FB_CreateGUID

FB_CreateGUID 1:

The function block generates a new GUID. It is possible to get a list of different new GUIDs with one call if an array of type GUID is specified as buffer at the input.

FB_CreateGUID 2: Inputs

VAR_INPUT
    bExecute        : BOOL;
    sNetId          : T_AmsNetId;
    tTimeout        : TIME := DEFAULT_ADS_TIMEOUT;
    pGuidBuffer     : POINTER TO GUID;
    nGuidBufferSize : UDINT;
END_VAR

Name

Type

Description

bExecute

BOOL

The function block is activated by a rising edge at this input.

sNetId

T_AmsNetId

String containing the AMS network ID of the target device to which the ADS command is addressed (type: T_AmsNetId).

tTimeout

TIME

States the length of the timeout that may not be exceeded by execution of the ADS command.

pGuidBuffer

POINTER TO GUID

Indicates the address to the buffer for generated GUIDs. It is possible to specify the address on an ARRAY OF GUID.

nGuidBufferSize

UDINT

Indicates the size in bytes of the specified buffer.

FB_CreateGUID 3: Outputs

VAR_OUTPUT
    bBusy    : BOOL;
    bError   : BOOL;
    nErrorId : UDINT;
END_VAR

Name

Type

Description

bBusy

BOOL

When the function block is activated, this output is set to TRUE and remains set until feedback is received. As long as bBusy is TRUE, no new command can be executed.

bError

BOOL

If an error occurs during command execution, this output is set, once the bBusy output has been reset.

nErrorId

UDINT

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

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.4022

PC or CX (x86, x64, ARM)

Tc2_System (system) >= 3.4.18.0