LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages

opERROR

  • This code does not exist in normal program
  • Dispatch status changes to INSTRBREAK


    opNOP

  • This code does absolutely nothing

    opPROGRAM_STOP (PRGID)
  • Stops specific program id slot
  • Dispatch status changes to PRGBREAK

    Parameters
    (DATA16)PRGID - Program id (GUI_SLOT = all, CURRENT_SLOT = current) (see prgid)

    opPROGRAM_START (PRGID, SIZE, *IP, DEBUG)

  • Start program id slot
  • Dispatch status unchanged

    Parameters
    (DATA16)PRGID - Program id (see prgid)
    (DATA32)SIZE - Size of image
    (DATA32)*IP - Address of image (value from opFILE(LOAD_IMAGE,..) )
    (DATA8)DEBUG - Debug mode (0=normal, 1=debug, 2=don't execute)

    opOBJECT_STOP (OBJID)

  • Stops specific object
  • Dispatch status changes to STOPBREAK

    Parameters
    (DATA16)OBJID - Object id

    opOBJECT_START (OBJID)

  • Start specific object
  • Dispatch status unchanged

    Parameters
    (DATA16)OBJID - Object id

    opOBJECT_TRIG (OBJID)

  • Triggers object and run the object if fully triggered
  • Dispatch status unchanged

    Parameters
    (DATA16)OBJID - Object id

    opOBJECT_WAIT (OBJID)

  • Wait until object has run
  • Dispatch status can change to BUSYBREAK

    Parameters
    (DATA16)OBJID - Object id

    opRETURN

  • Return from byte code subroutine
  • Dispatch status changes to STOPBREAK


    opCALL (OBJID, PARAMETERS, ....)

  • Calls byte code subroutine
  • Dispatch status changes to STOPBREAK or BUSYBREAK

    Parameters
    (DATA16)OBJID - Object id
    (DATA8)PARAMETERS - Number of parameters
  • Parameter Encoding


    opOBJECT_END

  • Stops current object
  • Dispatch status changes to STOPBREAK


    opSLEEP

  • Breaks execution of current VMTHREAD
  • Dispatch status changes to INSTRBREAK


    opPROGRAM_INFO (CMD, PRGID, DATA)

  • Get program data
  • Dispatch status can change to FAILBREAK

    Parameters
    (DATA8)CMD - Specific command parameter


    • CMD = OBJ_STOP
      • Parameters
        (DATA16)PRGID - Program slot number (see prgid)
      • Parameters
        (DATA16)OBJID - Object id

    • CMD = OBJ_START
      • Parameters
        (DATA16)PRGID - Program slot number (see prgid)
      • Parameters
        (DATA16)OBJID - Object id

    • CMD = GET_STATUS
      • Parameters
        (DATA16)PRGID - Program slot number (see prgid)
      • Returns
        (DATA8) DATA - Program status

    • CMD = GET_PRGRESULT
      • Parameters
        (DATA16)PRGID - Program slot number (see prgid)
      • Returns
        (DATA8) DATA - Program result [OK, BUSY, FAIL]

    • CMD = GET_SPEED
      • Parameters
        (DATA16)PRGID - Program slot number (see prgid)
      • Returns
        (DATA32) DATA - Program speed [instr/S]


        opLABEL (NO)
  • This code does nothing besides marking an address to a label
    Parameters
    (DATA8)NO - Label number

    opPROBE (PRGID, OBJID, OFFSET, SIZE)
  • Display globals or object locals on terminal
  • Dispatch status unchanged

    Parameters
    (DATA16)PRGID - Program slot number (see prgid)
    (DATA16)OBJID - Object id (zero means globals)
    (DATA32)OFFSET - Offset (start from)
    (DATA32)SIZE - Size (length of dump) zero means all (max 1024)

    opDO (PRGID, IMAGE)

  • Run byte code snippet
  • Dispatch status can change to BUSYBREAK

    Parameters
    (DATA16)PRGID - Program slot number
    (DATA32)*IMAGE - Address of image
    (DATA32)*GLOBAL - Address of global variables

    opBP0 - opBP3

  • Display globals or object locals on terminal
  • Removes it self when done
  • Dispatch status unchanged


    opBP_SET (PRGID, NO, ADDRESS)

  • Set break point in byte code program
  • Dispatch status unchanged

    Parameters
    (DATA16)PRGID - Program slot number (see prgid)
    (DATA8)NO - Breakpoint number [0..2] (3 = trigger out on TP4)
    (DATA32)ADDRESS - Address (Offset from start of image) (0 = remove breakpoint)

    opRANDOM (MIN, MAX, VALUE)

  • Get random value
  • Dispatch status unchanged

    Parameters
    (DATA16)MIN - Minimum value
    (DATA16)MAX - Maximum value
    Returns
    (DATA16) VALUE - Value

    opINFO (CMD, ....)

  • Info functions entry
  • Dispatch status unchanged

    Parameters
    (DATA8)CMD - Specific command parameter


    • CMD = SET_ERROR
      • Parameters
        (DATA8)NUMBER - Error number

    • CMD = GET_ERROR
      • Returns
        (DATA8) NUMBER - Error number

    • CMD = ERRORTEXT
      Convert error number to text string
      • Parameters
        (DATA8)NUMBER - Error number
      • Parameters
        (DATA8)LENGTH - Maximal length of string returned (-1 = no check)
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = GET_VOLUME
      • Returns
        (DATA8) VALUE - Volume [0..100%]

    • CMD = SET_VOLUME
      • Parameters
        (DATA8)VALUE - Volume [0..100%]

    • CMD = GET_MINUTES
      • Returns
        (DATA8) VALUE - Minutes to sleep [0..120min] (0 = ~)

    • CMD = SET_MINUTES
      • Parameters
        (DATA8)VALUE - Minutes to sleep [0..120min] (0 = ~)


        opSTRINGS (CMD, ....)
  • String function entry
  • Dispatch status unchanged

    Parameters
    (DATA8)CMD - Specific command parameter


    • CMD = GET_SIZE
      Get size of string (not including zero termination)
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Returns
        (DATA16) SIZE - Size

    • CMD = ADD
      Add two strings (SOURCE1 + SOURCE2 -> DESTINATION)
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Parameters
        (DATA8)SOURCE2 - String variable or handle to string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = COMPARE
      Compare two strings
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Parameters
        (DATA8)SOURCE2 - String variable or handle to string
      • Returns
        (DATA8) RESULT - Result (0 = not equal, 1 = equal)

    • CMD = DUPLICATE
      Duplicate a string (SOURCE1 -> DESTINATION)
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = VALUE_TO_STRING
      Convert floating point value to a string (strips trailing zeroes)
      • Parameters
        (DATAF)VALUE - Value to write (if "nan" op to 4 dashes is returned: "----")
      • Parameters
        (DATA8)FIGURES - Total number of figures inclusive decimal point (FIGURES < 0 -> Left adjusted)
      • Parameters
        (DATA8)DECIMALS - Number of decimals
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = NUMBER_TO_STRING
      Convert integer value to a string
      • Parameters
        (DATA16)VALUE - Value to write
      • Parameters
        (DATA8)FIGURES - Total number of figures
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = STRING_TO_VALUE
      Convert string to floating point value
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Returns
        (DATAF) VALUE - Value

    • CMD = STRIP
      Strip a string for spaces (SOURCE1 -> DESTINATION)
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = SUB
      Return DESTINATION: a substring from SOURCE1 that starts were SOURCE2 ends
      • Parameters
        (DATA8)SOURCE1 - String variable or handle to string
      • Parameters
        (DATA8)SOURCE2 - String variable or handle to string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = VALUE_FORMATTED
      Convert floating point value to a formatted string
      • Parameters
        (DATAF)VALUE - Value to write
      • Parameters
        (DATA8)FORMAT - Format string variable or handle to string
      • Parameters
        (DATA8)SIZE - Total size of destination string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = NUMBER_FORMATTED
      Convert integer number to a formatted string
      • Parameters
        (DATA32)NUMBER - Number to write
      • Parameters
        (DATA8)FORMAT - Format string variable or handle to string
      • Parameters
        (DATA8)SIZE - Total size of destination string
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

        Program Example

        opMEMORY_WRITE (PRGID, OBJID, OFFSET, SIZE, ARRAY)
  • Write VM memory
  • Dispatch status unchanged

    Parameters
    (DATA16)PRGID - Program slot number (must be running) (see prgid)
    (DATA16)OBJID - Object id (zero means globals)
    (DATA32)OFFSET - Offset (start from)
    (DATA32)SIZE - Size (length of array to write)
    (DATA8)ARRAY - First element of DATA8 array to write
    Direct command example

    opMEMORY_READ (PRGID, OBJID, OFFSET, SIZE, ARRAY)

  • Read VM memory
  • Dispatch status unchanged

    Parameters
    (DATA16)PRGID - Program slot number (must be running) (see prgid)
    (DATA16)OBJID - Object id (zero means globals)
    (DATA32)OFFSET - Offset (start from)
    (DATA32)SIZE - Size (length of array to read)
    Returns
    (DATA8) ARRAY - First element of DATA8 array to receive data
    Direct command example

    opPORT_CNV_OUTPUT (PortIn, Layer, Bitfield, Inverted)

  • Convert encoded port to Layer and Bitfield
  • Dispatch status unchanged

    Parameters
    (DATA32)PortIn - EncodedPortNumber
    Returns
    (DATA8) Layer - Layer
    (DATA8) Bitfield - Bitfield
    (DATA8) Inverted - True if left/right motor are inverted (ie, C&A)

    opPORT_CNV_INPUT (PortIn, Layer, PortOut)

  • Convert encoded port to Layer and Port
  • Dispatch status unchanged

    Parameters
    (DATA32)PortIn - EncodedPortNumber
    Returns
    (DATA8) Layer - Layer
    (DATA8) PortOut - 0-index port for use with VM commands

    opNOTE_TO_FREQ (NOTE, FREQ)

  • Convert note to tone
  • Dispatch status unchanged

    Parameters
    (DATA8)NOTE - Note string (HND) (e.c. "C#4")
    Returns
    (DATA16) FREQ - Frequency [Hz]

    opSYSTEM(COMMAND, STATUS)

  • Executes a system command
  • Dispatch status unchanged

    Parameters
    (DATA8)COMMAND - Command string (HND)
    Returns
    (DATA32) STATUS - Return status of the command