Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Multiple Modbusmaster commands


Anton Jan 27, 2017 09:40 PM

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?


GaryTRoberts Jan 27, 2017 10:05 PM

No.  You can run multiple ModBusMaster() instructions in a single sequence.


Anton Jan 27, 2017 10:07 PM

Thanks, just wanted to be sure.


Anton Feb 19, 2017 09:22 PM

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?


JDavis Feb 21, 2017 05:36 PM

They run sequentially (in order).


Anton Mar 23, 2017 08:53 AM

If I put the two ModBusMaster commands in two separate slow sequences, using pipeline mode, will they run in parallel?


JDavis Mar 23, 2017 02:51 PM

They will not run in parallel.

One sequence will run after the previous one finishes.


Anton Mar 23, 2017 03:03 PM

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?


Anton Mar 28, 2017 07:24 PM

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?


Anton Apr 22, 2020 08:00 PM

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?


Anton May 29, 2023 12:51 PM

Micklemiles Jun 12, 2023 12:01 PM

This post is under review.

Log in or register to post/reply in the forum.