Click here to Skip to main content
15,898,222 members

Comments by Jesús Álvarez (Top 7 by date)

Jesús Álvarez 2-Dec-15 8:05am View    
Deleted
thanks George, i have a problem with that

<pre lang="C#">if (serialPort.BytesToRead > 13) // For example
{
string data = serialPort.ReadLine();
//data+="F";
// The F is not included in the data so if you need it you have to add it again
// data += "F";

// Do your stuff


if (data.ToCharArray().Count() == 13)
{



dataArray = Encoding.ASCII.GetBytes(data);


dataArray.ToList().ForEach(b => recievedData.Enqueue(b));

processData();
LineReceived(this, new LineReceivedEventArgs(dataArray));
}

}</pre>

with this line i think
<pre lang="C#">dataArray = Encoding.ASCII.GetBytes(data); </pre>

dato: 68---65---84---1---3---63---1---1---1---122---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---123---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---124---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---125---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---126---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---127---1---1---63---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---107--- this will be 128
dato: 68---65---84---1---3---63---1---1---1---63---1---1---106---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---105---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---104---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---111---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---110---
dato: 68---65---84---1---3---63---1---1---1---63---1---1---109---
Jesús Álvarez 2-Dec-15 3:20am View    
That is the data (frame) i receive (always 14 bytes):
68 -->'D'
65 -->'A'
84 -->'T'
0
127 Xh
254 Xl
0
0
115 Yh
51 Yl
5
0
196
70 -->'F'

i do the job with this, (127254) is my X value and 11551 my Y value, i use these to plot it in a chart,my hardware now is sending frames continuosly
x = 1 y = 0,001 'D' 'A' 'T'.............'F'
x = 2 y = 0,002 'D' 'A' 'T'.............'F'
x = 3 y = 0,003 'D' 'A' 'T'.............'F'

All data with this 'D' 'A' 'T'.............'F' frame format is interesting for me, and continuosly read.
Jesús Álvarez 2-Dec-15 2:38am View    
i don konw how to stop firing event when i receive 14 bytes
Jesús Álvarez 1-Dec-15 11:50am View    
ok, i am going to implement (if i can) yesterday then tell you a feedback. thanks
Jesús Álvarez 1-Dec-15 9:28am View    
how can i do that?, how to force continuosly reading?