LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use a type descriptor to convert a variant to data?

Jean-Pierre:
In this answer you mentioned that to unflatten a string the incoming datatype must be tested. I believe you have outlined this process in another thread but I can't find it now. How is this checking accomplished?

I tried to interpert the type string from a flatten to string.vi and the datastrg.pdf but the document doesn't seem to apply to Lv6.0 . Two booleans produce totaly different hex type strings.

I am attempting to develop a generic VI which can interogate a running VI, identify it's controls and then get current control values. The application is: one data collection VI and a completely independent user interface, not a master/slave or VI/subVI relationship. I want to make it generic so that I c
an provide the vi path and control names to the function and it will retun the control values.

Thank you for your assistance. Your help is invaluable to the forum.
Brian Wells
0 Kudos
Message 11 of 20
(3,033 Views)
Brian,

That is the perfect application for LabVIEW Data Tools that I discussed here. The toolset will allow you to manipulate the variant data you receive from the value property. There is a template VI that does the type checking using the type code within the type descriptor. It cannot be overstated how powerful these tools are to a developer for creating flexible reuse tools.
Enjoy.


LabVIEW, C'est LabVIEW

0 Kudos
Message 12 of 20
(3,034 Views)
Jean-Pierre:
I downloaded the files on the link you referenced and inspected them. Unfortunatly, of the vi's I opened there has not been one vi that hasn't included subvi references that I do not have on my machine. For example "Get Array Element TDEnum.vi".

Why are these subVI's not included in the distrubution?Additionally do you recall which vi has the type descriptor decoder functions?

Thank you for your help,
Brian Wells
0 Kudos
Message 13 of 20
(3,033 Views)
Sorry if the installation is still difficult due to package dependencies. We are currently working on that.

You have to download and unzip three packages: error + lvdata + variant config. Copy the directories within the unzip files/dirs to your user.lib directory. LabVIEW then shouldn't have problem to find subVIs.

The VI that outputs the type code of data is "Get TDEnum from Data.vi". The template VI "Variant Manipulation Templ.vit" shows how to use the type code to manipulate data according to its type. There is not a single VI that decodes the whole type descriptor as such. However, you can take a look at VIs like ""Write Key (Variant").vi" which recursively parses the structure of the input data to write it to a
n INI file.


LabVIEW, C'est LabVIEW

0 Kudos
Message 14 of 20
(3,033 Views)
Brian,

I have released "all_packages" at
http:\\sourceforge.net\projects\opengtoolkit

that includes all other packages in a single zip file.

However, OpenG distribution will be made using a package manager in the near future (rather than single file) because we expect OpenG.org to be the repository of thousand(s) of VIs. We are trying to avoid a monolithic tools distribution. Instead we are
focusing on an open package management framework. Specifically an application that will automate packaging, installation, and management of developer tools. We hope to encourage a standard for packaging and distribution of tools by various individuals and organizations in a multi platform environment.


LabVIEW, C'est LabVIEW

0 Kudos
Message 15 of 20
(3,033 Views)
Sorry, the link should be:

http://sourceforge.net/projects/opengtoolkit

-Jim
0 Kudos
Message 16 of 20
(3,033 Views)
:-)))

I always check the links I post to DE by clicking on them in the view page before submitting... and this one actually worked! It still does with IExplorer, that I guess is forgiving for these slash errors...

Sorry and thanks, Jim!


LabVIEW, C'est LabVIEW

0 Kudos
Message 17 of 20
(2,696 Views)
Yes, but only in IE on Windows. It doesn't work in IE on my new Mac 😉

I guess that Microsoft is reciprocating by forgiving your mistakes. Maybe its a way of saying "thank you" for living with a less than perfect OS for all these years... wow, I'm becoming a cynical Mac user already :-))

-Jim
0 Kudos
Message 18 of 20
(2,696 Views)
Thank you Jean-Pierre.
I just downloaded the package and it looks like a lot of help to me. I am trying to make a readable config file out of a bunch of clusters. And the example file 'Example - Read Write Config File Cluster.vi' does exactly that.
Just a few modification should be necessary to fulfil my needs.
Roar.
0 Kudos
Message 19 of 20
(2,696 Views)

I came into the same problem of using a type descriptor to convert a variant to data,but i found the method from this note.

Thank  you very much.

Chun Jiang

0 Kudos
Message 20 of 20
(2,348 Views)