LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scanned Variable Write problem with Sub-Array?

Here's a weird one.  I believe this may be a compiler issue.

 

Why is the wire broken after the sub-array?  Adding a diagram disabled connection between the orginal array and another copy of the subvi fixes the wire?

 

I'm using LabVIEW/RT 2010 sp1

 

 

 

IOScanned Write Bug.png

0 Kudos
Message 1 of 5
(2,490 Views)

Interesting.

 

When I loaded your snippet into LV 2012, the wire wasn't broken.

 

Loading it into LV 2010 it is broken.  It seems like a bug.

 

I figured it must be some datatype issue.  I deleted the wire and created an indicator out of the array subset function.  It said it was a 1-D (sub)array of Double.  The wire coming out of the Array subset to the left says "1-D array of Double".  That seems like an odd difference.

 

So now I'm suspicious of the Array Subset function even though they look identical.  I made a copy of the one on the left and wired that up to the Scanned Variable VI on the right.  It worked.  So I then deleted the wire and connected it back to the original array subset function.  It worked.  But I still had the copied array subset connected to the source constant.  When I deleted that wire, the wire going to the scanned variable broke again.

 

See attached VI.

Message 2 of 5
(2,474 Views)

I wonder if the Always Copy would fix this...


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
Message 3 of 5
(2,468 Views)

@crossrulz wrote:

I wonder if the Always Copy would fix this...


Good idea.  When I inserted that into the middle of the broken wire, it appeared to work.

 

It still seems like a bug.  Why does it work fine on the left side, but not on the right?  I had tried to do a recompile with the Ctrl-Shift Run arrow, but that didn't fix anything.

Message 4 of 5
(2,464 Views)

@RavensFan wrote:

Interesting.

 

 

I figured it must be some datatype issue.  I deleted the wire and created an indicator out of the array subset function.  It said it was a 1-D (sub)array of Double.  The wire coming out of the Array subset to the left says "1-D array of Double".  That seems like an odd difference.

 



RavensFan,

 

I think you nailed it right on the head with this observation.  The output type of the Array Subset has that additional "(sub)" inserted in the type name.  The Scanned Variable Write VI must not be tollerant to this type (even though it is actually still an "array" type).  The "Always Copy" and the Diagram diable tricks seem to cast the data type such that the "(sub)" is removed.

 

To fix this, I'm guessing, NI would need to either modify the Scanned Variable Write VI so that data type is accepted or remove the "(sub)" the output of the Array Subset Datatype.

 

-Chris

0 Kudos
Message 5 of 5
(2,453 Views)