Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple task using the same timing source on USB-6210

Hi,

 

This may seem like an absurdly simple question so please forgive me. 

 

I would like to record a counter value and the state of a digital input pin at the same time.

 

I have two tasks ( because apparently one cannot have two different channels in the same task)

counter_read_task.CIChannels.CreateLinearEncoderChannel("/" + device_name + "/ctr0", "ctr", CIEncoderDecodingType.X4, false, 0.0F, CIEncoderZIndexPhase.AHighBHigh, 1.0F, 0.0F, CILinearEncoderUnits.Ticks);
dig_in_read_task.DIChannels.CreateChannel("/" + device_name + "/PFI2", "DI-1", ChannelLineGrouping.OneChannelForEachLine);

 

I then allocate timing resources to those tasks :

 

  counter_read_task.Timing.ConfigureSampleClock("/" + device_name + "/PFI3", 10000f, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, 1000);
            dig_in_read_task.Timing.ConfigureSampleClock ("/" + device_name + "/PFI3", 10000f, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, 1000);
          

But I get an exception that essentially says this :

 

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
 
Property: NationalInstruments.DAQmx.Timing.SampleTimingType
Requested Value: NationalInstruments.DAQmx.SampleTimingType.SampleClock
You Can Select: NationalInstruments.DAQmx.SampleTimingType.OnDemand
 
Task Name: DigIn Task
 
 
I really don't understand what the error message is trying to convey, nor why it is occuring ? Why can I not assign the same clock source to multiple tasks ? Surely there must be some fan-out on the clock lines ?
 
Any help would be greatly appreciated.
Thanks
Tom

 

0 Kudos
Message 1 of 2
(5,368 Views)

Hi Tom,

 

 

Spoiler
I have two tasks ( because apparently one cannot have two different channels in the same task)

 

Yes you can have more than one channel in the same task but they need to be different task types. 

 

Spoiler
counter_read_task.Timing.ConfigureSampleClock

 

This is where I think you are running into an error. The USB-6210 does not support hardware timing. Therefore this module only support software timing. That being said, you need to select the sample timing type on demand in order for it to be software timing. 

 

Warm Regards,

 

William Fernandez

Applications Engineering

National Instruments

0 Kudos
Message 2 of 2
(5,347 Views)