Page 62 of 112
DMM-0200 Product User Guide
159 Swanson Road
Boxborough, MA 01719
Tel: 508-475-3400
Email: sales@dovermotion.com
Standalone Program Specification
Standalone Program Specification:
Memory size: 1,275 assembly lines.
Note: Each line of pre-compiled code equates to 1-4 lines of assembly lines.
WAIT Statement
When writing a standalone program, it is generally necessary to wait until a motion is completed before
moving on to the next line. In order to do this, the WAIT statement must be used. See the examples below:
In the example below, the variable V1 will be set immediately afterthe X10000 move command begins; it will
not wait until the controller is idle.
X10000 ;* Move to position 0
V1 =100
Conversely, in the example below, the variable V1 will not be set until the motion has been completed. V1
will only be set once the controller is idle.
X10000 ;* Move to position 0
WAITX ;* Wait for the move to complete
V1 =100
Multi-Threading
PMX-2EX-SA supports the simultaneous execution of up to 2 standalone programs. Programs 0, 1
are controlled via the SR0 and SR1 commands respectively. For examples of multi-threading, please
refer to the Example Stand-alone Programs section.
Note: Sub-routines can be shared by different threads.
Error Handling
If an error occurs during standalone execution (i.e. limit error), the program automatically jumps to SUB 31. If
SUB 31 is NOT defined, the program will cease execution and go to error state. If SUB 31 is defined by the
user, the code within PMX-2EX-SA Manual page 42 rev 2.2 SUB 31 will be executed. The return jump line will
be determined by value of the 13t
h
bit of the POL register. If the value is 0, the return jump line will be the line
that caused the error. Otherwise, the return jump line will be line 0.
Calling subroutines over communication
Once a subroutine is written into the flash, they can be called via USB communication using the GS
command. The subroutines are referenced by their subroutine number [0-31]. If a subroutine number is not
defined, the controller will return with an error.