You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old June 16th, 2017, 04:08 PM   #1
g20kid
Member
United States

g20kid is offline
 
Join Date: Sep 2012
Location: Charleston
Posts: 7
Can I periodically ping a PC then view in PLC?

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"
  Reply With Quote
Old June 16th, 2017, 04:14 PM   #2
labeledas
Member
Canada

labeledas is offline
 
labeledas's Avatar
 
Join Date: Apr 2010
Location: Peace River Alberta
Posts: 480
what is the model on the server can you add hardware to it what distance is it from the plc
  Reply With Quote
Old June 16th, 2017, 04:35 PM   #3
g20kid
Member
United States

g20kid is offline
 
Join Date: Sep 2012
Location: Charleston
Posts: 7
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.
  Reply With Quote
Old June 16th, 2017, 04:39 PM   #4
labeledas
Member
Canada

labeledas is offline
 
labeledas's Avatar
 
Join Date: Apr 2010
Location: Peace River Alberta
Posts: 480
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.
  Reply With Quote
Old June 16th, 2017, 05:23 PM   #5
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,879
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....
  Reply With Quote
Old June 16th, 2017, 05:28 PM   #6
Mark-
Lifetime Supporting Member
United States

Mark- is offline
 
Join Date: Nov 2008
Location: Texas
Posts: 616
Hello,

PeakHMI has a Ping master driver that can ping X devices.
Attached Images
File Type: png 112.png (63.7 KB, 123 views)
__________________
Good luck,

Mark
PeakHMI
  Reply With Quote
Old June 16th, 2017, 06:29 PM   #7
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,264
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.
  Reply With Quote
Old June 16th, 2017, 06:42 PM   #8
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,879
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 by dmroeder; June 16th, 2017 at 06:50 PM.
  Reply With Quote
Old June 16th, 2017, 08:00 PM   #9
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,879
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...
  Reply With Quote
Old June 17th, 2017, 02:09 AM   #10
spaderkung
Member
Sweden

spaderkung is offline
 
Join Date: Aug 2007
Location: A flat type "4"
Posts: 157
I would first try solutions that don't include the plc.
__________________
Jon Bolmstedt, Automation Engineer (for hire)
  Reply With Quote
Old June 17th, 2017, 07:30 AM   #11
Diameter157
Member
Belgium

Diameter157 is offline
 
Join Date: Mar 2016
Location: Europe
Posts: 117
Why not use another pc instead?
Make a python script to ping the server, if the server isn't up send an email to a few email addresses?

https://stackoverflow.com/questions/...vers-in-python

Make a new gmail address and turn on less secure apps.
https://support.google.com/accounts/.../6010255?hl=en

Then edit the above script to send an email like this:
https://www.hackster.io/engininer14/...cations-0a8588
  Reply With Quote
Old June 18th, 2017, 05:52 PM   #12
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,160
Quote:
Originally Posted by dmroeder View Post
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...
  Reply With Quote
Old June 18th, 2017, 07:58 PM   #13
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,879
Quote:
Originally Posted by ASF View Post
I'd be interested in that script...
Alright, when I get back home I'll share
  Reply With Quote
Old June 18th, 2017, 08:58 PM   #14
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,160
Champion! Thanks Dustin
  Reply With Quote
Old June 19th, 2017, 08:06 PM   #15
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,879
Quote:
Originally Posted by ASF View Post
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PLC Values to PC Database dmmons LIVE PLC Questions And Answers 6 October 31st, 2013 03:53 AM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 06:24 AM
Mitsubishi MELSEC Q ethernet questions Picho LIVE PLC Questions And Answers 14 October 21st, 2005 08:09 PM
Simulator, Simulation, Shadow Code Terry Woods LIVE PLC Questions And Answers 1 January 2nd, 2005 01:40 PM
PLC Simulating with only a pc CruisinGolf LIVE PLC Questions And Answers 9 May 25th, 2004 08:01 AM


All times are GMT -5. The time now is 08:35 AM.


.