News:

  • August 15, 2026, 07:02:55 AM

Login with username, password and session length

Author Topic: Native Comms for BRX  (Read 8250 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Native Comms for BRX
« on: April 18, 2023, 12:30:18 PM »
Is there by chance a way to natively communicate with BRX controllers using a standard library in something like C++ or Python over TCP/UDP. I'm thinking something akin to whatever is used in C-More to communicate using symbolic addressing. I'm thinking it would be nice to not have to map values and be able to use a PC to log to a database. If native comms isn't available, what's the closest thing to this?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Native Comms for BRX
« Reply #1 on: April 18, 2023, 12:45:28 PM »
Is there by chance a way to natively communicate with BRX controllers using a standard library in something like C++ or Python over TCP/UDP. I'm thinking something akin to whatever is used in C-More to communicate using symbolic addressing. I'm thinking it would be nice to not have to map values and be able to use a PC to log to a database. If native comms isn't available, what's the closest thing to this?

If you are OK with read only, the REST API is perfect for that. We will eventually be adding write access, but not until we can support HTTPS on the web server.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Native Comms for BRX
« Reply #2 on: April 18, 2023, 02:29:09 PM »
I've used pyModbus to write to the PLC. It works well. I'm sure there's similar available for C++. The reading can be done with either also with pyModbus or like BobO says, REST API into the python application.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: Native Comms for BRX
« Reply #3 on: April 19, 2023, 07:40:48 AM »
Is there by chance a way to natively communicate with BRX controllers using a standard library in something like C++ or Python over TCP/UDP. I'm thinking something akin to whatever is used in C-More to communicate using symbolic addressing. I'm thinking it would be nice to not have to map values and be able to use a PC to log to a database. If native comms isn't available, what's the closest thing to this?

If you are OK with read only, the REST API is perfect for that. We will eventually be adding write access, but not until we can support HTTPS on the web server.

I thought REST might be the answer. The Python requests module takes about 4 lines of code to get this to work. Initially I'm just targeting read only for data storage. With a little experimentation, it looks like requests are limited to about 128 DWords at a time. Is this correct?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Native Comms for BRX
« Reply #4 on: April 19, 2023, 02:41:14 PM »
I thought REST might be the answer. The Python requests module takes about 4 lines of code to get this to work. Initially I'm just targeting read only for data storage. With a little experimentation, it looks like requests are limited to about 128 DWords at a time. Is this correct?

128 is the max length for a single array reference. You can have multiple references per query. The other limitation is the total size of the response.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO