Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Basic - Digital Pulse

I am trying to generate a simple digital pulse using Visual Basic.
I modified the Visual Basic example that outputs a pulse train using Frequency to Time.  From everything I have read this should work.
I get an error that says
Variable Not Defined and the variable is DAQmx_Val_Seconds
 
 
 
Visual Basic 6 line
DAQmxErrChk DAQmxCreateCOPulseChanTime(taskHandle, "Dev1/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 1, 0.5, 1)
   
 
C example
DAQmxErrChk (DAQmxCreateCOPulseChanTime(taskHandle,"Dev1/ctr0","",DAQmx_Val_Seconds,DAQmx_Val_Low,1.00,0.50,1.00));
 
What am I missing or not doing?
 
Steve
 
0 Kudos
Message 1 of 2
(3,527 Views)

Steve,

When programming in VB, some of the constants are not the same as whats listed in the C API.  The constant you are looking for is called DAQmx_Val_TimeUnits_Seconds instead of DAQmx_Val_Seconds.

You can find a list of all the DAQmx constants using the object browser in VB 6.  Once you have the NI DAQmx C API reference added to your project, select View >> Object Browser.  In the window that appears you will see a combo box that says All Libraries.  Change this value to NI DAQmxCAPI.  In the bottom right section of this window you will see all the DAQmx constants available to you in VB 6.

Regards,

Jesse O.
Applications Engineering
National Instruments


Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 2
(3,516 Views)