LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create double with exponent and mantissa

Solved!
Go to solution

I DAQ two analogue values from a Helium leak detector: one signal is a step function indicating an exponent (between 1 and 10 Volts, 0.5 V steps) and the other signal indicates the mantissa in the 1-10 V range. I take the mantissa value as it is, and I convert the exponent step function into an integer value. This part is simple. So the leak rate can be constructed in the following way: AI0 * 10^Exponent.

 

I could just use a formula node, but I wonder if there is a neater solution to create a scientific format double? I know there is an inverse function:

 

mantiss.png

 

Edit: Ok, I guess this is the possibly most simple way in LabVIEW, isn't it? -->

 

calc1.png

0 Kudos
Message 1 of 11
(4,634 Views)
Solution
Accepted by topic author Blokk

I would agree, taking a power of ten to the matissa is what you want.

 

Bob Schor

0 Kudos
Message 2 of 11
(4,620 Views)
Thanks, I just wanted to be sure I do not miss a special trick or "mini nugget" 😃
0 Kudos
Message 3 of 11
(4,615 Views)

Well, there are plenty of slower ways to get the same answer ...  I'd say that you, not I, deserve the "solution" (I only said "I agree") ...

 

BS

0 Kudos
Message 4 of 11
(4,602 Views)

The agreement was the solution I was seeking 😉

0 Kudos
Message 5 of 11
(4,597 Views)

Hi,

 

I was looking for a solution to this myself and found this post. However, the double should be mantissa x exponent ^ 2 - i.e. the Power of 2 vi should be used rather than Power of 10. At least this is what works on my machine / version of Labview - do some machines use Decimal32 IEEE-754?

0 Kudos
Message 6 of 11
(4,196 Views)

@redfrank wrote:

Hi,

 

I was looking for a solution to this myself and found this post. However, the double should be mantissa x exponent ^ 2 - i.e. the Power of 2 vi should be used rather than Power of 10. At least this is what works on my machine / version of Labview - do some machines use Decimal32 IEEE-754?


Sorry, I do not understand why you would use a power of 2? Anyway, in my case the manual of the leak detector clearly states that the mantissa and the exponent to be used the usual way to form a double number:

Value = mantissa * 10^Exponent

0 Kudos
Message 7 of 11
(4,192 Views)

Ahh, apologies, helps if I read the full post about- just skipped to the bit I was interested in which was the solution you had posted, and missed the whole reason you wanted to do it... Looks like the leak detector is using a Decimal32 representation. I am taking a 32 bit word from a message received by my test software and trying to convert this into a Floating point IEEE-754 number. Unfortunately it's not been specified whether it uses binary or decimal but was assuming binary as this seems to be the "standard" float convention. I proved my solution by converting it back using the Mantissa and Exponent vi, and it matched my original number, as Labview / the PC must be storing doubles as Binary32.

I thought you had done the same by running it through the Mantissa and Exponent vi - I assume you haven't as this uses Binary32?

 

Sorry for the confusion!

0 Kudos
Message 8 of 11
(4,184 Views)

I see 🙂 Well, in my case I measure analogue signals, not digital values. So after some scaling I use them as floating point values to form the mantissa and the exponent.

 

0 Kudos
Message 9 of 11
(4,179 Views)

Semantic nit pick: The thing being referred to as a "mantissa" is properly called a "significand".  A mantissa is the fractional part of a logarithm. 

"If you weren't supposed to push it, it wouldn't be a button."
Message 10 of 11
(4,156 Views)