Encapsulates the AutoMate™ action in the “Internet” group, “Ping Machine.” The method attempts to ping the specified host and places the roundtrip time into an AutoMate™ variable.
Declaration
function PingMachine (varMachineAddress As Variant,
intPingTimeout As Integer,
varVarToSet As Variant,
intPingAction As Integer,
varPingTaskToStart As Variant,
intNoPingAction As Integer,
varNoPingTaskToStart As Variant) As Integer
Parameters
varMachineAddress
The hostname or IP address of the machine to be pinged.
intPingTimeout
The amount of time (in milliseconds) to wait for a ping response before the ping times out.
varVarToSet
The variable name AutoMate™ is to put the ping response time.
intPingAction
The course of action AutoMate™ should take if the ping is responded to successfully (i.e. the ping is returned before the timeout expires):
Value |
Meaning |
0 |
Start the task specified by varPingTaskToStart |
1 |
Stop the current task (the method returns 2) |
2 |
Continue the current task (the method returns 0) |
varPingTaskToStart
The name of the task AutoMate™ should start if the ping is successful. This parameter is ignored unless intPingAction is set to “0.”
intNoPingAction
The course of action AutoMate™ should take if the ping fails (i.e., there is no response from the destination before the timeout expires)
Value |
Meaning |
0 |
Start the task specified by varNoPingTaskToStart |
1 |
Stop the current task (the method returns 2) |
2 |
Continue the current task (the method returns 0) |
varNoPingTaskToStart
The name of the task AutoMate™ should start if the ping is unsuccessful. This parameter is ignored unless intNoPingAction is set to “0.”
Description
The PingMachine method will send an ICMP ping to the machine specified by varMachineName and wait for a response for the time indicated by intPingTimeout. The method returns different integer values based on the settings of intPingAction and intNoPingAction and if the machine responds to the ping in time.