Multi-Threaded Interrupt Management Capabilities in LabVIEW
Background
Event interrupt management works well in LabVIEW if ones’ programme is small and developed within a single overall Event Structure, encapsulated within a While Loop.
The problem comes when the software architecture demands a separation between the User Interface management (interrupt) functions and the sequential and looped programme structure (executable) components of the code for modular programming. In this configuration, waiting for Events to occur before code execution, pausing code execution (once started), stopping code execution or even aborting code execution (with the ability to close the application down cleanly prior to code exit) become challenging operations to implement within LabVIEW.
This software architecture design challenge is exacerbated, if branching within the looped programme structure (executable code segment) is also a requirement.
Two Key Requirements
Ideally, the following two capabilities, if implemented within LabVIEW would solve all of the aforementioned problems:
- To be able to interrupt a While Loop, pause it and if appropriate reset the [i] loop index back to zero. If controlled via the Event structure, this would make both Event structures and While Loops compatible with each other, which is not the case today.
- To be able to interrupt a Flat Sequence or Stacked Sequence structure and break out at any individual “Frame” in that structure, based upon a specific Event interrupt or even an Abort, which when controlling hardware can be a critical request that requires immediate action! Today, it is not possible to break out of a Flat or Stacked Sequence structure, one has to wait until the complete Sequence has executed.
Current Tools
Current LabVIEW, if used with care, can overcome to some extent the current While Loop and Flat Sequence software architecture limitations, but they are very cumbersome to use and require an "eagle eye" and good software tracking and debugging skills!
While Loop with Pause and Stop buttons
Set Occurrence
Wait on Notification (Front Panel activity)
A not yet fully complete explanation of the key multi-threaded programming issues is attached. If it requires updating to make it complete, do let me know.