06-10-2021 02:07 AM
Hello everyone,
im trying to interate over the columns in my array that I read from a file: This is my program:
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:
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:
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:
Now when i try to attach the bool to my case structure it ceases function:
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
Solved! Go to Solution.
06-10-2021 02:09 AM
Okay I see what I did there i attached an array instead of a single bool.. This can be deleted
06-10-2021 02:44 AM
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…
06-10-2021 09:45 AM
@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.
06-14-2021 12:18 PM - edited 06-14-2021 12:21 PM
I really recommend to start with some basic LabVIEW tutorials instead of jumping into the deep end and randomly wiring things together until no wires are broken. Even if there are no broken wires, the code can still be highly flawed. 😄
Also, it typically helps to attach your broken code (and example data file) and explain exactly what you are trying to do, not how you are trying to do it. Once we know what you want, we can probably come up with an alternative that fits on a postage stamp and is 90% simpler. 😄