Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

SC-2040 T/H missing as assessory for DAQmx

Laura is right in that while the device is listed as a compatible accessory, the DAQmx driver doesn't provide any other built in functionality for using the accessory.  What does this mean?  As Laura pointed out, you'll first have to export the sample clock signal from the DAQmx task so the 2040 knows when to go into and out of track and hold mode.  To do this, you need to use the DAQmxSetExportedSampClkOutputTerm and DAQmxSetExportedSampClkOutputBehavior functions.  Set the output terminal to PFI7 and the output behavior to DAQmx_Val_Lvl.  The level behavior ensures the signal stays high until all of the conversions are finished instead of just providing a brief pulse.

Second, you'll have to do some more work to ensure the timing requirements for the track and hold signals are met.  Refer to the specifications in the manual for the track and hold times for your desired accuracy.  To ensure your hold time is being met, you will need to set the delay from sample clock property using the DAQmxSetDelayFromSampClkDelay function.  You can also use the DAQmxSetDelayFromSampClkDelayUnits function to specify the delay in your desired units.  Your track time can be calculated as follows:

Track Time = Sample Period - (Hold Time + (# Channels * Convert Period))

Since your hold time will generally be constant, you just need to ensure the covert rate and sample rate you choose allow sufficient head room to satisfy the tracking time.  If you're using an external signal not originating from your MIO board as your track and hold trigger, you'll need to do some additional setup, but I'm not going to go into that since I doubt you're using that feature.

Last, since the driver doesn't know what gain stages you've applied through the dip switch settings on the SC-2040, you're scaled data will be wrong unless you happen to be using a gain of 1.  However, this can be fixed relatively easily by using a custom scale and applying the appropriate linear equation.  Hopefully this helps.

Message 11 of 18
(2,537 Views)

Is this feature now in DAQmx 8.1?

-cpede

0 Kudos
Message 12 of 18
(2,468 Views)
Hi cpede-
 
No, the SC-2040 T/H is not supported in NI-DAQmx.  Jason's suggestions above should work well regardless of which version you're using.
 
Thanks-
Tom W
National Instruments
0 Kudos
Message 13 of 18
(2,423 Views)

Ok, I know this is not my speciallity, so please help.

To get the SC-2040 to work with a DAQmx device.

The first step to set the DAQmxSetExportedSampClkOutputTerm to PFI7 and DAQmxSetExportedSampClkOutputBehavior to DAQmx_Val_Lvl, that I can do 🙂

But in my current implementation I just call DAQmxCfgSampClkTiming with a SamplingRate.

Then I see the formula: Track Time = Sample Period - (Hold Time + (# Channels * Convert Period))

where a Track Time and Hold Time is used. looking in the manual for the SC-2040 I can find some numbers on page A-3.

So lets say I want to use Track Time = 10 us, that I should have Hold Time of 1 us, correct?

Then when I set the sample rate using DAQmxCfgSampClkTiming, then I can call DAQmxGetAIConvRate, and then do a 1/ConversionRate to get the Convert Period, correct?

How do I get the Sample Period? And what if the numbers don't match in the formula?

Please help?

-cpede

0 Kudos
Message 14 of 18
(2,205 Views)

Ok I think I got it. Please comment, if I have made mistakes.

if resolution is 12-bit I set SettlingTime = 1, and TrackTime = 7 usec.
if resolution is 16-bit I set SettlingTime = 2, and TrackTime = 50 usec.

I calculate the maximum sampling rate possible with the current settings:

maxSampleRate = 1 / (TrackTime + SettlingTime + ((numChannels - 1)*(1/currentConvRate)));

I test if this is OK, otherwise I try using the maxConvRate from DAQmxGetAIConvMaxRate

Then I do the set up:

DAQmxSetDelayFromSampClkDelayUnits(s_hTask,DAQmx_Val_Seconds);
DAQmxSetDelayFromSampClkDelay(s_hTask,(float64)SettlingTime*1e-6);
// us
DAQmxSetExportedSampClkOutputTerm(s_hTask,"/Dev1/PFI7");
DAQmxSetExportedSampClkOutputBehavior(s_hTask,DAQmx_Val_Lvl);

This seems to work.

* I'm in doubt if I should use (numChannels - 1) or just numChannels ?
* I also limit the supported devices to be E- and M-series, is this true ?

-cpede

0 Kudos
Message 15 of 18
(2,123 Views)

Aaaaggg. Now I have successfully tried using the two PCI devices: PCI-MIO-16E-4 and PCI-6023E.

BUT

The I tried to use the two PCMCIA devices: DAQCard-6036E and DAQCard-6024E and non of them worked?

I tried to add external power but no difference. Is is not possible to run the SC-2040 with PCMCIA DAQCards?

-cpede

0 Kudos
Message 16 of 18
(2,113 Views)

Please anyone, I'm under tremendous pressure to find a solution to this problem.

-cpede

0 Kudos
Message 17 of 18
(2,106 Views)
Hi cpede,

I don't see any specific reasons why the DAQcards wouldn't work.  Did you verify that the sample clock was being exported on PFI7 with an oscilloscope?  Also, on page 17 / 56 in the manual, it mentions that you will need to select external power with a switch.  Did you do this when you had the external power supply connected?  If  you didn't, the accessory might not be getting enough power from the PCMCIA devices.

I hope this helps,
0 Kudos
Message 18 of 18
(2,088 Views)