beckhoff TwinCAT 2 PLC Control — 10.5.6.5 MUX

Appendix 10.5.6.3 MIN Minimum function. Returns the lesser of the two values. OUT := MIN(IN0, IN1) IN0, IN1 and OUT can be any type of variable. Example in IL: LD 90 MIN 30 MIN 40 MIN 77 ST Var1 (* Result is 30 *) Example in FBD: 10.5.6.4 LIMIT Limiting OUT := LIMIT(Min, IN, Max) means: OUT := MIN (MAX (IN, Min), Max) Max is the upper and Min the lower limit for the result. Should the value IN exceed the upper limit Max, LIMIT will return Max. Should IN fall below Min, the result will be Min. IN and OUT can be any type of variable. Example in IL: LD 90 LIMIT 30,80 ST Var1 (* Result is 80 *) 10.5.6.5 MUX Multiplexer OUT := MUX(K, IN0,...,INn) means: OUT := INK.

IN0, ...,INn and OUT can be any type of variable. K must be BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT or UDINT. MUX selects the Kth value from among a group of values. Example in IL: LD 0 MUX 30,40,50,60,70,80 ST Var1 (* Result is 30 *) TwinCAT 2 PLC Control 321 Version: 1.0