100BBasic instructions
7.9 Word logic operations
S7-1200 Programmable controller
230
System Manual, 11/2011, A5E02486680-05
Table 7- 137 DEMUX (Demultiplex) instruction
LAD / FBD
SCL
Description
out := DEMUX(
k:=_unit_in,
in:=variant_in,
out0:=variant_in,
out1:=variant_in,
[...out32:=variant_in,]
outelse:=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.
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.
Table 7- 138 Data types for the DEMUX instruction
Parameter
Data type
1
Description
K
UInt
Selector value:
0 selects OUT0
1 selects OUT1
n selects OUTn
IN
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Time, Char
Input
OUT0, OUT1, ..
OUTn
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Time, Char
Outputs
ELSE
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord,
Time, Char
Substitute output when K is
greater than (OUTn - 1)
1
The input variable and the output variables must be of the same data type.