Locke (Customer) asked a question.

Click PLC Modbus TCP communication to Universal Robot

Hello - I am trying to use the receive & send instructions in the CLICK programming software. I am attempting to communicate with my Universal Robot, which has a Modbus TCP server. I believe I have the correct IP address, port #, slave address, etc. entered into the instruction. To start, I am just trying to read the status of a coil. The receive instruction has a receiving flag, which goes high at first, then the error flag goes high. Here is the UR help page:

 

https://www.universal-robots.com/articles/ur/interface-communication/modbus-server/

 

Any help would be greatly appreciated!

 


  • Locke (Customer)

    Figured it out! You're going to love this... I changed the IP address of the robot from 192.168.0.20 to 192.168.0.175, updated my receive instruction in the ladder as such, and I got successful receives! I don't have any other devices on the network that are 20, so not sure what was going on here, but glad I tried that! I appreciate your help along the way!

    Selected as Best
  • Todd Dice (Customer)

    1. Click PLC part number is helpful.
    2. If you can, attaching your PLC code give others a chance to diagnose any addressing issues because as your attached link points out:

     

    - The MODBUS Server has 0-based addressing. Be aware that some other devices are 1-based (e.g. Anybus X-gateways), then just add one to the address on that device. (e.g. address 3 on the robot will be address 4 on the Anybus X-gateway)

     

    So you may have to play around with the MODBUS addressing in the Click to gain a successful read/write.

    Expand Post
  • Locke (Customer)

    Hi Todd - Thank you for the response, I've attached my project file. Please see "Stacklight" sub-routine for receive and send instructions. I am also using a C0-11DD2E-D PLC. Please let me know if I can provide anything else. I appreciate your help!

    -Mike

    • Todd Dice (Customer)

      Locke,

       

      The issue I see is you're sending and receiving commands are operating simultaneously and you cannot do that.

       

      Go to this LINK and download communication example EP-COM-027 (halfway down page). Look it over to see one method to handle send and receive comms.

      Expand Post
  • Locke (Customer)

    Hi Todd - Thank you for the feedback. I downloaded the example program and made the necessary changes (port number flags, receive instruction setup, etc.). I'm still having trouble with it. All things aside, if I want to perform a single receive instruction, why would the attached program not work? Please see rungs in main program.

     

    I would think I could evaluate to make sure the port is ready and poll it every 0.5s using a timer as I have done. I am still receiving an error unfortunately. I would like to successfully receive a single piece of data and then scale up like the example program.

     

    Please let me know if you have any thoughts/ideas regarding this. Thanks!

    Expand Post
  • Todd Dice (Customer)

    An issue I see with your example is the normally open T10 is true for just one scan. For a test, change the address of T10 to SC6, which is an internal clock bit that's true for 250ms and false for 250ms.

    • Locke (Customer)

      I changed that NO T10 to SC7 (instead of SC6 so I could see the error flag of the receive instruction flash), unfortunately still no luck. Are there any other troubleshooting tools to see if the PLC is successfully finding/connecting to the robot's IP address? I'm just trying to think of ways to nail down if it's an IP address problem, slave address problem, etc.

      • Todd Dice (Customer)

        Well, I am stumped, so I did some digging into two projects I did with two UR5s communicating with a Productivity 2000 over Ethernet with implicit messaging. The I/O was all 8-bit unsigned integers. So, I "think" this is the problem. You'll have to play around with data types to figure out which one will communicate without error. Sorry I could not be more helpful.

         

        If Garry sees this thread he may have the answer.

         

        Also, found this thread from the forum:

         

        https://community.automationdirect.com/s/question/0D53u00002JDkv5CAD/issues-with-click-plc-modbus-tcp-receive-command

         

        Expand Post
      • Locke (Customer)

        Figured it out! You're going to love this... I changed the IP address of the robot from 192.168.0.20 to 192.168.0.175, updated my receive instruction in the ladder as such, and I got successful receives! I don't have any other devices on the network that are 20, so not sure what was going on here, but glad I tried that! I appreciate your help along the way!

        Selected as Best
      • Todd Dice (Customer)

        I was going to ask about confirming the IP address, but thought asking it was similar to, "is it plugged in?" 😂