10-16-2010 05:17 PM - edited 10-16-2010 05:18 PM
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
10-18-2010 06:18 PM
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,