System Function for pinging an IP through script

Hi,
I’m in need of to update a numeric text field value by pinging a IP address that have in my DB
So is there any function for that in ignition or anyone can give me your advice
Thanks in Advance,
Regards,
Sri

There are three projects on the Ignition Exchange that might be relevant.

Network Device Ping UDT by: Arnaud De Clerck

Network Device Status by: Bao Nguyen

Linux Network Device Ping UDT by: Michael Flagler.

1 Like

Thanks @Transistor
But can i have a detailed explanation of this
Regards,
Sri

There is usually documentation with each Exchange project - both on the Exchange pages and in the download. You load it onto your gateway and launch the application. If it does what you want then you import it into your own project.

If you have a particular question then explain what you have done and where you are stuck.

If it's just strictly pinging you can check this out

Im not sure if any of these ping from the client to the address…
but they proabbly ping from the gateway.

1 Like

Oh just noticed this is perspective. Yea all the jython runs on the gateway, so if you had a button that called the ping script in a view, it would be the gateway that ended up doing it, no matter what client clicked it.

If it’s just for checking to see if stuff is alive as a status check though that’s probably fine I would guess.

I'm late to the thread but wanted to revive it. We have several devices here we'd like to periodically ping which are not PLC's so I can't use the normal handshake methods.

I've tried the various Jython calls and while this also makes me queasy shelling out to it, it doesn't work when there's no path to the device (eg Windows "Destination not reachable" returns).

I've looked at several Exchange options and it appears that
Arnuald De Clerk's solution might fit for the bill but the instructions are for the Maker Addition and I'm not sure if I can use it on standard Ignition.

I've worked with support on this and they are a little stumped, pointing me back toward our network people. I'm not sure that's helpful because I want to know if the device is offline irregardless of whether a device gateway is set incorrectly or any other reason.

Any more recent suggestions on how to do this with Ignition 8.1.44?

Thanks!!!

Follow Tyler's instructions here:

I highly recommend not shelling out to the system's ping executable.

Thanks Phil. I've seen you reply this way before and appreciate your wisdom.

Do Tyler's instructions also work with Windows-based Ignition servers?

Oy! No, Windows apparently doesn't have an ICMP system call even for admins, and java won't even try. The ping executable in windows creates raw ethernet packets of the right format.

The ping executable in both Windows and Linux is marked to have the necessary permissions to use raw packets. The CAP_NET_RAW setting in Linux gives this permission to non-root java so .isReachable() works properly.

Sorry. You'll have to use one of the options that calls an external program that has necessary permissions.

Chalk this up as just one more reason for my declarations that deploying Windows in plant floor applications is engineering malpractice.

I'd agree on Windows, but I have to deal the cards I'm dealt. Not many IT folks these days on the corporate level know much about 'Nix and refuse to allow its use. I sharpened my teeth on various Unix versions clear back to DEC PDP's (which were pretty fantastic with that tiny amount of processing power compared to today).

Sigh....