MC_OverrideFilter

MC_OverrideFilter 1:

The function block MC_OverrideFilter can be used to convert an unfiltered override value consisting of digits (e.g. a voltage value of an analog input terminal) into a filtered override value that matches the cyclic axis interface (PlcToNc) (DWORD in the range 0...1000000). This filtered override is also available in percent (LREAL in the range 0...100%).
The raw input value is limited to a validity range by LowerOverrideThreshold and UpperOverrideThreshold, and implemented as parameterizable steps (resolution) (OverrideSteps). After each override change at the output of the FB, a minimum recovery time is awaited internally (OverrideRecoveryTime) before a new override value can be accepted. The only exceptions are the override values 0% and 100%, which are always implemented without delay for safety reasons.

MC_OverrideFilter 2:

Due to the gradation of the override output value (OverrideValueFiltered), the filtered override may become zero for very small override input values (OverrideValueRaw). A zero override leads to standstill of the axis. If total standstill is undesired, OverrideValueRaw should not fall below the smallest level.

Inputs


VAR_INPUT
OverrideValueRaw       : DINT;
LowerOverrideThreshold : DINT := 0;    (* 0...32767 digits *)
UpperOverrideThreshold : DINT := 32767;(* 0...32767 digits *)
OverrideSteps          : UDINT := 200; (* 200 steps=> 0.5 percent*)
OverrideRecoveryTime   : TIME := T#150ms; (* 150 ms *)
END_VAR

OverrideValueRaw

Raw, unfiltered override value (e.g. a voltage value of an analog input terminal).

LowerOverrideThreshold

The lower threshold for the raw override value.

UpperOverrideThreshold

The upper threshold for the raw override value.

OverrideSteps

The specified steps (override resolution).

OverrideRecoveryTime

Minimum recovery time, after which a new filtered override value is placed on the output. The override values 0% and 100% are implemented without delay.

Outputs


VAR_OUTPUT
OverrideValueFiltered   : DWORD; (* 0...1000000 counts *)
OverridePercentFiltered : LREAL; (* 0...100 % *)
Error                   : BOOL;
ErrorId                 : UDINT;
END_VAR

OverrideValueFiltered

The filtered override value in digits (the data type matches the override in the cyclic axis interface 0 to 1000000).

OverridePercentFiltered

The filtered override value in percent (0..100%).

Error

Becomes TRUE if an error occurs.

ErrorID

If the error output is set, this parameter supplies the error number.

Possible error number

Possible causes

MC_ERROR_PARAMETER_NOT_CORRECT

  • OverrideSteps <= 1
  • LowerOverrideThreshold >= UpperOverrideThreshold