Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

BIn conversion VB

I've gone over threads dealing with my problem, but I haven't found anything directly applicable.
 
I have some BIN files of crash data, presumably directly from the accelerometers. This data is from the days when this data was read (as far as I know) directly into Diadem to produce graphs.
 
We now have a new system of accelerometers and the data format is different. I've been updating the newer program, but my boss want's me to incorporate reading the older data into it, if possible.
 
I figure I can do this via an OCX (tech support told me so, but admitted he's no programmer). The old program procedure was to open Diadem and use it to produce the graphs, that the old program then saved out in my client's company format.
 
What I want to do now is do now is convert the entire data stream programmatically, without the user seeing or using Diadem. I want to get the data into a known format where I can stick it in the graphing object of the new program and work with it as we normally would from there. I have 10 channels of data and a header file.
 
I figure I need an OCX, but which one(s)? I have a licensed copy of version 10 to use and I have it installled.
 
Other question: Can I redistribute an OCX within the company without violating the license? I'll read the EULA if I have to, but I was wondering if anyone had a pat answer.
 
I've never used Diadem, so I don't feel I can make an informed choice about which example is a propos to my situation.
0 Kudos
Message 1 of 4
(6,932 Views)
Hello again Jay,

A little more research into your question allowed me to find a few resources to get you going in the right direction.  As I recall, your data was in  .dat files.  In this case, the attached VBScript code can be used from VB6 (with some editing) to extract the header information of these files thus allowing you to manipulate your data however you wish.  I also attached a zip that includes a pdf discussing the data organization in DIAdem with examples.

Have a great day,

Ecleamus Ricks, Jr.
National Instruments
Applications Engineer
Download All
0 Kudos
Message 2 of 4
(6,921 Views)

OK, I looked over the header PDF document, and that was really helpful, as is the channel reader in the VB script. I noticed the ChHdrObject class doesn't have any methods. Is that because it's a completely roll-your-own routine?

One further question. In looking at the header file, in tags 240 and 241 I have the following on the channels. Not the exact numbers for every channel, but the numbers on each are in decimal format.

240,0.103847
241,0.020769

So my formula for converting INT16 numbers would be 0.103847 + INT16 value * 0.020769?

Assuming an INT16 value is 24, I get the solution as 0.602303. Is this correct or are there parentheses in this, i.e. addition first, then multiplication, or multiplication then addition?

0 Kudos
Message 3 of 4
(6,913 Views)
Hi Jay,

The answer to your first question is yes.  We just give you the format of the header, it's up to you to program the method (or just use DIAdem Smiley Happy).

The  answer to your second question is yes, assuming this is an explicit channel (see header entry 210 - Channel Type to verify).  You multiply by the factor first, then add the offset.

Have a great day,

Ecleamus R.
0 Kudos
Message 4 of 4
(6,894 Views)