11-13-2019 04:59 AM
Hello People,
I am doing data logging
I am taking data from waveform and then saving all data to text file.
I am not able to convert data(variant) Attributes to string to store in text file.
I Need variant to string conversion function , I tried using varaint to flattened string but it does not worked
and even flatten to string function
Thanks in Advance😌
attached VI
Regards
Vishal
11-13-2019 05:20 AM
Variant To Data
11-13-2019 05:23 AM
Hi vishal,
@vishal231 wrote:I am not able to convert data(variant) Attributes to string to store in text file.
I Need variant to string conversion function , I tried using varaint to flattened string but it does not worked
and even flatten to string function
What does not work? Where did you fail? Where's the attached VI?
You can read any variant attribute using the GetVariantAttribute function: what is your problem with this?
11-13-2019 05:32 AM
If you want a human readable form of the variant attributes, check out this vi: <labview>\vi.lib\Utility\tdmsutil.llb\formatPropertyList.vi
Feed it the output of Get Variant Attribute.
11-13-2019 06:19 AM
@cordm wrote:
If you want a human readable form of the variant attributes, check out this vi: <labview>\vi.lib\Utility\tdmsutil.llb\formatPropertyList.vi
Feed it the output of Get Variant Attribute.
Good one.
I'd copy that VI and modify it to suit my needs (you want need different name\value formatting).
Still not sure what OP wants. (S)he mentions attributes, but I think these are attributes of the TDMS file, so it would be about converting a variant value to string.
Variant To Data works if the variant value is a string, your suggestion converts other data types to string.
11-13-2019 07:08 AM
hello ,
Thanks for replying
here the VI,
I will be variant to be converted into string for storing in text file.
i guess get variant Attributes will give me variant only and still soversion will be left
11-13-2019 07:19 AM
Hi vishal,
@vishal231 wrote:
here the VI,
There are no "variants" visible in the VI block diagram. I also don't see where you (attempt to) "convert variants to string"…
@vishal231 wrote:
i guess get variant Attributes will give me variant only and still soversion will be left
Why do you "guess" instead of "trying out"? Why don't you read the LabVIEW help on variant attributes and the functions to handle them?
How are variant attributes even related to your VI?
11-13-2019 07:20 AM
@vishal231 wrote:
Thanks for replying
here the VI,
I will be variant to be converted into string for storing in text file.
i guess get variant Attributes will give me variant only and still soversion will be left
Soooo many questions.
1st one: where are the variants?
11-13-2019 07:22 AM
hello,
see the issue I have pasted
11-13-2019 07:24 AM - edited 11-13-2019 07:28 AM
Hi vishal,
where exactly does that error occur?
Which function is highlighted when you select "stop"?
The code shown in your last image is different to your attached VI. When we should help on your code problems then you should attach that code!!!
Why is there no error handling in the inner FOR loop?
Why are there no inputs/outputs connected to GetVariantAttribute?
I repeat my question from above: Did you read the LabVIEW help for those variant functions?