Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
5 ratings:
 4.40 out of 5   

Archived: LabVIEW Error 91 or Error 1193 with Boolean References and Local Variables

This document has been archived and is no longer updated by National Instruments



Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 8.5.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I have a Boolean control set to a latching mechanical action in my VI. I also have control references or local variables associated with this control. When I run my VI, I get Error 91 or Error 1193 from my VI Server functions. With the Boolean set to a switching  mechanical action, I do not get these errors. Why is this?

Solution:
Note: Starting with LabVIEW 2009, a VI will not run due to a broken run arrow if a local variable is created from a latching Boolean.

With control references or local variable that are tied to latching Boolean controls, you would be resetting the Boolean with the first read, and thus other control references may not receive the same value if the first read reset the Boolean from True to False. This is why you can only use switching actions (Switch when pressed, Switch when released, or Switch until released) for a Boolean that has a local variable or a control reference associated with it.

If you use a local variable with a latching Boolean you may encounter the following:

Error 91: If a Boolean control has associated local variables, it may not use Latch mechanical action. The first local variable to read a Boolean control with Latch action would reset its value to the default.

In LabVIEW 7.1 if you try to do the same using control references, you may encounter the following:

Error 1193: When a Boolean control has a latch mechanical action, you cannot use the Value property to read or write its value.

By changing the Boolean's mechanical action to a switching type, you will no longer receive these errors, but the value of the Boolean will also no longer reset whenever it is read.

A latching mechanism can be roughly simulated by using a switching action and using a local variable to place the Boolean back into a false state, as seen in the screenshot below (VI is attached):



Related Links:
KnowledgeBase 3GGDIMTY: Stopping Parallel While Loops in LabVIEW With One Stop Button
LabVIEW Help: Changing the Mechanical Action of a Boolean Object

Attachments:
Simulate Latch.vi (2009)Simulate Latch.vi




Report Date: 01/24/2001
Last Updated: 05/27/2014
Document ID: 25NBPADM

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit