News:

  • June 28, 2026, 12:30:55 AM

Login with username, password and session length

Author Topic: Using the Modbus protocol how do I read if a DM is in run mode?  (Read 7093 times)

Henryp

  • Hero Member
  • *****
  • Posts: 161
I have a rung of code looking to see if DST10 is equal to 3 which turns on a Modbus output coil. However when I place the DM in program mode the Modbus coil remains on. I assume it is because the ladder is no longer running. So how do I read if a DM is in run mode?


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Using the Modbus protocol how do I read if a DM is in run mode?
« Reply #1 on: August 28, 2017, 06:40:00 PM »
You can use the $LastScan block to execute code as the PLC is going to program mode.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3612
  • Darth Ladder
Re: Using the Modbus protocol how do I read if a DM is in run mode?
« Reply #2 on: August 28, 2017, 07:27:37 PM »
You can also look at a clock bit and see if it keeps toggling.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.