horatius Posted October 24, 2008 Report Share Posted October 24, 2008 I have a lamp working as boolan indicator on my front panel. After I run my VI the PC takes some time to check the state of a device. Therefore the initial state of the lamp should be off. After checking of the device the lamp is on. However the state of the lamp changes only after the procedure irrespectively whether the lamp is initially on or off. What is an easy method to set the lamp in off state immediatly after pressing the run button? Quote Link to comment
Dan DeFriese Posted October 24, 2008 Report Share Posted October 24, 2008 QUOTE (horatius @ Oct 23 2008, 04:44 PM) I have a lamp working as boolan indicator on my front panel. After I run my VI the PC takes some time to check the state of a device. Therefore the initial state of the lamp should be off. After checking of the device the lamp is on. However the state of the lamp changes only after the procedure irrespectively whether the lamp is initially on or off. What is an easy method to set the lamp in off state immediatly after pressing the run button? Right Click the boolean terminal then select Create -> Invoke Node -> Initialize to Default. Use dataflow to ensure this invoke node execute immediately when the VI runs. Quote Link to comment
syrus Posted October 24, 2008 Report Share Posted October 24, 2008 Another option is to go to VI Properties->Execution and select the "Clear indicators when called" option. This will set all indicators to their default values each time you run your VI. Quote Link to comment
crelf Posted October 24, 2008 Report Share Posted October 24, 2008 QUOTE (horatius @ Oct 23 2008, 05:44 PM) I have a lamp working as boolan indicator on my front panel. After I run my VI the PC takes some time to check the state of a device. Therefore the initial state of the lamp should be off. Set the control/indicator to off, right click on it (from the front panel), and select Data Operations > Make Current Value Default. Quote Link to comment
Minh Pham Posted October 25, 2008 Report Share Posted October 25, 2008 QUOTE (crelf @ Oct 24 2008, 09:31 AM) Set the control/indicator to off, right click on it (from the front panel), and select Data Operations > Make Current Value Default. I agree, as beginer to Labview this method works best. When HORATIUS finish reading and practising Intro To Labview in 6hrs or something similar then you can start looking at Property node and Invoke node, execution order and data flow. Enjoy LabVIEW HORATIUS ! Quote Link to comment
horatius Posted October 25, 2008 Author Report Share Posted October 25, 2008 QUOTE Set the control/indicator to off, right click on it (from the front panel), and select Data Operations > Make Current Value Default. This method I tried before I started this thread. The method seemed intuitively at the beginning and I tested. However it didn't work (LV 8.51). Maybe you can test with your labview. Quote Link to comment
crelf Posted October 26, 2008 Report Share Posted October 26, 2008 QUOTE (horatius @ Oct 24 2008, 12:08 PM) This method I tried before I started this thread. The method seemed intuitively at the beginning and I tested. However it didn't work (LV 8.51). Maybe you can test with your labview. We must be talking about different things - it's worked fine for many versions of LabVIEW... What about it didn't work? Quote Link to comment
Neville D Posted October 28, 2008 Report Share Posted October 28, 2008 QUOTE (horatius @ Oct 24 2008, 09:08 AM) This method I tried before I started this thread. The method seemed intuitively at the beginning and I tested. However it didn't work (LV 8.51).Maybe you can test with your labview. You have to save the VI after making this change. N. Quote Link to comment
B Chavez Posted October 29, 2008 Report Share Posted October 29, 2008 If you're running the VI multiple times without closing it between runs, the indicators will not clear unless you add code that does it before everything else, or do what Syrus suggested. QUOTE (syrus @ Oct 23 2008, 03:15 PM) Another option is to go to VI Properties->Execution and select the "Clear indicators when called" option. This will set all indicators to their default values each time you run your VI. Quote Link to comment
OlivierL Posted October 30, 2008 Report Share Posted October 30, 2008 Horatius, Other options that haven't been said so far are to use the "FirstCall?" VI. It returns TRUE only once after hitting the Run button. Using that and a case strcture afterward, you can reinitialize your indicator once per Run. Using Property node is easy and an efficient way of accessing the value of indicators and controls. Left click on the Property node to change the type of information and you can swap between Read/Write. Is it good to know that this VI will return TRUE everywhere, once per execution which means that you can use it in as many places as you want in your code. Hope this helps. Olivier Quote Link to comment
horatius Posted November 4, 2008 Author Report Share Posted November 4, 2008 Thanks a lot. The invoke node and the setting in VI-properties/Clear indicators worked. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.