PingIP (Ping IP Address)

The PingIP function is used to ping an IP address.

Syntax

Variable = PingIP ( PingIPAddr, PingTimeOut, PingOption [optional] )

NOTE:  In order for PingIP to work, the Ping Enabled setting must be set to 1 in the data logger settings.

Remarks

The PingIP function returns the response time (in milliseconds) if a response is received from the ping within the timeout period; otherwise, it returns 0.

NOTE:  There is also a PING command available in the data loggers Terminal Mode, which can be used for testing and troubleshooting. For example: CRX> PING <HOST>. The host can be an IP address or a domain name, such as CR6>PING CAMPBELLSCI.COM.

Parameters

PingIPAddr (IP Address to Ping)

The IP address of the device to be pinged. This is a string variable, which can be entered as a numeric address (for example, "xxx.xxx.xxx.xxx", with each xxx being a value of 0 to 255) or a fully-qualified domain name (for example, "computer-name.domain.com"). The entry for the IPAddr must be enclosed in quotes.

Type: String Variable

PingIPTimeOut (Timeout)

The time, in milliseconds, that the datalogger should wait for a response back from the pinged device. If a response is not received within the timeout period, 0 will be returned.

Type: Constant or variable

Optional Parameter

PingOption

Optional parameter that specifies the IP version of the address to return if the address is a domain name that needs to be resolved to a numeric IP address. The optional parameter may be configured as follows:

Option Code Description
0 or absent Ping IPv4 first, if fail try IPv6
1 Ping only IPv4
2 Ping only IPv6 (local and global)
3 Ping IPv6 first, if fail try IPv4