08-13-2009 03:24 AM
Hello folks,
I am using a USB-6009 and want to write to multiple digital lines created in the comma separated style:
error = DAQmxCreateDOChan(taskSelHead,"dev3/port0/line0,dev3/port0/line6","",DAQmx_Val_ChanPerLine);
When I try to write to this channel I do
uInt8 data[8] = { d1, 0, 0, 0, 0, 0, d2, 0 }; // with d1 and d2 representing 0 or 1, that bits I want to get written
int error = DAQmxWriteDigitalLines(taskSelectFilter, 1, 1, 10, DAQmx_Val_GroupByChannel, data, NULL, NULL);
The result is, that only line0 gets updated, lin6 stays 0.
I also tried DAQmxWriteDigitalU8 with the same effect.
Can anybody help ?
Thanks in advance,
Michael
Solved! Go to Solution.
08-14-2009 04:19 AM
Hi Michael,
you defined two dig.out channels in your Task: line 0 and line 6. So when writing an array of channel values, d1 gets mapped to your line 0 all right - but line 6 always receives a zero!
Have you tried defining uInt8 data[2] = {d1, d2} ?
Best regards,
Sebastian
08-15-2009 03:52 AM
Hi Sebastian
In fact I have tried it before, but somehow screwed it up or didnt recognize it as working.
I retried your solution and now it works.
Thanks a lot!
Michael