The purpose of a CAPA/LabVIEW assessment is to have the student operate a simulated instrument in a LabVIEW VI and assess her performance by analyzing her answers to questions and the detailed log of her activity.
From the VI devoloper's perspective, there are three components in the CAPA/LabVIEW assessment environment:
- Otrunk: is an application framework from CC. Let's simplify and think of it as the initial Java web start window the student sees when running the assessment activity.
- Activity VI: is the LabVIEW VI that represent the instrument the student will be tested on.
- Monitor: is the program that monitors and logs all the student activities on the activity VI. Currently the monitor is another LabVIEW VI that runs in the background.
For an "activity VI" to run as part of a CAPA assessment it should meet certain requirements.
There must be a wrapper VI that will be stored in the same directory as the activity VI. The monitor runs the wrapper, and the wrapper runs the activity. (The reason we need a wrapper is to make the monitor VI free of any activity-specific code.)
Let's say we have a wrapper wrap_my_activity.vi for the activity my_activity.vi.
The requirements for the wrapper are:
The otrunk/monitor assumes minimal control over the third party activity. Still we need the monitor to be able to send various signals to the activity while it is running, e.g., stop and close the VI.
Hence the following requirements:
- The wrapper must run the activity dynamically.
- The wrapper must exit immediately after running the activity. (other wise it must be reentrant.)
- The wrapper must hide itself.
The wrapper must have the following controls with the same names.
- function: enum ('run', 'close')
- vi_to_track: path - let the monitor know where the activity VI is.
- ready: boolean - let the monitor know when to start monitoring (ensures initialization is complete before being monitored)
The wrapper must implement two cases for the two possible values of the input parameter function:
- run: launch the activity VI.
- close: send a signal to stop the VI AND hide it.
Below is an example of a simple wrapper that runs an activity named "my.vi":
Block diagram in "run" case:
Block diagram in "close" case:
Note that the "Hide front panel" switch in the above VI is not required, but it is useful for development/debugging since you want to test the VI with the front panel open while in production the VI should run hidden.
Note also that it is not necessary to set up the connector pane since the wrapper itself will be run dynamically.
Here's the link to the VI so you can use it as a template: wrap_my.vi
"ready" was just set to true in the above example, but the wrapper can be more complex on some occasions. For example,
in the example below, we wanted "amplitude" and "frequency" to be set to certain values before the monitor begins to log the activity:
Here's the algorithm that the monitor uses to get data from activity VI:
The monitor can only monitor controls with a label in the front panel. Embedded controls (e.g., controls inside a tab control) are not visible to the monitor. If their values are needed for assessment, they have to pulled out to the top level of the front panel in a way that the values will change only at the time of mouse click.
A boolean contol that can end the main loop in the activity should exist and labeled so that the monitor can set its value to end the activity. It doesn't need to be at the top level.