LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Graphing from Com Port Data

when i send 300(decimal) in two bytes 0x01 and 0x2C attached is what is plotted. I'm not sure why it is 10 (decimal) sometimes, and why it is not a pattern 0x01 0x2C 0X01 0X2C... (1 44 1 44 1.... decimal).  I played with the read count, figured it should be 2 but it really didn't make much of a differenec what the read count was

0 Kudos
Message 31 of 39
(1,342 Views)

That 10 is from your termination character.  You really should not be using the termination character since you are sending binary (hex) data.  Termination characters are only really good for ASCII data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 32 of 39
(1,336 Views)

Took out the termination character, so now i just send high byte then low byte.  attached is how it is graphing now.  Why is it graphing one most of the time?  It should be 1 44 1 44 1 44....

0 Kudos
Message 33 of 39
(1,330 Views)
You really need to understand the fundamentals. If your widget is sending two hex bytes, a serial connection at the other end is not going to be reliable. The receiver is asynchronous to the writer and you have no idea of the byte order. You can use hex with a header/terminator but the sender code must make sure that these characters never show up in the data. The other option, as has been suggested, is to send the ASCII data with a terminator. Either way, it is the fault of your sender code.
0 Kudos
Message 34 of 39
(1,321 Views)

I'm very new to labview, so all of this is quite new and i am trying to understand as best I can.  I am now trying to send ASCII characters B then C with the termination character A after B and after C. see attached.  This is the graph i am getting: (also see attached). 

Download All
0 Kudos
Message 35 of 39
(1,314 Views)
Your c code does not make any sense to me. What is a, b, c supposed to represent? What is usually done on the sender is converting to ascii representation of the numeric.
0 Kudos
Message 36 of 39
(1,305 Views)

what do you mean by ascii?  symbol representation? hex representation? decimal representation?  How i understand it is that ASCII is symbols/characters so A is ascii, which is 0x41 or 65 in decimal.  What should i send? A, 0x41, or 65?

0 Kudos
Message 37 of 39
(1,300 Views)
Sending "1" + "." + "2" as text - 3 bytes for example. The termination character is usually a carriage return or line feed - one byte. This requires sending more bytes but it is clearer and easier to translate at the receiving end.
0 Kudos
Message 38 of 39
(1,293 Views)

@jonathangt923 wrote:

what do you mean by ascii?  symbol representation? hex representation? decimal representation?  How i understand it is that ASCII is symbols/characters so A is ascii, which is 0x41 or 65 in decimal.  What should i send? A, 0x41, or 65?


http://www.asciitable.com/


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 39 of 39
(1,282 Views)