| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 18/02/2011 04:29:28
|
pentavalle
Initiate
Joined: 01/02/2011 05:45:33
Messages: 9
Offline
|
Just taking a look at 1.13 release in CVS, I have seen that ModbusFactory.createRtuMaster and ModbusFactory.createAsciiMaster now requires an int "concurrency" parameter.
This parameter could be SerialMaster.SYNC_TRANSPORT, SerialMaster.SYNC_SLAVE or SerialMaster.SYNC_FUNCTION and modify the behaviour of SerialWaitingRoomKeyFactory.
What's the difference between those 3 values?
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 20/02/2011 12:31:17
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1850
Offline
|
This parameter tells Modbus4J at what concurrency level it needs to operate. This is for when you have multiple threads using the same modbus master to send requests. (Note that Modbus4J doesn't handle the multi-threading for you. You still need to do that yourself.)
For example, one thread may be sending requests to slave 1, and another to slave 2. You can send both requests at the same time and have each slave generate the response concurrently, which is more efficient then sending them serially. To do this, you should set your master concurrency level to SYNC_SLAVE.
Does this make sense?
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 21/02/2011 04:21:28
|
pentavalle
Initiate
Joined: 01/02/2011 05:45:33
Messages: 9
Offline
|
Good improvement!
Looks like SYNC_FUNCTION syncs on slaveId and functionCode, so both must be different to send a concurrent request, and SYNC_TRANSPORT doesn't allow to send concurrent modbus requests, like before.
Please correct me if I'm wrong.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 21/02/2011 12:03:17
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1850
Offline
|
You are correct.
|
Best regards,
Matthew Lohbihler |
|
|
 |
|
|