Device connected and pinger script does not work

Hello,

I use Ignition 7.9.12 for supervision application. In this application, i created a pinger script :


In the application i created a view for dispay the connection status of the connected equipment. On my computer this view work correctly and the label ‘CENNECTED’ is displayed for connected equipment.
But the panel PC Pro-face SP5000 that is used for this project, the label ‘CENNECTED’ is not displayed for connected equipment. Despite the equipment is correctly connected and display as connected on OPC-UA Server> Devices.

Try this native Java script instead of using command line:

It is the some problem. I replaced the script and it was the some result.

Have you confirmed that you can ping the devices from outside of Ignition using cmd/terminal? Network switch blocking pings? Devices set to not respond to pings?

Yes. I can ping the device throw cmd/terminal correctly. Also, the devices is displayed connected on OPC-UA Server> Devices and the tags change when PLC IO change.
I tried to connected the device directly to the panel PC without success.

Does calling the shared script from the script console work as expected? Or does it fail to give the results you’re looking for there too?

The some application work in other stations. And in the SP5000 Pro-Face panel PC does not work.
That mean that the script is well created and called in the Ignition application.
May be there is some setting that must be checked wich I do not know!!!

Yes, this likely relates to network settings/configuration on the SP5000 in some way. I’m not sure what could be stopping this if you can ping the same address from command prompt on the SP5000.

I can ping all the device with the cmd/terminal. So i do not understand where is the problem !!

That is strange. Is the gateway running on the SP5000, or elsewhere? If the SP5000 is just a client (not also the gateway), it isn’t relevant as this script in a tag would be running on the gateway.

The gateway is running on the SP5000.

Retracted my original post as I had to re-read the last couple posts…

For the PLCs, you could reference the “Diagnostics/Is Connected” tag instead of trying to ping them.

I could not get the version of the ping function you have to work (one note, your command variable should be a python list[]). This version is what I use in my projects:

def ping(ip):
	import subprocess
	import platform
	
	# Ping command depends on OS
	platform_cmd = '-n' if platform.system() == 'Windows' else '-c'
	command = ['ping', platform_cmd, '1', ip]
	resp = subprocess.Popen(command, stdout=subprocess.PIPE).stdout.read()
	
	return False if 'unreachable' in resp.lower() else True

In the future if you could copy your code into your message (enclosed with ```), instead of a screenshot, it will make it a lot easier for us to help you.

As @witman said, Java has its own native icmp library you can use instead of going through the OS

To expand on @nminchin’s response. Can you give more detail into any errors or tests you ran when you tried using the native Java approach? I only offered the modified python version because you weren’t able to get the Java function working.

I used the native Java approach and the some problem.

I reinstalled the windows 10 IOT 2016 that was installed on the SP5000 and also i have the some issue.
So i made a clone of my PC windows and i installed it on the SP5000. The problem is solved and the ping script work !!!

1 Like