Discussion:
nidaqmx and vb6
(too old to reply)
Seyar
2007-08-31 09:40:10 UTC
Permalink
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 ?
 
Seyar
2007-09-03 12:10:10 UTC
Permalink
hello hello, is there some one ?
 
All on vacations ??????????
 
Help meeeeeeeeeeee, please ............;
 
Nobody here still using Nidaqmx 8.3 with VB6 ?????????
 
 
Seyar
2007-09-03 14:40:07 UTC
Permalink
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 !!!!
Seyar
2007-09-03 15:40:10 UTC
Permalink
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, <a>DAQmxReadDigitalU8</a> and <a>DAQmxWriteDigitalU8</a> are not included in the NI-DAQmx Visual Basic 6.0 type library. Use <a>DAQmxWriteDigitalLines</a> and <a>DAQmxReadDigitalLines</a> to write and read digital data to 8-bit or wider ports.
Loading...