09-30-2019 08:03 AM
Hello All,
I am receiving the following delimited string over GPIB.
ST4;TA246;TD252;AF15;ME3;SP1850;SP2250;SP365136;MS 2
The instructions to interpret this string tell me convert to Signed Decimal when dealing with negative temperatures. The value I am trying to convert is 65136 which I supposed to be -40 Degrees C.
How can I do this in Labivew?
Can anyone point me in the right direction.
Thanks
Solved! Go to Solution.
09-30-2019 08:13 AM
09-30-2019 08:16 AM - edited 09-30-2019 08:16 AM
In addition to the convert to a U16 and then type cast to I16, it also looks like you will need to divide by 10 to get your actual temperature.
09-30-2019 09:43 AM
Isn't it enough to parse the string to I16 instead of parse U16 and type cast? Or it'll 'safe out' at +32k instead?
/Y
09-30-2019 09:53 AM
@Yamaeda wrote:
Isn't it enough to parse the string to I16 instead of parse U16 and type cast? Or it'll 'safe out' at +32k instead?
It will "safe out" to +32k (just tested to make sure).
09-30-2019 02:53 PM
But as Gerd already suggested, converting to I16 is the same as the typecast to I16, but simpler and less code (works for all integers if the number of bits does not change, of course).
(And if you only need the blue indicator, setting the indicator to I16 would even be sufficient, but you get a pretty coercion dot :D))