
21
20 opens communication port #1, sets the baud rate to 600, selects no parity, 8 bit word length
and 2 stop bits (see Dip Switch Settings, page 20). The port is then assigned to buffer #1.
The PRINT command in line 80, 90 or 100 sends the range set command to the balance.
The PRINT command in line 150 sends an enquire command to the balance asking for a weight
reading. If the balance cannot respond to this command, the program will lock. If this should
occur, enter BREAK. If another attempt to read the weight fails, there is a problem with your
interface.
Line 160 enters the weight reading into variable A$.
Lines 170 and 180 look at the status character to assure that the weight reading is stable.
Lines 190 and 200 strip off the comma and status character from the weight reading.
Line 210 transforms the weight reading from a string variable to a numeric variable in order to do
numerical computation.
Line 250 contains a CLOSE command to close the buffer and port before finding the average
weight.
The above program and notes are not intended to be a complete course on how to program your
computer for RS232. However, if you have a passing understanding of BASIC programming,
writing your own program to access the RS232 feature should not be difficult.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com