06-11-2013 07:38 AM
Hi,
can anyone explain how to use "ai/sampleclock"?
I have an USB 6210 card and I want to read data from analog and digital in.
A very basic setup looks like this:
string dev = "dev1";
Task t1 = new Task();
t1.AIChannels.CreateVoltageChannel(dev + "/ai0", "", AITerminalConfiguration.Differential, -0.1, 0.1, AIVoltageUnits.Volts);
t1.Timing.ConfigureSampleClock("", 100.0, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
t1.Control(TaskAction.Verify);
Task t2 = new Task();
t2.DIChannels.CreateChannel(dev + "/port0/line0", "", ChannelLineGrouping.OneChannelForEachLine);
t2.Timing.ConfigureSampleClock(dev + "/ai/SampleClock", 100.0, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
t2.Control(TaskAction.Verify);
I get an exception at the t2.Timing.ConfigureSampleClock call (also tried with "/ai/sampleclock", /dev1/ai/sampleclock")
Is it not possible to get analog and digital data at the same time with this card?
If I understand the forum posts correctly, I can't use the internal clock to get digital data (how can I check this with the Deviceinfo class?)
What clock source would I use if I only want to get digital data?
Kind regards
Stephan
06-14-2013 02:22 AM
Hi StephanD,
the USB 6210 has no own internal sample clock. What are you trying to achieve with your application?
Regards
06-17-2013 03:43 AM
Hi FrankLp,
I'm trying to read analog and digital data at the same time. For analog data this works as expected. But I don't know how to get digital data with my card.
Regards
S.
06-25-2013 07:43 AM
Hi StephanD,
are you trying to read simultaniously? That means that you have to use threads or processes to get a parrallel execution. Without initiating that, you only got sequentiell execution of your code.
There are good Microsoft Knowledgbase articels on how to do threading in c#:
http://msdn.microsoft.com/en-ie/library/ms173178%28v=vs.80%29.aspx
Regards