Select, Multiplex, And Demultiplex Instructions - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents
100BBasic instructions
7.9 Word logic operations
Table 7- 131 OUT parameter for ENCO
ENO
Condition
1
No error
0
IN is zero
The DECO parameter OUT data type selection of a Byte, Word, or DWord restricts the
useful range of parameter IN. If the value of parameter IN exceeds the useful range, then a
modulo operation is performed to extract the least significant bits shown below.
DECO parameter IN range:
● 3 bits (values 0-7) IN are used to set 1 bit position in a Byte OUT
● 4-bits (values 0-15) IN are used to set 1 bit position in a Word OUT
● 5 bits (values 0-31) IN are used to set 1 bit position in a DWord OUT
Table 7- 132 Examples
DECO IN value
Byte OUT
Min. IN
8 bits
Max. IN
Word OUT
Min. IN
16 bits
Max. IN
DWord OUT
Min. IN
32 bits
Max. IN
7.9.4

Select, Multiplex, and Demultiplex instructions

Table 7- 133 SEL (select) instruction
LAD / FBD
SCL
out := SEL(
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
228
DECO OUT value ( Decode single bit position)
0
00000001
7
10000000
0
0000000000000001
15
1000000000000000
0
00000000000000000000000000000001
31
10000000000000000000000000000000
g:=_bool_in,
in0:-_variant_in,
in1:=_variant_in);
Result (OUT)
Valid bit number
OUT is set to zero
Description
SEL assigns one of two input values to parameter OUT, depending
on the parameter G value.
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05

Hide quick links:

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents