News:

  • August 23, 2026, 04:20:18 PM

Login with username, password and session length

Author Topic: Simulator with Modbus  (Read 6023 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Simulator with Modbus
« on: March 19, 2020, 06:39:49 PM »
I'm currently developing a program that uses staging to read a number of Modbus TCP registers on on a remote device. I'm developing in simulator, but I've found that after the simulator times out or if I transition from stop back to run the simulator will not reestablish connecting with the device and I get the "Operation timed out" error. In order to get the program to reestablish connection with the Modbus device I have to exit the simulator and reopen it. When I do, the simulator communicates with the device without issue. When trying the same code on actual hardware, I have no issue with a stop to run transition. Is this a bug or limitation of simulator?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Simulator with Modbus
« Reply #1 on: March 19, 2020, 06:55:39 PM »
If you are using Stage, definitely open the Project Browser to the code-block with all the stages (could be $Main or something else).  Turn All Status ON.  This should highlight the code blocks that are currently running in the PLC, along with what Stage are active (they will be highlighted in CYAN, like contacts).

This should help debug the "high level" control.  So, go to RUN, then go to PROGRAM, then back to RUN and see what your code blocks and stages do.

If the code block with the stages is not CYAN, or if the specific stage that has Modbus instructions are not CYAN.  The stages may flash quickly if they are working correctly and transitioning, but the stages may "hang" and remain CYAN if the Modbus instructions are timing out.

You get instruction level status in Ladder View, but the Project Browser status definitely helps you with the "high level" control debugging.