LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing 1D array to subVi causes nullified array...

I'm trying to pass an array of fault counters (starting at zero and counting +1 every time a fault condition is met) to a subVi that may or maynot add to the indvidual elements and then passes out to a shift register.

 

When the code runs the signal coming from the Main Vi outputs once the 2,0,0,0 array intot the subVI "shift register fault array" input, then goes grey (probe display).

 

The "shift register fault array" in the subVI never sees the 2,0,0,0 array and remains greyed out. 

The build array correctly builds the current cycle fault elements but when added to the greyed "shift register fault array" the output becomes greyed 0s.

 

I built a simply array adding VI to test if my property node call was causing the issue but the test program works correctly.

 

Any ideas?

 

 

0 Kudos
Message 1 of 11
(3,712 Views)
0 Kudos
Message 2 of 11
(3,711 Views)

Hi ian,

 

what's the point in attaching images when you want help on debugging a VI?

Is there a reason NOT to attach the VI or a snippet?

 

From your images I would guess it's the heavy overuse of "value" property nodes in your VIs that causes the problem.

Ever heard of race conditions?

 

THINK DATAFLOW! (Or: Use more wires…)

 

The "shift register fault array" in the subVI never sees the 2,0,0,0 array and remains greyed out. 

Here I suspect the race condition.

 

The build array correctly builds the current cycle fault elements but when added to the greyed "shift register fault array" the output becomes greyed 0s.

That's standard behaviour for array handling in LabVIEW. As is explained in the LabVIEW help and all those free beginner courses…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(3,708 Views)
It's a rather huge program so I though small snippets would help with identifying the array passing issue.
0 Kudos
Message 4 of 11
(3,704 Views)

Hi ian,

 

if you would attach snippets, I wouldn't complain!

But you are only providing us with stupid images

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(3,699 Views)

Learned what Labview Snippets are Smiley Happy

0 Kudos
Message 6 of 11
(3,692 Views)

Snippets don't really work well in this case (lots of broken wires and artificial property node substitutions).

0 Kudos
Message 7 of 11
(3,680 Views)

In your main VI snippet, you are reading values from a property node of the array.  Where is the terminal for that array?  Is it a control or indicator?  Like Gerd stated, this seems like a race condition problem.

 

Note:  Index Array is resizable.  You don't need to drop down 4 index arrays and wire up constants to each one.  Drop down one and drag the bottom border downwards.  You'll get indices, 0, 1, 2, 3 all by default.  You can also do a single comparison of >= 10 on the numeric array to get a boolean array, then do the index array on that.

0 Kudos
Message 8 of 11
(3,668 Views)
The property node getting passed to "5ch Fault Logic" subVI is not part of the array, its a single value for the cycle counter. I just tried puttting the mainVI portions of intializing the array and 5ch fault logic into seperate flat sequence frames but did not change the outcome.
0 Kudos
Message 9 of 11
(3,655 Views)

Replace all those "value" property nodes by wires.

This will solve your problems - much faster than drawing a lot of (Rube-goldbergish) sequence frames!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(3,635 Views)