LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append Text Header for Binary file

Hello Experts

 

I am using LabView 7.0 with PCI 6040 DAQ. I have created two separate files, one file is Binary that collects binary raw data from 16 channels of the DAQ. The second file contains variable length Header, i.e the information about all 16 channels and physical conditions of the recording. I am trying to merge these two files to form a single file that contains a text header at the top and followed by the binary data. I am unable to figure out that how can I append binary data to a text file.
I need help from users please.  

 

Ciao!!!!

Nabeel

0 Kudos
Message 1 of 21
(5,180 Views)

Hi Nabeel

take a look at 'High speed Data Logger.VI' and 'High speed Data reader.VI' from examples shipped with labVIEW

This should solve your problem

Regards

Dev

Download All
0 Kudos
Message 2 of 21
(5,154 Views)

Thanks Dev, That was quick.

Okay Let me explain to u the background. I m getting data from 16 channels for one second ( one record ) of it and store it to the disk. Its a sort of real time data acquisition and saving. Header record is produced first, it contains the information about the patient and then the acquisition of the data starts. At the end all together saves in one file. The reader of this specific file is a Standard Reader. 

If i am unable to find the VI u recomended. The data logger Vi i have is simply bundling the data and in my case it seems not fessible.

Any Idea??

ragards

Nabeel 

0 Kudos
Message 3 of 21
(5,149 Views)
Why do you think it's not feasible? Dev's example has shipped with LabVIEW for quite a while and whenever I've used it, it has worked jsut perfectly and does what I think you're describing. Why don't you post your code so soemone can see what you're doing. There is no such thing as a "standard reader" if you are talking about binary.
0 Kudos
Message 4 of 21
(5,129 Views)
Can u explain what you mean by 'The reader of this specific file is a Standard Reader' ??
0 Kudos
Message 5 of 21
(5,121 Views)

Hi,

My first thought is to use the Flatten to String function on the binary data.  Now you can use Concatenate String to marge the two components and write to disk.

Or, you can us the Bundle function to make a cluster of the string header and the binary data.  The resulting cluster can be written to disk using the write binary data function.  You can always use Labview to read these files once they have been written, just use the Read Binary File function, and connect the empty cluster control (use a type def) to define the incoming binary file.

I attached a simple example, but I am not perfectly clear on all the details so I hope the example will lead you int he right direction. 

If you intend at some point to read the data with an application other than Labview, please let me know, Labview has its own unique way of storing data in memory and you would need to properly decode it. 

More questions?

Chris

Chris Reyerson
Optical Systems Engineer
Arete Associates
Tucson, AZ
0 Kudos
Message 6 of 21
(5,114 Views)
Forgot the attachment...
Chris Reyerson
Optical Systems Engineer
Arete Associates
Tucson, AZ
0 Kudos
Message 7 of 21
(5,112 Views)
Hi Chris, Dev
 

I am working on Implementation of EDF file format (European data Format) in Lab View.  This file format is widely becoming a standard to acquire and store the physical data of patients. In short, the specification of the file can b read at  ( http://www.hsr.nl/edf/specs/edf.html ). Most of the companies that develop equipments for EEG (electroencephalogram) are implementing this format to read and write data. In my experiments I am also using the same file format but just to acquire and store. For reading and analysing the data Matlab is widely used instead of Labview. Dev, I have just start introducing myself to the idea of Data loggers.  

 

Dear Chris I have labview 7.0, is it possible to reload the file for 7.0? If not can you load it as a picture format?

 

Regards

 

Nabeel    
0 Kudos
Message 8 of 21
(5,110 Views)
Here is a jpeg of the example.  I will take a look at the Eropean Data File later today, sounds interesting...
 
Chris
Chris Reyerson
Optical Systems Engineer
Arete Associates
Tucson, AZ
0 Kudos
Message 9 of 21
(5,089 Views)

Hi Nabeel,

I'm agree with Chris, you have to write your file as datalog file using a cluster in order to represent your data format (string+array).

On attached you can see the VI sent from Chris but downgraded to LV 7.0.

Regards

MarcoC

0 Kudos
Message 10 of 21
(5,088 Views)