Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

count leading and falling edges

Hi dav2010,

 

You can indeed use two software-timed lines in parallel with the counter.

 

 

Best Regards,

John Passiak
0 Kudos
Message 31 of 40
(1,516 Views)

Hi John,

I plan to order the 9401 module, but, I have a question first.  I read the following on the NI product page.

 

"you can use LabVIEW FPGA to program the NI 9401 for implementing custom, high-speed counter/timers, digital communication protocols, pulse generation, and much more. Each channel is compatible with 5 V/TTL signals and features 1,000 Vrms transient isolation between the I/O channels and the backplane."

 

What is "LabVIEW FPGA"?   Is this something additional I need to buy to use the counter for frequency and period measurement?

 

Do you know of any tutorials or sample vi's on using the hardware timers to measure period in between rising/falling edges using the cDAQ 9174 with the 9401?

 

Thanks,

Dave

 

 

0 Kudos
Message 32 of 40
(1,500 Views)

LabVIEW FPGA only applies if you are using a cRIO backplane (which has a user-accessible FPGA).

 

If you are using cDAQ (like the 9174), then the bit about LabVIEW FPGA does not apply as there is no user-accessible FPGA on cDAQ.

 

 

Best Regards,

John Passiak
0 Kudos
Message 33 of 40
(1,492 Views)

Thanks, John.  I have received the 9401 and have been working with it, but, have some complications.  Can you confirm that the 9401 will allow me up to 4 channels of counting simultaneously?  I assume that I don't have to buy one 9401 per each slot in my cDAQ9174?  But, I am getting an error saying that "resources are reserved" suggesting that I can't use the 9401 to output a pulse train on one channel and count it on another.  What do you think?

0 Kudos
Message 34 of 40
(1,470 Views)

Hi John,

 

For example, I am using the Labview 2011 Labview example "Meas Dig Period-Low Freq 1 Ctr" to measure period.  It is slightly modified with a WHILE loop to continuously measure the period of a slowly turning wheel.  My hardware is a simple photo-interruptor that outputs TTL signal.  My system is showing typical period values between 10-500ms.  However, with this vi, apparently, I can measure only one channel. 

 

How can I use the multiple counters in my cDAQ9174 with the NI9401 to measure 3 periods associated with 3 sensor outputs simultaneously.  Now that I know how to configure this system for one channel, I want to configure two additional channels and measure period within the same vi, so we can do calculations based on comparing the periods of 3 sensors on 3 channels, all independent of one another.

 

When I try to add an identical loop and set the two channels correctly, this fails.  See the vi marked "failure".  What I mean is that when I connect ONE sensor output to both channels on the 9401, I observe different period readings, but, they should be identical because they are coming from the same sensor.  I haven't configured a second sensor yet.

 

Thanks,

Dave

0 Kudos
Message 35 of 40
(1,462 Views)

Hi Dave,

 

The counters are actually on the backplane of the 9174.  There are four total, and you can indeed use a single 9401 to route to all 4 of them.

 

As to why the readings are different, I can't say for sure.  The single counter method only returns the next period immediately following the software call to DAQmx Read.  Since the software calls don't occur at exactly the same time, it would be quite possible to get different readings if the period of the input signal was changing from cycle to cycle.

 

Or, perhaps there is noise on your input signal that is being picked up as an additional edge.  If this was the case, you could remedy the situation by enabling digital filtering (only available in DAQmx 9.4 and later for the 9174).

 

 

Try running the attached code, which measures from 4 channels simultaneously in a similar software-timed approach to what you were previously using with a single channel.

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 36 of 40
(1,436 Views)

Hi John,

Thanks for the clarification.  I will try the code you sent me.  By the  way, I have DAQ 9.2.3.  I had upgraded to 9.4 earlier in the year, but, it caused an error with the Tools>Visa Interactive Control from MAX.  The Visa interactive control function will not open in MAX if I have 9.4 installed.  We spent several months of trouble-shooting with NI support to determine this root cause, including re-formatting my hard drive; it was a big nuisance and a great investment of my time to resolve this issue.  It was reported as a bug, I guess.  So, I probably can't use the digital filtering option.  I will try your code and see if I can figure it out.

 

Thanks again,

Dave

0 Kudos
Message 37 of 40
(1,424 Views)

Hi Dave,

 

DAQmx 9.4 was released about two months ago.  You can try my code without filtering, but if the reason you are seeing different values on the various counters is noise on your signal then you'll probably want to get 9.4 working for the filtering capabilieis.  Out of curiosity, do you have a Service Request number relating to your previous issue?

 

For what it's worth, the VISA Interctive Control works on my machine with DAQmx 9.4:

 

2011-10-18_102212.png

 


Best Regards,

John Passiak
0 Kudos
Message 38 of 40
(1,418 Views)

Hi John,

 

Thanks for the update.  I checked the service request and it is Reference#7317521 and it was a RUNTIME ERROR with Visa-IC and not related to DAQ.  It was my mistake.  I believe that the upgrade that we decided to uninstall was for Labview 2011, not DAQ.  I think it was the service pak that was released in.... February that caused lots of problems????  The thread is very long, and I wonder if we concluded the issue by phone, because I can't find any email to document the conclusion...???

 

Do you recommend that I upgrade to DAQ 9.4?

 

Thanks,

Dave

 

0 Kudos
Message 39 of 40
(1,416 Views)

Hi Dave,

 

I think you should be able to view the SR notes for yourself using the Service Request Manager.  From what I can tell it looks like the issue was resolved by the Applications Engineer sending you an installer to use.

 

Looking at the notes of your more recent SR (7333750, it's same issue as what we are talking about here), it seems like the behavior confirms my suspicion that you are picking up multiple transitions on each change of state--digital filtering can be used to block these transitions from being registered, but you'll need to upgrade DAQmx to 9.4 as this is the first version that implemented the feature for the 9174.

 

 

Best Regards,

John Passiak
0 Kudos
Message 40 of 40
(1,406 Views)