F_iecGetAOTimeTag

This function can be used to read the current timestamp of the application object in a byte buffer.
Syntax
FUNCTION F_iecGetAOTimeTag: UDINT
VAR_INPUT
pDest : PVOID;
cbDest : UDINT;
END_VAR
VAR_IN_OUT
dbEntry : ST_IEC870_5_101AODBEntry;
END_VAR
Inputs
pDest: Target buffer address.
cbDest: Byte size of the target buffer.
Return value
Return parameter | Meaning |
|---|---|
0 | Error; the application object has no timestamp. |
<> 0 | Number of successfully copied timestamp data bytes. The CP24Time2a timestamp format has 3 bytes, for example, the CP56Time2a timestamp format has 7 bytes. |
Sample in ST
PROGRAM P_iecGetAOTimeTag
VAR_IN_OUT
AODB : ARRAY[1..MAX_TABLE_IDX] OF ST_IEC870_5_101AODBEntry;
END_VARVAR
bGet : BOOL := TRUE;
index : DINT;
cbTagSize: UDINT;
tTag : T_CP56Time2a;
END_VARIF bGet THEN
bGet := FALSE;
FOR index := 1 TO MAX_TABLE_IDX BY 1 DO
cbTagSize := F_iecGetAOTimeTag ( ADR( tTag ), SIZEOF( tTag ), AODB[index] );
END_FOR
END_IFRequirements
Development environment | Target system type | PLC libraries to be linked (category group) |
|---|---|---|
TwinCAT v3.1.4012.0 | PC oder CX (x86, x64, Arm®) | Tc2_IEC60870_5_10x (Communication->IEC60870) |