From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,397 Views)

Sorry I forgot to attach

Munna
0 Kudos
Message 2 of 5
(2,396 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
(2,384 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
(2,357 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
(2,348 Views)