private void button_read_bool_Click(object sender, EventArgs e)
 {
     // 读取bool变量
     if (textBox12.Text == "1")
     {
         DemoUtils.ReadResultRender(keyence_net.ReadBool(textBox3.Text), textBox3.Text, textBox4);
     }
     else
     {
         DemoUtils.ReadResultRender(keyence_net.ReadBool(textBox3.Text, ushort.Parse(textBox12.Text)), textBox3.Text, textBox4);
     }
 }
Esempio n. 2
0
        private void test1()
        {
            // 如果我们想要读取M100-M109,我们可以按照如下的代码进行操作

            // if we want read M100-M109, so we can do like this
            OperateResult <bool[]> read = keyence_net.ReadBool("M100", 10);

            if (read.IsSuccess)
            {
                bool m100 = read.Content[0];
                // and so on
                // ...
                // then
                bool m109 = read.Content[9];
            }
            else
            {
                // failed, the follow operation is output the wrong msg
                Console.WriteLine("Read failed: " + read.ToMessageShowString( ));
            }
        }
Esempio n. 3
0
 private void button_read_bool_Click(object sender, EventArgs e)
 {
     // 读取bool变量
     DemoUtils.ReadResultRender(keyence_net.ReadBool(textBox3.Text), textBox3.Text, textBox4);
 }