LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create this code in labview

Solved!
Go to solution

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...

 

 

0 Kudos
Message 1 of 12
(3,560 Views)

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.

0 Kudos
Message 2 of 12
(3,551 Views)

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

 

 

0 Kudos
Message 3 of 12
(3,532 Views)

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.

0 Kudos
Message 4 of 12
(3,524 Views)

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.

0 Kudos
Message 5 of 12
(3,510 Views)
Solution
Accepted by topic author Azou_LabVIEW

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 12
(3,504 Views)

@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.  

0 Kudos
Message 7 of 12
(3,495 Views)

hello all ...

 

pjr1121 ... Zwired1 ...   

 

thank you all for help me ..

 

Answer my brother   was best .  thank you very very much

 

 

0 Kudos
Message 8 of 12
(3,462 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(3,443 Views)

thanks you

Spoiler
 
0 Kudos
Message 10 of 12
(3,429 Views)