CustomEvents Sample

The CustomEvents sample demonstrates how to generate custom events from an RTSS application using the Real-time API RtGenerateEvent and how to collect them in a monitoring session.

The program generates two custom events, kind 101 and kind 102, in a loop. Each event carries a structure of two floats, x and y.

Before generating events, the program starts monitoring, and when it finishes, it stops monitoring, producing a single monitoring session.

Source Files

File Description
CustomEvents.cpp

This source file contains the main function. It starts and stops monitoring and generates two custom events.

CustomEvents_VS2022.vcxproj Visual Studio 2022-compatible project file.
CustomEvents_VS2019.vcxproj Visual Studio 2019-compatible project file.

Building the Sample

Build the sample using any of the four available configurations: Debug, Release, RTSSDebug, or RTSSRelease.

Running the Sample

  1. Enable monitoring in wRTOS Settings if it isn't already enabled (monitoring is OFF by default). If the Subsystem is running when you enable monitoring, restart the Subsystem.
  2. Open wRTOS Monitor, and make sure Custom Events are included in the list of events to collect.
  3. Run the sample program as a Windows executable or RTSS process.

Expected Results

Running the sample generates a monitoring session that contains custom events. By default, session logs are saved to C:\Users\Public\Documents\MaxRT\wRTOS\Monitor. You can change this location in wRTOS Settings.

Remarks

This sample requires the wRTOS SDK to be installed on the system.

APIs Referenced

RTAPI