LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatic error catching from different VIs

Is there any way to programatically catch the error cluster data from executed VIs in memory?  I'm trying to dump error data from all VIs running as part of a project.

 

Thanks,

Ajay.

--
Ajay MV


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

Hi Ajay,

 

write a subVI, that will forward all error cluster data to an ErrorLogger. Put that subVI in all VIs you want to monitor…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,346 Views)

Hi GerdW,

 

I thought about that idea but my project has huge number of VIs.  Adding a subVI in all those VIs may take long time.  Instead I'm looking for a method in which "automatic error handling"(AEH) in LabVIEW works.  Whenever a VI executes, behind the scenes, AEH reads error cluster, checks for the errors, if the error terminal is wired, it ignore to show up to the error to user user.  Similarly, I am thinking of working in that layer of LabVIEW which reads error from all nodes of the running VI and getting the error logged.  Is there any labview propery or invoke option to read errors caught by AEH?

 

Thanks,

Ajay.

--
Ajay MV


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

Hi Ajay,

 

nope.

 

But as error handling should be an integral part of each program you create you should put error handling code in all relevant places right from the start. Again: put a subVI in any place you want to catch/log errors…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,289 Views)

Yeah... I'm working in that way of adding subVI in each VI now... But I prefer for such AEH way.. 😕

--
Ajay MV


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

Trying to report every error from every SubVI isn't that useful. If you know how the Standard Error Handling works in VIs, if an error comes into a SubVI, it will not execute and pass the incoming error out.

 

In most situations where you have a chain of VIs, you probably wouldn't want the next one to execute (e.g. if initialising a device fails, it's pointless to try and send commands to it). By having an error handler at the end of the 'chain' of VIs, you get notified where the error was first generated. There are, of course, lots of exceptions to this which means you think carefully about how you will handle errors in your application and there is no 'one VI fits all' for error handling.

 

Also, there are lots of situations where you might not want to report an error to the user and there are lots of different things you might want to do with the error - see the attached PDF.

 

You might want to look at the Structured Error Handler (SEH) in the Tools Network / VIPM - it's an NI created error reporting express VI.

 

If you still want to do it...you can probably use VI scripting to attach your error handler to the output of every VI error out.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 6
(3,262 Views)