LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with "Load" button and boolean reset

Solved!
Go to solution
Hello...

I builded a simple VI to load a ascii file with 100 values, split the file into 4 segments (overlaped by 50 %), and perform the calculation of SUM of the segments. Each segment is represented by a Graph and has a LED, that when is ON means that the segment will be use for the SUM calculation, when the LED is OFF that segment will not be used for the calculation.

I have two problems:

First: I inserted a Load Button and I need that when I push the button, one window open and let me to select the ascii file to load, after I analyzed the segments and take a note of the SUM, I want to push the Load button again and load another file to analyze. The problem is, the Load button works only once, on the second file that I try to load, the button freezes pushed and nothing happens and I need to stop the VI and run it again.

Second: by default, I need that after I push the Load button to load another ascii file all the LEDS change to ON state. In other words, by default all the 4 LEDS must be ON when a new file is loaded.

Thanks in advance

Daniel
Download All
0 Kudos
Message 1 of 14
(4,287 Views)

Hi dan07,

you have to integrate the event structure into your while loop. After you use the button the first time, the event structure will never be called, because of the data flow. To set the button values to true, you can use a local variable or a property node.

Mike

0 Kudos
Message 2 of 14
(4,281 Views)
Mike...

I integrated the Event Structure into the while loop, the Load Button now is working properly, but the function of my LED are not running. I don't know what happened.

About the default values to the LEDS, I tried to create a Local variable to each LED and feed the local variables with a TRUE CONSTANT, but I don't know how to link the action of push Load button with the action "Send true values to local variables of the LEDS"

Thanks

Daniel
0 Kudos
Message 3 of 14
(4,274 Views)
Mike...

sorry... here is the VI with the Local Variables.. but the LED selection function is not working...

thanks

Daniel
0 Kudos
Message 4 of 14
(4,262 Views)

Hi dan07,

try this example.

Mike

0 Kudos
Message 5 of 14
(4,258 Views)
What Mike said + to make the LED's true, put local variable in a flat sequence structure writing true to all of them. Wire the "sum" value wire to the flat sequence structure. You are not actually using the data, just preserving data flow and ensureing that they are not changed to True DURING the calculations.




Message Edited by StevenD on 06-09-2008 03:04 AM
0 Kudos
Message 6 of 14
(4,257 Views)
Mike....

Your example worked like a charm! Thank you very much.

StevenD, thanks for the help too.


Thanks all!!

Daniel
0 Kudos
Message 7 of 14
(4,245 Views)
The only thing that I didn't understand is why the timeout value is set to 100?

Thanks
0 Kudos
Message 8 of 14
(4,240 Views)
Hi dan07,
without a timeout value greater or equal to 0 the event will never execute. But because you want to change the values of your 4 buttons and see a result, it has to. Smiley Wink
Another way would be to create an event for the 4 buttons and react on it.
 
Mike
0 Kudos
Message 9 of 14
(4,233 Views)
The Timeout case (0) is always the case where the main activities of the VI must be in?

Thanks
0 Kudos
Message 10 of 14
(4,230 Views)