Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP !! Cannot get WriteDigitalLines working !!

Hi,
 
The only supported way of writing values to the digital lines/ports is to use the WriteDigitalLines function.
 
The API for Visual Basic was taken from the C API and reduced to remove the functions that Visual Basic cannot support - so it was decided to leave just this one function in to make it simpler.
 
So yes, you will need to write an array of bytes to set the port. There is an example that ships with NI-DAQmx which uses this function. It will be located at C:\Program Files\National Instruments\NI-DAQ\Examples\VB 6.0\Digital\Generate Values\Write Dig Chan - if you use the standard installation location. Take a look at this for more info.
 
Regards
Hannah
NIUK & Ireland
 
0 Kudos
Message 11 of 12
(3,934 Views)
The nicaiu.dll contains the functions. To use DAQmxWriteDigitalU8 in VB6, simply declare as follows. I imagine all other functions can be translated similarly.
 
Joe
 
Declare Function DAQmxWriteDigitalU8 Lib "nicaiu.dll" (ByVal taskHandle As Long, ByVal tnumSampsPerChan As Long, ByVal tautoStart As Boolean, ByVal timeout As Double, ByVal dataLayout As Long, writeArray As Byte, sampsPerChanWritten As Long, Reserved As Any) As Long
0 Kudos
Message 12 of 12
(3,920 Views)