void Turn_Click(object sender, RoutedEventArgs e) { Button bt = sender as Button; string lay = bt.Tag.ToString(); PLC_SP.TurnTo(int.Parse(lay)); }
void b_Click(object sender, RoutedEventArgs e) { Button bt = sender as Button; int lay = int.Parse(bt.Tag.ToString()); PLC_SP.TurnTo(lay); }
private void Test() { int nowLay = PLC_SP.ReadNowLay(); if (ToLay == 0 || nowLay == ToLay) { Random r = new Random(); int i = r.Next(11); i = (i * 2) - 1; PLC_SP.TurnTo(i); } }