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

Inherited from

Input

itfEtherNetIPDevice

IEtherNetIPService

BaseService

eClass

CIPClass

BaseService

dwInstance

DWORD

BaseService

Output

eError

ERROR

BaseService

Input

pData

POINTER TO BYTE

udiDataSize

UDINT

Output

udiReceivedDataSize

UDINT