Timestamp_Current Property
General info
Label |
Current Time |
Description |
The current time of the OPC server. |
Data type |
DateTime |
Type |
Regular |
Code |
549 |
Symbolic name |
MODEL_PROP_TIMESTAMP_CURRENT |
Lua access code |
syslib.model.properties.Timestamp_Current |
Available since |
1.0 |
- Parent properties
Attributes
| Name | Tooltip |
|---|---|
| PROP_VISIBLE | The property is visible in DataStudio and can be read by the inmation APIs. |
| PROP_VOLATILE | The property exists during runtime of the service only and is not saved to the image. |
| PROP_DETECTABLE | Property is detectable by system-driven server endpoint investigation. |
Examples
Read from or write to the Timestamp_Current property.
-- Read from the Timestamp_Current
syslib.getvalue("<OBJECT FULL PATH>.OPCComCRuntimeInformation.OpcComCStateInformation.Timestamp_Current")
-- Write to the Timestamp_Current
syslib.setvalue("<OBJECT FULL PATH>.OPCComCRuntimeInformation.OpcComCStateInformation.Timestamp_Current", syslib.currenttime())
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the Timestamp_Current
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.OPCComCRuntimeInformation.OpcComCStateInformation.Timestamp_Current"));
// Write to the Timestamp_Current
Result result = sli.WriteValue(sc, new WriteItem(DateTime.Now, "<OBJECT FULL PATH>.OPCComCRuntimeInformation.OpcComCStateInformation.Timestamp_Current"));