private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; LbStat1.BackColor = SM.MT_GetNLimSnsr(m_eId) ? Color.Lime : Color.Silver; LbStat2.BackColor = SM.MT_GetHomeSnsr(m_eId) ? Color.Lime : Color.Silver; LbStat3.BackColor = SM.MT_GetPLimSnsr(m_eId) ? Color.Lime : Color.Silver; LbStat4.BackColor = SM.MT_GetAlarmSgnl(m_eId) ? Color.Lime : Color.Silver; LbStat5.BackColor = SM.MT_GetServo(m_eId) ? Color.Lime : Color.Silver; LbStat6.BackColor = SM.MT_GetStop(m_eId) ? Color.Lime : Color.Silver; LbStat7.BackColor = SM.MT_GetHomeDone(m_eId) ? Color.Lime : Color.Silver; LbCmdPos.Text = string.Format("{0:0.0000}", SM.MT_GetCmdPos(m_eId)); LbEncPos.Text = string.Format("{0:0.0000}", SM.MT_GetEncPos(m_eId)); if (SEQ._bRun || MM.GetManNo() != mc.NoneCycle) { btNeg.Enabled = false; btPos.Enabled = false; } else { btNeg.Enabled = true; btPos.Enabled = true; } tmUpdate.Enabled = true; }
private void tmUpdate_Tick(object sender, EventArgs e) { string sTemp;; tmUpdate.Enabled = false; lbStat1.ForeColor = SM.MT_GetNLimSnsr(m_eId) ? Color.Red : Color.Silver; lbStat2.ForeColor = SM.MT_GetHomeSnsr(m_eId) ? Color.Red : Color.Silver; lbStat3.ForeColor = SM.MT_GetPLimSnsr(m_eId) ? Color.Red : Color.Silver; lbStat4.ForeColor = SM.MT_GetHomeDone(m_eId) ? Color.Red : Color.Silver; lbStat5.ForeColor = SM.MT_GetAlarmSgnl(m_eId) ? Color.Red : Color.Silver; lbStat6.ForeColor = SM.MT_GetStop(m_eId) ? Color.Red : Color.Silver; lbStat7.ForeColor = SM.MT_GetInPosSgnl(m_eId) ? Color.Red : Color.Silver; lbStat8.ForeColor = SM.MT_GetServo(m_eId) ? Color.Red : Color.Silver; sTemp = string.Format("{0:0.0000}", SM.MT_GetCmdPos(m_eId)); lbCmdPos.Text = sTemp; if (SM.MT_GetHoming(m_eId)) { btHome.ForeColor = SEQ._bFlick ? Color.Lime : Color.Black; } else { btHome.ForeColor = Color.Black; } tmUpdate.Enabled = true; }