Jump to content
Taylorh140

Are LabVIEW Variant attributes accessible in C?

Recommended Posts

I have Created a dll that takes a variant pointer and sets the value to a string. Its very simple... But i want to easily move information to and from LabVIEW with very little overhead. I was wondering if there was a equivalent C api for Get/Set variant attributes? 

 

cviauto.h has many variant related functions that work well for manipulating data inside the variant but i can't seem to access the attributes.

Share this post


Link to post
Share on other sites

I have Created a dll that takes a variant pointer and sets the value to a string. Its very simple... But i want to easily move information to and from LabVIEW with very little overhead. I was wondering if there was a equivalent C api for Get/Set variant attributes? 

 

cviauto.h has many variant related functions that work well for manipulating data inside the variant but i can't seem to access the attributes.

 

You have a misunderstanding here. LabVIEW really knows two variant types. The ActiveX variant which is supposedly what you also can interface to with the cviauto.h file and the native Variant. When you pass a native variant to a Call Library Node configured to accept an ActiveX variant, LabVIEW is converting from one to the other which in fact means creating a complete copy of all the data inside. However ActiveX variants do not know attributes in the sense as the LabVIEW variant does. So those attributes are not only not converted but can not be passed in a meaningful way along with the ActiveX variant and are therefore simply not present on the ActiveX side.

 

While you can pass a native variant to the C code with the Adapt to Type configuration in the CLN this doesn't buy you anything since the C API to access the native variant data is not officially documented by NI.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.