Examples of Built-In Variables
• (PIECES)=10
Assigns 10 to variable
• (SPEED)=(AI12)*(VEL SCALE)
Speed = analog input times a scalar
• MS21,“Enter Length”IV32,(LENGTH)
Prompts user and gets feed length
• VE(SPEED)
Sets velocity to value in variable
• MS1,(POS2)
Displays current position of axis 2 on
keypad screen
• (TERM)=(POS1)
Sends the current position of axis 1 out
the RS-232 port of the SmartDrive
• (TEMPERATURE)=(AI9)
Reads in temperature from analog input
• (AO15)=4012
Sets the analog output to 4012
Using the Built-In Variable (AROWREL)
(AROWREL) is a built-in Boolean read only variable which determines the status of
any of the 4 ar row keys. When used in conjunction with (FKEY),the user can
detect whether or not an arrow key is being held down. (AROWREL) will return
one of the following values:
(AROWREL) = 0 One of the arrow keys is being held down.
(AROWREL) = 1 The arrow key has been released.
(AROWREL) will return k ey status for the 4 arrow keys only. If any other key is
pressed,(AROWREL) will return zero regardless if the key is held down or not.The
following is an example jog application using (AROWREL) and (FKEY):
[MAIN]
{Program #1}
FK12,13{Wait for a Left or Right ar row key}
GT(FKEY)
{Jump to arrow key program #12 or #13}
[LEFTARROW]
{Program #12}
MC+
{Enable MC mode}
AC.1
{Start MC move}
VE1
{Move in positive direction}
GO
LP
IF(AROWREL)=1{Check status of ar row key}
VE0 {Stop MC move on key release}
GO
GT1{Return to main program}
EB
EB
{End loop block}
[RIGHTARROW] {Program #13}
MC+
{Enable MC mode}
AC.1
{Start MC move}
VE-1
{Move in negative direction}
GO
LP
IF(AROWREL)=1{Check status of ar row key}
VE0 {Stop MC move on key release}
GO
GT1{Return to main program}
EB
EB
{End loop block}
Chapter 5 - Programming Your System
51
Содержание B8961
Страница 111: ...109 Chapter 7 Programming with Serial Communication...
Страница 132: ...B8961 and B8962 User Manual 130...
Страница 136: ...B8961 and B8962 User Manual 134 B8961 and B8962 Hardware Connections...
Страница 137: ...135 Chapter 8 Hardware Reference B8961 and B8962 Input and Output Schematics...
Страница 138: ...B8961 and B8962 User Manual 136 Connecting IDC Limit Switches to the B8961 2...
Страница 156: ...B8961 and B8962 User Manual 154...