LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel to labVIEW usage

Solved!
Go to solution

I have got something and I am stuck. 

 

So I have a text file with pin numbers in one column, and then a boolean status of on/off in the other column. I call it into labVIEW and put it into a 2d array, then separate it into two, 1d arrays. I want to make it so if array 1 (in index zero) is 0, and if array 2 (in index zero) is on, then it will turn on the boolean indicator.

 

If array 1 is 1 (in index 1) and if array 2 is off (in index 1) then it will turn boolean 1 off.

 

I cannot figure out the for loop for that logic.

 

Also how can I make it so the loop will programably create indicators for each pin, versus me actually "hard" coding it in.

 

Download All
0 Kudos
Message 11 of 12
(949 Views)
Solution
Accepted by topic author kenypatel

@kenypatel wrote:

I have got something and I am stuck. 


Again, this has NOTHING to do with excel!

 

If the numbers in column one are always in order starting with zero, we only need the second colum and we don't even need a FOR loop.

 

If the first column is in random order, we need to define what state an LED should be if it is not mentioned in the file.. Lets assume you want unmentioned LEDs OFF, all you need is initialize an array of booleans in a shift register and replace the values acording to the index in column zero.

 

The attached simple example shows both possibilities, maybe it can give you some ideas.

 


@kenypatel wrote:

Also how can I make it so the loop will programably create indicators for each pin, versus me actually "hard" coding it in.


Well, instead of simple booleans, use an array of booleans and resize the container as a function of array size (within limits, use an array scrollbar if it gets too big).

Creating extra scalar booleans on the fly is about as reasonable as trying to create extra pins on your circuit board on the fly, so think about that.

 

Message 12 of 12
(915 Views)