FB_CoEExecuteCommand

FB_CoEExecuteCommand 1:

With the function block FB_CoEExecuteCommand a command can be executed.

FB_CoEExecuteCommand 2: Inputs

VAR_INPUT
    NetId       : T_AmsNetID := '';
    Index       : WORD;
    pSrcBuf     : PVOID;
    SrcBufLen   : UDINT;
    pDstBuf     : PVOID;
    DstBufLen   : UDINT;
    Execute     : BOOL;
    Timeout     : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

Name

Type

Description

NetId

T_AmsNetID

String which contains the AMS Network ID of the PC (type: T_AmsNetId).

Index

WORD

CoE object index that FB_CoEExecuteCommand refers to.

pSrcBuf

PVOID

Address of the structure of the data to be sent

SrcBufLen

UDINT

Size in bytes of the structure of the data to be sent

pDstBuf

PVOID

Address of the structure of the data to be received

DstBufLen

UDINT

Size in bytes of the structure of the data to be received

Execute

BOOL

The function block is enabled via a positive edge at this input.

Timeout

TIME

Maximum time allowed for the execution of the function block.

FB_CoEExecuteCommand 3: Inputs/outputs

VAR_IN_OUT
   Axis : AXIS_REF;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.

FB_CoEExecuteCommand 4: Outputs

VAR_OUTPUT
    Busy        : BOOL;
    Error       : BOOL;
    ErrorId     : UDINT;
    Status      : _E_CoECommandStatus;
END_VAR

Name

Type

Description

Busy

BOOL

This output is set when the function block is activated, and remains set until a feedback is received.

Error

BOOL

This output is set after the Busy output has been reset when an error occurs in the transmission of the command.

ErrorId

UDINT

In the event of a set error output returns the ADS error code.

Status

_E_CoECommandStatus

Status of the command execution