/// <summary> /// 设置输出点状态 /// </summary> private void SetOutPut(int number, int value) { CtrlCard.Write_Output(number, value); }
private bool GetOutPutState(int number) { return(CtrlCard.Get_OutNum(number) == 1); }
private bool GetInputState(int number) { return(CtrlCard.Read_Input(number) == 0); }
public FormOutTest() { InitializeComponent(); CtrlCard.Init_Board(); CtrlCard.SetIOMmode(0, 1); this.chkOut16.DataBindings.Add("EditValue", this.bindingSource1, "Out16", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut17.DataBindings.Add("EditValue", this.bindingSource1, "Out17", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut18.DataBindings.Add("EditValue", this.bindingSource1, "Out18", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut19.DataBindings.Add("EditValue", this.bindingSource1, "Out19", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut20.DataBindings.Add("EditValue", this.bindingSource1, "Out20", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut21.DataBindings.Add("EditValue", this.bindingSource1, "Out21", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut22.DataBindings.Add("EditValue", this.bindingSource1, "Out22", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut23.DataBindings.Add("EditValue", this.bindingSource1, "Out23", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut24.DataBindings.Add("EditValue", this.bindingSource1, "Out24", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut25.DataBindings.Add("EditValue", this.bindingSource1, "Out25", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut26.DataBindings.Add("EditValue", this.bindingSource1, "Out26", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut27.DataBindings.Add("EditValue", this.bindingSource1, "Out27", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut28.DataBindings.Add("EditValue", this.bindingSource1, "Out28", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut29.DataBindings.Add("EditValue", this.bindingSource1, "Out29", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut30.DataBindings.Add("EditValue", this.bindingSource1, "Out30", true, DataSourceUpdateMode.OnPropertyChanged); this.chkOut31.DataBindings.Add("EditValue", this.bindingSource1, "Out31", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput32.DataBindings.Add("EditValue", this.bindingSource1, "Input32", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput33.DataBindings.Add("EditValue", this.bindingSource1, "Input33", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput34.DataBindings.Add("EditValue", this.bindingSource1, "Input34", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput35.DataBindings.Add("EditValue", this.bindingSource1, "Input35", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput36.DataBindings.Add("EditValue", this.bindingSource1, "Input36", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput37.DataBindings.Add("EditValue", this.bindingSource1, "Input37", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput38.DataBindings.Add("EditValue", this.bindingSource1, "Input38", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput39.DataBindings.Add("EditValue", this.bindingSource1, "Input39", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput44.DataBindings.Add("EditValue", this.bindingSource1, "Input44", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput45.DataBindings.Add("EditValue", this.bindingSource1, "Input45", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput46.DataBindings.Add("EditValue", this.bindingSource1, "Input46", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput47.DataBindings.Add("EditValue", this.bindingSource1, "Input47", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput48.DataBindings.Add("EditValue", this.bindingSource1, "Input48", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput49.DataBindings.Add("EditValue", this.bindingSource1, "Input49", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput50.DataBindings.Add("EditValue", this.bindingSource1, "Input50", true, DataSourceUpdateMode.OnPropertyChanged); this.chkInput51.DataBindings.Add("EditValue", this.bindingSource1, "Input51", true, DataSourceUpdateMode.OnPropertyChanged); this.bindingSource1.DataSource = new OutTestInfo(); this.chkOut16.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut17.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut18.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut19.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut20.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut21.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut22.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut23.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut24.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut25.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut26.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut27.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut28.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut29.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut30.CheckedChanged += new EventHandler(chkOut_CheckedChanged); this.chkOut31.CheckedChanged += new EventHandler(chkOut_CheckedChanged); }