beautypg.com

Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 79

background image

78

CHAPTER 8 • SERIAL MESSAGE SUPPORT

Message creation and transmission is handled by the developer through system function

calls. The Click 500 supports targeted protocol reception using a message watch list. The

developer populates this list with the message types to listen for, along with appropriate

callback functions and checksum handlers. Upon receiving a message, the Click 500 has a

receive message processor that makes sure the message (see Figure 8.1):

˽

Was received from the assigned virtual port.

˽

Matches all literal bytes throughout the message.

˽

Has data in the specified variable fields.

˽

Verifies that message integrity with a checksum.

If a message from the watch list is detected and validated then the following will occur:
1 Any data in the variable fields will be extracted and placed in variable memory associ-

ated with the name tag.

2 The assigned callback function will be immediately executed during interrupt time.

Virtual Port Receive

Data Streams

Receive Message Processor

V1 V2

V3

V4

Match assigned port

Match literal bytes

Match variable fields

Verify checksum

Protocol A Message 2

Protocol A Message 3

. . .

Protocol A Message 1

Protocol Z Message 2

Protocol Z Message 3

Protocol Z Message 1

Message Watch List

1. Extract data from variable fields

2. Execute assigned callback function

Figure 8.1 – Receive Message Processor Diagram

Note

Since callback functions are executed during interrupt time, consider limiting the
amount of code in the callback function. For example, you may be able to pass any
received variable data to an idle loop processing routine via a global structure.