FB_ReadAdsTecSysData

FB_ReadAdsTecSysData 1:

The FB_ReadAdsTecSysData function block reads the system data/diagnostic data of an ads-tec Industrial PC. The block is level triggered, which means that cyclic reading of the system data only occurs while the bEnable input is set. So that this only results in a low level of system loading, the read cycle is automatically repeated about every 100 ms (default value). When the bValid output is set, the most recently read data is valid (i.e. the last read cycle was carried out without error). If an error occurs, the bError output is set, and cyclic reading is halted. A new rising edge at the bEnable input can clear existing errors and restarts cyclic reading.

VAR_INPUT

VAR_INPUT
    sNetId     : T_AmsNetId;
    bEnable    : BOOL;
    tCycleTime : TIME := T#100ms;
END_VAR

sNetId: A string with the network address of the TwinCAT computer whose system data are to be read can be entered here (type: T_AmsNetID). If it is to be run on the local computer, an empty string can be entered.

bEnable: The block is reset by a rising edge (previous errors at the bError and nErrId outputs cleared). the system data are read cyclically if the input is set.

tCycleTime: The cyclic reading interval.

VAR_OUTPUT

VAR_OUTPUT
    bValid    : BOOL;
    bError    : BOOL;
    nErrId    : UDINT;
    stSysData : ST_AdsTecSysData;
END_VAR

bValid: If this output is set, the data in the ST_AdsTecSysData structure are valid (no error occurred during the last reading cycle).

bError: This output is set if an error occurred when executing the function. The error is cleared with a rising edge at the bEnable input.

nErrId: Supplies the ADS error number when the bError output is set.

stSysData: Structure with the system data/diagnostic data (type: ST_AdsTecSysData).

Requirements

Development environment

Target platform

IO hardware

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

None. This functionality is not supported by TwinCAT 3 at present!

ads-tec PC

Tc2_IoFunctions (IO)