Leggere i dati byte dal buffer di ricezione dell'unità EtherNet/IP
Questa istruzione FP legge i dati byte dal buffer di ricezione dati specificato da FP_ETHERNETIP_DATA_RECEIVE_DUT per un messaggio EtherNet/IP trasferito con FP_ETHERNETIP_DATA_EXCHANGE_FB.
Ingresso
Tipo unità dati del buffer di ricezione dati
Numero di byte da leggere dal buffer di ricezione dati.
Ingresso/uscita
Offset di byte attuale nel buffer di ricezione dati.
Uscita
Indirizzo iniziale dei dati byte da leggere dal buffer di ricezione dati.
se l'area specificata utilizzando il registro indice eccede il limite.
se la funzione EtherNet/IP non è utilizzata nella configurazione dell'unità Ethernet.
se un valore specificato per un parametro è fuori dall'intervallo utilizzabile.
se l'area specificata utilizzando il registro indice eccede il limite.
se la funzione EtherNet/IP non è utilizzata nella configurazione dell'unità Ethernet.
se un valore specificato per un parametro è fuori dall'intervallo utilizzabile.
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
awMessageData: ARRAY [0..1] OF WORD:=[2(16#0)];
dutReceiveData: FP_ETHERNETIP_DATA_RECEIVE_DUT;
iNumberOfBytes: INT:=3;
iCurrentByteOffset: INT:=0;
bDecodeMessage: BOOL:=FALSE;
END_VAR
When the variable bDecodeMessage is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 9 ;
NETWORK_BODY
B(B_CONTACT,,bDecodeMessage,5,1,7,3,);
B(B_F,FP_ETHERNETIP_DATA_GET_BYTES!,,17,0,34,6,,?DEN?DdutReceiveData?DnNumberOfBytes?DByteOffset?AByteOffset?AENO?CDataStart);
B(B_VARIN,,dutReceiveData,15,2,17,4,);
B(B_VAROUT,,awMessageData,34,2,36,4,);
B(B_VARIN,,iNumberOfBytes,15,3,17,5,);
B(B_VARIN,,iCurrentByteOffset,15,4,17,6,);
L(1,0,1,9);
L(1,2,5,2);
L(7,2,17,2);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if (bDecodeMessage) then
FP_ETHERNETIP_DATA_GET_BYTES(dutReceiveData := dutReceiveData,
nNumberOfBytes := iNumberOfBytes,
ByteOffset := iCurrentByteOffset,
DataStart => awMessageData);
end_if;