From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using PCI4461 with C#.NET

C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\DAQmx\Synchronization\Multi-Function\SyncAIAO_DigStart\cs
 
Hello, everyone.
I am using PCI4461 with C#.NET and Measurement Studio.
I have to do synchonization btw AI and AO, and try to run SyncAIAO_DigStart example.
It works well, but this example is using the same SampleClock on AI and AO like below.
 
                // Set up the timing
                inputTask.Timing.ConfigureSampleClock("",
                    Convert.ToDouble(rateNumeric.Value),
                    SampleClockActiveEdge.Rising,
                    SampleQuantityMode.ContinuousSamples,
                    Convert.ToInt32(samplesNumeric.Value));
                outputTask.Timing.ConfigureSampleClock("",
                    Convert.ToDouble(rateNumeric.Value),
                    SampleClockActiveEdge.Rising,
                    SampleQuantityMode.ContinuousSamples,
                    Convert.ToInt32(samplesNumeric.Value));
I need a high sampling rate on AO and a low sampling rate on AI, I changed it.
 
                // Set up the timing
                inputTask.Timing.ConfigureSampleClock("",
                    Convert.ToDouble(inputRateNumeric.Value),
                    SampleClockActiveEdge.Rising,
                    SampleQuantityMode.ContinuousSamples,
                    Convert.ToInt32(inputSamplesNumeric.Value));
                outputTask.Timing.ConfigureSampleClock("",
                    Convert.ToDouble(outputRateNumeric.Value),
                    SampleClockActiveEdge.Rising,
                    SampleQuantityMode.ContinuousSamples,
                    Convert.ToInt32(outputSamplesNumeric.Value));
Unfortunately, it does not work well with Error Code: -200660.
 
Is it impossible to use a separate sampling clock on AI and AO in Synchronization?
 
Please help me.
 
Thank you

메시지가 06-21-2007 02:51 AM에 James Choi에 의해 편집되었음

0 Kudos
Message 1 of 3
(3,692 Views)
Hi James,

Looking at the 4461 specifications, the analog and input clocks are bases on the same internal sample clock.  You have to make sure your clocks fit into the following specifications.

You can run AI and AO operations simultaneously at different rates.
However, because the timing information for all operations is derived from
a common sample clock timebase, the ratios between AI and AO sample
n
rates can differ only by a factor of 2 , where n is an integer. For example,
assume that the AI sample rate is 8kS/s. Valid AO sample rates include, but
are not limited to, 2kS/s, 8kS/s, 16kS/s, and 64kS/s. In this case, 20kS/s
is not a valid AO sample rate because the ratio between 8kS/s and 20kS/s
is not a power of 2.

Your manual is  here http://www.ni.com/pdf/manuals/373088a.pdf

Have a great day,

Michael D
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(3,671 Views)
Hi MickeyD,
 
Thank you for your kind help. I should have read a manual more precisely.
The setting was 2kS/s for AI and 200kS/sfor AO, and I changed 128kS/s for AO.
It works well.
 
Thank you.
 
James CHOI

메시지가 06-22-2007 08:50 PM에 James Choi에 의해 편집되었음

0 Kudos
Message 3 of 3
(3,664 Views)