Anaheim user manual Sample #1 Program SAMPLE1.BAS on the CLCI2000 Disk, Initialize ADDR,AXIS

Page 18

SAMPLE #1 (PROGRAM SAMPLE1.BAS ON THE CLCI2000 DISK)

This is a sample program written for a single axis. If Input #1 is active, then the motor will move in the clockwise direction 5000 steps. If input #2 is active then the motor will move in the counterclockwise direction 4000 steps. It continues this loop indefinitely.

'PROGRAM FOR QUICKBASIC OR 'VISUALBASIC USING CLCISUB1.BAS

DECLARE ()...

'this representation is for all the declare statements

ADDR = &H300

'sets up the variable for the board address

AXIS = 1

'sets up the variable for axis 1

INITIALIZE ADDR,AXIS

'initializes axis1

MOTION ADDR,AXIS,500,10000,230000

'sets up the base speed, max

 

'speed, and ramp values

TOP.OF.LOOP:

 

IF GET.INPUT(ADDR,1) = 1 THEN

'looks at input #1

INDEX ADDR,AXIS,5000

'sets up the index number

GO.CW ADDR,AXIS

'indexes the motor

WAIT.FOR.STOP ADDR,AXIS

'waits until the motor has stopped

END IF

 

IF GET.INPUT.2 = 1 THEN

'looks at input #2

INDEX ADDR,AXIS,4000

'sets up the index number

GO.CCW ADDR,AXIS

'indexes the motor

WAIT.FOR.STOP ADDR,AXIS

'waits until the motor has stopped

END IF

 

GOTO TOP.OF.LOOP

 

15

Image 18
Contents CLCI2000 Series Disclaimer Limited WarrantyCopyright TrademarksTable of Contents General Description Main FeaturesDescription Packing InformationDPI65201 CLCI2004Ordering Information DPI65202AA37MMC-10 AA37MFC-10AA37MMC-6 AA2M37Specifications Wiring to the CLCI2000 InstallationInstalling the Board Address SettingsQuickstart with Quickbasic Connector Descriptions Clock Signals+5VDC Home Limit Direction SignalsSoft Limit Hard LimitEncoder Inputs InputsOutputs Index ADR, Axis GO.CW ADR, Axis Programming with Anaheim Automation LibrariesProgramming with Quickbasic or Visualbasic for DOS Speed ConsiderationsCLCISUB1.BAS Library ONE.AT.MAX.CCW ADDRESS, AXIS# ONE.AT.MAX.CW ADDRESS, AXIS#ORIGIN.INDEX.CCW ADDRESS, AXIS# RAMP.TO.BASE.CW ADDRESS, AXIS# ORIGIN.INDEX.CW ADDRESS, AXIS#RAMP.TO.BASE.CCW ADDRESS, AXIS# RAMP.TO.STOP.CCW ADDRESS, AXIS#SLEW.AT.BASE.CCW ADDRESS, AXIS# SLEW.AT.BASE.CW ADDRESS, AXIS#TOP.OF.LOOP If GET.INPUTADDR,1 = 1 then Sample #1 Program SAMPLE1.BAS on the CLCI2000 DiskInitialize ADDR,AXIS Index ADDR,AXIS,5000HOME.TYPE.1 Sample #2 Program SAMPLE2.BAS on the CLCI2000 DiskInitialize ADDR, Axis LIMIT.CONTROL ADDR, AXIS, 0, 0CLCISUBS.CPP Program Function Definitions Originindexccw ADDRESS, Axis Oneatmaxccw ADDRESS, AxisOneatmaxcw ADDRESS, Axis Originindexcw ADDRESS, AxisSoftinputccw ADDRESS, Axis Slewatbaseccw ADDRESS, AxisSlewatbasecw ADDRESS, Axis Softinputcw ADDRESS, AxisObject Command1Procedure Click Using the CLCI2000 Indexer with WindowsUsing the DLL with Visual Basic for Windows Programming in WindowsWIN2000.BAS Program Listing Anaheim Automation DLL Library SupportCLCI2004 Program Generator Running the SoftwareFunction Window F4- Terminal F1 InsertF3 Delete F5 SaveF3 Clear Program F1 Prog StopF2 Single Step F4 Printing a ProgramCommand Window Command Dictionary CLCI2004 Program Generator Command DictionaryCommand Summary Direction + orFinish Move no value Encoder Resolution any numberEncoder Window any integer GO Index no valueJump to Line 1 to UNITS/SCALE any number MAX Setting not in HZ Register # Bits Setting Range DescriptionBase Setting not in HZ Ramp SettingCommand Buffer Register Description of Command Initial Setup Commands Input and Output Control CommandsList of Equations Acceleration = MAX Speed Base Speed / TUP Page