Intellidrives

Linear Actuators, Rotary Tables and XYZ Systems
for Motion Control Automation
Phone image Click to chat Click to chat Parametric Search New Products

Linear and Rotary Motion in its Simplest Form™

Phone image Phone image Click to chat Click to chat Parametric Search New Products IMAC Live DemoIMAC Live Demo
Home
Phone image
Click to Skype
Click to chat
Parametric Search
New Products
You are here:    Home > Blog: Programming IntelLigent Actuators (part2)
IntelLiDrives Products
  • Linear Actuators
  • Linear Actuators - Moving Shaft
  • Lift Stages
  • Combination XY-Lift-Rotary
  • Rotary Tables
  • Rotary Actuators and Stages
  • XY Tables and Stages
  • XY and XYZ Systems
  • Controllers and Drives
  • Encoders
 
Parametric Search
  • Linear Actuators
  • Rotary Tables
  • XY Tables and XYZ Systems
  • Combination Systems
  • Lift Actuators
 
Information
  • Home
  • Videos
  • Request Quote/Information
  • Search
  • Application Info
  • Contact Us - Email
  • Address, Phone, Skype
  • News
  • Community
 
Powered by Crafty Syntax
Skype Me!
Telephone: (215) 728-6804 (USA)
IMAC Live DemoIMAC Live Demo
 

Blog: Programming IntelLigent Actuators (part2)

Our next task will be to show how variables can be used in place of “hard coded” values to facilitate external parameter change. Then conditional branching will be used to call subroutines via a variable change or I/O.

First variables need to to be assigned. There are two types within the “SmartMotor” control scheme: Volatile (addresses 0­49) which are not retained in memory and Non­-Volatile (50­99) which are retained after powering down a controller. They can be used to hold and change data for parameters such as position, speed, counters, timers, etc.

; MAIN APPLICATION SECTION

ABS;Sets absolute mode

X2000 ; Moves X axis 2000 steps

WAITX ; wait for move complete

Y2000; Moves Y axis 2000 steps

WAITY ; wait for move complete

HSPDX=V50;

sets the speed of the X axis to the value in Variable 50

XV90; Moves X axis to the position based on the value in Variable 90

YV91; Moves Y axis to the position based on the value in Variable 91

DO2=1; turns on output #2 DELAY=500; wait 500mS

DO2=0; turns off output #2

END; end of program

Now the code adds a second X­Y move in which the move data is stored in a non­volatile variable for each axis and the speed of the X axis move is based upon another non­volatile variable. If we look at the code above, the 2000 step move is essentially an offset from the original Homing routine, while the second X­Y move is only defined by the value of the variables.

Sometimes in an application it becomes important to decide when and if either of these moves gets executed. We will next show how this can be accomplished with conditional branching and sub­routines. We are going to put each X­Y move (the hard coded, offset move and the variable based move) into its own subroutine. Determining when the sub­routines are “called” will be based on an “IF­-THEN­-ELSE” statement.

; MAIN APPLICATION SECTION ABS ;Sets absolute mode

IF DI1=1 ; looks at status of input 1

GOSUB 1 ; calls subroutine 1 ELSE

GOSUB 2 ; calls subroutine 2 ENDIF ; ends conditional branching/jumping

END : end of program

SUB 1 ; defines the subroutine

X2000 ; Moves X axis 2000 steps

WAITX ; wait for move complete

Y2000 ; Moves Y axis 2000 steps

WAITY ; wait for move complete

ENDSUB ; signals the end of the subroutines

 

SUB 2 ; defines the subroutine

HSPDX=V50 ; sets the speed of the X axis to the value in Variable 50

XV90 ; Moves X axis to the position based on the value in Variable 90

YV91 ; Moves Y axis to the position based on the value in Variable 91

DO2=1 ; turns on output #2

DELAY=500 ; wait 500mS

DO2=0 ; turns off output #2

ENDSUB ; signals the end of the subroutines

As can be seen, the program code is now divided into two separate pieces. Their execution is determined by the value of digital input 1. 

Leave A Comment
Name


Comment
Rating Bad            Good
Submit Comment

 © 1999-2019 IntelLiDrives Inc. | 8510 Bustleton Ave | Philadelphia, PA 19152, USA  |  (215) 728-6804 |  sales@intellidrives.com | Skype: intellidrives