Anaheim CLCI2000 user manual CLCISUBS.CPP Program Function Definitions

Page 20

CLCISUBS.CPP PROGRAM FUNCTION DEFINITIONS

The CLCISUBS.CPP Library is for use with C or C++ programming languages. It can also be used with other versions of 'C' or 'C++' with little or no modifications to the code. This Library is set up to run CLCI2000 Series Indexers at any open address. The following is a command list for all the usable Functions in this Library. This is a comprehensive list that will allow complete control of the CLCI2000 Series Index Boards. Refer to your programming manual for information on how to load this Library.

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 (0x300, ...)

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

BUSY (ADDRESS, AXIS)

This will return a 1 if the axis is Busy (clock pulses are being generated).

GET_INPUT (ADDRESS, INPUT#)

This will return the value for the Specified input number 1 through 10. A return of a 1 will specify that the input is active (0VDC), and a 0 will specify that the input is not active (an open circuit).

GO_CCW (ADDRESS, AXIS)

This will Index in the clockwise direction.

GO_CW (ADDRESS, AXIS)

This will Index in the counterclockwise direction.

HARD_INPUT_CCW (ADDRESS, AXIS)

This 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)

This 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.

HOME_CCW (ADDRESS, AXIS)

This will HOME (sometimes called SLEW) the motor in the counterclockwise direction.

HOME_CW (ADDRESS, AXIS)

This will HOME (sometimes call SLEW) the motor in the clockwise direction.

HOME_INPUT (ADDRESS, AXIS)

This will return the value of the +Home Limit or -Home Lime (determined by the LIMIT_CONTROL). If the Limit Switch is Active, the function will return a 1. If the Limit Switch is NOT ACTIVE, the function will return a 0.

INDEX (ADDRESS, AXIS, NUMBER)

This will set the Index Number Register.

INITIALIZE (ADDRESS, AXIS)

This will set the axis with initial settings. This must be done at the beginning of every program to ensure that the all the default setting are made.

LIMIT_CONTROL (ADDRESS, AXIS, SOFT, MARK, HOME)

This will either Activate or Deactivate the board features: SOFT LIMIT SWITCHES, ENCODER MARKER PULSE, OR HOME LIMIT SWITCH. A 1 will activate the feature, and a 0 will deactivate the feature.

MOTION (ADDRESS, AXIS, BASE, MAX, RAMP)

This will set the Base Speed, Max Speeds, and Acceleration. All three values must be entered.

17

Image 20
Contents CLCI2000 Series Limited Warranty CopyrightDisclaimer TrademarksTable of Contents Main Features DescriptionGeneral Description Packing InformationCLCI2004 Ordering InformationDPI65201 DPI65202AA37MFC-10 AA37MMC-6AA37MMC-10 AA2M37Specifications Installation Installing the BoardWiring to the CLCI2000 Address SettingsQuickstart with Quickbasic +5VDC Connector DescriptionsClock Signals Direction Signals Soft LimitHome Limit Hard LimitOutputs Encoder InputsInputs Programming with Anaheim Automation Libraries Programming with Quickbasic or Visualbasic for DOSIndex ADR, Axis GO.CW ADR, Axis Speed ConsiderationsCLCISUB1.BAS Library ORIGIN.INDEX.CCW ADDRESS, AXIS# ONE.AT.MAX.CCW ADDRESS, AXIS#ONE.AT.MAX.CW ADDRESS, AXIS# ORIGIN.INDEX.CW ADDRESS, AXIS# RAMP.TO.BASE.CCW ADDRESS, AXIS#RAMP.TO.BASE.CW ADDRESS, AXIS# RAMP.TO.STOP.CCW ADDRESS, AXIS#SLEW.AT.BASE.CCW ADDRESS, AXIS# SLEW.AT.BASE.CW ADDRESS, AXIS#Sample #1 Program SAMPLE1.BAS on the CLCI2000 Disk Initialize ADDR,AXISTOP.OF.LOOP If GET.INPUTADDR,1 = 1 then Index ADDR,AXIS,5000Sample #2 Program SAMPLE2.BAS on the CLCI2000 Disk Initialize ADDR, AxisHOME.TYPE.1 LIMIT.CONTROL ADDR, AXIS, 0, 0CLCISUBS.CPP Program Function Definitions Oneatmaxccw ADDRESS, Axis Oneatmaxcw ADDRESS, AxisOriginindexccw ADDRESS, Axis Originindexcw ADDRESS, AxisSlewatbaseccw ADDRESS, Axis Slewatbasecw ADDRESS, AxisSoftinputccw ADDRESS, Axis Softinputcw ADDRESS, AxisUsing the CLCI2000 Indexer with Windows Using the DLL with Visual Basic for WindowsObject Command1Procedure Click Programming in WindowsWIN2000.BAS Program Listing Anaheim Automation DLL Library SupportFunction Window CLCI2004 Program GeneratorRunning the Software F1 Insert F3 DeleteF4- Terminal F5 SaveF1 Prog Stop F2 Single StepF3 Clear Program F4 Printing a ProgramCommand Window CLCI2004 Program Generator Command Dictionary Command SummaryCommand Dictionary Direction + orEncoder Resolution any number Encoder Window any integerFinish Move no value GO Index no valueJump to Line 1 to UNITS/SCALE any number Register # Bits Setting Range Description Base Setting not in HZMAX 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