Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure frequency on PFI0 (DAQPad-6015)

Dear All,
 
I am trying to measure the frequency (or the period) of a digital input signal which is connected to the PFI0 input on a DAQPad-6015. I tried to modify one of the supplied examples (C:\Program Files\...\MeasDigFrequency_LowFreq1Ctr.sln) in order to use the PFI0 input.
 
I added the following code to the measureFrequencyButton_Click procedure:
 
DaqSystem.Local.ConnectTerminals("/Dev1/PFI0","/Dev1/ctr0Source")
 
after the Try statement. When running the program I get the error message:
 
Specified route cannot be satisfied, because it requires resources that are currently in use by anther route.
Property: NationalInstruments.DAQmx.CIChannel.CounterTimerbaseSource
Property: NationalInstruments.DAQmx.CIChannel.CounterTimerbaseActiveEdge
Source Device: Dev1
Source Terminal: MasterTimebase
Task Name: CITask
Status Code: -89137
 
My questions:
 
1. Is this the right approach or should I use another procedure?
2. Is that the right place (procedure measureFrequencyButton_Click, before creating myTask) to make a connection of DAQ terminals?
 
 
Any help is appreciated.
 
Detlef S.
 
 
 
0 Kudos
Message 1 of 5
(3,690 Views)

Sorry, I forgot:

I am using Visual Basic .NET 2003 and NI Measurement Studio 7.1 as development system.

Detlef S.

0 Kudos
Message 2 of 5
(3,686 Views)

Hi Detlef

Im not sure but have a look at this page, maybe it will help you:

http://digital.ni.com/public.nsf/websearch/CF592CB42924F9B986256F320053C5C7?OpenDocument

Manuel

 

0 Kudos
Message 3 of 5
(3,662 Views)

Hi Manuel,

thank you. Yes, I have seen that link and that is the reason why I wrote the code

DaqSystem.Local.ConnectTerminals("/Dev1/PFI0","/Dev1/ctr0Source")
 
instead of
 
DaqSystem.Local.ConnectTerminals("/Dev1/PFI0","/Dev1/ctr0").
 
Maybe I should use the "internal name" for PFI0 also, but I did not find any information about that one (neither online at the NI internet pages, nor in any help file installed on my PC together with NIMS).
 
Regards,
Detlef
0 Kudos
Message 4 of 5
(3,658 Views)
For those who are interested in the solution of my application (see above):
 
 
I added the following line after the myTask.CIChannels.CreateFrequencyChannel statement:
 
mytask.CIChannels.Item(0).FrequencyTerminal = "/Dev1/PFI0"
 
and now I am able to run the demo program measuring the frequency of the PFI0 input signal.
 
The DaqSystem.Local.ConnectTerminals statement is not necessary.
 
Best regards,
Detlef
0 Kudos
Message 5 of 5
(3,631 Views)