LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unnecessary redundancies in my code?

Concerning version _2

 

Not sure why you get the number of channels, then build an array of size 4, they use the array size VI to initialize your other arrays. Just use four, or if the number of tasks change, build an array with the tasks.

 

Use initialize you boolean array to false then "Not" it in your For loop, why not just start with a True array instead?

 

mcduff

 

Message 21 of 22
(258 Views)

@mcduff wrote:

 

Use initialize you boolean array to false then "Not" it in your For loop, why not just start with a True array instead?

 

mcduff

 


Hi mcduff,

I think the boolean array you mention comes from one of my responses in another thread. The reason is simply the question that I wanted the boolean to answer. So, in short, it just made more sense in my head. 

 

The question the boolean answers is "has the data already crossed the threshold?". You could definitely change the question to "has the data not crossed the threshold?" or "do I need to update when the data crosses the threshold?" in which case you would want to start with an array of True, but I chose the one which made the most sense to me 🙂

Message 22 of 22
(256 Views)