LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6210 in digital output mode in Labwindows CVI

Solved!
Go to solution

Hello,
I used in the past a PCI6503 card to output two binary signals. My new PC have no PCI bus and for the replacement we buyed a USB-6210 case. I have to modify my program to address two output lines from the USB-6210 (P1.0 and P1.1) box but I don't see how to name these two lines, can you help me please?

Before I had the following code:

 

uInt8 data[8]={0};

data[1]=1;
data[2]=0;

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0/line0:7","",DAQmx_Val_ChanForAllLines));

// DAQmx Start Code
DAQmxErrChk (DAQmxStartTask(taskHandle));

// DAQmx Write Code
DAQmxErrChk (DAQmxWriteDigitalLines(taskHandle,1,1,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));

 

 

Can you help me modify this code to work with the USB-6210?

Thank you

0 Kudos
Message 1 of 5
(1,193 Views)
Solution
Accepted by topic author Taloche_27

Hi,

 

Since you have given the channel string as "Dev1/port0/line0:7" you need to name your new device as "Dev1".

 

And be aware that your code updates all 8 bits of digital IO, not just 2, since you specifed all lines by writing "line0:7".

And the lines that will be updated will be line-1 and line-2.

Because you wrote to the 1st and 2nd indices of your array.

 

Hope this helps,

S. Eren BALCI
IMESTEK
Message 2 of 5
(1,187 Views)
 
Thank you very much for your quick response, I'm looking at this...
0 Kudos
Message 3 of 5
(1,179 Views)

Also as reminder:

 

You start your task before you write to the lines.

So they will output the default states first and then switch to the values you have given.

 

Either Make sure that does not harm your system or start after you write the data lines.

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 5
(1,172 Views)

Yes, I will change that, ty.

 

To address the correct first line I had to put "Dev1/Line4" and I changed the setting "DAQmx_Val_ChanForAllLines" by "DAQmx_Val_ChanPerLine"

 

Everything works, thank you very much

0 Kudos
Message 5 of 5
(1,161 Views)