LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Correct way of using the Variant Get/Replace In-Place Element Structure function?

I did a similar speed test, but I am seeing some strange behavior depending on whether I have indicators shown or not.  You can see the details and the VI I created on this post: 

 

https://lavag.org/topic/19722-lv2016-new-in-place-struct-border-nodes-for-variant-attribute-access/?...

 

 

Director of Engineering
G Systems, www.gsystems.com
Certified LabVIEW Architect
Certified LabVIEW Embedded Systems Developer
Certified Professional Instructor
0 Kudos
Message 11 of 13
(727 Views)
Highlighted

So I was reminded of this thread and the questions is raised, and I was wondering about the best way to perform a read on a variant attribute, and how the performance varies with the primitive solution.

 

What I found is the primitive for reading variant attributes is consistently faster than the IPE.  One reason for this is that you have to convert the data type to the actual type you want, because the IPE returns the attribute as a variant, where the primitive returns it as the data type you specify.  Attached is my updated speed test with the two reads.

 

Does this mean if you want to just read the data, that you should use the primitive, and if you want to replace, or read/modify/write you should use the IPE?

0 Kudos
Message 12 of 13
(598 Views)

I see the same as you Hooovahh, if you just want to read the get variant attribute function is a tad faster than using the in-built structure...which kind of makes sense as you are not really avoiding the cost of having to manipulate the attribute content of the variant..For anything that involves changes to the attributes, he in-place structure is the best solution.

MTO
Check out ClampOn CAN Monitor on the LabVIEW Tools Network.
0 Kudos
Message 13 of 13
(574 Views)