private void data_read_connection_Click(object sender, RoutedEventArgs e) { try { if (!plc.finsConnectionDataRead(0)) { throw new Exception(plc.LastError); } //cnt.ShowDialog(); //cnt.messegeList_connect.Text = plc.LastDialog("CONTROLLER DATA READ"); //cnt.messegeList_connect.AppendText("CONTROLLER: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 0, 20)); //cnt.messegeList_connect.AppendText(Environment.NewLine); //cnt.messegeList_connect.AppendText("VERSION: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 20, 20)); } catch (Exception ex) { MessageBox.Show("ControllerDataRead() error: " + ex.Message); } }
/// <summary> /// Controller data read /// </summary> private void ControllerDataRead() { try { if (!plc.finsConnectionDataRead(0)) { throw new Exception(plc.LastError); } dialog.Text = plc.LastDialog("CONTROLLER DATA READ"); dialog.AppendText("CONTROLLER: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 0, 20)); dialog.AppendText(Environment.NewLine); dialog.AppendText("VERSION: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 20, 20)); } catch (Exception ex) { MessageBox.Show("ControllerDataRead() error: " + ex.Message); } }
private void data_read_connection_Click(object sender, RoutedEventArgs e) { try { if (!plc.finsConnectionDataRead(0)) { throw new Exception(plc.LastError); } //cnt.ShowDialog(); //cnt.messegeList_connect.Text = plc.LastDialog("CONTROLLER DATA READ"); //cnt.messegeList_connect.AppendText("CONTROLLER: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 0, 20)); //cnt.messegeList_connect.AppendText(Environment.NewLine); //cnt.messegeList_connect.AppendText("VERSION: " + Encoding.ASCII.GetString(plc.FinsCommand.Response, 20, 20)); } catch (Exception ex) { //MessageBox.Show("ControllerDataRead() error: " + ex.Message); MessageBox.Show("Сработала заглушка! Канал чтения данных не был открыт, т.к. отсутствуют IP и PORT.", "Warning!"); } }