OG_MU-4-434_v10e Circuit Design, Inc.
65
OPERATION GUIDE
6.4.4 Response and receive processing
First, the response and receive data that enters UART from the MU-4 is received by the ring buffer. If there is data in
the ring buffer, the response and receive identification routine takes 1 byte at a time and performs interpretation of
the response and the receive. After, the processing routines diverge in accordance with each response or receive.
To determine the response and receive type, prepare a table of all responses and receives, and make a comparative
judgement. It is convenient to return the result of comparison as an integer of the response or receive position on the
table, and for the value to diverge to the processing routine.
Arrange the responses and receives in the table divided into groups by type.
Example:
array [‘BR’, ‘CH’, ‘CS’, ‘CT’, ‘DI’, ‘DR’, ‘DT’, ‘EI’, ‘ER’, ‘GI’, ‘IR’, ‘MD’, ‘PB’, ‘RA’, ‘RM’, ‘SB’, ‘TC’, ‘TB’, ‘UI’, ‘VR’]
Response and receive values are ASCII strings that express a numerical value, so when using values, provide a
routine to convert the ASCII characters into numerical values. For example, when data is received, the ‘*DR’ data
receive value indicates the amount of user data received, so this is converted to a numerical value and only that
amount of data is obtained.