From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i have a Build Array function within a case structure. This array gets populated properly but I am unable to pass this array out of the case structure.

I'm including a .png file that shows how I've coded this array.  This is part of a subvi.  Do arrays/loops behave differently in subvi's than in vi's?
0 Kudos
Message 1 of 8
(2,553 Views)

You need to wire the array across in the other case.

 

Right now your tunnel uses "use default if unwired", meaning you get an empty array whenever the other case executes. The empty array will go into the shift register, overwiring all existing data there.

Message Edited by altenbach on 05-22-2009 11:37 AM
0 Kudos
Message 2 of 8
(2,548 Views)
Of course you get nothing out. You have nothing wired in the false case. You have selected Use Default If Unwired. That's an empty array. Wire the shift register through in the false case. You would have the exact same problem in a main VI.
0 Kudos
Message 3 of 8
(2,544 Views)
Thank you.  I have now wired the false case and added an indicator between the case structure and the for loop.  I do get the indicator array (Array) to populate properly but the final indicator array (Array 2) remains empty.  I've included a new screen shot.
0 Kudos
Message 4 of 8
(2,523 Views)

The final indicator will update once the loop has finished. That's dataflow!

 

Use execution highlighting to get a better idea how things work.

Message Edited by altenbach on 05-22-2009 12:03 PM
0 Kudos
Message 5 of 8
(2,519 Views)

Can you attach your actual VI?

 

I think there are a few more problem areas, for example:

  • Why are you reading "time Stamp 3" from a value property node with each iteration of the loop? Due to the speed of the loop is very unlikely that that value changes between iterations (and if it would, it would give unpredictable results!). Thus you should read that value once before the loop or better just wire from the actual terminal. Property nodes force synchronous execution and are several orders of magnitude slower than any other method of data transfer.
0 Kudos
Message 6 of 8
(2,509 Views)
Thank you for your very helpful observations.  I've removed the timestamps from inside the loop.  The performance information concerning property nodes makes me a little sad---I liked not having so many wires on my diagram but performance is too important so I'm going back to direct wiring.  Thanks again.
0 Kudos
Message 7 of 8
(2,480 Views)

There is nothing wrong with wires. If you really don't want to use a wire, you might be able to use a local variable.

 

You should only use value property nodes if there is no alternative (e.g. point to an element inside of a cluster or to a control in another VI, for example)

0 Kudos
Message 8 of 8
(2,476 Views)