Tag Archives: PLC Ladder Logic

Siemens S7-200 PLC’s Belt conveyor Control Programming Example

Three conveyor belts, respectively, by the motor M1, M2, M3 driven.

Requirements: After pressing the start button SB1, a startup sequence for M1, M2, M3, interval of 3s.
After the stop button SB2, Sequential stopping for M3, M2, M1, interval of 3s.
Three motors M1, M2, M3, respectively, through the contactor KM1, KM2, KM3 three-phase AC power supply is turned on, PLC control coil contactor

Siemens S7-200 PLC Duty Cycle Adjustable of the pulse source Programming Example

When I0.0 changes from 0 to 1, T102 normally closed contact closure, T101 is started and start time: When the T101 SV reaches the set PT  (50 × 100ms = 5s)
, T101 is turned on, T101 normally open contact closure, T102 is started, the start time; When the
T102 current value of SV reaches its set value PT (5s), T102 is turned on, normally closed contacts disconnect T102, T101 reset, T101 makes the current value SV = 0, T101 normally open contacts disconnect, T102 reset, T102 NC contact is closed, T101 restarted, begin the next cycle.

Siemens S7-300 plc’s Controls Belt Programming Example

An electrical start of the conveyor belt, At the beginning of the conveyor belt has two push button switches: S1 for START and a STOP of the S2.
At the end of the conveyor belt also has two buttons switches: the S3 for START and STOP for the S4. You can start or stop the belt from either end. In addition, when an object on the conveyor belt reaches the end, the Sensor S5 Make  Conveyor belts Shutdown

byte Immediate Read instruction (MOV-BIR)

Bytes read instruction immediately (MOV-BIR) reads the actual input IN the 1byte values, and write OUT the result as the specified storage unit, but the input image register has not been updated.


Bytes write command immediately read from the input IN the specified storage unit 1 byte numerical and written (in bytes) of physical output point on the OUT side the actual output, it also flushes the output image that corresponds to the register

PLC alarm circuit Ladder Logic

 That is the condition for the alarm input X0 X0 = ON alarm requirements.
Alarm lamp output Y0, Y1 alarm buzzer.
Y0 flashing alarm when its oscillation cycle 1s;
Y1 tweet.
X1 alarm response, alarm X1 after blinking and stays ON Y0, Y1 tweet closed.
X2 is alarm lamp test signal, i.e., Y0 X2 turns ON.

①Y0 need an oscillator signal.

alarm response after Y0 after flash lit, so the application of an intermediate relay R0 will hold X1 signal and with R0 normally open contact in parallel with the oscillating signal to reach steady Y0 purpose, while the normally closed contact with R0 disconnect the buzzer Y1.

PLC circuit Program

With a start button QA, a stop button TA D to achieve a motor start, stop control. Its AC contactor for KM. Draw terminal wiring diagram of the control system; lists the I / O allocation table; design ladder.
Analysis example
1) Terminal Blocks

2) I / O assignment Input Output
               QA-X0 KM-Y0
               TA-X1
 
                         

0 when input contact input terminal (QA) is turned on, input relay X0 coil excited, its normally open contact closure X0, Y0 output relay coil is excited by its normally open contacts self-retaining. KM AC contactor is energized, the motor starts normally. When No. 1 input contact input terminal (TA) is turned on, enter the relay coil Xl stimulated, the normally closed contacts to open Y0 coil energized and open self-locking, the motor stops running.

In programming the PLC, start, reset circuit is the most basic common electrical control circuit, and a variety of programming methods.
 

Siemens S7 PLC shift register instructions (SHRB) PLC Ladder Logic

(1) Shift Register instruction SHRB the DATA value into the shift register. Ladder, EN enable input is connected to the shift pulse signal, each effective when enabled, moving an entire shift register.DATA data input connected binary value shifted into the shift register, the instruction is executed when bit value into register.S_BIT specify the minimum bit shift register. N specifies the length and shift direction of the shift register, the maximum length of the shift register is 64, N is a positive value indicates a left shift, the input data (DATA) into the shift register, the least significant bit (S_BIT), and out of the shift the highest bit register.Out of the data is placed in the overflow memory bit (SM1.1) in.N is a negative value indicates a right shift, the input data is shifted into the most significant bit of the shift register, and shifted the least significant bit (S_BIT). Out of the data is placed in the overflow memory bit (SM1.1) in.

 (2) operand DATA and S-BIT was I, Q, M, SM, T, C, V, S, L. Data type: BOOL variables.Operand N is VB, IB, QB, MB, SB, SMB, LB, AC, constant. Data type: Byte.
 (3) Error conditions that set ENO = 0: The 0006 (indirect address), 0091 (operand out of range), 0092 (error in count field).

 (4) the impact of special internal shift instruction flag: SM1.1 (a bit of value out of the overflow bit is set).

Siemens S7 series PLC logic control instruction PLC Ladder Logic

Logic Control Instructions refers jumps and circular logic block instructions. Jump or loop instruction operand is the address label, the address label stating that the program to jump to where the label of up to four characters, the first character must be a letter, the remaining characters can be letters or numbers.
An unconditional jump instruction

         JU Unconditional jump instructions
          
JL Jump instruction form
2 jumps

         JC jump if RLO = 1
         
JCN Jump if RLO = 0
         
JCB when RLO = 1 and BR = 1 jump
          
JNB when RLO = 0 and BR = 0 Jump
          
JBI When BR = 1 jump
          
JNBI When BR = 0 Jump
          
JO jump when OV = 1
          
JOS When OS = 1 jump
          
JZ accumulator 1 evaluates to zero Jump
          
JNZ accumulator 1 evaluates to nonzero jump
          
JP accumulators 1 calculation result is positive Jump
          
JM accumulators 1 calculation result is negative jump
          
JPZ accumulators 1 calculation result is greater than zero Jump
          
JMZ accumulators 1 calculation result is less than zero Jump
          
JUO calculation result overflows Jump
3 Program Control Instructions

        BE Block End instruction
        
BEC conditional block end instruction
       
RLO = 1, the end of the scanning of the current block, control is returned to the calling block.If RLO = 0, then the RLO is set to 1, the program continues to scan in the current block
        
BEU Block End Unconditional instructionThe instruction unconditionally end scanning current block, control is returned to the calling block

Siemens S7 series PLC Word Logic instruction PLC Ladder Logic

Word logic instruction word (16-bit) or two double word (32 bits) bit by bit logical operations. Two number one in accumulator 1, the other may or instruction to immediate (constant) given by way of the accumulator 2, the logical operation result word logic operation instruction in ACCU 1 the double word logic operation result is stored in accumulator 1. the contents of accumulator 2 remain unchanged.
Logic operation Affected flag status word. If the result of logic operation is 0, the CCl bit is reset to 0. If the result of logic operation is non-zero, then the CCl is set to 1.
In any case, the status word bits CC0 and OV are reset to zero.
l AW 16 bit word logic instructionl OW 16-bit word logic or instructionsl XOW 16-bit word logical XOR instructionl AD 32 bit double word logic instructionl OD 32 bit double word logic or instructionsl XOD 32 bit double word logic instruction Exclusive OR

 

Example 3.10.1 FBD Symbol:
         


* STL statement format: AWNote: When the enable input EN input is “1”, the IN1 and IN2 from the two ends of the phase-by-16-bit binary data and outputs the result from the OUT terminal. Enable output ENO = enable input EN.
          
IN1 = 0101010101010101
          
IN2 = 0000000000001111
          
OUT = 0000000000000101Example 3.10.2 FBD Symbol:
 


                
 
* STL statement format: XOWNote: When the enable input EN input is “1”, the IN1 and IN2 from the two ends of the 16-bit binary data bit by bit XOR result is output by the OUT terminal. Enable output ENO = enable input EN.

Siemens S7 series PLC Data Block Instructions PLC Ladder Logic

Open the data block
        
<span title="指令格式:OPN           “>Instruction format: OPN

          Description: open a data block as a shared data block (DB) or as an instance data block (DI).

              You can open a shared data block and one instance data block at the same time.
Example 4.9.1: OPN DB 10 // open a data block as a shared data block DB 10

          L DB W35 // the DB data words W35 10 is loaded into the accumulator
Low Word 1.

          T M W22 // transfer low word of accumulator 1 to M W22.

          OPN DI 20 // open a data block as the instance data block DI 20

          L DI B12 // will DI B12 20 byte data is loaded into the accumulation
Low Word 1

          T DB B37 // the low word of accumulator 1 transmission word to DB 10
Section 37.

Exchange of shared data blocks and instance data blocks

        Instruction format: CDB

        Description: Exchange shared data block and instance data block.
shared data block into instance data block,
instance data block becomes shared data block.
The length of the loading shared data block into accumulator 1

        Instruction format: L DBLG

        Explanation: The length of shared data block is loaded into the accumulator 1.
The number of loaded shared data block into accumulator 1

        Instruction format: L DBNO

        Description: The number of shared data block is loaded into the accumulator 1.
 
Length loaded instance data block into accumulator 1

        Instruction format: L DILG

        Explanation: The length of instance data block is loaded into the accumulator 1.

 
The number of installed instance data block into accumulator 1

        Instruction format: L DINO
        
Description: The number of instance data block is loaded into the accumulator 1.

Siemens S7 series PLC cycle instruction PLC Ladder Logic

l RRD 32-bit left cyclic command
 
l RRD 32 Wei right rotation instruction

 
l RLDA 32-bit instruction cycle CC1 bit left

 
l RRDA 32-bit instruction with CC1 bit right rotation

1. When the enable input EN = 1, the implementation of double word left instruction cycle. The 32 pairs of words left cyclic N bits from the input terminal IN, the output from the OUT terminal.

2. N-ended input frequency to be shifted.

3. If N is not equal to 0, then the instruction is executed, CC0 and OV bits are always equal to zero.

4. ENO = EN