11-08-2013 10:24 AM
Hi all,
I am using a basic serial read and write VISA communication to input a string that sets a flowrate for one of my controllers. The string looks like "az09909.6p01=16.27" where 16.27 is the flowrate. Every once in a while, maybe 5-10%, it will lose a character and the flowrate will be set to 1.27, or it will not set at all. If I just run it again, it will work, it seems random that this is happening. Am I sending data too fast? How can I stop this? Thanks for the help!
11-08-2013 11:13 AM
I have never seen a communication bus just loose data in the middle like that. I have seen instruments interpret things totally wrong though. What model of flowmeter are you using? What communication bus are you using? What settings for that bus are you using?
11-08-2013 01:47 PM
If you lose data in the middle of the string, I would suspect a loose or noisy cable.
(Note: lose is the opposite of find, loose is the opposite of tight. It is a pet peeve of mine when people write the wrong word.):smileywink:
But if you had a loose or noisy cable, I'd suspect you'd also get parity or framing errors.
What is your baud rate?
11-09-2013 02:54 AM
@jayshih wrote:
Hi all,
I am using a basic serial read and write VISA communication to input a string that sets a flowrate for one of my controllers. The string looks like "az09909.6p01=16.27" where 16.27 is the flowrate. Every once in a while, maybe 5-10%, it will lose a character and the flowrate will be set to 1.27, or it will not set at all. If I just run it again, it will work, it seems random that this is happening. Am I sending data too fast? How can I stop this? Thanks for the help!
You mean to say instead of 16.27 you are receiving 1.27? What is the timeout and baud rate of both Tx and Rx module? Is baud rate of both Tx and Rx module same?
11-15-2013 04:09 PM
I have attached the code I am using as well as the manual for the CM-400 controller I am using. I have checked for loose cables.
Thank you all for your replies!
11-15-2013 04:09 PM
See below. Thanks!
11-15-2013 04:27 PM
I have checked all the connections and they are all right, any other suggestions? Thanks. I think the character being lost is generally random. Although after running for >100 times. It seems like most of the time it is from the number portion of my string that describes the flowrate. Sometimes the string does not read back at all, which i attribute that a different character was lost so a string was not echoed back. Thanks!
11-16-2013 01:23 AM - edited 11-16-2013 01:23 AM
Is baud rate is same for Tx and Rx?
11-18-2013 09:34 AM
Not sure what is Tx or Rx, sorry I am new to this...I know the baud rate I have programmed in is 9600, which the manual for my controller suggests.
Thanks.
11-18-2013 09:40 AM
Tx = transmit, Rx =receive. I don't know why Ranjeet would ask about the baud rate of each. I have never heard of a situation where the transmit and receive lines would function at different baud rates.