Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I count the pulses on the 100kHz internal timebase using a PCI-6601 with VB6 and the DAQmx API?

Please bear with me; I'm new to DAQmx.  I was able to read in pulses using a 6601 timer with the DAQ legacy software, but I haven't had much luck doing this with DAQmx.  To read a signal, it looks like I have to associate it with a task, but I haven't been able to figure out how to do that with internal signals such as the 100kHz internal timebase.
 
I'd be looking to duplicate the following VB6 code written using the legacy activeX controls.
 
I used this code to set up to timer to use the 100kHz timebase and measure counter events:
    frmMainMenu.CWCounter1.TimebaseSource = cwctrFrequencyTB
    frmMainMenu.CWCounter1.TimebaseSignal = 100000
    frmMainMenu.CWCounter1.MeasurementType = cwctrEvents
    frmMainMenu.CWCounter1.Configure
 
I then used this code to read a count of events:
    frmMainMenu.CWCounter1.ReadMeasurement Measurement, Overflow
    TimeInSec = Measurement / 100000
 
Thanks in advance for any help,
Steve
0 Kudos
Message 1 of 2
(6,551 Views)
 Hi Sgiese,

 Here's a great devzone link that provides a complete counter functionality example in VB6. Please take a look at this link, this will answer most of your questions I think!

Moving forward. If possible port your code to C, VB6 support will be disappearing as Microsoft drops it completely in the future. There are alot more examples for C programming language than VB6. If you must use VB6 due to a large existing codebase or other reason then here is a reference you will definetly want to look at.

 Best regards,

MatthewW
Applications Engineer
National Instruments


0 Kudos
Message 2 of 2
(6,541 Views)