var TcHmi;!function(TcHmi){let Functions;!function(Functions){let Beckhoff;!function(Beckhoff){Beckhoff.Increment=function(ctx,symbol,maxValue,stepWidth){null!=symbol?symbol instanceof TcHmi.Symbol?symbol.readEx((function(data){if(data.error!==TcHmi.Errors.NONE)return void ctx.error(data.error,{code:data.error,message:TcHmi.Errors[data.error],reason:"Function: Increment, symbol value read failed",domain:"Function",errors:data.details?[data.details]:void 0});let value=TcHmi.ValueConverter.toNumber(data.value);if(null===value)return void ctx.error(TcHmi.Errors.E_PARAMETER_INVALID,{code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:"Function: Increment, symbol value is no number.",domain:"Function"});let convertedStepWidth=TcHmi.ValueConverter.toNumber(stepWidth,1);isNaN(convertedStepWidth)&&(convertedStepWidth=1),value+=convertedStepWidth;let convertedMaxValue=TcHmi.ValueConverter.toNumber(maxValue);null===convertedMaxValue||isNaN(convertedMaxValue)||convertedMaxValue>=value?symbol.write(value,(function(data){data.error===TcHmi.Errors.NONE?ctx.success():ctx.error(data.error,{code:data.error,message:TcHmi.Errors[data.error],reason:"Function: Increment, symbol value write failed",domain:"Function",errors:data.details?[data.details]:void 0})})):ctx.success()})):ctx.error(TcHmi.Errors.E_PARAMETER_INVALID,{code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:"Function: Increment, parameter is no symbol.",domain:"Function"}):ctx.error(TcHmi.Errors.E_PARAMETER_INVALID,{code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:"Function: Increment, Requested symbol is not set.",domain:"Function"})}}(Beckhoff=Functions.Beckhoff||(Functions.Beckhoff={}))}(Functions=TcHmi.Functions||(TcHmi.Functions={}))}(TcHmi||(TcHmi={})),TcHmi.Functions.registerFunctionEx("Increment","TcHmi.Functions.Beckhoff",TcHmi.Functions.Beckhoff.Increment);