LabVIEW utilities - loop inspector
Finding timeouts and errors in multiple loops
Loop inspector is a tool to inspect multiple loops on a failure in case it isn't clear which loop is wrong. Such a vague failure may occur for example when using a DDE program. Some loops might stop for some unknown reason and just resume on any user interaction such as a mouse click or move and on remote login, without error!
Loop inspector monitors loops for timeouts and errors and reports them in a table. This can be used to easily identify loops which are affected by vague phenomena similiar to one described above.
Loop inspector monitors the status of a loop. It is a global functional that can perfom the following actions:
This is the initialisation action which adds (registers) the name and preset timeout value for a loop.
- [Write] default
This action updates the status information of a loop. If an event happened, that is either a time out occured or an error occured or both, it will be reported in a log file.
This action reads the information of all loops so it can be presented in a table that must either be setup or prepared beforehand.
This action clears the status information for all loops (not including the name and the preset timeout value).
The following example shows how the loop inspector can be implemented.
In the above sample program 2 loops must be monitored. Since it is a sample program the user can force a time out and an error by entering an appropiate value for 'wait....' and 'error control....' respectively.
In existing programs take the following steps:
- add the loop inspector [Add] action for each loop, such that it executes prior to the start of the loops
- put a table on the frontpanel and setup the table for proper display, again such that it executes prior to the start of the loops
- add the loop inspector [Write] action in each loop
- add a loop that regularly executes the loop inspector [Read] action and updates the table
This file includes:
- loop inspector.vi the abovementioned functional global
- loop inspector sample.vi the abovementioned sample program
- loop inspector.llb a library of files for use with the utility
- All VIs have been made with LabVIEW 2011 SP1 Professional Development System
- The log file can be found in the default LabVIEW data folder.
- By using a preformatted table, such that each row is 3 lines high, the VI to setup the table can be skipped.
- In the actual case of using a DDE program (FlowDDE) it was found that also some loops with IO (DAQmx and VISA) were 'postponed' as well.
- If the additional loop fails then everything fails.
I would like to thank Martijn Smeulers for providing me with the functional global which was the basis for the loop inspector.
Bart Boshuizen, 2012/10/04