Default Framework Cases
The Workers Main VI
Last updated
The Workers Main VI
Last updated
The MHL of a Worker's Main VI is required to have these four cases for its proper functioning in the framework (see below).
All VIs referenced in this page can be found in the Workers palette in LabVIEW.
The <Initialize> case is the first case that is called by the framework in a Workers application. This case receives user-defined initialization data that the Worker requires, sent from the Worker's Caller in the Worker's Initialization Data.ctl typedef.
In this case you can perform any initial tasks that requires data received from the Workers Initialization Data.ctl typedef.
This case should also be used to write data into the Initialization Data.ctl data clusters of this Worker's statically-linked subworkers (if this Worker has any).
The final step required to be performed by this case (or sequence of cases) is for Initialize subWorkers.vi to be called, which will call the <Initialize> case of the Worker's statically-linked subWorkers.
Worker without statically linked subWorkers
If the Worker contains no statically-linked subWorkers, then the Initialize subWorkers.vi will instead call the <All subWorkers Initialized> case of the Worker.
This case is called by the framework when all of a Worker's statically-linked subWorkers have been successfully initialized. (A Worker will notify its Caller that it has been successfully initialized when its Initialized Notify.vi has been called). You can now perform any tasks that are required to be performed now that all the Worker’s statically-linked subWorkers have been initialized.
The final step required to be called by this case (or sequence of cases) is to call Initialized Notify.vi. This VI will notify the Worker’s Caller that the Worker has been successfully initialized.
Calling the <Start Exiting> case of a Worker will start the shutdown sequence of the Worker and its subWorkers. This can be done by use of Worker Start Exiting.vi.
In this case you can perform any tasks that are required before the shutting down of the Worker's subWorkers.
The final step required to be performed by this case (or sequence of cases) is for Start Exiting subWorkers.vi to be called, which will call the <Start Exiting> case of the Worker's subWorkers.
Worker without subWorkers
If the Worker contains no subWorkers, then the Start Exiting subWorkers.vi will instead call the <All subWorkers Exiting> case of the Worker.
This case is called by the framework when all of a Worker's subWorkers have successfully exited. (A Worker will notify its Caller that it has exited when its Exited Notify and Cleanup.vi has been called.) You can now perform any tasks that are required to be performed now that all the Worker’s subWorkers have exited.
The final step required to be called by this case (or sequence of cases) is to call Exit.vi. This VI will stop both a Workers MHL and EHL, and then Worker will then exit.