//IO状态C:\Users\Administrator\Desktop\Manual_Debug\Manual_Debug\UserCtrl\IOoutputStatus.cs public void NewCtrlCardSR_IOstChange(object sender, EventArgs e) { try { CardInputIOEvengArgs cIOE = e as CardInputIOEvengArgs; if (arrOutputIo != null && cIOE.CardNum == arrOutputIo.CardNum && cIOE.type == (int)arrOutputIo.tag_MotionCardManufacturer) { bool var = (((cIOE.Value & ((ulong)(1 << arrOutputIo.IOBit))) > 0 && arrOutputIo.Logic == 1) || ((cIOE.Value & ((ulong)(1 << arrOutputIo.IOBit))) < 1 && arrOutputIo.Logic == 0)); btstatus = !var; this.Invoke(tag_UIdelegate, btstatus); } } catch { } }
//IO状态C:\Users\Administrator\Desktop\Manual_Debug\Manual_Debug\UserCtrl\IOoutputStatus.cs void NewCtrlCardSR_IOstChange(object sender, EventArgs e) { try { CardInputIOEvengArgs cIOE = e as CardInputIOEvengArgs; if (arrInputIo != null && cIOE.CardNum == arrInputIo.CardNum && cIOE.type == (int)arrInputIo.tag_MotionCardManufacturer) { ulong uaone = 1; if (arrInputIo.StrIoName == "右载具右压紧位") { } ulong a = uaone << arrInputIo.IOBit; ulong b = (cIOE.Value & a) >> arrInputIo.IOBit; bool var = ((b > 0 && arrInputIo.Logic == 1) || (b < 1 && arrInputIo.Logic == 0)); // lblinputLight.Image = (((cIOE.Value & ((ulong)(1 << arrInputIo.IOBit))) > 0 && arrInputIo.Logic == 1) || ((cIOE.Value & ((ulong)(1 << arrInputIo.IOBit))) < 1 && arrInputIo.Logic == 0)) ? Project.Properties.Resources.led_green_on_16 : Project.Properties.Resources.led_off_16; this.Invoke(tag_UIdelegate, var); } } catch { } }