Get_Attributes_All (FB)ΒΆ
FUNCTION_BLOCK Get_Attributes_All EXTENDS BaseService
This function block is used for querying the attribute of a specific instance of a CIP object.
Note
Data received and send needs to be swapped. See parent folder.
PROGRAM PLC_PRG
VAR
data : ARRAY[0..500] OF BYTE;
getAttributeAll : ENIP.Get_Attributes_All ;
udiReceivedData : UDINT;
END_VAR
getAttributeAll(
xExecute:= ,
itfEtherNetIPDevice:= EtherNetIP_Adapter, (* instance of the device (instance is found in the I/O Mapping of the device) *)
eClass:= ENIP.CIPClass.TCPIPInterfaceObject, (* cip class which contains the desired attribute *)
dwInstance:= 1, (* value of 0 is class level, range from 1..x is instance level *)
pData:= ADR(data), (* data buffer *)
udiDataSize:= SIZEOF(data), (* size of the data buffer *)
xDone=> ,
xBusy=> ,
xError=> ,
eError=> ,
udiReceivedDataSize=> udiReceivedData ); (* if the request was successful, udiReceivedData contains the number of bytes which have been received *)
;
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xExecuteBOOLRising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone,xError) are present at the outputs for exactly one cycle.ETrig
Output
xDoneBOOLTRUE: Action successfully completedETrig
xBusyBOOLTRUE: Function block activeETrig
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrig
Input
itfEtherNetIPDeviceIEtherNetIPServiceBaseService
eClassBaseService
dwInstanceDWORDBaseService
Output
eErrorBaseService
Input
pDataPOINTER TO BYTE
udiDataSizeUDINTOutput
udiReceivedDataSizeUDINT