Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ-STC counter/timer, measurement type:period,rising edge

Hi~ i need an urgent reply for this simple question, if anyone of you out there could help me, that would be appreciated. thanks!
im using PCI-6014, i wish to use DAQ-STC Counter/Timer to measure the period of a pulse from the digital pulse train. Other than set the measurement type in the properties page of the counter control to PERIOD,RISING EDGE, what should i set the CLOCK page and GATE page? what I/O connection i need to use? can I use PFI3 and DIO7 as im using counter1? Following is the code that i have to show the value of the period of one pulse.im not sure whether if it works. Please correct me if there is mistake/error.
------------------------------------------------------
Private Sub Timer1_Timer(
)
Dim Measurement As Long
Dim Overflow As Boolean

CWCounter1.ReadMeasurement Measurement, Overflow
PeriodPerPulse.Value = Measurement

End Sub
------------------------------------------------------
0 Kudos
Message 1 of 2
(5,723 Views)
Hello:

Please start by using the example "PulsePeriod.vbp" located in C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\DAQ\Counter\Pulse and Period.


On this example, you might want to change 1 property on the CWCtr control (right-click control and select properties)... Change to the "Clock" tab and leave the source as "Frequency (Hz)" but change the Signal from "100000" to "20000000." That is the ONLY change you should make. Connect the signal to be measured to the Gate of CTR1.


Run the example... This example reads pulses from rising edge of the gate to the next rising edge of the gate signal. The pulses are at 20 MHz (see change above). That means you divide # of pulses found in 1 period by 20,000,000 to get the pulse width.



This should get you going!!!


Good Luck!


Sincerely,


Brooks B
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(5,723 Views)