Announcement

Collapse
No announcement yet.

Newbie Eathernet/IP Array to toggle ouput coil

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie Eathernet/IP Array to toggle ouput coil

    Hello first time poster, I'm fairly new to ladder logic, but I understand some basics. I've searched the forums but am unable to find an answer for what I'm after likely I don't know what I'm looking for

    I have a P2K(set as adapter) communication with an outside scanner(robot) I can see the data going back and forth in dataview based on robot i/o. When I Edit data robot updates correctly.

    If I toggle an output from Robot, then Array shows a value equaling I/0 group values, which is correct, but how can I use that data to turn I/O on the P2K on/off?

    In a simple example how do I use Array Data to turn coils on/off.

    TIA


  • #2
    You can access the Bit of Word component of any word by placing : after the tag name. Example: Robot Output I/O(1):1. This will access bit 1 of word Motor.

    Click image for larger version  Name:	2019-12-11_7-18-11.jpg Views:	0 Size:	10.1 KB ID:	127122

    Another option is to use the Unpack Bits instruction to take the word array element 1 Robot Output I/O(1) and break out the individual bits of a word.

    Click image for larger version  Name:	2019-12-11_7-23-38.jpg Views:	0 Size:	24.4 KB ID:	127123

    Comment


    • #3
      Originally posted by dnj View Post
      You can access the Bit of Word component of any word by placing : after the tag name. Example: Robot Output I/O(1):1. This will access bit 1 of word Motor.

      Click image for larger version Name:	2019-12-11_7-18-11.jpg Views:	0 Size:	10.1 KB ID:	127122

      Another option is to use the Unpack Bits instruction to take the word array element 1 Robot Output I/O(1) and break out the individual bits of a word.

      Click image for larger version Name:	2019-12-11_7-23-38.jpg Views:	0 Size:	24.4 KB ID:	127123

      Thank you Sir, that was much easier than I had it in my head, I was definitely overthinking it.




      Comment


      • #4
        Originally posted by Codeworx View Post


        Thank you Sir, that was much easier than I had it in my head, I was definitely overthinking it.



        You should have some sort of comms heartbeat to put the outputs into a 'safe-state' if comms fails.
        I do not have enough experience with EtherNet/IP to know if this already happens.

        Comment


        • #5
          Originally posted by kewakl View Post

          You should have some sort of comms heartbeat to put the outputs into a 'safe-state' if comms fails.
          I do not have enough experience with EtherNet/IP to know if this already happens.
          I do have a heartbeat monitoring setup on the robot side.

          I did run into odd behavior where the scanner output(robot) work as expected with bit toggling on/off, but when outputting from p2k (robot inputs) they only update when I restart the plc and the state dosent update with each scan. I can see the values updating correctly when I monitor.

          I have the logic in the "run every scan" task area

          Do i have add soem logic to force the bit status change? I would thing logically it should update each scan?

          Comment


          • #6
            Originally posted by Codeworx View Post

            I do have a heartbeat monitoring setup on the robot side.

            I did run into odd behavior where the scanner output(robot) work as expected with bit toggling on/off, but when outputting from p2k (robot inputs) they only update when I restart the plc and the state dosent update with each scan. I can see the values updating correctly when I monitor.

            I have the logic in the "run every scan" task area

            Do i have add soem logic to force the bit status change? I would thing logically it should update each scan?

            So to be clear on what is happening:
            The output is changing on the robot
            On the P2k, do you or do you not see the corresponding value change when looking at the array in Data View?
            On the P2k, do you or do you not see the value changing in ladder code when monitoring is on?



            The status monitor in ladder code only updates one or two times a second or something pretty slow. It is hard to catch things that change quickly. Dataview is faster, but still only like 20 times a second. Which could have anywhere from 5-10 scans going by between dataview updates.
            Are you sure the PLC is in run mode? I believe Productivity still has network comms going on even when in stop, but values dont update properly and ladder code doesnt run. So it can look like things are ok in some areas but nothing really works when the PLC is in stop.
            What time interval is set on your scanner for update rate (RPI)?
            Is the ethernet connection these devices talk on a dedicated line between each device? Or are they plugged into a main network with other stuff going on?



            Watch these videos too because they may have some info that may be relevant to your setup:
            https://youtu.be/FNGIgqi0AYQ
            https://youtu.be/OLmhO_iTYhw
            Last edited by MikeN; 12-12-2019, 09:37 AM.

            Comment


            • #7

              Output from Robot(Scanner) works 100%
              Input to robot from PLC(Adaptor) - Shows Correctly in Dataview, Dataview updates when flipping Inputs
              Input to robot from PLC(Adaptor) - Only Updates on Robot when restarting PLC (reads current status not "Live") Waiting for multiple scans


              PLC tested in Run mode
              RPI 150ms
              Peer to Peer with Patch cable (Tested Patch & Crossover made no difference)

              Click image for larger version

Name:	2019-12-12_0903.png
Views:	115
Size:	79.3 KB
ID:	127153

              Comment


              • #8
                Do you have an enable somewhere to turn on the connection that is maybe being turned on at first scan but not staying on?

                Comment


                • #9
                  Originally posted by MikeN View Post
                  Do you have an enable somewhere to turn on the connection that is maybe being turned on at first scan but not staying on?
                  I had this same thought after I replied and had a chance to check and double test everything. I sent an email of to Motoman, I will update once I hear back.

                  Comment


                  • #10
                    I was able to solve this.

                    Updating firmware on CPU, didn't solve my issue with the inputs updating when Robot was acting as Scanner, but it did fix issues I was having setting the P2K as the scanner, and robot as adapter (which was my original preference).

                    Happily communicating now.

                    Comment

                    Working...
                    X