![Galil DMC-4040 Скачать руководство пользователя страница 162](http://html1.mh-extra.com/html/galil/dmc-4040/dmc-4040_user-manual_3282915162.webp)
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.
Example - Using Variables for Joystick
The example below reads the voltage of an X-Y joystick and assigns it to variables vX and vY to drive the motors at
proportional velocities, where:
10 Volts = 3000 rpm = 200000 c/sec
Speed/Analog input = 200000/10 = 20000
#JOYSTIK
Label
JG 0,0
Set in Jog mode
BGXY
Begin Motion
#LOOP
Loop
vX=@AN[1]*20000
Read joystick X
vY=@AN[2]*20000
Read joystick Y
JG vX,vY
Jog at variable vX,vY
JP#LOOP
Repeat
EN
End
Operands
Operands allow motion or status parameters of the DMC-40x0 to be incorporated into programmable variables and
expressions. Most DMC commands have an equivalent operand - which are designated by adding an underscore (_)
prior to the DMC-40x0 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-40x0 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.
GAIN=_GNZ*2
Assigns value from GNZ multiplied by two to variable, GAIN.
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-40x0 provides a few additional operands which give access to internal variables that are not accessible by
standard DMC-40x0 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
Chapter 7 Application Programming
•
153
DMC-40x0 User Manual
Содержание DMC-4040
Страница 17: ...DMC 4080 Layout Figure 2 2 Outline of the of the DMC 4080 DMC 40x0 User Manual Chapter 2 Getting Started 8...
Страница 19: ...DMC 4040 Dimensions Figure 2 5 Dimensions of DMC 4040 DMC 40x0 User Manual Chapter 2 Getting Started 10...
Страница 20: ...DMC 4080 Dimensions Figure 2 6 Dimensions of DMC 4080 Chapter 2 Getting Started 11 DMC 40x0 User Manual...
Страница 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Страница 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Страница 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Страница 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Страница 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Страница 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Страница 220: ...Step 2 Remove ICM For DMC 4040 Proceed to Step 3 Configure Circuit Appendices 211 DMC 40x0 User Manual...
Страница 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Страница 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...