FB_OcaDevice

FB_OcaDevice 1:

The function block FB_OcaDevice establishes the connection via TcpIp to devices that support the AES70 standard.

FB_OcaDevice 2:

Cyclically single call

The instance of the function block FB_OcaDevice must be called cyclically once at the start of the PLC program.

Syntax

VAR_INPUT
   bEnable         : BOOL;
END_VAR
VAR_OUTPUT
   ipTcResultEvent : Tc3_EventLogger.I_TcResultEvent;
   pLink           : POINTER TO ST_Link;
   bBusy           : BOOL;
   bActive         : BOOL;
   bError          : BOOL;
   stDeviceInfo    : ST_OcaDeviceInfo;
END_VAR

FB_OcaDevice 3: Inputs

Name

Type

Description

bEnable

BOOL

Enables/disables execution of the function block and starts the "keep alive" mechanism.

A rising edge at this input clears any pending errors (indicated by bError = TRUE).
The property sDeviceName should be set before the activation. Parameters such as IP address, port, etc. should also be predefined in the global variable list "GVL_AES70".

FB_OcaDevice 4: Outputs

Name

Type

Description

ipTcResultEvent

Tc3_EventLogger.I_TcResultEvent

Result interface with detailed information on the return value

pLink

POINTER TO ST_Link

Pointer for establishing a connection between OCA objects and the OCA device

bBusy

BOOL

TRUE as long as the function block is called with bEnable = TRUE.

bActive

BOOL

Indicates that the device is ready to operate.

This output is generally used to activate OCA objects.

bError

BOOL

TRUE, if an error occurs.

stDeviceInfo

ST_OcaDeviceInfo

This structure provides information such as the time of the last sent or received message and the number of messages.

FB_OcaDevice 5: Properties

Name

Type

Access

Definition location

Description

AmsNetId

T_AmsNetID

Set

Local

AMS network ID of the device

For the local computer (default) an empty string may be specified.

bLocalOcaDevice

BOOL

 

Local

Currently unused (intended for future extension)

sDeviceName

STRING

Set

 

Name of the OCA device to be used

Parameters such as IP address and port are defined in the array aOcaDevices, which can be found in the global variable list GVL_AES70.

tAdsTimeout

TIME

Set

 

Maximum time allowed for the execution of the function block

This input is internally preset to DEFAULT_ADS_TIMEOUT and does not have to be explicitly assigned.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.2 or higher

PC or CX (x64, x86, ARM)

Tc3_AES70

See also: Example for using the function block FB_OcaDevice