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