Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6602 C# software

Hello, I am trying to do some pulse width buffering with a 6602, and I found that the example software that is provided doesn't correspond directly with my card. After searching, I have discovered that there are functions that are designed to control this card. (http://www.ni.com/pdf/manuals/321644k.pdf p.124) However, I am not able to find the NI-DAQ help files it refers to for further information. Where do these GPCTR functions exist, and is there an example of their use somewhere? (I'd settle for any .net language at this point, although I am working in C#.)

 

  Many thanks...

Message 1 of 5
(6,463 Views)

Good morning Zipporah,

 

It appears that you are looking to do a buffered pulse width measurement on your PCI-6602 card.  The link you have referenced is for the old version of our DAQ driver, Traditional DAQ.  I would suggest downloading and installing the latest version of our DAQmx Driver.  This driver works with your card, and it will allow you install .NET (c# and VB) examples along with other Text Based Support for the DAQmx Driver.  You will also get the DAQmx help file that is very beneficial with these functions.  With that said, there are several counter examples for you to use in c#, one of which is a pulse width measurement. 

 

The examples install by default to Start»Programs»National Instruments»NI-DAQ»Text-Based Code Support».NET 3.5 Examples

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 2 of 5
(6,450 Views)

Adam,

  Thank you for the information. I was not aware that those functions belonged to Traditional DAQ.

 

I have looked at the current DAQmx examples, and I am able to run some of them. In MeasBuffered_SemiPeriodFinite, I notice that the digital filter values seem to be set with the CreatePulseWidthChannel function. However, when I run the program, it seems to completely ignore the filter values and accept pulse widths of any length. Is this actually setting the digital filter values, or is that done some other way? Also, I get the error -200141 (data was overwritten before it could be read by the system). Could this be fixed if the filter was working correctly? Also, is there an example of how to set the source/gate signals? I know I can't call ConfigureSampleClock with the 6602, but it seems like I should still have some control over what my clock is.

 

   Thanks.

0 Kudos
Message 3 of 5
(6,445 Views)

Good morning Zipporah,

 

Here is a KnowledgeBase article that discusses the error you are receiving; please disregard the DAQmx Base sections. 

 

As for the filtering, are you referring to the minimum and maximum values that can be input to the channel configuration?  If yes, these are not necessarily a filter, but they are an estimate for the DAQmx driver to use when setting up the task.  By giving a good estimate, it will help to choose the best timebase for the task and help to reduce error.  However, it will not actually filter out any values.

 

There is a property node where you can actually configure a digital figure for the input, that can help to eliminate this error you are receiving.  It could be that there is noise on your line and you are getting a quick pulse at a high frequency that is giving you unwanted pulses that are overflowing your FIFO.  Here is the help document from our DAQmx C Reference Help manual, so the syntax will be similar in .NET:

 

Get/Set/Reset CI_PulseWidth_DigFltr_MinPulseWidth

int32 __CFUNC DAQmxGetCIPulseWidthDigFltrMinPulseWidth(TaskHandle taskHandle, const char channel[], float64 *data);

int32 __CFUNC DAQmxSetCIPulseWidthDigFltrMinPulseWidth(TaskHandle taskHandle, const char channel[], float64 data);

int32 __CFUNC DAQmxResetCIPulseWidthDigFltrMinPulseWidth(TaskHandle taskHandle, const char channel[]);

 

Purpose

DAQmxGetCIPulseWidthDigFltrMinPulseWidth gets the Counter Input >> Pulse Width >> Digital Filter >> Minimum Pulse Width property.

DAQmxSetCIPulseWidthDigFltrMinPulseWidth sets the Counter Input >> Pulse Width >> Digital Filter >> Minimum Pulse Width property.

DAQmxResetCIPulseWidthDigFltrMinPulseWidth resets the Counter Input >> Pulse Width >> Digital Filter >> Minimum Pulse Width property.

 

Best,

Message Edited by cyclone2k9 on 04-15-2010 11:07 AM
Adam
Academic Product Manager
National Intruments
0 Kudos
Message 4 of 5
(6,426 Views)

Hello Adam,

  Thank you for the clarification. Yes, I was talking about the min and max values of the channel configuration. It looks like I will not need to set the digital filter values afterall. Again, I appreciate your help.

 

 

0 Kudos
Message 5 of 5
(6,380 Views)