//取得機臺狀態 private void getCNCInfo() { string eqpStatus = ""; short ret = iRemoting.SKY_conn_status(_Pwd, ref _SkyConn_status); if (ret == 0) { switch (_SkyConn_status.Status[0]) { case 0: eqpStatus = "OFF"; break; case 1: eqpStatus = "RUN"; break; case 2: eqpStatus = "IDLE"; break; case 3: eqpStatus = "Alarm"; break; } } currentStatus = eqpStatus; //取得程式名稱 ret = iRemoting.SKY_nc_filename(_Pwd, ref _SkyNc_filename); if (ret == 0) { currentProgName = _SkyNc_filename.MainProg[0]; } //取得程式內容 ret = iRemoting.GET_nc_current_block(_Pwd, ref _nc_current_block); if (ret == 0) { currentProg = ""; for (int i = 0; i <= _nc_current_block.Block.Length - 1; i++) { currentProg += _nc_current_block.Block[i] + "\r\n"; } } //取得循環時間 ret = iRemoting.GET_time(_Pwd, ref _time); if (ret == 0) { cycleTime = _time.Cycle; } //取得刀號 ret = iRemoting.GET_othercode(_Pwd, ref _othercode); if (ret == 0) { currentTCode = _othercode.TCode.ToString(); } }
private void S1_Tick(object sender, EventArgs e) { //主程 _SkyNc_filename.RetType = -1; ret = iRemoting.SKY_nc_filename(_Pwd, ref _SkyNc_filename); if (ret == 0) { txtProg_F.Text = _SkyNc_filename.MainProg[0]; } //狀態及模式 ret = iRemoting.GET_status(_Pwd, ref _status); if (ret == 0) { txtStatus_F.Text = _status.Status; txtMode_F.Text = _status.Mode; } ret = iRemoting.GET_spindle_speed(_Pwd, ref _spindle_speed); if (ret == 0) { label17.Text = _spindle_speed.SpSpeed.ToString(); } }