Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 Inconsistent Reading

Hi,

 

I have a scale connected to RS-232 to record the weight change respect to time. Unfortunately, I am getting inconsistent string output which does not conform with the format string I assigned. I set the format string based on typical reading as below:

 

Typical String:

"ST,GROSS       100 g "

 

Output String when Error Occurs:

"GROSS      100 g "

"SS     100 g "

"g "

 

For typical string, output byte size is always 22. I am thinking something is wrong with my VISA property. If you have any suggestions, please let me know.

 

FYI, if you are counting to see typical string has 22 byte size, it might not. I put arbitrary number of spaces just for this post. I am also running this with 2 different scales at the same time in the same VI. Both having 2 separate VISA open/read/write/close. (Think of it as a duplicate except for sharing a same while loop.) 

 

Please leave a comment or question. I would appreciate your feedback.

0 Kudos
Message 1 of 2
(1,965 Views)

You are reading 22 bytes and having an end character.

If you ask for 100 characters the system should reply with all characters until the end character.

Maybe 22 but also maybe 23 or 25 when an error or maybe better special situation occurs.

So try out what happens when askin too many characters. Maybe your end character is different or something else.

By the way which scale are you communicating with?

 

greetings from the Netherlands
0 Kudos
Message 2 of 2
(1,947 Views)