Mitsubishi PLC four-choice program preparation method - Database & Sql Blog Articles

Photocoupler

The "four choices one" program is a test model of "self-study plc instruction - Mitsubishi FX2N programming technology and application" (edited by Mo Caojun), which is a refinement of practical problems, describing:

Given four inputs X0, X1, X2, X3, four outputs Y0, Y1, Y2, Y3; each input corresponds to one output, but only one output is allowed to be turned on at a time; four inputs, only There is a switch on to allow the corresponding output.

Also, assume that when the inputs X0 to X3 are all turned off, the outputs Y0 to Y3 remain unchanged from the previous state; see Table 1.

Table 1 one-to-one correspondence between input and output

Serial number

enter

Output

Description

Remarks

1

X0

Y0

X0 single turn-on, Y0 turn on

In the output Y0 to Y3, two or more are not allowed to be simultaneously turned on.

2

X1

Y1

X1 single turn-on, Y1 turn on

3

X2

Y2

X2 single turn-on, Y2 turn on

4

X3

Y3

X3 single turn-on, Y3 turn on

When the output is a relay or contactor signal, although the external circuit can be connected by means of interlocking to ensure the uniqueness of the input signal, as a PLC program, the correctness of the signal must still be considered to ensure that the wiring is incorrect. When the device is forced to turn on the component during program debugging, the system can work normally.

So, the programming ideas for this problem can be:

(1) determine whether the signal is correct;

(2) The output is determined according to the state of the input signal.

It is also assumed that when one input is first turned on (for example, X0) and the corresponding output Y0 is turned on, X0 is not turned off, and when X1 is turned on again, the output state remains unchanged, that is, Y0 is turned on, and Y1 to Y3 are turned off.

In order to simplify the problem, when only one input is turned on again, its action condition is temporarily not required, and it can be immediately converted to the corresponding output; in actual programming, it can be specified according to the system situation.

1. Determine if only one input is connected

For the determination of the number of input signals, "Self-study PLC instruction - Mitsubishi FX2N programming technology and application" (hereinafter referred to as the literature) was introduced with SUM, ADD, FOR, LD =, INC and other instructions.

According to the idea of ​​the literature, we can seek different solutions to a problem in order to familiarize with instructions and accumulate programming experience. Therefore, we try to use shift instructions to program, see Figure 1.

In the program of Fig. 1, when only one of X0 to X3 is turned on, M100 is turned on; and when two or more are turned on, M20 is turned on, and M100 is turned off. Due to this problem, it is only necessary to judge whether only one input is turned on, and the specific number is not required, so the program of Fig. 1 can satisfy the use requirement.

数码相机

However, for the program of FIG. 1, M11, M12, and M13 can be turned on as the number of input turns is increased.

For convenience of use, if it is assumed that when only one input is turned on, only M10 is turned on, and when two inputs are turned on, only M11 is turned on, when three inputs are turned on, only M12 is turned on, and four inputs are connected. All the time, only M13 is connected, can you do it? To this end, a program is compiled as shown in Figure 2.

数码相机 In Fig. 2, in order to facilitate the test observation, Y4 to Y7 are specifically set as the operation instructions of M10 to M13. When there is no PLC at hand, software simulation can also be used to verify the results.

Thus, when M100 in Fig. 1 is turned on, or M10 in Fig. 2 is turned on, it means that the input signal is correct, and the corresponding output relay is allowed to be turned on.

Therefore, the programming of the second step can be performed.

Entertainment Tablet

The advantage of entertainment tablet lies in having a powerful chip and excellent hardware. If you want to play various online videos on the tablet and run various software smoothly, the performance of the hardware is an absolute prerequisite. In addition, a high-speed and stable WIFI module is also required, which must be compatible with multiple 802.11 B/G/N protocols at the same time, so that the webpage can be loaded instantly when the webpage is opened, and the online video can be played smoothly. So hardware is the premise and foundation, without good performance everything else is empty talk.
In addition to having a good CPU as a prerequisite, it is equally important to carry a professional video player. A professional video player must perform equally well both online and offline.

Entertainment Tablet,High capacity battery,WIFI

Jingjiang Gisen Technology Co.,Ltd , https://www.jsgisengroup.com