CJtoKV
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)
| CJ2H | KV8000 | |||
|---|---|---|---|---|
| Relays | CIO | 6144 | R | 32000 |
| Internal auxiliary relays | WR | 8192 | MR | 64000 |
| Latch relays | HR | 8192 | LR | 16000 |
| Link relays | B | 32768 | ||
| Timers | T | 4096 | T | 4000 |
| Counters | C | 4096 | C | 4000 |
| Control relays | AR | 48128 | CR | 1280 |
| Data memory | DM | 32768 | DM | 65535 |
| Extended DM | EM | 32768 x 25 | EM | 65535 |
| File registers | FZ | 524288 | ||
| FM | 32768 x 16 | |||
| Link registers | W | 32768 | ||
| Temporary DM | TM | 512 | ||
| Index | IR | 16 | Z | 23 |
| DR | 16 | |||
| Control memory | CM | 9600 | ||
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.
| CJ | KV | ||
|---|---|---|---|
| Condition flag | Name | Address | Name |
| P_ER | Error flag | CR2012 | ON when an instruction execution error occurs |
| P_CY | Carry flag | CR2009 | ON when the result is negative or overflows |
| P_GT | > flag | CR2011 | ON when the result is positive |
| P_EQ | = flag | CR2010 | ON when the result is zero |
| P_LT | < flag | CR2009 | ON when the result is negative or overflows |
| P_On | Always ON flag | CR2002 | Always ON |
| P_Off | Always OFF flag | CR2003 | Always OFF |
| P_First_Cycle | ON for 1 scan only at start of operation | CR2008 | ON for 1 scan only at start of operation |
| CJ | KV | ||
|---|---|---|---|
| Condition flag | Name | Address | Name |
| P_0_1ms | 0.1ms | - | |
| P_1ms | 1ms | - | |
| P_0_01s | 10ms | CR2004 | 10 ms clock pulse (50% duty) |
| P_0_02s | 20ms | - | |
| P_0_1ms | 100ms | CR2005 | 100 ms clock pulse (50% duty) |
| P_0_2ms | 200ms | - | |
| P_1s | 1s | CR2006 | 1 s clock pulse (50% duty) |
| P_1min | 1min | - | |
| CJ | KV | ||
|---|---|---|---|
| Address | Name | Address | Name |
| A0 | 10 ms incrementing free-running timer | CR1030 | 32-bit 1 ms free-running counter (*) |
| A1 | 100 ms incrementing free-running timer | ||
| A2 | 1 s incrementing free-running timer | ||
| A200.11 | First cycle ON flag at start of operation | CR2008 | ON for 1 scan only at start of operation |
| A262 - 263 | Maximum cycle time (0.1 ms) | CR0727 | KV-5000, 7000 maximum scan time (10 μs units) (*) |
| CR1006 - 1007 | KV-8000 maximum scan time (1 μs units) (*) | ||
| A264 - 265 | Current cycle time (0.1 ms) | ||
| A266 - 267 | Current cycle time (0.01 ms) | CM0720 | KV-5000, 7000 measured scan time (10 μs units) |
| CM1000 - 1001 | KV-8000 measured scan time (1 μs units) (*) | ||
| A343.14 | File access flag | CR5402 | Memory card in use |
| A343.15 | Memory card recognition complete flag | CR5403 | Memory card recognition complete |
| A351 | Clock data (minute, second) | CM0705 | Read from RTC: second |
| CM0704 | Minute | ||
| A352 | Clock data (day, hour) | CM0703 | Hour |
| CM0702 | Day | ||
| A353 | Clock data (year, month) | CM0701 | Month |
| CM0700 | Year | ||
| A354 | Clock data (day of week) | CM0706 | Day of week |
| A402.04 | Battery error flag | CR2306 | Backup 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
A file named ???.cxt is output to the destination
Example: when the c:\temp\cj-project folder is specified
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
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
3. Start KV-STUDIO and read the mnemonic list
- 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 - Select [File] - [Mnemonic List] - [Read] from the menu
- For example, reading "新規PLC1_新規プログラム1.mnm" gives the result shown below
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
1. Open in Notepad
Open the mnemonic list file that failed to read in Notepad
2. Open List Edit
Add a new program in KV-STUDIO and select [Edit] - [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
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
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
| CJ | KV | |
|---|---|---|
| Year | A353.08-15 | CM0700 |
| Month | A353.00-07 | CM0701 |
| Day | A352.08-15 | CM0702 |
| Hour | A352.00-07 | CM0703 |
| Minute | A351.08-15 | CM0704 |
| Second | A351.00-07 | CM0705 |
| Day of week | A350.00-07 | CM0706 |
↓
- 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
Handling Parts That Could Not Be Converted: Example 2
Differences in cycle time units
| CJ | KV | |
|---|---|---|
| Current value | A266, 267 (0.01 ms units) | CM1000, 1001 (1 μs units) |
| Maximum value | A262, 263 (0.1 ms units) | CM1006, 1007 (1 μs units) |
↓
- 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
Handling Parts That Could Not Be Converted: Example 3
Differences in timers
| CJ | KV | |
|---|---|---|
| Decrementing ON-delay timer, 0.1 s units (BCD) | TIM | |
| Decrementing ON-delay timer, 0.1 s units (BIN) | TIMX | TMR |
| Decrementing ON-delay timer, 0.01 s units (BCD) | TIMH | |
| Decrementing ON-delay timer, 0.01 s units (BIN) | TIMHX | TMH |
| 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 |
↓
- 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
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
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

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