LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I write binary file (express) but can't read it (express)

Hello,

I have an application where I will acquire data from several sensors. For most of them (16) a relatively low sampling rate (10000Hz) will be fine, but, for one AE sensor I need a high sampling rate (50k - 100kHz). So, I've decided to store the data in binary format so as no to have way too big files.

 

I try writing the files with the express module, and afterwards, in a new .vi, reading and graphing it to check it, but signals don't match.

By now I'm working with simulated channels, so data stored in the file and read and graphed afterwards should be sine, but I don't see so.

 

Any suggestions?

 

0 Kudos
Message 1 of 7
(3,618 Views)
can you attach a screen shot of your vi?
0 Kudos
Message 2 of 7
(3,610 Views)

Hello,

here it is. I show only the part where the EA sensor is acquired and written. On the upper part of the program, not shown, the other channels are created just like the one showed, chained together in a unique task.

 

regards.

0 Kudos
Message 3 of 7
(3,600 Views)

Your wiring is a mess, as well as your error handling. You have uninitialized shift registers which means that if you stop the VI and then re-run it, the contents of the shift registers are remembered. You have one shift register that's being used for error handling, but it is going to only one of the Write to Measurement File VIs. You also have waveform data going every which way. Frankly, I'm surprised the code actually works. Based on the little that I can see, there's no way to tell which Write to Measurement File runs first, so you have no way of knowing which signals get written out first. This is a race condition.

 

If you upload the code then someone can try to clean it up for you.

Message 4 of 7
(3,589 Views)

Hello, just checking if the issue is solved. I see kudos for the last answer but I do not know if it solved your question. Is it already solved?

 

Kind regards.

0 Kudos
Message 5 of 7
(3,521 Views)

Hello,

 

I have tried my best cleaning up the wiring, but it's still pretty messy. I attach the complete program.

My problem (still not solved) is that since EA needs to be measured at very high rate, I want to write it as binary data. But I cannot make it show me the correct data afterwards, with a different program, that doesn't matter.

 

I would also like to know how to convert this saved data to MatLab... any suggestions? (should I post this in a new thread?)

 

Regards,

Usuario

0 Kudos
Message 6 of 7
(3,477 Views)

Hello,

 

Indeed it is still a bit messy Smiley Happy. I would strongly recommend you to use only one task per device and try to clean your code a little bit more. There is a pretty good example for DAQmx acquisition and TDMS logging. It is called Cont Acq&Graph Voltage - Write Data to File (TDMS).vi. If you could combine this example with Producer/Consumer architecture, that would be perfect. As for the Matlab conversion, I guess that has been replied here.

 

Have a nice day.

0 Kudos
Message 7 of 7
(3,208 Views)