FB_ReadAdsTecSysData

The FB_ReadAdsTecSysData function block allows the system and/or diagnostic data of an ads-tec Industrial PC to be read. 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: It is possible here to provide the AmsNetId of the TwinCAT computer on whose function data should be read. If it is to be run on the local computer, an empty string can be entered.
bEnable: The block is reset with a rising edge (prior errors at the output bError and nErrId are deleted). If the input is set, the system data are read cyclically.
tCycleTime: Cyclic read 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 occurs at the last read cycle).
bError: if an error occurs during the execution of a command, this output is set. The error is reset with a rising edge at the bEnable input.
nErrId: Supplies the Ads error number when bError output is set.
stSysData : Structure with system data/ diagnosis data.
Requirements
Development environment | Target System | IO Hardware | PLC Libraries to include |
---|---|---|---|
TwinCAT v2.8.0, Build > 746 TwinCAT v2.9.0, Build > 945 | PC (i386)
| ads-tec PC | TcIoFunctions.Lib ( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib are included automatically ) |