05-29-2015 12:32 AM
Hi there
I'm relativley new to Labview and have been trying to learn how to use it for a university project. I have ideas in my mind but am not quite sure how to execute some of them in Labview. Recently i've been playing around with boolean array in hope that I'll be able to control an array of LEDs on an arduino board.
Basically I'm trying to work out how I can set up an array of numbers where each element will correspond to a boolean operation eg turning an LED on or off. Trying to learn some basics, I have created a simple VI that has an array of one number (between 0-255) which is then convert to booealn and controls an array of 8 LEDs (on the front panel). I'm trying to up the ante and have an array of two numbers or more controlling two or more rows of 8 LEDs. It seems simpled enough to me but I cant get it to work. I get the error "you have connected to arrays of different dimensions". If I change the dimensions I that error goes away, but then I get a new error saying "you have connected two terminals of different types" and that "The type of the source is 1D (sub)array of unsigned long [32-bit integer (0 to 4,294,967,295)]" and "The type of the sink is unsigned long [32-bit integer (0 to 4,294,967,295)]".
I'm really having trouble figuring this one out, can anyone please provide with me some assistance. I have provided the VI for you to inspect.
Cheers
Dimitri
05-29-2015 12:35 AM
If you use index array on a 2D array and leave one of the indices disconnected, you get an entire row or colum. To get a single element, wire both indices.
05-29-2015 01:49 AM
Hi altenbach
Thanks for your reply. I have tried wiring the column index but I still recieve "The type of the source is 1D (sub)array of unsigned long [32-bit integer (0 to 4,294,967,295)].The type of the sink is unsigned long [32-bit integer (0 to 4,294,967,295)]."
Am I going about what I'm trying to do the right way??
05-29-2015 01:59 AM
You need to wire both indices.
05-29-2015 02:11 AM
i've tried wiring both indices to 0 and I get the original error saying "you have connected to arrays of different dimensions"
05-29-2015 03:49 AM
If I understood you right, you want to have an array of numbers, to convert into binary representation. Therefore you need ONE dimentional array of numbers, and TWO dimentional array of booleans (one row for each number).
If so - check out the attachment
05-29-2015 08:58 AM - edited 05-29-2015 08:59 AM
@dmtzbz wrote:
i've tried wiring both indices to 0 and I get the original error saying "you have connected to arrays of different dimensions"
Well, I don't. Please show is your code again.