From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Digital I/O Tasks - Error -200170

Solved!
Go to solution

I'm working on a project to use DAQmx to write and read digital channels as well as monitor thermocouples.  There's already source code that initializes the thermocouples AI channels tasks.  I tried to mimic (to some degree) what the AI task initlization was doing, except I read that there's a flatten DAQmx VI that allows me to send an array and of the channels I want then create the virtual channels and tasks.  I've posted a picture of my code.  The error I am getting is -200170 for the DI and the DO.  Can someone please explain what I am doing wrong and what it is I don't seem to understand about tasks?  Please and thank you.

 

DAQmx Task Question.PNG

0 Kudos
Message 1 of 6
(4,490 Views)

Some clarification as to what you exactly want to do, as well as the source code would be of great help. Have you first tried to just go barebones and work from there? By barebones I mean, use the DAQ assistant to create a single task to monitor a single channel and see if it works, then convert to code and work your way up.

0 Kudos
Message 2 of 6
(4,487 Views)
Solution
Accepted by topic author DailyDose

My guess is that the "port" values are off.  I don't know what DAQ you have, but in my experience you generaly have /port0/line0, /port0/line1... /port0/line6, /port0/line7, then you start the next port with /port1/line0, /port1/line1, etc.

 

Basically grouping them 8 lines per one port.  

 

Right now you're trying /port0/line0, /port1/line1... /port31/line31.

 

 

Message 3 of 6
(4,475 Views)

Error -200170 says that specified channel does not exist on your device. Looking at your code I can see a flaw in your for loops. As an exemple the bottom one generate the following channel list:

Mod3/port0/line0

...

Mod3/port31/line31

 

I doubt there is a device with 32 ports of 32 lines.

 

Ben64

Message 4 of 6
(4,471 Views)

The source code does what I did differently.  Instead of flattening an array of channel names, it does each one by one.  And I've definitely verified that the cDAQ is there.  I used the DAQmx Physical Channels to search for all my DI/O channels.  And the strings I'm entering into the flatten appear to be exactly the same as the Physical Channels.  So... I must be doing something wrong with my create Virtual Channels vi or the flatten.  And yes, I've used the DAQ Assistant.

0 Kudos
Message 5 of 6
(4,469 Views)

@ben64 wrote:

Error -200170 says that specified channel does not exist on your device. Looking at your code I can see a flaw in your for loops. As an exemple the bottom one generate the following channel list:

Mod3/port0/line0

...

Mod3/port31/line31

 

I doubt there is a device with 32 ports of 32 lines.

 

Ben64


Yep!  That was the problem.  Thank you!

0 Kudos
Message 6 of 6
(4,463 Views)