From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx is not member of NIDAQmxCAPI

I am using Visual Basic 2005 Express to configure and control the USB-6008. I have included a reference to the NIDAQmxCAPI into the VB project.

When I try to load the sample code for "Acq-Int Clk" for example, I get the following error:-

"DAQmx is not member of NIDAQmxCAPI"

Here is a snippet of the code that causes the problem but the same thing appears in other places as well

'Create the DAQmx task.

DAQmxErrChk(NIDAQmxCAPI.DAQmx.DAQmxCreateTask(

"", taskHandle))

 

0 Kudos
Message 1 of 6
(4,015 Views)
Jarra,

Thanks for contacting National Instruments.  I have opened this example in VB 6 since that is all we have here.  The line of code you speak of says:

'Create the DAQmx task.
    DAQmxErrChk DAQmxCreateTask("", taskHandle)

There is no reference to NIDAQmcCAPI in our documentation.  Visual Basic Express 2005 is used for developing VB .NET which is very different from the examples that we have written for VB 6.  Try using the .NET examples that came with the DAQmx driver.  Look in this folder.  C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Analog In

Regards,
Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
Message 2 of 6
(3,999 Views)

Thanks Ken,

I think this has me on the right track now.

0 Kudos
Message 3 of 6
(3,986 Views)

Hi Keen,

 

I am facing the same problem when trying to convert code from Visual Basic 6.0 to Visual Studio 2008.  The code example I found is in: 

 

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Ext Clk

 

According to the example, I replaced the original code in Visual Basic 6.0:

 

DAQmxErrChk(NIDAQmxCAPI.DAQmx.DAQmxCreateTask("", taskHandle))

 

With

 

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));

 

However, the code still does not work, saying the DAQmxCreateTask is not declared

 

I was wondering if you wound be willing to provide me some sugestions?

 

Thanks!

 

 

0 Kudos
Message 4 of 6
(3,158 Views)

bwang,

 

Are you able to run the example code without any problem? Can you post your code here so we can see what else might be going wrong?

 

J. Calvert

Applications Engineer

National Instruments

0 Kudos
Message 5 of 6
(3,143 Views)

Hi Kathryn,

 

Thank you for your help. 

I am now converting VB6 to VS2012 instead.  The examples in 

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5

are useful!

 

Besides,

1. I changed target framework from ‘.NET Framework 2.0’ to ‘.NET Framework 4.5’

2. I added "National Instruments Common" and "National Instruments DAQmx" as the references.

 

It works now.

0 Kudos
Message 6 of 6
(3,098 Views)