36.0000
36.0000
Example: Working with Arrays
#Array
DM
speeds[8]
DM
other[256]
JS
#zeroAry
(
"speeds"
,0)
;'zero out all buckets in speeds[]
JS
#zeroAry
(
"other"
,0)
;'zero out all buckers in other[]
EN
'
#zeroAry
;NO(array ^a, ^b) zeros array starting at index ^b
^a[^b]=0
^b=^b+1
JP
#zeroAry
,(^b<^a[-1])
;'[-1] returns the length of an array
EN
Example: Abstracting Axes
#Axes
JS
#runMove
(0,10000,1000,100000,100000)
MG
"Position:"
,
_JS
EN
'
#runMove
;NO(axis ^a, PR ^b, SP ^c, AC ^d, DC ^e) Profile movement for axis
~a=^a
;'~a is global, so use carefully in subroutines
'try one variable axis a-h for each thread A-H
PR
~a=^b
SP
~a=^c
AC
~a=^d
DC
~a=^e
BG
~a
MC
~a
EN
,,
_TP
~a
Example: Local Scope
#Local
JS
#POWER
(2,2)
MG
_JS
JS
#POWER
(2,16)
MG
_JS
JS
#POWER
(2,-8)
MG
_JS
'
#POWER
;NO(base ^a,exponent^b) Returns base^exponent power. +/- integer only
^c=1
;'unpassed variable space (^c-^h) can be used as local scope variables
IF
^b=0
;'special case, exponent = 0
EN
,,1
ENDIF
IF
^b<0
;'special case, exponent < 0, invert result
^d=1
^b=
@ABS
[^b]
ELSE
^d=0
DMC-40x0 User Manual
Chapter 7 Application Programming
•
148
Summary of Contents for DMC-4040
Page 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Page 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Page 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Page 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Page 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Page 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Page 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Page 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...