Jim Kring Posted September 22, 2007 Report Share Posted September 22, 2007 [status: Reported to NI (waiting on response)] "vi.lib\Utility\VariantDataType\GetArrayInfo.vi" will always output a Size of zero (0) for any input array (it does not report the actual size). Download File:post-17-1190399556.vi Quote Link to comment
Darren Posted September 22, 2007 Report Share Posted September 22, 2007 QUOTE(Jim Kring @ Sep 21 2007, 01:35 PM) "vi.lib\Utility\VariantDataType\GetArrayInfo.vi" will always output a Size of zero (0) for any input array (it does not report the actual size). Hi Jim, I don't own these VIs, and I haven't seen the CAR, but my guess is that the "size" output is only valid for Fixed/Bounded arrays. Notice the "Type" output in the "Array Lengths" cluster of this VI. If the Type is Fixed or Bounded, I'd imagine you'd see a size there. 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. Hope this helps, -D P.S. - Fixed/Bounded arrays are a feature of the LabVIEW FPGA Module, as discussed http://zone.ni.com/reference/en-XX/help/371599B-01/lvfpgahelp/creating_fixedsize_arrays/' target="_blank">here. Quote Link to comment
Jim Kring Posted September 22, 2007 Author Report Share Posted September 22, 2007 QUOTE(Darren @ Sep 21 2007, 02:52 PM) Hi Jim,I don't own these VIs, and I haven't seen the CAR, but my guess is that the "size" output is only valid for Fixed/Bounded arrays. Notice the "Type" output in the "Array Lengths" cluster of this VI. If the Type is Fixed or Bounded, I'd imagine you'd see a size there. 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. Hope this helps, -D P.S. - Fixed/Bounded arrays are a feature of the LabVIEW FPGA Module, as discussed here. 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. 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 Quote Link to comment
Darren Posted September 22, 2007 Report Share Posted September 22, 2007 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 Quote Link to comment
Jim Kring Posted September 23, 2007 Author Report Share Posted September 23, 2007 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 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 Quote Link to comment
David Wisti Posted September 23, 2007 Report Share Posted September 23, 2007 QUOTE(Darren @ Sep 21 2007, 05:52 PM) P.S. - Fixed/Bounded arrays are a feature of the LabVIEW FPGA Module, as discussed http://zone.ni.com/reference/en-XX/help/371599B-01/lvfpgahelp/creating_fixedsize_arrays/' target="_blank">here. but FPGA doesn't support variants... Quote Link to comment
Darren Posted September 23, 2007 Report Share Posted September 23, 2007 QUOTE(dwisti @ Sep 22 2007, 10:08 AM) but FPGA doesn't support variants... To my knowledge, if you have the FPGA module installed, you can use fixed/bounded arrays in FPGA VIs or in normal VIs. -D Quote Link to comment
David Wisti Posted September 23, 2007 Report Share Posted September 23, 2007 QUOTE(Darren @ Sep 22 2007, 11:43 AM) To my knowledge, if you have the FPGA module installed, you can use fixed/bounded arrays in FPGA VIs or in normal VIs.-D Yea I know, I was just being a wise guy . I posted about http://forums.lavag.org/Fixed-arrays-t4434.html#' target="_blank">fixed arrays a while back. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.