LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

for and case structure do not accept inputs

Solved!
Go to solution

Hello everyone,

im trying to interate over the columns in my array that I read from a file: This is my program:pr.png

When I add an indicator to the size of my array it gives me the right number N that I want as my input to the for loop:for indicator.png

Now comes what I didnt expect: When I now try to attach that number to N, it gives me an error that source and sink are not compatible though of the same type:

for er.png

 

Its not a big deal for my application so I just attached a constant because that array size does not change usually, so I had a workaround. The problem is that the weird error repeated to occur: I am trying to find out if the first element in my row is -1 and do something with that in a case structrure. So I used a comparison operator, that gives out a bool. If I add an indicator again, everything works as expected: as indicator.png

Now when i try to attach the bool to my case structure it ceases function:

to case.png

I am working with labview for a few weeks now and came quite far but this confuses me a lot. Am I doing something wrong or is my Labview (v.2015) installation corrupted maybe?

 

Thanks for reading

derbengale

 

0 Kudos
Message 1 of 4
(148 Views)
Solution
Accepted by derbengale

Okay I see what I did there i attached an array instead of a single bool.. This can be deleted

Message 2 of 4
(145 Views)

Hi derbengale,

 


@derbengale wrote:

im trying to interate over the columns in my array that I read from a file


When you want to autoindex columns instead of rows of a 2D array then you may transpose the array before the loop…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 3 of 4
(112 Views)

@GerdW wrote:

Hi derbengale,

 


@derbengale wrote:

im trying to interate over the columns in my array that I read from a file


When you want to autoindex columns instead of rows of a 2D array then you may transpose the array before the loop…


Adding just a bit to what GerdW wrote, you should not have the count terminal wired when you're using autoindexing. LabVIEW will take care of counting the length of the array for you. 

0 Kudos
Message 4 of 4
(68 Views)