LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a vi to clear warnings?

Solved!
Go to solution

Just wondering if there is a built in VI to clear the warnings in the error cluster, essentially setting the error code to 0 if error status is false. It is a trivial matter to write on such VI oneself, but I am just wondering if there is any built in VI to do this. 

 

I find this function useful when propagating error cluster through out a loop. If a warning is generated by a vi inside the loop, it will get propagated into next iterations, which makes all the error out terminals inside the loop to have this warning . This makes it hard to tell where does that error comes from.

0 Kudos
Message 1 of 10
(4,802 Views)

Do you have an example of the code that you are mentioning?

-ncm
0 Kudos
Message 2 of 10
(4,798 Views)

@AuZn wrote:

Just wondering if there is a built in VI to clear the warnings in the error cluster, essentially setting the error code to 0 if error status is false. It is a trivial matter to write on such VI oneself, but I am just wondering if there is any built in VI to do this.


Clear Error will do what you are asking for.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(4,790 Views)

My program can be simplicated to the following VI. Suppose a warning is generated at VI2, it will be propagated to the next iteration, so it is hard tell where does that warning comes from using a probe. On the other hand, I don't want to clear the errors, b/c in case of error the loop should stop.

 

 

 Untitled.png

0 Kudos
Message 4 of 10
(4,784 Views)

@crossrulz wrote:

@AuZn wrote:

Just wondering if there is a built in VI to clear the warnings in the error cluster, essentially setting the error code to 0 if error status is false. It is a trivial matter to write on such VI oneself, but I am just wondering if there is any built in VI to do this.


Clear Error will do what you are asking for.



But that would clear all errors,  not just warnings.  If you wrapped that in the non-error case of a case structure, then you'd be okay.

0 Kudos
Message 5 of 10
(4,779 Views)

@RavensFan wrote:

@crossrulz wrote:

@AuZn wrote:

Just wondering if there is a built in VI to clear the warnings in the error cluster, essentially setting the error code to 0 if error status is false. It is a trivial matter to write on such VI oneself, but I am just wondering if there is any built in VI to do this.


Clear Error will do what you are asking for.



But that would clear all errors,  not just warnings.  If you wrapped that in the non-error case of a case structure, then you'd be okay.


Or if you knew the specific warning number, wire that into the Clear Error and it would only clear that single warning.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(4,757 Views)
Solution
Accepted by AuZn

Another thing you could do when debugging is wire the error cluster into the conditional terminal of your loop. I don't know what you're doing and if this would be detrimental to your architechture, but I use this when designing so I can get detailed information for debugging purposes (iteration, source, etc). You could also simply use a tunnel with a conditional terminal, like so:

 

 

And essentialy wire your own logic to the terminal. This lets you have whatever behavior you want. Note that I did not use a shift register because in this application, the error state of previous iterations shouldn't be propogated. You could, for example, use the conditional terminal on an indexing output to build up an array of ALL warnings, or ALL errors, or ALL errors with a specific code, etc. The reason is up to you as the developer. All the tools are there to get whatever behavior you desire.

 

I've attached the VI so you can check out the error case.

 

 

0 Kudos
Message 7 of 10
(4,744 Views)

In the VI you provided, I don't think the conditional terminal on the most recent error will be necessary, since the loop will stop on error.

 

But I really like your idea of using an indexing terminal + conditional on error. It is a easy way to store all the error/warning generated in the loop.

0 Kudos
Message 8 of 10
(4,736 Views)

paulmw_0-1679513448521.png

 

0 Kudos
Message 9 of 10
(1,569 Views)

@paulmw wrote:

paulmw_0-1679513448521.png

 


Wrapped in a VI (with a small icon)

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 10
(1,559 Views)