LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger data acquisition for a limited set of values using DAQ Assistant?

I am trying to acquire data across 3 load cells and record the 3 curves from a waveform graph as well as record the peak values reached. The module I am using is NI 9237 and program is LabVIEW 2016. In researching how to do it, it seems like I need to set up a trigger to acquire data between the desired set of values and save the sample, but from what I can find it seems that NI 9237 is not capable of setting up a trigger by itself (the trigger options within DAQ Assistant are all greyed out). See the attached file and snapshot below. Any help with this would be greatly appreciated!

 

jpartain_0-1581439115375.png

0 Kudos
Message 1 of 18
(3,386 Views)

I don't understand your definition of trigger in the example VI you posted.  Trigger means something like "don't start acquiring until something else happens", like a digital input detecting a switch.

 

What is your "trigger" in the example you posted?

In your example, you are just acquiring data and writing to a file.  So just do that.  If you are saying "don't write data to a file until the values have peaked", then just keep acquiring data until your conditions are met, and when they are write to the file which is placed in a case structure.

0 Kudos
Message 2 of 18
(3,377 Views)

My terminology was probably confusing, I am still very new to LabVIEW.

Basically, I need to start recording data only when the load is increasing and has reached a peak. The way I have the code currently, it just records everything including the zero load/noise values at the beginning which I don't want. So using your example, I meant trigger in the sense of: "Don't start acquiring data until the load has reached at least 5lbs, and stop acquiring data after all 3 load cells have reached a peak." Hopefully that clarifies the problem a little better.

 

Thanks

0 Kudos
Message 3 of 18
(3,361 Views)

Well you have to acquire data because how else would you know if a level has been reached unless you are reading it.

 

You need to understand that you can put the part about "recording" the data to a file in a case structure based on the conditions of the data that you just read.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW

0 Kudos
Message 4 of 18
(3,348 Views)

Hi jpartain,

You should continuously acquire data and then pick out the data that meets your criteria after the fact. It will be much easier if you get rid of the "dynamic data" and express VIs. The express VI is a nice way to test out hardware functionality, but for anything beyond that you should just use the DAQmx functions you need. This should help you collect data faster as well, since you can open the instrument reference prior to the loop, and close it after the loop, instead of doing it every single iteration which is what the express VI does.

0 Kudos
Message 5 of 18
(3,345 Views)

Thank you both for your input. 

 

I'll work on it for a while and try to implement some of things we discussed and then post an update later with the results and (more likely) any more problems that arise! 

0 Kudos
Message 6 of 18
(3,333 Views)

Gregory,

I'm working on implementing DAQmx VI's instead of the Express like you suggested and I'm stuck here now. I've simplified it down to a single load cell reading for now just to make things simpler to figure out, then I can add the remaining load cells later. See below for what I've got so far. 

 

jpartain_0-1581456509561.png

0 Kudos
Message 7 of 18
(3,311 Views)

Hi jpartain,

Can you explain why you're stuck? Are you seeing an error? 

0 Kudos
Message 8 of 18
(3,303 Views)

Yes I am getting Error 200077 at the Start Task VI. The program will run, but it doesn't record any data at all and when I stop it, this error appears. The load cell that this is reading is rated for 2000lbs, so I set the minimum to 0 and the max to 2000 in the Create Channel VI, but the Start Task VI seems to not accept those parameters. 

 

jpartain_0-1581457910778.png

0 Kudos
Message 9 of 18
(3,298 Views)

Yes those might be voltages if you have not set any kinds of units. You can right click the DAQ Assistant >> Generate NI-DAQmx Code. Then look at the code it generates to see what settings you were using.

0 Kudos
Message 10 of 18
(3,294 Views)