DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

rs232 input command???

Hi all,
 
I want to receive data through RS232 in measuring instrument.
Generating output appears like this " ST,GS,0E,     0.0 kg"
Will no there be method that can receive?
 
 
Regards,
 
chang..,

메시지가 09-17-2007 09:40 PM에 blue-windy에 의해 편집되었음

0 Kudos
Message 1 of 2
(6,774 Views)
Chang,

If the string is fixed format, ST,GS,0E,     0.0 kg, then you can do this:

"ST,GS,0E," a\r
This assumes that there is a <CR> character at the end of the line.

Or, you can skip characters

9x a \r

If there is no <CR> character, try counting the numbers

9x 8a 3x      (you must account for all of the characters on the line)

If only the first characters are fixed, then you can try a combination of the above

"ST," 6x 8a      (this will anchor to the start of the line, and count)
or
"ST," 6x a\r     (this will anchor to the start of the line, skip 6, and then look for a number in the remaining characters

I hope that one of these will help. The important thing is to be able to anchor to the start of the line. If you simply count, using x to skip and a to interpret as a number, then you must account for all characters on the line.
Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 2
(6,766 Views)