Announcement

Collapse
No announcement yet.

Fail Safe due to LAN connection

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


  • Fail Safe due to LAN connection

    Hi All,

    I connect my water tank and its sensors to PLC and it is working fine now. I connect the PLC through LAN port to my computer. Is there any way to detect LAN connection, so that if the PLC detect there is no connection from the LAN, my actuator valve and pump will be forced to close by the PLC. This is important, for example, by accident or by mistake someone in my lab take off the LAN cable, I want to stop the tank-PLC operation.

    Any help would be appreciated. Thank you.


  • #2
    What PLC do you have?
    I do an internet check every hour on a BRX very easily, and if the internet check fails I have it run a LAN check and then it will generate an alarm based on whether only the internet connectivity is down or if it is a local network problem.

    I have not done this on a Productivity or DL before though. Easiest in Do-More because you have very nice instructions ready to go for Ping that you can use. Ping a google DNS server for internet check, ping your local router for LAN check.

    I assume you can have a tag in Productivity that says whether the ethernet port is active or not. If you lose access on lan to the local switch it is plugged into that would tell you whether the lan is down or not.

    Comment



    • #3
      Hi MikeN,

      I am using P1000, P1-540.

      Comment



      • #4
        In the CPU module there is an "Ethernet Heartbeat Timeout Bit" that you should be able to use to know whether the LAN has a connective active or if it dropped.

        Comment



        • #5
          Hi MikeN,

          I tried something like this, but it only turned off the DO-0.1.2.7, because what I want to achieve is that when the LAN cable is disturbed then DO-0.1.2.7 must be turned ON, and if the LAN Cable works normally then DO-0.1.2.7 must be turned OFF.

          I tried the "Ethernet Heartbeat Timeout Bit" Click image for larger version

Name:	Capture7.JPG
Views:	85
Size:	21.9 KB
ID:	125085

          Comment



          • #6
            RE: Ethernet heartbeat help topic P282 - Options Tab Configuration bullet point (m)
            This bit only applies when the CPU ports are being used as a slave device and only monitors the time between the communications from the master device.
            When you do design a viable method for detecting a disconnected ethernet cable, use a timeout to minimize nuisance tripping.

            Comment



            • #7
              If the timeout bit only works in some situations then maybe the port ready bit along with a timer could be used to detect a timeout. Normal traffic on a PLC has periods between activity where the ready bit will be on, so if the ready bit stays off for maybe 2-3 seconds straight then it could be assumed that the cable is not connected

              Comment



              • #8
                It seems that bit of testing will be needed.
                will 'port ready' be true if the plc is only connected to a switch? Or does there need to be a src/dst comms device?
                hopefully an ad tech will chime in.

                Comment



                • #9
                  I just looked at my test bench and "port ready" does sit on when the PLC is only connected to a switch and there is nothing at all set up for com traffic.

                  Comment



                  • #10
                    Hi,

                    Thank you for your comments.

                    I also tried something like this. But is only turn on the DO-0.1.1.7 and the DO-0.1.1.7 stays ON when I unplugged the LAN Cable. So is it possible to do Fail-Safe operation only by using 1 PLC connected to PC without slave? I know that there is a tutorial on how to do Master-Slave PLCs and one of them checking the connection to the other.

                    Click image for larger version

Name:	Capture8.JPG
Views:	72
Size:	30.4 KB
ID:	125098

                    Comment



                    • #11
                      I just checked and the tag does not go off when the cable is unplugged. So that bit must not be monitoring whether the port is active, but only whether something is sending data over the port or not, or is simply broken, or only works when in slave mode still. So I guess you are SOL on a tag that monitors cable status/port active status.



                      Also I was noticing in your code that you are using set, rst, and out on the same physical output. You cant do that in a real program if you were not aware.

                      Comment



                      • #12
                        Can you have a program/service on the PC that periodically writes to the plc?
                        You could use this as a heartbeat to confirm the PC is actually connected to the PLC - and not just some intermediate device(switch et al.) that is maintaining an 'empty' connection

                        it is not that difficult to make a vb program (maybe even .vbs script) to write a modbus frame to your PLC.

                        [update]
                        I have tried doing the in vbscript. Failed every time.
                        I have tried running CMD as admin, specifying the regsvr in the win...wow64 folder
                        tried using C:\Windows\SysWOW64\cscript.exe to run the script
                        I tried using MS winsock and ostrosoft winsock.
                        The script fails to create object every time.
                        Last edited by kewakl; 09-12-2019, 06:48 AM.

                        Comment



                        • #13
                          Or if you have a network switch with EtherNet/IP or ModbusTCP support in the switch (like an EDS-408A-EIP for example) you could do a read instruction and read any memory address, if the instruction fails then you can say the connection is down. If you get a success bit back then the connection is good.

                          Comment



                          • #14
                            Originally posted by MikeN View Post
                            Or if you have a network switch with EtherNet/IP or ModbusTCP support in the switch (like an EDS-408A-EIP for example) you could do a read instruction and read any memory address, if the instruction fails then you can say the connection is down. If you get a success bit back then the connection is good.
                            That only indicates that the PLC can communicate with the switch, not the PC.

                            Comment



                            • #15
                              Originally posted by MikeN View Post
                              I just checked and the tag does not go off when the cable is unplugged. So that bit must not be monitoring whether the port is active, but only whether something is sending data over the port or not, or is simply broken, or only works when in slave mode still. So I guess you are SOL on a tag that monitors cable status/port active status.



                              Also I was noticing in your code that you are using set, rst, and out on the same physical output. You cant do that in a real program if you were not aware.
                              Hi MikeN, I am new to Ladder Logic. What is the more appropriate way of doing switch ON and OFF the physical port? It works for another case, not this fail-safe case when I apply the code to my P-540.

                              Comment

                              Working...
                              X