LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to write a simple program to control LEDs. Can successfully run on one channel but not multiple channels...

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). 

0 Kudos
Message 1 of 9
(2,949 Views)

Also, not sure if this helps or not, but the LEDs that I've been testing are both connected to the same module. Thanks!

0 Kudos
Message 2 of 9
(2,948 Views)

Also, here is a screenshot of the front panel of the v1 program with the settings that I use. 

0 Kudos
Message 3 of 9
(2,944 Views)
Have you gone through any of the online tutorials? They are very good at shooing away confusion.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(2,925 Views)

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.

0 Kudos
Message 5 of 9
(2,904 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(2,880 Views)

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!

0 Kudos
Message 7 of 9
(2,851 Views)

@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.

0 Kudos
Message 9 of 9
(2,840 Views)