Current Page:
NeXtMidas Training
Macros - Part 1 (Basics)
Messages in a Macro
Message Structure
|
|
- The structure of a message:
- All NeXtMidas messages are instances of the
Message class.
- Messages have the following attributes:
name |
The name of the message (e.g. "ZOOM"). |
info |
Message information (this is just an integer). |
data |
The data associated with the message (can be a table). |
fid |
Identifies the sender ID (e.g. "PLOT") |
from |
Identifies the sender (Object) |
to |
Identifies the intended receiver of the message. |
quals |
(Since 2.7.2) Additional information or object to pass (usually a Table). |
(Note that the info field is included for historical purposes
and is rarely used by newer applications.)
-
The data and quals fields can hold any type of Java
Object .
- Tables are by far the most common Java
Object .
X-Midas Users Take Note: |
In X-Midas all messages are packed into an array of bytes that can be said to be
configured (the bytes follow a pre-defined structure) or unconfigured (message comes with
a field telling how to interpret the bytes). This is not the case in NeXtMidas. In
NeXtMidas all messages have a fixed set of fields (see above) in addition to
a "free-form" data field that can hold any Java Object .
|
Note: |
Certain message names are reserved and have special uses. These
names should be avoided when composing messages. Also, since command id's
become the message name when interacting with the macro, users should not
assign any commands an id with one of these reserved names:
EXIT
ERROR
EXEC
MACRO
|
|
|
|