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.
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.
04-19-2016 03:19 PM
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.
Solved! Go to Solution.
04-19-2016 03:25 PM
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.
04-19-2016 03:39 PM
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.
04-19-2016 03:43 PM
04-19-2016 03:43 PM
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.
04-19-2016 03:46 PM
@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!