Siemens Bit Shifter PLC Program

Siemens PLC Programming Example

Shift one bit to the right as long as the button is pressed.

plc programming bitshifter plc

NETWORK 1       //NETWORK TITLE (single line)

LD     I0.0

EU

SHRB   M0.0, V0.0, +6

 

NETWORK 2

LD     V0.0

=      Q0.1

NETWORK 3

LD     V0.1

=      Q0.1

NETWORK 4

LD     V0.2

=      Q0.2

NETWORK 5

LD     V0.3

=      Q0.2

NETWORK 6

LD     V0.4

=      Q0.1

NETWORK 7

LD     V0.5

=      Q0.5

NETWORK 8

LDN    V0.0

AN     V0.1

AN     V0.2

AN     V0.3

AN     V0.4

AN     V0.5

=      M0.0