10-14-2011 05:00 PM
When I tried to round Ctr0Gate to PFI0 a runtime error occurs indicating that the resources are already in use by another route. Anybody have any ideas? Thanks.
myTask = new Task();
NationalInstruments.DAQmx.DaqSystem.Local.ConnectTerminals("/Dev1/PFI0", "/Dev1/Ctr0Gate"); myTask.CIChannels.CreateFrequencyChannel("/Dev1/Ctr0", "Measure Dig Freq Low Frequency", Convert.ToDouble(minValueTextBox.Text), Convert.ToDouble(maxValueTextBox.Text), edges, CIFrequencyMeasurementMethod.LowFrequencyOneCounter, 0.001, 4, CIFrequencyUnits.Hertz);
myCounterReader = new CounterReader(myTask.Stream);
10-18-2011 11:13 AM
Hi bionicbuider,
The ConnectTerminals function is not going to be the best way to go about this. Instead, I recommend using the frequency input terminal
(NationalInstruments.DAQmx.CIChannel.FrequencyTerminal) to set the input terminal to PFI0. That way, it will modify your task instead of your hardware.
Regards,
Daniel H.
10-18-2011 11:50 AM
Hi Daniel,
Thanks.
Even though that class exists in the documentation is does not exist in my NIDAQmx 9.4 installation. I can only get to(NationalInstruments.DAQmx.CIChannel). Maybe I should set that to something? The examples say it is easy to redirect PFIs but do not show how. Are there any examples on how to do this with C#?
Thanks again.
Bionicbuilder
10-19-2011 05:02 PM
Hi Bionicbuilder,
Sorry about the faulty info. After you create your frequency channel, you can use "CIChannels.All.FrequencyTerminal = "Dev1/PFI0";" to set the input terminal for the counter in that task.
As for examples, this document shows you where you can find different types of examples if you have installed them. If you don't have the examples installed, this document will show you how to install them.
Regards,
Daniel H.
10-20-2011 09:57 PM
Daniel,
That works great, would have never figured it out. Thanks.
Bionicbuilder.
10-21-2011 12:30 PM
Bionicbuilder,
No problem.
Daniel H.