Trasferimento messaggi con l'unità EtherNet/IP
Questo function block trasferisce un messaggio esplicito con un'unità EtherNet/IP presso una destinazione specifica.
Ingresso
Il trasferimento dati inizia su un fronte di salita.
Tipo unità dati con informazioni sull'unità EtherNet/IP di destinazione
Tipo unità dati del buffer di invio dati
I dati possono essere scritti nel buffer di invio dati utilizzando l'istruzione FP_ETHERNETIP_DATA_SET
Uscita
Flag che indica che il trasferimento di dati con l'unità EtherNet\IP di destinazione è in corso.
Tipo unità di dati del risultato dell'esecuzione dell'istruzione
Tipo unità dati del buffer di ricezione dati
I dati possono essere letti dal buffer di ricezione dati utilizzando le istruzioni FP_ETHERNETIP_DATA_GET e FP_ETHERNETIP_DATA_GET_BYTES
se l'area specificata utilizzando il registro indice eccede il limite.
se la funzione EtherNet/IP non è utilizzata nella configurazione dell'unità Ethernet.
se l'istruzione viene eseguita in un programma di interrupt
se la dimensione del buffer di ricezione dati per dutReceiveData eccede l'intervallo utilizzabile (3–253 word).
se la dimensione del buffer di ricezione dati per dutResult è inferiore a 3 word.
se l'area specificata utilizzando il registro indice eccede il limite.
se la funzione EtherNet/IP non è utilizzata nella configurazione dell'unità Ethernet.
se l'istruzione viene eseguita in un programma di interrupt
se la dimensione del buffer di ricezione dati per dutReceiveData eccede l'intervallo utilizzabile (3–253 word).
se la dimensione del buffer di ricezione dati per dutResult è inferiore a 3 word.
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
dutSend: FP_ETHERNETIP_DATA_SEND_DUT;
FP_ETHERNETIP_DATA_EXCHANGE_FB1: FP_ETHERNETIP_DATA_EXCHANGE_FB;
bSend: BOOL:=FALSE;
dutDestination: FP_ETHERNETIP_DATA_DESTINATION_DUT;
dutReceive: FP_ETHERNETIP_DATA_RECEIVE_DUT;
dutResult: FP_ETHERNETIP_DATA_EXCHANGE_RESULT_DUT;
END_VAR
When the variables sys_bIsEtherNetIPReady and bSend are set to TRUE, the function is executed.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_CONTACT,,sys_bIsEtherNetIPReady,5,2,7,4,);
B(B_CONTACT,,bSend,13,2,15,4,);
B(B_FB,FP_ETHERNETIP_DATA_EXCHANGE_FB!,FP_ETHERNETIP_DATA_EXCHANGE_FB1,21,1,39,6,,?BbSend?BdutDestination?BdutSendData?AbInProgress?AdutReceiveData?AdutResult);
B(B_VARIN,,dutDestination,19,3,21,5,);
B(B_VAROUT,,dutResult,39,3,41,5,);
B(B_VARIN,,dutSend,19,4,21,6,);
B(B_VAROUT,,dutReceive,39,4,41,6,);
L(1,0,1,6);
L(1,3,5,3);
L(7,3,13,3);
L(15,3,21,3);
END_NETWORK_BODY
END_NET_WORK
END_BODY
If (sys_bIsEtherNetIPReady) and (bSend) Then
FP_ETHERNETIP_DATA_EXCHANGE_FB1(bSend := bSend,
dutDestination := dutDestination,
dutSendData := dutSend,
dutResult => dutResult,
dutReceiveData => dutReceive);
End_if;