06-01-2011 10:50 AM
I seem to be having issue pass values to my sub VIs in a subpanel. I'm using the invoke node and control value set command.
I am able to pass a database reference that I'm using, but when I try Boolean values, I get no response. I'm also trying to use one of the Boolean values to fire an event. The front panel of my sub VI looks as though the FP button is being pressed, but my value doesn't change and my event doesn't fire.
I've reviewed as may forum threads as I could and have looked through the bug reports without any luck. Any ideas?
06-01-2011 06:23 PM
Attached your vi, so that we can look at it. Have you tried to change the mechanical action of your boolean to switch instead of latch? That may help.
06-01-2011 07:28 PM
Hi Clampy,
This boolean/signalling problem sounds familier - is the button's mechanical-action "latched" (and value property variant type)? If so, try changing button action to not be latched.
Luck/Cheers.
06-03-2011 09:33 AM
Thanks guys. No luck though. I did have the mechanical action set to latch when released. Changing it to switch w/r had no effect.
Here is a side question for anyone: Why does the "latch" only switch the value momentarily, but "switch" holds the value until changed again? In all my years working w/ LV I never under stood that and just accepted it. Why did NI decide to title those actions exactly opposite of what most normal humans would interpret that as being?
Now back to the subpanels, In one instance I'm trying to pass a boolean constant, so I wouldn't expect that to have any effect on what so ever.
The other thing I though of is that I'm passing my reference before starting the sub VI, and then trying to pass both my booleans after. I'll try reversing that to see if it works momentarily, but if that is the case, it seems that there is no way to interact data with the running VI then. That limits the usefulness of subpanels even further.
I'll try to post the code snippet here shortly.
06-03-2011 09:42 AM
Also tbd, what do you mean by "(and value property variant type)?"
Do I need to convert the boolean to a variant before passing it?
06-03-2011 09:48 AM
If you want to fire an event in the subpanel, you need a reference to the boolean control in the subpanel. Use the "value signaling" method to fire your event, if you pass using the VI refnum and control set, it will not fire the event!
Depending on the latch type, the value signaling will be a variant in which case, you cannot fire the event. You have to use one of the latch modes, then the value signaling is a boolean data type and then your good to go.
Hope this helps.
06-03-2011 11:27 AM
Tried a couple things with some of you suggestions, no solution yet.
Attached is my code.
How do you pass a ref to the sub panel? Correct me if I am wrong, but isn't the subpanel essentially an invoke node? LV won't let me wire a ref to the control to the subpanel invoke node. Can you elaborate on your recomendation?
06-03-2011 12:35 PM - edited 06-03-2011 12:39 PM
attached is the code snippet. You can use this as a subVI in place of where you are setting the control value or just hammer the code in directly. Add error handling as you see fit, although you should note that if you use the error handling within the for loop, you will probably get an error, probably better to move the 'to specific' outside the loop.
06-03-2011 12:49 PM
Got the variable name wrong in the example. you will need to change it. Sorry