06-27-2009 10:42 AM
Greetings.
I have the following problem: I want to store the data obtained from my daq device (pci-6014), but I don't know how. I tried the Storage VIs, but I get the error -2558. I tried the measurement file, but it doesn't store the data continously (every random amount of time it just doesn't record the data, and I lose tons of info.) What can I do?
I need to record the data obtained from two channels of my daq device when I push a "record" button, and stop saving such data when I push a "stop" button (different from the stop application default button).
Can anyone help me out with this?
06-27-2009 07:40 PM
I tried the Storage VIs, but I get the error -2558.
If you have an error cluster showing an error, then once the program stops, you can pop up on the error cluster and ask to EXPLAIN ERROR.
If you do that for -2558, you probably get "LabVIEW cannot open the data storage file".
That means there's something wrong - I suggest you find out what.
Maybe your path is invalid.
Maybe your disk is write-only.
Maybe the file is busy.
Post some code and we'll have a better shot at helping you.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-27-2009 08:22 PM
Well, I knew about the error code. In fact, by searching through labview support I found out that due the the type of file (end-to-end type or something like that), the files can't be edited (funny thing, as if they can't be edited then how will I be able to create them in the first place?).
I'll try to post some code, but that will have to wait until Tuesday (due to the work being in my office). In the meantime, can someone please give me some support on how to store data from the daq device (at a somewhat high speed rate without data loss)?
Thanks.
06-27-2009 08:39 PM
What does "somewhat high speed" mean to you?
If I'm monitoring temperatures, 10 Hz is high speed. If I'm monitoring vibrations in structure, 10,000 Hz is high speed. If I'm digitizing video, 10 MHz is high speed.
In general, without knowing any specifics about your system, here's the way I would attempt it:
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-28-2009 11:44 PM
I'm sorry if I keep bothering you, but I quite don't know how to do that. I'm just a beginner, and I don't have much knowledge about Labview. I understand what you are telling me to do (I thought of that), but I just don't know how to do it. I don't know how to open binary files, nor how to store the data in a buffer as it's been read.
Ok, if you are still willing to help me, here's a bit more of specifications: I'm using Labview 7.1. I need to read samples at 100KHz (possible more). The samples come from two different channels, both of them must be recorded. I know I'm being a nuisance by asking, but, could you help me? I really need this, but I'm a bit clueless about Labview (and, I have to use Labview).
Thanks
06-29-2009 05:05 AM
Take a look at the examples. Under the HELP menu, choose FIND EXAMPLES and look in FUNDAMENTALS - FILE I/O.
There are examples dealing with reading and writing binary files there.
Study what happens there and apply it to your own situation.
As far as the "buffer" comment goes, NI-DAQ will take care of managing the buffer for you. What I meant was to ask for a large buffer, since you will be writing to disk (a fairly long operation) while data is still coming in, so you need a larger buffer to hold the new stuff while you write the older stuff.
Also in the examples, take a look at HARDWARE I/O - DAQmx - ANALOG MEASUREMENTS - VOLTAGE. You should find some examples dealing with continuous (as opposed to finite) DAQ.
HTH,
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-01-2009 11:10 AM
Ok, I tried the examples (specifically the High Speed Data Logger), and it works wonderful. But, now I have another problem. I want to apply an user-specified filter to the data I'm reading. I tried with the IIR filter vi, but it generates me an error (-20023).
Here, I'll upload the vi. It's mostly a modification of the example I used.
Any help with this?
07-01-2009 11:21 AM
Since you chose to acquire unscaled data, your signal has no timing information - no dt. Converting to dynamic data does not do any good. You should convert to a waveform data type and provide the dt information. You would use the Build Waveform function as shown below. Converting the output of the filter to a 2D array seems silly as well.
07-02-2009 09:18 AM
Ok, I did that, but I'm still getting the same error from the Filter VI. Searching, I found that such error is due to either wrong cut frecuencies (which it isn't the case) or "An array of data is being passed to the filter without waveform information".
But, am I not transforming the array into a waveform? Then, what's the problem?
07-02-2009 09:26 AM
Put a breakpoint on the IIR FILTER vi, and trace your execution into it. See what it comes up with for dT.
If it doesn't match your expected sample rate, find out why.
Blog for (mostly LabVIEW) programmers: Tips And Tricks