Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 - Digital Output not supported??

Solved!
Go to solution

Hi All,

I can't use DO port of the USB6211 device.. I'm using daqmx API functions with Delphi7.

First, I tried this:

DAQmxCreateTask('', @TaskDO);
DAQmxCreateDOChan(TaskDO, PChar('Dev1/port0'), '', DAQmx_Val_ChanForAllLines);
DAQmxWriteDigitalU8(TaskDO, 1, 1, 1, DAQmx_Val_GroupByChannel, $FF, @written, nil);

I got an error at DAQmxWriteDigitalU8: -200012 (= Digital Output Not Supported). (???)

Ok, I tried to turn off AutoStart option in DAQmxWriteDigitalU8 function and insert a "manual" start into the code:

DAQmxCreateTask('', @TaskDO);
DAQmxCreateDOChan(TaskDO, PChar('Dev1/port0'), '', DAQmx_Val_ChanForAllLines);
DAQmxStartTask(TaskDO);
DAQmxWriteDigitalU8(TaskDO, 1, 0, 1, DAQmx_Val_GroupByChannel, $FF, @written, nil);
DAQmxStopTask(TaskDO);

Now I got the same error at DAQmxStartTask: -200012 (Digital Output Not Supported, again). (?????)

I don't understand.. "Digital Output Not Supported"?! USB-6211 has 4 DO lines! What's the problem?

I simply want to switch on and off the DO lines from code..



- George Cs -

0 Kudos
Message 1 of 2
(3,343 Views)
Solution
Accepted by topic author George_Cs

Well, finally I figured out.. 🙂

Here is the solution:

DAQmxCreateTask('', @TaskDO);
DAQmxCreateDOChan(TaskDO, PChar('Dev1/port1'), '', DAQmx_Val_ChanForAllLines);
DAQmxWriteDigitalU8(TaskDO, 1, @dummy, 1, DAQmx_Val_GroupByChannel, @bitmask, @written, nil);

The digital output lines are on port1! Parameter corrected.
And the interface part of DAQmxWriteDigitalU8 had to be changed (in nidaqmx.pas).
I don't know why, but AutoStart parameter (dummy) in DAQmxWriteDigitalU8 function is ignored: the function always starts task automatically, independently from the value of AutoStart. But this is not problem for me.



- George Cs -

0 Kudos
Message 2 of 2
(3,337 Views)