Anaheim user manual Programming in Windows, Using the CLCI2000 Indexer with Windows

Page 23

PROGRAMMING IN WINDOWS

USING THE CLCI2000 INDEXER WITH WINDOWS

To communicate with the CLCI2000 Indexer, the programming language needs to have access to the computer bus. While running under windows, this bus can be controlled through a Dynamic Link Library, commonly called a DLL. A DLL will allow procedures to be performed that are not part of the standard Windows Instruction Set. This DLL has been extensively tested on Visual Basic for Windows, and can also be used for other Software Languages that can use a Dynamic Link Library.

USING THE DLL WITH VISUAL BASIC FOR WINDOWS

The process of loading the DLL into the main application is very simple. This process will be described in this section.

The first step is to choose a new project. This can be done by choosing FILE, New Project.

The next step is to add the declaration file WIN2000.BAS. To do this, choose, FILE, Add File. The correct directory should be put in for the position of WIN2000.BAS. It is recommended to copy the WIN2000.BAS file into the directory C:\VB (the file WIN2000.DLL should also be in this directory). Once the file is selected, click OK and the file will be added to the Project. The project window (Window, Project) can be chosen to verify that this file has been added. This is all that needs to be done with the WIN2000.BAS file. No modifications to this file are necessary from this point on. The file should never be modified for any reason.

The final step is to write the code. An example of this would be to create a Command Button. the code in the form would be:

Object: Command1Procedure: Click.

Sub Command1_Click () Dim a As Integer

a = INITIALIZE(&H300, 1) a = INDEX(&H300, 1, 400)

a= GO_CW (&H300, 1)

End Sub

When the Command Button is Clicked, the Motor will index 400 steps. All the other commands can be used in this same manner.

.

20

Image 23
Contents CLCI2000 Series Trademarks Limited WarrantyCopyright DisclaimerTable of Contents Packing Information Main FeaturesDescription General DescriptionDPI65202 CLCI2004Ordering Information DPI65201AA2M37 AA37MFC-10AA37MMC-6 AA37MMC-10Specifications Address Settings InstallationInstalling the Board Wiring to the CLCI2000Quickstart with Quickbasic +5VDC Connector DescriptionsClock Signals Hard Limit Direction SignalsSoft Limit Home LimitOutputs Encoder InputsInputs Speed Considerations Programming with Anaheim Automation LibrariesProgramming with Quickbasic or Visualbasic for DOS Index ADR, Axis GO.CW ADR, AxisCLCISUB1.BAS Library ORIGIN.INDEX.CCW ADDRESS, AXIS# ONE.AT.MAX.CCW ADDRESS, AXIS#ONE.AT.MAX.CW ADDRESS, AXIS# RAMP.TO.STOP.CCW ADDRESS, AXIS# ORIGIN.INDEX.CW ADDRESS, AXIS#RAMP.TO.BASE.CCW ADDRESS, AXIS# RAMP.TO.BASE.CW ADDRESS, AXIS#SLEW.AT.BASE.CW ADDRESS, AXIS# SLEW.AT.BASE.CCW ADDRESS, AXIS#Index ADDR,AXIS,5000 Sample #1 Program SAMPLE1.BAS on the CLCI2000 DiskInitialize ADDR,AXIS TOP.OF.LOOP If GET.INPUTADDR,1 = 1 thenLIMIT.CONTROL ADDR, AXIS, 0, 0 Sample #2 Program SAMPLE2.BAS on the CLCI2000 DiskInitialize ADDR, Axis HOME.TYPE.1CLCISUBS.CPP Program Function Definitions Originindexcw ADDRESS, Axis Oneatmaxccw ADDRESS, AxisOneatmaxcw ADDRESS, Axis Originindexccw ADDRESS, AxisSoftinputcw ADDRESS, Axis Slewatbaseccw ADDRESS, AxisSlewatbasecw ADDRESS, Axis Softinputccw ADDRESS, AxisProgramming in Windows Using the CLCI2000 Indexer with WindowsUsing the DLL with Visual Basic for Windows Object Command1Procedure ClickAnaheim Automation DLL Library Support WIN2000.BAS Program ListingFunction Window CLCI2004 Program GeneratorRunning the Software F5 Save F1 InsertF3 Delete F4- TerminalF4 Printing a Program F1 Prog StopF2 Single Step F3 Clear ProgramCommand Window Direction + or CLCI2004 Program Generator Command DictionaryCommand Summary Command DictionaryGO Index no value Encoder Resolution any numberEncoder Window any integer Finish Move no valueJump to Line 1 to UNITS/SCALE any number Ramp Setting Register # Bits Setting Range DescriptionBase Setting not in HZ MAX Setting not in HZCommand Buffer Register Description of Command List of Equations Initial Setup CommandsInput and Output Control Commands Acceleration = MAX Speed Base Speed / TUP Page