11-12-2013 09:10 AM
hello...
please helpe me for this Question
i have create this code "c" in " labview "...
ex c :
if portc.f1==1 {
portc.f0=~portc.f0
}
ex labview :
if push button ==1 {
round led =~ round led
}
thanks...
Solved! Go to Solution.
11-12-2013 09:25 AM - edited 11-12-2013 09:26 AM
If else statments are achieved using the Case Structure (see structures pallete). Wire your control/value of interest (say the push button) as the input. The case strucutre will perform different segments of code when certain conditions are met. In your case, you will leave the "False" condition empty, only performing functions when the value is TRUE.
11-12-2013 10:41 AM
hello
first ... thank you for your help ...
i have ..
if push button value = true round led = true
and
if push button value = true ( not false ) round led = false
ok
thank you
11-12-2013 10:54 AM
set the push button action to Switch until released and use an event structure to detect value change. This action sets the mechanical value back to false when you let go but a case structure is used to change the LED state when the value changes to TRUE (as you press it).
See attached image.
11-12-2013 11:37 AM
Is your push button a "real" device and not a button on a screen? Your "port" command leads me to believ you might be getting the state of a physical button and wishing to display a virtual (on-screen simulated LED) indicator.
11-12-2013 11:42 AM - edited 11-12-2013 11:43 AM
pjr1121 wrote:
See attached image.
Why do people insist on using property nodes to get the value. It has the same issues with race conditions as the local variable but is extremely slow (forces a thread swap to the UI thread). Besides, you should be keeping the value of the LED in a shift register.
11-12-2013 11:45 AM
@crossrulz wrote:
Why do people insist on using property nodes to get the value. It has the same issues with race conditions as the local variable but is extremely slow (forces a thread swap to the UI thread). Besides, you should be keeping the value of the LED in a shift register.
My bad. I did this in haste on my way out to lunch. I had intended a local variable.
But you are correct, the shift register is better still.
11-12-2013 12:49 PM
11-12-2013 01:29 PM
@i_love_NI_LabV wrote:
Answer my brother @crossrulz was best . thank you very very much
In that case, you should mark my post as the answer and give Kudos to all useful posts (including the solution). These are how you are to properly give thanks on the forums.
11-12-2013 02:30 PM
thanks you