CaseyB
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Posts posted by CaseyB
-
-
I develop software from home for several labs using MCC dacq boards and the Universal Library for C++. These laboratories run my proprietary software to collect data for physiological testing in (mostly) exercise physiology laboratories. The software is quite specialized and requires a $70,000+ instrument called a respiratory mass spectrometer. It is WAAAY beyond my budget to set myself up with one at home. So I have relied heavily on being able to do 'repolays' of data acquisition sessions to convert the raw data they send to me in proprietary-formatted binary files into DEMO0.DAT files, using information shared by one of the kind engineers at MCC years ago (probably 5+). BUT the 64-bit version of Instacal apparently does not read these files, or they are in a different format. This means I am stuck as I rely on this feature heavily. Is there any chance either a) someone can share the 64-bit version of the file format (in case it still works) or b) resurrect that feature?
Thanks for your help and support!
Just FYI, here is the information I use to construct DEMO0.DAT files extracted from my proprietary-formatted binary raw data files (usually sampled at 100 Hz per channel).
Here is the format of the binary file: ASCII Identifier (20 bytes) = "CB Raw Data File \r\n" ASCII Date String (10 bytes) - date file was last written to (07/24/19\r\n) ASCII Time String (10 bytes) - time file was last written to (12:18 am\r\n) Low Chan (integer - 2 bytes) - Low A/D channel scanned HighChan (integer - 2 bytes) - High A/D channel scanned HzRate (integer - 2 bytes) - Hz component of sampling rate kHzRate (integer - 2 bytes) - kHz component of sampling rate (0 for 100Hz total) TotalCount (long - 4 bytes) - Number of samples in file (e.g. number (Hichan-LoChan) x # records) TriggerIndex (long - 4 bytes) - Index of trigger sample (set to zero) GainCode (integer - 2 bytes) - Gain code for A/D SkipCount (integer - 2 bytes) - Number of bytes to skip to first data point NotUsed (SkipCount bytes) Data (TotalCount integers)
-
I have been using this somewhat hidden feature of InstaCal for many years now, but as I am migrating from 32-bit to 64-bit build of my project, I find it does not work for 64 bit. Years ago, someone at MCC sent me documentation to create a DEMO0.DAT file from a source of raw data. I imagine this information is what is used in the cbFileAInScan() routine. I can't use that routine in my code, my approach is to take the raw data created by my users, stored in my proprietary binary file, and write a DEMO0.DAT file to allow me to 'replay' this session through Instacal during development and debugging. So, my question is, does anyone know how I can get hold of the API/file format information to create the DEMO0.DAT file in the 64-bit world? Maybe all the integers (see below) are just twice as big as they used to be?
Here is the info I got from someone at MCC years ago. When I call their engineers today, they tell me that function never worked and is no longer supported. Well, it DOES work in 32-bit version up to the latest InstaCal as far as I can tell.
Here is the format of the binary file: ASCII Identifier (20 bytes) = "CB Raw Data File \r\n" ASCII Date String (10 bytes) - date file was last written to (07/24/19\r\n) ASCII Time String (10 bytes) - time file was last written to (12:18 am\r\n) Low Chan (integer - 2 bytes) - Low A/D channel scanned HighChan (integer - 2 bytes) - High A/D channel scanned HzRate (integer - 2 bytes) - Hz component of sampling rate kHzRate (integer - 2 bytes) - kHz component of sampling rate (0 for 100Hz total) TotalCount (long - 4 bytes) - Number of samples in file (e.g. number (Hichan-LoChan) x # records) TriggerIndex (long - 4 bytes) - Index of trigger sample (set to zero) GainCode (integer - 2 bytes) - Gain code for A/D SkipCount (integer - 2 bytes) - Number of bytes to skip to first data point NotUsed (SkipCount bytes) Data (TotalCount integers)
-
I have a bit different information, and I dont remember where I got it. The DEMOx.dat files are in
C:\Users\<XXXX>\AppData\Local\VirtualStore\Program Files (x86)\Measurement Computing\DAQ
In any case, I have been using this feature for years, I have a routine that takes raw data created by my end users, generates a DEMO0.DAT file, which then place in the location above. Works like a charm to create 'replay' files that my users create. Allows me to debug the actual data acquistion routines.
Maybe the program looks in several places??
DEMOx.DAT file for MCC's InstaCal
in Measurement Computing (MCC)
Posted
Thanks for your response. This is a very lengthy response. What you sent me does not answer my question. What I will try to show below is first, that the Instacal and DEMO-BOARD work fine in my 32-bit version of my program. But when I compile and run in 64-bit, it does not. So IO repeat my questions: 1) does the 64-bit Instacal cbw64.dll support replaying data using DEMO0.DAT files; and 2) if so, is there a new file format specification you can send me so I can generate such files from my user data?
I made sure I have your ver 6.73 installed, and I am running the 64-bit Windows 10, all the latest updates applied. Note that Instacal is a 32-bit program (as you point out, it is installed in c:\Program Files (x86)...., the standard location for 32-bit programs in Win64), but the install package comes with a 64bit version of the .dll file that one can link into a custom program. My custom program runs fine in 64-bit version doing raw data acquisition, it just does not work replaying DEMO0.DAT files. Details:
Here is the DEMO board using a sine wave:
Here is image from my custom 32-bit program using cbw32.dll, demo board and the damped sine wave:
Now switching to your DEMO0.DAT file, I dont get anything using the Instacal test, loopback, but my program does see data. Is there something wrong with my setup there?) This is channels 2 and 3 in the top panel and 4 and 5 in the bottom. Channel 5 appears to have nothing, and I did not see anything in channel 0. Note the units in these graphs are physiological units, NOT VOLTAGES. And, BTW, these signals look a lot like a human subject breathing, gas channels in 1 & 2 and some kind of flow signal in chan 3! How did you generate this file?
Now here is a 'replay' of data one of my users sent. I created this DEMO0.DAT file using the algorithm in my OP. Still Instacal ver 6.73 using cdw32.dll:
Top two panels are chans 1 & 2 showing two flow signals generated by a human breathing. Bottom two are O2 and CO2 from a mass spectrometer. You can clearly see the breathing cycle in both panels. Instacal shows nothing in the loopback test. Am I doing something wrong with setup there? Clearly it is working, but instacal shows nothing.
Now I compile my program as a 64-bit. That means it now uses cbw64.lib to compile and therefore cbw64.dll at run time If I try to build with cbw32, it does not compile, I get compiler errors that none of the calls to MCC are present (e.g. cbAInScan, the one I use the most...). Here is output from my program using the DEMO board and the sine wave.
Clearly, the 64-bit dll still has the sine wave feature. But using your DEMO0.DAT files shows nothing (even though it worked fine in the 32-bit, see above):
And, finally, a DEMO0.dat file generated from user data by my program, which again, worked fine in 32-bit, gave same output as above.
See my questions to you at the top of this response, and see my original post for the file format information I use to create DEMO0.DAT files.