10-26-2005 02:48 AM
10-26-2005 05:54 AM
Hallo Paul,
I don't know any other way then splitting up the bits and use the 'Power of X' function and include the sign bit.
struct Real48 {
int sign : 1;
int mantissa : 39;
int exponent : 8;
};
(From Apeldoorn)
10-26-2005 07:15 AM
10-26-2005 11:49 AM
Thanks for the suggestion, however could you give me some tips on how to write this in G, because I have never used C-code in LabVIEW (besides, I don't have a visual C compiler and as far as I know I need that to use a CIN)?
The format is indeed Real48, because for some odd reason the other programmer used an ancient version of Pascal. I'll ask him never to do that again
10-26-2005 12:01 PM
I wasn't suggesting that you write it in C, how could you think of it
I will work on it but there are a few angle's. Can you send me a file with some data, would be nice if you know what in the file
You canb also look at this: http://digital.ni.com/public.nsf/allkb/C3E8E433244565F086256F6B0058E073
If you want you can mail me the data keeswe at zonnet
10-26-2005 02:27 PM
Thanks K C,
Sorry for my misinterpretation, after a long day of debugging my head isn't always as clear as it was in the morning Maybe it's because of the suggestion in an old NI forum thread to use a C routine.
Anyway, I'll try working with the example VI in the link that you gave me. To give you an example of the mess that I have to work with, there's an example of the datafiles that I have to translate in the attachment. If you open it in notepad, you can see clearly that it not only consists of raw bytes, but also contains strings. Some of the real48 values are at the following offset positions (from the beginning of the file): starting from byte 566 there should be three real48 values (according to my technical document 'rMin','rMax' and 'rMean'). This group is preceded by the ASCII string '0000003018'. The problem is that I have no idea what the values should be. I am trying to figure it out, but it's like searching for a needle in a haystack.
Paul
10-26-2005 02:31 PM
whoops, I really should take some rest, I accidently replied to one of your older replies. Please read reply 6. Thanks.
Paul
/getting some strong coffee to keep me awake
10-26-2005 02:40 PM
Goeiemorgen zegziet er leuk uit.
Sorry guys but we're both Dutch (I think)
I will try to fing out if the data is actual Real48 data. I modified the VI at the previous link.
Get back to you....
10-27-2005 05:48 AM - edited 10-27-2005 05:48 AM
Hi,
The conversion is no problem. The data in the file is. Do you know anything about the figures. Positive/negative, range or whatever.
This is what I found so far.
Real48 conversions:
2 bytes before data:
1 = 5.894775E-39
2 = -2.000000E+0
3 = 9.949082E+9
2 bytes after data:
1 = 7.132135E+19
2 = 5.911912E-39
3 = 5.884521E+0
1 byte before and 1 after data:
1 = 1.030700E-38
2 = 5.877606E-39
3 = 9.730659E-27
But i can think of much more options to read the data. So do you have more data and/or files ? Do the figures make any sense ?
Message Edited by K C on 10-27-2005 12:53 PM
10-27-2005 02:26 PM
Hi K C,
Thanks, I'll try to check the conversion. If it's ok, I'll send my 'work in progress'-vi ('in het nederlands') and the documentation (in english) to your mailbox. Maybe that will clear things up. Again, many thanks.
Paul
P.S. Groeten uit Limburg