script editor

Upload: cassio-sousa

Post on 04-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Script Editor

    1/37

    CONTROL INSTRUMENTSFLEET MANAGEMENT SERVICES

  • 7/30/2019 Script Editor

    2/37

    TABLE OF CONTENTS

    1 SCOPE ..........................................................................................................................................................4

    2 THE SCRIPT FILE .........................................................................................................................................5

    2.1 SCRIPT FILE FORMAT - OVERVIEW ....................................................................................................... ......... ..52.1.1 Script File Headers .................................................................................................................................... ........ ......5

    2.1.2 Events and Menus ....................................................................................................................................................6

    2.2 EVENTS .............................................................................................................................................................. ......... .62.2.1 Event Components ...................................................................................................................................................7

    2.2.1.1 EventType .........................................................................................................................................................7

    2.2.1.2 EventCheck .......................................................................................................................................................7

    2.2.1.3 EventResultA ....................................................................................................................................................82.2.1.4 EventResultB ...................................................................................................................................................8

    2.2.1.5 EventChild ................................................................................................................................................... .....9

    2.2.1.6 EventText ..........................................................................................................................................................9

    2.3 MENUS ........................................................................................................................................................................102.3.1 Menu Components .................................................................................................................................................10

    2.3.1.1 MenuType .......................................................................................................................................................10

    2.3.1.2 MenuRedraw ................................................................................................................................ ........ ......... .112.3.1.3 MenuSelect ............................................................................................................................................. ........12

    2.3.1.4 MenuReturn ............................................................................................................................................... .....122.3.1.5 MenuChild ................................................................................................................................................. .....13

    2 3 1 6 MenuText 13

  • 7/30/2019 Script Editor

    3/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

  • 7/30/2019 Script Editor

    4/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 ofthe menu structure and associated functionality of the FM Terminal. Basic understanding of scripting andscript principles is assumed. An understanding of the concepts of data types binary, hexadecimalrepresentation will also prove beneficial when consulting this document. A great deal of the process involvedin 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 essentialthat the fundamentals of script file design be clearly understood before embarking on the creation of newfiles or file entries. Where possible, model new menu and event structures on existing structures that havebeen tested and are known to work. If new structure types are required, be sure to test them thoroughlybefore 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 becompletely 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. Additionalinformation will cover the files required and indexed by the script file.

  • 7/30/2019 Script Editor

    5/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. Thedifferences 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

    Figure 1. Script File HeadersA B C ED F

  • 7/30/2019 Script Editor

    6/37

    F - Graphic Files

    The FM Terminal supports the inclusion of various graphics into the menu structure. All graphic files arelisted at the top of the script file as shown above. For example, in the above illustration, Graphic 0 refers tothe 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 FMTerminal. 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 mustbe preceded with a 0x prefix.

    For the remainder of this text, where an item is enclosed in square brackets, this implies that the item iscomposed of more than one sub item. An example of this is the [DfuncAct Dfunc] item. Dfunc and DfuncActcan 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

  • 7/30/2019 Script Editor

    7/37

    2.2.1 EVENT COMPONENTS

    2.2.1.1 EventType

    The FM Terminal interpreteruses the EventType component as well as the MenuType component discussedlater in this text to distinguish between events and menus. The script file writer also has the option of defininga 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 beused to determine whether the visible component of the event should be displayed or not. This is achievedthrough the setting of the DisplayTime item. DisplayTime is more relevant for use with menus but has beenincluded 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 selected1 = A menu itemBIT 1: Event itemBIT 2: Option numbering, 1 = item will be numbered.BIT 3: RequestBIT 4: ReservedBIT 5: ReservedBIT 6: ReservedBIT 7: Reserved

  • 7/30/2019 Script Editor

    8/37

    Command Line:

    EventCheck1 = ChkAction, [ChkDfuncAct ChkDfunc], ChkValue

    Components:

    For ChkAction, the following actions are possible:

    0: Call to a device driver function when item is first checked1: Call to a device driver function every refresh cycle2: Call to a device driver function every 2nd refresh cycle

    .

    .

    .254: Call to a device driver function every 254th refresh cycle255: No further actions

    ChkDFunc: Contains the function numberChkDFuncAct: 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:

    The returned value of the last device driver function called

    The 32 bit value specified in ChkValue

    2.2.1.3 EventResultA

    Defines what is to be done when the conditions of an event are satisfied (when all EventCheck actions

    ret rn a tr e)

  • 7/30/2019 Script Editor

    9/37

    Components:

    Action, [Dfunc DfuncAct], Value:The available actions include:

    0: No further action1: Jump to a child menu2: Jump to a parent menu3: Reserved

    5 4. Menu redraw6 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.

    C d Li

  • 7/30/2019 Script Editor

    10/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 and3 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 systemto return to the parent menu of the current menu.

  • 7/30/2019 Script Editor

    11/37

    Action, [DfuncAct Dfunc], Value:The available actions include:

    0: No further action

    1: Jump to a child menu2: Jump to a parent menu3: Reserved4. Menu redraw5. Call to device driver function

    The following items are passed in the call:Dfunc: Function number DfuncAct: Function-action numberValue: 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 itemonly 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 subsequentactions will only be valid if the first Action occurred and in those cases, all values other than 255 will alwaysresult in an action. There is a wide range of MenuRedraw functions that will respond to different user input.

    C d Li

  • 7/30/2019 Script Editor

    12/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 action1: Jump to a child menu2: Jump to a parent menu3: Reserved

    7 4. Menu redraw8 5. Call to device driver function

    The following items are passed in the call:Dfunc: Function number

    DfuncAct: Function Action numberValue: 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 page 24)

    2 3 1 4 M R t

  • 7/30/2019 Script Editor

    13/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 childmenu 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 menuheader/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 Reset Defines if the screen must be cleared before displaying textBit 1 Local Defines the origin of the text Local text implies text received from

    a source other than the menu driver.

    Bit 2 Width D fi th idth f th h t 0 b i 1 t 1 1 b i 2 t 1

  • 7/30/2019 Script Editor

    14/37

    2.4 MNEMONICS

    Mnemonics will appear at various points within a script and deserve a special mention here. Mnemonics formmessage identifiers used for passing data between the different modules of the FM200 Fleet Managementsystem.

    Mnemonics will always be preceded by an @ within the script file. Each consists of 5 alphanumericcharacters, each character is compressed into a 6-bit number: 00 3F (hexadecimal). The character setused is as follows:

    Table 1: Character Mapping for Item Naming Convention

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

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

    1 G H I J K L M N O P Q R S T U V

    2 W X Y Z : ; < = > ? @

    3 # $ % & ( ) * + , - . / ~ _

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

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

    VALUES

  • 7/30/2019 Script Editor

    15/37

    2.5.1 RECEIVE VALUE (FUNCTION 0)

    DfuncAct 0 = REQUEST FROM FM200

    (Requests the current value associated with a mnemonic from the FM200. Theresult of the request is stored internally in the FM Terminal)Value = 4 Byte ID Mnemonic

    DfuncAct 1 = GET STORED MNEMONIC(Retrieves the current value associated with a mnemonic stored in the FMTerminal)Value = 4 Byte ID Mnemonic

    DfuncAct 2= CHECK FOR VALID MNEMONIC(Checks that the mnemonic appears in the current mnemonic table and is valid)Value = 4 Byte ID Mnemonic

    .

    .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 charactersBit 1 - Alphabet charactersBit 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 notsupported. When no decimal places are required, bits 0&1 should be set and, bits 2 to 7 cleared.

    A ti 0 d 1 h b t d t ll f h d t f t l d t b d i

  • 7/30/2019 Script Editor

    16/37

    2.5.3 DISPLAY VALUE (FUNCTION 2)

    DfuncAct 0 = SHOW DISPLAY SETUP

    (Shows Display Adjustment screen)Value = Graphic number of Display Adjustment graphic

    DfuncAct 1 = DISPLAY SPLASH SCREEN(Shows Splash screen Differs from Action 0 by also extracting and displayingsoftware version numbers on the Splash screen)Value = Graphic number of Splash screen graphic

    DfuncAct 2 = DISPLAY LAST CRITICAL EVENT

    (Displays a description of the last critical event. If the text string is unavailable, themnemonic associated with the event will be displayed)Value = Reserved

    DfuncAct 3 = DISPLAY INPUT VALUE(Displays the value obtained from previously called procedure)Value = Display format information

    Byte 0Bit 0 - Entry Type: 0 = Numerical

    Bit 1 - 1 = Date formatBit 2 - 2 = Time format

    (3 7 Reserved)Bit 3 - (If Entry Type = Numeric)

    Decimal separatorSet = Comma, Clear = Point

    (If Entry Type = Date)Format

    S t M th/D /Y Cl D /M th/Y

  • 7/30/2019 Script Editor

    17/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

    DfuncAct 1 = ID2 SETTING(Sets the value to be sent in Mnemonic ID2)Value = Mnemonic ID2

    DfuncAct 2 = 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 15 = Reserved

    2.5.5 UPDATE VALUE (FUNCTION 4)

    DfuncAct 0 = ADJUST DISPLAY(Implements control for contrast and backlight adjustment as well as bar graphindicators)Value = Reserved

    DfuncAct 1 = STORE DRIVING REASON(Stores the currently selected driving reason in memory)Value = Driving Mnemonic

    Df A t 2 STORE RESTING REASON

  • 7/30/2019 Script Editor

    18/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

    DfuncAct 1 = SET UP PARAMETER 2 mnemonic(Loads a mnemonic value in Parameter 2)Value =4 Byte mnemonic ID

    DfuncAct 2 = SET UP PARAMETER 2 - numeric(Loads a numeric value in Parameter 2)

    Value = 4 Byte numeric value (long)

    DfuncAct 3 = SET UP OPERATOR AND EVALUATE(Used to select the comparison operator and to perform the comparison betweenthe contents of Parameter 1 and Parameter 2 (which are populated using Actions 1and 2 above). The result is always true/false)Value: 0 = = Equal To

    1 = ">" Greater Than2 = ">=" Greater Than Or Equal To

    3 = "

  • 7/30/2019 Script Editor

    19/37

    Many of the above Function-actions work in unison to produce one action. An example of this in events is theEvaluate Condition action that requires instances of Action 0, Action 1 or Action 2 as well as Action 3 toform 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 commandlines. In this way, it is possible to perform numerous functions on a single item through the use of a series ofconsecutive 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 fromkilometres 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 firstMenuRedraw line. The second MenuRedraw line converts the kilometre value to an approximated mile valueby multiplying by 5 and dividing by 8. The third MenuRedraw line will then display the mile value. This type ofmenu will be discussed in more detail further on in this document.

  • 7/30/2019 Script Editor

    20/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 requestthe status of these properties from the FM200. These requests are made in event items within the menuscript 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 subsequentsuccessful 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 beforeusing it for event evaluation. Validating a property involves ensuring that there is a copy of the property in thelocally stored table. Validation checks take on the following form:

  • 7/30/2019 Script Editor

    21/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 To1 = ">" Greater Than2 = ">=" Greater Than Or Equal To3 = "

  • 7/30/2019 Script Editor

    22/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 scriptmust 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 listof critical events that the FM Terminal will respond to. Also included in this file are delays (in seconds) thatthe FM Terminal will wait before displaying the warning after the warning condition becomes true. Thecontents 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 followingform:

    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.

  • 7/30/2019 Script Editor

    23/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 orevents.

    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 ofthe FM Terminal requires there to be a heading item within each menu to mark the start of the newmenu 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 asillustrated 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.

    C f

  • 7/30/2019 Script Editor

    24/37

    For example, to jump to the Fleet Log Book menu:

    MenuType = 4, 0, 0, 0L, 0MenuSelect = 1, 0, 0L

    MenuChild = "FLB"MenuText = 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, 0MenuSelect = 6, 0, 0x030ALMenuReturn = 5, 0x03, @COSCDMenuReturn = 5, 0x23, 0LMenuChild = "UserEntry"MenuText = 0, "", "Cost code"

    The MenuType line indicates that this is a menu option and not a heading. The option is numbered. The childmenu is called UserEntry and the option text to be displayed is Cost code. The 0 in the MenuText lineindicates that there is no special formatting of the Cost code text i.e. the text will be displayed as left-justified, normal sized text.

    If the user presses the RET key while this menu is displayed, the MenuSelect line will be executed. TheMenuSelect action (6) indicates a User entry action. There is no associated Function; Function-action pairso this field is set to 0. The value of 0x030AL will be passed to the User Entry menu.

  • 7/30/2019 Script Editor

    25/37

    The first MenuReturn line of cost code commits the cost code mnemonic (COSCD) to memory. The secondline formats the text entered by the user and packages this text along with the mnemonic into a completeFleet 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 systemparameters. An example of this is the current odometer reading of the vehicle.

    MenuType = 0, 0, 0, 0L, 0MenuRedraw = 1, 0x10, @ODO_MMenuRedraw = 1, 0x32, 0xe010LMenuSelect = 2, 0, 0LMenuChild = ""MenuText = 0, "", "Odo : km"

    The MenuType line indicates that this is not a menu heading. In addition, this menu option will not benumbered.

    The first MenuRedraw line calls Action 1 of Function 0 that corresponds to a REQUEST FROM FM200action 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. Thevalue associated with this execution can be broken down into:

    0x10 Bit 0 = 0 -

  • 7/30/2019 Script Editor

    26/37

    2.8 ADDITIONAL REMARKS ON SCRIPT FILES

    2.8.1 SEQUENCE

    The FM Terminal interpreter follows a cyclical top to bottom approach to script file execution. Ordering ofevents, menus and even specific command lines within events and menus can therefore impact on the waythe interpreter responds to script requests. A simple example of this effect is where two events may operateon a similar condition. The outcome of the execution of the first event may impact on the response createdby the second event. In cases such as this, the event of higher priority must always appear first in the scriptfile to ensure that it is executed first. Similarly, if a series of command lines each effect the value of a singlevariable, 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 twoforwardslash characters, //. The use of commenting is encouraged to assist in the interpretation of newevents 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 isinterpreted first, followed by each subsequent menu item. When the interpreter detects the heading of thenext menu in the script, it stops processing and returns to the current menu heading. For this reason it isessential that every Menu structure contain one and only one heading element. This element must always bethe first element in the structure. Also as a result of this process, the script file must always end with adummy menu. This menu takes the form of a menu heading and is used to mark the end of the lastfunctioning menu structure.

  • 7/30/2019 Script Editor

    27/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. Therecommended maximum lengths of text depend on the circumstances under which the text is to bedisplayed.

    The FM Terminal screen is composed of 128 x 64 pixels. A small character of text occupies an area of 6x8pixels, including line spacing above, below and to the right of the character. As a result, when normal text isselected, it is possible to print a maximum of 21 characters on 8 lines on the screen. When working withnormal-size text in menu applications, each item should be restricted to a single line. If longer text strings areused, 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: These can occupy an entire line on the screen and should be limited to 21characters. The default format of menu headings is uppercase text.

    Menu Options: If Option Numbering is not selected menu options, can be up to 21 characterslong. If Option Numbering is required, the option line must reserve 3 characters forthe option number, point and space. It is therefore suggested that numbered menuoptions should not exceed 18 characters.

    The Warning Screen: The area of the warning popup screen is smaller than the overall screendimensions. This screen can accommodate a maximum of 14 normal-sizecharacters in 6 rows.

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

  • 7/30/2019 Script Editor

    28/37

    3 GAPHIC FILES

    The only restrictions concerning graphics is that they must be in a monochrome bitmap (BMP) format. Theheight and width must both be multiples of 8 pixels. The maximum size of the bitmap should not exceed 128X 64 pixels (the maximum size of the FM Terminal screen).

    Bitmaps can be created in Paint and saved in monochrome bitmap format.

  • 7/30/2019 Script Editor

    29/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 tothe 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 filereferenced 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 filecontains a reference to the Deutsch.csv language file. An extract of this file is shown below:

  • 7/30/2019 Script Editor

    30/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 andthen loaded onto a FM Terminal.

    The FM 2000 program is used for selecting the primary and secondary languages, and for selecting manualor 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 beunique.

    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.

  • 7/30/2019 Script Editor

    31/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 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 twodifferent languages but, could both be the same (eg English.alb and French.alb orEnglish.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 language1and language 2 files.

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

  • 7/30/2019 Script Editor

    32/37

    TUTORIALS

    The following tutorials show the steps required to implement certain changes to the FM Terminal menu. Before anyfiles are modified, always make a copy of the original file and save it under a different name. Never alter the originalfiles. 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 Detailswill be added to the Fleet Log Bookmenu and, when selected, willprovide for a Depot Codeand Weigh Bridge Massto 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.alband English.mlb, which are located in the

    directory C:/Program Files/Fleet Manager/FMTerminal. Open them into a text editor and save them as

  • 7/30/2019 Script Editor

    33/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 Payloadchild menu.

    Insert the new menu option as shown in the

    highlighted block.

    The text Payload Details will be displayed as option5. When selected, the menu will jump to the child

    menu, Payload, which is still to be created.

  • 7/30/2019 Script Editor

    34/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. Payloadwill, therefore, be positioned below the FLBValue2child 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 Entrymenu

    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 beincluded and must remain empty in a

    header.

    MenuText = 0x10,"","PAYLOADDETAILS" specifies the heading name

    and that it is centre justified on thedisplay.

    B. Enter Option 1 Details

    MenuType = 4,0,0,0L,0 specifies that the option will be numbered.

  • 7/30/2019 Script Editor

    35/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 isselected.

    Select English Payloadas the primary and

    secondary language. It is advisable not to selecttwo 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.

  • 7/30/2019 Script Editor

    36/37

    APPENDIX A: List of Available Mnemonics (Codes)

    Menu Option Code Units CodeCritical EventDescription

    CodeFM200 EventDescription

    CodeFM Terminal

    Event DescriptionCode

    Business BUSDR Over Speeding OVSPD Driver ID number DRVID Display on DSPON

    Private PVTDR Over revving OVREV Ignition On IGNON Backlight on BCKLT

    Job JOBDR Harsh Acceleration HRACC FM200 mode FM_MD "No Activity" Timer ACTMR

    Maintenance MNTDR Harsh Braking HRBRK Trip length (m) TRP_M Key pressed KEYON

    Accident/Alarm ACCDR Excessive Idle EXIDL Ctime (s) TIMES Overload on KBD port OVCUR

    Work to home WTHDR High Engine Temp HITMP Odometer (m) ODO_M Comms busy CMBSY

    Home To Work HTWDR Low Oil Pressure LOPRS Speed (km/h) SPDKH Short Trip SMLTR

    Other OTHDR Low Coolant Level LOLVL Revs (RPM) REVPM

    Business Halt BUSHT Vehicle ID VEHID

    Private Halt PVTHT F3 Frequency F3_FR

    Refueling RFLHT F3 Count F3_CN

    Maintenance Halt MNTHT F3 Cnt for Last Minute F3MIN

    Traffic Jam TRFHT

    Pause PSEHT

    Other OTHHT

    Begin Time BGNTM

    End Time ENDTM

    Customer Code CUSCDActivity Code ACTCD Alt. Quantities Alt. CurrenciesMaterial Code MATCD "Milli" Gallons MLGAL Deutsch DEPFN

    Location Code LOCCD UK UKPEN

    Other OTHV1 US USCNT

    Cost Code COSCD (Currency) CENTS RSA ZACNT

    Cost of fuel FCOST Millilitres MLITR Nederlands NLCNT

    Amt of fuel FAMNT Portugues PTCNT

    Trailer/Container TRLCD Espanol ESCNT

    Description DESCR Italiano ITLIT

    Failure reason FAILR Francais FRCNT

    Document code DOCCD

    Other OTHV2

    Unspecified Trip UNSDR

    Unspecified Halt UNSHT

    CIFMS FM TERMINAL SCRIPT EDITOR Page 36 of 37

  • 7/30/2019 Script Editor

    37/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 1 2 3 4 5 6 7 8 9 A B C D E F01 2 Space ! # $ % & ` ( ) * + , - . /3 0 1 2 3 4 5 6 7 8 9 : ; < = > ?4 @ A B C D E F G H I J K L M N O5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 a b C d e f g h i j k l m n O

    7 p q r S t u v w x y z { | } ~ Del89A B C C D E c F o

    CIFMS FM TERMINAL SCRIPT EDITOR Page 37 of 37