LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formula Node Array Indexing Problem

Solved!
Go to solution

Hi, I was wondering if anyone could explain the behaviour of this VI please? Is it a bug?

 

top indicator = 4

bottom indicator = [4,4,4]

 

Those both make sense; it's just the third element of the input array.

 

However I also get:

 

middle indicator = [0,0,0]

 

Why is that?

 

Thanks for any help!

 

LabVIEW Formula Node Arrays.png

0 Kudos
Message 1 of 10
(4,268 Views)

Example_VI.png

I don't see the [0,0,0]


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 10
(4,259 Views)

Oh...

I get this:

 

 

FrontPanel.png

0 Kudos
Message 3 of 10
(4,254 Views)

Ahhhhhh.....

 

Stick an "Always Copy" (programming, Aplication Control, Memory Control sub palatte) on both wire branches from the array constant.  The buffer alocation bug on forked array constants was fixed in 2013.

cute bug but, we know about it and its work aroundSmiley Wink


"Should be" isn't "Is" -Jay
Message 4 of 10
(4,244 Views)
Solution
Accepted by topic author Orbital

Have you applied the most recent patch to LV12SP1?  A similar issue was fixed there.  I applied the patch and got the expected result.

 

Try changing the constant 3 to a control to stop all of the constant folding and see what you get.

 

Edit:  Jeff's AC solution probably won't work as stated.  You should only apply the AC to a single branch.

Message 5 of 10
(4,239 Views)

@Darin.K wrote:

Have you applied the most recent patch to LV12SP1?  A similar issue was fixed there.  I applied the patch and got the expected result.


I applied that f5 patch this morning and I am not seeing this bug.  I didn't dig through the bug fixes yet though.  But it would appear to be fixed now.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(4,234 Views)

Thanks for the replies everyone. I've tried the "Always Copy" in a few places without any luck. I'm downloading updates at the moment so hopefully that will fix it.

0 Kudos
Message 7 of 10
(4,227 Views)

What about changing the constant to a control?  Just curious, the real fix is the update.

 

Always Copy is a little tricky with three branches.  I would try the following:  branch the array and put the AC node on one of the branches.  Now branch the wire out of the AC node and put a second node on one of those branches.  Other combinations may have optimizations applied that nullify the effect.

0 Kudos
Message 8 of 10
(4,215 Views)

@JÞB wrote:

 

Stick an "Always Copy" (programming, Aplication Control, Memory Control sub palatte) on both wire branches from the array constant. :


Is this another case where the icon for the "Always Copy" should be a band-aid?

0 Kudos
Message 9 of 10
(4,194 Views)

Applying all current updates for 2012 seems to have fixed this. Thanks for the help everyone.

 

I didn't see the comments about using a control instead of a constant until after I'd applied the updates so I didn't manage to test that, sorry.

0 Kudos
Message 10 of 10
(4,159 Views)