ServoModBusprotocolTECOGROUP1/20ServoModbusprotocolSerials:TSTAVersion︰1.0核定核對作成ServoModBusprotocolTECOGROUP2/201.RS485ModBus通訊.........................................................错误!未定义书签。1.1通訊界面參數...........................................................................................................31.2通訊連接...................................................................................................................31.3通訊數據結構...........................................................................................................41.4編碼和位元結構...............................................................................................42.CRC/LRC校驗碼計算......................................................................................................62.1CRC校驗..................................................................................................................62.2............................................................................................................LRC校驗83.功能碼.............................................................................................................................103.103H︰讀暫存器......................................................................................................103.206H︰寫單個暫存器..............................................................................................113.308H︰診斷..............................................................................................................123.410H︰寫多個暫存器..............................................................................................133.5異常碼...........................................................................................................................144.參數暫存器位址.............................................................................................................154.100xxH︰系統參數(Cn001~Cn031)................................................................154.201xxH︰轉矩參數(Tn101~Tn107).................................................................164.302XXH︰速度控制參數(Sn201~Sn218)........................................................164.403XXH︰位置控制參數(Pn301~Pn369)........................................................174.504XXH︰快捷參數(Qn401~Qn407)..............................................................194.605xxH:多機能接點規劃參數(Hn501~Hn517)............................................194.706XXH︰狀態顯示參數(Un-01~Un-19)..............................................................205.NOTE...............................................................................................................................206.版本記錄..........................................................................................................................20ServoModBusprotocolTECOGROUP3/201.RS485ModBus通訊使用TSTA系列伺服驅動器ModBus通訊界面時,每一台伺服驅動器必須預先在參數Cn035上設定其伺服驅動器型號(ID),計算機便根據型號對個別的伺服驅動器實施控制。通訊的方法是使用ModBusnetwork通訊。其中ModBus可使用下列兩種模式︰ASCII(AmericanStandardCodeforinformationinterchange)模式和RTU(RemoteTerminalUnit)模式,使用參數Cn037設定所需的模式。1.1通訊界面參數參數代號通訊位址RAM簡稱參數功能設定範圍初值單位控制模式Cn036H’ffff8036(1BH)ADR型號設定1~2541P.S.TCn037H’ffff8088(44H)BRT通訊傳輸率0︰48001︰96002︰192003︰384004︰576005︰1152000~51bpsP.S.TCn038H’ffff808a(45H)PTL通訊協定0︰7,N,2(Modbus,ASCII)1︰7,E,1(Modbus,ASCII)2︰7,O,1(Modbus,ASCII)3︰8,N,2(Modbus,ASCII)4︰8,E,1(Modbus,ASCII)5︰8,O,1(Modbus,ASCII)6︰8,N,2(Modbus,RTU)7︰8,E,1(Modbus,RTU)8︰8,O,1(Modbus,RTU)0~80P.S.TCn039H’ffff80ce(67H)CWD通訊逾時設定設定值不為0時,立即開啟通訊逾時功能,若設為0則關閉此逾時功能0~200secP.S.TCn040H’ffff80f2(79H)CDT通訊回複延遲時間延遲驅動器回複上位控制單元之通訊時間0~25500.5msecP.S.T1.2通訊連接PC或PLCTSTA01TSTA02TSTA03RS485ServoModBusprotocolTECOGROUP4/201.3通訊數據結構ASCII模式︰RTU模式︰STX起始位元‘︰’(3AH)STX無ADR通訊位址︰1-byte(2個ASCII碼)ADR通訊位址︰1-byteCMD功能碼︰1-byte(2個ASCII碼)CMD功能碼︰1-byteDATA(n-1)數據內容︰n-word(2n位元組,包含4n個ASCII碼),n=30DATA(n-1)數據內容︰n-word(2n位元組,包含4n個ASCII碼),n=30…………DATA(0)DATA(0)LRC校驗碼︰1-byte(2個ASCII碼)CRC-low校驗碼︰2-byteEND1結束碼CR︰(0DH)CRC-highEND0結束碼LF︰(0AH)END0無通訊數據格式詳細說明如下︰STX(通訊起始)ASCII模式:‚:‛位元(3AH);RTU模式︰超過10ms的靜止時段。ADR(通訊位址)參數Cn035設定型號,合法通訊位址範圍在1到254之間。CMD(功能碼)及DATA(數據)數據格式以指令功能碼而定,常用指令功能碼如下,格式參照功能碼03H︰讀暫存器06H︰寫單個暫存器08H︰診斷10H︰寫多個暫存器1.4編碼和位元結構ASCII模式︰每個8-bit數據由兩個ASCII位元組成。例如︰一個1-byte數據64H,以ASCII碼表示‚64‛,包含了‚6‛的ASCII碼(36H)及‚4‛的ASCII碼(34H)。HEX數字0~9及A~F的ASCII碼,如下表所示︰位元符號‚0‛‚1‛‚2‛‚3‛‚4‛‚5‛‚6‛‚7‛對應ASCII碼30H31H32H33H34H35H36H37H位元符號‚8‛‚9‛‚A‛‚B‛‚C‛‚D‛‚E‛‚F‛對應ASCII碼38H39H41H42H43H44H45H46HRTU模式︰每個8-bit數據由兩個4-bit的十六進製位元組成。例如︰1-byte數據64H。ServoModBusprotocolTECOGROUP5/20位元結構︰10bit位元框(用於7-bit位元)7N2Stasrtbit0123456StopbitStopbit──7-databits─────────10-bitscharacterframe──────7E1Stasrtbit0123456EvenparityStopbit──7-databits─────────10-bitscharacterframe──────7O1Stasrtbit0123456OddparityStopbit──7-databits─────────10-bitscharacterframe──────11bit位元框(用於8-bit位元)8N2Stasrtbit01234567StopbitStopbit────8-databits───────────11-bitscharacterframe───────8E1Stasrtbit01234567EvenparityStopbit────8-databits───────────11-bitscharacterframe───────8O1Stasrtbit01234567OddparityStopbit────8-databits───────────11-bitscharacterframe───────ServoModBusprotoc