Trio EtherCAT 快速上手 FLEX-6 NANO
Trio EtherCAT 快速上手 FLEX-6 NANO
Trio EtherCAT 快速上手 FLEX-6 NANO
‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ Communication ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Private Sub Form_Load() If (MSComm1.PortOpen = True) Then MSComm1.PortOpen = False MSComm1.CommPort = 1 MSComm1.PortOpen = True MSComm1.Settings = “57600,N,8,1” End Sub ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ Random Value ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Private Function MyRnd() As Integer ‘產生亂數0~9 Randomize MyRnd = Int(Rnd * 10) End Function ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ Function: format 10 to 16 ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Function format16(ByVal distTe …
https://montrol.com.tw/wp-content/uploads/2018/10/ST5驅動器-VB介面範例.mp4 ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ 建立通訊連接 ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Private Sub Form_Load() If (MSComm1.PortOpen = True) Then MSComm1.PortOpen = False MSComm1.CommPort = Combo1.Text ‘Choose comport MSComm1.PortOpen = True MSComm1.Settings = “9600,N,8,1” End Sub ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ 設定原點 ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Private Sub SetZeroPosition_Click() MSComm1.Output = “SP0” & Chr(13) ‘Set Absolute Position End Sub ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ‘ 開始位置移動 ‘= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = …
範例code
***RS485 站號(Node ID) 設定: * 透過AMP ” Step-Servo Quick Tunner ”軟體內設定馬達ID,如下: *** 開啟VB軟體 :步驟一: 專案>設定使用元件>勾選”Microsoft Comm Control 6.0” 步驟二: 先製作介面 步驟三: 編寫程式碼 Private Sub Form_Load() If (MSComm1.PortOpen = True) Then MSComm1.PortOpen = False MSComm1.CommPort = 3 MSComm1.PortOpen = True MSComm1.Settings = “9600,N,8,1” End Sub Private Sub Command3_Click() MSComm1.Output = “1FL20000” + Chr(13) End Sub Private Sub Command4_Click() MSComm1.Output = “2FL20000” + Chr(13) End Sub Private Sub Command5_Click() MSComm1.Output = “1FL20000” + Chr(13) MSComm1.Output = “2FL20000” + Chr(13) End Sub
步驟一: 先製作介面 步驟二: 編寫程式碼 Private Sub Form_Load() If (MSComm1.PortOpen = True) Then MSComm1.PortOpen = False MSComm1.CommPort = 3 MSComm1.PortOpen = True MSComm1.Settings = “9600,N,8,1” End Sub Private Sub Command1_Click() MSComm1.Output = “VE” & Text1.Text & Chr(13) MSComm1.Output = “AC” & Text2.Text & Chr(13) MSComm1.Output = “DE” & Text3.Text & Chr(13) MSComm1.Output = “FL” & Text4.Text & Chr(13) End Sub 說明步驟二: 檢視>屬性視窗 點左邊的Text1 (可以改變): 元件名稱(Name) 點右邊的Text (不可改變): 元件屬性(在此指Text屬性,可呼叫使用者鍵入的值)
步驟: 將RJ45 cable 與轉換器做接線配置,轉換器(紅色框框處)有顯示立體文字(T+、T-、R+、R- & GND)。接線方式(心法)為(綠傳橙收,有白為正);接線方式(口訣)為(T接R,R接T,正接正,負接負)。 將RJ45連接於驅控器,如下圖,有IN跟OUT,可插入IN,也可插入OUT (因為IN跟OUT是導通的)。 接線配置完成後,打開軟體”LinMot-Talk”進行設定。主要是Id(紅色框框)的設定,其餘設定皆為預設值。接著點選Reboot(綠色三角形播放扭)。 點選Tools叫出LinRS Test Tool視窗(Project不一定要在Login狀態下,也可在Logout的狀態下)。 LinRS Test Tool視窗如下圖 (1) 視窗右邊(紅色框框)之設定與第3步驟之設定參數一致 (2) 在Data(綠色框框)輸入:01 08 05 02 00 01 3F 00 04此字串之 08 所代表之意義正是第3步驟所設定之Id (3) 輸入(2)之字串,如若顯示紫色框框處之回應,代表通訊正常 參考選項中之原廠使用說明書(如下圖),並在LinRS Test Tool視窗中輸 入說明書第17、18、19頁之example,馬達即可動作。
設定步驟: 安裝好設定軟體:ST configurator 先啟動軟體 再打開電源 正確的話ST configurator會抓到對應的Drive型號,如若沒有,請使用下拉式按鈕選擇對應之Drive型號(黃色圈圈) 使用下拉式按鈕選擇對應之COM,接著按下Connect進行連線(綠色圈圈) 先選擇Motion & I/O…(紅色圈圈) 跳出Motion Control Mode視窗,點選Velocity(Oscillator) 在速度模式下,馬達的轉速是由模擬輸入或設定的數字輸入控制的!如果要使用開關或者其他裝置信號控制驅動器啟動/停止時,勾選“Use STEP input as Run/ Stop”。DIR輸入控制馬達方向,驅動器可以設置成恆定的速度運行模式,速度由“Speed”編輯框中的值設定。 勾選“Speed proportional to analog input”,驅動器將運行在模擬量調速模式。可以在“Analog Input”編輯框中輸入對應於+5V模擬量輸入時的最大速度值,例如輸入“10 rev/sec at +5V”,則+5V模擬量輸入對應於10轉/秒的轉速,而+2.5V對應於5轉/秒。 設定完成後Downlaod至驅動器即可
程式指令如下:
1.目的:會解決B1100-VF無通訊功能,需改變部分UPID的參數 2.作法:利用0-10V電壓輸入X14. Pin 20,再利用Command Table及i/o ,改變特定的UPID Pin.20 : Analog in 0-10V Pin.1 :Analog GND 3. 3.1. Analog Input On X14.20設定 3.2 UPID的值如設0000H,則Analog Intput沒有數值 3.3 設定Scale : 範例為0-5v的旋鈕 5v約=1000 2.5約500 4.Command Table程式範例 : UPID F448h : Scaled Value ON X14.20 : Analog 轉換過的數值 UPID E313h : Control Parameter Set B : FF Constant Force (0.5A = 500) UPID 619Eh : Ctrl Par Set Selection : Set B: 1h Set A :0h UPID 62A8h : Run Mode Selection : Motion Command : 0001 Position Indexing:000A 5.Ctrl Par Selection 設定 (Set A ,Set B) ※ 當Set B轉成Set A,如速度太快,可限制Maximal Current