XNET Read (State FlexRay Cycle Macrotick) VI
- Updated2025-10-07
- 3 minute(s) read
Reads the current FlexRay global time using an XNET session.

Inputs/Outputs
session in
—
session in is the session to read. This session is selected from a LabVIEW project or returned from the XNET Create Session VI.
error in (no error)
—
The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.
session out
—
session out is the same as session in, provided for use with subsequent VIs.
cycle
—
cycle returns the current FlexRay cycle counter. The cycle counter range is 0–63. In the FlexRay specification, the current cycle counter is referred to as vCycleCounter. The XNET Cluster FlexRay:Cycle property returns the cycle length in microseconds.
macrotick
—
macrotick returns the current FlexRay macrotick. In the FlexRay specification, the current macrotick is referred to as vMacrotick. The XNET Cluster FlexRay:Macro Per Cycle property returns the number of macroticks in the cycle. The current macrotick returned from this XNET Read VI instance ranges from 0 to (FlexRay:Macro Per Cycle – 1). The XNET Cluster FlexRay:Macrotick property returns the macrotick length in floating-point seconds.
error out
—
The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Description
Global time represents the timebase that all ECUs on the FlexRay network cluster share. You use sync frames to synchronize the global time. The global time components are the current cycle counter and macrotick within the cycle. For more information about global time, refer to Summary of the FlexRay Standard.
You can use this XNET Read VI instance with any XNET session mode, as long as the session interface is FlexRay. Because the state reflects the FlexRay interface, it can apply to multiple sessions.
For this VI to operate properly, you must connect FlexRay global time as the FlexRay interface timebase source. To do this, you must call the XNET Connect Terminals VI with a source of FlexRay Macrotick and destination of Master Timebase. If the terminals are not connected in this manner, this XNET Read VI instance returns an error.
When using LabVIEW Real-Time, this VI often is useful in conjunction with the XNET Create Timing Source (FlexRay Cycle) VI. The FlexRay Cycle timing source enables a LabVIEW timed loop to execute at a specific macrotick within the cycle. Only one FlexRay Cycle timing source is allowed within the cycle. Within the timed loop, you can read the current FlexRay global time to measure performance or synchronize LabVIEW code to additional macroticks in the cycle.
session in
—
error in (no error)
—
session out
—
cycle
—
macrotick
—
error out
—