LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with variant data

I am using a VI that is called from Teststand. I go to teststand to get
different variables from a sequence file that is running. I don't know at
any point in time what the variable type is, so I use the Get Val Variant
method. I have a vi with an input parameter of type variant. I have a
problem distinguishing between a string and a numeric value coming in the
variant input. If the variant was a string value of 4 a probe on the input
looks like this:
Value -> 4

If the variant was a numeric value of 4 a probe on the input looks like
this:
Value -> 4.000E+0

These seem to be different but I have no way to programatically determine
this difference. I have tried to use the variant to flattened string but
it
gi
ves the exact same value for both of these variant inputs. If I convert
to string or number they both give 4 when using the Variant to Data.vi. I
am not sure what the problem is.
Thanks,
________________________________________________
Kenny Ham - Research Engineer
Southwest Research Institute
Warner Robins, GA 31088
Email: kham@Swri.org
0 Kudos
Message 1 of 2
(2,301 Views)
fasttech wrote:

> I am using a VI that is called from Teststand. I go to teststand to
> get
> different variables from a sequence file that is running. I don't
> know at
> any point in time what the variable type is, so I use the Get Val
> Variant
> method. I have a vi with an input parameter of type variant. I have
> a
> problem distinguishing between a string and a numeric value coming in
> the
> variant input. If the variant was a string value of 4 a probe on the
> input
> looks like this:
> Value -> 4
>
> If the variant was a numeric value of 4 a probe on the input looks
> like
> this:
> Value -> 4.000E+0
>
> These seem to be different but I have no way to programatically
> determine
> this difference. I have tried to use the variant to flattened
string
> but
> it
> gives the exact same value for both of these variant inputs. If I
> convert
> to string or number they both give 4 when using the Variant to
> Data.vi. I
> am not sure what the problem is.
> Thanks,
> ________________________________________________
> Kenny Ham - Research Engineer
> Southwest Research Institute
> Warner Robins, GA 31088
> Email: kham@Swri.org

Kenny,

Did you tried to set data type attribute to Variant? This will
characterize your data properly and solves the problem of getting proper
data type when receiving. Just couple vi's to add from variant palette.

--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
0 Kudos
Message 2 of 2
(2,301 Views)