I have created a program to get a value. This is my program code.
Expand|Select|Wrap|Line Numbers
- private byte getValue (byte[]ComBuffer)
- {
- ArrayList list = new ArrayList();
- int intVal=0;
- for (intVal=0; intVal<129; intVal++)
- {
- list.Add(ComBuffer[intVal+1]);
- }
- return list;
- }
then when i need to use
Expand|Select|Wrap|Line Numbers
- void DataReceived(object sender, SerialDataReceivedEventArgs e)
- {
- int bytes = comPort.BytesToRead;
- byte[] comBuffer = new byte[bytes];
- comPort.Read(comBuffer, 0, bytes);
- getValue();
- }
Can anyone help me on this?