private void test5()
        {
            // The complex situation is that you need to parse the byte array yourself.
            // Here's just one example.
            OperateResult <byte[]> read = keyenceNanoSerial.Read("D100", 10);

            if (read.IsSuccess)
            {
                int    count   = keyenceNanoSerial.ByteTransform.TransInt32(read.Content, 0);
                float  temp    = keyenceNanoSerial.ByteTransform.TransSingle(read.Content, 4);
                short  name1   = keyenceNanoSerial.ByteTransform.TransInt16(read.Content, 8);
                string barcode = Encoding.ASCII.GetString(read.Content, 10, 10);
            }
        }
Esempio n. 2
0
 private void button25_Click(object sender, EventArgs e)
 {
     try
     {
         OperateResult <byte[]> read = keyence.Read(textBox6.Text, ushort.Parse(textBox9.Text));
         if (read.IsSuccess)
         {
             textBox10.Text = "Result:" + read.Content.ToHexString(' ');
         }
         else
         {
             MessageBox.Show("Read Failed:" + read.ToMessageShowString( ));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Read Failed:" + ex.Message);
     }
 }