09-05-2014 11:35 AM - edited 09-05-2014 11:38 AM
Hey Everyone,
I'm having anissue with a subVI which takes a user file, plays with the file path data type until it is in the form of a string and then puts it into a string array in a list box. The issue I'm having is that I've created input and output terminals to the buttons seen in the image, but the event case structures they control aren't executing when I press the buttons that are wired to the terminals of the sub VI (the buttons up one level from the image below). They DO work when I use the subVI front pannel rather than the front pannel of the VI that's the next level up.
So far I've tried:
-Moving the buttons into the while loop
-Moving the buttons into the event structure
-Changing the event case handling to execute on a mouse click of the button vs. a value change
Thanks in advance for any help anyone is able to give me!
Solved! Go to Solution.
09-05-2014 11:43 AM - edited 09-05-2014 11:45 AM
Yeah, writing a value to a terminal never causes a value change event. Think of it as a "User Changed Value" event. To programatically fire a value change event you must write to the Value(Signaling) property of the control or indicator.
Latching booleans do belong in the event case that handles the VC event.
You could read the terminal (use a local varible) before the while loop compare it to the last value (use a feedback node) and use a case structure to determine if you want the VC event to fire based on the value passed in from the caller.
09-05-2014 11:47 AM
after what Jeff said , do not use two event structure into a single vi or worse in one while loop.
register every action with one event structure only
09-05-2014 12:19 PM
Thanks for the replies! How would I read the value from the terminal if the button's value can only be altered by user input? Do I have to take the input as a string or integer type and convert it to a boolean? Also, what's the harm in using multiple event structures in a while loop? Does it prohibit Labview from making use of multi threading? Thanks again for all the help!
09-05-2014 12:24 PM
@RASGary wrote:
Also, what's the harm in using multiple event structures in a while loop?
For one, a loop can't iterate until everything inside has completed. So, in your code, you would have to add an item AND clear the list in order to iterate the loop. I really don't think you want that.
You might want to look into an Action Engine. The idea I'm thinking here is that you change your subVI so that it doesn't use the event structure. Instead, it uses a case structure to react based on whatever action you want. You can then use that code in the main VI.
Or the simple solution is to just make the subVI's front panel visible when it is called. This would eliminate the need of the GUI on the front panel, though.
09-05-2014 12:34 PM
Thanks again for the help, I'll try a few of these methods and make sure I accept a whichever one works best as the solution when I figure it out!