Can I periodically ping a PC then view in PLC?

g20kid

Member
Join Date
Sep 2012
Location
Charleston
Posts
7
It's not entirely PLC related, but I know there are a bunch of computer gurus on here. I have a computer running as a server for some of our IP cameras. It typically only functions when a client computer is first booting up, as it will then authenticate the client and provide the appropriate permissions. From there the clients pull video straight from the NVR. Since it only gets used when the program on the client machine starts, it is possible for the server to crash and we won't know about it until we have an issue with a client. And this will happen at 3am.
This lead me to try and find a way to periodically ping the server (say, once an hour or so) and get an output file from there into a controllogix PLC. From there I can get an alarm to display on an HMI to alert us. Any ideas on how I can accomplish this? Thanks for any help. If you are able to help, I will add your name to the alarm. "Video Server Crash: Thank you John Doe"
 
It's a regular Windows 7 PC. I can add hardware if necessary, but would ideally have a software solution. It's not very close to our PLCs, so running a wire there would be difficult.
 
I am thinking maybe something like advanced hmi, never worked with it but I have used FTView and pushed data to my plc through VBA, I am wondering if advanced hmi can do similar, I know it has a .Net backend and built in AB drivers so it should be feasible and I think it's 100% free.
 
AdvancedHMI would be a good solution. I think there is even a user added ping control.

I could probably help you with a simple python script that could be scheduled with Windows Task Scheduler that would do it too. Pinging is easy and so is writing to your CLX. If you want to go that route, let me know....
 
What HMI software system do you use ? Does it use OPC DA data servers ? Does it have drivers for SNMP or other management protocols ?

One method you might use is an OPC server on the video server computer that monitors the tasks or services the video functions rely on. The HMI can then get the status of the video software over OPC.

https://www.matrikonopc.com/opc-drivers/842/index.aspx

If your ControlLogix has a 1756-EWEB or a 1756-EN2T/EN3T you could use the raw socket services to "ping" the video server using a TCP or UDP connection. If you know the TCP port that the video server uses, for example, your TCP connection request could verify that particular port is open and responsive.
 
Disregard

After reading Ken's post, I don't think I understood the task at hand. Unless the HMI was a PC, then my solution was silly.
 
Last edited:
Actually once I got a beer in my system, I had an idea. I could help you with a python script that you could run on your server that would write a value to the CLX tag, say switch form 0 to 1 periodically. In the CLX, if it stopped changing, then there is an issue with the server and you could alarm. It would only take a few lines of code, you could schedule it to run when your server starts. Just a thought...
 
Actually once I got a beer in my system, I had an idea. I could help you with a python script that you could run on your server that would write a value to the CLX tag, say switch form 0 to 1 periodically. In the CLX, if it stopped changing, then there is an issue with the server and you could alarm. It would only take a few lines of code, you could schedule it to run when your server starts. Just a thought...

I'd be interested in that script...
 
Champion! Thanks Dustin 🍺

Ok, here's what you would do:

Install Python 2.7.13 https://www.python.org/
Download pylogix https://github.com/dmroeder/pylogix
Create a new python file(.py)(if you need help with that, let me know)
Save the following code in the file (save it in the same directory as pylogix):

Code:
from eip import PLC
import time

with PLC() as comm:
    comm.IPAddress = '192.168.1.20'
    while True:
        comm.Write('BaseDINT', 1)
        time.sleep(0.5)
        comm.Write('BaseDINT', 0)
        time.sleep(0.5)

You'll have to replace the IP address that I had with your PLC's address. Replace 'BaseDINT' with the tag name that you want to write to. If you want to adjust the interval to write, change the value in time.sleep(). It is in seconds, so the example above is 1/2 second.

Keep in mind, there is probably a lot that can be done to improve here, just starting off simple.
 

Similar Topics

I have an 1100 that I am using mainly as a protocol converter. It Talks Modbus RTU on channel 0 and is connected to a large management system on...
Replies
4
Views
8,263
Hi Any one know how i can clear this fault? Cpu run led turn on for a second then red fault led turn on for a second then cpu restart and all...
Replies
11
Views
4,457
I have a CLX messaging to both CLX's and SLC's. I have discovered that the Read messages originating in the CLX stop reading about every 60...
Replies
12
Views
5,213
Hi, I am new to ladder logic. I have completed a code in the Xinje PLC XC3-32RT-E for one of the machines I am developing. Currently the program...
Replies
10
Views
131
Hey guys, the scenario is: I have already completed the drawing package for my system utilizing an A-B 440R-N23126 (Minotaur) safety relay. SoS...
Replies
0
Views
101
Back
Top Bottom