EasyManua.ls Logo

Galil DMC-4040 - Mathematical and Functional Expressions; Mathematical Operators

Galil DMC-4040
284 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ENDIF
#PWRHLPR
^c=^c*^a
^b=^b-1
JP#PWRHLPR,^b>0
IF ^d=1 ;'if inversion required
^c=(1/^c)
ENDIF
EN,,^c
Executed program from program1.dmc
4.0000
65536.0000
0.0039
Example: Recursion
'although the stack depth is only 16, Galil DMC code does support recursion
JS#AxsInfo(0)
MG{Z2.0}"Recursed through ",_JS," stacks"
EN
'
#AxsInfo ;NO(axis ^a) List info for axes
~h=^a
^b=(^a+$41)*$1000000 ;'convert to Galil String
MG^b{S1}, " Axis: "{N}
MG{F8.0}"Position: ",_TP~h," Error:",_TE~h," Torque:",_TT~h{F1.4}
IF ^a=7 ;'recursion exit condition
EN,,1
ENDIF
JS#AxsInfo(^a + 1) ;'stack up recursion
EN,,_JS+1 ;' as recursion closes, add up stack depths
Executed program from program1.dmc
A Axis: Position: 00029319 Error: 00001312 Torque: 9.9982
B Axis: Position: -00001612 Error: 00000936 Torque: 1.7253
C Axis: Position: 00001696 Error:-00001076 Torque:-1.9834
D Axis: Position: -00002020 Error: 00001156 Torque: 2.1309
E Axis: Position: 00000700 Error:-00001300 Torque:-2.3963
F Axis: Position: 00000156 Error:-00000792 Torque:-1.4599
G Axis: Position: -00002212 Error: 00001732 Torque: 3.1926
H Axis: Position: 00002665 Error:-00001721 Torque:-3.1723
Recursed through 8 stacks
Mathematical and Functional Expressions
Mathematical Operators
For manipulation of data, the DMC-40x0 provides the use of the following mathematical operators:
Operator Function
Chapter 7 Application Programming 149 DMC-40x0 User Manual

Table of Contents

Related product manuals