Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter Input Terminal Selection NI-DAQmx VB.Net

Solved!
Go to solution

Hello,

I'm an old hand at VB6/NIDAQ but now I'm trying to get the hang of the new ways.  I have generated a simple Task with the DAQ Assitant to count pulses.  I want to count pulses on PFI 0 instead of the default PFI 8 line for counter 0.  (PCIe 6143).  The Assitant generated code is:

 

            myTask.CIChannels.CreateCountEdgesChannel("/Dev1/ctr0", "Count Edges", _

                edgeType,Convert.ToInt64(initialCountTextBox.Text), countDirection)

           

How do I indicate that I want the input to be on PFI 0?  I have tried many different syntaxes, but I can't find the way to make the specification.

 

myTask.CIChannels(0).CountEdgesTerminal = "PFI0"

 

It is frustrating to not be able to get past step 1.

0 Kudos
Message 1 of 2
(3,871 Views)
Solution
Accepted by topic author bboyce

I found the answer myself (after 6 hours of searching).  Do something like this...

 

            myTask.CIChannels.CreateSemiPeriodChannel("Dev1/ctr0", _

               

        "SemiPeriodMeasurement", Convert.ToDouble(minValueTextBox.Text), _

               

         Convert.ToDouble(maxValueTextBox.Text), CISemiPeriodUnits.Seconds)

           

HERE IS THE GOLD!

Dim d AsCIChannel = myTask.CIChannels("SemiPeriodMeasurement")

            d.SemiPeriodTerminal ="/Dev1/PFI0"

 

 

Thanks to the forums, or I would still be searching.

Brad

0 Kudos
Message 2 of 2
(3,856 Views)