07-11-2007 02:47 PM
07-11-2007 03:10 PM
07-11-2007 03:27 PM
07-11-2007 06:06 PM
07-11-2007 06:37 PM
07-12-2007 02:46 AM
Hello,
please also add some ms sleep between the reads and writes, that helped us a lot!
Regards, Martin
07-12-2007 11:33 AM - edited 07-12-2007 11:33 AM
It looks to me as though the Red Lion kit is sending the character out in even parity, and you're reading in 8bit/no parity.
The bit patterns of the ASCII characters 1, 2, 4 7 and 8 all contain an odd number of 1's, (example the ASCII character 1 has a bit pattern of 0011 0001, ie three 1's) so aready odd parity and are transmitted without change.
The other characters have a bit pattern containing an even number of 1's, for example the ascii character 6 has a bit pattern of 0011 0110, so when tranmitting this over a data link in 7data/odd parity, the top bit is set to 1 to make an odd number of 1 bits, so it is transmitted as 1011 0110. It is thic character+parity that I think you are reading into a string. As an example, If I set an 8-bit unsigned to this value, and flatten it to a string, I get the paragraph symbol.

So.... Check the parity setting when you configure the serial port. My guess is that you have 8bit/no parity (or possibly 7/even) on the LabVIEW, and the Red Lion is set to 7bit/odd parity and it ignore parity errors on receipt.
Rod.
Message Edited by Rod on 07-12-2007 05:37 PM
Message Edited by Rod on 07-12-2007 05:43 PM
07-12-2007 11:39 AM
07-12-2007 11:49 AM
Oops did anyone else spot the deliberate mistake?...
For "It looks to me as though the Red Lion kit is sending the character out in even parity", read "It looks to me as though the Red Lion kit is sending the character out in ODD parity" and the rest follows logically.
07-12-2007 01:16 PM
Thank you all for your replies. I do however have the serial port set to the odd parity and 8 bits. The red lion hardware is also set to odd parity. Though I have concluded my problem lies in the fact that Red Lion is sending me numeric information and the serial read is reading a string. Thanks to Rod's post I believe this is why I am getting these symbols. If someone could tell me how to fix this I would be most appreciative.
Ben Williams