一、概述
本文主要介紹使用 HI-TOP 網(wǎng)關(guān) HT3S-EIS-COP 在匯川 H5U-A8 和匯川 660C 伺服之間
進(jìn)行數(shù)據(jù)交換。
解決的問題:匯川 660C 伺服做從站與匯川 H5U-A8 進(jìn)行數(shù)據(jù)交換。
解決方法:使用 HI-TOP 網(wǎng)關(guān) HT3S-EIS-COP。匯川 H5U-A8 支持 EtherNET/IP 協(xié)議,
匯川 660C 伺服支持 CANopen 協(xié)議,而 HI-TOP 網(wǎng)關(guān) HT3S-EIS-COP 可以在 EtherNET/IP 網(wǎng)
絡(luò)和 CANopen 網(wǎng)絡(luò)之間傳送數(shù)據(jù)。以下為測試環(huán)境:

二、匯川 660C 伺服
2.1 參數(shù)表
(1)匯川 660C 伺服支持 CANopen 協(xié)議,在其手冊中可以看到它使用參數(shù)對應(yīng)的設(shè)置
如下:
電機(jī) 6040 運(yùn)行參數(shù)

(2)伺參數(shù)的設(shè)置服通過伺服上的按鍵進(jìn)行調(diào)節(jié)。
運(yùn)行時伺服顯示界面,81rn
H02.00 設(shè)置 8,為 CANOPEN
H0C.00 設(shè)置為 2,站地址為 2
H0C.08 設(shè)置為 5.波特率為 500k

三、網(wǎng)關(guān)的配置
3.1 HT3S-EIS-COP 網(wǎng)關(guān)介紹
HT3S-EIS-COP 是一款 EtherNET/IP 從站功能的通訊網(wǎng)關(guān)。該產(chǎn)品主要功能是將各種
CANopen 設(shè)備接入到 EtherNET/IP 網(wǎng)絡(luò)中。本網(wǎng)關(guān)連接到 EtherNET/IP 總線中作為從站使
用,連接到 CANopen 總線中作為主站使用。

下面來介紹 HT3S-EIS-COP 的配置,網(wǎng)關(guān)所有的配置是使用 GW Modbus Builder 和 GW
CANopen Builder 倆款軟件來進(jìn)行配置的。
43.2 配置網(wǎng)關(guān) EtherNET/IP 的 IP 地址
使用 GW Modbus Builder 連接到 HT3S-EIS-COP 網(wǎng)關(guān)的 P1 口,并將撥碼第 8 位撥到
ON,如下圖所示。此時網(wǎng)關(guān) P1 口地址為:192.168.1.100。

選擇菜單“設(shè)置 -> 通信設(shè)置 -> 以太網(wǎng)設(shè)置”:

在彈出的窗口中選擇本機(jī)連接網(wǎng)關(guān) P1 口的網(wǎng)卡的地址,并輸入網(wǎng)關(guān)的地址(這里是
192.168.1.100),點擊確認(rèn)按鈕。注意,計算機(jī)網(wǎng)卡地址和網(wǎng)關(guān)地址要在同一網(wǎng)段。

然后選擇“工具->在線”菜單:

在協(xié)議選擇框中選擇“EtherNET/IP 配置”,點擊確認(rèn)按鈕。

點擊“連接從站”按鈕,連接成功后,其他按鈕會變成可以點擊的狀態(tài):

點擊“讀取配置”按鈕后,顯示網(wǎng)關(guān)目前的實際 IP 地址:

填寫用戶需要的 IP 地址,點擊 “寫入配置”按鈕,寫入成功后,會彈出 OK 的對
話框:

配置完成后需將撥碼 8 位撥回 OFF,然后斷電重啟。
3.3 網(wǎng)關(guān)連接 CANopen 設(shè)備的連接
使用專用線 纜進(jìn)行連接,網(wǎng)口連接伺服的 RJ45 A 端,串口線連接至網(wǎng)關(guān)的 CANopen
端,L 與 L 接,H 與 H 接,RL 與 L 短接,RH 與 H 短接。


3.4 配置 CANopen 的參數(shù)
使用 GW CANopen Builder 連接到 HT3S-EIS-COP 網(wǎng)關(guān)的 LAN 口,如下圖所示。網(wǎng)關(guān)
LAN 口,地址為:192.168.1.201。

3.4.1 導(dǎo)入 EDS 文件
(1)打開 GW Canopen Builder 軟件,點擊“工具——導(dǎo)入 EDS”按鈕。

(2)選擇相應(yīng)的 EDS 文件,點擊打開

(3)導(dǎo)入成功后,可以在右側(cè)設(shè)備列表中找到從站設(shè)備,如下圖:

3.4.2 添加設(shè)備
(1)使用 GW Canopen Builder 軟件進(jìn)行網(wǎng)關(guān)的 CANopen 配置,首先添加一個
CANopen 主站,如下圖:


(2)根據(jù)需要添加 CANopen 從站


(3)右鍵單擊主站圖標(biāo),選擇屬性頁面,設(shè)置主站波特率、定時發(fā)送間隔和主站
心跳時間,如下圖:

(4)雙擊主站圖標(biāo),從所有節(jié)點列表里選擇需要添加到心跳監(jiān)控列表里的從站,
如下圖:

3.4.3 配置 CANopen 的 PDO
(1)雙擊從站的圖標(biāo),配置該從站的參數(shù)。選中 RXPDO(1400),點擊“PDO 映射”按
鈕

如下圖所示,在彈出的對話框中,選擇 6040 控制字、6060 運(yùn)行模式刪掉 60FF,
然后點擊確定。


(2)選中 TXPDO(1800),點擊“PDO 映射”按鈕


如下圖所示,在彈出的對話框中,查看狀態(tài)字是否含有 6041 狀態(tài)字,然后點
擊確定。

再選中 TXPDO(1800),點擊“屬性”按鈕:

輸入 TXPDO 定時發(fā)送時間,例如 100ms,、50ms、傳輸類型 255,點確定。

3.5 下載到網(wǎng)關(guān)
(1)點擊菜單欄“設(shè)置”——“以太網(wǎng)設(shè)置”,可以修改網(wǎng)關(guān)的 IP。

(2)電腦與網(wǎng)關(guān)用網(wǎng)線連接,選擇下載按鈕,可以將配置后的信息傳送給網(wǎng)關(guān)。
下載之前會彈出保存項目的對話框,保存即可。下載成功后消息框顯示如下:

3.6 使用匯川系統(tǒng)的配置方法
(1) 打開 autoshop 新建一個項目,導(dǎo)入網(wǎng)關(guān)的 eds 文件

(2) 在打開的界面選擇選擇網(wǎng)關(guān)的 eds 文件,導(dǎo)入后重啟軟件。

(3) 重啟后在打開的界面右擊 項目樹中的 ETHERNET/IP,進(jìn)行掃描設(shè)備并添加:


將掃描到的設(shè)備更新到總線上

(4) EtherNet/IP 輸入輸出設(shè)置
雙擊添加的網(wǎng)關(guān),在彈出的界面選擇“連接-雙擊設(shè)置0--》T大小”進(jìn)行設(shè)置長度,
雙擊下圖中紅框位置,進(jìn)入長度設(shè)置。

首先在標(biāo)簽組里面注冊輸入輸出數(shù)據(jù):

(5) 編譯并下載匯川 PLC 的程序。

四、運(yùn)行結(jié)果
4.1 運(yùn)行步驟
1. 網(wǎng)關(guān)的撥碼開關(guān)第 8 位為 OFF(運(yùn)行模式)。
2. 連接網(wǎng)關(guān) P1 口到匯川 H5U-A8 的 EtherNET/IP 網(wǎng)口,連接 CANopen 接口接到到匯
川 660C 伺服的接口
網(wǎng)關(guān)正常運(yùn)行時各指示燈如下圖所示,EtherNET/IP 的 OK 燈亮, CANopen 的 RUN 燈常亮、
RX 和 TX 閃爍。如下圖所示:


3. 啟動 PLC。
4. 輸入?yún)?shù)
4.2 參數(shù)的讀取
PLC 編程軟件 H5U-A8 中切換到監(jiān)控器模式,找到變量表進(jìn)行監(jiān)控,在 PLC 中輸出電
機(jī)啟動參數(shù),如下圖所示。


依次輸入 0X0600、0X0700、0X0F00、0X1F00,電機(jī)啟動,在匯川 660C 伺服電機(jī)轉(zhuǎn)動時會有
數(shù)據(jù)變化