Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI6511 digital filter usage

Hi,

 

I am tring to use the PCI6511 as DI device in a near-real-time system (10ms resolution).

 

The project requires that the different debounce and blocking time could be set per channel. By blocking I mean after a valid value change is detected, the channel will not report any value change for certain time.

 

I uses DAQmx API for C to implement my project and tried with the following calls to set the filter property:

 

DAQmxSetDIDigFltrEnable
DAQmxSetDIDigFltrMinPulseWidth

 

There are a few questions:

 

1. It seems to me that I have to use empty string as the channel name in the above calls. Otherwise system will return me an error code saying this property is not configurable per channel. Is it right?

2. Therefore if I want the debounce time to be configurable per channel, the only way seems to be creating a task for each channel. Imagine there is 64 channel per board, and maximum 10 slot per host machine, I will have to create 640 tasks and have to read from 640 tasks if I do a polling job. How would this number of tasks affect the system performance? Is there any other better solution?

3. Is there an easy way to implement the blocking function using the on-board feature? What I can think of is to setup the change detect event for the tasks, and then log the time-tag every time when a valid change (after filtering) is detected, then compare the time-tag to decide whether this change should be blocked or not. Is there a better way?

 

thanks a lot,

 

Jane

0 Kudos
Message 1 of 7
(3,840 Views)

A few more questions about PCI boards as general:

 

1. Is there any DAQ API calls available to check the board status? i.e.: normal / faulty / error_code, etc.

2. Is there any DAQ API calls available to perform self-test like the MAX does?

3. Is there any DAQ API calls available to set/reset the board LED? (GO to register level programming is not really an option for the project now)

 

To be more specific,  the boards I am looking at are PCI6511/6513/6225/6704.  

 

Thanks a lot,

 

Jane

0 Kudos
Message 2 of 7
(3,833 Views)

Hi Jane,

 

You should be able to take advantage of the digital filtering for your 6511 inputs usign the properties that you listed in your initial post. You can run into a problem when you try to configure the minimum pulse width for each channel. You will be able to set one minimum pulse width for your channels because of the filtering implementation. This is described in more detail in the 6511 User Manual starting on page 17. There is a filter clock that is set based on the specified minimum pulse width and this is used for the filtering on the device. The same filter clock will be used for each channel it is enabled for.

 

As far as the additional functions for reset and self-test, those exist and are listed in the NI-DAQmx C Reference Help (Start>>Programs>>National Instruments>>NI-DAQ) and you can find them under NI-DAQmx C Functions>> Advanced Functions>>Device Control. The functions are DAQmxResetDevice and DAQmxSelfTestDevice.  

 

The DAQmx functions return a status number that indicates the current status of the hardware. In the case of an error, this can be converted to the appropriate error message using the DAQmxGetErrorString function.

 

What functionality were you looking for with the LED? The hardware uses it to indicate the device status. In the event of an error and the LED goes red, the reset function will return the LED back to green once the error has been cleared.

Steve B

0 Kudos
Message 3 of 7
(3,796 Views)

Thanks Steve!

 

I couldn't find the call DAQmxSelfTestDevice on my version of DAQ. Do I need to install some supportive package? or a newer version?

 

For the other call you mentioned: DAQmxResetDevice, seems it will reset all the tasks that are currently running on the board. Is there a way to get the current working status without interrupting the tasks at run-time?

 

Basically the functionality that I look for with the LED is to detect the status and reset the error. For example, with digital filter and change detection enabled with my 6511 card, the software will be triggered only when there is a valid change. Then I will get the return status when I call the read channel. However I would also like to refresh the card status from time to time (i.e.: every 1 second) and hopefully this status I get will be synchronized with the LED color change.

 

thanks,

Jane

0 Kudos
Message 4 of 7
(3,793 Views)

Hi Jane,

 

Where were you looking and not finding the DAQmxSelfTestDevice? Which version of the DAQmx driver are you working with? If you are able to see other functions it is likely that you have already installed the appropriate support (ANSI C, .NET, ...) but you can verify under Add/Remove Programs>>National Instruments Software>>NI-DAQmx to see what support is installed. You can see what I am referring to in the attached image.

 

Each DAQmx function and property that you call in your program will return the current state of the hardware. The DAQmxResetDevice will reset all of the tasks on the device and should be used to clear an error to return the hardware to the desired state. You will want to check the status of the hardware with each DAQmx call and in the event that there is an error the error status code can be passed to the DAQmxGetErrorString function in order to get more information about the actual error. You will not need to detect the error from the LED, as this can be done programmatically, however in the event of a hardware error the LEd will change color.

 

Your best approach will be to programmatically find an error, process it, and return the card to the desired state.

 

If you do need to upgrade your version of the DAQmx driver you can finda download for the upgrade from the DAQmx Product Support Page:

http://sine.ni.com/psp/app/doc/p/id/psp-268

 

DAQmx Support  

Message Edited by Steve_B on 02-08-2009 03:05 PM
Message Edited by Steve_B on 02-08-2009 03:09 PM
Steve B

0 Kudos
Message 5 of 7
(3,761 Views)

Hi Steve,

 

Thanks for the information.

 

I checked my local installation and found that I am using a pretty old version: 8.6.0. This is because we investigated the device a while ago and go seriously to project only recently. Do I absolutely need to upgrade my DAQ to the latest version? Is there any known bug-fixing that is important in the newer version?

 

As mentioned pervious the devices I am looking at are PCI6511/6513/6225/6704.

 

Thanks,

 

Jane

 

 

Message Edited by JaneGuo on 02-09-2009 08:44 AM
0 Kudos
Message 6 of 7
(3,751 Views)

Hi Jane,

 

You likely do not need to upgrade the driver to fix the issue that you are describing. With each driver release there is an associated Readme file that describes the corresponding issues that have been addressed in this version. You can look there to see if your issue of interest has been addressed. What environment are you in when you are trying to locate this function? It should exist as the other functions do in the coding environment as well as in the help files.

 

Steve

Steve B

0 Kudos
Message 7 of 7
(3,730 Views)