LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 116 occurs at Flattened String To Variant when a fixed point number is used

I've got a fixed point number that I convert to a variant. I then flatten it to a string. Now when I try to reconstruct the variant by using "Flattened String to Variant", I get error 116. I'm currently using LabView 8.5. Do any of you know if this issue has been fixed in later releases?

 

0 Kudos
Message 1 of 8
(3,118 Views)

Hi OptEn_Mar...,

is it a known issue? Do you use the correct FixedPoint settings?

 

Mike

0 Kudos
Message 2 of 8
(3,113 Views)
I've looked around but can't find anything about this issue. I'm sure that the settings are correct. Its really simple to test. Try it and you will see.
0 Kudos
Message 3 of 8
(3,102 Views)

Hi OptEn_Mar...,

you are correct, i see the same behavior. There are two work arounds if you need the data as string.

 

 

Hope it helps.

Mike

Message Edited by MikeS81 on 03-03-2009 04:41 PM
Message 4 of 8
(3,098 Views)
Let me explain my problem in a bit more detail. I'm trying to split up a cluster using the openg vi  "Cluster to Array of VData". In this vi, they take the cluster and push it through the "Variant to Flattened String" block to get its type descriptor and flattened string. They then cut these two up to get to each cluster element's type descriptor and flattened string. By recombining them using "Flattened String to Variant" they generate an array of variants for the cluster elements. The problem comes in with the usage of the "Flattened String to Variant" block that can't handle fixed-point numbers. As a result, the openg block doesn't work. I'm trying to find a way around this problem, but don't know what to do. Your solutions depend on knowing what you are working with. However, I need a generic solution for any type of fixed-point number.
0 Kudos
Message 5 of 8
(3,072 Views)

OptEn_Marius wrote: 
... Your solutions depend on knowing what you are working with. However, I need a generic solution for any type of fixed-point number.

Hi OptEn_Marius,

if you want to transform your fixedpoint to variant and later back, then you also have to know what you want to get back.

For every transformation back from string or variant to a specific type you have to select the type you want to get, also with the type cast function. 

 

Mike

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

What I do once I have the variants is to analyze each one's type by using the openg block "Get TDEnum from Data". Since I then know what I'm working with I know what type to wire into type terminal of the "Variant to Data" block. With regards to a fixed-point number I simply wire in a double to the "Variant to Data" block when I do the final conversion -  the double I end up with is fine for the purpose I'm using it for. The problem however comes back to "Flattened String to Variant" vi that does not want to work with fixed-point types. Do you know if NI fixed this in later releases? I'm currently using version 8.5.

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

Hi OptEn_Marius,

see this link http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/funcs_support_fxp/. There are all supported functions and "Flatten String to Variant" or back is not on the list.

 

Mike

Message Edited by MikeS81 on 03-05-2009 01:00 PM
0 Kudos
Message 8 of 8
(3,055 Views)