AVand (Customer) asked a question.

Serial (RS-485) Comms Sequencing- help understanding Modbus Write timing and sequencing.

I have 15 VFDs which need to be controlled using Modbus-RTU over RS-485. I plan to sequence a Modbus Write command to each successive drive, over and over. The command word (i.e. the Register being sent to the drive) can be changed to reflect a start or stop command.

 

I planned to use the "Sequencer" instruction, to trigger a "Write to VFD1, "Write to VFD2" etc command, whereby "Write to VFD1" is the enable for the Modbus Write to VFD1. I figured the "Complete" bit for each Modbus Write instruction would be the "Event" flag to move to the next step in the sequencer.

 

Unfortunately this method didn't seam to work, with many timeout errors occurring. To rule out other configuration issues, I changed the next step condition from event to duration, set at 500ms, and it worked fine.

 

It makes me realise I don't quite understand how the Modbus Write block works (despite reading the section of the manual). If the "Enable" stays ON, does the Write instruction run over and over, thereby only resetting the 'complete' flag for a fraction of a cycle, to be missed by the sequencer? This is how I interpreted the manual. Is there a way to make the 'write' only happen once per enable?

 

Any help would be greatly appreciated.


  • ADC_TechnologyGroup_06 (AutomationDirect)

    Good morning, a couple of questions to help clarify:

    1. Which model PLC are you using? e.g. P2-622, P3-550E, P1-540, etc.
    2. Which Modbus Write instruction are you using? MWX or MBUS-Write which relates to which PLC you've chosen for the project and the behaviors are similar but not exactly the same.
    3. In either MWX or MBUS-Write, have you enabled Auto Polling?
      1. If yes, then the behavior you describe where the Write instruction will run over and over and the 'Complete' bit only setting for a fraction of a cycle is possible to be missing by the Sequencer especially if you have very fast Auto Poll rate enabled and the Write queues up which may be serviced between logic scans.
      2. If no, then it should behave and write only once per trigger like a one shot instruction.

     

    Please let us know a few of these details to help understand the issue, and thank you!

    Expand Post
  • AVand (Customer)

    Thanks for the reply.

    I am using a P1-550, and the MWX command.

     

    Through further trial and error, I've got the following progress and I'm interested to know if you agree or have any better ideas:

    I believe the "Complete" flag stays active until the enable of the MWX is active again, so the sequencer was skipping the next MWX cycle- I presume because as soon as it gets to a step, the "Change on Event Condition" was active, so it moved onto the following step before another MWX was even started. I'm now using the "Sequence Done" tag to clear all MWX Complete flags, before starting the sequence again.

    Even with the Complete flag required to move to the next MWX step, I was getting many many timeouts. I have since changed the Sequence "Change on Event" to be "Event + Duration", and through trial and error, 50ms is given no timeouts. At this point I can probably make the Change to be purely 50ms and not worry with all of the additional "Event" tags, thought at least if one takes longer for some reason it wont get skipped.

     

    Expand Post
    • ADC_TechnologyGroup_06 (AutomationDirect)

      Thank you also for the information; sometimes it's just good to know exactly which PLC and instruction is in question. It's good news that you've found a way to handle this setup. I believe your observation is correct in that the Complete bit stays high until the next time the instruction is active, so clearing those status bits with the Sequencer.Done would be a viable way to handle starting the sequence again.

       

      The timeout issue is going to revolve around your baud rate and how much data you're writing to each VFD. So cumulatively there's time to transmit the query from PLC to VFD (e.g. at 9600 baud it's about 1ms per character transmitted), time on the wire, time for the VFD to process the message, time for VFD to transmit the response on the wire, time for PLC to process the response (Scan Interval), and then it's time to send the next message to the next drive. Depending on how you're set up with baud rate and message size that sum could easily exceed 50 msec per drive.

       

      Help Topic P195 on Communication Port Configuration has a diagram that illustrates this serial communication timing in general terms for the Modbus Timeout between Data Query and Response (default = 500 msec):

      image

      Expand Post