Thanks for that. I'm not sure that is quite what I want but it could be..
We have 8 relays attached to the 8 lines.
When I used the port0/line0:7 address I would setup a global array of 8 bytes and then to turn line 3 on..
DeviceAddr = "Dev1/port0/line0:7"
writeArray(3) = 1
..CreateTask
..CreateDOChan
..StartTask
DAQmxWriteDigitalLines(taskHandle, 1, True, 10#,
DAQmx_Val_GroupByChannel, writeArray(0),
sampsPerChanWritten, ByVal 0&)
This would mean the global array WriteArray would be '0001000'
If I then wanted to turn on chan4..
DeviceAddr = "Dev1/port0/line0:7"
writeArray(4) = 1
..CreateTask
..CreateDOChan
..StartTask
DAQmxWriteDigitalLines(taskHandle, 1, True, 10#,
DAQmx_Val_GroupByChannel, writeArray(0),
sampsPerChanWritten, ByVal 0&)
This would mean the global array WriteArray would now be '0001100'
This is what causes the problem as it tries to turn on valve 3 which is already turned on...
Are you saying that when you use your technique the digout function would be as follows..
Turn on line 3
Redim i(8)
i(3)=1
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, True, 10#,
DAQmx_Val_GroupByChannel, i(3),
sampsPerChanWritten, ByVal 0&
Turn on line 4
Redim i(8)
i(4)=1
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, True, 10#,
DAQmx_Val_GroupByChannel, i(4),
sampsPerChanWritten, ByVal 0&
Would the second write routine not turn 'OFF' line 3 ?
Regards
Peter