Apex II
Program Conversion 

Mars Electronics MEQ to Compsee Apex II 

01-04


One of the Major Goals of the Compsee Apex II Design team has been to maintain a high degree of compatibility between the Mars Electronics MEQ series of portable terminals and the Apex II. Although this has proven for the most part to be successful, programming differences do exist. Therefore, some program modifications need to be completed prior to the transfer of an MEQ application to an Apex II terminal.

This document contains four sections:

  1. Programming and hardware differences between the Apex II and the MEQ terminals
  2. Information on modifying an existing MEQ program to run in the Apex II terminal.
  3. FAQ's
  4. Check List

1. Programming and hardware differences between the Apex II and the MEQ terminals

  • Assembly Routines

    The Apex Unit does not support loading assembly routines. The reason for this is that our engineering team was successful in including the FAST SEARCH, RIGHT TRIM and EXTERNAL BAR CODE decode and other routines into the Apex II operating system. Hardware differences are also a reason. Reference the programming manuals for details on these parameters, along with the search.lib file form Mars Electronics

  • MEQ Code Example for the File Search: ( CALL 50592) Except 630

    Syntax: CALL 50592,KEY$,KEYSTART,KEYLEN,FILENUM,RECNUM

  • APEX II Code Example for File Search . ( FREC)
    Syntax: RECNUM=FREC(KEY$,KEYSART,KEYLEN,FILENUM,RECNUM)

  • MEQ 630 Code Example for File Search . ( FREC)
    Syntax: RECNUM = FREC(KEY$,KEySTART,KEYLEN,FILENUM,RECNUM)

  • MEQ Code Example for the Right Trim (CALL 51550 or 50625)
    Syntax: CALL 51550,A$,B$

  • APEX II Code Example for Right Trim ( RTRIM)
    Syntax: A$=RTRIM(A$,B$)

  • Mars Key Chirp CALL (also called beep function )
    Syntax: CALL 51350 a,b,c
    The Apex does not support a similar feature.
    The key click is a part of the Apex O.S.

  • Softscan Function ( Apex II )
    Syntax: SOFTSCAN Software Trigger for the Integrated laser on the Apex
    See The Mars Program AUTO530 for an example of the MEQ Software trigger. This requires an Assembly code LOAD . (Included in the program)

  • SYSPARMS
    The Apex II does NOT have the same Sysparms format as the MEQ . Reference the Apex Basic Manual for a description of the SYSPARMS command. The differences are minor. The MEQ 630 does not have the same Sysparms as the other MEQ units .

  • Key Map Locations
    The APEX does not have the same key map locations as the MEQ . Reference the Apex Basic Manual for a description of the Key Map Table .
    It is IMPORTANT that any PEEK POKE used in a MEQ Program be changed to match the Apex II key map .

  • Optical Communications
    The Apex does Not support Optical Communications.

  • New Apex Basic Commands
    Please Reference the Apex Basic Programming Manual for Details .
    Pause:
    Pause the program for a defined time and put the unit into a power reserve mode.
    Aim:
    Used to time Aiming Dot for long range lasers .

  • Some PEEK locations everyone should know about .
    332
    If location 332 = 0 then a wand is the input device on the Apex.
    If location 332 = 255 then a laser is the input device on the Apex .
    If location 332 = 128 then the INPUT is RS232 serial .
    This setting is controlled by the Apex II program, and is covered in other documentation . This setting is used for input of special devices such as 2-D decoders and Mag Stripe Readers .

  • Test the Apex Serial Output Buffer for data with the code below.
    While PEEK(288)<> PEEK(289):Wend
    If Location 288=289 then the Output Buffer is Empty.
    All Peek Locations between the Apex and MEQ are Different.

  • Hardware
    Optical Communications
    The Apex does Not support Optical Communications.
    Display
    The MEQ units were first manufactured with 2 line by 16 character displays.
    They later changed to has a 4 line by 18 character with back lighting for the display.
    The APEX has a 4 line by 16 character display.

    ROM, Ram, and Flash

    The MEQ ....


    The OS for the MEQ is In ROM and is copied into the Ram of the unit.
    The O.S. and System Support Data Area will take up about 52+ K of Ram in the MEQ.
    The Program loaded into the MEQ is also stored in Ram. Along with all data files.

    The Apex…

    The O.S. for the APEX is in FLASH, and is not copied into the Ram. The system support data area is in Ram. The required amount of space will vary from program to program. Usually somewhere between 12 to 24 K of Ram will be used.

    The Apex II was first shipped with a 128 K Flash . 64 K was used for the OS and 64 K for program storage. (128K Flash Units run the version "a" OS.)

    Today the Apex is manufactured with a 512K Flash, 128K used for the OS and 128K used for the program storage. (512K Flash Units run the version "b" OS.)

  • OS Versions: MEQ
    For the 2 line MEQ units the latest OS shipped is 2.18.
    The latest OS Disk File shipped for updating is 2.16.
    For MEQ 4 line units, OS version 4.00 is shipped in 130.430, and 530 units. Except the VIN unit .
    For the MEQ VIN unit the OS version is 4.04 .
    For the MEQ 630 unit the OS version is 5.00.

  • OS Versions: Apex II
    Apex II units with 128K Flash use OS version "a" and the version number will start with a "1". For example 1.30.a
    Apex II units with 256K Flash use OS version "b" and the version number will start with a "2". For example 2.16b

    Updates of OS files for the MEQ and Apex can be downloaded form the Compsee web site www.compsee.com

2. Information on modifying an existing MEQ program to run in the Apex II terminal.
Topics Covered

  • Assembly Code Routines ( the MEQ CALL Statement )

  • The Sysparms command :

  • Keyboard Re Map

  • Memory POKE and PEEK

  • Display Screen Considerations .

  • Apex II Program commands not found in the MEQ :

  • MEQ program code to watch for and modify :

  • Important Apex II Memory Locations

  • The PC support Programs :

  • Testing the Conversion

Topics Not Covered (see FAQ's)

  • The MEQ 1260 Node: The Apex II does not support optical communications as the MEQ does . If the MEQ application program requires use of the 1260 Node in a daisy chain configuration or the use of RS422 communications, converting the application will include both hardware additions as well as application changes. The 1260 Conversion is not covered in this document.

MEQ to Apex II Program Conversion

  • Assembly Routines
    The Apex Unit does not support loading assembly routines . The reason for this is that the Compsee engineering team was successful in including the FAST SEARCH , RIGHT TRIM and EXTERNAL BAR CODE decode and other routines into the APEX II Operating System . Another is the hardware configuration of the Apex II unit. The OS is stored in FLASH not RAM as in the MEQ.

    File Search for a Record
    The MEQ CALL 50592 will should be replaced with the Apex function of FREC .

    MEQ Code Example for the File Search. (All MEQ units, EXCEPT THE 630)
    Syntax: CALL 50592,KEY$,KEYSTART,KEYLEN,FILENUM,RECNUM

    MEQ 630 Code Example of File Search The MEQ 630 OS supports a new function for the MEQ FREC .
    FoundRec = FREC(Key$,KeyStart,KeyLen,FileNum,RecNum)

    APEX II Code Example for File Search.
    The FUNCTION: FREC Key file search
    Syntax: FoundRec=FREC(KEY$,KSYSART,KEYLEN,FILENUM,RECNUM)

    The Parameter Definition
    See the MEQ SEARCH.LIB code . Apex Manuals, And MEQ 630 Manual

    MEQ Code Example for the Right Trim

    MEQ CALL for Right Trim at 51550.
    Syntax: CALL 51550,A$,B$

    APEX II Code Example for Right Trim
    Use a FUNCTION: RTRIM Right Trim a Field
    Syntax: A$=RTRIM(A$,B$)
    MEQ to Apex II Program Conversion

    MEQ Key Chirp ( Also called beeper function )
    CALL 51350
    The Apex does not support a similar feature. The key click is a part of the Apex O.S. When converting code this CALL along with all other CALL statements should be removed .

    Loading the Assembly code into the MEQ
    Often the Assembly code is a part of the MEQ program. If this is the case be sure it is removed and not loaded into the Apex II.
    If the Assembly code is loaded by it self, that will be addressed with new load programs for the Apex II.

  • THE SYSPARMS
    The Programmer will have to deal with 4 separate formats of SYSPARMS
    Explaining the SYSPARMS is not a part of this document that is done in the Programming guides . We will give a layout of each and what should be done to convert them to the Apex II programming syntax .

    The MEQ 2 line units SYSPARMS
    SYSPARMS noscan,pdt,dto,dc_1,dc_2,2of5,coda,dst,plessey
    The MEQ 4 line unit SYSPARMS
    SYSPARMS noscan,pdt,dto,dc_1,dc_2,2of5,coda,dst,plessey,2/4,light,contrast
    The MEQ 630 unit SYSPARMS
    SYSPARMS noscan,pdt,dto,dc_1,dc_2,dc_3,2of5,coda,dst,plessey,2/4,light,contrast
    The Apex II SYSPARMS
    SYSPARMS noscan,pdt,dto,dc_1,dc_2,dc_3,2of5,coda,dst,plessey,contrast

    Making the modifications :
    For the 2 line MEQ units : Insert a comma for the dc_3 parameter and add 1 comma to the end of the command line .
    For the 4 line MEQ units : Insert a comma for the dc_3 parameter , remove the 2/4 and light parameters .
    For the MEQ 630 unit : Verify the value of the dc_3 parameter , remove the 2/4 and light parameters.

    Often the SYSPARMS will be used to only set the noscan parameter or only two or three parameters. Be sure the correct number of commas are in the statement.
    The Apex II also supports two other parameters. CENTURY and Foreign character, they are covered in Apex II OS update information. They are not in the list above because this document is dealing with program conversions.

  • Keyboard Re Map , and other POKE statements :
    The APEX does not have the same key map locations as the MEQ. Reference the Apex Basic Manual and the MEQ Programmers Guide, for a description of the Key Map Table. It is CRITICAL that any PEEK and POKE statements used in a MEQ Program be changed to match the Apex II key map.
    Search the MEQ Program for POKE statements. These will normally be used to re map the keyboard. Cross check the memory locations with the Apex II keyboard and make the necessary corrections.
    If the Poke Location is not a keyboard location.
    Check the Location with the MEQ Memo location listed below. If it is not on the list Call Compsee Technical Support for assistance .
    Often Programmers do find non published locations and use them.
    Remove any POKE statements that you can not find references to.

  • The PEEK statements :
    Search for any PEEK statements and replace them with the correct Apex II memory location.
    Note: In some MEQ programs you will fine code that checks the MODE by using the PEEK to pull values and do calculations. REMOVE This CODE, and simply set the MODE. ie: (MODE x,y) If the Mode is not known you are in trouble anyway.
    Note: All PEEK and POKE locations will be different between the MEQ and Apex II.


  • Display Screen Considerations:
    The MEQ units have two display types; 2 line by 16 positions and a 4 line by 18 positions. As you may think the programs for 2 line units are simpler to convert to the Apex II format. The Apex Display is 4 line by 16 positions.
    · Two Line MEQ programs :
    Look for and change any reference to LOCATE 2,17. Screen Location 2,17 is not valid in the Apex II. Suggestion - change to 2,16. Remember variables can be used also such as LOCATE ROW,COL be sure COL is not greater than 16 .
    Valid, but will display oddly is this statement:
    PRINT #0, USING "C32", " the 32 characters of date "
    This will display on lines 1 and 3 of the Apex II. Then if the Locate for input is set to line 2 position 10 for example the display will look ODD, the conversion will look incomplete.
    Suggestions for Display Output modifications from both the 2 and 4 line MEQ programs - Use the LOCATE ROW,COL for each line on the display . Examine the MEQ Program and understand what the programmer is doing for the display operations. Then modify the code as required. This will require more work for the 4 line MEQ units if they are using all 18 character on a display line. The bottom line is that it will require some time and effort to modify the code and test it.

    For the MEQ 4 line display units look for LOCATE 4,19, the Apex II does not support the 19 position . This should be changed to 17.

  • Apex II Program commands not found in the MEQ:
    Please reference the Apex Basic Programming Manual for details.
    Pause -Pause program for a defined time in power reserve mode.
    Aim - Used to time aiming dot for long range lasers.
    Softscan Function - Syntax: SOFTSCAN
    Software Trigger for the integrated laser on the Apex.
    See The Mars Program AUTO530.BAS for an example of the MEQ Software trigger.

  • MEQ program code to watch for and modify:
    FOR NEXT loops used for time delays:
    Some MEQ programmer will use a FOR X= 1 TO some value: NEXT X program statement to cause the MEQ to pause operation. This code will run much faster on the Apex II the wait time will not be the same. We suggest that it be replaced with the PAUSE statement. Or you can adjust the target number if you like it is your decision.
    Calculating the MODE using the PEEK. Drop this code and just set the MODE.

  • Important Apex II Memory Locations
    Input device type
    Memory location 332 in the Apex II Standard should be used when checking for input device type.
    If location 332 = 0 then a wand is the input device on the Apex.
    If location 332 = 255 then a laser is the input device on the Apex .
    If location 332 = 128 then the input is serial .
    A Special NOTE : Input type 128 is program controlled and not set in the normal operation of the Apex unit . Used in interfacing with input device types not supported by any other PDT units. Such as 2-D code readers and Mag Stripe readers.

  • RS232 Serial buffer pointers:
    When sending data out the RS232 port of the Apex II, before the program returns to the normal operation. This type of test should be put into the code.
    WHILE PEEK (288) <> PEEK (289) : WEND
    This line of code will cause the Apex II Program to wait at this line of code until all data is sent form the serial buffer. This code should be added to any program where a printer is being used.

  • Wand Timer:
    For Apex II OS version "a" the memory location is 22201, for OS version "b" the location is 28301. These location will show the remaining time that power will be on for wand input.

  • The PC Support Programs:
    Many people are using the Mars MEQ DOS programs to load the MEQ. You should check the procedures to be run and replace any MEQ programs with Apex II programs. For example MEQPROG.EXE should be replaced with APEXPROG.EXE. You may wish to use the Compsee Windows programs to support the Apex II unit. The Programmers Tool Kit for the Apex can be used as well as the Link Master program.

  • Tips on Testing the conversion:
    These are suggestions ONLY. Once you have completed the program changes, testing is the next step. The display output will be easy enough to verify, but other errors can be harder to locate


    · If a bar code symbology does not read , verify the SYSPARMS value .
    · If the program aborts or the Apex re-boots , check the POKE commands. A invalid location will cause unpredictable results . Well with the exception that the results will be BAD.
    · Loading the program can be done with the latest version of LinkMaster, one benefit is that errors found during the load are sent back to the PC and displayed .
    · Do not save the program to FLASH when testing. This will allow you to modify program lines in ram and not have to re-load the program. A communications package like Procomm Plus or Qmodem even Hyper Terminal will allow you to do this.

3. FAQ's:

Where Should I start in the Conversion Process?
First answer this question . Can the MEQ program be reproduced with the Apex program generator ? If it can DO IT ! That will be both the easiest and fastest conversion you can do.

Where can I find Information on Memory Locations for the Apex and MEQ units?

The MEQ Programmers Guide Appendix B has information on the keypad table.
The Apex II Manual Part 3 page 18-2 has the Apex keypad table.
Look under the SYSPARMS in both manuals for information on parameter locations.

Does any of the MEQ units support a Aim command ?
Yes , the MEQ VIN units do at memory location 32618 , if poked with a value by the program to set the aim time. See the Sysparms command in the MEQ programmer guide .

How Long will a Program Conversion take?
NO Answer for that one. A few hours and longer , perhaps Days Longer .

Can you determine the difficulty of the conversion ?
NO, But a guess ….
1. The older MEQ programs , the 2 line program will be the easier .
2. Custom Programs that use the MEQ DEMO1.BAS as a model will be next.
3. Next the MEQ Generated code - Programs generated with other program generators will be the worst, along with complex custom written code. Some programs are hard to follow and the code is intended to be that way.

What if we do not have the time or resources to modify the code?
Contact Compsee Sales and a cost estimate can be given for program conversion.

Do I have another option other than program conversion?
Yes. If the program was written with the MEQ program generator, you should be able to reproduce it with the Apex II program generator.
We would encourage anyone to first determine if the program can be duplicated with the Apex II program generator before they begin a code conversion project.
We feel sure that the customer will be happier with the time and cost savings of a generated program over the time and cost of a converted program.

Can I use the MEQ PC programs to load the Apex II program and / or data files?
No. The programs distributed with the MEQ will not work well with the Apex II.

IF the MEQ is using the 1260 Node in a one to one connect and RS232 serial communications, can the Apex II and Cradle replace it ?
More than likely YES. But Some System Changes will have to be looked at. The MEQ and 1260 combination will usually have a PC program running waiting for the MEQ to start the communications session. With the Apex II and Cradle, the operator may have to start the communications, if the Compsee support programs are used. You can always write your own PC program to run like the ones normally used with the 1260.

4. Conversion Check List

  • Pull Assembly Code form program

  • Re-code all CALL commands

  • Re-code all POKE commands

  • Re-code all PEEK commands

  • Define the new SYSPARMS information , then re-code all Sysparms.

  • Re-code all FOR NEXT loops used for delays.

  • Re-define and re-code variables and display outputs.

  • Remove any code used to calculate the MODE (seen in some older programs)

  • Replace all PC programs and procedures for the MEQ with Apex II programs.

  • Test changes.