The CRBasic help states:
Beginning with OS version 28, multiple ModbusMaster instructions can be used in one program, as long as each is run in a separate sequence (e.g., Main scan and slow sequences).
Is this limitation still in place?
No. You can run multiple ModBusMaster() instructions in a single sequence.
Thanks, just wanted to be sure.
Folowing up, if the two ModBusMaster commands are going out on different serial ports (or TCP ports) will the logger run them in parallel or one after the other?
They run sequentially (in order).
If I put the two ModBusMaster commands in two separate slow sequences, using pipeline mode, will they run in parallel?
They will not run in parallel.
One sequence will run after the previous one finishes.
That's disappointing. This portion of the helpfile made me hopefull that some parallelism would be possible.
If multiple ModbusMaster instructions are used in a program, and these instructions use the same ComPort, use the SemaphoreGet/SemaphoreRelease instructions to prevent the instructions from attempting to use the communications hardware at the same time.
Are the semaphores then no longer necessary?
With that question still left hanging, another has popped up:
Will the logger leave the required pause of 3.5 character durations or more between the end of one Modbusmaster exchange to the beginning of the next?
I would like to raise these questions again:
1) Is any kind of parallelism possible with modbus requests? If so, how can it be done? If not, why are semaphores suggested?
2) Will the logger leave the required pause of 3.5 character durations or more between the end of one Modbusmaster exchange to the beginning of the next?
This post is under review.