ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop with Error Check

Solved!
Go to solution

Hello all,

 

As per my sample VI.

 

I gave   Empty array to For Loop. As we know this Loop will not execute because N value “0”.

But, I want to know why Error out always giving True value. This Error Indicator value changing to “True” irrespective of Error In.  

 

 BR,

Munna

Munna
0 Kudos
Message 1 of 5
(3,301 Views)

Sorry I forgot to attach

Munna
0 Kudos
Message 2 of 5
(3,300 Views)

Attach the VI instead of a picture. I cannot reproduce your observation.

 

(The error out will only give a true of you would keep the error in a shift register instead of plain tunnels, and only because your error diagram constant is set to true for some reason)

0 Kudos
Message 3 of 5
(3,288 Views)

Check this Sample VI.

 

In both the cases ForLoop is not executing but Output Error is not same.

Munna
0 Kudos
Message 4 of 5
(3,261 Views)
Solution
Accepted by Munna232

That''s exaclty what I said.

 

  • If you use plain tunnels and the loop iterates zero times, the output will give the default value for the datatype, which is FALSE for errors.
  • If you use shift registers, whatever is wired to the initializer terminal will be output unchanged on the right if the loop iterates zero times. Since you initialize with a error=TRUE, that's what you get.

 

This is all as expected. In your first post you claimed that the output is error=true using plain tunnels, which cannot be. Agreed?

 

If you want error=false with the shift register, change the diagram constant accordingly.

0 Kudos
Message 5 of 5
(3,252 Views)