ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Control Value By another control in same vi (Without Using VI Server)

Hi all,
 
i have question, but i'm sure that if i explain here a simple case for example it will be more efficient.
 
I have vi that have 2 Boolean Controls and 1 Numric Control ,all in same vi inside While loop,
lets named them :  Bool1 and Bool2 and  Numeric1 set to Zero.
 
I want to do simple thing (probably not so simple to me..) :
 
while (user dont stop the loop) {
 
       if ( Bool1.Value is True ) {
 
               Numeric1.Value += 1 (increment one)
 
               if (Numeric1.Value is Odd ) {
       
               /// this is my problem....
               Set Bool2.Value = True
          
               /// How i do that without using Vi Server and Main Vi/Sub Vi  
              } 
       }
}
 
its maybe simple.. but i really appriciate any help.
I'm using  LabView 8
 
Thanks
Moti Mor.
 
 
 
0 Kudos
Message 1 of 5
(3,050 Views)
Take a look at the example and let me know if that is what you are looking for.  I was not sure what you wanted to do when the value was even so at the moment it just flashes the one boolean.
Message 2 of 5
(3,040 Views)
Even's example will do exactly what you want, as long as Boolean 2 is an indicator and not a control.

If it is a control as you specified in your question, you will have to use either a local variable (prefered) or the Value property of a property node. Those are the only ways to programtically change the value of a control.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 5
(3,033 Views)
This is my favorite question because it was my first one to info-LabVIEW over 10 years ago.  The answer, as Ed said, is to use a local variable.  A local variable is linked to a control and sets its value programmatically instead of through user interaction.  The programming use I had for it all those years ago was to have controls for both frequency and period of a sinewave and to get the other to update when one was set.
 
Thanks,
Bob Young
 
0 Kudos
Message 4 of 5
(3,022 Views)

Dear friends,

Thanks for your replies.

i acctually use global variable and i though that i doing something wrong..

Thank you for your advices i will use local variable as you told me

Thanks again

Moti Mor

0 Kudos
Message 5 of 5
(3,002 Views)