Optimization 2 PLC program (input)

Save input points in several ways:

1. encoded input

 Combining a plurality of code input is input as an input signal relay, relay has inputs n 2 n combinations, can be represented by n-bit binary numbers, such an input method may maximize the use of the input point, generally require decoding ladder . As shown, input relay X0, X1 There are four combinations (i.e., 2-bit binary numbers 00,01,10,11), represented by M0 ~ M3, corresponding to four input signals. For example, in switch position 2, X1, X0 = 10, M2 ladder diagram coil is energized.

2. Enter the Matrix

3 shown below is input matrix row 2, this wiring commonly used in the occasion of a variety of input operation. For example, the selection switch SA in FIG hit the left, the manual operation mode is executed, operation input buttons; switch is on the right, the automatic operation mode is performed automatically by the system control point.

 

3. Enter Programming

The input circuit is programmed manner the following composition shown in FIG. Input button SB corresponding to a gear selection switch 10, the initial position of the coil is energized to M20, M20 = 1, contact closure.

It works as follows:

Press the button SB, X1 is turned on again, the SFTL perform a left shift instruction, the M20 is the value "1" moves to the left in M21, so that M21 = 1, the normally closed contacts open M21, M20 coil is energized, M20 = 0.

Then press the button SB, SFTL and performs a left shift instruction, the M21 value "1" is moved to the left in M22, so that M22 = 1, the normally closed contacts open M22, M20 coil remains energized.

Each press of a button SB, SFTL instruction execution time left. That only one relay M = 1, so that the contact 10 M20 ~ M29 are sequentially alternately closed relay, 10 corresponds to a gear selection switch.

The methods may be implemented using a variety of programming input mode and the control mode, the key is flexibility in the application of basic function commands and logical instructions.

4. A multi-button

Long press, press, release and binding detected signs design.

Guess you like

Origin www.cnblogs.com/iBoundary/p/11294006.html