Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the DAQmx API, how can I programmatically enumerate the analog output sample rates for USB-4431?

According to page 3 of the spec sheet for the USB-4431 http://www.ni.com/pdf/manuals/372485c.pdf
the analog output supports 21 discrete sample rates.
 
I'm writing a general application that works with all NI-DAQmx supported devices using DAQmx calls. I know that I can get the min/max values with DAQmxGetDevAOMinRate() and DAQmxGetDevAOMaxRate() respectively but can't find the call to enumerate all legal values for AO on the USB-4431.
 
When the user requests an unsupported value  my app blithely passes it to the device using DAQmxSetSampClkRate() and we get the text error message:
 
Requested value is not a supported value for this
property. Property: DAQmx_SampClk_Rate You Have Requested:  2.0e3 You Can
Select:  800.000000,  1.250000e3,  1.500000e3,  1.600000e3,  2.500000e3,
3.0e3,  3.200000e3,  5.0e3,  6.0e3,  6.400000e3,  10.0e3,  12.0e3,
12.800000e3,  20.0e3,  24.0e3,  25.600000e3,  40.0e3,  48.0e3,  51.200000e3,
80.0e3,  96.0e3  Task Name: MWDAT0002  Status Code: -200077
 
We need a way to detect that the user has chosen an unsupported value and prevent it from being passed to DAQmx.
 
My questions:
1. What DAQmx call exists that will return the list of legal values?
2. Are there other NI devices that behave this way? In the past it seemed like if the rate was set to something the device didn't support it was coerced to the next higher supported rate, which was returned by calling DAQmxGetSampClkRate()
 
Thanks!
Sherryl Radbil
Data Acquisition Engineer
The MathWorks
0 Kudos
Message 1 of 6
(3,989 Views)

Hey Sherryl,

     Because this was the first device that had multiple subsystems sharing a timing signal, we wanted to have customers "more aware" of the valid values for AO sample clock rate.  Therein we did not choose to coerce the AO rates to the next highest value.  Unfortunately, that means that you will have to parse the error string or use an array of possible values to get past this issue.  There is not a property for valid sample clock rates, just min and max.

 

Good luck

 

Gavin Goodrich

National Instruments
0 Kudos
Message 2 of 6
(3,952 Views)

Hi Gavin,

Thanks very much for the information.

 

Is there a way to put in an enhancement request to provide this functionality in a future release of NI-DAQmx?

 

 

Sherryl Radbil
Data Acquisition Engineer
The MathWorks
0 Kudos
Message 3 of 6
(3,947 Views)

Sure...

I'll make a request for us to revisit that decision and to reference this post.

 

-gavin

0 Kudos
Message 4 of 6
(3,922 Views)

Gavin,

any progress in this regard?

 

Thanks!

 

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

Hello diabolo,

I haven't seen this functionality implemented anywhere so far; however, if you need to limit the user interface to certain values, could you not use a combo box with only the accepted values?

You can then feed this into whichever terminal you want and not worry about what the user inputs.

 

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Message 6 of 6
(3,465 Views)