Ejemplo n.º 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            //mi yazma butonu
            ModbusClient tcpclient = new ModbusClient(Convert.ToString(textBox1.Text), 502);

            tcpclient.Connect();
            int cc = Convert.ToInt32(textBox12.Text);

            int[] mideger = ModbusClient.ConvertDoubleToTwoRegisters(Convert.ToInt32(textBox8.Text));

            tcpclient.WriteMultipleRegisters(cc - 1, mideger);

            //tcpclient.WriteSingleRegister(cc-1, mideger[0]);
            //tcpclient.WriteSingleRegister(cc-1, mideger[1]);
        }