Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

nidaqmx and vb6

Hello all, I'm try to make some acquistion with an PCI 6534 board with Nidaqmx and VB6.
My program works fine in Nidaq traditionnal but I decided to move to Nidaqmx, to uptdate my application.
I need to use the function DAQmxReadDigitalU16 in VB6.
The problem is that this function is not recognized in VB6 !!
 
all the function used below are recognized :
DAQmxCreateTask
DAQmxStartTask
DAQmxCfgSampClkTiming
and even DAQmxReadDigitalLines ( but I don't need to use this last function in my program)
 
I noticed that DAQmxReadDigitalU8, DAQmxReadDigitalU16 ,DAQmxReadDigitalU32 and DAQmxReadDigitalScalarU32 are not recognized !!!
 
I have the reference nidaqmx.tlb used in VB6, and NidaqmxErrorCheck.bas used as a module.
 
I don't understand where is the problem.
 
some function like DAQmxReadAnalogF64, used for Analog Input in analog card only, are recognised as well by VB6 (of course not usable with my card).
 
So where is the problem ?
 
0 Kudos
Message 1 of 5
(4,459 Views)
hello hello, is there some one ?
 
All on vacations ??????????
 
Help meeeeeeeeeeee, please ............;
 
Nobody here still using Nidaqmx 8.3 with VB6 ?????????
 
 
0 Kudos
Message 2 of 5
(4,440 Views)
I don't know.

I have been using other api functions in VB the last several days.

I looked in the object viewer (pressing F2) and did not find a reference to the functions you are looking for.

David
0 Kudos
Message 3 of 5
(4,435 Views)
Thanks for your interest in helping me !
 
Can you try on your VB6 browser if the functions below are recognised :
 
DAQmxCreateTask
DAQmxStartTask
DAQmxCfgSampClkTiming
 
if yes try these ones :
DAQmxReadDigitalU8,
DAQmxReadDigitalU16 ,
DAQmxReadDigitalU32
and DAQmxReadDigitalScalarU32
 
these are not recognized on my VB6, but they are on the  Nidaqmx help Function List !!!
 
these last function are the most important to achieve an acquisition of N samples in array using  the internal clock at X rate.
 
Why don't they work ? VB6 doesn't recognised these functions !!!!
0 Kudos
Message 4 of 5
(4,432 Views)
Ok, after a lot of hours, I find the reason :
 
 

Differences Between the NI-DAQmx C API and the NI-DAQmx Visual Basic 6.0 API

The primary difference between the C API and the Visual Basic 6.0 API is the data type of function parameters. The nidaqmx.tlb type library specifies the translated parameter data types.

In addition to data types, there are several other differences between the two APIs, including the following:

  • Visual Basic 6.0 does not support any unsigned numbers, except unsigned 8-bit integers. If a function uses an unsigned data type in C, you must use the signed equivalent in Visual Basic 6.0. This requirement can reduce the range of values you can pass for some function parameters. Even though Visual Basic 6.0 supports unsigned 8-bit integers, DAQmxReadDigitalU8 and DAQmxWriteDigitalU8 are not included in the NI-DAQmx Visual Basic 6.0 type library. Use DAQmxWriteDigitalLines and DAQmxReadDigitalLines to write and read digital data to 8-bit or wider ports.
0 Kudos
Message 5 of 5
(4,429 Views)