 Quote by 0x0000eWan
Hi,
I've finished processing cnf files. It's working fine for new version cnf files, but in old version ones, there are issues with realtime, livetime, dates and calibration values. It's easy to change code to work with old cnf files, but i wanna my app to be universal and can be used for both kinds of cnf files. I didn't figured out how to clearly determine which file is old and which is new, but I'm working on it ;) I'm sending you my code written in Delphi. It's quite messy because i used it only for testing and then rewrote it to another app, but i hope it will help you. I'll send updated version when I complete it.
|
There are no "old" and "new" versions of the CAM (cnf) file format, there is only one and it is quite old. What is happening is that you are relying on fixed offsets to read parameters, spectral data, etc. and CAM files are much more complex than that. They have a filesystem-like structure, with "directories" to locate parameters, spectral (or any other) data, as well as an allocation bitmap and some other stuff. Neither the spectrum nor the parameters are at a fixed address, and neither they have to be contiguous inside the file (most of the time, for example, the spectrum is not!) All that was inherited from VMS (where Genie originated), which supports files with complex structure, unlike Windows. I don't think even CANBERRA has today the complete description of the CAM format...
A newer version of Genie might seem to generate a different "version" of the CAM file, simply because is saving a different number of parameters or in a different order. If you create the CAM file in VB using the CANBERRA SDK, chances are that you will not be able to read them back with your code. Even when using the same version of Genie, changing something as the detector type or a setting somewhere can cause your code to fail.
The best way to read the CAM files is by using the CANBERRA libraries, otherwise you'll be reinventing the wheel (and believe me, is a complicated one). CANBERRA has an SDK consisting of a set of COM components and C libraries that can be used with VB or C++. IIRC, the pcam.dll in the EXEFILES directory is the one that does all the low-level access. There should be also a sad.dll file or similar that can be called from C to access files and devices. The documentation is available from CANBERRA (usually comes with the Genie distribution).