日本語 English

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

FunctionsMitsubishi 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$□SCMPLD□$/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)RCMP CMPL CPS CPSLDifferent outputs: Mitsubishi = 3 specified bits, KV = arithmetic flags (CR), OMRON = condition flags
Band (zone) comparisonZCP(P)(_U) DZCP(P)(_U)ZCMP(.U/.S/.D/.L)RZCP ZCPL ZCPS ZCPSL
Block data comparison (between 2 blocks)BKCMP□(P)(_U) DBKCMP□(P)(_U)BCMP(.S/.D/.L)MCMPOMRON's MCMP only compares 16 words for equality
Batch comparison of one value against a blockBKCMP□(P)(_U)BCMPI(.S/.D/.L)TCMPMitsubishi 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 BCMP2OMRON's BCMP has the same name as KV's BCMP but a different function
Consecutive bit data comparison—BBCMP—

Arithmetic

FunctionsMitsubishi 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)+ +LKV'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 *ULOMRON: 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/subtractionBK+(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)RNEG NEGL
Absolute value—ABS(.L)R—Mitsubishi supports this with a general-purpose FUN (ABS) (outside the scope of this table)
BIN square rootSQRT(P) DSQRT(P)ROOT(.U/.S/.D/.L)RROTB
BIN exponentiation—POW(.S/.D/.L)R—

BCD arithmetic

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
BCD additionB+(P) DB+(P)—+B +BLKV has no BCD arithmetic instructions (convert with TBIN/TBCD, then calculate)
BCD subtractionB-(P) DB-(P)—-B -BL
BCD addition/subtraction with carry——+BC +BCL -BC -BCL
BCD multiplicationB*(P) DB*(P)—*B *BL
BCD divisionB/(P) DB/(P)—/B /BL
BCD increment / decrement——++B ++BL --B --BL
BCD square rootBSQRT(P) BDSQRT(P)—ROOTOMRON's ROOT is BCD; KV's ROOT is BIN/real
BCD trigonometric functionsBSIN(P) BCOS(P) BTAN(P) BASIN(P) BACOS(P) BATAN(P)——
Floating-point division (BCD)——FDIV

Logical operations

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Logical ANDWAND(P) DAND(P)ANDA(.U/.D)R CAL&(.U/.D)ANDW ANDL
Logical ORWOR(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)RXNRW XNRL
Block data logical operationsBKAND(P) BKOR(P) BKXOR(P) BKXNR(P)——
Bit inversion (same device)—COM(.U/.D)RCOM COMLMitsubishi 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 transferCMLB(P)——

Bit processing

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Set/reset a bit in a word deviceBSET(P) BRST(P)BSET BRESSETB RSTBKV's BSET/BRES are basic instructions (bit output instructions)
Test a specified bit in a wordTEST(P) DTEST(P) BON(P) DBON(P)BLD BLDB BAND BANB BOR BORBTST TSTNKV/OMRON use contact types. KV's BLD etc. are basic instructions
Batch reset of a rangeBKRST(P)ZRESRSTAOn Mitsubishi, batch-clear words with FMOV
Batch set of a range——SETA
Count ON bitsSUM(P) DSUM(P)BCNT(.U/.D)RBCNTOn Mitsubishi the instruction name is SUM (bit check)

Shift and rotation

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Shift right n bits within a wordSFR(P)SRA(.U/.D)R CAL>>(.U/.S/.D/.L)NASR NSRL ASR ASRLOMRON's ASR/ASRL shift by a fixed 1 bit
Shift left n bits within a wordSFL(P)SLA(.U/.D)R CAL<<(.U/.S/.D/.L)NASL NSLL ASL ASLLOMRON'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)SFTSFT SFTR ASFTMitsubishi'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)WSFTOMRON'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 dataESFR(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)RRRNC RRNLOMRON rotates by a fixed 1 bit
Rotate left (without carry)ROL(P) DROL(P)RLNCA(.U/.D)RRLNC RLNLOMRON rotates by a fixed 1 bit
Rotate right (with carry)RCR(P) DRCR(P)RRA(.U/.D)RROR RORLSame 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)RROL ROLLSame as above

Data conversion

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
BIN → BCD conversionBCD(P) DBCD(P)TBCD(.U/.D)RBCD BCDL
BCD → BIN conversionBIN(P) DBIN(P)TBIN(.U/.D)RBIN BINL
Signed BIN ⇔ BCD conversion——BCDS BDSL BINS BISL
Block BIN ⇔ BCD conversionBKBCD(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)RSIGNKV can also convert automatically via suffixes. EXT/SIGN extend 16 → 32 bits
BIN → real conversionINT2FLT(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)RFLT FLTL DBL DBLL
Real → BIN conversionFLT2INT(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)RFIX FIXL FIXD FIXLDRounding differs: Mitsubishi = round half up; KV: INTG = truncate / ROUND = round half up
Single ⇔ double precision real conversionFLT2DBL(P) DBL2FLT(P)FTODFR DFTOFR—
BIN → Gray code conversionGRY(P)(_U) DGRY(P)(_U)GRY(.U/.D)RBIN_GRAY BIN_GRAYL
Gray code → BIN conversionGBIN(P)(_U) DGBIN(P)(_U)RGRY(.U/.D)RGRAY_BIN GRAY_BINL GRYOMRON's GRY converts Gray code → BIN/BCD/angle
BIN → decimal ASCII conversionBINDA(P)(_U) DBINDA(P)(_U)DASC(.U/.S/.D/.L)—
Decimal ASCII → BIN conversionDABIN(P)(_U) DDABIN(P)(_U)RDASC(.U/.S/.D/.L)—
BIN → hexadecimal ASCII conversionBINHA(P) DBINHA(P) INT2ASC(P)ASC(.U)R HASC(.U/.D)ASC STR4 STR8 STR16
Hexadecimal ASCII → BIN conversionHABIN(P) DHABIN(P) ASC2INT(P)RASC(.U)R RHASC(.U/.D)HEX NUM4 NUM8 NUM16
BCD ⇔ decimal ASCII conversionBCDDA(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 conversionESTR(P)FASCFSTR
String → real conversionEVAL(P)RFASCFVAL
Split / combine real mantissa and exponentEMOD(P) EREXP(P)DISF UNIF—Mitsubishi uses BCD format; KV uses binary mantissa and exponent
DecodeDECO(P)DECOR MPXRMLPX
EncodeENCO(P)ENCOR DMXRDMPX
7-segment decodeSEG(P)SEG(.U/.D)RSDEC
Split / combine in 4-bit unitsDIS(P) UNI(P)DISN(.U/.D) UNIN(.U/.D)—
Split / combine an arbitrary number of bitsNDIS(P) NUNI(P)——
Split / combine in byte unitsWTOB(P) BTOW(P)DISB(.U/.D) UNIB(.U/.D)—
Bit row ⇔ bit column conversion——LINE COLM
Unicode ⇔ Shift-JIS conversionWS2SJIS(P) SJIS2WS(P) SJIS2WSB(P)——

Data transfer

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Data transferMOV(P) DMOV(P)MOV(.U/.S/.D/.L) DW(.U/.S/.D/.L)MOV MOVLKV's DW is for storing constants only
Digit (4-bit) transferSMOV(P)—MOVD
Block transferBMOV(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)BSETOMRON's BSET is block set (Mitsubishi's BSET is bit set)
Data exchangeXCH(P) DXCH(P)XCH(.U/.D)XCHG XCGL
Block data exchangeBXCH(P)——
Swap upper and lower bytesSWAP(P) DSWAP(P)SWAP(.U/.D)R BSWAPSWAPKV's BSWAP and OMRON's SWAP swap multiple words at once
1-bit transferMOVB(P)—MOVB
Multiple-bit transferBLKMOVB(P)BBMOV PMOV(.U/.D)XFRB
Transfer with offset (distribute / extract)——DIST COLLMitsubishi 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

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
JumpCJ SCJ JMPCJ NCJ SCJ GOTO LABELJMP JME CJP CJPN JMP0 JME0OMRON classifies jump instructions as sequence control instructions
Jump to END (end of program) / early exitGOENDRETURN—
Subroutine call and returnCALL(P) RET FCALL(P) XCALLCALL SBN RETSBS SBN RET
Global (inter-program) subroutinesECALL(P) EFCALL(P)ECALLGSBS GSBN GRET
Macro call—MCALL MSTRT MENDMCRO
Loop (FOR to NEXT)FOR NEXTFOR(.U/.D) NEXTFOR NEXT
Forced loop exitBREAK(P)BREAKBREAK
Disable / enable interruptsDI EI IMASK SIMASKDI EI DICDI EI MSKS MSKR CLIOMRON's DI/EI disable / re-enable execution of interrupt tasks
Return from interrupt programIRETINT RETI—OMRON uses interrupt tasks, so there is no return instruction
Watchdog (cycle monitoring)WDT(P)—WDTMitsubishi resets the WDT; OMRON extends the monitoring time
Execute / stop programs (tasks, modules)PSTOP(P) POFF(P) PSCAN(P)MDSTRT MDSTOPTKON TKOF
Step progression (steps / stages)—STP STE STG JMP ENDS W-ON W-OFF W-UE W-DESTEP SNXTMitsubishi 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

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
FIFO / LIFO writeFIFW(P)FIFOW(.U/.D) LIFOW(.U/.D)SSET PUSHOn 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 tableFINS(P)FINS(.U/.D)SINS
Delete data from a tableFDEL(P)FDEL(.U/.D)SDEL
Read / overwrite table data—FWRIT(.U/.D)SNUM SREAD SWRIT
Record-type table operations——DIM SETR GETR

Data processing

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Data searchSERDATA(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 valuesSERMM(P) DSERMM(P)——
Record search——RSRCH RSRCH2 RSRCH4
Maximum value searchMAX(P)(_U) DMAX(P)(_U) EMAX(P) EDMAX(P)MAX(.U/.S/.D/.L/.F/.DF)RMAX MAXL MAXF MAXDIncluding real numbers
Minimum value searchMIN(P)(_U) DMIN(P)(_U) EMIN(P) EDMIN(P)MIN(.U/.S/.D/.L/.F/.DF)RMIN MINL MINF MINDIncluding real numbers
SortSORTD(_U) DSORTD(_U) SORTTBL(_U) SORTTBL2(_U) DSORTTBL2(_U)SORT(.U/.S/.D/.L) SORTN(.U/.S/.D/.L)RSORT RSORT2 RSORT4
Sum calculationWSUM(P)(_U) DWSUM(P)(_U)WSUM(.U/.S/.D/.L/.F/.DF)R BSUMRSUMOMRON's SUM calculates a table sum (byte/word addition)
Average calculationMEAN(P)(_U) DMEAN(P)(_U)AVG(.U/.S/.D/.L/.F/.DF)RAVGOMRON's AVG is a moving average over a specified number of cycles
CRC calculationCRC(P)CRCR—
Check code (horizontal parity, sum)CCD(P)—FCS
Random number generationRND(P) SRND(P)RND—

Data control

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Upper/lower limit controlLIMIT(P)(_U) DLIMIT(P)(_U)LIMIT(.U/.S/.D/.L)LMT
Dead band controlBAND(P)(_U) DBAND(P)(_U)BANDC(.S/.L)BAND
Zone controlZONE(P)(_U) DZONE(P)(_U)ZONE(.S/.L)ZONE
Scaling / polyline approximationSCL(P)(_U) DSCL(P)(_U) SCL2(P)(_U) DSCL2(P)(_U)APR(.U/.S/.D/.L/.F/.DF)SCL SCL2 SCL3 APR
Ramp signalRAMPQRAMP—
Lead-lag filter—LLFLT—
PID controlPID PIDINIT(P) PIDCONT(P) PIDSTOP(P) PIDRUN(P) PIDPRMW(P) S(P).PIDINIT S(P).PIDCONT S(P).PIDSTOP S(P).PIDRUN S(P).PIDPRMWPIDPID
PID with autotuning—PIDATPIDATMitsubishi specifies autotuning in the control data of the PID instruction
Time-proportional output / PWMPWMTPOUTTPO PWMOMRON's PWM uses the built-in pulse output

Floating point

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Real additionE+(P) ED+(P)ADD(.F/.DF)R CAL+(.F/.DF)+F +D
Real subtractionE-(P) ED-(P)SUB(.F/.DF)R CAL-(.F/.DF)-F -D
Real multiplicationE*(P) ED*(P)MUL(.F/.DF)R CAL*(.F/.DF)*F *D
Real divisionE/(P) ED/(P)DIV(.F/.DF)R CAL/(.F/.DF)/F /D
Real comparison outputECMP(P) EDCMP(P)CMP(.F/.DF)R—OMRON uses comparison contacts (LD□F etc.)
Real band comparisonEZCP(P) EDZCP(P)ZCMP(.F/.DF)R—
Real transferEMOV(P) EDMOV(P)MOV(.F/.DF)MOVF
Real sign inversionENEG(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)RSIN COS TAN SIND COSD TAND SINQ COSQ TANQOMRON's SINQ etc. are high-speed versions
Inverse trigonometric functionsASIN(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)RASIN ACOS ATAN ASIND ACOSD ATANDKV's ATAN2 calculates the angle from coordinates (X,Y)
Degrees → radians conversionRAD(P) RADD(P)RAD(.F/.DF)RRAD RADD
Radians → degrees conversionDEG(P) DEGD(P)DEG(.F/.DF)RDEG DEGD
Real square rootESQRT(P) EDSQRT(P)ROOT(.F/.DF)RSQRT SQRTD
ExponentialEXP(P) EXPD(P)EXP(.F/.DF)REXP EXPD
Natural logarithmLOG(P) LOGD(P)LOG(.F/.DF)RLOG LOGD
Common logarithmLOG10(P) LOG10D(P)LOG10(.DF)R—
ExponentiationPOW(P) POWD(P)POW(.F/.DF)RPWR PWRD

String processing

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
String transfer$MOV(P) $MOV(P)_WSSMOVMOV$
String concatenation$+(P)SADD+$
String length detectionLEN(P)LENLEN$
Extract from the rightRIGHT(P)SRGHTRGHT$
Extract from the leftLEFT(P)SLEFTLEFT$
Extract from any positionMIDR(P)SMIDMID$
Replace at any positionMIDW(P)SRPLCRPLC$
String searchINSTR(P)SFIND SFINDNFIND$
String insertionSTRINS(P)SINSINS$
String deletionSTRDEL(P)SDELDEL$
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

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Save / restore index registersZPUSH(P) ZPOP(P)ZPUSH(.S/.L) ZPOP(.S/.L)—
Get and manipulate indirect addressesADRSET(P)ADRSET ADRINC ADRDEC ADRADD(.S/.L) ADRSUB(.S/.L)MOVR MOVRWOMRON sets the actual address in an index register
File register (extended DM) bank switchingRSET(P) QDRSET(P)FRSETEMBC
1-byte read/write of file registersZRRDB(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

FunctionsMitsubishi 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 timerTTMR STMR——
Pulse density measurement / fixed-cycle pulse outputSPD PLSY—SPEDOn KV these are built-in function instructions (see the CPU user's manual)
Timing pulse generationDUTY——
Time measurement / hour meterTIMCHK HOURM——
Free-running counter update—RFSFRC—
Input time constant / interrupt edge setting—HSP IEDGE—

Special I/O

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Rotary table shortest-path controlROTC——
Matrix inputMTR—MTR
Key input (10-key / 16-key)—HKEYTKY HKY
Digital switch input——DSW
7-segment display output——7SEG

Clock

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Read clock dataDATERD(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)WTIMEDATE
Clock data addition/subtractionDATE+(P) DATE-(P) S(P).DATE+ S(P).DATE-—CADD CSUB
Hours:minutes:seconds ⇔ seconds conversionTIME2SEC(P) SEC2TIME(P)—SEC HMS
Date/time ⇔ seconds conversionDATE2SEC(P)(_U) SEC2DATE(P)(_U)SEC RSEC—KV's SEC differs from OMRON's SEC (hours:minutes:seconds → seconds)
Time comparison output / time band comparisonTCMP(P) TZCP(P)——
±30-second clock correction—AJST—

Unit access

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
I/O refreshRFS(P)RFSX RFSYIORFKV's RFSX/RFSY are basic instructions (direct I/O)
Unit / network refreshCOM(P) S(P).ZCOMRFSCI RFSCOFIORF DLNKMitsubishi's COM is selective refresh (KV's and OMRON's COM invert bits)
Read unit buffer memoryFROM(P) DFROM(P) FROMD(P) DFROMD(P)UREAD(.U/.S/.D/.L/.F)IORD
Write unit buffer memoryTO(P) DTO(P) TOD(P) DTOD(P)UWRIT(.U/.S/.D/.L/.F) UFILL(.U/.S/.D/.L/.F)IOWR
Read unit model / informationTYPERD(P) UNIINFRD(P)IS_□□□—KV determines the type of the specified unit
Allocate buffer memory—UMALLOC—

File operations

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
File readSP.FREADMREAD MREADLFREAD
File writeSP.FWRITEMWRIT MPRINTFWRIT TWRITOMRON's TWRIT writes text (CSV etc.)
File deleteSP.FDELETEMDEL—
File copySP.FCOPYMCOPY—
File moveSP.FMOVEMMOV—
File renameSP.FRENAMEMREN—
Get file statusSP.FSTATUSMSTAT—
Create / delete folder—MMKDIR MRMDIR—
Get free space—MFREE MFREEK—
Read / write to data memoryS(P).DEVLD SP.DEVST——

Communication

FunctionsMitsubishi 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 macroSP.ECPRTCL—PMCR PMCR2
Serial port send/receive——TXD RXD TXDU RXDU STUPMitsubishi and KV support this with unit-specific instructions (outside the scope of this table)
CIP (EtherNet/IP) messages—CPMSET CPMGET CPSASC RCPSASCEXPLT EGATR ESATR ECHRD ECHWR
FTP clientSP.FTPPUT SP.FTPGET——

Diagnostics and debugging

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Reset error display / alarmLEDRARES—
Non-fatal error (user-defined)PALERT(P)—FAL
Fatal error (user-defined)PABORT—FALS
Failure point detection——FPD
Trace memory sampling——TRSM

Other

FunctionsMitsubishi MELSEC
iQ-R
KEYENCE
KV
OMRON
CS/CJ
Remarks
Message display—AWNUM AWMSG AWSHOW AWHIDEMSGKV 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 RInternal register method instruction. Used in combination: LDA (load) → operation → STA (store)
OMRON L / S / U / F / DL = 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

devices

Device Comparison by Manufacturer

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

PLC

relay

Special Relay Comparison by Manufacturer

Compares the special relays of major PLC manufacturers such as Mitsubishi, OMRON and KEYENCE.

PLC

systemvar

System Variable Comparison by Manufacturer

Compares the system variables of OMRON NX and KEYENCE KV-X.

PLC

systemvar

FUN/FB Comparison by Manufacturer

Compares the functions and function blocks of OMRON NX and KEYENCE KV-X.

PLC

motion

Motion Control Instruction Comparison by Manufacturer

Compares the motion control instructions of OMRON NX and KEYENCE KV-X.

MITSUBISHI

Special Relay (SM) and Special Register (SD) List

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 by Model

CR/CM comparison across KV-X, KV-8000, KV-7000, KV-5000 and KV-3000

KEYENCE

CR/CM Comparison by Model

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

CJ to NJ Instruction Replacement Guide

A guide to replacing CJ instructions with NJ instructions

PC Tools

Converter from KV series to CJ series

KVtoCJ

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

PC Tools

Converter from CJ series to KV series

CJtoKV

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

Comments