日本語 English

CJtoKV iconCJtoKV
Ladder converter from OMRON CJ series to KEYENCE KV series

CJtoKV is a conversion tool for migrating CX-Programmer ladder programs for the OMRON CJ1M, CJ2M and CJ2H to the KEYENCE KV-8000, KV-7000, KV-5500, KV-5000 and KV-3000 series.

Overview

An application that converts OMRON CJ ladder circuits into KEYENCE KV series ladder circuits
It converts as much of the circuit as possible, but not every instruction can be converted
Instructions that cannot be converted are shown as comment lines in the mnemonics in KV STUDIO

CJ and KV Memory Correspondence Table

CJ memory addresses are converted to KV memory as follows
(the numbers are the maximum addresses)

CJ and KV Memory Correspondence Table
CJ2HKV8000
Relays CIO6144R32000
Internal auxiliary relays WR8192MR64000
Latch relays HR8192LR16000
Link relays B32768
Timers T4096T4000
Counters C4096C4000
Control relaysAR48128CR1280
Data memory DM32768DM65535
Extended DM EM32768 x 25EM65535
File registersFZ524288
FM32768 x 16
Link registers W32768
Temporary DM TM512
Index IR16Z23
DR16
Control memoryCM9600

Correspondence Between CJ Auxiliary Area (AR) and KV Control Relays/Memory (CR, CM)

This table maps CJ Auxiliary Area bits to KV control relays with similar content

Note

They do not behave identically.
Use this only as a rough guide. Check the manuals and verify the behavior for exact details.

Condition flag
CJKV
Condition flagNameAddressName
P_ERError flagCR2012ON when an instruction execution error occurs
P_CYCarry flagCR2009ON when the result is negative or overflows
P_GT> flagCR2011ON when the result is positive
P_EQ= flagCR2010ON when the result is zero
P_LT< flagCR2009ON when the result is negative or overflows
P_OnAlways ON flagCR2002Always ON
P_OffAlways OFF flagCR2003Always OFF
P_First_CycleON for 1 scan only at start of operationCR2008ON for 1 scan only at start of operation
Clock pulses
CJKV
Condition flagNameAddressName
P_0_1ms0.1ms-
P_1ms1ms-
P_0_01s10msCR200410 ms clock pulse (50% duty)
P_0_02s20ms-
P_0_1ms100msCR2005100 ms clock pulse (50% duty)
P_0_2ms200ms-
P_1s1sCR20061 s clock pulse (50% duty)
P_1min1min-
Read-only Auxiliary Area
CJKV
AddressNameAddressName
A010 ms incrementing free-running timerCR103032-bit 1 ms free-running counter (*)
A1100 ms incrementing free-running timer
A21 s incrementing free-running timer
A200.11First cycle ON flag at start of operationCR2008ON for 1 scan only at start of operation
A262 - 263Maximum cycle time (0.1 ms)CR0727KV-5000, 7000 maximum scan time (10 μs units) (*)
CR1006 - 1007KV-8000 maximum scan time (1 μs units) (*)
A264 - 265Current cycle time (0.1 ms)
A266 - 267Current cycle time (0.01 ms)CM0720KV-5000, 7000 measured scan time (10 μs units)
CM1000 - 1001KV-8000 measured scan time (1 μs units) (*)
A343.14File access flagCR5402Memory card in use
A343.15Memory card recognition complete flagCR5403Memory card recognition complete
A351Clock data (minute, second)CM0705Read from RTC: second
CM0704Minute
A352Clock data (day, hour)CM0703Hour
CM0702Day
A353Clock data (year, month)CM0701Month
CM0700Year
A354Clock data (day of week)CM0706Day of week
A402.04Battery error flagCR2306Backup battery error

* The units differ, so they must be fixed if used

Procedure

1. Preparation: save the project in CX-Programmer text file (*.cxt) format in CX-Programmer

Open the project you want to convert in CX-Programmer, select [File] - [Save As], and save it in CX-Programmer text file (*.cxt) format in any folder
A file named ???.cxt is created in the specified folder
Example: when the c:\temp\cj-project folder is specified

Save the project in cxt format
Save the project in cxt format

A file named ???.cxt is output to the destination
Example: when the c:\temp\cj-project folder is specified

Output example
Output example

2. Run CJtoKV.exe

Run CJtoKV.exe
For the source file, specify the cxt file saved in step 1
For the destination folder, specify the folder to save the converted files in
Click the [Convert] button and the KV mnemonic list files are output to the destination folder

Run CJtoKV.exe
Run CJtoKV.exe

Example: when the c:\temp\kv-project folder is specified
Files named "PLCName_ProgramName.mnm" are output
The converted files are output separately for each program

Example of output files
Example of output files

3. Start KV-STUDIO and read the mnemonic list

  1. Start KV-STUDIO, specify "KV-8000" as the model and create a new program with any project name
    If you want to convert to a model other than KV-8000, create it as KV-8000 first and change the model afterwards
  2. Select [File] - [Mnemonic List] - [Read] from the menu
  3. Reading a mnemonic list in KV-STUDIO
    Reading the mnemonic list
  4. For example, reading "新規PLC1_新規プログラム1.mnm" gives the result shown below
  5. Example of a read mnemonic list
    Example of a read mnemonic list

Conversion Results

  • Lines that converted successfully are shown as ladder diagrams
  • If an address is a variable, the variable name is shown as-is in red; you may need to fix it by hand so the name does not collide with KV system-reserved words
  • Lines that failed to convert are shown as comment lines, and a "separator output" may be added to the ladder diagram
    Delete the "separator output" after fixing by hand
  • Comment lines that failed to convert contain the original instruction and the closest KV instruction

Note

CJ instructions differ from KV instructions, so parts that could not be converted must be fixed by hand
Even when conversion succeeds, operands may have different meanings, so check the behavior
If there is a similar instruction, it is written in parentheses () after the original instruction
If there is no similar instruction, the ladder circuit must be rewritten

If Reading the Mnemonic List Fails

If an error message appears when reading the mnemonic list in KV-STUDIO, create a new program, load the mnemonics with "List Edit" and fix them while identifying the failing parts

Read failure
Open in Notepad

1. Open in Notepad

Open the mnemonic list file that failed to read in Notepad

Notepad
Notepad

2. Open List Edit

Add a new program in KV-STUDIO and select [Edit] - [List Edit]

Select List Edit
Select List Edit

3. Paste into List Edit

Copy the mnemonic list opened in Notepad and paste it into List Edit in KV-STUDIO

Memo

The first three lines "DEVICE:57 ;MODULE:新規プログラム4 ;MODULE_TYPE:0" and
the last line ";END(001)" are not needed, so delete them

Paste into List Edit
Paste into List Edit

4. Press [Insert] and fix the errors

When you press [Insert], the lines that could not be made into ladder are shown; fix those lines by hand
To get the ladder diagram displayed for now, try fixing it as follows

  • Try adding "LD CR2002" (always ON) above the displayed line
  • Try adding ";" at the start of the line to make it a comment line
Add LD CR2002
Add CR2009
Make it a comment line
Make it a comment line
Ladder diagram after fixing conversion errors
Ladder diagram after fixing conversion errors

Handling Parts That Could Not Be Converted: Example 1

Parts that could not be converted are shown as comment lines below the block
If there is a similar instruction, it is written in parentheses () after the original instruction

Fixing differences in date/time memory layout

The date/time memory layout differs, so it must be adjusted

Date and time
CJKV
YearA353.08-15CM0700
MonthA353.00-07CM0701
DayA352.08-15CM0702
HourA352.00-07CM0703
MinuteA351.08-15CM0704
SecondA351.00-07CM0705
Day of weekA350.00-07CM0706
CJ date/time section
CJ date/time section

↓

Date/time section after conversion to KV
Date/time section after conversion to KV
  • Line 3: a "separator output" has been inserted after LD CR2002. Delete it after fixing by hand
  • Line 4: MOVD → DISN or DISB etc. (operands need fixing) A353 → CM700 (A353.08-15 year) CM701 (A353.00-07 month) $012 tmpWord
    In the CJ ladder, the upper digits of A353 (A353.08-15) are stored in the tmpWord variable with MOVD, then converted from BCD to BIN with the BIN instruction
    This extracts only the year from the calendar and converts it to the year
    On KV, CM0700 contains the year directly, so simply MOV the value of CM0700 to DM0
  • Line 6: likewise, the lower digits of A353 (A353.00-07) are stored in tmpWord with MOVD and converted from BCD to BIN with the BIN instruction to extract the month, so simply MOV the value of CM0701 to DM1
  • Line 8: likewise, for the day, simply MOV the value of CM0702 to DM2
  • Line 10: likewise, for the hour, simply MOV the value of CM0703 to DM3
  • Line 12: likewise, for the minute, simply MOV the value of CM0704 to DM4
  • Line 14: likewise, for the second, simply MOV the value of CM0705 to DM5
  • Line 16: likewise, for the day of the week, simply MOV the value of CM0706 to DM6
Date/time section after fixing by hand
Date/time section after fixing by hand

Handling Parts That Could Not Be Converted: Example 2

Differences in cycle time units

Cycle time
CJKV
Current valueA266, 267 (0.01 ms units)CM1000, 1001 (1 μs units)
Maximum valueA262, 263 (0.1 ms units)CM1006, 1007 (1 μs units)
CJ cycle time section
CJ cycle time section

↓

Cycle time section after conversion to KV
KV cycle time section
  • Line 10: on CJ the maximum cycle time is in 0.1 ms units, so it is multiplied by 100 to get μs
    On KV the unit is μs, so it is converted to a plain MOV
  • Line 11: delete the separator output after fixing by hand
  • Line 12: on CJ the current cycle time area (A266) is in 0.01 ms units and is multiplied by 10 to get μs
    On KV the unit is μs, so it is converted to a plain MOV
    Lines that could not be converted and became comments are appended at the end, so swap with line 10 to restore the original order
Cycle time section after fixing by hand
Cycle time section after fixing by hand

Handling Parts That Could Not Be Converted: Example 3

Differences in timers

Timers
CJKV
Decrementing ON-delay timer, 0.1 s units (BCD)TIM
Decrementing ON-delay timer, 0.1 s units (BIN)TIMXTMR
Decrementing ON-delay timer, 0.01 s units (BCD)TIMH
Decrementing ON-delay timer, 0.01 s units (BIN)TIMHXTMH
Decrementing ON-delay timer, 1 ms units (BIN)TMS
Decrementing ON-delay timer, 0.1 ms units (BCD)TIMU
Decrementing ON-delay timer, 0.1 ms units (BIN)TIMUX
Decrementing ON-delay timer, 0.01 ms units (BIN)TMU
CJ timer section
CJ timer section

↓

Timer section after conversion to KV
KV timer section
  • Line 62: CJ's TIMX instruction is a BIN decrementing 0.1 s timer, so it converts to KV's TMR instruction
  • Line 63: CJ's TIMHX instruction is a BIN decrementing 0.01 s timer, so it converts to KV's TMH instruction
  • Line 64: delete the separator output after fixing by hand
  • Line 65: CJ's TIM instruction is a BCD decrementing 0.1 s timer, so change the set value of KV's TMR instruction to BIN
  • Line 66: CJ's TIMH instruction is a BCD decrementing 0.01 s timer, so change the set value of KV's TMR instruction to BIN
  • Line 67: CJ's TIMU instruction is a BCD decrementing 0.1 μs timer, so change the set value of KV's TMU instruction to BIN and recalculate the units
  • Line 68: CJ's TIMUX instruction is a BIN decrementing 0.1 μs timer, so recalculate the units of the set value of KV's TMU instruction
  • Adjust the order as needed
Timer section after fixing by hand
Cycle time section after fixing by hand

FAQ

Can it convert all instructions?

No. Some instructions need to be fixed by hand.

Which KV-STUDIO models are supported?

It outputs in the KV-8000 mnemonic format; after conversion, change the model to KV7000, KV5500, KV5000, KV3000, KV1000, KV Nano, etc.

Can it be used for models other than CJ?

For models other than CJ, change the model to CJ series in CX-Programmer first; then it can be converted to KV series mnemonics.

Related pages

PLC

Device Comparison by Manufacturer

Device Comparison by Manufacturer

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

PLC

Device Comparison by Manufacturer

Special Relay Comparison by Manufacturer

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

PLC

Application Instruction Comparison by Manufacturer

Application Instruction Comparison by Manufacturer

Compares the application instructions of major PLC manufacturers such as Mitsubishi, OMRON and KEYENCE.

PLC

System Variable Comparison by Manufacturer

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

Download

By downloading, you are deemed to have agreed to the Terms of Use

Only basic ladder conversion is supported. If you find conversion errors or have requests, I would like to update the tool, so please let me know in the comments or via the contact form

Comments