通过以太网/IP从PC程序读取/写入欧姆龙CJ2M [英] Omron CJ2M read/write from PC program over Ethernet/IP

查看:1172
本文介绍了通过以太网/IP从PC程序读取/写入欧姆龙CJ2M的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个程序,将我的PC连接到Omron CJ2M PLC以发送读/写命令.

I am developing a program to connect my PC to Omron CJ2M PLC to send read / write commands.

据我了解,欧姆龙PLC可以通过3种方法进行通信:

As per my understanding, Omron PLCs can be communicated over 3 methods:

1)主机链接,

2)FINS(TCP或UDP)和

2) FINS, (TCP or UDP) and

3)EIP.

我的要求是通过EIP连接CJ2M,并通过EIP(CIP)协议发送读/写命令.

My requirement here is to connect CJ2M through EIP, and send Read/Write commands over EIP(CIP) protocol.

最初,EIP通信需要发送2个请求:

Initally EIP communication needs to send 2 requests:

1)列出服务和2)注册会话

1) List Services and 2) Register Sessions

Register Sessions返回一个句柄,该句柄应在通过EIP进行的进一步通信中使用.

Register Sessions returns a handle which should be used in further communication over EIP.

我能够成功发送列表服务,注册会话和转发打开(RR数据),并且欧姆龙PLC已成功答复了这些服务.这三个请求/响应都没有问题.

I am successfully able to send List Services, Register Session and Forward Open (RR Data) and these are successfully replied by the Omron PLC. There is no problem in these 3 requests/responses.

现在,我想知道需要使用哪个命令/服务来读取欧姆龙的存储区域(例如DR 20的存储地址).

Now I want to know which command/service need to be used to read the memory area of Omron (say DR 20 memory address).

我正在通过RR数据发送服务代码0x4d,但显示供应商特定错误",然后连接被终止.

I am sending service code 0x4d over RR Data, but it says "Vendor Specific Error" and then connection gets terminated.

我需要Omron EIP或Wireshark日志或某些嗅探到的数据包的协议规范,这些数据包是通过EIP从PC到Omron PLC的EIP通信捕获请求/响应的.

I need protocol specification for Omron EIP or wireshark logs or some sniffed packets where a request / response is captured over EIP communication from PC to Omron PLC (no fins, no hostlink).

推荐答案

我们可以使用服务代码为0x4d的发送单位数据"向Omron EIP发送请求.

We can send requests to Omron EIP using "Send Unit Data" with service code 0x4d.

此服务(0x4d)用于根据EIP文档发送写请求,但是我们可以插入欧姆龙特定命令(FINS)来读取命令特定数据中的存储区.

This service (0x4d) is used to send write request as per EIP documentation, but we can insert the Omron specific commands (FINS) to read the memory areas in command specific data.

0000 00 00 00 00 00 80 0e 00 01 00 80 00 02 00 00 00

0000 00 00 00 00 00 80 0e 00 01 00 80 00 02 00 00 00

0010 00 00 00 12 01 01 82 00 00 00 00 01

0010 00 00 00 12 01 01 82 00 00 00 00 01

这篇关于通过以太网/IP从PC程序读取/写入欧姆龙CJ2M的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆