Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

VariableTimestamp

  • Last UpdatedJul 18, 2023
  • 1 minute read

Extracts the timestamp from a given variable.

Note: This function is designed to be used within Cicode; using it on graphical pages may result in displaying an error message instead of an expected timestamp message when either its argument has not good quality or an execution error is set.

Syntax

VariableTimestamp(Variable, INT Type)

Variable:

The variable from which the timestamp will be extracted.

nType:

The type of timestamp:

0 – The element’s date/time (default)

1 – The element’s quality date/time

2 – The element’s value date/time

Return Value

A TIMESTAMP of the given variable depending on the type. If Variable is NULL, returns INVALID_TIMESTAMP.

Timestamps of uninitialized stack variables, uninitialized code variables and constants are equal to 0 - invalid timestamp, while their qualities are GOOD.

TimestampAdd, TimestampCurrent, TimestampDifference, TimestampSub, TimestampToStr, TimestampCreate, TimestampFormat, TimestampGetPart, TimeIntToTimestamp

Example

INT codeVariable = 1;

INT

FUNCTION

MyFunction(REAL arg1)

STRING str = "My string";

TIMESTAMP ts;

ts = VariableTimestamp(codeVariable, 0); //code variable

ts = VariableTimestamp(arg1, 0); //function argument

ts = VariableTimestamp(str, 0); //stack variable

ts = VariableTimestamp(Tag1, 0); //any tag/local variable

RETURN 1;

END

See Also

Timestamp Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in