02-25-2015 01:50 PM
I'm new to LabVIEW and have been struggling with a single error message for a while now. I'm trying to write a program to control various LEDs using the cDAQ-9178 with the NI 9402 modules. I can successfully run my program using the DAQ Assistant (digital output) when only one channel is selected, but not multiple channels. When I try to run it on multiple channels simultaneously I get this error message:
Write cannot be performed, because the number of channels in the
data does not match the number of channels in the task.
When writing, supply data for all channels in the task.
Alternatively, modify the task to contain the same number of
channels as the data written.
Number of Channels in Task: 2
Number of Channels in Data: 1
I've tried playing around with the "data" icons on the front panel, and this subsequently changes the number of channels in data (it has increased to 8 or 9 at several points)...but I think the problem is that I don't understand what I'm doing and what effect this is having on the program (what are the numeric vs. 8 buttons for the data icon? What do these actually mean/do?). I've attached the functioning program for a single channel (v1) as well as the non-functioning program for multiple channels (v2).
02-25-2015 01:51 PM
Also, not sure if this helps or not, but the LEDs that I've been testing are both connected to the same module. Thanks!
02-25-2015 01:57 PM
Also, here is a screenshot of the front panel of the v1 program with the settings that I use.
02-25-2015 05:01 PM
02-25-2015 08:40 PM
And how many elements are in each boolean array when you run the 2nd VI. From the error message, it sounds like you only have one boolean value set in the array.
02-26-2015 06:59 AM
The error message is quite clear what is happening. You have two channels in your task, but you only supplied data for 1 channel. Make sure your input array has 2 elements in it.
02-26-2015 03:31 PM
I understood the error message...I just didn't know how to make the changes necessary to fix it. I think I figured it out, though. Thanks!
02-26-2015 03:33 PM
Did someone say tutorials? Here are the obligitory links you'll see for online training and help.
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-26-2015 03:59 PM
@neuroscienceiscool wrote:
I understood the error message...I just didn't know how to make the changes necessary to fix it. I think I figured it out, though. Thanks!
Uhhhhhh, make sure the 2nd element in your arrays have some value defined on them and don't appear shaded.