Function instructions, also known as special instructions, are an essential part of the CPM1A series PLC programming. These commands are designed to handle more complex operations such as program control, data manipulation, and arithmetic calculations. Unlike basic instructions, function instructions do not have a direct key on simple programmers. Instead, each instruction is assigned a two-digit function code, which must be entered by pressing the "FUN" key followed by the corresponding code. Below are some commonly used function instructions and their detailed descriptions:
1. NOP (00) - No Operation Instruction This instruction does not perform any logical operation. It is often used during debugging to insert placeholders in the program or to adjust the scan time. Since it doesn't use any relay or operand, it's a simple yet powerful tool for fine-tuning programs.
2. END (01) - End Instruction The END instruction marks the end of the user program. It doesn't require any operands and should be placed at the end of the program. When the PLC encounters this instruction, it stops executing the program and moves to the output refresh phase. If the END instruction is missing, an error message like “NO END INSET†will appear. Adding the END instruction ensures the PLC runs properly. It can also be used to divide the program into segments for easier debugging.
3. IL (02) - Interlock Instruction and ILC (03) - Interlock Clear Instruction These two instructions work together to create a branch in the ladder logic. The IL instruction starts an interlock block, while the ILC ends it. They are used to control a specific section of the ladder diagram based on certain conditions. If the condition for IL is ON, the block is executed; if OFF, the block is skipped, and all relays within it are turned off. However, counters, shift registers, and hold relays retain their values. IL and ILC must be used in pairs to avoid errors.
4. JMP (04) - Jump Start Instruction and JME (05) - Jump End Instruction These instructions define a program jump segment. When the condition for JMP is ON, the program executes normally. If the condition is OFF, the program skips the block between JMP and JME and continues from the next instruction. During the jump, output relays remain in their current state, and timers/counts maintain their values. Like IL and ILC, JMP and JME must be used together to prevent errors.
5. SFT (10) - Bit-by-bit Shift Instruction Also known as the shift register instruction, SFT allows data to be shifted through a range of channels. It has two operands: D1 (the starting channel) and D2 (the ending channel). This instruction is useful for implementing serial data processing. The shift occurs when the clock signal transitions from OFF to ON. The lowest bit is filled with new input, and the highest bit is lost. If the reset input is ON, all data in the shift register is cleared. Multiple channels can be connected for longer shifts, but they must be in the same relay area and ordered correctly.
6. KEEP (11) - Latch Instruction This instruction is used to maintain the state of a relay. It works similarly to a latch, where the relay remains ON once set, even after the condition that triggered it turns OFF. To reset it, the R terminal must be activated. The KEEP instruction is typically used for self-locking circuits. If both SET and RESET conditions are ON, the relay is turned OFF first. The order of programming is important: set line, reset line, then the KEEP relay.
7. DIFU (13) - Rising Edge Differential Pulse and DIFD (14) - Falling Edge Differential Pulse These instructions generate a single scan pulse when a rising or falling edge is detected on an input. DIFU activates the specified relay after one scan cycle on the rising edge, while DIFD does the same on the falling edge. These are useful for detecting short pulses and triggering actions based on changes in input signals.
Mark4 V2 Mark4 7inch 295mm / 8inch 367mm / 9inch 387mm / 10inch 427mm 3K Full Carbon Fiber TrueX Frame for FPV Camera Kit Done:



Carbon Fiber FPV Drone Frame,FPV Drone TrueX Frame,Carbon Fiber FPV Frame
Jiangsu Yunbo Intelligent Technology Co., Ltd , https://www.fmodel-ai.com