汇川AM401(Scanner) 和Easy521 (Adapter)的EIP通信

1, 导出Easy系列的EDS文件, 配置Easy521的收发字节大小

 

 

 

 

2, 导入Easy系列的EDS文件, 配置AM401的收发字节大小

 

 

 

 3, AM401作为Scanner的EIP通讯诊断代码

VAR
//eSlaveState : IodrvethernetIPAdapter.AdapterState;
eMasterState : Iodrvethernetip.ScannerState;
eRemoteSlave: Iodrvethernetip.AdapterState;
END_VAR


//可参考以下示例程序:

//eSlaveState :=EtherNetIPSlave.eState; //本地从站状态
eMasterState :=EtherNetIPMaster_A.eState;//本地主站状态
eRemoteSlave := Easy.eState;//远程从站状态
//判断本地从站状态是否正常
//IF eSlaveState = iodrvethernetIPAdapter.AdapterState.RUNNING THEN
//TODO ; 添加用户逻辑
//END_IF
//判断本地主站状态是否正常
IF eMasterState <> iodrvethernetip.ScannerState.RUNNING THEN
//TODO;添加用户逻辑
END_IF
//判断远程从站状态是否正常
IF eRemoteSlave <> IoDrvEthernetip.AdapterState.RUNNING THEN
//TODO;添加用户逻辑
END_IF

 

posted @ 2023-03-04 12:20  CSF践行  阅读(2406)  评论(0编辑  收藏  举报