如何实现用Ethernet/IP在PC,PLC和robot之间传输数据
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何实现用Ethernet/IP在PC,PLC和robot之间传输数据相关的知识,希望对你有一定的参考价值。
我想你最好把PC做为这两个设备通讯的中间媒介,在PC这边用OPC是最省事的方法,然后再辅助一些程序来实现数据的交换。把IP设在同一个段里就可以了 参考技术A 现在有个项目要从PC传送Real data到AB Compactlogic 5370 L2 PLC, PLC计算后再传给Fanuc robot。想用Ethernet/IP, 因为PLC和robot都有集成的Ethernet port。我现在用一个hub把三个设备连在一起,各自设定了static IP,在RSLinx中可以扫描到PLC和robot,但看不到PC。(华为)DHCP与VLAN结合的应用
1.通过搭建的拓扑图来实现PC的IP地址自动获取
2.配置思路:
⑴首先将PC机调到DHCP自动获取状态;
⑵创建相应的VLAN,将VLAN放入对应的端口;
<Huawei>system-view
[SW2]vlan batch 10 20 30
[SW2]interface Eth0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]port default vlan 10
[SW2]interface Eth0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 20
[SW2]interface Eth0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan all
<Huawei>system-view
[SW3]vlan batch 10 20 30
[SW3]interface Eth0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 30
[SW3]interface Eth0/0/1
[SW3-Ethernet0/0/1]port link-type trunk
[SW3-Ethernet0/0/1]port trunk allow-pass vlan all
⑶在三层交换机上创建DHCP地址池,并开启;
<Huawei>system-view
[SW1]vlan batch 10 20 30
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1]interface Vlanif 10
[SW1-Vlanif10]ip address 192.168.1.254 24
[SW1-Vlanif10]int vl20
[SW1-Vlanif20]ip address 192.168.2.254 24
[SW1-Vlanif20]int vl30
[SW1-Vlanif30]ip address 192.168.3.254 24
[SW1]dhcp enable
[SW1]ip pool vlan10
[SW1-ip-pool-vlan10]network 192.168.1.0 mask 24
[SW1-ip-pool-vlan10]gateway-list 192.168.1.254
[SW1-ip-pool-vlan10]dns-list 8.8.8.8
[SW1]ip pool vlan20
[SW1-ip-pool-vlan20]network 192.168.2.0 mask 24
[SW1-ip-pool-vlan20]gateway-list 192.168.2.254
[SW1-ip-pool-vlan20]dns-list 8.8.8.8
[SW1]ip pool vlan30
[SW1-ip-pool-vlan30]network 192.168.3.0 mask 24
[SW1-ip-pool-vlan30]gateway-list 192.168.3.254
[SW1-ip-pool-vlan30]dns-list 8.8.8.8
[SW1]interface Vlanif 10
[SW1-Vlanif10]dhcp select global
[SW1-Vlanif10]int vl20
[SW1-Vlanif20]dhcp select global
[SW1-Vlanif20]int vl30
[SW1-Vlanif30]dhcp select global
⑷ 验证;注意:华为获取的IP地址是从254往下开始分配的,思科是从1往上开始分配的;
PC1:
PC2:
PC3:
以上是关于如何实现用Ethernet/IP在PC,PLC和robot之间传输数据的主要内容,如果未能解决你的问题,请参考以下文章
modbus TCP/IP、EtherNet/IP与TCP/IP、以太网通讯是啥关系?