private void checkLimitSwitch_Tick(object sender, EventArgs e) { UInt32 value; //cbr.getDevice(); value = cbr.returnInputChannel(testParam.limitChannel[0]); if (value < testParam.limitChannel[2]) { piston_stop(); testOver = 1; testOverReason = "Limit Switch!"; } else if (value > testParam.limitChannel[3]) { piston_stop(); testOver = 1; testOverReason = "Limit Switch!"; } else if (testParam.forceReadings[3] > testMaxForce) { piston_stop(); testOver = 1; testOverReason = "Press Maximum Force Reached!"; } }
private int check_limits() { UInt32 value; //cbr.getDevice(); testParam.dispReadings[0] = ((cbr.returnInputChannel(testParam.dispChannel) - testParam.potMin) / (testParam.potMax - testParam.potMin)) * testParam.potRange; value = cbr.returnInputChannel(testParam.limitChannel[0]); if (value < testParam.limitChannel[2]) { return(1); } else if (value > testParam.limitChannel[3]) { return(2); } else if (testParam.dispReadings[0] > testParam.potRangeMax) { rangeMaxExceeded = true; rangeMinExceeded = false; } else if (testParam.dispReadings[0] < testParam.potRangeMin) { rangeMinExceeded = true; rangeMaxExceeded = false; } else { rangeMinExceeded = false; rangeMaxExceeded = false; } return(0); }
private void labelUpdater_Tick(object sender, EventArgs e) { inputChannel0.Text = cbr.returnInputChannel(0).ToString(); inputChannel1.Text = cbr.returnInputChannel(1).ToString(); inputChannel2.Text = cbr.returnInputChannel(2).ToString(); inputChannel3.Text = cbr.returnInputChannel(3).ToString(); inputChannel4.Text = cbr.returnInputChannel(4).ToString(); inputChannel5.Text = cbr.returnInputChannel(5).ToString(); inputChannel6.Checked = Convert.ToBoolean(cbr.returnInputChannel(6)); inputChannel7.Checked = Convert.ToBoolean(cbr.returnInputChannel(7)); }
private int check_limits() { UInt32 value; //cbr.getDevice(); label1.Text = cbr.returnInputChannel(0).ToString(); label2.Text = cbr.returnInputChannel(1).ToString(); label3.Text = cbr.returnInputChannel(2).ToString(); label4.Text = cbr.returnInputChannel(3).ToString(); label5.Text = cbr.returnInputChannel(4).ToString(); label6.Text = cbr.returnInputChannel(5).ToString(); label7.Text = cbr.returnInputChannel(6).ToString(); label8.Text = cbr.returnInputChannel(7).ToString(); testParam.dispReadings[0] = ((cbr.returnInputChannel(testParam.dispChannel) - testParam.potMin) / (testParam.potMax - testParam.potMin)) * testParam.potRange; value = cbr.returnInputChannel(testParam.limitChannel[0]); if (value < testParam.limitChannel[2]) { return(1); } else if (value > testParam.limitChannel[3]) { return(2); } else if (testParam.dispReadings[0] > testParam.potRangeMax) { rangeMaxExceeded = true; rangeMinExceeded = false; } else if (testParam.dispReadings[0] < testParam.potRangeMin) { rangeMinExceeded = true; rangeMaxExceeded = false; } else { rangeMinExceeded = false; rangeMaxExceeded = false; } return(0); }