Home› Programming
Discussion
Back to discussions page
arnoldgauge
Posts: 17 Handy
Modbus Register Input/Output |
317 views
|
Answered | |
/ Most recent by arnoldgauge
in Programming
|
2 comments |

in Programming
I have an application with 2 robots and several other devices using Modbus TCP/IP. I'm using Robot #1 as the Modbus Server. All devices need to be able to update a register in Robot #1 for handshaking purposes. The functionality I'm trying to implement is for all devices to look at that register, and if it a certain value, complete their current cycle then stop.
If I set the address to a "Register Input" on Robot 1, Robot 1 can't update the value. However, if I set it to "Register Output", it will keep the value to the last value it knows on ALL devices. For example, if the value is 0 and another device sets it to 1, Robot 1 (the server) will immediately overwrite it to 0 again. In effect, preventing other devices from changing it.
Maybe I've been lucky/lazy. But on other devices I've used in the past, if I set the address to output on both sides of the communication, it works as expected. I.E. either side can change the value and the last message is honored on both devices.
Is there a way to make UR act as I expect, or do I have a misunderstanding of how Modbus works? Running the latest 5.9 on several UR5Es. Running Integration-Objects OPC->Modbus on my Windows PCs.
If I set the address to a "Register Input" on Robot 1, Robot 1 can't update the value. However, if I set it to "Register Output", it will keep the value to the last value it knows on ALL devices. For example, if the value is 0 and another device sets it to 1, Robot 1 (the server) will immediately overwrite it to 0 again. In effect, preventing other devices from changing it.
Maybe I've been lucky/lazy. But on other devices I've used in the past, if I set the address to output on both sides of the communication, it works as expected. I.E. either side can change the value and the last message is honored on both devices.
Is there a way to make UR act as I expect, or do I have a misunderstanding of how Modbus works? Running the latest 5.9 on several UR5Es. Running Integration-Objects OPC->Modbus on my Windows PCs.
Tagged:
There are a number of threads, but nothing that reads or writes the modbus registers in question. Each slave has an individual "running vs stopped" register that the master uses to monitor the slave's status.
My goal was to have a single register that anyone can set (master or slave) to gracefully shutdown the entire system. Kind of like a public bus, where anyone can pull the "stop requested" rope and the bus driver will stop the entire bus. (Sorry, my analogy isn't the best here). Once the master knows each slave is idle, it is safe to go onto the next step or stop the entire process.
I was able to create some additional registers and get my system working similar to your suggestion, it wasn't a big deal. It just appears that if UR is acting as a modbus master, there can only be 1 device defined as an Output in the entire system for the register. All others must be defined as Inputs.
Just different than I expected. If I'm controlling a SMC or Festo pneumatic cylinder via Modbus for example, I can have multiple devices connected to the same register. Any of the devices can send an output (or read the value), and the most recent value is the updated on all devices.