So, I have a PLC which will be communicating to a lot of devices using modbus TCP. I know how to instance the block to create connections. I am curious what the typical convention is for using it.
Here are the ways I'll be using it:
Pulling (not necessarily sequential) blocks of data from devices regularly
Writing (not necessarily sequential) blocks of data to devices regularly
Pulling data irregularly
I understand the different modes, and register ranges and such. However, the process of opening connections is confusing to me.
I believe I should open one connection per device and I shouldn't really have to close it presuming the ID is unique. Am I wrong? Is there benefit is disconnecting connections if I'm continuously trying to pull data?
Further, I'm trying to using Siemens S7 (TIA14). There is a MB_Client block which produces a bunch of status. I imagine it isn't a good idea to pull the target every scan of the PLC, so is there some convention for managing how the block is executed? ie, is there a waiting for data status / time out and an example program that may help demonstrate how to use this block conventionally? Or do you stick it in an interrupt block and cross your fingers? I found a few examples online, but I'm unable to convert from anything older than TIA13_SP1.
Thanks!
Here are the ways I'll be using it:
Pulling (not necessarily sequential) blocks of data from devices regularly
Writing (not necessarily sequential) blocks of data to devices regularly
Pulling data irregularly
I understand the different modes, and register ranges and such. However, the process of opening connections is confusing to me.
I believe I should open one connection per device and I shouldn't really have to close it presuming the ID is unique. Am I wrong? Is there benefit is disconnecting connections if I'm continuously trying to pull data?
Further, I'm trying to using Siemens S7 (TIA14). There is a MB_Client block which produces a bunch of status. I imagine it isn't a good idea to pull the target every scan of the PLC, so is there some convention for managing how the block is executed? ie, is there a waiting for data status / time out and an example program that may help demonstrate how to use this block conventionally? Or do you stick it in an interrupt block and cross your fingers? I found a few examples online, but I'm unable to convert from anything older than TIA13_SP1.
Thanks!