private void button1_Click(object sender, EventArgs e)
        {
            // 连接
            if (!System.Net.IPAddress.TryParse(textBox1.Text, out System.Net.IPAddress address))
            {
                MessageBox.Show(DemoUtils.IpAddressInputWrong);
                return;
            }

            if (!int.TryParse(textBox2.Text, out int port))
            {
                MessageBox.Show(DemoUtils.PortInputWrong);
                return;
            }


            if (!byte.TryParse(textBox15.Text, out byte SA1))
            {
                MessageBox.Show("SA1 Input Wrong!");
                return;
            }


            omronFinsUdp     = new OmronFinsUdp(textBox1.Text, port);
            panel2.Enabled   = true;
            omronFinsUdp.SA1 = SA1;
            omronFinsUdp.ByteTransform.DataFormat = (HslCommunication.Core.DataFormat)comboBox1.SelectedItem;

            userControlReadWriteOp1.SetReadWriteNet(omronFinsUdp, "D100", false);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // 连接
            if (!System.Net.IPAddress.TryParse(textBox1.Text, out System.Net.IPAddress address))
            {
                MessageBox.Show(DemoUtils.IpAddressInputWrong);
                return;
            }

            if (!int.TryParse(textBox2.Text, out int port))
            {
                MessageBox.Show(DemoUtils.PortInputWrong);
                return;
            }


            if (!byte.TryParse(textBox15.Text, out byte SA1))
            {
                MessageBox.Show("SA1 Input Wrong!");
                return;
            }


            omronFinsUdp = new OmronFinsUdp(textBox1.Text, port);
        }
Example #3
0
        public override void DeviceConn(OmronFinsUdpConfig config)
        {
            OmronFinsUdp omronFinsUdp = new OmronFinsUdp(config.IP, config.Port);

            omronFinsUdp.SA1 = config.SA1;
            omronFinsUdp.SA2 = config.SA2;
            omronFinsUdp.ByteTransform.DataFormat = (HslCommunication.Core.DataFormat)config.ByteTransformDataFormat;
        }