Dynamic Variables
Getting Started
Setup ServersSecurity
Authentication Security Access-controlAddress Space
Address-space Data-types Methods Dynamic-variables Structures Extension-objects ViewsAdvanced
Events-and-alarms Historical-dataIntegration
Testing-guide Ci-integration CustomizationDynamic Variables
Path: Objects > TestServer > Dynamic
13 variables whose values change over time. These are essential for testing subscriptions, monitored items, and data change notifications.
All dynamic variables are read-only.
Variable Reference
Counters
| BrowseName | DataType | Update Interval | Behavior |
|---|---|---|---|
Counter |
UInt32 | 1 second | Increments by 1 every second. Starts at 0. |
FastCounter |
UInt32 | 100 ms | Increments by 1 every 100ms. Starts at 0. |
SlowCounter |
UInt32 | 10 seconds | Increments by 1 every 10 seconds. Starts at 0. |
Testing notes:
FastCounteris ideal for testing subscription sampling intervals- Create a subscription with 200ms publishing interval, monitor
FastCounter-- you should see every other update SlowCounteris useful for testing longer publishing intervals and keep-alive
Random Values
| BrowseName | DataType | Update Interval | Behavior |
|---|---|---|---|
Random |
Double | 500 ms | Random value in [0.0, 1.0) |
RandomInt |
Int32 | 1 second | Random integer in [-1000, 1000] |
RandomString |
String | 2 seconds | Random alphanumeric string, 8-24 characters |
Testing notes:
- Every data change notification should have a different value
- Useful for testing deadband filtering (set a deadband on
Randomand verify fewer notifications)
Waveforms
| BrowseName | DataType | Period | Formula |
|---|---|---|---|
SineWave |
Double | 10 seconds | sin(2 * PI * t / 10) -- smooth oscillation between -1 and 1 |
SawTooth |
Double | 5 seconds | (t % 5) / 5 -- linear ramp from 0 to 1, then resets |
Square |
Boolean | 2 seconds | true for 1s, false for 1s, repeating |
TriangleWave |
Double | 8 seconds | Linear ramp from -1 to 1 to -1, period 8s |
Testing notes:
- Waveforms are computed on every read (no timer), so they are always current
SineWaveis good for testing analog deadband filteringSquareis good for testing boolean data change detection
Timestamps
| BrowseName | DataType | Behavior |
|---|---|---|
Timestamp |
DateTime | Returns the current server time on every read |
Testing notes:
- The value changes on every single read, making it ideal for verifying that your client receives fresh timestamps
- Source timestamp in the DataValue should closely match the value itself
Status Cycling
| BrowseName | DataType | Update Interval | Behavior |
|---|---|---|---|
StatusVariable |
StatusCode | 3 seconds | Cycles through: Good -> BadCommunicationError -> UncertainLastUsableValue -> repeat |
Testing notes:
- Verify your client correctly interprets different status code classes:
Good(0x00xxxxxx)Bad(0x80xxxxxx) -- indicates an errorUncertain(0x40xxxxxx) -- value may not be reliable
- Test data change filtering with status change triggers
Nullable Value
| BrowseName | DataType | Update Interval | Behavior |
|---|---|---|---|
NullableDouble |
Double | 4 seconds | Alternates between a valid Double value (StatusCode = Good) and StatusCode = BadNoData |
Testing notes:
- When status is
Good: value is a random double in[0, 100) - When status is
BadNoData: value is0but should be treated as unavailable - Tests how your client handles variables that intermittently have no data
Subscription Testing Guide
Basic subscription
- Create a subscription with
publishingInterval = 1000(1 second) - Add
Counteras a monitored item withsamplingInterval = 1000 - Expect one data change notification per second, values incrementing by 1
Fast sampling
- Create a subscription with
publishingInterval = 200 - Monitor
FastCounterwithsamplingInterval = 100 - Expect ~5 notifications per second
Deadband filtering
- Monitor
SineWavewith an absolute deadband of0.5 - Notifications should only arrive when the value changes by more than 0.5
- With a period of 10s and deadband of 0.5, expect ~4 notifications per period
Status change trigger
- Monitor
StatusVariablewithDataChangeTrigger = StatusValue(trigger on status or value change) - Expect notification every 3 seconds as the status cycles
- Change to
DataChangeTrigger = Statusto only trigger on status changes