Message frame objects define the structure of the data from the communication object that the program should act upon and the control flow objects to execute once that data arrives.
A message frame object defines the format of a specific piece of the incoming data message, describing the byte order sequence of the data to match. A message AIM can use as many message frames as necessary to identify the structure of the incoming message (data). The message frame object identifies the start of the data, datatype/length, data end, and the control flow object to execute when incoming data matches the message frame definition.
Defining a message frame
Select the Message Frame object and click Add. The Frame Matching window appears.
Click in the Frame Name field and enter a name for the message frame object that is descriptive of the type of message being framed by this object.
To define the Message Frame, click the appropriate button and complete additional information in its associated field.
The button options are described in the following table:
Button |
Description |
---|---|
Any |
Select this option to match on any type of data for the specified number of bytes. Enter the number of bytes in the entry field. |
All Data Until |
Select this option to match any type and amount of data until it reaches whatever value is specified in the next line of the frame definition. To stop matching when the frame finds a set of values instead of a single value, define a definition for each value, in the order you want them matched, after the “All Data Until” statement. Then put an “...end All Data Until” statement after the definition for the final value. For example, if you want the Frame to stop matching on data when it finds a CRLF combination, but not when it finds just a CR or just an LF, place the following definitions in the message frame object: All Data Until.. Control Character CR Control Character LF ..end All Data Until |
end All Data Until |
Select this option to stop matching upon encountering any type of data. |
Hex value |
Select this option to match on the hex value specified in the entry field. |
Decimal value |
Select this option to match on the decimal value specified in the entry field |
Octal value |
Select this option to match on the octal value specified in the entry field. |
ASCII String |
Select this option to match on the ascii string specified in the entry field. |
Control Character |
Select this option to match on the control character specified in the entry field. |
Var String |
Select this option to match on the value of the selected char, string, or blob variable. The drop-down list contains all char, string, and blob variables declared in the Define dialog box of the project data object.
|
Var Length |
Select this option to match of the value of the selected short, int, or long variable. Use this option to make a variable out of the number of bytes delimiting the message. Use the Any option to hard code the number of bytes. The drop-down list contains all short, int, and long variables declared in the Define dialog box of the project data object |
Click Add to add the definition to the message frame object.
Click the Non-recursive scan check box if you do not want the message frame object to perform a recursive scan on the data.
The message frame object performs recursive scanning by default in case some interference, such as line noise, causes the communication object to receive only part of a data packet and then the entire packet if it is re-sent.
In a recursive scan, after the message frame object matches on part of the data, it checks within the matched area to see if it can match on a smaller part of that data. The Message Frame continues to check within the matched data for another match until it finds the smallest possible part of the data to match.
Example: The Protocol Object submits this data to the Message Frame Object for bidding. The Message Frame Object is looking for an STX and then all data until an ETX.
STXthisSTXthis is aSTXthis is a test.ETX
In a recursive scan, the Message Frame Object first matches on the entire piece of data, “STXthisSTXthis is aSTXthis is a test.ETX”. It then looks for another match within that piece of data and finds “STXthis is aSTXthis is a test.ETX”. It then looks within that piece of matched data for another match and finds “STXthis is a test.ETX”. It then looks for another match within that piece and does not find one, so it bids on the final piece of the data that it matched on. In a non-recursive scan, the Message Frame Object matches on the entire piece of data, “STXthisSTXthis is aSTXthis is a test.ETX”, does not look any further within the data for another match, and bids on the entire piece of data.
The Frame Definition box displays the frame definition, which describes what the data looks like that the message frame object should match on. Each part of the definition defined in the Options box displays in this box.
Click Add to add the currently defined option to the message frame definition.
Click Remove to remove a selected line from the message frame definition
Use the spin arrows to change the order of lines in the Frame Definition box.
Click the Control Flow down arrow and select an existing control flow object from the list.
The control flow object that the message frame object should run after the message frame makes a successful bid on the data.
Click Detail to open the control flow dialog box and build a new control flow object.
The name of the function associated with the control flow appears next to the Run label.
When you finish completing the fields or updating the message frame, click Close to close the Frame Matching dialog box.
The message frame object is added to the project or the message frame is updated with the modifications.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |