Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

DaqmxRead VB6

Hi,

Im new to Daqmx, Is it possible to read digital lines through vb6.

Im using usb 6509, from test panel i can see the bits on/off. I can control the bits externally. Is there a way i can read them through vb 6 code cos i need to perform more functions afterwards.

 

I used the following code. I would like the result in bits.

 

'create task for Reading digital signals from Dev1 

    jStatus = DAQmxCreateTask("", taskHandle)
    jStatus = DAQmxCreateDIChan(taskHandle, "Dev1/port0/line0:7", "", DAQmx_Val_ChanForAllLines)
    'Start the task
    jStatus = DAQmxStartTask(taskHandle)
  
'read Port
    jStatus = DAQmxReadDigitalLines(taskHandle, 1, 10#, DAQmx_Val_GroupByChannel, readArray(0), arraySizeInBytes, sampsPerChanRead, numBytesPerSamp, ByVal 0&)
   
'close the channel
    jStatus = DAQmxStopTask(taskHandle)
    jStatus = DAQmxClearTask(taskHandle)

 

 

Hope im not confusing. Thanks for any help

0 Kudos
Message 1 of 2
(6,456 Views)

Hi rakoon,

 

When you install the DAQmx driver, there are Visual Basic examples that install.  Please navigate to Start»Programs»National Instruments»NI-DAQ»Text-based Code Support.  You an find many resources for Text-based code development.  There are analog, digital, and counter examples already created for this language.

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 2 of 2
(6,434 Views)