Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter Acquired_Data does not work?

Hello,
I am using a PCMCIA board AI-16XE-50 which I think is now called NI6012E.
With Measurement Studio, VB6 and traditional NI-DAQ drivers.

Essentially that is what I am trying to do. I have ~450ms high signal
which turns low for 50ms and repeats. I want my visual basic to receive it
and act upon detecting a falling edge. When I run the test panels, the
counter counts these events accurately (actually twice the number
detecting both falling and rising edges), so in visual basic, I tried to
set up a simple application:

1) I included a counter on my form and configured it:
Measurement Type: Event Count
Counter: 1
Initial Count: 0
Use buffering: unchecked (I tried checking it and choosing 1 or 1000)
Clock: Source: PFI
Signal: 0
Edge: Count falling edges (or let NIDAQ choose)
Count Direction: Up

No gating and other things are default.

2) I put a start  button which when  pressed, I issue:
CWCounter1.Configure
CWCounter1.Start

3) I clicked on the counter icon and created this:
Private Sub CWCounter1_AcquiredData(Measurement As Variant, Overflow As Boolean)Text1.Text = Measurement
End Sub

(from examples in your pages)

4) I put a simple textlabel to display the result in (3).

5) I put a stop button which issues:
CWCounter1.Reset
CWCounter1.Stop

So, I was expecting that atleast in the buffered mode, after each count,
it should call the acquired data sub-function and I can act upon that
count.  Unfortunately, it never calls acquired data.

Am I wrong in my reasoning? How else can I achieve this effect? (I have
also tried a while loop and reading the signal one by one, did not work).

Thanks,


Ulugeyik

0 Kudos
Message 1 of 2
(5,972 Views)
Hello Ulugeyik,
 
There is actually a shipping example that can be used with your 6012E, does event counting using Traditional DAQ, Measurement Studio and VB.  If you did not change the defaults when installing NI-DAQ, it is located at: C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\DAQ\Counter\DAQSTC Event Counting
 
Good luck with your application!
Micaela N
National Instruments
Message 2 of 2
(5,955 Views)