LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Communication - Losing data from string

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!

0 Kudos
Message 1 of 36
(2,950 Views)

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?


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 2 of 36
(2,935 Views)

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?

0 Kudos
Message 3 of 36
(2,918 Views)

@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?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 36
(2,899 Views)

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!

Download All
0 Kudos
Message 5 of 36
(2,835 Views)

See below. Thanks!

0 Kudos
Message 6 of 36
(2,834 Views)

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!

0 Kudos
Message 7 of 36
(2,831 Views)

Is baud rate is same for Tx and Rx?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 36
(2,815 Views)

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.

0 Kudos
Message 9 of 36
(2,788 Views)

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.

0 Kudos
Message 10 of 36
(2,784 Views)