Vous êtes sur la page 1sur 37

C O NT R O L I N S T R U M E N T S F L E E T M AN AG E M E N T S E R V I C E S

FM TERMINAL SCRIPT EDITOR SOFTWARE DEVELOPMENT KIT USER GUIDE

REV 01.03 25-June-2001

TABLE OF CONTENTS

1 SCOPE..........................................................................................................................................................4 2 THE SCRIPT FILE.........................................................................................................................................5 2.1 SCRIPT FILE FORMAT - OVERVIEW..................................................................................................................5 2.1.1 Script File Headers..................................................................................................................................................5 2.1.2 Events and Menus....................................................................................................................................................6 2.2 EVENTS........................................................................................................................................................................6 2.2.1 Event Components...................................................................................................................................................7 2.2.1.1 EventType.........................................................................................................................................................7 2.2.1.2 EventCheck.......................................................................................................................................................7 2.2.1.3 EventResultA....................................................................................................................................................8 2.2.1.4 EventResultB ...................................................................................................................................................8 2.2.1.5 EventChild........................................................................................................................................................9 2.2.1.6 EventText..........................................................................................................................................................9 2.3 MENUS........................................................................................................................................................................10 2.3.1 Menu Components.................................................................................................................................................10 2.3.1.1 MenuType.......................................................................................................................................................10 2.3.1.2 MenuRedraw..................................................................................................................................................11 2.3.1.3 MenuSelect.....................................................................................................................................................12 2.3.1.4 MenuReturn....................................................................................................................................................12 2.3.1.5 MenuChild......................................................................................................................................................13 2.3.1.6 MenuText........................................................................................................................................................13 2.4 MNEMONICS............................................................................................................................................................14 2.5 AVAILABLE FUNCTIONS (DFUNC), FUNCTION-ACTIONS (DFUNCACT) AND VALUES....................14 2.5.1 Receive Value (Function 0)..................................................................................................................................15 2.5.2 Convert Value (Function 1)..................................................................................................................................15 2.5.3 Display Value (Function 2)..................................................................................................................................16 2.5.4 Return Value (For setting up Fleet Logbook report messages) (Function 3).....................................................17 2.5.5 Update Value (Function 4)...................................................................................................................................17 2.5.6 Store Settings (Function 5)...................................................................................................................................17 2.5.7 Evaluate Condition (For Events) (Function 6)....................................................................................................18 2.5.8 Load Value (Function 7).......................................................................................................................................18 2.6 CREATING AN EVENT...........................................................................................................................................19 2.6.1 Logging Requests..................................................................................................................................................20 2.6.2 Validating Mnemonics..........................................................................................................................................20 2.6.3 Evaluating Event Status.........................................................................................................................................20 2.6.4 Violations...............................................................................................................................................................22 2.7 CREATING A MENU................................................................................................................................................23 2.7.1 Jumping to a Child Menu (For numbered menu option).......................................................................................23 2.7.2 Logging User Entry...............................................................................................................................................24 2.7.3 Displaying Current Parameter Values...................................................................................................................25 2.8 ADDITIONAL REMARKS ON SCRIPT FILES....................................................................................................26 2.8.1 sequence.................................................................................................................................................................26 2.8.2 adding comments...................................................................................................................................................26 2.8.3 delimiting menu structures....................................................................................................................................26 2.8.4 text display limitations...........................................................................................................................................27 2.8.5 ALB and MLB File Extensions.............................................................................................................................27

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 2 of 37

3 GAPHIC FILES............................................................................................................................................28 4 COMMA DELIMITED (CSV) FILES.............................................................................................................29 5 COMPILING SCRIPT FILES.......................................................................................................................30 TUTORIALS..................................................................................................................................................32 TUTORIAL ONE: Inserting A New Sub-Menu With Two User Entry Fields.....................................................32

APPENDIX A: LIST OF AVAILABLE MNEMONICS (CODES) ...................................................................36 APPENDIX B DISPLAYABLE CHARACTERS.............................................................................................37

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 3 of 37

1 SCOPE
This document serves to describe the procedures involved in writing a successful FM Terminal script file. The script file facility of the FM Terminal is a powerful feature that allows for the complete reconfiguring of the menu structure and associated functionality of the FM Terminal. Basic understanding of scripting and script principles is assumed. An understanding of the concepts of data types binary, hexadecimal representation will also prove beneficial when consulting this document. A great deal of the process involved in writing a script command requires bit and byte level manipulation. The FM Terminal is entirely dependent on the contents of the script and how it will be interpreted. For this reason, a poorly designed script could have a major effect on the operation of the FM Terminal. It is essential that the fundamentals of script file design be clearly understood before embarking on the creation of new files or file entries. Where possible, model new menu and event structures on existing structures that have been tested and are known to work. If new structure types are required, be sure to test them thoroughly before implementing any major changes to multiple FM Terminals. It is hoped that through the use of menu scripting as described in this document, the FM Terminal will be completely customisable and meet the unique requirements of individual fleets. The discussion to follow will first focus on the script file layout and menu/event command content. Additional information will cover the files required and indexed by the script file.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 4 of 37

2 THE SCRIPT FILE


2.1 SCRIPT FILE FORMAT - OVERVIEW

Currently there are two types of script files available, the automatic (ALB) and manual (MLB) types. The differences between the two concerns automatic menu jump events associated with the Fleet Logbook. This will be discussed in more detail later in this document. 2.1.1 SCRIPT FILE HEADERS

A B C D E F

Figure 1. Script File Headers

A-

ModuleNo This number is used by the FM Terminal to identify itself to other units on the FM200 communication bus. The module number must not be changed. DDMNumber The DDM Number refers to the FM Terminal device driver number for the menu script and determines where the script will be stored in the FM Terminal memory. The DDMNumber must not be changed. DDMVersion The DDM Version refers to the revision of the script and should be incremented after each change to the script. It is a hexadecimal number with a maximum value of 0xffh. DDMText The DDMtext is stored in the header of the binary file created after the script has been compiled. This text will be displayed in the FM Terminal device driver listing in the FM2000. ScriptLanguage The ScriptLanguage designator references a comma delimited (CSV) file to be used for menu generation. The CSV file includes all text strings that appear in the script file. The file will also contain text associated with each script file string which will be displayed in the various menu and event warning windows on the FM Terminal screen. The advantage of this text association concerns the generation of alternative languages for the generated script see section 4 on Comma Delimited Files.

B-

C-

D-

E-

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 5 of 37

F-

Graphic Files

The FM Terminal supports the inclusion of various graphics into the menu structure. All graphic files are listed at the top of the script file as shown above. For example, in the above illustration, Graphic 0 refers to the Splash screen shown at start up. 2.1.2 EVENTS AND MENUS

The remainder of the script file is composed of the various events and menu items that operate within the FM Terminal. All event and menu items in the script file are composed of command line Components. All command lines in the script are of the format: Command = Item1, Item2, Item3, ItemN It should be noted that: Commas must separate all items. All items are byte-sized unless otherwise stated. Value items that are 32-bit numbers (Long values) must include an L after the number to indicate this. Numeric entries can be in decimal or hexadecimal. When using hexadecimal entries, the number must be preceded with a 0x prefix.

For the remainder of this text, where an item is enclosed in square brackets, this implies that the item is composed of more than one sub item. An example of this is the [DfuncAct Dfunc] item. Dfunc and DfuncAct can each be set to any value from 0 to 15 (0xf in hexadecimal). Combined, they form a single byte with a value from 0 to 255 (0 to 0xff in hexadecimal). It is often beneficial to use hexadecimal representation in these cases as it results in a simpler interpretation of the sub item. For example, if a [DfuncAct Dfunc] pair is displayed as 0x24, it is clear to see that DfuncAct has a value of 2 and Dfunc is equal to 4.

2.2

EVENTS

Although events can generate a variety of possible results, they all adopt a format similar to the example of a switch on event shown below.

Figure 2. Event Sample


CIFMS FM TERMINAL SCRIPT EDITOR Page 6 of 37

2.2.1 2.2.1.1

EVENT COMPONENTS EventType

The FM Terminal interpreter uses the EventType component as well as the MenuType component discussed later in this text to distinguish between events and menus. The script file writer also has the option of defining a procedure call in this command line. The procedure included in this command will be called once only, when the command is first executed. If the procedure call returns a Boolean (True/False) value, this can be used to determine whether the visible component of the event should be displayed or not. This is achieved through the setting of the DisplayTime item. DisplayTime is more relevant for use with menus but has been included with events for completeness. Command Line: EventType1 = ItemType, Action, [DfuncAct Dfunc], Value, DisplayTime Components: ItemType: Describes what the item does. The following bits are allocated: BIT 0: 0 = A heading or information line, cannot be selected 1 = A menu item BIT 1: Event item BIT 2: Option numbering, 1 = item will be numbered. BIT 3: Request BIT 4: Reserved BIT 5: Reserved BIT 6: Reserved BIT 7: Reserved Action, [DfuncAct Dfunc], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: Function-action number Value: A 32 Bit number (Options available for Dfunc, DfuncAct will be discussed in section 2.5) DisplayTime: A value of 0 will result in the item always being displayed, a value of 1 will result in the item only being displayed if the result of the device driver function called in EventType is True. 2.2.1.2 EventCheck

Defines how often, and which procedures to call to check for the event condition. Some EventCheck lines are single line commands for example, to determine the validity of a mnemonic. However, EventCheck lines are often formulated in threes, the first two lines set up the two items for comparison and the third line determines the operator used in the comparison. When there are more than one set of comparisons, all comparisons must be found to be true for the entire event to be true.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 7 of 37

Command Line: EventCheck1 = ChkAction, [ChkDfuncAct ChkDfunc], ChkValue Components: For ChkAction, the following actions are possible: 0: 1: 2: Call to a device driver function when item is first checked Call to a device driver function every refresh cycle Call to a device driver function every 2nd refresh cycle . . . Call to a device driver function every 254th refresh cycle No further actions

254: 255:

ChkDFunc: Contains the function number ChkDFuncAct: Contains the Function Action number (Options available for ChkDfunc, ChkDfuncAct will be discussed in section 2.5) The device driver function selected will be passed the following parameters: 2.2.1.3 The returned value of the last device driver function called The 32 bit value specified in ChkValue

EventResultA

Defines what is to be done when the conditions of an event are satisfied (when all EventCheck actions return a true). Command Line: EventResultA1 = RsaAction, [RsaDfuncAct RsaDfunc], RsaValue Components: Action, [DfuncAct Dfunc], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 4 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: Function-action number Value: A 32 Bit number (Options available for Dfunc, DfuncAct will be discussed in section 2.5) 2.2.1.4 EventResultB

Defines a second set of event handling conditions that will only be executed when the first action of EventResultA returns a true. Command Line: EventResultB1 = RsbAction, [RsbDfuncAct RsbDfunc], RsbValue

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 8 of 37

Components: Action, [Dfunc DfuncAct], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 6 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: Function-action number Value: A 32 Bit number (Options available for Dfunc, DfuncAct will be discussed in section 2.5) 2.2.1.5 EventChild

This event line specifies the menu to jump to if the event action requests a jump to a child menu. Command Line: EventChild= ChildName Where ChildName = name of child menu 2.2.1.6 EventText

This defines the style of text and the actual text to be displayed. Command Line EventText1 = TextStyle, Units, Text Components: TextStyle: Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Units: Refers to the units associated with the text (for data entry fields otherwise empty) Text: The text string associated with the event. Note: The script file uses commas as separators between menu items within menus and events. It is therefore not possible to include commas within text strings. Reset Local Width Height Centred Inverted Reserved Reserved Defines if the screen must be cleared before displaying text Defines the origin of the text Local text implies text received from a source other than the script driver. Defines the width of the characters, 0 being 1 to 1, 1 being 2 to 1. Defines the height of the characters, 0 being 1 to 1, 1 being 2 to 1. Defines if the text is to be left or centre justified on a line. For inverted text (1 = inverted).

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 9 of 37

2.3

MENUS

Figure 3. Menu Sample

Menu items can occur singly or can be grouped together. The example above illustrates a menu heading and 3 options. As menus are intended to respond to user intervention, all menus respond to user key presses. Menus will respond inherently to the ESC key which when pressed will cause the FM Terminal menu system to return to the parent menu of the current menu.

2.3.1 2.3.1.1

MENU COMPONENTS MenuType

Command Line: MenuType1 = ItemType, Action, [DfuncAct Dfunc], Value, DisplayTime Components: ItemType: Describes what the item does. The following bits are allocated: BIT 0: 0 = A heading or information line, cannot be selected 1 = A menu item BIT 1: Event item BIT 2: Option numbering, 1 = item will be numbered. BIT 3: Request BIT 4: Reserved BIT 5: Reserved BIT 6: Reserved BIT 7: Reserved

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 10 of 37

Action, [DfuncAct Dfunc], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: Function-action number Value: A 32 Bit number (Options available for Dfunc, DfuncAct will be discussed in section 2.5) 6. User Entry causes a jump to a special User entry child menu for generating an entry field (Refer to paragraph 2.7.2 on page24) DisplayTime: A value of 0 will result in the item always being displayed, a value of 1 will result in the item only being displayed if the result of the device driver function called in MenuType is True.

2.3.1.2

MenuRedraw

Defines how often, and which procedures to call to refresh the menu item. See below for further definitions. When there is more than one MenuRedraw line within a single menu item, the second and subsequent actions will only be valid if the first Action occurred and in those cases, all values other than 255 will always result in an action. There is a wide range of MenuRedraw functions that will respond to different user input. Command Line: MenuRedraw1 = RedAction, [RedDfuncAct RedDfunc], RedValue, Components: For Action 1, the following actions are possible: 0: 1: 2: Call to a device driver function when item is first displayed Call to a device driver function when item is redrawn every refresh cycle Call to a device driver function when item is redrawn every 2nd refresh cycle . . . Call to a device driver function when item is redrawn every 254th refresh cycle No further actions

254: 255:

RedDFunc: Contains the function number RedDFuncAct: Contains the Function-action number (Options available for RedDfunc, RedDfuncAct will be discussed in section 2.5) The device driver function selected will be passed the following parameters: The returned value of the last device driver function called The 32 bit value specified in RedValue

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 11 of 37

2.3.1.3

MenuSelect

Defines the action to be taken when the menu item is selected. This command line will be executed when the item has focus and the user presses the RET key. There can be more than one MenuSelect line. Command Line: MenuSelect1 = SelAction, [SelDfuncAct SelDfunc], SelValue Components: Action, [DfuncAct Dfunc], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 8 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: Function Action number Value: A 32 Bit number 6. (Options available for Dfunc, DfuncAct will be discussed in section 2.5) User Entry causes a jump to a special User entry child menu for generating an entry field (Refer to paragraph 2.7.2 on page 24)

2.3.1.4

MenuReturn

When a child menu returns to a parent menu, the parent menu runs the MenuReturn line if it exists. There can be more than one MenuReturn line. This allows child menus to return parameters to parents. Command Line: MenuReturn1 = RetAction, [RetDfuncAct RetDfunc], RetValue Components: Action, [DfuncAct Dfunc], Value: The available actions include: 0: No further action 1: Jump to a child menu 2: Jump to a parent menu 3: Reserved 4. Menu redraw 10 5. Call to device driver function The following items are passed in the call: Dfunc: Function number DfuncAct: FunctionAction number Value: A 32 Bit number (Options available for Dfunc, DfuncAct will be discussed in section 2.5)

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 12 of 37

2.3.1.5

MenuChild

This menu line specifies the heading of the child menu to jump to if the action requests a jump to a child menu. The request for a child menu jump will usually be included in a MenuSelect line. As a result, the child menu will be executed when the user presses the RET key. Command Line: MenuChild= ChildName Where ChildName = name of child menu

2.3.1.6

MenuText

This defines the style of text and the actual text to be displayed. The MenuText line contains the menu header/item text as well as any units (quantity/currency) that may need to be displayed. Command Line MenuText1 = TextStyle, Units, Text Components: TextStyle: Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Reset Local Width Height Centred Inverted Defines if the screen must be cleared before displaying text Defines the origin of the text Local text implies text received from a source other than the menu driver. Defines the width of the characters, 0 being 1 to 1, 1 being 2 to 1. Defines the height of the characters, 0 being 1 to 1, 1 being 2 to 1. Defines if the text is to be left or centre justified on a line. The default should be to centre headers and left-justify other text such as menu items. For inverted text (1 means inverted). Note text forming a menu option does not have to be inherently marked as inverted to show if it is selected. The interpreter will invert the text automatically during menu operation.

Bit 6 Bit 7 Units:

Reserved Reserved

Refers to the units associated with the text (for data entry fields otherwise empty) Text: The text string associated with the menu item. Note: The script file uses commas as separators between menu items within menus and events. It is therefore not possible to include commas within text strings.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 13 of 37

2.4

MNEMONICS

Mnemonics will appear at various points within a script and deserve a special mention here. Mnemonics form message identifiers used for passing data between the different modules of the FM200 Fleet Management system. Mnemonics will always be preceded by an @ within the script file. Each consists of 5 alphanumeric characters, each character is compressed into a 6-bit number: 00 3F (hexadecimal). The character set used is as follows: Table 1: Character Mapping for Item Naming Convention
Hex 0 1 2 3 0 0 G W # 1 1 H X $ 2 2 I Y % 3 3 J Z & 4 4 K ( 5 5 L ) 6 6 M * 7 7 N + 8 8 O , 9 9 P : A A Q ; . B B R < / C C S = D D T > E E U ? ~ F F V @ _

The 5 character IDs of existing mnemonics have been chosen to best describe the field or property that they will be storing. A list of currently assigned mnemonics and the corresponding data that they represent is included in Appendix A on page 36. If creating a new mnemonic, be sure to enter a meaningful name to assist with data integrity and script readability.

2.5

AVAILABLE FUNCTIONS (DFUNC), FUNCTION-ACTIONS (DFUNCACT) AND VALUES

The assignment of the Function and Function-action information within the script forms a single byte (4 bits for the Function and 4 for the Function-action) As a result, the interpreter has the ability to respond to 16 possible Function numbers (0 15). In turn, each Function can refer to one of 16 possible Function-actions (0 15). In theory, all Functions and Function-actions can be integrated into both events and menus although some actions have been introduced specifically for either events or menus. An example of this is the Evaluate Condition action that was designed for use in events. At present, only half of the available numbers have been assigned to Functions and Function-actions. The current assignment of Functions is as follows: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 = = = = = = = = = = = = = = = = RECEIVE VALUE CONVERT VALUE DISPLAY VALUE RETURN VALUE UPDATE VALUE STORE SETTINGS EVALUATE CONDITION LOAD VALUE Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved

The corresponding assignment of Function-actions is shown below. Some actions also require a 32-bit value to be passed to the FM Terminal script interpreter. Where applicable, the assignment of Value is described below.
CIFMS FM TERMINAL SCRIPT EDITOR Page 14 of 37

2.5.1

RECEIVE VALUE (FUNCTION 0) DfuncAct 0 = REQUEST FROM FM200 (Requests the current value associated with a mnemonic from the FM200. The result of the request is stored internally in the FM Terminal) Value = 4 Byte ID Mnemonic GET STORED MNEMONIC (Retrieves the current value associated with a mnemonic stored in the FM Terminal) Value = 4 Byte ID Mnemonic CHECK FOR VALID MNEMONIC (Checks that the mnemonic appears in the current mnemonic table and is valid) Value = 4 Byte ID Mnemonic

DfuncAct 1 =

DfuncAct 2=

. . DfuncAct 15 = REQUEST FROM USER (TEXT INPUT)* (Sets up user entry field for user to enter a text string or numeric value) Value = User input information Byte0 = Number of characters (including decimal places) Byte1 = Bit 0 - Numeric characters Bit 1 - Alphabet characters Bit 2 - Is Alpha first? (1 = display alpha before numeric) Bit 3 - Decimal separator (0 = point, 1 = comma) Bit 4-7 - Decimal places (0-15) * Note: At present, entry fields containing only numeric characters with no decimal places, are not supported. When no decimal places are required, bits 0&1 should be set and, bits 2 to 7 cleared. Actions 0 and 1 have been created to allow for asynchronous update of property values and must be used in combination to achieve the desired purpose. Action 0 initiates a request that is conducted in the background. This is due to the fact that the time taken to retrieve data from the FM200 is dependent on external elements such as the availability of the bus and the current status of the FM200. For this reason, Action 0 will not return a value directly in the procedure call. The value will be returned and stored in a look-up table within the FM Terminal as a background operation. Action 1 is then required to retrieve this value from the local look-up table.

2.5.2

CONVERT VALUE (FUNCTION 1) DfuncAct 0 = Multiply/Divide conversion (Performs a multiplication and division on a number) Value = Conversion Factor Byte0 = Division factor Byte1 = Multiplication factor Reserved

DfuncAct 1 = . .

DfuncAct 15 = Reserved

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 15 of 37

2.5.3

DISPLAY VALUE (FUNCTION 2) DfuncAct 0 = SHOW DISPLAY SETUP (Shows Display Adjustment screen) Value = Graphic number of Display Adjustment graphic DISPLAY SPLASH SCREEN (Shows Splash screen Differs from Action 0 by also extracting and displaying software version numbers on the Splash screen) Value = Graphic number of Splash screen graphic DISPLAY LAST CRITICAL EVENT (Displays a description of the last critical event. If the text string is unavailable, the mnemonic associated with the event will be displayed) Value = Reserved DISPLAY INPUT VALUE (Displays the value obtained from previously called procedure) Value = Display format information Byte 0 Bit 0 Entry Type: 0 = Numerical Bit 1 1 = Date format Bit 2 2 = Time format (3 7 Reserved) Bit 3 (If Entry Type = Numeric) Decimal separator Set = Comma, Clear = Point (If Entry Type = Date) Format Set = Month/Day/Year, Clear = Day/Month/Year Number of Decimal places (0-15) Location on line (0 - 127) 0 = Location refers to start of input (Left Justify) 1 = Location refers to end of input (Right Justify)

DfuncAct 1 =

DfuncAct 2 =

DfuncAct 3 =

Bit 4-7 Byte 1 Bit 0 6: Bit 7: DfuncAct 4 = DfuncAct 5 =

DISPLAY VIOLATION (Displays the message associated with an event violation in the pop-up window) TOGGLE CURRENT MENU ITEM (Causes the currently selected menu item to flash between inverted and normal a specified number of times) Value = Number of repetitions DISPLAY WARNING SCREEN (Displays warning popup screen) Value = Reserved

DfuncAct 6 = . .

DfuncAct 15 = Reserved

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 16 of 37

2.5.4

RETURN VALUE (FOR SETTING UP FLEET LOGBOOK REPORT MESSAGES) (FUNCTION 3) DfuncAct 0 = ID1 SETTING (Sets the value to be sent in Mnemonic ID1) Value = Mnemonic ID1 ID2 SETTING (Sets the value to be sent in Mnemonic ID2) Value = Mnemonic ID2 FORMAT STRING (Converts entry text to value if numeric entry or calculates string length and commits entire message (Mnemonic1, Mnemonic2, User entry) to the Fleet Log Book buffer)

DfuncAct 1 =

DfuncAct 2 =

. DfuncAct 15 = Reserved

2.5.5

UPDATE VALUE (FUNCTION 4) DfuncAct 0 = ADJUST DISPLAY (Implements control for contrast and backlight adjustment as well as bar graph indicators) Value = Reserved STORE DRIVING REASON (Stores the currently selected driving reason in memory) Value = Driving Mnemonic STORE RESTING REASON (Stores the currently selected resting reason in memory) Value = Resting Mnemonic

DfuncAct 1 =

DfuncAct 2 = . .

DfuncAct 15 = Reserved

2.5.6

STORE SETTINGS (FUNCTION 5) DfuncAct 0 = STORE DISPLAY SETTINGS (Stores contrast and backlight levels to non-volatile memory if updated) Value = Reserved STORE LANGUAGE SETTINGS (Switches between languages (if an alternative language is available) and stores new language number in non-volatile memory) Value = Reserved POPULATE FLB BUFFER Value = Reserved STORE DAYLIGHT SAVING SETTING (Stores the offset (number of hours) correction of daylight saving to non-volatile memory) Value = Reserved

DfuncAct 1 =

DfuncAct 2 = DfuncAct 3 =

. DfuncAct 15 = Reserved

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 17 of 37

2.5.7

EVALUATE CONDITION (FOR EVENTS) (FUNCTION 6) DfuncAct 0 = SET UP PARAMETER 1 mnemonic (Loads a mnemonic value in Parameter 1) Value = 4 Byte mnemonic ID SET UP PARAMETER 2 mnemonic (Loads a mnemonic value in Parameter 2) Value = 4 Byte mnemonic ID SET UP PARAMETER 2 - numeric (Loads a numeric value in Parameter 2) Value = 4 Byte numeric value (long) SET UP OPERATOR AND EVALUATE (Used to select the comparison operator and to perform the comparison between the contents of Parameter 1 and Parameter 2 (which are populated using Actions 1 and 2 above). The result is always true/false) Value: 0 = = Equal To 1 = ">" Greater Than 2 = ">=" Greater Than Or Equal To 3 = "<" Less Than 4 = "<=" Less Than Or Equal To CHECK FLEET LOG BOOK BUFFER IS EMPTY (The result is true if the buffer is empty)

DfuncAct 1 =

DfuncAct 2 =

DfuncAct 3 =

DfuncAct 4 =

If multiple Evaluate condition routines occur in one event item, then all must be true for the event condition to be true i.e. the results of each evaluation are ANDED together.

2.5.8

LOAD VALUE (FUNCTION 7) DfuncAct 0 = LOAD LOCAL MNEMONIC (Selects the local variable by mnemonic. Local variables are internal to the FM Terminal, for example No Activity Timer, Backlight State etc.) Value = mnemonic LOAD LOCAL VALUE (Assigns the value to write to the selected FM Terminal variable. Used in conjunction with Action 0) Value = new value to assign to mnemonic LOAD NEW MNEMONIC (Adds a new mnemonic and value to the mnemonic table. Used in conjunction with Action 0) Value = new value to assign to mnemonic START UP/SHUT DOWN (Will start up or shut down the module depending on its current status) RECALL OPTION NUMBER (Recalls the previously selected option number. When a new menu is displayed, focus is usually set on option 1. Recall option number is used to set initial focus to the previously selected option number) Value: Driving Reason 0 Resting Reason 1 Other Values 2

DfuncAct 1 =

DfuncAct 2 =

DfuncAct 3 = DfuncAct 4 =

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 18 of 37

Many of the above Function-actions work in unison to produce one action. An example of this in events is the Evaluate Condition action that requires instances of Action 0, Action 1 or Action 2 as well as Action 3 to form one evaluation. A similar effect in menus can be seen with Return Value and Load Value actions. Examples of these will be covered in sections 2.6 and 2.7. All procedures that perform a function on a variable will make that value available to subsequent command lines. In this way, it is possible to perform numerous functions on a single item through the use of a series of consecutive command lines. The order of execution must always be taken into consideration. A good example of multiple operations on a single variable is the conversion of an odometer reading from kilometres to miles.

Figure 4. Converting Kilometres to Miles

The first requirement is to obtain the current reading of the odometer. This is achieved in the first MenuRedraw line. The second MenuRedraw line converts the kilometre value to an approximated mile value by multiplying by 5 and dividing by 8. The third MenuRedraw line will then display the mile value. This type of menu will be discussed in more detail further on in this document.

2.6

CREATING AN EVENT

Every event must contain an EventType line to distinguish it from a menu. With events, bit 1 of the ItemType byte is always set. In general, there will be no action associated with the EventType line. As a result, the EventType line will usually have the following format: EventType = 2, 0, 0, 0L, 1 There are currently three implementations of the EventCheck line. 1. 2. 3. Logging requests. Validating mnemonics. Evaluating the status of event conditions.

These implementations plus the special Violation event will be discussed in this section

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 19 of 37

2.6.1

LOGGING REQUESTS

Currently, many event conditions arise from properties of the vehicle that are monitored by the FM200. Examples of these include ignition status, current speed, current time, etc. The FM Terminal must request the status of these properties from the FM200. These requests are made in event items within the menu script and take the form of: EventCheck = Frequency, 0x00, @Mnemonic Where Frequency determines how often the mnemonic is requested (in number of program cycles) Mnemonic refers to the mnemonic name of the property requested. For example EventCheck = 2, 0x00, @TRP_M Would request the current Trip distance once every two program cycles. The result of the request is stored locally in the FM Terminal and is updated after every subsequent successful request to the FM200.

2.6.2

VALIDATING MNEMONICS

It is important to confirm that the property requested from the FM200 has been received successfully before using it for event evaluation. Validating a property involves ensuring that there is a copy of the property in the locally stored table. Validation checks take on the following form: EventCheck = Frequency, 0x20, @Mnemonic Where Frequency determines how often the mnemonic is requested (in number of program cycles) Mnemonic refers to the mnemonic name of the property being validated. For example EventCheck = 1, 0x20, @FM_MD Would request the validity of the mode value (armed or drive) of the FM200 every program cycle.

2.6.3

EVALUATING EVENT STATUS

Events often involve checking the value of a property against another property or some numeric value. This is achieved in the FM Terminal script through the use of three EventCheck lines. When comparing a mnemonic value with a numeric value the format would be: EventCheck = Frequency, 0x06, @Mnemonic EventCheck = Frequency, 0x26, Number L EventCheck = Frequency, 0x36, Operator L

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 20 of 37

Where Frequency determines how often the check is performed (in number of program cycles), Mnemonic corresponds to any current mnemonic recognised by the FM200 or FM Terminal, Number equals the value that the mnemonic is being compared to, Operator can have a value from 0 to 4 where: 0 = = Equal To 1 = ">" Greater Than 2 = ">=" Greater Than Or Equal To 3 = "<" Less Than 4 = "<=" Less Than Or Equal To To continue with the FM200 mode example of earlier, if the event is required to trigger when the FM200 is in drive mode then the value of the FM_MD mnemonic must be equal to zero. The check for this condition would therefore be: EventCheck = 1, 0x06, @FM_MD EventCheck = 1, 0x26, 0L EventCheck = 1, 0x36, 0L Note the inclusion of the L character after all numeric entries in the Value item. It is also possible to compare two mnemonic values directly. The format of this check is: EventCheck = Frequency, 0x06, @Mnemonic EventCheck = Frequency, 0x16, @Mnemonic EventCheck = Frequency, 0x36, Operator L The only difference being the new [DfuncAct Dfunc] combination and the inclusion of a second mnemonic in line two. The event conditions will be satisfied when the result of all EventChecks are True. If this occurs, the EventResult lines of the event will be executed. It is possible to produce a number of effects with the various functions and actions available. One example of an event result is the jump to a child menu. This type of event is currently used to start the FM Terminal Splash screen from a start up event. Child menu jumps are also utilised in automatic Fleet Logbook functionality where a condition such as Is FM200 in Drive mode? can cause a jump to the Driving Reason menu. A complete Fleet Logbook event is illustrated below.

Figure 5. An Automatic Fleet Logbook Event

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 21 of 37

2.6.4

VIOLATIONS

Another type of event that does not seem to appear in the menu script is the Violation event. These events are generated in the FM2000 front-end software and appended to the script during compilation. The script must include a reference to the External Events file of the format: ExternalEventsFile=file The External Events file is called Critical.ini and is generated by the FM2000 software. This file contains a list of critical events that the FM Terminal will respond to. Also included in this file are delays (in seconds) that the FM Terminal will wait before displaying the warning after the warning condition becomes true. The contents of Critical.ini are based on event configurations determined by the system user with FM2000. The script file will also contain a list of text strings for the available critical events. These take the following form: EventWarning = @Mnemonic, WARNING TEXT" Where Mnemonic corresponds to an existing mnemonic associated with a critical event. The text included in these statements is the text that will be displayed in the warning window when a critical event becomes true. The figure below, extracted from an existing script, shows the complete set of EventWarning entries.

Figure 6. Violation Events in the Script File

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 22 of 37

2.7

CREATING A MENU

Rules that govern the creation of new menus include the following: All menus must have a header. The header is used to access this menu from other menus or events. The format of the header is: [MenuHeader =NewMenu] Where NewMenu is the text string associated with the new menu. The first menu element of each menu structure must always be a Heading. The menu interpreter of the FM Terminal requires there to be a heading item within each menu to mark the start of the new menu within the script. Menu items are assigned Heading status in the MenuType command line. For a menu item to be classified as a Heading, Bit 0 of the first byte in the line must be set as illustrated in: MenuType = 1, 0, 0, 0L, 0 Menu option lines on the other hand have this bit set to zero. A menu option may start with: MenuType = 0, 0, 0, 0L, 0 If option numbering is required for each menu option, Bit 3 of the MenuType byte must be set: MenuType = 4, 0, 0, 0L, 0 Numbering will always start at 1 from the first numbered option below the Menu Heading. There must always be a MenuChild Tag. If there is no child menu associated with the menu item , then the line will read: MenuChild = There must always be a MenuText Tag. If there is no text to be displayed with a menu item, the item must still include the line: MenuText = 0, , There are a variety of Functions, Function-actions available for creating new menu items. Some are very specific such as setting the current language whereas others may be more general. A selection of some of the more common menu formats will be discussed further in this section.

2.7.1

JUMPING TO A CHILD MENU (FOR NUMBERED MENU OPTION)

This resembles child menu jumps in events. The format could possibly be: MenuType MenuSelect MenuChild MenuText = 4, 0, 0, 0L, 0 = 1, 0, 0L = "Childmenu Name" = 0, "", "Option Name"

Where Childmenu Name = Header of child menu. Option Name = Name of option displayed in current menu.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 23 of 37

For example, to jump to the Fleet Log Book menu: MenuType MenuSelect MenuChild MenuText = 4, 0, 0, 0L, 0 = 1, 0, 0L = "FLB" = 0, "", "Fleet Log Book"

2.7.2

LOGGING USER ENTRY

At present the main use of these menu elements is the logging of Fleet Logbook entries. The principle of such an element can be best explained with an example: MenuType = 4, 0, 0, 0L, 0 MenuSelect = 6, 0, 0x030AL MenuReturn = 5, 0x03, @COSCD MenuReturn = 5, 0x23, 0L MenuChild = "UserEntry" MenuText = 0, "", "Cost code" The MenuType line indicates that this is a menu option and not a heading. The option is numbered. The child menu is called UserEntry and the option text to be displayed is Cost code. The 0 in the MenuText line indicates that there is no special formatting of the Cost code text i.e. the text will be displayed as leftjustified, normal sized text. If the user presses the RET key while this menu is displayed, the MenuSelect line will be executed. The MenuSelect action (6) indicates a User entry action. There is no associated Function; Function-action pair so this field is set to 0. The value of 0x030AL will be passed to the User Entry menu. [MenuHeader="UserEntry"] MenuType = 1, 0, 0, 0L, 0 MenuRedraw = 1, 0xf0, 0L MenuSelect = 2, 0, 0L MenuChild = "" MenuText = 0, "", "" The value of 0xf0 in the MenuRedraw line of User Entry indicates that Action 15 (0xf) of Function 0 will be executed. In other words, the Request From User action of the Receive Value function will be performed. This function will interpret the value of 0x030AL as: Byte 0 0A hex (10 decimal) Byte 1 03 hex: Bit 0 = 1 Bit 1 = 1 Bit 2 = 0 Bit 3 = 0 Bit 4-7 = 0 - Size of entry field = 10 characters - Numeric characters are accepted - Alphabet characters are accepted - Numeric characters will be displayed on first key press - Decimal separator = decimal point - No decimal places

The FM Terminal menu interpreter will use this information to display the entry field and to manage the type of information entered. After entering data into the field. The user has 2 options, to press RET which will commit the entered text for logging, or to press ESC and cancel the process of data entry. If ESC is pressed, control will return to the original cost code menu item and the data will not be recorded. On the other hand, if the user presses RET, the MenuSelect line of the UserEntry menu will be executed. The MenuSelect line instructs the interpreter to return to the parent menu. In contrast to pressing ESC, when control returns to the parent menu element, cost code; the MenuReturn items in cost code will be performed.
CIFMS FM TERMINAL SCRIPT EDITOR Page 24 of 37

The first MenuReturn line of cost code commits the cost code mnemonic (COSCD) to memory. The second line formats the text entered by the user and packages this text along with the mnemonic into a complete Fleet Logbook message. The message is then stored in memory for the FM200 to retrieve on request.

2.7.3

DISPLAYING CURRENT PARAMETER VALUES

The trip display found in existing scripts is capable of displaying the current values of certain system parameters. An example of this is the current odometer reading of the vehicle. MenuType MenuRedraw MenuRedraw MenuSelect MenuChild MenuText = 0, 0, 0, 0L, 0 = 1, 0x10, @ODO_M = 1, 0x32, 0xe010L = 2, 0, 0L = "" = 0, "", "Odo : km"

The MenuType line indicates that this is not a menu heading. In addition, this menu option will not be numbered. The first MenuRedraw line calls Action 1 of Function 0 that corresponds to a REQUEST FROM FM200 action of the RECEIVE function. In other words, the current value of the odometer (pointed to by the @ODO_M mnemonic) is requested. The second MenuRedraw line will perform the DISPLAY INPUT action of the DISPLAY VALUE function. The value associated with this execution can be broken down into: 0x10 Bit 0 = 0 Bit 1 = 0 Bit 2 = 0 Bit 3 = 0 Bit 4-7 = 1 Entry Type = 0 (Numerical) Decimal separator = Point 1 decimal place

0xe0 (11100000B in binary) Bit 0- 6 = 1100000B = 96 Bit 7 = 1: Location (column number) on screen Location refers to end of input

The odometer reading will be displayed as a numerical value with one decimal place such that the right-most character will end on column 96 of the FM Terminal screen. By default, the entry will be displayed on the same line as the text indicated in the MenuText command line. The MenuSelect line indicates a jump to the parent menu element if the RET button is pressed. Note: By using the MenuRedraw commands as illustrated in this example, it is possible to continuously refresh the odometer value displayed. It should also be noted that the menu text is refreshed every cycle. The menu text will always be written first, before the parameter is written to the screen. By formatting the text to include the entire row of the screen as in Odo : km, the entire line will be refreshed and the odometer value will be replaced each cycle. This is useful in cases where the length of the parameter is likely to change between readings. The new parameter value will only overwrite the area where it overlaps with its former value. By using an entire line refresh, the area of the screen containing the entire parameter will always be cleared.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 25 of 37

2.8
2.8.1

ADDITIONAL REMARKS ON SCRIPT FILES


SEQUENCE

The FM Terminal interpreter follows a cyclical top to bottom approach to script file execution. Ordering of events, menus and even specific command lines within events and menus can therefore impact on the way the interpreter responds to script requests. A simple example of this effect is where two events may operate on a similar condition. The outcome of the execution of the first event may impact on the response created by the second event. In cases such as this, the event of higher priority must always appear first in the script file to ensure that it is executed first. Similarly, if a series of command lines each effect the value of a single variable, the order in which the command lines appear may affect the final value assigned to the variable. 2.8.2 ADDING COMMENTS

Comments can be placed in the script file where necessary. All comments must be preceded by two forwardslash characters, //. The use of commenting is encouraged to assist in the interpretation of new events and menus. 2.8.3 DELIMITING MENU STRUCTURES

The FM Terminal interpreter uses a simple approach to servicing the items of a menu The menu heading is interpreted first, followed by each subsequent menu item. When the interpreter detects the heading of the next menu in the script, it stops processing and returns to the current menu heading. For this reason it is essential that every Menu structure contain one and only one heading element. This element must always be the first element in the structure. Also as a result of this process, the script file must always end with a dummy menu. This menu takes the form of a menu heading and is used to mark the end of the last functioning menu structure.

Figure 7. The Dummy Menu

In the above graphic, Dummy marks the end of UserEntry.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 26 of 37

2.8.4

TEXT DISPLAY LIMITATIONS

Careful attention must be made when displaying text on the screen of the FM Terminal. It is possible to include text that is too long to fit on a single line of the screen or the entire page of the screen. The recommended maximum lengths of text depend on the circumstances under which the text is to be displayed. The FM Terminal screen is composed of 128 x 64 pixels. A small character of text occupies an area of 6x8 pixels, including line spacing above, below and to the right of the character. As a result, when normal text is selected, it is possible to print a maximum of 21 characters on 8 lines on the screen. When working with normal-size text in menu applications, each item should be restricted to a single line. If longer text strings are used, the text will wrap onto a new line and disrupt the operation of the FM Terminal during menu option selection. Therefore, the recommended maximum text lengths for menu items are as follows: Menu Headings: Menu Options: These can occupy an entire line on the screen and should be limited to 21 characters. The default format of menu headings is uppercase text. If Option Numbering is not selected menu options, can be up to 21 characters long. If Option Numbering is required, the option line must reserve 3 characters for the option number, point and space. It is therefore suggested that numbered menu options should not exceed 18 characters. The area of the warning popup screen is smaller than the overall screen dimensions. This screen can accommodate a maximum of 14 normal-size characters in 6 rows.

The Warning Screen:

Apart from using normal-size text, it is possible to increase the height and width of text by a factor of 2. This introduces text types known as high, wide or large (high and wide) text. Currently, all driver warnings such as Over speeding use high text. It is important to remember that the use of this larger text will also reduce the available space for text. For example, high text used in the warning popup screen would be limited to only 3 rows of 14 characters.

2.8.5

ALB AND MLB FILE EXTENSIONS

The FM2000 software recognises two types of script files, those with automatic Fleet Logbook functionality and those without. Fleet Logbook functionality includes the ability of certain script events to initiate jumps to Fleet Logbook menus in response to system properties such as the ignition switching on or the trip starting. Scripts containing automatic events have the .alb extension. Scripts without automatic functionality have the extension .mlb. Selection between automatic and manual scripts is achieved with a checkbox in the FM2000. If you wish to create a script that is independent of automatic/manual functionality, it will be necessary to create 2 versions of the script, one with a .alb extension and a second with the .mlb extension. In this way, the FM2000 software will always compile a copy of the new script, regardless of the setting of the checkbox.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 27 of 37

3 GAPHIC FILES
The only restrictions concerning graphics is that they must be in a monochrome bitmap (BMP) format. The height and width must both be multiples of 8 pixels. The maximum size of the bitmap should not exceed 128 X 64 pixels (the maximum size of the FM Terminal screen). Bitmaps can be created in Paint and saved in monochrome bitmap format.

Figure 8. Bitmap Editing in Paint

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 28 of 37

4 COMMA DELIMITED (CSV) FILES


The final piece in the menu script puzzle is the comma delimited or CSV file. This is an optional addition to the script file and is implemented by including the following: [ScriptLanguage=Filename.csv] where Filename is the name of the comma delimited file. The purpose of the CSV file is to replace text found in the script file with text referenced in the CSV file. The existing script file utilises this process in the generation of multiple language script files. All the default script files for the different languages are identical with the exception of the CSV file referenced in the ScriptLanguage statement (and the list of Graphic files that are accessed). In other words, all text strings embedded in the script are in English. Using Deutsch.alb as an example, this script file contains a reference to the Deutsch.csv language file. An extract of this file is shown below:

Figure 9. The Comma Delimited File

The first column contains all text fields found in the script file. The second column contains all the new text strings that will replace the default English text when the new menu script is compiled. Care must be taken to ensure that the text in the left-hand column matches the text in the script precisely. Note also, that this is a case-sensitive list. If the text in the script does no match the text found in the lefthand column then the text will not be replaced. As mentioned previously, the CSV file is an optional addition to the script. If the script file has been generated for only one language, then this ScriptLanguage line can be omitted and all resultant text will be taken directly from the script file. If different text fields, which need to be displayed in another language, are added to the script, they must be appended to the left hand column of the CSV file. The translated text string must be inserted into the right hand column. It is important that the structure of the CSV file is not modified in any way. It must be a comma delimited text file with two columns. When inserting text into the CSV file, consideration should be given to the limitations of the display. For more details, see Text Display Limitations on page 27. Appendix B on page 37 shows the characters which are displayable. Only characters shown in this table, may be used in the CSV files second column

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 29 of 37

5 COMPILING SCRIPT FILES

OVERVIEW The script file needs to be compiled and converted into a device driver, which is written to a code plug and then loaded onto a FM Terminal. The FM 2000 program is used for selecting the primary and secondary languages, and for selecting manual or automatic fleet log book operation. The FM 2000 software is normally used but, for debugging purposes, the script file can be compiled manually. Both automatic (alb) and manual (mlb) script files, with the same, name must be present. Their file names must not include any spaces and the first eight characters must be unique.

Using FM 2000 The FM 2000 software automates the compiling, converting and writing to the code plug. Place the *.alb, *.mlb & *.csv files into the C:\Program Files\Fleet Manager\FMTerminal directory. Right click on the vehicle for which the script file is to be changed. Select properties. Scroll to far right of options and select FM Terminal. Make sure the FM Terminal Connected option is selected. Select the primary and secondary languages from the option lists. They can be the same. Select either the Automatic (alb) or Manual (mlb) option. Select Apply. If the properties have changed, the code plug will be updated automatically. Otherwise, it must be updated manually by selecting Code Plug, Initialise Plug, Vehicle Plug. Make sure the option Build FM Terminal Menus is selected. If the compiler detects an error, the message An error occurred while compiling the FM Terminal Menu will be displayed. If this message is displayed, open the file script.lst to view a list of the detected errors. A temporary file, script.fmt combines the two script files. Line numbers in the error file script.lst refer to the line numbers in script.fmt and not the original *.mlb or *alb file. Correct the errors and repeat the compile procedure until no errors are detected. Continue as prompted.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 30 of 37

Using Command Line When debugging, the command line compiler, provides error details without the FM2000 front-end software. To use the command line compiler: Copy the following files from C:\Program Files\Fleet Manager\FM Terminal to a temporary directory. makescr.exe External Events File, critical.ini Required script language file, *.csv. Place the new script files (*.alb and *.mlb) into the same temporary directory. At the DOS prompt run makescr <language 1> <language 2> <ext events> <bin out> language 1 is the new script file (eg. English.alb) language 2 is the same new script file, but referencing another language (eg. French.alb) Note: script 1 and script 2 must be functionally the same. Normally, they would be two different languages but, could both be the same (eg English.alb and French.alb or English.mlb and English.mlb). *.alb and *.mlb scripts should not be compiled together. ext events is the critical.ini file, as previously generated by the FM2000 software. bin out is the name of the binary file, which will be generated. Unsuccessful compilation is indicated by the creation of the error file script.lst. Open this file to view a list of the detected errors. Line numbers in the error file (script.lst) refer to the file script.fmt, which combines the language1 and language 2 files.

When the script files are successfully debugged, copy them to the C:\Program Files\Fleet Manager\FMTerminal directory and follow the FM2000 procedure, as outlined above.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 31 of 37

TUTORIALS
The following tutorials show the steps required to implement certain changes to the FM Terminal menu. Before any files are modified, always make a copy of the original file and save it under a different name. Never alter the original files. The file names must not include any spaces and the first eight characters must be unique. The new files, used in the tutorials, will be based on existing *.mlb, *.alb and *.csv files.

TUTORIAL ONE:

Inserting A New Sub-Menu With Two User Entry Fields

BACKGROUND This customised application requires a new sub menu to be added which will allow the user to input specific details regarding the vehicles payload. Payload Details will be added to the Fleet Log Book menu and, when selected, will provide for a Depot Code and Weigh Bridge Mass to be entered.

STEP 1.

COPY EXISTING FILES

Copy and rename the manual log book (*.mlb ) and automatic log book (*.alb ) script files, which are to be modified. In this example, the changes are based on the script files English.alb and English.mlb, which are located in the directory C:/Program Files/Fleet Manager/FMTerminal. Open them into a text editor and save them as EnglishPayload.alb and EnglishPayload.mlb. The file name must not include any spaces and the first eight characters must be unique. Make sure the files do not include any formatting by saving them as text only files. The changes will initially be made to the mlb file and later repeated in the alb file. For more details on alb and mlb files, see ALB and MLB File Extensions on page 27.

STEP 2.

ADD NEW MENU ITEM

The new Payload Details menu must be added to the Fleet Log Book menu, which is a child menu of Main Menu. Locate the insertion point in the English Payload.mlb by working through the script file to the point shown below.

Locate the Main Menu section.

Locate the Fleet Log Book option. Note that the child menu, FLB, is called when Fleet Log Book is selected.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 32 of 37

Locate the FLB child menu. This is where the new menu option, Payload Details (option 5), is to be inserted. It points to the Payload child menu.

Insert the new menu option as shown in the highlighted block. The text Payload Details will be displayed as option 5. When selected, the menu will jump to the child menu, Payload, which is still to be created. Details of the items configuration are: MenuType: MenuSelect: Menu Child: MenuText: Item will be numbered. No further action. Jump to a child menu. Name of child menu is Payload. Text style: Units: Text: Screen is not cleared before displaying text. Text is left justified Text is displayed at normal size. None Payload Details will be displayed.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 33 of 37

STEP 3.

CREATE THE CHILD MENU

The Payload child menu must now be inserted below the point where it is first called. For ease of reading the script, a logical sequence should be maintained. Payload will, therefore, be positioned below the FLBValue2 child menu. The simplest way to create a new child menu is to find an existing menu which is similar, copy and modify it. In this case, the menu to be created will be similar to the existing Fuel Entry menu A. Enter Header Details [MenuHeader="Payload"] identifies the menu name, which must be identical to that specified in the parent menu. MenuType = 1,0,0,0L,0 classifies this as a heading. MenuChild = "" must always be included and must remain empty in a header. MenuText = 0x10,"","PAYLOAD DETAILS" specifies the heading name and that it is centre justified on the display. B. Enter Option 1 Details MenuType = 4,0,0,0L,0 specifies that the option will be numbered. MenuSelect = 6,0,0x2309L causes a jump to a special UseEntry child menu. The hex value, 0x2309L, will be passed to the User Entry menu where it sets the size of the entry field to 9 characters, and allows both alpha and numeric characters to be entered. For more details on this option see Logging User Entry on page24. MenuReturn = 5,0x03,@DEPOT commits the depot code mnemonic (DEPOT) to memory. As custom data is to be stored, a new mnemonic must be created. A five character code, which clearly describes the data, must be selected. This code will be associated with the data when generating reports, using the FM2000 software. Registered codes, used in the supplied script files, are expanded into the full text description when the reports are generated by the FM2000 software. Before selecting a new mnemonic, check the table of registered mnemonics in Appendix A (Page 36) and be sure to select a unique code. For more details on mnemonics see MNEMONICS on page 14. MenuReturn = 5,0x23,0L formats the text entered by the user and packages this text along with the mnemonic into a complete Fleet Logbook message. MenuChild = "UserEntry" calls the special "UserEntry" child menu. MenuText = 0,"","Depo Code" specifies the text to be displayed above the entry field and how it is formatted. C. Enter Option 2 Details Option 2 is set up in the same way as option 1, but with a different mnemonic being used to identify the weigh bridge mass value. D. Save The File. Save the file, making certain that it is a Text Only file and contains no formatting codes.

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 34 of 37

STEP 4.

REPEAT THE CHANGES IN THE AUTOMATIC LOG BOOK FILE Repeat the changes in the Automatic Fleet Log Book file (EnglishPayload.alb), and save.

STEP 5.

COMPILE THE SCRIPT FILES Open FM 2000. Right click on the vehicle for which the script file is to be changed. Select properties. Scroll to the far right of options and select FM Terminal. Make sure the FM Terminal Connected option is selected. Select English Payload as the primary and secondary language. It is advisable not to select two different Languages, which have different menu structures. Select either the Automatic (alb) or Manual (mlb) option. Select Apply, followed by OK. If the compiler detects an error in the script files, a Communications Error message will be displayed. If this message is displayed, open the file script.lst. Details of the errors and the line numbers at which they occurred, are displayed in this file. Line numbers refer to the script.fmt file, which combines the language1and language 2 files. Correct the errors and repeat the compile procedure until no errors are detected.

STEP 6.

UPDATE THE CODE PLUG If the vehicle properties have changed, the code plug will be updated automatically. Otherwise, it must be manually updated, by selecting: Code Plug, Initialise Plug, Vehicle Plug. Make sure the option Build FM Terminal Menus is selected. Continue to update the code plug, as prompted.

STEP 7.
CIFMS

UPLOAD THE SCRIPT TO THE FM TERMINAL Insert the updated code plug into the FM200 code plug socket. The FM200 indicates the start of the upload with a beep. The FM200 downloads the script and beeps when complete. The FM200 transfers the script to the FM Terminal. The FM Terminal reboots and gives three short beeps. The new script is successfully loaded
FM TERMINAL SCRIPT EDITOR Page 35 of 37

APPENDIX A:
Menu Option
Business Private Job Maintenance Accident/Alarm Work to home Home To Work Other Business Halt Private Halt Refueling Maintenance Halt Traffic Jam Pause Other Begin Time End Time Customer Code Activity Code Material Code Location Code Other Cost Code Cost of fuel Amt of fuel Trailer/Container Description Failure reason Document code Other Unspecified Trip Unspecified Halt

List of Available Mnemonics (Codes)


Code
BUSDR PVTDR JOBDR MNTDR ACCDR WTHDR HTWDR OTHDR BUSHT PVTHT RFLHT MNTHT TRFHT PSEHT OTHHT BGNTM ENDTM CUSCD ACTCD MATCD LOCCD OTHV1 COSCD FCOST FAMNT TRLCD DESCR FAILR DOCCD OTHV2 UNSDR UNSHT

Units

Code

Critical Event Description


Over Speeding Over revving Harsh Acceleration Harsh Braking Excessive Idle High Engine Temp Low Oil Pressure Low Coolant Level

Code
OVSPD OVREV HRACC HRBRK EXIDL HITMP LOPRS LOLVL

FM200 Event Description


Driver ID number Ignition On FM200 mode Trip length (m) Ctime (s) Odometer (m) Speed (km/h) Revs (RPM) Vehicle ID F3 Frequency F3 Count F3 Cnt for Last Minute

Code
DRVID IGNON FM_MD TRP_M TIMES ODO_M SPDKH REVPM VEHID F3_FR F3_CN F3MIN

FM Terminal Event Description


Display on Backlight on "No Activity" Timer Key pressed Overload on KBD port Comms busy Short Trip

Code
DSPON BCKLT ACTMR KEYON OVCUR CMBSY SMLTR

Alt. Quantities
"Milli" Gallons MLGAL

Alt. Currencies
Deutsch UK US RSA Nederlands Portugues Espanol Italiano Francais DEPFN UKPEN USCNT ZACNT NLCNT PTCNT ESCNT ITLIT FRCNT

(Currency) Millilitres

CENTS MLITR

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 36 of 37

APPENDIX B

DISPLAYABLE CHARACTERS

This table shows the characters, which can be displayed on the screen. They can be used in the script file text strings, or placed in the CSV file for translations. This character set should not be confused with the mnemonic set, shown on page 14.

0 0 1 2 3 4 5 6 7 8 9 A B C D E F

7
` 7 G W g w

8
( 8 H X h x

9
) 9 I Y i y

A
* : J Z j z

C
, < L \ l |

D
= M ] m }

Space 0 @ P p

! 1 A Q a q

2 B R b r

# 3 C S C S

$ 4 D T d t

% 5 E U e u

& 6 F V f v

+ ; K [ k {

. > N ^ n ~

/ ? O _ O Del

o C c

CIFMS

FM TERMINAL SCRIPT EDITOR

Page 37 of 37

Vous aimerez peut-être aussi