Expression Tag errors when dividing by 0

I have an expression tag that occasionally show an error whenever the two tags inside the expression equal zero. Is there away to ignore the error value and just show 0 in the case when the expression is 0*3600/0? Expression below.

({Tag1} * 3600) / {Tag2}

The try() expression function, perhaps?

That worked, thank you!

I spoke too soon, it still shows an error...

I can't see what you've done, or what you are getting. (Infinity? That isn't an error.)

try(({[.]Shots per seconds for Chute2} * 3600) / {[.]Chute2 lbs per hour},0)

the error that shows is Error_TypeConversion("Invalid value: Tag value is Infinity or NaN."), which is what the error I was seeing before.

So is not an execution exception, which is what try() captures, but simply bad quality on infinity.

In this particular case, I'd use the if() function to replace the denominator when it is zero. if({someTag}, {someTag}, 1.0) (Relying on the fact that numbers are "true" when non-zero.)

Alright I can confirm this did work for sure, Thank you for your help.

Just another way, as this looks similar to an workcenter efficiency calculation:

if({target} = 0, 0, {actual}/{target})

Doing OEEs and efficiencies can be a whole 'nuther topic filled with differences between how normal people calculate things and how corporate calculates things. :roll_eyes: