文字格 (Text Box):實際位置、實際速度、指令速度

獲得軸的實際位置和實際速度後需展示之,為此我們使用文字格來展示,首先宣告兩個 TextBox 變數-tbACT_POStbACT_VEL,接著使用 Invoke 來顯示文字格內的值,ToString 屬性會將此值轉換為字串。

tbACT_POS.Invoke((MethodInvoker)delegate { tbACT_POS.Text = PositionValue[Mindex].Value.ToString(); });
tbACT_VEL.Invoke((MethodInvoker)delegate { tbACT_VEL.Text = VelocityValue[Mindex].Value.ToString(); });

TextBox 變數 tbCMD_VEL 控制指令速度,預設值為 10000,此值在 Form1.Designer.cs 檔案中設定並可依照需要更改,亦可在 Properties 窗格中更改。