Jump to content

"GetArrayInfo.vi" always outputs array size of zero for any array


Jim Kring

Recommended Posts

QUOTE(Darren @ Sep 21 2007, 02:52 PM)

Hi Darren,

Thanks for the response. I don't have a CAR yet, but I'll post it, once it's made available to me.

> my guess is that the "size" output is only valid for Fixed/Bounded arrays.

If that's the case, then the documentation should reflect that.

> Since these VIs are only analyzing the type data of the variant, they would have no way of knowing the size of a standard array in LabVIEW (returned as the "Variable" Type in that cluster). But for Fixed/Bounded arrays, the size is part of the data type.

As you know, variants contain type and data information. So, there is no reason that this VI cannot look at the data, to extract the actual array length. That's how OpenG's "Array Size(s)" VI works.

post-17-1190412744.png?width=400

Either way, there's a bug -- incomplete documentation or incorrect functionality. I'd rather see the functionality change, but that depends on what the actual specification for this VI calls out (and maybe who, if anyone, is already relying on the existing behavior internally).

Thanks,

-Jim

Link to comment

QUOTE(Jim Kring @ Sep 21 2007, 05:16 PM)

As you know, variants contain type and data information.

Yup, but those VIs are only working with the type of the variant...they don't do anything with the value. And I don't suspect that will change. Remember that these VIs are the next generation of the type checking VIs that used to work on the I16 type array, they just use a variant now. I agree, though, that it would be helpful for the context help to indicate the specific behavior of the "size" output in relation to the "type" input. In fact, I'm pretty sure I was the one who did a code review with the author of these VIs before he added them to LabVIEW back a few versions ago, so I'll take partial responsibility... ;)

-D

Link to comment

QUOTE(Darren @ Sep 21 2007, 03:24 PM)

Yup, but those VIs are only working with the type of the variant...they don't do anything with the value. And I don't suspect that will change. Remember that these VIs are the next generation of the type checking VIs that used to work on the I16 type array, they just use a variant now. I agree, though, that it would be helpful for the context help to indicate the specific behavior of the "size" output in relation to the "type" input. In fact, I'm pretty sure I was the one who did a code review with the author of these VIs before he added them to LabVIEW back a few versions ago, so I'll take partial responsibility... ;)

-D

> Yup, but those VIs are only working with the type of the variant...they don't do anything with the value.

Well, since I don't have access to the block diagram of that password protected VI, I'll have to just take your word for it :P

So, can I turn this bug report into a feature request? It would be nice if the variant functions in vi.lib were a much more complete API, similar to... well.. the OpenG Variant Tools.

> Remember that these VIs are the next generation of the type checking VIs that used to work on the I16 type array, they just use a variant now.

I didn't know that. I don't recall having ever used the old ones.

Cheers,

-Jim

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.