Features of plc instruction execution (based on FX series programmable controller)

Features of plc instruction execution

1. General expressions and features of function instructions

The expression of the function instruction is shown in the following table:

The function commands are organized by function number FNC00~FNC249. Each function instruction has an instruction mnemonic.

Features of plc instruction execution

2, data length

Function instructions can process 16-bit data and 32-bit data.

The first instruction in the following figure is to send the data in D10 to D12, which is processing 16-bit data. The second instruction is to send the data in D21 and D20 to D23 and D22, and process the 32-bit data.

Features of plc instruction execution

3, function instruction type

Features of plc instruction execution

The function commands of the FX series PLC are available in continuous execution mode and pulse execution type.

The program in the left is an example of a continuous execution mode. The above instruction is repeatedly executed every scan cycle when X2 is in the ON state. The program on the right is the pulse execution mode, which is valid only when X1 turns from OFF to ON.

4, bit components

Bit components: Components that only handle the ON/OFF state are called bit components.

Word component: a component that processes data is called a word component.

Combination of bit elements: Data processing can be performed by bit elements or word elements, and bit element combinations are represented by Kn plus head element numbers. The four bit elements are grouped into a unit, and n in KnM0 is the number of groups.

5, the index register V, Z

The index register is used to modify the component number of the operation object in the transfer and compare instructions. It operates in the same way as a normal data register. The (.) in [D.] indicates that the index register can be added. For 32-bit instructions, V is 16 bits high and Z is 16 bits low. When the index register is used in a 32-bit instruction, only Z is specified, and Z represents V and Z.

Second, the program flow control function instruction

Conditional jump instruction CJ

Subroutine call instruction CALL and return instruction SRET

Interrupt return instruction IRET, enable interrupt instruction EI and disable interrupt instruction DI

Main program end instruction FEND

Watchdog timer refresh instruction WDT

Loop start instruction FOR and loop end instruction NEXT

1, conditional jump instruction CJ

The CJ and CJP instructions are used to skip a part of the sequence program to reduce the scan time. Conditional jump instruction CJ application description

Features of plc instruction execution

2, subroutine call instruction CALL and return instruction SRET

The subroutine should be written after the main program, ie the label of the subroutine should be written after the instruction FEND, and the subroutine must end with the SRET instruction.

Features of plc instruction execution

3. Interrupt return instruction IRET, enable interrupt instruction EI and disable interrupt instruction DI

The PLC is generally in an interrupt-free state. The block between the commands EI~DI is the allowable interrupt interval, and the interrupt interval is between DI and EI. When the program executes to the allowable interrupt interval and an interrupt request signal occurs, the PLC stops executing the main program, executes the corresponding interrupt subroutine, and returns to the breakpoint to continue executing the main program when the interrupt return instruction IRET is encountered.

Features of plc instruction execution

4, the main program end instruction FEND

The FEND instruction indicates the end of the main program and the start of the subroutine. When the program is executed to the FEND instruction, output processing, input processing, and watchdog timer refresh are performed. When it is completed, it returns to step 0.

The FEND instruction is typically used with the CJ-P-FEND, CALL-P-SRET, and I-IRET structures (P for the program pointer and I for the interrupt pointer). The pointers and subroutines, interrupt pointers, and interrupt subroutines of the CALL instruction should be placed after the FEND instruction. The subroutine called by the CALL instruction must end with the subroutine return instruction SRET. The interrupt subroutine must end with the interrupt return instruction IRET.

5, watchdog timer refresh command WDT

If the scan time (from step 0 to END or FEND) exceeds 100ms, Mitsubishi PLC will stop running. In this case, the watchdog timer should be refreshed by inserting the WDT instruction into the appropriate program step (scan time not exceeding 100ms).

6, loop start instruction FOR and loop end instruction NEXT

The program between FOR~NEXT is executed n times (specified by the operand) and then executed after the NEXT instruction. The number of cycles n ranges from 1 to 32767. If the value of n ranges from -32767 to 0, the number of loops is processed as 1.

FOR and NEXT always appear in pairs, and should be FOR before and NEXT after. The FOR~NEXT loop instruction can be nested up to 5 levels.

The FOR~NEXT loop body can be jumped out using the CJ instruction.

Lighting Tower

LED or Metal Halide Lamp Lighting Tower Feature:


The SWT lighting tower is an economical lighting device which easy operate, compact, high performance, and affordable. This series of light tower use a number of advanced and innovative technologies:

1. The control panel is simple with the common configuration: timer, emergency stop button, general alarm light, start switch, light pole control switch and lighting control switch. The power output adopts standard quick insertion output mode, and operation is simple and convenient;

2. Four large-capacity batteries, the lighting system can be powered without the generator set if power sufficiently.

3. The Diesel Generator set is equipped with Kubota or Perkisn Series engine with high quality control system.

4. More humanized maintenance design, all maintenance points are unimpeded ;

5. LED or Metal Halide Lamp lighting system, energy conservation, environmental protection;

6. High-standard mold forming process for all tanks;

7. Internal wiring harness adopts fast plug-in connection mode;

8. Light tower adopts mobile trailer design. Short distance transportation can be directly operated by using tractor-assisted, convenient, fast and efficient;

9. Using anti-rust material, and with high-temperature baking paint process surface, effectively reduce noise up to 15db or more;

10. Using hydraulic power to drive lamp post , and making the unit easy to operate.

11. Four supporting legs install light tower, which can make the installation and dismantling process easily.

Light Tower Genset,Light Tower Genset,Light Power Generator,Lighting Tower Generator

Guangdong Superwatt Power Equipment Co., Ltd , https://www.swtgenset.com

Posted on