Cannot shutdown the robot via modbus

Hi! I want to stop the robot sending a communication via modbus, but I don’t see any register able to do this. Is there any way to shut it down using modbus? Thanks

You could create a Thread that monitors a modbus signal and calls the halt command when it is in a certain state. If you are setting up the Modbus signal via the Installation → FieldBus page; once you create the signal you can find it in the Installation → General → IO Setup and you can select the Action of the Modbus signal. This only works for a Digital Input though, not a Register Input.

1 Like

Hi,
You can’t shut it down the robot throw fieldbus.
You can do it with digital signals throw the REMOTE connector of the control box.
You can do it throw an Ethernet socket sending a specific command to the DASHBOARD port 2999

In the Technical Articles web, you can search by a specific concept as DASHBOARD and find some related articles: Articles | Support site | Universal Robots

Thanks, I think I have created correctly, but how can now send the data there?

I have this python code, but is for registers:

client = ModbusClient(‘dockursim’, port=502)
client.connect()
client.write_register(1, 3)

I can not speak for which library you are using but there is usually a “Write Coil” instead of “Write Register” option as well.

1 Like

I am programming in Python, just in case you know how to execute write_coil in python.

Hi, I have tried this command in python:

client.write_coil(1,True)

And is not stopping the program, should I write to register Modbus_d instead of 1? Not sure what coil I have to write to

You have configured input on robot client that should connect to remote modbus server. So you need to run modbus server on remote machine.
Alternatively you can use one of the spare digital outputs on internal UR modbus server (addresses 16-31 for standard, and 136-143 configurable outputs) and change state with remote client (client.write_coil(31, True))
Refer to modbus server descritpion: Modbus Server - 16377 | Universal Robots Support

I have no chance to stop the program with a digital output

I only have that option with a digital input, anyway I’m not able to make it stop

What I mean is use internal modbus server and create modbus signal reading internal digital output register (register 23 is digital output 7)

So, just following your example, I will need to write_coil(7,True)?

I have the following configuration:



Where the signal created should stop the program that is running in the robot.
But I cannot make it stop with write_coil(23,True) neither write_coil(7,True)

Any suggestions?
Thanks

What device are you using to communicate with the Robot? What network settings have you setup for the robot and the device?

I’m using modbus to communicate, in python. The robot is running in a docker container and I’m reaching it from another different container deployed in the same network. But I have just changed the configuration I sent in the previous message, otherwise I can read the register with this line:
client.read_holding_registers(128, 1)

I’m also able to write the normal registers. The only one that isn,t working is the one to stop the program

The first question is whether it is actually toggling the signal first. Can you see the input change between True and False? or does it stay in the same state no matter what you have tried sending?

I guess it changes:

And after:

Alright then if you create a short program to test it out, lets say just put in a wait command for however long and let the main program loop forever, when you toggle that signal it should stop the program.

I can make it stop with an if:

But not directly with just a single loop:
image

It is resolved now, the problem was that the Digital Input was kept in true and I was starting the program again without changing it to false.

Thanks for your help!

1 Like

Robot27 made a product to do this, if you want to avoid the headache to setup in the future: