Anaheim CLCI2000 user manual CLCISUB1.BAS Library

Page 14

CLCISUB1.BAS LIBRARY

The CLCISUB1.BAS Library is for use with QuickBASIC, VisualBasic for DOS, or any other similar 'BASIC' based programming languages. This Library is set up to run CLCI2000 Series Indexers at any open addresses. The following is a command list for all the usable Subroutines and Functions in this Library. This is a comprehensive list that will allow complete control of the CLCI2000 Series Index Boards. To use these commands you need to LOAD the file CLCISUB1.BAS into your main program and DECLARE the Subroutines and Functions you wish to use. That is all there is to it. Refer to your QuickBASIC or VisualBasic manual for more details.

In all the below descriptions, these general guidelines apply:

The ADDRESS is the setting on the 5 pin dip switch (see Installation). This is always given in the Hexadecimal format. For a setting of 11000, or a Base Address of 300, the correct format would be (&H300, ...)

The AXIS# applies to the axis for that particular board (1, 2, 3, or 4)

BUSY (ADDRESS, AXIS#)

This Function will return a 1 if the axis is Busy (clock pulses are being generated). It will return a 0 if there is no motion at all. This is a good Input to use to wait until the motion has stopped before going on in the program.

GET.BASE (BASE, MAX, RAMP)

Because the motor speeds are created by a digital device, the resolution is limited to the clock oscillator that is used - in this case it is 9.8304 MHz. The result is a speed that is very close to the one desired - usually within a fraction of a percent. This Function will return the actual Base Speed obtainable with the given parameters. This is used to find out the exact Base Speed that will be used for the specified numbers. For example, if the desired Base Speed was 500, Max Speed was 10,000, and Ramp was 2,000, the resulting Base Speed would actually be: 499.7963 Hz.

GET.MAX (BASE, MAX, RAMP)

Because the motor speeds are created by a digital device, the resolution is limited to the clock oscillator that is used - in this case it is 9.8304 MHz. The result is a speed that is very close to the one desired - usually within a fraction of a percent. This Function will return the actual Max Speed obtainable with the given parameters. This is used to find out the exact Max Speed that will be used for the specified numbers. For example, if the desired Base Speed was 500, Max Speed was 10,000, and Ramp was 2,000, the resulting Base Speed would actually be: 9999.593 Hz.

GET.RAMP (BASE, MAX, RAMP)

Because the motor speeds are created by a digital device, the resolution is limited to the clock oscillator that is used - in this case it is 9.8304 MHz. The result is a Ramp that is very close to the one desired - usually within a fraction of a percent. This Function will return the actual Ramp obtainable with the given parameters. This is used to find out the exact Ramp that will be used for the specified numbers. For example, if the desired Base Speed was 500, Max Speed was 10,000, and Ramp was 2,000, the resulting Ramp would actually be: 2000.784 Hz/Second.

GET.INPUT (ADDRESS, INPUT#)

This Function will return the values for INPUT 1. A '1' means that the input is active, or at a TTL state of 0VDC. A '0' means that the input is at a TTL state of +5VDC or there is no connection to the input.

GO.CCW ADDRESS, AXIS#

This Subroutine will Index in the counterclockwise direction. The distance that the motor will move depends on the distance set by the A.INDEX.NUMBER command. The motion starts at Base Speed and Ramps up to Max Speed, sustains the Max Speed, and then finishes the move by ramping down to Base Speed and stopping.

GO.CW ADDRESS, AXIS#

This Subroutine will Index in the clockwise direction. The distance that the motor will move depends on the distance set by the A.INDEX.NUMBER command. The motion starts at Base Speed and Ramps up to Max Speed, sustains the Max Speed, and then finishes the move by ramping down to Base Speed and stopping.

HARD.INPUT.CCW (ADDRESS, AXIS#)

This Function will return the value of the -Hard Limit Switch. If the Limit Switch is ACTIVE or 0VDC, the Function will return a 1. If the Limit Switch is NOT ACTIVE, the function will return a 0.

HARD.INPUT.CW (ADDRESS, AXIS#)

11

Image 14
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 +5VDC Connector DescriptionsClock Signals Home Limit Direction SignalsSoft Limit Hard LimitOutputs Encoder InputsInputs Index ADR, Axis GO.CW ADR, Axis Programming with Anaheim Automation LibrariesProgramming with Quickbasic or Visualbasic for DOS Speed ConsiderationsCLCISUB1.BAS Library ORIGIN.INDEX.CCW ADDRESS, AXIS# ONE.AT.MAX.CCW ADDRESS, AXIS#ONE.AT.MAX.CW 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 SupportFunction Window CLCI2004 Program GeneratorRunning the Software 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 List of Equations Initial Setup CommandsInput and Output Control Commands Acceleration = MAX Speed Base Speed / TUP Page