Home Programming

Discussion

Left ArrowBack to discussions page
arnoldgaugearnoldgauge Posts: 10 Apprentice
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.

Comments

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,131 Handy
    I can’t say I’ve seen that behavior as we have done similar things in the past to have multiple robots running together. 

    Do you have a thread on robot 1 that is setting the value back to 0 unless it’s ready to set it to 1. Also, how would the server/master know when all slaves have completed their tasks?  

    What I’ve done in the past is each slave had a dedicated register or coil on the master which was an input to the master. Then once all slaves were complete the master would set an output coil or register which all robots were listening for to tell them to advance to the next task thereby keeping all the robots in sync. 

    Another way is to give each robot a single bit on the register but they need to keep the current value of the register which you could then convert to a Boolean list so the robot only sets the bit it has control over and then writes the full value back to the output. 

    I would think you’d want the master to set another status bit or register that then each slave would acknowledge by setting the register bit back to 0, when the value is back to 0 the master would turn off the handshake. 
  • arnoldgaugearnoldgauge Posts: 10 Apprentice
    I can’t say I’ve seen that behavior as we have done similar things in the past to have multiple robots running together. 

    Do you have a thread on robot 1 that is setting the value back to 0 unless it’s ready to set it to 1. Also, how would the server/master know when all slaves have completed their tasks?  

    What I’ve done in the past is each slave had a dedicated register or coil on the master which was an input to the master. Then once all slaves were complete the master would set an output coil or register which all robots were listening for to tell them to advance to the next task thereby keeping all the robots in sync. 

    Another way is to give each robot a single bit on the register but they need to keep the current value of the register which you could then convert to a Boolean list so the robot only sets the bit it has control over and then writes the full value back to the output. 

    I would think you’d want the master to set another status bit or register that then each slave would acknowledge by setting the register bit back to 0, when the value is back to 0 the master would turn off the handshake. 

    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.
Sign In or Register to comment.
Left ArrowBack to discussions page