Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous Analog and Counter Input with Express VI's

Hi All,

I have an NI 6040E and would like students to use the Labview express vi's to acquire a voltage signal from an accelerometer and count pulses from a Pasco rotary encoder as a cart rolls down ramp.

I've got the accelerometer connected to an analog input channel and the Pasco encoder is using counters 0 and 1.

I'd like to acquire both signals for about 5 seconds at 1000 samples per second and then write the data to a spreadsheet file.

From what I've read, I have to use hardware timing due to the sampling rate, but I find the counter side of things a bit confusing.  I'd love to find an example or a tutorial similar to this application  but haven't been able to find anything really useful on my own...

Any help would be appreciated!

TIA!

Peter
0 Kudos
Message 1 of 5
(5,180 Views)
Hi,

My suggestion is to start with a LabVIEW shipping example. When you open LabVIEW, under the Help menu choose "Find Examples". Under the browse tab choose "Hardware Input and Output">> "DAQmx" >> "synchronization" >> "Multi-Function" >> Mulit-Function-Synch AI-AO.vi. This example will show you how to do simultaneous DAQmx analog output and analog input. You can edit this VI to do analog input and counter input. I hope this helps!
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 2 of 5
(5,155 Views)
Hi,
I see that a few people have looked at this question so I thought I should post the VI that I wrote.  Maybe it will help somebody else...

The Pasco Set Res 360.vi pulses the counter outputs so that the Pasco rotary encoder is in the 360 pulses per revolution mode.  When powered up this encoder is in 1440 pulses per rev mode and it doesn't take much linear velocity to over speed it and make it lose count.  So the first thing the students do is run this vi.

The MECH4600_Velocity.vi does the data acquisition from the accelerometer on an AI channel and counts pulses on one of the counter channels, it then writes the data to a file.  Basically the student starts the vi and releases the cart and it rolls down the track until it hits the bumper. They can then calculate cart velocity by integrating the acceleration signal and differentiating the position count.

Cheers!
Download All
Message 3 of 5
(4,963 Views)
Hi Peter,
 
Thanks for posting your code for the benefit of others! Smiley Happy
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 4 of 5
(4,942 Views)
Hi, i'm working with a NI USB-6211 and my software is Visual BAsic 6.0.
I need to read analog input voltage samples and a counter simultaneously and i'm having some problems with that...

i can manage to do the tasks separetly but not simultaneously...

If you know anything about this subject i would apreciate that you chared your knowledge with me!

Thank you
0 Kudos
Message 5 of 5
(4,910 Views)