Email on Error

Hey All,

Is there a way to determine which errors are reported by Email? I can get it to email on certain errors but not others; specifically, it seems like only ML.STAR errors step errors are reported, whereas code related errors (e.g., left hand side not a number and such) are not.

Thanks!
Gil

1 Like

Hi Gil,

The send email on error feature enabled in system configuration editor is designed to only send automatic emails when waiting error dialogs are produced on ML_STAR and other device steps configured as a deck instrument.

To have Run Control send emails on other occurrences, you can use the ‘Send Email’ function of the HSLUtilLib library, which is default to all VENUS installations. The function is straightforward, only needing string variables/values as parameters for recipient address, subject and body.

This function is configured to use the same sender and SMTP settings that you already have specified in configuration editor used to send emails on error, unless you use functions within the library to temporarily overwrite those settings.

This function can be called programmatically whenever you want, whether in error handling situations or OnAbort.

For sending emails with the intent to capture programmatic errors or bugs, I recommend using the function ‘ErrGetDescription’ of the HSLErrLib library (also default) prior to the SendEmail function. This command will return a string whose value will contain a description of whatever the active/current error object is. This can be used as the body of the email to capture details.

There are no parameters, just a return value.

Thanks.

-Nick

2 Likes

This is great. Thank you Nick!

1 Like

Hi @NickHealy_Hamilton ,

Quick question regarding this. In the “to” parameter, is there a way to list multiple email addresses? Or will this only work with one email?

Same question applies to email address setting in the system configuration settings.

I ask since our SMTP will work fine with single email address, but our internal SMTP system won’t work with email distribution lists.

If not, it’s not the end of the world, as I can get around this by setting up some outlook filtering rules to automatically forward the emails to the relevant other people as necessary.

Thanks!

You can provide all the emails as a string

Mail1,mail2,mail3mail4 and then use string lib from HSLExtentions to split the string to an array with the de limiter you use.

Then get size of the array, loop that amount of time and use the mail addresses you’ve split to this array per loop. So each index will be used.

Sending emails to any number of users that way. Otherwise you can do the same with MailAlert or similar. However in Venus 6 it works great.

Not for the default error handling emails (the one you set in system config). You’d have to deal with the sending of emails yourself if you wanted to split on a delimiter.

I could never find a way to designate multiple emails, so we’ve gone with a distribution list.