DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading R32 File outside of Diadem

I have a DAT file and its R32 file which i want to read in an application outside of Diadem. (I want to load my R32 file and plot it and stuff outside of Diadem). But when i open my R32 file in Notepad or even access lines of the file thru VB it is a bunch of garbage. Is there something I dont know about the R32 files? Can they only be viewed as points in Diadem? Do I have to convert them from one format to another?

I guess, I don't understand much about R32 and R64 files. Any input will be greatly appreciated.

Thanks ~sn
0 Kudos
Message 1 of 9
(11,151 Views)
Hello shefalika,

the r32 and r64 files are binary, that is why you cant look at the data with your notepad program. Together with these binary files comes a dat file, which is the header of that dataset, containing a lot of information about how to interpret the content of the binaries. Btw: the number says that each value is stored in 32bit or 64bit resolution, respectively.

Attached PDF describes the DAT file format. The content should be enough to explain to you how the files can be used outside DIadem. If you find that to complicated, think about exporting ASCII data from DIAdem. Saving a DAT file you can do this with a the setting in the menu.
File -> Dat files -> storage parameters (version 9 and following, called in the module navigator)
File -> Desctop parameters -> device specific (version 8.1 and beyond, called in the device DATA).
Set the datatype to ASCII and save the data as usual. It will create a DAT file and another file with the extension asc - one that can be opened with notepad.

Hope that helps
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 9
(11,132 Views)
What is the bit layout of the r32 und r64 format?
Is it according to IEEE 754?

Regards,
   Florian Kolbe
0 Kudos
Message 3 of 9
(10,824 Views)
Hello Florian!
 
The binary representation of the R32/R64 values should be standard conform.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 9
(10,819 Views)

Hi fkolbe,

Yes, the real numbers in DIAdem are stored and read according to the IEEE 754 standard.  If you want, I can send you VBScript routines which will read those values, but VBScript is NOT the best language to do so since it has no built-in support for reading binary values.  My routines load the values byte by byte as strings and calculate the correct real numbers from them in VBScript loops, which is much slower than the performance you would get with a compiled language.

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 5 of 9
(10,798 Views)
Hi,
   thanks for offering the VB Code, but we are actually using Java.
The appropriate method is: Float.intBitsToFloat()

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html?noframes=true#intBitsToFloat(int)

Regards,
   Florian

Message Edited by fkolbe on 08-13-2007 03:01 AM

0 Kudos
Message 6 of 9
(10,782 Views)

Hi

 

I have a need to read Diadem .DAT/.R64 files outside of diadem, and would appreciate any VB samples you have.

 

Regards

 

Onkar Jagpal

0 Kudos
Message 7 of 9
(8,729 Views)

Hi Onkar,

 

Here are a variety of VBScripts I've written to parse the DIAdem DAT header file, read and write IEEE binary values from binary files, and also convert DIAdem DateTime values (fractional seconds since 0 AD) to a VBScript datetime variable.

 

Good luck,

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 8 of 9
(8,724 Views)

HI again Onkar,

 

Bear in mind that VBScript is an interpreted language (not compiled), so if you use these scripts to try to load a very large binary file into VBScript variables, it will likely take a very long time.  I mainly used them for reading scalar values out of binary headers and then creating the DIAdem DAT header to match the binary data file-- the reverse of what you want to do.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 9 of 9
(8,720 Views)