Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

DI's clear DO's on same port using DAQmx DigWrite example

I'm adding support to a 6509 DIO board for an existing VB app.  I'm following the DAQmx DigWrite example.  I've created a button which writes DOs using the following code from the example:
 
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask("", taskHandle)

' Add a digital output channel to the task.
DAQmxErrChk DAQmxCreateDOChan(taskHandle, txtChannelString.Text, "", DAQmx_Val_ChanForAllLines)

' Start the task running, and write to the digital lines.
DAQmxErrChk DAQmxStartTask(taskHandle)
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, 1, 10#, DAQmx_Val_GroupByChannel, writeArray(0), sampsPerChanWritten, 0)

MsgBox "Samples per channel written = " & sampsPerChanWritten

' All done!
DAQmxErrChk DAQmxStopTask(taskHandle)
DAQmxErrChk DAQmxClearTask(taskHandle)
 
 
This works fine.  I've modified this code to read a DI, under a second button.  Works great.
 
However, if I set a DO (e.g.  Dev1/Port2/Line7) and then read a DI from the same port (e.g. Dev1/Port2/Line6), the DO is cleared as soon as the task is started to read the DI.
 
Is there some reason I can't mix DIs and DOs on a single port?  Thanks for your help.
 
(I posted this earlier on the Measurement Studio for .VSNET languages.  It belongs more properly here.  While I'm using VB.Net, we do not have Measurement Studio.)
0 Kudos
Message 1 of 2
(6,458 Views)
This was answered on the other posting of this thread.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 2
(6,448 Views)