LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED Indicator Switching On/Off

Solved!
Go to solution

Hi everyone,

 

I am having a problem with a VI where I read two analog inputs and save one of them into an Excel file. As you can see in the picture of the block diagram attached, I also enter a target value for the first signal and want to check whether the first signal exceeds this target value or not by using an LED indicator. The problem is that the LED indicator turns green once the 1st signal exceeds the targe value but when the signal falls below that level, it turns off again. However I want it to stay ON even if the signal is below the threshold. I tried so many things with 'while' and 'for' loops but couldn't solve the issue.

 

I would be glad if you can share your opinions about this issue.

 

Thanks in advance.

Download All
0 Kudos
Message 1 of 7
(3,719 Views)

Wire your comparison into a shift register. Then make your indicator show whether the comparison OR the previous value (from the shift register) is TRUE.

0 Kudos
Message 2 of 7
(3,716 Views)

Please attach the actual VI instead of pictures!

 

A solution to your problem has nothing to do with loops, just boolean logic. If you want tie LED to stay on, you probably also want to implement a mechanism to reset it at one point.

 

A feedback node would be simpler than a shift register. You are also complicating things tremendously by using dynamic data throughout. You are actually comparing both values, but since you wire a scalar indicator, you only get the result of the first channel. Look at all the coercion dots! Your code is very opaque and hard to debug.

 

(Note that your code is very poorly designed. If you are not careful in configuring the event structure, your VI will lock up permanently if you would press the OK a second time during execution. An event structure should not be used as a "one shot" deal. Have a look at state machine architecture instead. Also, your sequence frame serves absolutely no purpose. Nothing would change if you would delete it, so why is it there?)

 

 

 

0 Kudos
Message 3 of 7
(3,674 Views)

Dear altenbach, thank you very much for your response. You can find my VI attached and regarding your solutions I would really be grateful if you can refer me to specific functions, videos or tutorials rather than describing the solution in words. The reason is that I am not so familiar with Labview therefore when you say that I should implement a mechanicsm to reset a boolean logic, I really can't grasp what exactly I should be doing. Then what happens is that I would search for videos using your words as keywords and find myself watching tutorials about things that are totally irrelevant. In summary I would be really grateful if you refer me to a specific video, a tutorial and so on.

 

Thanks for your reply again 😉

0 Kudos
Message 4 of 7
(3,630 Views)

Dear gregoryj, thank you for your response. I am watching tutorial videos on "shift registers" now and will be giving it a shot shortly 😉

0 Kudos
Message 5 of 7
(3,627 Views)
Solution
Accepted by topic author neptunium

This could give you some ideas...

0 Kudos
Message 6 of 7
(3,619 Views)

Thank you very much 🙂 I have updated my VI by making use of what you shared and now it works as I want 😉

Download All
0 Kudos
Message 7 of 7
(3,590 Views)