Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent: 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!
i wish to use DAQ-STC Counter/Timer to measure the period of a pulse from a digital pulse train. Following are the setings in the counter's properties page.

1)General:
measurement type: PERIOD,RISING EDGE
Counter: 1
2)Clock:
Source: PFI
Signal: 4
Edge: Count Rising Edge
Count Direction: Up
3)Gate:
Gate Source: Counter's gate

I/O connection I use is PFI4/GPCTR1_GATE

Following are 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. Will the value return in the CWNum
Edit named PeriodPerPulse in the unit second?
------------------------------------------------------
Private Sub CWCounter1_AcquiredData(Measurement As Variant, ByVal Overflow As Boolean)

PeriodPerPulse.Value = Measurement

End Sub

------------------------------------------------------
0 Kudos
Message 1 of 2
(5,921 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,921 Views)