01-25-2006 08:49 PM
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.
06-26-2006 01:19 AM
Is this feature now in DAQmx 8.1?
-cpede
06-27-2006 02:16 PM
08-31-2007 09:29 AM
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
10-10-2007 07:56 AM
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
10-12-2007 05:58 AM
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
10-15-2007 07:01 AM
Please anyone, I'm under tremendous pressure to find a solution to this problem.
-cpede
10-15-2007 06:04 PM