Hi
M Series card Programming with VS.NET
I have a system with 11 analog channels and 1 (or more later) digital input channels. I want to scan the analog channels and the digital channel continously at 1000 Hz
I have set up 2 tasks, analogTask and digitalTask, and configured the analog channels and digital channel in those tasks.
I have setup an analog reader and digital reader and 2 callbacks one for analog and the other for digital. After verifying the tasks I call the begin read functions:
analogInReader.BeginReadMultiSample(bufferScans, analogCallback, null);
digitalInReader.BeginReadMultiSamplePortUInt32(bufferScans,digitalCallback, null);
Thetiming for both tasks has been configured with SampleQuantityMode.C
ontinuousSamples
The analog part works as expected but I am having trouble with the digital part. When I run the application I get a puzzling error message:
"External sample clock source must be specified for this application".
If I comment out the line
digitalTask.Timing.ConfigureSampleClock("",scanRate,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
then the error message goes (so it presumably refers to this function call)and the application thenruns, with the analog values being read correctly at the proper interval. The digital callback still gets called and values are read but the samples are not as frequent as they should be.
I must be missing something simple here. Whilst there is an analog continous sample example, there is only a digital single sample one to consult.
Can anyone help me out on this
Ray