03-27-2011 10:55 AM
Hi friends,
I have a problem, i have a program to read a signal from a DAQ and put it in a file and i need to read this file since another program.
I read in a float64 format and put with this format in a txt file, How can i read this dates from a file?
Thank's.
Regards.
03-28-2011 02:59 AM
Hello Galdos,
I need additional information to give you an answer. What programming language are you using? LabVIEW? C?
In addition, if you are reading from a DAQ device using float64 and you are writing into a TXT file… you are missing a lot of information because the float data is transformed/coerced into string with a specific format (finite number of decimal).
To read float64 from string file, you need:
1) Read data from the TXT file in a string variable
2) Use a conversion function to change a string into a float64 value.
03-28-2011 11:10 AM
Hi Sendia,
I'm programming in C, I know if I write a float64 in a txt file I lose a lot of information, but is not a problem, I have the precission that I need, I only use a ten decimals.
What is the function to change a string to float?
Thank's for you help.
Regards.
03-28-2011 11:14 AM
What programming environment are you using? And are you using ANSI C, C, C++??
03-29-2011 09:01 AM
According to this link, a float64 data is just a Double data:
http://zone.ni.com/reference/en-XX/help/371361G-01/lvexcodeconcepts/manager_data_types/
http://digital.ni.com/public.nsf/allkb/D6BED7D73659C43586256A7300691C26?OpenDocument
… so to transform a string variable to a double/float64 variable, you only need to use the “strtod” function (in any language)