LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert from string to double?

I have a concatenated string that needs to be converted to double to be used in a subvi. How can I convert this? I'm using LabVIEW 7.0. Thanks!
0 Kudos
Message 1 of 6
(4,821 Views)
There is a function in the String>String/Number Conversion subpalette that does the job. Not sure that this is the answer you are expecting, since I don't see what the "concatenated" info is hiding...

See the attachment

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 6
(4,809 Views)
I wasn't sure if it being a concatenated string had to do with anything, I just thought I'd mention it in case. I couldn't open the file because it was created with LabVIEW 7.1, and I'm using 7.0.
0 Kudos
Message 3 of 6
(4,806 Views)
We need to know more about your string. 😉

(1) Is is a human readable string consisting of the decimal numbers characters 0..9, a possible decimal point character and/or the character "e"?
(2) Is it a string of 8 binary bytes representing the DBL in binary format?

For (1) use one of the string functions, e.g. "Fract/Exp string to number" or "scan from string (with %f as format)", etc.

For (2) use typecast with "DBL" as type. If the string is in little-endian, you need to reverse it first.

(edit: typos)

Message Edited by altenbach on 03-19-2005 02:08 PM

0 Kudos
Message 4 of 6
(4,806 Views)


@amw026 wrote:
I wasn't sure if it being a concatenated string had to do with anything, I just thought I'd mention it in case. I couldn't open the file because it was created with LabVIEW 7.1, and I'm using 7.0.


Sorry !
Here is a 7.0 version
CC
Chilly Charly    (aka CC)
0 Kudos
Message 5 of 6
(4,784 Views)
I got it working. Thanks for the help!
0 Kudos
Message 6 of 6
(4,781 Views)