LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The data send by serial port and mscomm control is not the same as the original data

Solved!
Go to solution

attached please find the mscomSerialWrite2.vi and the result picture.

try it and find that when the data "FFAE 4040 EA41 D8FF"  is sent,

the received data is "FFAE 4040 EA41 3F"

I tried other data , the result is as following:

send:4164 8163 4341 03  receive :41 64 81 63 43 41 03      result:OK
send:A143 B245 6AAA BBCC   recieve:A1 43 B2 45 6A AA BB 00   result: NG
send:AAAA AAAA AAAA AAAA AAAA AAAA   receive:AA AA AA AA AA AA AA AA AA AA AA AA   result :OK
send:A1A1 A1A1 A1A1 A1A1 A1A1  receive:A1 A1 A1 A1 A1 A1 A1 A1 A1 A1   result:OK
send:FFAE 4040 EA41 D8FF  receive:FF AE 40 40 EA 41 3F   result: NG
send:FFAE 4040 EA41 D8FF AA23 AB33 A233 AAAA A404 ABCD A2CD A22D B22C  receive:FF AE 40 40 EA 41 3F 3F 3F 3F AA AA 3F AB CD A2 CD 3F 3F  result: NG
send:FFAE 40A2 CCDD EEFA   receive:FF AE 40 A2 CC DD EE 00   result: NG

please help me to solve the porblem.

wrong data from serial port.jpg


0 Kudos
Message 1 of 3
(3,052 Views)
Solution
Accepted by topic author liedals

According to Microsoft, you want to pass anything with non-printing strings as a byte array, not a string.  I don't know that it will make any difference in this case, but may be worth a try.

0 Kudos
Message 2 of 3
(3,042 Views)

you are right, I should use a byte array to  pass  the chars without use the string. Using a string would cause some questions. after all, thks a lot.

0 Kudos
Message 3 of 3
(3,034 Views)