Shift And Rotate - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Programming instructions
6.1 Basic instructions
MUX
K
IN0, IN1, ....
ELSE
OUT
Input variables and the output variable must be of the same data type.
● The SEL instruction always selects between two IN values.
● The MUX instruction has two IN parameters when first placed in the program editor, but it
Use the following methods to add and remove input parameters for the MUX instruction:
● To add an input, right-click on an input stub for one of the existing IN parameters and
● To remove an input, right-click on an input stub for one of the existing IN parameters
Condition codes: ENO is always TRUE following execution of the SEL instruction.
ENO status (MUX)
6.1.10

Shift and Rotate

Shift instruction
Click below the box name and select a data type from the drop-down list.
130
Data type
UInt
SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,
DWord, Time, Char
SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,
DWord, Time, Char
SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,
DWord, Time, Char
can be expanded to add more IN parameters.
select the "Insert input" command.
(when there are more than the original two inputs) and select the "Delete" command.
MUX condition
1
No error
0
K is greater than or equal to the
number of IN parameters
You use the shift instructions to shift the bit pattern of parameter IN. The
result is assigned to parameter OUT. Parameter N specifies the number of
bit positions shifted:
 SHR: Shift bit pattern right
 SHL: Shift bit pattern left
Description
Selector value:
0 for IN0
1 for IN1
...
Inputs
Input substitute value
(optional)
Output
MUX result OUT
Selected IN value is assigned to OUT
No ELSE provided:
OUT is unchanged
ELSE provided:
ELSE value assigned to OUT
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents