Logging User Events
- Updated2025-02-17
- 2 minute(s) read
You can log user events in a trace session to show the execution of specific sections of an application.
Use the TraceTool Log User Event VI to log a user event in the trace session. You then can use the Flag Configuration dialog box to configure the display settings of the user flag, which appears in the Thread view. The Event ID input of the TraceTool Log User Event VI corresponds to the User Event number (0 - 254) in the Flag Configuration dialog box.
The following block diagram shows a typical use of the TraceTool Log User Event VI. The Event ID input of the first TraceTool Log User Event VI receives the event code 0 and the second receives the event code 1. The trace session logs any occurrence of the user events and the Real-Time Trace Viewer marks the occurrences with user event flags. You can configure the style and color of the user event flags in the Flag Configuration dialog box to make the flags easy to recognize in the Thread view.
The following illustration shows the user events logged in the VI shown above. The VI executed in a LabVIEW thread running at normal priority and assigned to the Standard execution system. The user event with Event ID 0 is configured to display a yellow flag and the user event with Event ID 1 is configured to display a blue flag. The user event flags in the Thread view show the exact time when the TraceTool Log User Event VI executes in the application.