03-23-2018 08:24 AM
i was just trying to get some strain data using strain gauge.
I used cDAQ-9178, NI 9237 module, and ni9944 connector.
Now, when i tried to use 'continuous sample', the labview kept giving me error-200279. i tried like every possible thing, but won't fix the problem.
So I changed the setting to N-sample, and put the 'samples to read' and 'rate(Hz)' both as 1k, the error did not occure.
Now, i'm thinking, this is 1000 data every second, right? good enough.
I gave a non-stopping load from 0N to 20N, slowly.
However, every 1 sec, the data show 'gaps', just like the below.
the graph is x=sec, y=strain
The above is the strain data, which has some leap gap every 1 sec.
Now, i checked if the load was also having this problem, but the load data showed smooth continuous arrays of data. Of course, I also used n sample collection for the load too.
I connected 4 strain gauges to the module ni-9237, and all 4 strain gauge data showed these leap gap, so i'm thinking:
1. It must be the module. module has some kind of problem.
2. it's just the way with n-sample collecting method when it comes to strain gauges... even though load was smooth.....
anyone have any idea why these leap gap appeared?
Solved! Go to Solution.
03-23-2018 08:53 AM
By the looks of things, I'd put my money on there being a fixable problem in your programming.
Key clues:
- the original error in continuous sample mode suggests that you weren't reading data out of your task buffer fast enough to keep up with the speed that the task was adding it.
- at 1 kHz sampling, that should be a very readily solvable problem just by following the continuous acquisition shipping examples
- since you didn't solve it, that tells me you're fairly new to DAQmx programming. Not a problem, just an observation. We were all new once
- but that makes me more likely to be suspicious of your analysis of the problem. For example, I don't believe your time axis is true. I think you reconstructed it based on a wrong assumption that the separate 1-second bursts of data could be connected together over continuous time.
- in other words, you capture a 1 second burst of continuous data, then you capture nothing at all for up to another second, then you capture another 1 second burst *but graph it as though it's contiguous with the previous burst*
- in reality, the variable size of the jump in data between bursts compared with the general rising slope trend suggests that you still have a significant solvable issue in not iterating your finite sampling task nearly as fast as you could/should. Missing time gaps seem to vary from around 0.25 - 1+ sec
- all that being said, since you seem to want continuous data it's best to focus on solving the original problem. Post your code, someone will help.
-Kevin P
03-23-2018 08:54 AM - edited 03-23-2018 08:55 AM
Hi jones,
so you have a problem with your VI - and all we get is an image of the resulting data produced by that VI?
And you want us to help you with your VI???
anyone have any idea why these leap gap appeared?
Idea: you are starting and stopping your DAQmx task from time to time…
03-23-2018 10:05 AM
My bet is that all of your code is inside a single loop. Remember the basic LabVIEW Principle of Data Flow -- nothing can proceed until all of the inputs have been read, all of the outputs have been written, and everything inside a loop structure has executed. Are there things inside your loop that might take more than 1 second to finish, thereby slowing down the speed at which the loop can run? Only you know the answer to that, as we can't see the code you are trying to run.
Bob Schor
03-24-2018 01:53 AM
Hi, I posted yesterday and now I post more information.
I never used Labview before and need the data as soon as possible...
All I need is the strain-force output data, which is very simple, right? I should be able to learn and do this quick.
With a newbie knowledge, I set up Labview like the below.. very simple:
the upper DAQ assist and waveform are connected to 2 strain gauges connected to NI-9237 module.
The one below is the applied force data collected with a loadcell by Ni-9215 module.
I was having problem with 'Timing settings', in which if I tried 'continuous samples' in the acquisition mode, I was keep getting the 200279 error.
I tried like every possible combinations of 'samples to read' and 'rate' values ranging from 1 to 100k, but this won't work.
So I had to use n-sample acquisition mode... I was getting same error message for some sample and rate settings, but mostly they were fine...
However, I am getting gaps like the waveform chart above. Now, when I see the actual data, it's not as bad as the above chart, but still i get leap gap like below:
The data was collected as N-samples, 1k Samples to read and 1k rate(Hz)... so x=sec and y=strain.
This only happens to the strain gauge data and not the load cell. The load cell data is fine and smooth.
I tried 4k samples to read and 1k rate, but this only delayed the gaps for like every 4 seconds.
25k samples to read and rate gave me too much data, and I just need to collect 100~1000 data per a second.
I saw the comments form the previous post.
One of the issue was everything being in one loop... Not sure how to set this... as I never used Labview before and I need to do this as quick as possible.
My professor sighed and left when he saw the strain data, but well... the old man doesn't know how to use this, either. Now I guess I have the weekend to make this right.
Please help me get a smooth data acquisition.(if possible, I would like to be able to use the "continuous sample' acquisition mode.)
03-24-2018 02:52 PM
@jones111132 wrote:
I never used Labview before and need the data as soon as possible...
All I need is the strain-force output data, which is very simple, right? I should be able to learn and do this quick.
I've never used C++ before. All I want is a simple database program, which is very simple, right? I should be able to learn and do this quick. Huh? If you don't know something (e.g. LabVIEW), haven't studied it, haven't put time and effort into learning it, why should you "be able to learn and do this quick"?
With a newbie knowledge, I set up Labview like the below.. very simple:
the upper DAQ assist and waveform are connected to 2 strain gauges connected to NI-9237 module.The one below is the applied force data collected with a loadcell by Ni-9215 module.
I was having problem with 'Timing settings', in which if I tried 'continuous samples' in the acquisition mode, I was keep getting the 200279 error.
I think you got a -200279 Error. Do you know the difference between 2 and -2? Did you look up the Error? "The application is not able to keep up with the hardware acquisition. Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."
So I had to use n-sample acquisition mode... I was getting same error message for some sample and rate settings, but mostly they were fine...
However, I am getting gaps like the waveform chart above. Now, when I see the actual data, it's not as bad as the above chart, but still i get leap gap like below
A very important concept of LabVIEW is something called Data Flow. When considered in terms of a Loop (like the While Loop in your very simple-minded, definitely Newbie beginner DAQ Assistant code, this means that everything in the loop needs to run to completion before the loop can continue. It also means that no function can run until all of its inputs have data, and no function outputs data until it finishes.
You have two DAQ Assistants (very Newbie) that take, let's say, 1 second to get 1000 data points at 1 KHz. It is probably the case that the two functions, which don't share inputs, can run in parallel, so after 1 second, each will output 1000 points. Where do those points go? Each goes to a Waveform Chart which takes some time (let's say 20 msec to plot 1000 points), and may or may not be able to do them in parallel. The points are also combined and sent to a Write to Measurement File, which takes some time (let's say 40 msec) to format and write 2000 points. The plotting and File I/O might also go in parallel, so they might finish in 40 msec (the longer of the two times). So your next 1000 point sample will start 40 msec late. This explains the gaps in your plots -- you have put 1040 msec of processing in a 1000 msec loop (that's a LabVIEW paraphrase of a somewhat vulgar cowboy saying).
How to fix this? Simple -- move the processing out of the loop! Since you are a LabVIEW beginner, you might not be up for the Producer/Consumer Design Pattern (which lets the processing run in parallel with the Acquisition). My recommendation would be to (a) get rid of the visualization, and (b) accumulate the data in an Indexing Tunnel (do you know what this is? Take the LabVIEW Tutorial shown on the first page of this Forum and read about Arrays and For Loops -- the While Loop can also take an indexing tunnel). You'll create an array of data (for goodness sake, go back to Continuous Sampling, but get the processing out of the While Loop) that appears when you exit the While Loop. Follow it with a For Loop that contains the Write to Measurement File Express VI.
Since "doing it this weekend" seems to take precedent over wanting to Learn LabVIEW and gain some understanding of this really powerful and useful Language, I won't tell you to learn to avoid the Dreaded DAQ Assistant, and its Evil Twin, the Dynamic Data Wire. You seem wedded to both, and it will (possibly) allow you to "do it quickly without understanding anything". However, if you are curious, you could do a Web Search for "Learn 10 Functions in NI-DAQmx ..." (there's more to the title, but that will find it for you) and maybe learn something.
Bob Schor
03-25-2018 10:25 AM
Thank you for the reply.
I managed to do this based on your advice.
I am acting like this because I don't have much time right now, but after this is done, I will definitely study Labview.
Thank you again.