Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the pulse frequency of a continious pulse generation while the task is running ?

I create the task:

 

IOTask.COChannels.CreatePulseChannelFrequency(c, "x", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, f, d);

IOTask.Timing.SampleTimingType = SampleTimingType.Implicit;

// IOTask.Timing.ConfigureSampleClock("internal", 10000000, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, 1000);

IOTask.Control(TaskAction.Start);

 

and it is doning fine.

 

Then I try to change the frequency:

 

f = f + amount;

IOTask.Control(
TaskAction.Stop);

IOTask.COChannels["x"].PulseFrequency = f;

IOTask.Control(TaskAction.Start);

 

This does not throw an exception but creates only one pulse after the start and does not go to continious mode.

Any ideas why ???

 

Thanks,  Bernhard

 

 

0 Kudos
Message 1 of 4
(3,758 Views)

Hi Bernhard,

 

we need more information about your problem.

Which device are you using, which driver,...

 

Best regards

Dippi 

0 Kudos
Message 2 of 4
(3,746 Views)

We are using a USB6212 with NIDaqMx 8.6

 

 

 

 

0 Kudos
Message 3 of 4
(3,743 Views)

Hi Bernhard,

 

unfortunately it is not possible to change the frequency while the task is running.

You have to stop the task, change the frequency and start it again.

 

This is implemented in DAQmx driver like this.

 

Best regards

Dippi 

0 Kudos
Message 4 of 4
(3,735 Views)