/// <summary> /// 获取控制器状态 /// </summary> private void GetGWStatus() { bool bGoOn; int ret, timeStart; for (int i = 0; i < GWCount; i++) { Dapapi.AB_GW_Open(GWID[i]); ret = Dapapi.AB_GW_Status(GWID[i]); if (ret != 7) { bGoOn = true; timeStart = System.Environment.TickCount; while (bGoOn) { ret = Dapapi.AB_GW_Status(GWID[i]); if (ret == 7) { bGoOn = false; } else if (System.Environment.TickCount - timeStart > 3000) { bGoOn = false; } } } if (ret == 7) { this.tb_msg.Text += "\r\n Gateway ID:" + GWID[i] + " success connected, status return :" + ret; } else { this.tb_msg.Text += "\r\n Gateway ID:" + GWID[i] + " failed to connected, status return :" + ret; } } }
/// <summary> /// 熄灭所有标签 /// </summary> private void TagClear() { for (int i = 0; i < GWCount; i++) { if (Dapapi.AB_GW_Status(GWID[i]) == 7) { Dapapi.AB_LB_DspNum(GWID[i], -252, 0, 0, -3); Dapapi.AB_LB_DspNum(GWID[i], 252, 0, 0, -3); Dapapi.AB_LED_Dsp(GWID[i], -252, 0, 0); Dapapi.AB_LED_Dsp(GWID[i], 252, 0, 0); Dapapi.AB_BUZ_On(GWID[i], -252, 0); Dapapi.AB_BUZ_On(GWID[i], 252, 0); Dapapi.AB_LB_DspStr(GWID[i], -252, "", 0, -3); Dapapi.AB_LB_DspStr(GWID[i], 252, "", 0, -3); //12-digits Alphanumerical display Dapapi.AB_AHA_ClrDsp(GWID[i], -252); Dapapi.AB_AHA_ClrDsp(GWID[i], 252); Dapapi.AB_AHA_BUZ_On(GWID[i], -252, 0); Dapapi.AB_AHA_BUZ_On(GWID[i], 252, 0); } } }