05-12-2010 11:49 PM
I have a configuration file which has string as well as numbers.Config. file has data of 10 motors with encoder reading,temperature,card information and so on. I would like to use the data in config. file for different motor movements. If I use string function then everytime i have to convert string in to number and while saving file number in to string. In doing this conversion I lost the accuracy as well I think this is not the correct procedure. Can any one suggest me how I can overcome this problem. If you need code with config file I can post or send.
kane
05-13-2010 12:00 AM
hi RRCAT,
Basically config file is an ascill file which has fields/keys and initialsing/configuring data...Obviously all the data will be in the form of strings only..The only one thing as you told that you are losing precision is...using correct format specifiers while reading the data...Please post your config file also in the reply post.
Thanks and regards,
srikrishnaNF
05-13-2010 11:27 AM
Have you considered using a binary config file? You won't be able to edit the config file using a text editor, but you won't lose any precision and the file size remains reasonable. How much precision are you looking for?
Cheers, Matt
05-13-2010 11:50 AM
Write Key accepts a "precision" input.
Have you tried using that?
Ben
05-13-2010 12:23 PM
Why are you using a string type? As Ben implied, you should be using a DBL type with your config file. Then you can specify the precision.