LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with LEDs to keep the light on

Solved!
Go to solution

Hi,

 

I started learning Labview from my own account, by now i am modifying a software in Labview to move 3 motors, only that i got a problem, i tried to use 2 Round LEDs for every axe (one when the motor is moving in the positive sense and one on the negative).

 

So i have like 6 LEDs, now the real problem started when i need to keep the LEDs on, i mean for example i push on the positive (Eixo - X) and the LED turns on, and in some milliseconds it turns off. But what i need is that if i push some button the respective LED should keep on until i push another. I dont know how can i make it for the Case Structure where these leds are situated.

 

I am adding part of the part when i am trying to add this function, hope someone can explain me a little or even help me what can I do.

 

Thank for any help

0 Kudos
Message 1 of 4
(2,700 Views)
Solution
Accepted by topic author Vlasr
It is not hard to do what it sounds like you are trying to accomplish. Have you gone through the online tutorials?

A simple way is to get to your goal is to have the values for the LEDs carried in a shift register. You then write your logic (an event structure would be easiest) so the data in the SR only changes when the operator pushes a button. If there are no presses, the data isn't changed.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,683 Views)
Solution
Accepted by topic author Vlasr

"i tried to use 2 Round LEDs for every axe" - I take it you are referring to the six rectangular leds on the jog panel?

 

You have a while loop setting the led states. The while loop never exits (you have true wired to the continue node). It will read the input values from your buttons once (when the loop starts) and then never read the button inputs again.

 

The first time round the loop, if one of the inputs was true, it will light that led. The next time round the loop, it will turn it off again. Look at the logic you wired in the loop and work it through! (also, why do you have OR gates with only one input?) Also, the loop has no time delay in it, so not only will it run for ever, it will run as fast as possible and hog your CPU.

 

While I am at it, your program is very very difficult to follow (and hence alter or maintain) because of its sheer size and all the nested structures. You said that you are modifying software so I know this is not your fault, but I would very strongly recommend re-structuring the program (if you have time, which I appreciate you may not). Look at the Labview Style Guidelines (in the Labview help) and some of the example projects or the online tutorials for more guidance on structure and layout.

0 Kudos
Message 3 of 4
(2,626 Views)

Yes i am working with the 2 Round Leds for every axes, i understood that the while loop is not correctly wired, is that right? can u explain me again with more detail. And with using the OR is incorrect i myself have noticed that, i was thinking in using the direct wire but i was trying to dont use a while loop and instead using a structure.

0 Kudos
Message 4 of 4
(2,535 Views)