Application Instruction Comparison by Manufacturer (Mitsubishi iQ-R / KEYENCE KV / OMRON CS/CJ)
A cross-reference table that lines up, by function, the application instructions of the Mitsubishi Electric MELSEC iQ-R, KEYENCE KV series and OMRON CS/CJ series. Use it as a reference when migrating models or reading another manufacturer's PLC programs. For the meaning of the symbols, see the legend at the end of the page.
Comparison
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Comparison contacts (BIN 16/32-bit) | LD□(_U) AND□(_U) OR□(_U) LDD□(_U) ANDD□(_U) ORD□(_U) | LD□/AND□/OR□(.U/.S/.D/.L) | LD□/AND□/OR□ (S/L/SL) | □ is =,<>,>,<=,<,>=. OMRON: no suffix = unsigned, S = signed, L = double length. Mitsubishi: no suffix = signed, _U = unsigned |
| Comparison contacts (real) | LDE□ ANDE□ ORE□ LDED□ ANDED□ ORED□ | LD□/AND□/OR□(.F/.DF) | LD□F/AND□F/OR□F LD□D/AND□D/OR□D | |
| Comparison contacts (string) | LD$□ AND$□ OR$□ | SCMP | LD□$/AND□$/OR□$ | KV's SCMP is not a contact type; it outputs the comparison result to arithmetic flags (CR2010 etc.) |
| Comparison contacts (date/time) | LDDT□ ANDDT□ ORDT□ LDTM□ ANDTM□ ORTM□ | — | LD□DT/AND□DT/OR□DT | |
| Calendar / weekly contacts (period specified) | — | LDCAL ANDCAL ORCAL LDCALB ANDCALB ORCALB LDWK ANDWK ORWK LDWKB ANDWKB ORWKB | — | Contacts that turn ON/OFF within a specified range of dates, days of the week or times |
| Data comparison (bit output of result) | CMP(P)(_U) DCMP(P)(_U) | CMP(.U/.S/.D/.L)R | CMP CMPL CPS CPSL | Different outputs: Mitsubishi = 3 specified bits, KV = arithmetic flags (CR), OMRON = condition flags |
| Band (zone) comparison | ZCP(P)(_U) DZCP(P)(_U) | ZCMP(.U/.S/.D/.L)R | ZCP ZCPL ZCPS ZCPSL | |
| Block data comparison (between 2 blocks) | BKCMP□(P)(_U) DBKCMP□(P)(_U) | BCMP(.S/.D/.L) | MCMP | OMRON's MCMP only compares 16 words for equality |
| Batch comparison of one value against a block | BKCMP□(P)(_U) | BCMPI(.S/.D/.L) | TCMP | Mitsubishi achieves this by specifying a constant for (s1) of BKCMP. OMRON's TCMP compares for equality with 16 words |
| Range comparison against an upper/lower limit table | — | — | BCMP BCMP2 | OMRON's BCMP has the same name as KV's BCMP but a different function |
| Consecutive bit data comparison | — | BBCMP | — |
Arithmetic
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| BIN addition | +(P)(_U) D+(P)(_U) | ADD(.U/.S/.D/.L)R CAL+(.U/.S/.D/.L) | + +L | KV's ADD uses the internal register method; CAL+ uses 3 operands. Mitsubishi supports both 2 and 3 operands |
| BIN subtraction | -(P)(_U) D-(P)(_U) | SUB(.U/.S/.D/.L)R CAL-(.U/.S/.D/.L) | - -L | |
| BIN multiplication | *(P)(_U) D*(P)(_U) | MUL(.U/.S/.D/.L)R CAL*(.U/.S/.D/.L) | * *L *U *UL | OMRON: no suffix = signed, U = unsigned |
| BIN division | /(P)(_U) D/(P)(_U) | DIV(.U/.S/.D/.L)R CAL/(.U/.S/.D/.L) | / /L /U /UL | |
| BIN addition/subtraction with carry | — | — | +C +CL -C -CL | |
| Increment (+1) | INC(P)(_U) DINC(P)(_U) | INC(.U/.S/.D/.L) | ++ ++L | |
| Decrement (-1) | DEC(P)(_U) DDEC(P)(_U) | DEC(.U/.S/.D/.L) | -- --L | |
| Block data addition/subtraction | BK+(P)(_U) BK-(P)(_U) DBK+(P)(_U) DBK-(P)(_U) | — | — | |
| Sign inversion (two's complement) | NEG(P) DNEG(P) | NEG(.U/.S/.D/.L)R | NEG NEGL | |
| Absolute value | — | ABS(.L)R | — | Mitsubishi supports this with a general-purpose FUN (ABS) (outside the scope of this table) |
| BIN square root | SQRT(P) DSQRT(P) | ROOT(.U/.S/.D/.L)R | ROTB | |
| BIN exponentiation | — | POW(.S/.D/.L)R | — |
BCD arithmetic
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| BCD addition | B+(P) DB+(P) | — | +B +BL | KV has no BCD arithmetic instructions (convert with TBIN/TBCD, then calculate) |
| BCD subtraction | B-(P) DB-(P) | — | -B -BL | |
| BCD addition/subtraction with carry | — | — | +BC +BCL -BC -BCL | |
| BCD multiplication | B*(P) DB*(P) | — | *B *BL | |
| BCD division | B/(P) DB/(P) | — | /B /BL | |
| BCD increment / decrement | — | — | ++B ++BL --B --BL | |
| BCD square root | BSQRT(P) BDSQRT(P) | — | ROOT | OMRON's ROOT is BCD; KV's ROOT is BIN/real |
| BCD trigonometric functions | BSIN(P) BCOS(P) BTAN(P) BASIN(P) BACOS(P) BATAN(P) | — | — | |
| Floating-point division (BCD) | — | — | FDIV |
Logical operations
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Logical AND | WAND(P) DAND(P) | ANDA(.U/.D)R CAL&(.U/.D) | ANDW ANDL | |
| Logical OR | WOR(P) DOR(P) | ORA(.U/.D)R CAL|(.U/.D) | ORW ORWL | |
| Exclusive OR (XOR) | WXOR(P) DXOR(P) | EORA(.U/.D)R CAL^(.U/.D) | XORW XORL | |
| Exclusive NOR (XNOR) | WXNR(P) DXNR(P) | ENRA(.U/.D)R | XNRW XNRL | |
| Block data logical operations | BKAND(P) BKOR(P) BKXOR(P) BKXNR(P) | — | — | |
| Bit inversion (same device) | — | COM(.U/.D)R | COM COML | Mitsubishi achieves this by specifying the same device as source and destination for CML |
| Inverted transfer (transfer with bits inverted) | CML(P) DCML(P) | CAL~(.U/.D) | MVN MVNL | |
| 1-bit inverted transfer | CMLB(P) | — | — |
Bit processing
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Set/reset a bit in a word device | BSET(P) BRST(P) | BSET BRES | SETB RSTB | KV's BSET/BRES are basic instructions (bit output instructions) |
| Test a specified bit in a word | TEST(P) DTEST(P) BON(P) DBON(P) | BLD BLDB BAND BANB BOR BORB | TST TSTN | KV/OMRON use contact types. KV's BLD etc. are basic instructions |
| Batch reset of a range | BKRST(P) | ZRES | RSTA | On Mitsubishi, batch-clear words with FMOV |
| Batch set of a range | — | — | SETA | |
| Count ON bits | SUM(P) DSUM(P) | BCNT(.U/.D)R | BCNT | On Mitsubishi the instruction name is SUM (bit check) |
Shift and rotation
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Shift right n bits within a word | SFR(P) | SRA(.U/.D)R CAL>>(.U/.S/.D/.L) | NASR NSRL ASR ASRL | OMRON's ASR/ASRL shift by a fixed 1 bit |
| Shift left n bits within a word | SFL(P) | SLA(.U/.D)R CAL<<(.U/.S/.D/.L) | NASL NSLL ASL ASLL | OMRON's ASL/ASLL shift by a fixed 1 bit |
| Arithmetic shift (sign preserved) | — | ASRA(.S/.D/.L)R ASLA(.S/.D/.L)R | — | |
| Digit (4-bit) shift | — | — | SLD SRD | |
| Shift register (input signal capture type) | SFT(P) | SFT | SFT SFTR ASFT | Mitsubishi's SFT is a sequence instruction (bit device shift) |
| Bit shift of n-bit data (right) | BSFR(P) SFTBR(P) | BSR(.U/.D) | NSFR | |
| Bit shift of n-bit data (left) | BSFL(P) SFTBL(P) | BSL(.U/.D) | NSFL | |
| Word (block) shift (right) | DSFR(P) SFTWR(P) DDSFR(P) SFTDWR(P) | WSR(.U/.D) | WSFT | OMRON's WSFT shifts toward higher words in 1-word units |
| Word (block) shift (left) | DSFL(P) SFTWL(P) DDSFL(P) SFTDWL(P) | WSL(.U/.D) | — | |
| Shift of real number data | ESFR(P) ESFL(P) EDSFR(P) EDSFL(P) SFTER(P) SFTEL(P) SFTEDR(P) SFTEDL(P) | — | — | |
| Rotate right (without carry) | ROR(P) DROR(P) | RRNCA(.U/.D)R | RRNC RRNL | OMRON rotates by a fixed 1 bit |
| Rotate left (without carry) | ROL(P) DROL(P) | RLNCA(.U/.D)R | RLNC RLNL | OMRON rotates by a fixed 1 bit |
| Rotate right (with carry) | RCR(P) DRCR(P) | RRA(.U/.D)R | ROR RORL | Same name, different meaning: OMRON's ROR/ROL include carry, Mitsubishi's ROR/ROL do not |
| Rotate left (with carry) | RCL(P) DRCL(P) | RLA(.U/.D)R | ROL ROLL | Same as above |
Data conversion
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| BIN → BCD conversion | BCD(P) DBCD(P) | TBCD(.U/.D)R | BCD BCDL | |
| BCD → BIN conversion | BIN(P) DBIN(P) | TBIN(.U/.D)R | BIN BINL | |
| Signed BIN ⇔ BCD conversion | — | — | BCDS BDSL BINS BISL | |
| Block BIN ⇔ BCD conversion | BKBCD(P) BKBIN(P) | — | — | |
| Integer type conversion (signed/unsigned, 16/32-bit) | INT2UINT(P) INT2DINT(P) INT2UDINT(P) UINT2INT(P) UINT2DINT(P) UINT2UDINT(P) DINT2INT(P) DINT2UINT(P) DINT2UDINT(P) UDINT2INT(P) UDINT2UINT(P) UDINT2DINT(P) | EXT(.S/.U/.D/.L)R | SIGN | KV can also convert automatically via suffixes. EXT/SIGN extend 16 → 32 bits |
| BIN → real conversion | INT2FLT(P) UINT2FLT(P) DINT2FLT(P) UDINT2FLT(P) INT2DBL(P) UINT2DBL(P) DINT2DBL(P) UDINT2DBL(P) | FLOAT(.S/.D/.L/.U)R DFLOAT(.S/.D/.L)R | FLT FLTL DBL DBLL | |
| Real → BIN conversion | FLT2INT(P) FLT2UINT(P) FLT2DINT(P) FLT2UDINT(P) DBL2INT(P) DBL2UINT(P) DBL2DINT(P) DBL2UDINT(P) | INTG(.U/.S/.D/.L)R ROUND(.S/.D/.L)R DINTG(.S/.D/.L)R DROUND(.S/.D/.L)R | FIX FIXL FIXD FIXLD | Rounding differs: Mitsubishi = round half up; KV: INTG = truncate / ROUND = round half up |
| Single ⇔ double precision real conversion | FLT2DBL(P) DBL2FLT(P) | FTODFR DFTOFR | — | |
| BIN → Gray code conversion | GRY(P)(_U) DGRY(P)(_U) | GRY(.U/.D)R | BIN_GRAY BIN_GRAYL | |
| Gray code → BIN conversion | GBIN(P)(_U) DGBIN(P)(_U) | RGRY(.U/.D)R | GRAY_BIN GRAY_BINL GRY | OMRON's GRY converts Gray code → BIN/BCD/angle |
| BIN → decimal ASCII conversion | BINDA(P)(_U) DBINDA(P)(_U) | DASC(.U/.S/.D/.L) | — | |
| Decimal ASCII → BIN conversion | DABIN(P)(_U) DDABIN(P)(_U) | RDASC(.U/.S/.D/.L) | — | |
| BIN → hexadecimal ASCII conversion | BINHA(P) DBINHA(P) INT2ASC(P) | ASC(.U)R HASC(.U/.D) | ASC STR4 STR8 STR16 | |
| Hexadecimal ASCII → BIN conversion | HABIN(P) DHABIN(P) ASC2INT(P) | RASC(.U)R RHASC(.U/.D) | HEX NUM4 NUM8 NUM16 | |
| BCD ⇔ decimal ASCII conversion | BCDDA(P) DBCDDA(P) DABCD(P) DDABCD(P) | — | — | |
| BIN → string conversion (with decimal point position) | STR(P)(_U) DSTR(P)(_U) | — | — | |
| String → BIN conversion (with decimal point position) | VAL(P)(_U) DVAL(P)(_U) | — | — | |
| Real → string conversion | ESTR(P) | FASC | FSTR | |
| String → real conversion | EVAL(P) | RFASC | FVAL | |
| Split / combine real mantissa and exponent | EMOD(P) EREXP(P) | DISF UNIF | — | Mitsubishi uses BCD format; KV uses binary mantissa and exponent |
| Decode | DECO(P) | DECOR MPXR | MLPX | |
| Encode | ENCO(P) | ENCOR DMXR | DMPX | |
| 7-segment decode | SEG(P) | SEG(.U/.D)R | SDEC | |
| Split / combine in 4-bit units | DIS(P) UNI(P) | DISN(.U/.D) UNIN(.U/.D) | — | |
| Split / combine an arbitrary number of bits | NDIS(P) NUNI(P) | — | — | |
| Split / combine in byte units | WTOB(P) BTOW(P) | DISB(.U/.D) UNIB(.U/.D) | — | |
| Bit row ⇔ bit column conversion | — | — | LINE COLM | |
| Unicode ⇔ Shift-JIS conversion | WS2SJIS(P) SJIS2WS(P) SJIS2WSB(P) | — | — |
Data transfer
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Data transfer | MOV(P) DMOV(P) | MOV(.U/.S/.D/.L) DW(.U/.S/.D/.L) | MOV MOVL | KV's DW is for storing constants only |
| Digit (4-bit) transfer | SMOV(P) | — | MOVD | |
| Block transfer | BMOV(P) BMOVL(P) | BMOV(.U/.D) | XFER | |
| Batch transfer of the same data (fill) | FMOV(P) FMOVL(P) DFMOV(P) DFMOVL(P) | FMOV(.U/.S/.D/.L) | BSET | OMRON's BSET is block set (Mitsubishi's BSET is bit set) |
| Data exchange | XCH(P) DXCH(P) | XCH(.U/.D) | XCHG XCGL | |
| Block data exchange | BXCH(P) | — | — | |
| Swap upper and lower bytes | SWAP(P) DSWAP(P) | SWAP(.U/.D)R BSWAP | SWAP | KV's BSWAP and OMRON's SWAP swap multiple words at once |
| 1-bit transfer | MOVB(P) | — | MOVB | |
| Multiple-bit transfer | BLKMOVB(P) | BBMOV PMOV(.U/.D) | XFRB | |
| Transfer with offset (distribute / extract) | — | — | DIST COLL | Mitsubishi and KV achieve this with index modification |
| Byte-order swap transfer | — | BYBMOV BYLMOV | — | |
| Transfer to/from internal register | — | LDA(.U/.S/.D/.L/.F/.DF)R STA(.U/.S/.D/.L/.F/.DF)R PLDA(.U/.D)R PSTA(.U/.D)R | — | KV-specific (used together with internal register method instructions) |
| Read digital trimmer value | — | TMINR | — |
Program control
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Jump | CJ SCJ JMP | CJ NCJ SCJ GOTO LABEL | JMP JME CJP CJPN JMP0 JME0 | OMRON classifies jump instructions as sequence control instructions |
| Jump to END (end of program) / early exit | GOEND | RETURN | — | |
| Subroutine call and return | CALL(P) RET FCALL(P) XCALL | CALL SBN RET | SBS SBN RET | |
| Global (inter-program) subroutines | ECALL(P) EFCALL(P) | ECALL | GSBS GSBN GRET | |
| Macro call | — | MCALL MSTRT MEND | MCRO | |
| Loop (FOR to NEXT) | FOR NEXT | FOR(.U/.D) NEXT | FOR NEXT | |
| Forced loop exit | BREAK(P) | BREAK | BREAK | |
| Disable / enable interrupts | DI EI IMASK SIMASK | DI EI DIC | DI EI MSKS MSKR CLI | OMRON's DI/EI disable / re-enable execution of interrupt tasks |
| Return from interrupt program | IRET | INT RETI | — | OMRON uses interrupt tasks, so there is no return instruction |
| Watchdog (cycle monitoring) | WDT(P) | — | WDT | Mitsubishi resets the WDT; OMRON extends the monitoring time |
| Execute / stop programs (tasks, modules) | PSTOP(P) POFF(P) PSCAN(P) | MDSTRT MDSTOP | TKON TKOF | |
| Step progression (steps / stages) | — | STP STE STG JMP ENDS W-ON W-OFF W-UE W-DE | STEP SNXT | Mitsubishi supports this with SFC (outside the scope of this table) |
| Block programs (IF/WAIT/LOOP etc.) | — | — | BPRG BEND BPPS BPRS IF ELSE IEND WAIT LOOP LEND EXIT TIMW TIMWX CNTW CNTWX TMHW TMHWX | |
| Function block / function calls | — | FB FEND FUN FBCALL FBSTRT | — | Mitsubishi calls FBs/FUNs via labels (no instruction) |
Table processing
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| FIFO / LIFO write | FIFW(P) | FIFOW(.U/.D) LIFOW(.U/.D) | SSET PUSH | On OMRON, set the stack area with SSET before use |
| FIFO read (first in, first out) | FIFR(P) | FIFOR(.U/.D) | FIFO | |
| LIFO read (last in, first out) | FPOP(P) | LIFOR(.U/.D) | LIFO | |
| Insert data into a table | FINS(P) | FINS(.U/.D) | SINS | |
| Delete data from a table | FDEL(P) | FDEL(.U/.D) | SDEL | |
| Read / overwrite table data | — | FWRIT(.U/.D) | SNUM SREAD SWRIT | |
| Record-type table operations | — | — | DIM SETR GETR |
Data processing
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Data search | SERDATA(P) DSERDATA(P) | SER(.U/.D)R DSER(.U/.D) | SRCH | |
| Count matching data | — | DCNT(.U/.D)R | — | Mitsubishi's SERDATA also outputs the number of matches |
| Simultaneous search for minimum, identical and maximum values | SERMM(P) DSERMM(P) | — | — | |
| Record search | — | — | RSRCH RSRCH2 RSRCH4 | |
| Maximum value search | MAX(P)(_U) DMAX(P)(_U) EMAX(P) EDMAX(P) | MAX(.U/.S/.D/.L/.F/.DF)R | MAX MAXL MAXF MAXD | Including real numbers |
| Minimum value search | MIN(P)(_U) DMIN(P)(_U) EMIN(P) EDMIN(P) | MIN(.U/.S/.D/.L/.F/.DF)R | MIN MINL MINF MIND | Including real numbers |
| Sort | SORTD(_U) DSORTD(_U) SORTTBL(_U) SORTTBL2(_U) DSORTTBL2(_U) | SORT(.U/.S/.D/.L) SORTN(.U/.S/.D/.L) | RSORT RSORT2 RSORT4 | |
| Sum calculation | WSUM(P)(_U) DWSUM(P)(_U) | WSUM(.U/.S/.D/.L/.F/.DF)R BSUMR | SUM | OMRON's SUM calculates a table sum (byte/word addition) |
| Average calculation | MEAN(P)(_U) DMEAN(P)(_U) | AVG(.U/.S/.D/.L/.F/.DF)R | AVG | OMRON's AVG is a moving average over a specified number of cycles |
| CRC calculation | CRC(P) | CRCR | — | |
| Check code (horizontal parity, sum) | CCD(P) | — | FCS | |
| Random number generation | RND(P) SRND(P) | RND | — |
Data control
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Upper/lower limit control | LIMIT(P)(_U) DLIMIT(P)(_U) | LIMIT(.U/.S/.D/.L) | LMT | |
| Dead band control | BAND(P)(_U) DBAND(P)(_U) | BANDC(.S/.L) | BAND | |
| Zone control | ZONE(P)(_U) DZONE(P)(_U) | ZONE(.S/.L) | ZONE | |
| Scaling / polyline approximation | SCL(P)(_U) DSCL(P)(_U) SCL2(P)(_U) DSCL2(P)(_U) | APR(.U/.S/.D/.L/.F/.DF) | SCL SCL2 SCL3 APR | |
| Ramp signal | RAMPQ | RAMP | — | |
| Lead-lag filter | — | LLFLT | — | |
| PID control | PID PIDINIT(P) PIDCONT(P) PIDSTOP(P) PIDRUN(P) PIDPRMW(P) S(P).PIDINIT S(P).PIDCONT S(P).PIDSTOP S(P).PIDRUN S(P).PIDPRMW | PID | PID | |
| PID with autotuning | — | PIDAT | PIDAT | Mitsubishi specifies autotuning in the control data of the PID instruction |
| Time-proportional output / PWM | PWM | TPOUT | TPO PWM | OMRON's PWM uses the built-in pulse output |
Floating point
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Real addition | E+(P) ED+(P) | ADD(.F/.DF)R CAL+(.F/.DF) | +F +D | |
| Real subtraction | E-(P) ED-(P) | SUB(.F/.DF)R CAL-(.F/.DF) | -F -D | |
| Real multiplication | E*(P) ED*(P) | MUL(.F/.DF)R CAL*(.F/.DF) | *F *D | |
| Real division | E/(P) ED/(P) | DIV(.F/.DF)R CAL/(.F/.DF) | /F /D | |
| Real comparison output | ECMP(P) EDCMP(P) | CMP(.F/.DF)R | — | OMRON uses comparison contacts (LD□F etc.) |
| Real band comparison | EZCP(P) EDZCP(P) | ZCMP(.F/.DF)R | — | |
| Real transfer | EMOV(P) EDMOV(P) | MOV(.F/.DF) | MOVF | |
| Real sign inversion | ENEG(P) EDNEG(P) | NEG(.F/.DF)R | — | |
| Real absolute value | — | ABS(.F/.DF)R | — | |
| Trigonometric functions (SIN/COS/TAN) | SIN(P) COS(P) TAN(P) SIND(P) COSD(P) TAND(P) | SIN(.F/.DF)R COS(.F/.DF)R TAN(.F/.DF)R | SIN COS TAN SIND COSD TAND SINQ COSQ TANQ | OMRON's SINQ etc. are high-speed versions |
| Inverse trigonometric functions | ASIN(P) ACOS(P) ATAN(P) ASIND(P) ACOSD(P) ATAND(P) | ASIN(.F/.DF)R ACOS(.F/.DF)R ATAN(.F/.DF)R ATAN2(.F/.DF)R | ASIN ACOS ATAN ASIND ACOSD ATAND | KV's ATAN2 calculates the angle from coordinates (X,Y) |
| Degrees → radians conversion | RAD(P) RADD(P) | RAD(.F/.DF)R | RAD RADD | |
| Radians → degrees conversion | DEG(P) DEGD(P) | DEG(.F/.DF)R | DEG DEGD | |
| Real square root | ESQRT(P) EDSQRT(P) | ROOT(.F/.DF)R | SQRT SQRTD | |
| Exponential | EXP(P) EXPD(P) | EXP(.F/.DF)R | EXP EXPD | |
| Natural logarithm | LOG(P) LOGD(P) | LOG(.F/.DF)R | LOG LOGD | |
| Common logarithm | LOG10(P) LOG10D(P) | LOG10(.DF)R | — | |
| Exponentiation | POW(P) POWD(P) | POW(.F/.DF)R | PWR PWRD |
String processing
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| String transfer | $MOV(P) $MOV(P)_WS | SMOV | MOV$ | |
| String concatenation | $+(P) | SADD | +$ | |
| String length detection | LEN(P) | LEN | LEN$ | |
| Extract from the right | RIGHT(P) | SRGHT | RGHT$ | |
| Extract from the left | LEFT(P) | SLEFT | LEFT$ | |
| Extract from any position | MIDR(P) | SMID | MID$ | |
| Replace at any position | MIDW(P) | SRPLC | RPLC$ | |
| String search | INSTR(P) | SFIND SFINDN | FIND$ | |
| String insertion | STRINS(P) | SINS | INS$ | |
| String deletion | STRDEL(P) | SDEL | DEL$ | |
| String exchange | — | — | XCHG$ | |
| String clear | — | — | CLR$ | |
| Trim leading/trailing spaces | — | STRIM | — | |
| String conversion between byte and word units | — | DISS UNIS | — | |
| Read device comment | — | RCOM | — |
Device operations
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Save / restore index registers | ZPUSH(P) ZPOP(P) | ZPUSH(.S/.L) ZPOP(.S/.L) | — | |
| Get and manipulate indirect addresses | ADRSET(P) | ADRSET ADRINC ADRDEC ADRADD(.S/.L) ADRSUB(.S/.L) | MOVR MOVRW | OMRON sets the actual address in an index register |
| File register (extended DM) bank switching | RSET(P) QDRSET(P) | FRSET | EMBC | |
| 1-byte read/write of file registers | ZRRDB(P) ZRWRB(P) | — | — | |
| Save / load file registers to/from memory card | — | FRSTM FRLDM | — | |
| Get variable size / number of array elements | — | ACNT WSIZE BSIZE | — |
Timers and counters
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Up/down counter (1-phase / 2-phase) | UDCNT1 UDCNT2 | — | — | KV's UDC is a basic instruction |
| Teaching timer / special function timer | TTMR STMR | — | — | |
| Pulse density measurement / fixed-cycle pulse output | SPD PLSY | — | SPED | On KV these are built-in function instructions (see the CPU user's manual) |
| Timing pulse generation | DUTY | — | — | |
| Time measurement / hour meter | TIMCHK HOURM | — | — | |
| Free-running counter update | — | RFSFRC | — | |
| Input time constant / interrupt edge setting | — | HSP IEDGE | — |
Special I/O
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Rotary table shortest-path control | ROTC | — | — | |
| Matrix input | MTR | — | MTR | |
| Key input (10-key / 16-key) | — | HKEY | TKY HKY | |
| Digital switch input | — | — | DSW | |
| 7-segment display output | — | — | 7SEG |
Clock
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Read clock data | DATERD(P) S(P).DATERD | — | — | KV refers to special devices (CM); OMRON refers to the Auxiliary Area (A351 onward) |
| Write clock data (set time) | DATEWR(P) | WTIME | DATE | |
| Clock data addition/subtraction | DATE+(P) DATE-(P) S(P).DATE+ S(P).DATE- | — | CADD CSUB | |
| Hours:minutes:seconds ⇔ seconds conversion | TIME2SEC(P) SEC2TIME(P) | — | SEC HMS | |
| Date/time ⇔ seconds conversion | DATE2SEC(P)(_U) SEC2DATE(P)(_U) | SEC RSEC | — | KV's SEC differs from OMRON's SEC (hours:minutes:seconds → seconds) |
| Time comparison output / time band comparison | TCMP(P) TZCP(P) | — | — | |
| ±30-second clock correction | — | AJST | — |
Unit access
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| I/O refresh | RFS(P) | RFSX RFSY | IORF | KV's RFSX/RFSY are basic instructions (direct I/O) |
| Unit / network refresh | COM(P) S(P).ZCOM | RFSCI RFSCO | FIORF DLNK | Mitsubishi's COM is selective refresh (KV's and OMRON's COM invert bits) |
| Read unit buffer memory | FROM(P) DFROM(P) FROMD(P) DFROMD(P) | UREAD(.U/.S/.D/.L/.F) | IORD | |
| Write unit buffer memory | TO(P) DTO(P) TOD(P) DTOD(P) | UWRIT(.U/.S/.D/.L/.F) UFILL(.U/.S/.D/.L/.F) | IOWR | |
| Read unit model / information | TYPERD(P) UNIINFRD(P) | IS_□□□ | — | KV determines the type of the specified unit |
| Allocate buffer memory | — | UMALLOC | — |
File operations
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| File read | SP.FREAD | MREAD MREADL | FREAD | |
| File write | SP.FWRITE | MWRIT MPRINT | FWRIT TWRIT | OMRON's TWRIT writes text (CSV etc.) |
| File delete | SP.FDELETE | MDEL | — | |
| File copy | SP.FCOPY | MCOPY | — | |
| File move | SP.FMOVE | MMOV | — | |
| File rename | SP.FRENAME | MREN | — | |
| Get file status | SP.FSTATUS | MSTAT | — | |
| Create / delete folder | — | MMKDIR MRMDIR | — | |
| Get free space | — | MFREE MFREEK | — | |
| Read / write to data memory | S(P).DEVLD SP.DEVST | — | — |
Communication
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Socket communication (TCP/UDP) | SP.SOCOPEN SP.SOCCLOSE SP.SOCRCV S.SOCRCVS SP.SOCSND SP.SOCCINF SP.SOCCSET SP.SOCRMODE S(P).SOCRDATA | — | — | KV supports this with unit-specific instructions (U_SOPEN etc.) (outside the scope of this table) |
| Send message to other station (SLMP/FINS) | SP.SLMPSND | — | SEND SEND2 RECV RECV2 CMND CMND2 | |
| Execute registered protocol / protocol macro | SP.ECPRTCL | — | PMCR PMCR2 | |
| Serial port send/receive | — | — | TXD RXD TXDU RXDU STUP | Mitsubishi and KV support this with unit-specific instructions (outside the scope of this table) |
| CIP (EtherNet/IP) messages | — | CPMSET CPMGET CPSASC RCPSASC | EXPLT EGATR ESATR ECHRD ECHWR | |
| FTP client | SP.FTPPUT SP.FTPGET | — | — |
Diagnostics and debugging
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Reset error display / alarm | LEDR | ARES | — | |
| Non-fatal error (user-defined) | PALERT(P) | — | FAL | |
| Fatal error (user-defined) | PABORT | — | FALS | |
| Failure point detection | — | — | FPD | |
| Trace memory sampling | — | — | TRSM |
Other
| Functions | Mitsubishi MELSEC iQ-R | KEYENCE KV | OMRON CS/CJ | Remarks |
|---|---|---|---|---|
| Message display | — | AWNUM AWMSG AWSHOW AWHIDE | MSG | KV displays it on the Access Window |
| Memory switch setting | — | MEMSW | — | |
| Set / clear carry flag | — | — | STC CLC | |
| Save / restore condition flags | — | — | CCS CCL | |
| Disable / enable peripheral servicing | — | — | IOSP IORS | |
| CV ⇔ CS address conversion | — | — | FRMCV TOCV |
No matching instructions found.
Legend
| — | No corresponding instruction (within the scope of this page) |
|---|---|
| Mitsubishi (P) | When appended, the instruction becomes pulse (rising edge) execution type. e.g. MOV(P) = MOV / MOVP |
| Mitsubishi (_U) | When appended, data is treated as unsigned |
| Mitsubishi D... / E... / ED... | D = 32-bit, E = single-precision real, ED = double-precision real |
| KV suffixes | .U = 16-bit unsigned (default), .S = 16-bit signed, .D = 32-bit unsigned, .L = 32-bit signed, .F = single-precision real, .DF = double-precision real |
| KV @ | Prefixing an instruction with @ makes it differentiated execution (available for many instructions) |
| KV R | Internal register method instruction. Used in combination: LDA (load) → operation → STA (store) |
| OMRON L / S / U / F / D | L = double length (32-bit), S = signed, U = unsigned, F = single-precision real, D = double-precision real (depends on instruction) |
| OMRON @ / % / ! | @ = rising-edge differentiation, % = falling-edge differentiation, ! = immediate refresh (availability varies by instruction) |
| □ | A comparison symbol (=, <>, >, <=, <, >=) goes here |
How rows are organized
- Each function is one row. Differences in 16/32-bit and signed/unsigned are listed on the same row.
- Arithmetic and functions for real numbers (floating point) are on separate rows under "Floating point". Real versions of maximum, minimum, sum, average and similar are included on the same row.
Scope
- Covers instructions other than sequence instructions such as contacts, coils, timers, counters, master control and END. However, comparison contacts and bit operations within a word (KV BSET/BLD, OMRON TST/SETB etc.) are included.
- Mitsubishi: redundancy, safety, SFC, database, process control, multiple CPU, logging/recording and routing information instructions, general-purpose FUN/FB and module-specific instructions are excluded.
- KV: built-in positioning / high-speed counter instructions, unit-specific instructions (U_...), sensor setting instructions and unit program instructions are excluded.
- OMRON: SFC-related, model conversion and FB-specific special instructions, high-speed counter / pulse output instructions (except PWM and SPED), and NC / analog unit-specific instructions are excluded.
- Instruction specifications and availability vary by CPU model and version. Check each manufacturer's manual before actual use.
Sources
- Mitsubishi Electric: MELSEC iQ-R Programming Manual (CPU Module Instructions, Standard Functions/Function Blocks) SH(NA)-081226-AF
- KEYENCE: KV-8000/7000/5000/3000/1000 Series and KV Nano Series Instruction Reference Manual 084681 (October 2021)
- OMRON: CS/CJ/NSJ Series CPU Unit Instructions Reference Manual Man. No. SBCA-351N (December 2018)
Related pages
PLC

Device Comparison by Manufacturer
Compares the device addresses of major PLC manufacturers such as Mitsubishi, OMRON and KEYENCE.
PLC

Special Relay Comparison by Manufacturer
Compares the special relays of major PLC manufacturers such as Mitsubishi, OMRON and KEYENCE.
PLC

System Variable Comparison by Manufacturer
Compares the system variables of OMRON NX and KEYENCE KV-X.
PLC

FUN/FB Comparison by Manufacturer
Compares the functions and function blocks of OMRON NX and KEYENCE KV-X.
PLC

Motion Control Instruction Comparison by Manufacturer
Compares the motion control instructions of OMRON NX and KEYENCE KV-X.
MITSUBISHI

SM / SD List
Special relays (SM) and special registers (SD) for Q series / L series / iQ-R series PLCs
KEYENCE

CR/CM Comparison by Model
CR/CM comparison across KV-X, KV-8000, KV-7000, KV-5000 and KV-3000
KEYENCE

CR/CM Cross-Reference: KV / KV-X
CR/CM and variable name correspondence between the KEYENCE KV-8000 series and the KV-X500/X300 series
OMRON

CJ to NJ Instruction Replacement Guide
A guide to replacing CJ instructions with NJ instructions
PC Tools

KVtoCJ
An application that converts KEYENCE KV series ladder programs into OMRON CJ series ladder programs
PC Tools

CJtoKV
An application that converts OMRON CJ series ladder programs into KEYENCE KV series ladder programs
