08-29-2013 03:14 AM
I need your help for measuring speed differences(rpm) between 2 shaft speeds with NI usb 6351 card. Shafts’ speeds fluctuating between 700rpm to 1200 rpm.
For the first shaft; I got quadrature encoder(1000p/r) and its cables connected to 81,85,83 pins of the card
Second shaft has 12 tooth gear and I got photoelectric type sensor(srf-50-5-p) to read shaft speed and sensor’s cable connected to 76 pin of the card.
Now I need to build something in Labview but I cant do anything without your help……
I need to get as much data as 6351 can provide.
Solved! Go to Solution.
08-29-2013 03:25 AM
Connect each of your encoders to counter inputs of the 6351. You can find examples of reading from quadrature encoders if you go to
Help>>Find Examples and then browse to Hardware Input and Output>>DAQmx>>Counter Input.
If you are unsure how to configure the counters try using the DAQ Assistant express VI to setup your initial configuration
08-29-2013 05:34 AM
I connected each cable to the 6351 and I tried to read the datas from encoder with a basic program as shown in attachment. but it measures the angular changes of encoder. I dont know how to configure it to measure/convert in rpm. And also I dont know how to increase the number of datas it takes form encoder.
08-30-2013 09:33 AM
Here's another example which you may find useful :
Use Counter Frequency to obtain an Encoder Rotational Speed
https://decibel.ni.com/content/docs/DOC-13039
This example basically uses the frequency measured by the encoder to calculate the rotational velocity of the encoder.
Let us know if you run into any problems!
Andy C.
Applications Engineer
National Instruments
09-02-2013 03:22 AM
thnx for your help andy,
the example that you suggested worked well but it is so complicated for me to understand it and I cannot add something new to measure or display so I built a different thing that shown in attached picture but I'm not sure whether it is right/well enough or not for the measurement of encoder speed because I didnt fully understand both measurement method and especially the purpose of divisor in the frequency setup page. Secondly, I need to add another speed measurement to this work but I couldnt add another channel to the same DAQassistant, should I add another DAQassistant to measure it?
09-03-2013 11:40 AM
The example I posted takes advantage of the lower level DAQmx functions. Express VIs are actually simply wrappers for these lower level functions. If you're at all curious about how the example I posted works, you should take a look at this paper :
Learn 10 Functions in NI-DAQmx
http://www.ni.com/white-paper/2835/en/
As for the code you posted in the last reply, I would say it looks fine as long as it gives you the data you are expecting. You should be able to add a second Express VI for your second counter measurement--have you tried this yet?
Cheers,
Andy C.
Applications Engineering
National Instruments
09-03-2013 12:44 PM
Now I decided to use another encoder instead of speed sensor for second speed measurement and I connected it 76-77-87 pin of the card (to ctr1, first one @ctr0). And I could read and display the datas with changing just the ctr 0 to 1.
But when I tried to read them together it never worked, always gave error.
firstly I tried to add a channel to same daqassistant and configure it in the same way with the first one ( just their ctr number is different) but it didnt work.
secondly, I added another daqassistant and configure it in the same way with the first one again , but the result didnt change.
I did whatever I can like checking all the connections changing the measurement method (low frequency for only using one counter)etc. but I wasnt able to run it. can you guess what kinda mistakes I've been doing? how can it be worked? or 6351 just can read only 1 encoder?
09-03-2013 12:57 PM
I haven't used the 6351 card specifically, but my guess is that you have two examples that are independently trying to configure the same resource.
Without futrther investigation, my guess is that, when you configure for ctr0, the resource is reserved, so attempting to add ctr1 fails. (Likewise if you configure ctr1 first.)
I'm not certain whether you can configure both ctr channels to operate at the same time on the 6351, but I can't see any reason why this shouldn't be possible. Starting with a working example VI, dig down into the config section and see if you can combine the config for both ctr0 and ctr1 into the same configuration step. (Essentially, what you want is a single DAQ Task ID that works with both ctr channels operating at the same time.)
If you are unable to make this work, another suggestion would be to post the error number you are seeing when you attempt to run the second VI. Then we can get a better understanding of the nature of your difficulty.
-- Dave
09-04-2013 02:39 AM
yes! you are right!
I attached both pictures (config&error) and the model.
can you check it? because I couldnt find out the problem.
pin connections are;
ctr0 --- 81*85*87
ctr1---76*87*77
09-04-2013 02:43 AM
for attachments...