User Tools

Site Tools


code:dqmh:hse-application-template:startupvi

20 Startup VI

See Project Structure: Main VI

The startup.vi (found in the root of the SOURCE folder) is the VI that starts and runs the application. It takes care of

  • showing a splash screen
  • initialising various HSE-specific framework and config objects
  • starting the HSE-Logger
  • starting the Event Manager and UI Manager framework modules
  • starting DQMH modules dynamically via PROJECT_StartModules.vi
  • registering the Event Manager and UI Manager dynamically for the previously started modules' default broadcast events
  • setting and dynamically populating a run-time menu
  • showing the UI
  • stopping modules and shutting down the whole application

The startup.vi is also prepared to run any other custom code or external communication during startup.

Note: The startup.vi is marked with the User VI Tag HSE-App-Template.

—-

Dynamic Loading of Modules

The following screen shots document the process of registering dynamically for the project-specific modules' default broadcasts chronologically. This should help you walk through the code and understand the mechanism. See this NI Forums thread for a few more details.

Get List of Modules

startup.vi
PROJECT_StartModules.vi

Load Modules Dynamically

startup.vi
startup.vi:DQMH Load Module.vi
<SomeModule>.lvlib:Load Module.vi (specific to HSE DQMH Flavour)

Register Broadcasts Dynamically

startup.vi
startup.vi:DQMH Set Modules.vi
UI Manager.lvlib:Main.vi
UI Manager.lvlib:Register Modules in UI Manager–helper.vi
<SomeModule>.lvlib:Obtain Default Broadcast References.vi (specific to HSE DQMH Flavour)
UI Manager.lvlib:Main.vi

—-

Wait for Startup Completed Broadcast

The startup.vi waits for the application to report back that everything has been loaded and initialised and that the splash screen can be hidden and the UI Manager window can finally be shown.

startup.vi: “Wait for Startup Completed Broadcast”

The application can update the splash screen with information while it is loading resources using the “Update Splash Screen Message” System Message broadcast:

Application: “Update Splash Screen Message” System Message broadcast

The application finally has to tell the startup VI to finish the startup phase using the “Startup Completed” System Message broadcast:

Application: “Startup Completed” System Message Broadcast

—-

Optional: Wait for Continue Event

The startup.vi waits to continue the sequence on an event fired by the project specific PROJECT_SplashScreen.vi:

PROJECT_SplashScreen.vi has a designated place where any project specific code may be implemented in order to ensure the startup sequence can proceed normally.

code/dqmh/hse-application-template/startupvi.txt · Last modified: by joerg.hampel