private void button_read_float_Click(object sender, EventArgs e)
 {
     // 读取float变量
     if (textBox12.Text == "1")
     {
         DemoUtils.ReadResultRender(melsecSerial.ReadFloat(textBox3.Text), textBox3.Text, textBox4);
     }
     else
     {
         DemoUtils.ReadResultRender(melsecSerial.ReadFloat(textBox3.Text, ushort.Parse(textBox12.Text)), textBox3.Text, textBox4);
     }
 }
예제 #2
0
 private void test3( )
 {
     short  d100_short  = melsecSerial.ReadInt16("D100").Content;
     ushort d100_ushort = melsecSerial.ReadUInt16("D100").Content;
     int    d100_int    = melsecSerial.ReadInt32("D100").Content;
     uint   d100_uint   = melsecSerial.ReadUInt32("D100").Content;
     long   d100_long   = melsecSerial.ReadInt64("D100").Content;
     ulong  d100_ulong  = melsecSerial.ReadUInt64("D100").Content;
     float  d100_float  = melsecSerial.ReadFloat("D100").Content;
     double d100_double = melsecSerial.ReadDouble("D100").Content;
     // need to specify the text length
     string d100_string = melsecSerial.ReadString("D100", 10).Content;
 }
 private void button_read_float_Click(object sender, EventArgs e)
 {
     // 读取float变量
     readResultRender(melsecSerial.ReadFloat(textBox3.Text), textBox3.Text, textBox4);
 }