Table Of Contents

Error Checking

Version:
    Last Modified: May 14, 2018

    Error checking identifies why and where errors occur in your VI.

    The current Main VI checks errors in the Button Express VI. If the Button Express VI returns an error, the Main VI stops.

    The yellow wire that comes into and out of the Button Express VI is the error wire. The error wire passes the error cluster value, which contains three elements: status, code, and source.

    • status is TRUE if an error occurred.
    • code is the error or warning code.
    • source specifies the origin of the error or warning and is, in most cases, the name of the node that produced the error or warning.

    The Unbundle By Name function, which is highlighted in the figure, returns the status element in the error cluster. If the Button Express VI returns an error, status is TRUE, and the Boolean value is passed to the Conditional Terminal, also highlighted. When Conditional Terminal receives a TRUE value, the Main Loop stops repeating the code within its diagram, and the Main VI stops.

    To ensure that the Main VI also stops when the LED Express VI returns an error, you must add code to check errors in the LED Express VI. Use the Merge Errors function to merge errors from the Button and LED Express VIs. You can access the Merge Errors function by navigating to Functions»Programming»Dialog & User Interface»Merge Errors.

    The following figure shows the block diagram after you add the Merge Errors function, which is highlighted. The Main VI stops if the Button Express VI or the LED Express VI returns an error, or if you click Stop on the front panel.


    Recently Viewed Topics