Omron PLC (CPM1A) function command - Solutions - Huaqiang Electronic Network

Photocoupler

Function instructions are also called special instructions. The function instructions provided by Omron CPM1A series plc are mainly used to implement program control, data processing and arithmetic operations. Such instructions generally do not have a corresponding command key on the simple programmer, but a function code is specified for each instruction, represented by two digits. When entering such an instruction, first press the "FUN" button and then press the corresponding code. Some commonly used function instructions are described below.
1. Null operation command NOP (0 0)
This instruction does not perform any logic operation, so it is called empty operation, no relay is used, and no operand is required. This instruction applies an address in the program to insert instructions when debugging a program, and can also be used to fine tune the scan time.
2. End command END (01)
This instruction is used alone, does not require an operand, and is the last instruction of the program, indicating that the program ends here. When the PLC executes the user program, it stops executing the program phase when it executes the END instruction, and transfers to the execution output refresh phase. If the END instruction is omitted from the program, the error signal will be displayed when the programmer is executed: “NO END INSET”: The PLC can operate normally after the END command is added. This instruction can also be used to segment the debugger.
3. Interlock instruction IL(02) and interlock clear command ILC(0 3)
These two instructions have no operands. The IL instruction is an interlock condition, forming a branch circuit, that is, a new bus for use with the LD instruction, indicating the start of the interlock block; and the ILC instruction indicates the end of the interlock block.
The interlock command IL and the interlock clear command ILC are used to form a new bus at the branch of the ladder diagram, so that a certain portion of the ladder diagram is controlled by certain conditions. The IL and ILC instructions should be used in pairs, otherwise an error occurs. The function of the IL/ILC instruction is to execute an interlock instruction if the condition for controlling IL is established (ie, ON). If the condition for controlling IL is not established (ie, OFF), the interlock block between IL and ILC is not executed, that is, all relays between IL/ILC are OFF, and all timers will be reset, but all The counter, shift register and hold relay maintain the current value.
4. Jump start instruction JMP (0 4) and jump end instruction JME (0 5)
These two instructions do not have an operand, the JMP instruction indicates the start of the program transfer, and the JME instruction indicates the end of the program transfer.
The JMP/JME instruction set is used to control the program branch. When the JMP condition is OFF, the program goes to execute the first instruction after the JME; when the JMP condition is ON, the entire ladder diagram is executed in order, as if the JMP/JME instruction does not exist.
Note that when using JMP/JME instructions, if the JMP condition is OFF, the relay status between JMP/JME is: the output relay remains in the current state; the timer/counter and shift register maintain the current value. In addition, JMP/JME instructions should be paired, otherwise the PLC will display an error.
5. Bit-by-bit shift instruction SFT(10)
Also known as the shift register instruction, this instruction has two operands, in units of channels, the first operand is the first channel number D1, and the second operand is the last channel number D2. The relays used are: 000CH~019CH, 200CH~252CH, HR00~HR19. Its function is equivalent to a serial input shift register.
The shift register has a data input (IN), a shift clock (CP), and a reset (R), which must be programmed in the order of input (IN), clock (CP), reset (R), and SFT instructions. When the shift clock is turned from OFF to ON, the contents of the (D1~D2) channel are shifted by one bit from the low order to the high order, the highest bit overflow is lost, and the lowest bit is filled by the input data. When the reset input is ON, all channel data participating in the shift is reset, that is, both are OFF.
If more than 16 bits of data are needed for shifting, several channel levels can be connected.
Note that the shift command must be used when it is used: the start channel and the end channel must be in the same relay and the start channel number ≤ end channel number.
6. Latch instruction KEEP(11)
The operands used in this instruction are: 01000~01915, 20000~25515, HR0000~HR1915. Its function is equivalent to the latch. When the set terminal (S terminal) condition is ON, the KEEP relay remains ON, even if S When the terminal condition is OFF, the KEEP relay is also kept ON, and it is turned OFF until the reset terminal (R terminal) condition is ON. The KEEP command is mainly used for coil retention, that is, the relay's self-locking circuit can be used with the KEEP command. achieve. If both the SET and RES terminals are ON, the KEEP relay will be turned OFF first. The latch relay instruction must be programmed in the order of the set line (S terminal), reset line (R terminal) and KEEP relay.
7. Leading edge differential pulse command DIFU (13) and trailing edge differential pulse command DIFD (14)
The operands used in this instruction are: 01000~01915, 20000~25515, HR0000~HR1915. The function of DIFU is to release the specified relay after one scan period on the front (rising) edge of the input pulse, and the function of DIFD is The trailing (falling) edge of the input pulse causes the specified relay to turn on after one scan cycle.
8. Fast Timer Instruction TIMH(15)
The operand of this instruction occupies two lines, one is the timer number 000~127 (do not reuse the same number with TIM or CNT), and the other behavior sets the time. The set timing time can be constant or determined by the contents of channels 000CH~019CH, 20000CH~25515CH, HR0000~HR1915, but must be four-digit BCD code. The function is similar to the normal timer in the basic instruction. The only difference is that the timing accuracy of TIMH is 0.01 s, and the timing range is 0~99.99 s.
9. Channel shift instruction WSFT(16)
Also known as a word shift instruction, this instruction is a serial shift in units of words (channels). The operand is the first channel number D1 and the last channel number D2. Available as 000CH~019CH, 200CH~252CH, HR00~HR19. When the channel shift instruction is executed, when the shift condition is ON, the WSFT moves one word from the first channel to the last channel, and the original 16-bit contents of the first channel are all reset, and the 16-bit contents in the original channel are all removed and lost.
Note that the WSFT instruction must be used when the first channel and the last channel must be the same type of relay; the first channel number ≤ the last channel number.
When the shift condition is ON, the CPU executes the WSFT instruction every time the program is scanned. If the program is executed once, you should use a differential instruction.
10. Reversible Counter Instruction CNTR(12)
The function of this instruction is to add or subtract 1 to the external signal. With two operands: counter number 000~127, the set value range is 0000~9999, the set value can be constant, or the channel number can be used. When the channel number is used, the set value is the content in the channel.
11. Compare instruction CMP(20)
The function of this instruction is to compare the content of S (source channel) with the content of D (target channel), and the comparison result is sent to PLC internal dedicated relays 25505, 05506, 25507 for processing and output. The output status is shown in the table. 4-9.
Table 4-9 Comparison result output dedicated relay status table
SMR255052550625507
S>DONOFFOFF
S=DOFFONOFF
S, DOFFOFFON
The comparison command CMP is used to compare the channel data S with a hexadecimal number or a four-bit constant in another channel data D, at least one of which is channel data.
12. Data transfer instruction MOV (21) and data negation transfer instruction MOVN (22)
Both instructions are used for the transfer of data. When the state before the MOV is 0N, the MOV instruction is executed, and the source data in S is transferred to the channel designated by the target D in each scan cycle. When the state before the MOV is 0FF, the MOVN instruction is executed, and the source data in S is negated in each scan cycle and then transmitted to the channel specified by the target D. After the transfer instruction is executed, if the content in the target channel D is all zero, the flag bit 25506 is turned ON.
13. Position bit instruction STC (40) and carry reset bit instruction CLC (41)
The function of these two instructions is to set the carry flag relay 25504 (ie, turn ON) or to force reset the carry flag relay 25504 (ie, turn OFF). When the status of the two instructions is ON, the instruction is executed, otherwise it is not executed. Usually, before performing the add and subtract operations, the CLC instruction is executed to clear the bit to ensure the correct result.
14. Add instruction ADD(30) This instruction adds the contents of two channels or the contents of one channel to a constant (with carry bit) and sends the result to destination channel D. The contents of the operand S1, the addend S2, and the operation result D in the operand are shown in Table 4-10.
Table 4-10 Operand contents of the add instruction
S1/S2000~019CH200~231CHHR00~HR19TIM/CNT000~127DM0000~1023
DM6144~6655 four-bit constant
D010~019CH200~231CHHR00~HR19-DM0000~1023—
Note: DM6144~6655 cannot be written by program (can only be set by peripheral device)
Note: Before performing the addition operation, a clear carry flag instruction CLC (41) must be added to participate in the operation; the addend and addend must be BCD numbers, otherwise 25503 is turned ON, the ADD instruction is not executed; if the result has a carry, then The carry flag relay 25504 is ON; if the sum is zero, the dedicated relay 25506 is turned ON.
15. Subtraction instruction SUB(31)
This instruction is similar to the ADD instruction in that two four-bit BCD numbers are subtracted by borrowing, and the difference is sent to the specified channel, and its operand is the same as the ADD instruction. When writing the SUB instruction language, you must specify the number of the subtracted, subtracted, and difference storage channels. Note: You must add a clear bit instruction CLC (41) before performing the subtraction; the subtracted and subtracted must be BCD number, otherwise 25503 is turned ON, the SUB instruction is not executed; if the operation result has a borrow, the carry flag relay 25504 is ON; if the operation result is zero, the dedicated relay 25506 is turned ON.
The above introduction is some commonly used special instructions of CPM1A series PLC, and some are not introduced. In addition to the basic instructions and CPM1A series PLC, C200H series PLC has the same function instructions. In addition, some function instructions are added, and readers can change according to different The model PLC can be learned and mastered by referring to the user manual according to its function.

Vehicle Diagnostic Cables

We make OBD connector with terminal by ourselves, soldering type and crimping type are both available. Also 12V and 24V type. OBD1, OB2, J1939, J1708, J1962, etc. Also molded by different type, straight type or right-angle type. The OBD connector cables used for Audi, Honda, Toyota, BWM, etc. We have wide range of materials source , also we can support customers to make a customized one to replace the original ones.

Vehicle Diagnostic Cables,Diagnostic OBD Cable,OBD2 Splitter Y Cables,OBD2 Diagnostic Adapters,OBD Heavy Vehicle Cables

ETOP WIREHARNESS LIMITED , https://www.oemmoldedcables.com