VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you handle errors in Veristand models and drivers?

Hi folks,

 

I want to include decent error handling in my Veristand project. From what I can tell so far, it is hard to get good error information out of your model or driver. (I am writing these in LabVIEW.) I was wondering what other people where doing.

 

At a minimum, I want to log that an error has happened and have some info about the error so developers can have something to go by. I would also like to log details to help debug errors in the event of un-anticipated errors. (I would love to log the values of all the inputs to the model/driver.)

 

What are best practices for error handling in models and device drivers?

 

Thanks!

0 Kudos
Message 1 of 3
(5,646 Views)

I typically use a channel on the output of a custom device that holds the error code. Then I can see that value in any tools that can read channels. Since errors can be transient its usually good to do things like "last error code" "current error code" and "error count". If you want the full call chain for debugging you can print it to console.

 

I've seen people use Syslog protocol inside custom NI VeriStand plugins before: http://zone.ni.com/devzone/cda/epd/p/id/5980

 

This allows you to send messages in the custom code and view them in any Syslog viewer (there are many in the industry).

 

For custom labview models... you probably couldn't do syslog because they only have a "run" state. But you could at least do the other suggestions

Stephen B
0 Kudos
Message 2 of 3
(5,642 Views)

I like the idea of using Syslog. I did not know there were syslog functions available.

 

I guess the problem with using this solution in a model is that there are init and clean up steps that models don't have states for?

 

I suppose I could convert my error data to an array of U8 and pass it to a Syslog driver as an outport?

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