03-13-2011 02:01 PM
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?
Solved! Go to Solution.
03-13-2011 02:15 PM
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.
03-13-2011 02:43 PM
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.
03-13-2011 03:00 PM
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
03-13-2011 03:49 PM
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.
03-13-2011 03:51 PM
@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...
03-13-2011 04:08 PM
Thanks, I didn't even realize that I had marked my reply as the solution. I changed it now. Did I do it right?
03-13-2011 04:08 PM
I figured out how to use the range and coerce function replaced that AND gate structure. It is much easier, thanks.