Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write a channel with usb 6008,Visual Studio 2010, NI-DAQmx?

I have a NI-USB-6008. I am using Visual Studio 2010, Visual C#, .Net 4.0.

 

I have tried several things, also i took a look into the examples, but the example WriteDigChan.2010, in ...\Documents\National Instruments\NI-DAQ\Examples\DotNET4.0\Digital\Generate Values\WriteDigChan\CS

 

It works just when i don't select a chanel to write, by default its written Dev1/Port0/line0:7 when I click write it sends the information, but when I select for example Dev1/port0/line1 it shows me a window with the next information:

 

Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel... etc etc

 

What can I do? Really I have no idea.

0 Kudos
Message 1 of 4
(4,126 Views)

Good morning. I´m José Manuel Vólquez, an Application Engineer from National Instruments México. The problem here is in the moment when the acquisition task is created. I´m your code you must have a function similar to:

DAQmxCreateDOChan (taskHandle, chan, "", DAQmx_Val_ChanForAllLines);

The last parameter is the problem; you must select the option “One Channel For Each Line” instead of “One Channel For All Line”.

Try to implement this change please.

Regards.

 

0 Kudos
Message 2 of 4
(4,110 Views)

Hi, could you check the solution that I recommended?

Regards.

 

0 Kudos
Message 3 of 4
(4,030 Views)

Thank you so much it worked really fine =D

0 Kudos
Message 4 of 4
(4,009 Views)