MODBUS output switch off when program not running

Dear,

I send a control signal via MODBUS to an external device. This can be either high or low, depending on what I want to do in my program. So it does change state during normal operation. However, if the robot switches this output to TRUE during normal operation and then for some reason drops into an error state, the program stops, but the output remains at TRUE, which causes mayor problems. I need the MODBUS signal to be forced off if the program is NOT running, but can be either on or off during program operation (which is not the same as having a MODBUS signal active if the robot program runs, as in other threads on this forum).

Regards,

Max

The IO’s are writen with the program running, if the program stop for any reason, the outputs will not become FALSE by default. Unfortunably the UR programs doesn’t behave as a regular plc.

Cheers

Ok, thanks. I was afraid so…

Would be a nice safety feature, though

You can set the modbus runstate dependency. There are options just like for digital outputs. You can set the signal to be low when not running. This will force the output to False anytime the program stops executing (includes pause, protective stop, etc)

I know you can set this with script and it may be possible from the pendant, we mainly use script so my Polyscope is a bit rusty.

Here is an excerpt from the script manual

modbus_set_runstate_dependent_choice(signal_name, runstate_choice)
Sets the output signal levels depending on the state of the program (running or stopped).

modbus_set_runstate_dependent_choice(“output2”,1)

Parameters
signal_name: A string identifying an output digital signal that in advance has been
added.
runstate_choice: An integer:
0 = preserve program state,
1 = set low when a program is not
running,
2 = set high when a program is not running,
3 = High when program is running and low when it is stopped.

Example command:
modbus_set_runstate_dependent_choice(“output2”, 3)
• Example Parameters:
– Signal name = output2
– Runstate dependent choice = 3 ! set low when a program is stopped and high when a program is running

Ah thank you!

This is what I was looking for.

I’m assuming that this only works with MODBUS digital outputs and not register outputs?

Along those lines has anyone come up with a good way to 0 a register output when the program is not running or if a fault occurs?

We’re using an IO breakout that uses input registers instead of single bit coils therefore I can’t use the Digital Output selection.

It can also be done in the settings of the UR under I/O options.
Roughly something like:

  • program robot > installation > I/O,
  • then scroll all the way down to the modbus I/Os and set the options there.

you could Zero the register in your PLC program then the output would only be ‘ON’ for one scan if the modbus drops