12-19-2023 05:23 PM
I'm using an edge counter (PXI1Slot2/ctr0) to count edges from a photo multiplier. Now I'd like to gate the counter so it only counts when an external signal is high for instance. I've read on this forum that the 'pause trigger' is needed (I've had no luck with the gate terminal). But when I try to configure the pause trigger I just get "NationalInstruments.DAQmx.DaqException: 'Source terminal to be routed could not be found on the device."
CIChannel chan = myTask.CIChannels.CreateCountEdgesChannel("PXI1Slot2/ctr0", "Counter 0", CICountEdgesActiveEdge.Rising, 0, CICountEdgesCountDirection.Up);
myTask.Triggers.PauseTrigger.ConfigureDigitalLevelTrigger("PXI1Slot2/PFI0", DigitalLevelPauseTriggerCondition.High);
12-19-2023 05:49 PM
What is the model of your DAQ device?
12-21-2023 01:08 PM
I'm using counter 0 on a PXIe-6363. At present I'm stuck trying to configure the PauseTrigger in C# using DAQmx.
12-22-2023 09:03 AM
When I lookup the pinout for your 6363 device, I see that P1.0 is also known as PFI0.
And that's probably where the problem is. In DAQmx syntax, "P1.0" refers to a digital physical channel (or possibly a specific line in a port-wide channel). Whereas "PFI0" refers to a terminal with many options for configuration and routing as a timing signal.
Even though the exact same pin is referenced, DAQmx requires that you use PFIx syntax when configuring a terminal for use as a clock, trigger, or other routable timing signal. Try it out and let us know.
myTask.Triggers.PauseTrigger.
-Kevin P
12-22-2023 03:03 PM
Thanks for the suggestion but that doesn't run either.
For such a simple problem, running a gated edge counter, there seems to be no source code samples and NI support seems baffled as well.
As a novice looking at the 6363 counter, the hardware seems designed to do what I want: there's a counter output and a gate input but I have yet to see a code example of anyone using the gate for, well, gating. Then there's a start trigger but most people on the forum seem to talk about the pause trigger so I'm lost.
CIChannel chan = myTask.CIChannels.CreateCountEdgesChannel("PXI1Slot2/ctr0", "Counter 0", CICountEdgesActiveEdge.Rising, 0, CICountEdgesCountDirection.Up);
//myTask.Timing.ConfigureImplicit(SampleQuantityMode.FiniteSamples, 1000);
myTask.Timing.ConfigureSampleClock("100kHzTimebase", 100000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples,100000);
myTask.Triggers.PauseTrigger.ConfigureDigitalLevelTrigger("PXI1Slot2/PFI0", DigitalLevelPauseTriggerCondition.High);
myCounterReader = new CounterSingleChannelReader(myTask.Stream);
myTask.Control(TaskAction.Verify);
Exception thrown: 'NationalInstruments.DAQmx.DaqException' in NationalInstruments.DAQmx.dll
An unhandled exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll
Source terminal to be routed could not be found on the device.
Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer for valid terminal names.
Property: NationalInstruments.DAQmx.DigitalLevelPauseTrigger.Source
Property: NationalInstruments.DAQmx.DigitalLevelPauseTrigger.Condition
Source Device: PXI1Slot2
Source Terminal: PXI1Slot2/PFI0
Channel Name: Counter 0
12-27-2023 10:18 AM
So far, no proposed solutions have worked. I’m posting now because I’ve gotten email from the ‘community’ prompting me to accept a solution. There is none.
I’ve also filed a service request.
01-15-2024 04:52 PM
The solution was very simple. Change "PXI1Slot2/PFI0" to "/PXI1Slot2/PFI0". Nobody included NI tech support suggested that.
01-16-2024 01:55 PM
That's a little quirk of syntax I've noticed in the past but somehow missed this time. And not a particularly easy thing to discover until you're looking for it. Sorry about that, wish I could have saved you some time and frustration...
-Kevin P