LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get Error from sub panel VI

Hi, I am beginner of LabVIEW programming. Recently I have a case that I need to insert a sub VI into my main VI's front panel by using sub panel method. Then I have a question that how I could do error handling on my inserted sub VI. As shown below, I am inserting a sub VI "Sub IO.vi". My understanding of the error our of Invoke Node "Run VI" and "Insert VI" is the error whether this particular function is running properly. How could I get the error info of functions inside the sub VI, If I want do error handling, for instance, based on error status, go to different machine states in Main VI? 

image.png

 

 

 

 

 

 

0 Kudos
Message 1 of 6
(3,121 Views)

One of the way is inside a sub vi (which you are calling) use case, wire error cluster to the case selector. If you get a error  "error" case will execute. In that error case use a FGV(Functional Global Variable) to set error, Read that FGV in your main VI to go to different states based on error.

Expand.Evolve.Influence
0 Kudos
Message 2 of 6
(3,109 Views)

Dear ELNO,

 

Thank you very much for your reply. I will try what you suggested. Thank you!

0 Kudos
Message 3 of 6
(3,097 Views)

If you instead of VI server use Asynchronous call you can do a Collect afterwards. The sub VI must finish first, ofcourse.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(3,091 Views)

Dear Yamaeda,

 

Sorry I don't know what is "Asynchronous call". That is out of my current coverage. Thank you for your suggestions and I will get info of this "Asynchronous call" first.

0 Kudos
Message 5 of 6
(3,086 Views)

Start Asynchronous Call (found on the Application Palette) is one way to start a sub-VI running without having it explicitly being placed on your Block Diagram.  It allows you to specify when you want your parallel, asynchronous VI to start running.

 

As Yamaeda mentions, if your Asynchronous VI, itself, exits on Error, you can use code in the Main VI to trap the error.  However, it seems "cleaner" to me to set up a "communicate Error" routine to allow the Clone to signal its problem directly to the Main VI.

 

Bob Schor

Message 6 of 6
(3,071 Views)