LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant Data and Data (Type)

I'm on my way to build a XML parser for my program.

How do you make Variant display it's Data and Data (Type) like the one on my screenshot?

I dont want my data type be a string. I want it to be the same as my cluster.

Is there a way to edit the data and data type for a variant control and return the same data for it's indicator?

 

Thanks!

 

Download All
0 Kudos
Message 1 of 8
(3,372 Views)

@saintalan94 wrote:

Is there a way to edit the data and data type for a variant control and return the same data for it's indicator?


Though your question isn't very clear, I would like to mention that Variant data type is a generic container which can hold any other data type.

Now in order to edit/modify the original data type (before it was converted to Variant), you can do it only when it is in its original form (and not when it is converted to Variant). And if you're interested in knowing what was the original data type, you might want to check this link.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 8
(3,362 Views)

moderator1983,

 

Is it possible to manipulate the data by using string and convert it back to a variant?

I have done a replica using string to a variant but the data type is showing both data and data(type).

Btw, the VI at the link you provided have a password, I cant even look into the VI.

Help is muchly appreciated. (:

0 Kudos
Message 3 of 8
(3,356 Views)

Can you demonstrate how exactly you're editing the Variant data type, as string...!!

 

Below is an example, where I converted a cluster (Error data type) into variant and also displayed it on the Front Panel.

 

Cluster to Variant

 

Now if you wanna edit the original cluster data, by editing the string displayed in Variant indicator, this is not a good idea. Ideally you should convert the Variant data type to its original data type and thendo modification and convert it back to Variant.


@saintalan94 wrote:

the VI at the link you provided have a password, I cant even look into the VI.


Those VIs are provided as it is from its developer and even I don't have the password.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 8
(3,345 Views)

moderator1983,

 

to be frank, I'm actually extracting data from a XML string and replace the data of the variant data type and format it back to variant where It gives me a variant with data type String.

I know it will give me this answer but I dont have any idea how to make it work.

I have been taking reference from EasyXML parser by JKI.

0 Kudos
Message 5 of 8
(3,341 Views)

To make my question more comprehensive.

Is it possible to create "data" using string, "type" using another sting then concatenate both string and to a variant.

0 Kudos
Message 6 of 8
(3,316 Views)

@saintalan94 wrote:

Is it possible to create "data" using string, "type" using another sting then concatenate both string and to a variant.


No.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 7 of 8
(3,311 Views)

Take a look at the OpenG LabVIEW Data Library and as a good example in how to use those VIs also the OpenG Variant Configuration File Library. They implement it by parsing the typedescriptor of the Variant to Flatten node and use a type enum for the return conversion. This is not the string you require but the only workable way with the functionality as provided by LabVIEW. And when using the OpenG library you don't have to create all the type specific VIs to do the conversion based on the enum but can simply reuse it.

 

The easiest way to get OpenG libraries onto your system is by installing VI Package Manager first if you haven't it already on your system.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 8
(3,303 Views)