Basic instructions
7.9 Word logic operations
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
279
Table 7- 139 Data types for the MUX instruction
K UInt
• 0 selects IN1
• 1 selects IN2
•
n
selects IN
n
IN0, IN1, .. INn SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Inputs
ELSE SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Input substitute value (optional)
OUT SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Output
1
Input variables and the output variable must be of the same data type.
Table 7- 140 DEMUX (Demultiplex) instruction
k:=_unit_in,
in:=variant_in,
out1:=variant_in,
out2:=variant_in,
[...out32:=variant_in,]
DEMUX copies the value of the location assigned to parameter IN to
one of many outputs. The value of the K parameter selects which
output selected as the destination of the IN value. If the value of K is
greater than the number (OUT
n
- 1) then the IN value is copied to
location assigned to the ELSE parameter.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
To add an output, click the "Create" icon or right
-click on an output stub for one
of the existing OUT parameters and select the "Insert output" command.
To remove an output, right-click on an output stub for one of the existing OUT parameters
(when there are more than the original two outputs) and select the "Delete" command.