Defining Custom ASCII Templates
Templates
Custom messaging uses the concept of templates and matching those templates. Templates are first defined that specify the general format of how packets of interest appear on the network. Information to be broadcasted on the network is composed using the defined templates with data from the schema inserted as specified. Information (network packets) to be received from the network must first match a defined template format then data is extracted and made available to the schema.
Creating Templates
Right clicking on the logical ASCII network name in the Workspace Network View and selecting Properties shows the Configure Network screen. Select Ascii Settings to the left and click on Add to begin defining the message template, Edit to modify an existing template, or Remove to delete an existing template. The figure below shows the dialog with four messages already defined. Clicking Add or Edit shows the ASCII Custom Message Template screen. Insert the name of the template in the Name field. Templates are created by appending 'slices' of the information together to form the complete full packet. A 'slice' of the packet is created by choosing the data type, pin on the broadcaster / receiver operator that the information will be read from and/or written to, and fields to customize the data.
Select the Data Type from one of the following data types:
- Text: Type a fixed string of characters (numbers, letters, symbols, etc.) in the Data field.
- Float: A floating point number of a defined format
- Bool: A binary number of a defined format
- Error Check: An 8-bit number generated from the algorithm type specified in the 'Error Check' drop down box. Specify the left and right offset of the packet to include in check. Also specify the format of the result.
- Special Character: Choose from the list of avaialble special characters such as the Bell (BEL), Back Space (BS), Tab (TAB), Line Feed (LF), Vertical Tab (VT), Form Feed (FF), and Carridge Return (CR) characters.
Many of the above data types can be formatted using C 'printf' like commands. For example:
- s Specifies one or more characters.
- f Signed floating point value having the form -dddd.dddd, where dddd is one or more decimal digits. The number of digits before and after the decimal point is specified as b.a
For a complete reference of the possible format options for Custom ASCII templates please refer to Custom ASCII Protocol Formatting Options.
When the 'slice' is defined, press Append to add it to the packet format. Select Insert, Modify, and Delete to futher define the slices. Note that the Preview line will show an example of the packet.
 Figure 9.83. Adding Message Definitions to an ASCII Network
Many templates can be defined for a particular network.