取消
顯示結果 
搜尋替代 
您的意思是: 

How to use internal counter of cDAQ 9172 to measure PWM and generate frequency ?

已解決!
前往解決方案

Hi Galli,

 

The 9403 is SW-timed only (as you have found out).  Thus, the software-timed approach that you are trying is the only option without purchasing other hardware.  The 9172 provides support for clocked digital outputs (using a HW-timed module in slot 1-4) or for the access to two counters (using a HW-timed module in slot 5-6).

 

Now... there are quite a few optimizations you can make in your software.  For one, I would suggest using a producer/consumer architecture to remove as many steps as possible from your update loop.  You also might consider using the lower-level DAQmx VIs to have more explicit control over your tasks.

 

 

That being said, the communication to the 9172 is over USB which is going to have a much higher latency than a PCI card would (for example).  There is not really anything you can do to reduce this latency, it is simply an inherent limitation with USB.  In a feedback-type application, the latency actually hurts you twice (you must transfer data both from and back onto the 9172).

 

 

What kind of latency numbers are you seeing?  Although there are a few optimizations you could make in your code, I'd imagine the bulk of the latency mostly due to the latency of USB transfers.

 

 

Best Regards,

 

John

Message Edited by John P on 02-10-2010 11:45 AM
John Passiak
0 積分
11 條訊息(共 16 條)
2,523 檢視

Hi John

 

Thanks to your explanation. I'll try to work with my code to still working with th SW timer.

When you say about the counter in the slot 5 or 6, are you saying that is possible to use this counter to control my PWM? In this way I tested my 9403 in the slot 5 and in the "I/O name filtering" I check the box to the "Internal Channels". Now I can see the cDAQ1/_ctr0, cDAQ1/_ctr1, cDAQ1/_freqout but how can I transfer this counter to a physical output of the 9403 card? I'm configuring the internal counter of the 9172 chassi but I don't understand how to put this counter to an output of the 9403 in the slot 5.

 

Regards

 

Galli

0 積分
12 條訊息(共 16 條)
2,515 檢視

Hi Galli,

 

Sorry I think my last post was a little unclear.  The 9172 chassis itself has the 2 counters (+ freqout).  To route these externally, you need to use a HW-timed module in slot 5 or 6.  Since the 9403 is a SW-timed module you cannot use it to route the counters.

 

The following has a list of our cDAQ modules: 

C Series Support in NI-DAQmx

 

Any of the digital modules that say "Hardware Timed" should work for routing out counters in slot 5 or 6, or for performing correlated digital I/O in slots 1-4.

 

 

The cDAQ1/_ctr0 syntax indicates that the counter is internal on the chassis.  You can use the counters internally if desired in this way.

 

 

Best Regards,
John Passiak
0 積分
13 條訊息(共 16 條)
2,510 檢視

Hello John

 

Thanks again. First, I would like to try the possibility to use the internal counter and the 9403 in the slot 5. The problem is that I don't know how can I do this.

 

How can I connect the cDAQ1/_ctr0 in the software to send the PWM to an output of the 9403???

 

Please, let me know if you have some news.

 

Regards

 

Galli

0 積分
14 條訊息(共 16 條)
2,504 檢視
Like I mentioned last post, since the 9403 is a SW-timed module you cannot use it to route the counter outputs.
John Passiak
0 積分
15 條訊息(共 16 條)
2,501 檢視

Hi John

 

I understood everything now. I will work to improve my VI to SW timed.

 

Thanks to support.

 

Regards

 

Galli 

0 積分
16 條訊息(共 16 條)
2,497 檢視