Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Visual Basic 6

I am writing DAQ software for a NI DAQ card (E-series) using Visual Basic 6. I got stuck with statements (for example DAQmxCreateTask) not being recognised by Visual Basic 6. I used "nicaiu.dll" public declarations to get Visual Basic to recognise the statements as recommended by Bilal Durrani (NI Engineer) on the discussion forum on 12-07-04. (For example: Public Declare Function DAQmxCreateTask Lib "nicaiu.dll" (ByVal taskName As String, ByRef taskHandle As Long) As Long)

 

My problem is that some of the DAQmx functions from example software I have, calls for DAQmx parameters that are still not recognised by Visual Basic 6. For example: The statement DAQmxCreateAIVoltageChan(taskhandle, channel, "", DAQmx_Val_Cfg_Default, minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString) does not recognise the parameters DAQmx_Val_Cfg_Default and DAQmx_Val_VoltageUnits2_Volts. The NI reference documentation only shows that the parameters have a 32 bit integer value but gives no indication what those values should be.

 

I will prefer not to use ActiveX controls if possible.

 

Any suggestions or sample code will be highly valued.

 

Gerhard Heymann

0 Kudos
Message 1 of 4
(3,044 Views)
Gerhard,

What version of NI-DAQmx do you have? With 7.5 and later, we supply a type library for use with VB6. We also supply examples in the

C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0

directory. This support was added well after Bilal's post, so I would recommend going this route. Please post back if you still have trouble.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 4
(3,029 Views)

Dear Ryan

I was using NI-DAQmx 7.1. On the basis of your recommendation I have now downloaded NI-DAQmx 8.1 from ni.com and my code is running beautifully!

Many thanks for your advice. It is much appreciated.

Best regards

Gerhard

0 Kudos
Message 3 of 4
(3,005 Views)
Gerhard,

Glad to help! No sense in reinventing the wheel.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 4
(3,002 Views)