LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input from 6210

Have this piece of code written by BLOKK. (http://forums.ni.com/t5/LabVIEW/Where-to-put-communication-with-NI-USB-6212/td-p/3254217/page/3)

I would read Analog output with the rate of 100 kHz but I can't figure out how to do this with his fine piece of code.

Can anybody help?

 

snip.png

0 Kudos
Message 1 of 12
(4,705 Views)

Ok, so you opened up a new post too. See my comment at your original post. What you show, my example code was designed to run software timed. So it takes 1 sample per all required channels. If you need higher sampling frequency, you need to modify the initialization part of the VI. You need to specify the required frequency and the number of samples per channel using "DAQmx Timing.vi". Also, you need to decide on the design: you sample in your actual while loop, or -wich is better usually- you start to use a Producer/consumer pattern to decouple DAQ and data analysis (logging) parts in your code.

 

Anyway, but as I wrote in my other comment, I think you really not need 100 kHz sampling for a pressure transducer in your actual experimental setup...The sensor itself has a much higher "inertia", its output changes much slower than 100 kHz...

 

edit: I guess the "6210" is a mistypo, since you mentioned "6212" in your original post?

0 Kudos
Message 2 of 12
(4,703 Views)

As advised( I think you were part of that) I replaced my 6212 with 2 6210.

The variation of the output is 0.7 mBar. The precition is 0.1 % of full scale which is 100 mbar.

You are right about the change speed of the pressure transducer. Probably some kind of noise as you also suggest .

Our Idea was to sample more an average the noise out, but we will of course also try to reduce noise.

The room where the equipment is placed is temperature controlled.

Thank you for your reply

0 Kudos
Message 3 of 12
(4,669 Views)

@Michael.Koppelgaard wrote:

As advised( I think you were part of that) I replaced my 6212 with 2 6210.

The variation of the output is 0.7 mBar. The precition is 0.1 % of full scale which is 100 mbar.

You are right about the change speed of the pressure transducer. Probably some kind of noise as you also suggest .

Our Idea was to sample more an average the noise out, but we will of course also try to reduce noise.

The room where the equipment is placed is temperature controlled.

Thank you for your reply


I never heard about pressure sensor with upper limit 100 mbar. Are you sure it is not 1000 mbar (~1 atmosphere)? If the scale is up to 1000 mbar, it means precision is 1mbar. So actually the 0.7 mbar variation is quite good. I use many pressure sensors (full scale 1000 and also 3000 mbar) and their signal fluctuates around a few mbars. Totally in agreement with their data sheet. So I do not see any problem here...

 

edit: I know, I know, i am not a mathematician 🙂 Actually precision, accuracy, noise, etc. are not the same things, but for now I just called it "signal fluctuations" 🙂 Anyway, 0.7 mbar fluctuations seems totally OK...

https://www.allsensors.com/engineering-resources/white-papers/accuracy-and-precision-for-mems-pressu...

 

edit2: could you provide the data sheet of these sensors, or link it? I am just curious... (i use such products from companies MKS and TEI)

 

edit3: I have found products with upper limit of 100 mbar, so they exist indeed 🙂 In this case the precision is 0.1 mbar. So your fluctuation has a (peak-to-peak) amplitude 7 times higher than the precision. Hmmm, could you make a measurement in an ideal separated environment? So only using the DAQ module and a single pressure sensor? Record the signal fluctuations, and show it here (the raw voltage signal and the conversion formula too).

 

edit4: please also share the wiring (wire type, shielding, grounding, etc.).

0 Kudos
Message 4 of 12
(4,664 Views)

As I remember, you used RSE for input terminal configuration. You could move to Differential wiring (and so set the input terminal configuration to "Differential" for the "init_USB6212.vi"), it might improve the system. So you have to wire your pressure sensors in this way to the phyisical pins ( more reading:http://www.ni.com/white-paper/3344/en/ ).

 

For the question about how to sample at 100 kHz, you need to modify my code to include timing, and specify the number of samples per channel. You also need to decide how you want to calculate the Mean and SD values from your data. If you have 12 channels, you need to calc means and SDs on 100k values 12 times. Another question whether you want to embed this statistical calculations inside the lvlib ("ResourceModule"), or you request a 2D data array instead (size 12X100k) and calculate these statistics in your main VI (maybe using a Producer/consumer design).

 

As a not too elegant solution, you could stay with software timing, and request data just at around 100 Hz. Take lets say 80 values in a FOR loop, and then you can get some more data to calculate mean and SD values to play with...  (the trick is that you keep the DAQ time just a bit below 1 sec, and still using the "Wait until msec multiple" function to ensure better matching between iteration times). Something like this:

 

Example_VI_usb6210.png

 

EDIT: another thought about your experiment: you should really test your sensor attached to a CONSTANT pressure chamber, it might be that the "fluctuations" around 0.7 mbar what you see is actually really there. Can it be that the pressure really fluctuates at this level? I do not know what you measure, so it is another possibility...

0 Kudos
Message 5 of 12
(4,642 Views)

Thank you for you reply ! 🙂

 

Here is my test app:snip.png

 

And output

 

Capture.PNG

 

Also the data for the pressure transducer. I mentioned range 0- 100 mbar. What I meant was -100  to 0 mbar. The data on the curve is positive. That's a mistake. Should of course be negative, but that should not matter.

About  wiring I can tell you without help from my workshop man who is not available today.

We a discussing change to difference wiring..

 .

Varenr.: DMP 331i 110-S170-1-1-100-300-1-111
Medieberørte dele: Syrefast stål, AISI 316Ti/316L og FKM o-ring
Nominelt måleområde: -0,17 - 0,17 barg
Kalibreret måleområde: -0,1 - 0 barg
Udgangssignal: 4 - 20 mA
Nøjagtighed: +/-0,1% FSO
Procestilslutning: G1/4" DIN 3852
Eltilslutning: ISO 4400 - inkl. stik
Spændingsforsyning: 10 - 28 Vdc
 
Prisen er i dag, kr. 4.479,00 -15% = kr. 3.807,15 netto  
 
Leveringstiden er ca. 3 uger.
0 Kudos
Message 6 of 12
(4,637 Views)

Udgangssignal: 4 - 20 mA

 

Regarding to the above info from your specificatons, this pressure sensor outputs current and NOT voltage signal. You connect this pressure sensor to a USB-6210 unit which is a DAQ device to measure VOLTAGE signals...

0 Kudos
Message 7 of 12
(4,634 Views)

I modified my app after you example. New output after the blue arrow 🙂 But we should try to reduce noise anyways. But now I know there is another way .... 🙂

 

 

Capture.PNG

0 Kudos
Message 8 of 12
(4,633 Views)

Did you read my post about you connect a current signal to a voltage measurement HW, which is a NO GO?

 

edit: you could show the wiring diagram...maybe a resistor is used connected to the sensor, and the voltage drop over the resistor is measured via the USB device?

0 Kudos
Message 9 of 12
(4,630 Views)

Ups Error. I should multiply with slope instead of subtracting.... 😞

0 Kudos
Message 10 of 12
(4,617 Views)