Announcement

Collapse
No announcement yet.

MODBUS Receive Instruction - Only First Works

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MODBUS Receive Instruction - Only First Works

    I have two modbus receive instructions. Both only get one register from the same device. The destination addresses where the data is stored are not sequential (DF1, DF21) so I'm doing two instructions. If I add them both to the positive differential _1sec_Clock to poll, only the first one works. Meaning, first in the ladder. The second never executes. If I set the second to the negative differential on the _1sec_Clock then they both work. Problem is I now need to get a third (and fourth and so on) register, but I've ran out of options to trigger the poll. So question is "How do I poll two registers with a Receive instruction that are not sequential from the same device?"

    This does not work. When setup this way, the device never sees the second request for data. Is there a better way to set this up?
    Click image for larger version

Name:	ClickReceiveNoWork.png
Views:	46
Size:	26.6 KB
ID:	128973

    This does work
    Click image for larger version

Name:	ClickReceiveDoesWork.png
Views:	47
Size:	29.7 KB
ID:	128972
    Attached Files

  • #2
    It is all about the timing of the communication. I would use the status flags from the Receive or Send instruction to trigger the next communication.
    Here is an example:
    Click image for larger version

Name:	Click Modbus Timing.png
Views:	60
Size:	43.3 KB
ID:	128980

    This was taken from the following post:
    https://accautomation.ca/click-plc-a...communication/

    The other way to do this is through a shift register and time, but this is the better way.

    I hope this helps you out.
    Regards,
    Garry
    _________________________________________________
    Garry
    ACC Automation
    https://www.accautomation.ca
    Connect with us on Facebook: facebook.com/accautomation/

    Comment


    • #3
      Normally, you would interlock the comms instructions.
      You have timed them by about 1/2 second.
      Maybe your device cannot handle the queries in the first configuration.

      You could run a timer that triggers a counter. On every up count, trigger one of the receive instructions.
      You could use the success of 1 to trigger the next - but I prefer a little bit of time between reads.

      Look at g3 durapulse manual CH5 PG23 .. for a click setup to talk with a G3 drive. It should give you ideas. (my manual is 05/2013 revD - in case the page numbering is off)
      It may be a bit of overkill for your application, but the procedure is there.

      Comment


      • #4
        Thanks for the replies Garry and kewakl. These are exactly what I needed. The exact problem was the requests were happening too fast in sequence. I used the basics of Garry's setup and added delays. I only wanted it to poll every 10 seconds anyway. Now it kicks off every 10 seconds and polls perfectly.

        Comment

        Working...
        X