FP_ETHERNETIP_DATA_GET_BYTES

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.

Parametri

Ingresso

dutReceiveData (FP_ETHERNETIP_DATA_RECEIVE_DUT)

Tipo unità dati del buffer di ricezione dati

nNumberOfBytes (WORD, INT, UINT)

Numero di byte da leggere dal buffer di ricezione dati.

Ingresso/uscita

ByteOffset (WORD, INT, UINT)

Offset di byte attuale nel buffer di ricezione dati.

Uscita

DataStart (WORD, INT, UINT)

Indirizzo iniziale dei dati byte da leggere dal buffer di ricezione dati.

Flag di errore

sys_bIsOperationErrorHold (passa a TRUE e resta TRUE)
  • 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.

sys_bIsOperationErrorNonHold (passa a TRUE per una scansione)
  • 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.

Example

POU header

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

LD body

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

ST body

if (bDecodeMessage) then
    FP_ETHERNETIP_DATA_GET_BYTES(dutReceiveData := dutReceiveData,
                                  nNumberOfBytes := iNumberOfBytes,
                                  ByteOffset := iCurrentByteOffset,
                                  DataStart => awMessageData);
end_if;

L'ultima revisione: 2022-04-19Feedback su questa paginaPanasonic hotline