High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Save multiple channles in binary file

Hey everyone,

 

I tweeked one of the examples for my digitizer to display and record in a binary file the data coming into one channel (attached file). It works great, but now I need to be able to do this with multiple channels. If we start with two channels, how would I come about doing this?

 

I tried switching to 2D I16 on the Fetch Binary VI, but it breaks several of the links. This is because the wfm info array is no longer for one channel only. Is there an easy way to separate all the info and use it on the plot? Ideally I should be able to display all my channels on one plot.

 

The second issue is that I'm not sure how the file is saved in multiple channel mode. Can I easily separate the various channels in the file? I tried opening the file in Matlab but got a memory error. Evidently I'm trying to read too much data at once.

 

Any advice would be great.

 

Thanks,

Marc

0 Kudos
Message 1 of 5
(6,269 Views)

This is a fairly easy fix.  You need to convert your 1D data structures into 2D data structures.  Here is a screenshot of most of what needs to be done.  Note that the FOR loop around the data going to the graph can simply be drawn over the existing code.

 

FixedShockDetection.png

 

If you run into performance issues, consider moving your save to another loop using a producer/consumer architecture (look it up in the LabVIEW help).

 

How big are your resultant files?  Anything over a few hundred megabytes should probably be opened with care. If you want to post process in LabVIEW, the LabVIEW help has a good section on how to do this, or you can read this tutorial.  I can't help you with Matlab.

0 Kudos
Message 2 of 5
(6,263 Views)

Thanks DFGray, I made the changes and everything seems to be in place. However, how is the data stored for lets say 2 channels? Even when I try recording with only one channel I don't get the right signal.

 

Are there delimiters,tabs, spaces...?

 

Would there be a way for me to split the data into multiple arrays and simply save the different sets of data under different files? That would be ideal. I tried doing this with an index array VI and using indeces 0,1 etc. without much success.

 

Marc

0 Kudos
Message 3 of 5
(6,254 Views)

The data is being saved as flat binary, not text.  So the bytes on disk are the binary data.  I believe the data is interleaved, so it will alternate channels as you read it.  Most analysis programs should be able to read this format with no difficulties.  It is interleaved, I16, little-endian binary.

 

You can split the data into two files.  Use Index Array to get one set of data from the 2D array.  Set one of the indices (to 0 or 1) and don't wire the other.  If you get the wrong data, wire to the other index.  I almost always get it wrong the first time.  Note that you can pull the bottom edge of the Index Array so you can get both pieces out of one node.

 

Good luck.

0 Kudos
Message 4 of 5
(6,247 Views)

Great thanks! Now that I know what it look like I should be able to figure it out!

0 Kudos
Message 5 of 5
(6,245 Views)