AIM104-Software Library
Total Page:16
File Type:pdf, Size:1020Kb
2192-09193-000-000 AIM104-Software Library Software A Utility Disk is supplied with your AIM104. It contains a host of software utilities designed specifically for each AIM104. Please refer to the README.TXT file on the disk for further information. It also includes a test program EXAMP-01.EXE which may be used to confirm access to the board. Introduction Arcom Control Systems produces a complete range of high quality Input/Output (I/O) cards for the PC104 bus. In order to support these I/O cards as fully as possible a complimentary set of high quality software support products is also available. This software library forms part of the software support. This software support has been developed to support Borland C++ versions 3.1 and 4.52, running on 386 CPUs, Pentium CPUs and Arcom Target boards, in both DOS and Windows operating systems. It is presented to the user in the form of standard static library files. This library can then be incorporated into custom application code giving the user all the software facilities needed to use all the hardware features included on an Arcom PC104 I/O card. This manual contains the basic details of what is contained within this library. For a more detailed description please read the Word 2.0 file genman.doc contained in the DOCS sub-directory of the installation disk or in the DOCS sub-directory of the directory you install to. The list below shows the boards supported within the scope of this library. All commonly used modules are listed, however those that fall outside this list are not supported within this software library. If you have a module which is different from the ones listed below please refer to your hardware manual and contact Arcom for software advice. Module Function AIM104-IO32 Digital I/O AIM104-IN16 Digital Input - optoisolated AIM104-OUT16 Digital Output - optoisolated AIM104-IN8 Digital Input - optoisolated AIM104-RELAY8/IN8 Digital Output - optoisolated AIM104-SER4 Serial Communications AIM104-ADC16\IN8 Analogue Input AIM104-DAC2\IN8 Analogue Output AIM104-RTC Real Time Clock AIM104-MULTI-IO Analogue I/O Digital Input - optoisolated To contact Arcom technical support you can use one of the following methods: Telephone: UK 01223 412 428 International +44 1223 412 428 Fax: 01223 410 457 E-mail: [email protected] Bulletin Board: 01223 415 146 Page 1 CONTROL SYSTEMS 2192-09193-000-000 AIM104-Software Library Installation System Requirements Hardware: To make use of your Arcom software library you will need the following hardware at your disposal :- Either: A PC AT compatible, 386sx 25Mhz or better, 1 Mbyte DRAM (4 Mbytes recommended), and 180 Kbytes free hard disk space for software installation. Note that your particular compiler may well need a higher specification PC than the library does to run satisfactorily. See your compiler documentation for details. An ISA to PC/104 bus adaptor card if there is no PC/104 site on the motherboard. One or more Arcom I/O cards fitted into the adaptor card PC/104 slots. See your hardware manual installation section for details and remember that the base address settings of each I/O card must be unique. Or: An Arcom Target Board (386EX or 188EB). One or more Arcom I/O cards fitted into the PC/104 bus expansion slot on the Target board. See your hardware manual installation section for details and remember that the base address settings of each I/O card must be unique. Software: The software environment you will need is as follows :- MS-DOS ver. 5.0 or later BoralndC version 3.1 or 4.52. This library has been tested with several earlier versions of this compiler without any problems. If you have an earlier version it is worth trying it before upgrading. If you are buying a new compiler you will be shipped the latest version. SourceView for your Arcom Target Board Software Installation DOS: Place the distribution disquette in the A: drive and type INSTALL You will be presented with a menu as shown below: Please enter your target type: 1. PC 2. Target 188EB 3. Target 386EX [1, 2, 3]? Enter the number corresponding to your target type. Next you will be asked to state which version of Borland C++ you are using: Please enter your Borland C++ Version: 1. Borland C++3.1 2. Borland C++4.52 [1, 2,]? Your replies will determine which object files and libraries are installed on the hard disk in the C:\ARCOM directory. If you already have a directory of this name on your hard disk the commented Page 2 CONTROL SYSTEMS AIM104-Software Library 2192-09193-000-000 batch file AIMINST.BAT in the root directory of the installation disk may be altered to specify another destination. What's on the Disk? The setup program installs the following files:- The Examples Directory (EXAMPLES) should contain :- EXAMP-xx.C Example files (see examples section) MAKEFILE Makefile for building examples tttEXm.RSP Response file used by TLINK For Borland C++ 4.52 Users:- tttEX-xx.IDE Project files for Borland integrated tttEX-xx.DSW development environment For Borland C++ 3.1 Users:- tttEX-xx.PRJ Project files for Borland integrated tttEX-xx.DSK development environment The include files directory (INCLUDE) should contain:- ARCOM.H Arcom function prototypes definitions GLOBALS.H Board definitions The documentation directory (DOCS) should contain :- GENMAN.DOC A more comprehensive manual as a Word 2.0 file GENHELP.HLP On-line help file The object files and libraries directory (LIB) should contain:- ARCOMBm.LIB Arcom AIM-104 software support library For Arcom Target Board Users:- COm.OBJ Target board initialisation object code SERttt.OBJ SVIF communications object code Page 3 CONTROL SYSTEMS 2192-09193-000-000 AIM104-Software Library Command Line Fast Start Procedure Having installed your software you now want to check that both it and the hardware are working. The following is a description of how to get started quickly. If you encounter any problems or need more detail please refer to the manual genman.doc which is included in the DOCS sub-directory of the installation. Step 1: Switch off your PC/Target Board. Install your I/O card. Remember anti-static handling precautions and write down your base-address setting now! Leave off the cover so you can see the module access LED work. Step 2: Load up the LED flashing example, EXAMP-01.C into your text editor. Check the base address setting in the source code against the hardware setting, you may need to change the base address according to the module you are using. Step 3: Go to the c:\arcom\examples directory and use the makefile to build the examples. For Borland C++ type:- make -DMODEL=s To use a memory model other than small substitute S for M or L for medium or large models respectively. For PC: Step 4A: Run the executable file EXAMP-01 - the red module access LED should flash! OR For Target Board (188EB, 386EX): Step 4B: To run the example on an Arcom Target Board type:- TLOAD -g EXAMP-01 to download through COM port 1 OR TLOAD -2 -g EXAMP-01 to download through COM port 2 Step 5: Power down your PC/Target Board and replace the cover. Page 4 CONTROL SYSTEMS AIM104-Software Library 2192-09193-000-000 Borland C++ Integrated Development Environment Each of the example programs provided has an associated integrated development environment (I.D.E) project file. For instructions on how to load and edit project files please refer to your compiler manual. Using Borland C++ V4.52 I.D.E. Step 1: Having connected your target board (if applicable) and installed AIM-104 I/O boards, load up Borland C++ V4.52 from within Windows. Step 2: Select Projectñ Open from the menu bar at the top of the screen. Step 3: Load in C:\ARCOM\EXAMPLES\tttEX-xx.IDE (or equivalent path) Step 4: To generate an executable file select Projectñ Build from the menu. This will compile and link the example program, displaying a SUCCESS message upon completion. Step 5: To run the example program: On a PC compatible select Debugñ Run from the menu bar. On a Target386EX or Target188EB, select Toolsñ Turbo Debug Remote (COMp). This will start Turbo Debug in a separate MS-DOS window. Using Borland C++ V3.1 I.D.E. Step 1: Having connected your target board (if applicable) and installed AIM-104 I/O boards, load up Borland C++ V3.1 from the MS-DOS command line (C:\BORLANDC\BIN\BC). Step 2: Select Projectñ Open from the menu bar at the top of the screen. Step 3: Load in C:\ARCOM\EXAMPLES\tttEX-xx.PRJ (or equivalent path) Step 4: To generate an executable file select Compileñ Build All from the menu. This will compile and link the example program, displaying a SUCCESS message upon completion. Step 5: To run the example program: On a PC compatible select Debugñ Run from the menu bar. On a Target386EX or Target188EB, select -ñ TVER (COMp) to set the correct remote version. Next select -ñ Turbo Debugger Remote (COMp). This will start Turbo Debug in a separate MS-DOS window. NB. If modifying source code in the I.D.E. it is not automatically saved before running Turbo Debug. This can lead to an old version of the source code being displayed in the Turbo Debug source module window. To avoid this occurrence, always save any modified source before running Turbo Debug. Page 5 CONTROL SYSTEMS 2192-09193-000-000 AIM104-Software Library Library Functions To make use of the library functions, you need to link in to your program the correct library for the memory model and compiler you are using.