LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does vi give different results with HIGHLIGHT EXECUTION on or off?

Solved!
Go to solution

I am using a measured input voltage value (and BOOLEAN comparators "<" and ">") to operate a case structure.  I have not placed any code in the case structure yet, and it has 2 values only, TRUE or FALSE.  When I run the vi with the HIGHLIGHT EXECUTION on, the case structure changes from TRUE or FALSE depending on the voltage value input.  However, when I run the vi with the HIGHLIGHT EXECUTION off, the case structure does not change at all.  I am using NI 9211 to provide the voltage measurement, and I am using a DC power supply to vary the input voltage in the range less than 80mV.  Sorry for mixing Volt and milliVolt in the front panel.

 

Why doesn't the case structure change from TRUE or FALSE with the HIGHLIGHT EXECUTION button OFF?

0 Kudos
Message 1 of 8
(2,656 Views)
Solution
Accepted by topic author dav2010

If you don't have anything inside the case structure how do you know it's not changing? Have you put a probe on the wire that feed the case structure? Have you tried putting a message box inside the case structure? If you have highlighting off are you expecting the block diagram to be updated? If so, it's not going to since you have ... highlighting off.

 

Also, use the In Range and Coerce function instead of two comparison functions and an AND gate.

0 Kudos
Message 2 of 8
(2,652 Views)

I agree with saverio.

 

The block diagram will no update unless excution highlighting is on. It is irrelevant for the proper functioning of the code which case is visible on the diagram, so why would the diagram need to switch the visible case? Only the front panel is designed to intereact with the user under normal circumstances.

You should also be aware that newer versions of the LabVIEW compilers agressively strip out dead code. Since your case structure does not produce any output and nothing else uses the comparison output, it is conceivable that the entire upper half or your while loop does not even exist in the compiled program. 

0 Kudos
Message 3 of 8
(2,645 Views)

Thank you both very much for your input.  I was confused because the HIGHLIGHT EXECUTION does show the Case STructure selector label changing between TRUE and FALSE, but, I cannot observe any change with the HIGHLIGHT EXECUTION off.  If I understand you, I should not be able to see it changing in the block diagram.  I will put something inside each case and observe it that way.  Thanks for the advice about the In Range and Coerce.  I saw those icons on the pallette but wasn't sure how to use them, so, the AND gate was easier for the moment.

 

Thanks again,

Dave

0 Kudos
Message 4 of 8
(2,640 Views)

You should mark Smercurio's message as the solution to your problem and not your own thank you message.  If you go to the options menu to the upper right of your message and select "unmark as solution", then you'll be able to go to his message and properly mark it as the solution.

0 Kudos
Message 5 of 8
(2,628 Views)

 


@dav2010 wrote:

Thanks for the advice about the In Range and Coerce.  I saw those icons on the pallette but wasn't sure how to use them, so, the AND gate was easier for the moment.


That's what the LabVIEW Help is for... Smiley Wink

 

0 Kudos
Message 6 of 8
(2,625 Views)

Thanks, I didn't even realize that I had marked my reply as the solution.  I changed it now.  Did I do it right?

0 Kudos
Message 7 of 8
(2,615 Views)

I figured out how to use the range and coerce function replaced that AND gate structure.  It is much easier, thanks.

0 Kudos
Message 8 of 8
(2,614 Views)