日本語 English

How to Perform Cyclic Communication with KV Series EtherNet/IP

This article explains how to set up EtherNet/IP cyclic communication using an OMRON NX102 and a KEYENCE KV-5500.
It explains with images the setup procedures in Sysmac Studio and KV STUDIO, how to register EDS files, how to create tag sets and how to check communication.

Overview

Cyclic communication between the OMRON NX/NJ series and the built-in Ethernet port of the KEYENCE KV series

Here, using an NX102 and a KV5500,
we explain how to set up the cyclic communication areas as follows

Link area
NX/NJKV
Variable nameData typeAddress
EIP_OUTARRAY[0..9] OF WORD→DM50~59
EIP_INARRAY[0..9] OF WORD←DM0~9

OMRON NX/NJ series settings

  1. Create global variables
  2. EIP connection settings

1. Create global variables

Set the variables for cyclic communication as global variables

Set Network Publish to Input and Output
Sysmac Studio input/output variables

2. EIP connection settings

1. Open [Tools] - [EtherNet/IP Connection Settings] from the menu

EtherNet/IP Connection Settings
Sysmac Studio EtherNet/IP Connection Settings

2. Double-click port 1 to show the edit screen

EtherNet/IP device list
Sysmac Studio EtherNet/IP device list

3. Set the input tag set as follows

Built-in EtherNet/IP port settings
Sysmac Studio built-in EtherNet/IP port settings

4. Set the output tag set as follows

Set the instance ID to 100

Instance ID setting
Sysmac Studio built-in EtherNet/IP instance ID setting

5. Add the EDS library

Right-click in the toolbox and click Display EDS Library

Toolbox
Sysmac Studio add EDS library

6. Add the EDS library

Press the [Install] button and select the EDS file for the KV series
NOTE
Get the EDS file by searching for KV8000 or similar on KEYENCE Downloads (Software)

Install the EDS file
Add the EDS library

7. Add a target device

Press the [+] button in the toolbox

Target device
Add a target device

8. Add a target device

Set the address and other details of the cyclic communication partner

Add a target device
EipKv01b

9. Connection settings

Connection settings
Target deviceKV-5500
Connection typeInputOnly (ID type)
In-outInput
Target variable100 (ID set in KV STUDIO)
Size20 (byte)
Originator variableEIP_IN
Size20 (byte)
Connection settings
Sysmac Studio connection settings

KEYENCE KV series settings

  1. Register the EDS file
  2. Set the output area
  3. Set the input area

1. Register the EDS file

1. Register the EDS file

Open EtherNet/IP Settings, right-click the device list and register the EDS file for the NX series with [Register EDS File]
NOTE
Get the EDS file for the NX series from EtherNet/IP EDS file download

EtherNet/IP Settings
KV STUDIO EtherNet/IP Settings

2. Adapter initial settings

Drag and drop the NX registered in the device list onto the blue area on the left to show the adapter initial settings screen
Set the IP address of the NX

Adapter initial settings
KV STUDIO adapter initial settings

2. Set the output area

1. Tag settings

Setting the area for cyclic output

Click the text KV-5500 to show the tag list screen
Press the [Add] button to add a tag
Set the instance ID to 100 and check Use
In the device allocation area, set the first device to DM0 and the size to 10 words

Tag settings
KV STUDIO tag settings

3. Set the input area

1. Connection settings

Setting the area for cyclic reading

Click the text Input Only of the added adapter (NX) to show the connection list

Connection settings
KV STUDIO connection settings

2. Parameter settings

Press the [Parameter Settings] button to show the parameter settings screen and set the following
Produced Assembly ID: 100 (ID set in the output tag set in Sysmac Studio)
Size: 20

Parameter settings
KV STUDIO parameter settings

Device allocation

Press the [Device Allocation] button to show the device allocation settings screen and set the following
First device: DM50
Size: 10 words

Device allocation
KV STUDIO device allocation

Checking cyclic data

Checking the link
NX/NJKV
Variable nameData typeAddress
EIP_OUTARRAY[0..9] OF WORD→DM50~59
Sysmac Studio watch window KV STUDIO batch monitor
EIP_INARRAY[0..9] OF WORD←DM0~9
Sysmac Studio watch window KV STUDIO batch monitor

Setting Up More Practical Communication Areas

Let's set up the cyclic communication area combining bits, words, numbers and characters
The following data is communicated cyclically

Link area
NX/NJKV
Variable nameData typeAddress
EIP_OUT2sEIP_OUT2→D200~241
EIP_IN2sEIP_IN2←D100~D157
Structures
Sysmac Studio structure

Procedure

  1. NX settings
  2. KV settings
  3. Strings need endian conversion
  4. Memory alignment

1. NX settings

1. Global variable settings

Sysmac Studio global variable settings

2. Set the input tag set

Sysmac Studio set input tag set

3. Set the output tag set

Sysmac Studio set output tag set

4. Set the connection

Sysmac Studio set connection

2. KV settings

1. Tag settings

KV STUDIO tag settings

2. Connection settings

KV STUDIO connection settings

3. Parameter settings

KV STUDIO parameter settings

4. Device settings

KV STUDIO device settings

3. Strings Need Endian Conversion

Converting on the NJ side

Convert the string to a byte array specifying _HIGH_LOW, then convert it back to a string
Sysmac Studio endian conversion ladder

Converting on the KV side

Swap the high and low bytes from the cyclic communication area and store them from D300 onward
KV STUDIO endian conversion ladder

Appendix. Memory Alignment

There is something to watch out for when linking using structures
The size of the structure sEIP_IN2 this time is 112 bytes (56 words), but in Set the input tag set it is 116 bytes

Alignment
NameData typeBytes
BARRAY[0..15] OF BOOL2
WARRAY[0..9] OF WORD20
INT32ARRAY[0..9] OF DINT40
STRSTRING[50]50
Total112

This is because the amount of memory allocated changes; for details, see "A-12 Variable Memory Allocation Methods" in the NJ/NX-series CPU Unit Software User's Manual

If there is no particular problem, create the connection with the number of bytes shown in the tag set as-is
To change it, you can adjust it by changing the offset type in the structure data type settings

FAQ

Where can I get the EDS file for the KV series?

It can be downloaded from the KEYENCE official website.

What should I check if communication does not work?

Check the IP address, instance ID and tag size settings.

Can it be used with both NJ and NX?

Yes, with any EtherNet/IP-compatible model.

Comments