Example Code

Error Transferring FGV

Code and Documents

Attachment

Download All

Description:

This example is a Functional Global Variable which helps you merge any errors that happen across VIs that may not have direct wiring capabilities.

So far, I have used it in the Non-Blocking Multibutton Dialog Box example.

Instructions:

  1. Open the VI and look at its three states:
    1. Merge Error
    2. Read Stored Error
    3. Clear Stored Error
  2. Test the Functionality
    1. Create a sample error in the "Error In" control
    2. Run the VI once with "Merge Error" selected in the "Error Function" control
    3. Notice that Error Out should display the sample error created previously.
    4. Reinitialized the VI (Edit >> Reinitialize Values to Default)
    5. Run the VI with "Read Stored Error" selected in the "Error Function" control, and the original sample error should reappear in the Error Out indicator.
    6. The "Clear Stored Error" open is used for initializing the FGV and clearing any error that may be stored on the shift register.

  3. Implement it in your code.
    1. Make sure to clear the error stored in the FGV in an initialization section of the code.
    2. In any of the clean up/close sections of the code, place the FGV with "Merge Error" selected as an input.
    3. In the main portion of the code, using the "Merge Error" function will merge input (defaulted to no error) with the error stored on the shift register of the FGV.

ErrorFGV_BD.png

ErrorFGV_FP.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors