8
●
^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h
DMC-40x0 Command Reference
^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h
FUNCTION:
JS subroutine stack variable
DESCRIPTION:
Provides local subroutine access for up to 8 variables passed on the subroutine stack when using
the JS (jump to subroutine) command.
Passing values on the stack is
advanced
DMC programming, and is recommended for
experienced DMC programmers familiar with the concept of passing arguments by value and
by reference.
See the JS command for a full explanation of passing stack variables.
Notes:
1.
Passing parameters has no type checking, so it is important to exercise good programming
style when passing parameters. See examples below for recommended syntax.
2.
Do not use spaces in expressions containing ^.
3.
Global variables MUST be assigned prior to any use in subroutines where variables are
passed by reference.
USAGE: Defaults:
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format
-
Command Line
Yes
Controller Usage
DMC-4000
RELATED COMMANDS:
Pass by reference
Jump to subroutine
EXAMPLE:
#Add
JS
#SUM
(1,2,3,4,5,6,7,8)
;' call subroutine, pass values
MG
_JS
return value
EN
'
#SUM
;NO(^a,^b,^c,^d,^e,^f,^g,^h) syntax note for use
EN
,,(^a+^b+^c+^d+^e+^f+^g+^h)
;' return sum
:Executed program from program1.dmc
36.0000
Note:
For additional examples, see the “JS Subroutine Stack Variables (^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h)”
section in the DMC-40x0 User Manual.
Summary of Contents for DMC-40x0 Series
Page 2: ......
Page 4: ......
Page 10: ...vi i Table of Contents DMC 40x0 Command Reference This Page is Left Blank Intentionally ...