Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

ConnectTerminals problem

$
0
0

Hello,

 

I have a NI DAQmx USB 6343mx

 

I use 3 counters with a CreatePulseChannelFrequency to create 3 PWM signals using ctr0, ctr1 and ctr2.  I create them in 1 Task, did it also in 3 different Task with the same result.

Counter 1 runs on 1000 HZ, counter 2 on 500 Hz and counter 3 on 250 HZ.

Works perfectly. With a logic analyzer i see the outputs on PFI12 (pin 89), PFI13 (pin 91) and on PFI14 (pin 93).

 

Then i want to connect the 3 PFI terminals to some other PFI terminals.

 

What i see is that the ConnectTerminals method works for PFI12 (ctr0) and for PFI14 (ctr2) but never for PFI13 (ctr1), i really dont know anymore what to do. I dont get errors just the PWM signal on PFI13 doesnt appear on the connected terminals PFI2 and PFI3

Any help would be kind.

 

My code below.

 

 

task = new Task("");
task.COChannels.CreatePulseChannelFrequency($"/Dev1/ctr0", "", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, 1000, 50 / 100.0);
dtask.COChannels.CreatePulseChannelFrequency($"/Dev1/ctr1", "", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, 500, 50 / 100.0);
task.COChannels.CreatePulseChannelFrequency($"/Dev1/ctr2", "", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, 250, 50 / 100.0);
task.Timing.ReferenceClockSource = "OnboardClock";
task.Timing.ConfigureSampleClock("OnboardClock", 1000, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
task.Timing.ConfigureImplicit(NationalInstruments.DAQmx.SampleQuantityMode.ContinuousSamples, 1000);
digpwm1.Start();

 

DaqSystem.Local.ConnectTerminals($"/Dev1/pfi12", $"/Dev1/pfi0");
DaqSystem.Local.ConnectTerminals($"/Dev1/pfi12", $"/Dev1/pfi1");

DaqSystem.Local.ConnectTerminals($"/Dev1/pfi13", $"/Dev1/pfi2");
DaqSystem.Local.ConnectTerminals($"/Dev1/pfi13", $"/Dev1/pfi3");

DaqSystem.Local.ConnectTerminals($"/Dev1/pfi14", $"/Dev1/pfi4");
DaqSystem.Local.ConnectTerminals($"/Dev1/pfi14", $"/Dev1/pfi5");

 

VeH_0-1616066403804.png

 

 

Regards,

 Herbert Veldhuis


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>