F_iecGetAOTimeTag

This function reads the current timestamp in a byte buffer of an application object.
FUNCTION F_iecGetAOTimeTag: UDINT
VAR_INPUT
pDest : DWORD; (* Pointer to time tag destination buffer *)
cbDest : UDINT; (* Byte size of time tag destination buffer *)
END_VAR
VAR_IN_OUT
dbEntry : ST_IEC870_5_101AODBEntry;
END_VAR
pDest : Buffer address.
cbDest: Byte size of the buffer.
dbEntry: Application object whose timestamp is to be read.
Return parameter | Description |
---|---|
0 | Error, no timestamp for this application object available. |
<> 0 | Number of successfull copied time stamp data bytes. These are 3 bytes for the CP24Time2a time stamp format and 7 bytes for the CP56Time2a time stamp format. |
Example for a call in ST:
PROGRAM MAIN
VAR
(*...*)
TT1 : T_CP56Time2a;
TTSize : UDINT;
bGetTT : BOOL;
END_VAR
IF bGetTT THEN
bGetTT := FALSE;
TTSize := F_iecGetAOTimeTag( ADR( TT1 ), SIZEOF( TT1 ), slave1AODB[1] );
END_IF
Requirements
Development Environment | Target System | PLC libraries to include |
---|---|---|
TwinCAT v2.9.0 Build >= 1030 | PC or CX (x86) | TcIEC870_5_101.Lib ( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib; are included automatically ) |
TwinCAT v2.10.0 Build >= 1301 | CX (ARM) |