Request to send PING
This FP instruction sends a PING to the destination IP address of the connection specified by sPort. The number of times to send PING is specified by n_Requests. Please ensure the suitable parameters are also set in the project navigator under .
Input
Ethernet port on CPU (FP7 E types):
SYS_ETHERNET_USER_CONNECTION_1–SYS_ETHERNET_USER_CONNECTION_216
Number of times to send PING
Values: 1–10
Output
Stores the result of PING in the DUT FP_ETHERNET_PING_DUT
This instruction is dedicated to ET-LAN.
The timeout period for one PING response is one second (fixed).
The size of sent/received data is 56 bytes (fixed).
When a destination IP address is not specified, an error occurs.
Use the instructions FP_IPV4_GET_CONNECTION or FP_IPV6_GET_CONNECTION to check the destination IP address for the PING.
When Ethernet is being initialized while sending PING, 0 is put in all elements of FP_ETHERNET_PING_DUT.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
bEnable: BOOL:=FALSE;
iRequest: INT:=0;
dutEthernet: FP_ETHERNET_PING_DUT;
END_VAR
When the variable bEnable is set to TRUE, the function is executed.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 10 ;
NETWORK_BODY
B(B_F,FP_ETHERNET_PING!,,19,2,30,7,,?DEN?Ds_Port?Dn_Requests?AENO?Cd);
B(B_VARIN,,SYS_ETHERNET_USER_CONNECTION_10,17,4,19,6,);
B(B_VARIN,,iRequest,17,5,19,7,);
B(B_VAROUT,,dutEthernet,30,4,32,6,);
B(B_CONTACT,,bEnable,3,1,5,3,);
L(1,2,3,2);
L(5,2,5,4);
L(5,4,19,4);
L(1,0,1,10);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if(bEnable) then
FP_ETHERNET_PING(sPort := SYS_ETHERNET_USER_CONNECTION_10,
n_Requests := iRequest,
d => dutEthernet);
END_IF;