示例#1
0
 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);
     }
 }
示例#2
0
文件: TestPLC.cs 项目: mcNets/mcOmron
        /// <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);
            }
        }
示例#3
0
 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!");
     }
 }