1. PLC and host computer (or touch screen) monitoring system, in the screen many times need to have "manual", "automatic" and other control modes (generally more than one can only be a time). Inside the program you can use the "MOV" command. Such as: when you choose "manual" will be constant 1 MOV to a register VB10 inside, when you choose "automatic" will be 2 MOV to the same register VB10. as long as the judgment register data is how much, we know that the system is that kind of control mode. The advantage of this idea is that it is easy to understand, without the need for interlocking and other troublesome programs.
2. The program has analog control, if the analog read basically no error, you can take the time filtering method, delay for a period of time. If the read data error is very large, you need to take other filtering methods, such as calculation of the average and so on. You can consult the relevant information.
3. In the process of program debugging (especially when the equipment transformation, your program is added to the original equipment program), when the program statements appear to meet the conditions, but the output coil is not connected, you can check whether your program is between such statements, such as JMPgo to statements. There is also a possibility that after interrupting the program, the conditions are met but the output is not turned on, usually because the program is not scanned.
4. In the sequence control program, that is, after the completion of an action, into the next action, and other similar sequential control, the use of +10 +10 control mode I find it very convenient. The idea is: preset a register, in the initialization of the value of 0, when the system starts, it +10, at this time, the register is 10, the register is equal to 10 when you can do the first action; the first action is completed, and then on the register +10, at this time, the register is equal to 20, you can do the second action, the second action is completed and then +10, at this time the register is equal to 30, so that as long as you judge how much data inside the register, you know what to do! In this way, as long as you judge how much data is in the register, you will know that you need to complete that action. When you need to jump action, you can no longer +10, you can add +20 +30..., depending on the actual need. It depends on the actual need.
Why add 10 instead of 1, because after adding 10, if you insert a paragraph, just choose a random position in the 10 empty places.
5. In the design of the program, when there is a process failure (non-control system control), it is best to keep the failure phenomenon, and light sound alarm. Until the operator reset, in order to let it know that the system has a fault. Otherwise it shuts down and others think you have a program problem. It's usually a good idea to design a new system with these in mind.
6. For subroutines that are frequently called, they can be made into sub-modules and called frequently.
7. because the production machinery in the work cycle of the various steps of the movement in the execution of a certain amount of time, and these times have a certain limit, so you can use these times as a reference, in order to detect the start of the work step action at the same time, start a timer, timer time set value than the normal circumstances of the action to last for 20% to 30% longer, and the output signal of the timer can be used for alarms or Automatic stopping device. When the production machinery of a step action time more than the specified time to reach the corresponding timer preset time, has not been transferred to the next step action timer issued a fault signal, the signal to stop the normal work cycle program, start the alarm or shutdown program, which is often referred to as over beat protection.
8. Some safety detection switches (e.g. emergency stop button, safety light curtain, limit switch, etc.) are practical normally closed (NC) inputs.
9. For safety and energy saving considerations, try to design the output to require action only when the action, once in place to stop the output, rather than designing the usual has been the output, the need to stop when the output is disconnected.
10. The principle of the action of the executive element should be rather not move, do not move!
11. Single device control: a single device must have a soft manual / automatic switching and soft manual when you can start / stop function, by automatic switching to soft manual, the device can not stop; by soft manual switching to automatic, equipment start / stop depending on the automatic program.
12. A single device (pumps, fans and other large equipment) running full 24 hours must be rotated, and there must be a running time accumulated, if set by the host computer start / stop order except the operator to set their own.




