LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data out of a while loop?

I can't pass the value of a list box out of a while loop. I have tried:

1) A non-indexing tunnel
2) Shift Register
3) Local variable
4) Property node of "value"

For the local variable and property node I tried one for the list and also for an intermediate varible inside the loop.

None of these will pass the value. This is Labview 7. I can't figure out what is wrong.
Thanks,
Lou
0 Kudos
Message 1 of 7
(4,778 Views)
Lou

try using the Item Names Property

Good Luck

Dan Bookwalter
0 Kudos
Message 2 of 7
(4,778 Views)
When I wire the listbox inside the while loop to the choice indicator outside, it correctly passes the value of the listbox. Here's the fixed version. I hope you realize that you won't get Choice to update until you stop the while loop. Your example doesn't work because there is no data flow from the while loop to the property node and the indicator is getting updated at the same time the while loop starts. Just because you have it to the right of the loop doesn't mean it gets executed after the while loop.
0 Kudos
Message 3 of 7
(4,778 Views)
That gets me the array of strings in the list box but not the actual numeric value from the list box.
Thanks,
Lou
0 Kudos
Message 4 of 7
(4,778 Views)
Dennis,
When I tried it originally I was able to get it to update when the while loop was stopped.

What I'm trying to do is figure out a way to pass the current value from the list box off to an active X register event callback via the user parameter input. When I run the program it should just sit there and wait for the call back, and the current value of the listbox should be fed to the callback, without having to re-start the program.

I don't want to put any of the active X stuff inside the while loop since it would constantly poll the aplication I'm trying to control.

The attached VI won't execute but is an example of what I'm trying to do.

Thanks,
Lou
0 Kudos
Message 5 of 7
(4,778 Views)
I think you can get what you want by using the event structure in the main VI. I've modified the main VI to call your subVI only with a value change of the list box. I also modifed the subVI to add the listbox input to the connector pane. I'm not sure exactly what you're trying to accomplist in the subVI so if this isn't what you want, could you explain in more detail.
Download All
0 Kudos
Message 6 of 7
(4,778 Views)
Dennis,
Your listbox2 does what I need. Using this I can put the Active X stuff inside the while loop and only have the while loop execute if there is a change in the list box.
Thanks for your help,
Lou
0 Kudos
Message 7 of 7
(4,778 Views)