void Button5Click(object sender, EventArgs e) { using (var plc = new S7.Adapter("192.168.1.3")) { plc.WriteBytes("DB300.DBB0", new byte[] { 0x01 }); } }
void ConnectToSPSClick(object sender, EventArgs e) { try { var siemensS7 = new S7.Adapter("10.240.26.54"); byte[] data = siemensS7.ReadBytes("DB250.DBB164", 86); var stringValue = siemensS7.ReadString("DB250.DBB164", 86); textBox3.Text = StringHelper.ArrayToString("data", data); textBox3.Text += "value: " + stringValue; siemensS7.Dispose(); } catch (Exception ex) { sar.Tools.ExceptionHandler.Display(ex); } }