Basic instructions
8.9 Word logic operations
S7-1200 Programmable controller
330 System Manual, V4.2, 09/2016, A5E02486680-AK
To add an input, click the "Create" icon or right
-
click on an input stub for one of
the existing IN parameters and select the "Insert input" command.
To remove an input, right-click on an input stub for one of the existing IN parameters (when
there are more than the original two inputs) and select the "Delete" command.
Table 8- 178 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,
Time, Date, TOD, Char, WChar
Inputs
ELSE SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Time, Date, TOD, Char, WChar
Input substitute value (optional)
OUT SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Time, Date, TOD, Char, WChar
Output
1
Input variables and the output variable must be of the same data type.
Table 8- 179 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.