ModSlaveSim help v3.06 - 5.4. Pre-defined Variables

Download manual: HTML

5.4. Pre-defined Variables

There are two variables provided for use in ModSlaveSim expressions : CycleTime and TimeNow.

CycleTime is the period at which ModSlaveSim calculates the values of registers that have statements when running the simulation (that is, when the Run Slave Simulation button is highlighted). The value of CycleTime is the actual time since the register values were last calculated, and may differ slightly from the configured cycle time (Run Interval setting) due to variations produced by the operating system. See the Edit Run Interval section for how to set the Run Interval value.

The TimeNow variable is the current time in seconds (since 1 Jan 1970).

Both these variables have floating-point values with millisecond precision.