LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read a binary file stream with many data type, as with AcqKnowledge physio binary data file?

Thanks Charly. On Sunday, I implemented most of the lengthy file format spec for my AcqKnowledge file reader my application - minus the markers section . I even worked out how to re-organized interleaved data when one channel is sampled twice faster than the other one using a decimate and interleave subVI. Along the way, I spotted a couple of typos and located the section where 48bytes was added in the new version 3.8.1 (ver. # 41 in the header file), which not documented on BioPac webpage. There might be more new "item" saved just before the data section.
I am now cleaning up the code while I am waiting to get an update for the new file format for Version 3.8.1 from BioPac support. Note that version 3.8.1 is t
he latest version of AcqKnowledge released last September.
Among the thing I am cleaning, is the Read from file subvi which opens and closes file each time, so I use the file open and read and close instead. Also, I made an extensive use of case structure for every single variable or array. This would not be necessary if I only wanted to get channel data out. I also want to understand every parameters saved, or at least to get default values so that, in turn, I can generate *.acq file which can be read cleanly by AcqKnowledge software. I can post or email you the program when it is cleaned if you want.

Thanks again,
Donat-Pierre
0 Kudos
Message 11 of 20
(2,255 Views)
Bravo DP !
Happy to see that you are on the right path.
About the use of the sub-vis of the "read from file" vi, I'm not sure that this will save much time, but anyway it's the propedr way of doing it.
What you should also know is that the "Type cast" function works also on clusters. Means that you can decode a complex data structure with a simple node. Of course, there is still the indian question...
Keep wiring !
Chilly Charly    (aka CC)
0 Kudos
Message 12 of 20
(2,255 Views)
When I started I was think of storing everything into an cluster. At the time a bundle by name each variable sounded ideal but I could not make ie work in a simple way or at all. But I think you are talking about something else here. I'll keep wiring and try few ideas out.
0 Kudos
Message 13 of 20
(2,255 Views)
As I understand it, you are looking for an example for reading binary data? There are a couple of shipping examples included with LabVIEW, specifically Read Binary File.vi and Display Acq'd File (Binary).vi that should demonstrate how this is done.

For the question of different data types, here is a KnowledgeBase that should help you understand which data type you should use. Also, LabVIEW data is written as Big Endian.

http://digital.ni.com/public.nsf/websearch/C261612DFCA8BD3586256CC300713EA6?OpenDocument
0 Kudos
Message 14 of 20
(2,255 Views)
Dear fellow BIOPAC users,


I've been folling a labview course (Labview Basics I and II) and I would like to try to read BIOPAC .acq files. My goal is to read the real channel data and if possible the channel names. I am aware of the BIOPAC app note, but I was wondering...

Do you have a woring .vi to import .acq data? How far are you? Are you willing to share?


Best regards,

T Schrama


------------------------------------------------------------------------------------
drs. Thijs Schrama

Research-Technician /-Programmer
Faculty of Social and Behavioural Sciences

Postbus 9555, 2300 RB Leiden

Wassenaarseweg 52, 2333 AK Leiden
phone +31 (0)71 5271337
fax +31 (0)71 5273712

website: http://www.fsw.leidenuniv.nl/
email: Tschrama@fsw.leidenuniv.nl
------------------------------------------------------------------------------------
0 Kudos
Message 15 of 20
(2,245 Views)
T Schrama,

See if this discussion forum helps you at all:

http://forums.ni.com/ni/board/message?board.id=170&message.id=21926&requireLogin=False

Tyler S.
0 Kudos
Message 16 of 20
(2,230 Views)
Thanks for the link. Again I see people mentioning the little- versus big- endian ...:


Quote :
"It might also be necesary for you to reverse the byte order of numeric data since LabVIEW is "big endian" while most PC applications are "little endian" "

Does this mean I need to reverse the data for all number formats (U8 I8 U16 I16 Double etc..) or do I need to reverse the data only for the "Double" number format?


I am getting there... slowly.... but it's a tedius work.. espessially when manufacturors documentations has errors...

thanks again,

cheers,
Thijs
0 Kudos
Message 17 of 20
(2,227 Views)
The endian format applies to all numeric data types.

Tyler S.
Message 18 of 20
(2,224 Views)
all formats! ok! Thanks, that did help a bit ;-).. I allready build 12 subVI's to read Biopac .ACQ file information, like number of channels, sample interval, headerlengths etc etc... it should be relatively easy to extract the data now... I could post the subVI's if anybody is interested..


cheers,
Thijs
0 Kudos
Message 19 of 20
(2,215 Views)
Here's what I got so far.... the .ACQ-file info reader should work on all .ACQ files... but the data reader only works for 8 channel 16 bit data ... this is work in progress......

cheers,
Thijs
Message 20 of 20
(2,203 Views)