DMC-18x2
Chapter 7 Application Programming • 131
Assigning Variable Values to Controller Parameters
Variable values may be assigned to controller parameters such as GN or PR.
PR V1
Assign V1 to PR command
SP P3*2000
Assign P3*2000 to SP command
Displaying the value of variables at the terminal
Variables may be sent to the screen using the format, variable=. For example, V1= , returns the value
of the variable V1.
Operands
Operands allow motion or status parameters of the DMC-18x2 to be incorporated into programmable
variables and expressions. Most DMC-18x2 commands have an equivalent operand - which are
designated by adding an underscore (_) prior to the DMC-18x2 command. The command reference
indicates which commands have an associated operand.
Status commands such as Tell Position return actual values, whereas action commands such as KP or
SP return the values in the DMC-18x2 registers. The axis designation is required following the
command.
Examples of Internal Variables:
POSX=_TPX
Assigns value from Tell Position X to the variable POSX.
VAR1=_KPX*2
Assigns value from KPX multiplied by two to variable, VAR1.
JP #LOOP,_TEX>5
Jump to #LOOP if the position error of X is greater than 5
JP #ERROR,_TC=1
Jump to #ERROR if the error code equals 1.
Operands can be used in an expression and assigned to a programmable variable, but they cannot be
assigned a value. For example: _GNX=2 is invalid.
Special Operands (Keywords)
The DMC-18x2 provides a few additional operands which give access to internal variables that are not
accessible by standard DMC-18x2 commands.
KEYWORD FUNCTION
_BGn
*Returns a 1 if motion on axis ‘n’ is complete, otherwise returns 0.
_BN
*Returns serial # of the board.
_DA
*Returns the number of arrays available
_DL
*Returns the number of available labels for programming
_DM
*Returns the available array memory
_HMn
*Returns status of Home Switch (equals 0 or 1)
_LFn
Returns status of Forward Limit switch input of axis ‘n’ (equals 0 or 1)
_LRX
Returns status of Reverse Limit switch input of axis ‘n’ (equals 0 or 1)
_UL
*Returns the number of available variables
TIME
Free-Running Real Time Clock (off by 2.4% - Resets with power-on).
Note: TIME does not use an underscore character (_) as other keywords.
* - These keywords have corresponding commands while the keywords _LF, _LR, and TIME do not
have any associated commands. All keywords are listed in the Command Reference manual.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание DMC-18 2 Series
Страница 3: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 5: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 11: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...