ProSoft Technology MVI69-ADMNET User Manual

MVI-ADMNET
'C' Programmable Application Development Module with Ethernet
February 20, 2013
DEVELOPER'S GUIDE
Your Feedback Please
We always want you to feel that you made the right decision to use our products. If you have suggestions, comments, compliments or complaints about our products, documentation, or support, please write or call us.
ProSoft Technology 5201 Truxtun Ave., 3rd Floor Bakersfield, CA 93309 +1 (661) 716-5100 +1 (661) 716-5101 (Fax) www.prosoft-technology.com support@prosoft-technology.com
Copyright © 2013 ProSoft Technology, Inc., all rights reserved.
MVI-ADMNET Developer's Guide
February 20, 2013
ProSoft Technology ®, ProLinx ®, inRAx ®, ProTalk ®, and RadioLinx ® are Registered Trademarks of ProSoft Technology, Inc. All other brand or product names are or may be trademarks of, and are used to identify products and services of, their respective owners.
In an effort to conserve paper, ProSoft Technology no longer includes printed manuals with our product shipments. User Manuals, Datasheets, Sample Ladder Files, and Configuration Files are provided on the enclosed CD-ROM, and are available at no charge from our web site: www.prosoft-technology.com.
Content Disclaimer
This documentation is not intended as a substitute for and is not to be used for determining suitability or reliability of these products for specific user applications. It is the duty of any such user or integrator to perform the appropriate and complete risk analysis, evaluation and testing of the products with respect to the relevant specific application or use thereof. Neither ProSoft Technology nor any of its affiliates or subsidiaries shall be responsible or liable for misuse of the information contained herein. Information in this document including illustrations, specifications and dimensions may contain technical inaccuracies or typographical errors. ProSoft Technology makes no warranty or representation as to its accuracy and assumes no liability for and reserves the right to correct such inaccuracies or errors at any time without notice. If you have any suggestions for improvements or amendments or have found errors in this publication, please notify us.
No part of this document may be reproduced in any form or by any means, electronic or mechanical, including photocopying, without express written permission of ProSoft Technology. All pertinent state, regional, and local safety regulations must be observed when installing and using this product. For reasons of safety and to help ensure compliance with documented system data, only the manufacturer should perform repairs to components. When devices are used for applications with technical safety requirements, the relevant instructions must be followed. Failure to use ProSoft Technology software or approved software with our hardware products may result in injury, harm, or improper operating results. Failure to observe this information can result in injury or equipment damage.
© 2013 ProSoft Technology. All rights reserved.
Printed documentation is available for purchase. Contact ProSoft Technology for pricing and availability. North America: +1.661.716.5100 Asia Pacific: +603.7724.2080 Europe, Middle East, Africa: +33 (0) 5.3436.87.20
Latin America: +1.281.298.9109
Important Installation Instructions
Power, Input, and Output (I/O) wiring must be in accordance with Class I, Division 2 wiring methods, Article 501-4 (b) of the National Electrical Code, NFPA 70 for installation in the U.S., or as specified in Section 18-1J2 of the Canadian Electrical Code for installations in Canada, and in accordance with the authority having jurisdiction. The following warnings must be heeded:
A WARNING - EXPLOSION HAZARD - SUBSTITUTION OF COMPONENTS MAY IMPAIR SUITABILITY FOR
CLASS I, DIV. 2;
B WARNING - EXPLOSION HAZARD - WHEN IN HAZARDOUS LOCATIONS, TURN OFF POWER BEFORE
REPLACING OR WIRING MODULES
C WARNING - EXPLOSION HAZARD - DO NOT DISCONNECT EQUIPMENT UNLESS POWER HAS BEEN
SWITCHED OFF OR THE AREA IS KNOWN TO BE NON-HAZARDOUS.
D THIS DEVICE SHALL BE POWERED BY CLASS 2 OUTPUTS ONLY.
MVI (Multi Vendor Interface) Modules
WARNING - EXPLOSION HAZARD - DO NOT DISCONNECT EQUIPMENT UNLESS POWER HAS BEEN SWITCHED OFF OR THE AREA IS KNOWN TO BE NON-HAZARDOUS.
AVERTISSEMENT - RISQUE D'EXPLOSION - AVANT DE DÉCONNECTER L'ÉQUIPEMENT, COUPER LE COURANT OU S'ASSURER QUE L'EMPLACEMENT EST DÉSIGNÉ NON DANGEREUX.
Warnings
North America Warnings
A Warning - Explosion Hazard - Substitution of components may impair suitability for Class I, Division 2. B Warning - Explosion Hazard - When in Hazardous Locations, turn off power before replacing or rewiring
modules. Warning - Explosion Hazard - Do not disconnect equipment unless power has been switched off or the area is known to be nonhazardous.
C Suitable for use in Class I, division 2 Groups A, B, C and D Hazardous Locations or Non-Hazardous Locations.
ATEX Warnings and Conditions of Safe Usage:
Power, Input, and Output (I/O) wiring must be in accordance with the authority having jurisdiction
A Warning - Explosion Hazard - When in hazardous locations, turn off power before replacing or wiring modules. B Warning - Explosion Hazard - Do not disconnect equipment unless power has been switched off or the area is
known to be non-hazardous.
C These products are intended to be mounted in an IP54 enclosure. The devices shall provide external means to
prevent the rated voltage being exceeded by transient disturbances of more than 40%. This device must be used only with ATEX certified backplanes.
D DO NOT OPEN WHEN ENERGIZED.
Electrical Ratings
Backplane Current Load: 800 mA @ 5 V DC; 3mA @ 24V DC  Operating Temperature: 0 to 60°C (32 to 140°F)  Storage Temperature: -40 to 85°C (-40 to 185°F)  Shock: 30g Operational; 50g non-operational; Vibration: 5 g from 10 to 150 Hz  Relative Humidity 5% to 95% (non-condensing)  All phase conductor sizes must be at least 1.3 mm(squared) and all earth ground conductors must be at least
4mm(squared).
CE
EMC-EN61326-1:2006; EN6100-6-4:2007
CSA/cUL
C22.2 No. 213-1987
CSA CB Certified
IEC61010
ATEX
EN60079-0 Category 3, Zone 2 EN60079-15
243333
ME06
ANSI / ISA
ISA 12.12.01 Class I Division 2, GPs A, B, C, D
CSA/cUL
C22.2 No. 213-1987
CSA CB Certified
IEC61010
ATEX
EN60079-0 Category 3, Zone 2 EN60079-15
243333
Markings - MVI56, MVI69, PTQ
Markings - MVI46, MVI71
Warning: This module is not hot-swappable! Always remove power from the rack before inserting or removing this
module, or damage may result to the module, the processor, or other connected devices.
Battery Life Advisory
The MVI46, MVI56, MVI56E, MVI69, and MVI71 modules use a rechargeable Lithium Vanadium Pentoxide battery to backup the real-time clock and CMOS. The battery should last for the life of the module. The module must be powered for approximately twenty hours before the battery becomes fully charged. After it is fully charged, the battery provides backup power for the CMOS setup and the real-time clock for approximately 21 days. When the battery is fully discharged, the module will revert to the default BIOS and clock settings.
Note: The battery is not user replaceable.
MVI-ADMNET 'C' Programmable Contents 'C' Programmable Application Development Module with Ethernet Developer's Guide
Contents
Your Feedback Please ........................................................................................................................ 2
Content Disclaimer .............................................................................................................................. 2
Important Installation Instructions ....................................................................................................... 3
MVI (Multi Vendor Interface) Modules ................................................................................................ 3
Warnings ............................................................................................................................................. 3
Battery Life Advisory ........................................................................................................................... 4
1 Introduction 9
1.1 Operating System .................................................................................................... 10
2 Preparing the MVI-ADMNET Module 11
2.1 Package Contents ................................................................................................... 12
2.2 Jumper Locations and Settings ............................................................................... 13
2.2.1 Setup Jumper .......................................................................................................... 13
2.2.2 Port 1 and Port 2 Jumpers ...................................................................................... 13
2.3 Connections ............................................................................................................ 14
2.3.1 MVI-ADMNET Communication Ports ...................................................................... 14
3 Setting Up Your Development Environment 15
3.1 Setting Up Your Compiler........................................................................................ 16
3.1.1 Configuring Digital Mars C++ 8.49 .......................................................................... 16
3.1.2 Configuring Borland C++5.02 .................................................................................. 25
3.2 ROM Disk Configuration.......................................................................................... 33
3.2.1 CONFIG.SYS File ................................................................................................... 33
3.2.2 Command Interpreter .............................................................................................. 35
3.2.3 Sample ROM Disk Image ........................................................................................ 35
3.3 Creating a ROM Disk Image ................................................................................... 37
3.3.1 WINIMAGE: Windows Disk Image Builder .............................................................. 37
3.4 Downloading a ROM Disk Image ............................................................................ 39
3.4.1 MVIUPDAT .............................................................................................................. 39
3.5 MVI System BIOS Setup ......................................................................................... 41
3.6 Transferring Files to and from the Module with HyperTerminal .............................. 43
3.6.1 Required Software ................................................................................................... 43
3.6.2 Connecting to the Module ....................................................................................... 44
3.6.3 Enabling the Console .............................................................................................. 45
3.6.4 Installing RY.exe and SY.exe .................................................................................. 49
3.6.5 Downloading Files From a PC to the ADM Module ................................................ 49
3.6.6 Uploading files from the ADM module to a PC........................................................ 50
3.7 Installing and Configuring the Module ..................................................................... 52
3.7.1 Using Side-Connect (Requires Side-Connect Adapter) (MVI71) ............................ 52
4 Understanding the MVI-ADMNET API 55
4.1 API Libraries ............................................................................................................ 56
4.1.1 Calling Convention .................................................................................................. 56
ProSoft Technology, Inc. Page 5 of 122 February 20, 2013
Contents MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
4.1.2 Header File ............................................................................................................. 56
4.1.3 Sample Code .......................................................................................................... 56
4.1.4 Multi-threading Considerations ............................................................................... 57
4.2 Development Tools ................................................................................................. 58
4.3 Theory of Operation ................................................................................................ 59
4.3.1 ADM API ................................................................................................................. 59
4.3.2 ADMNET API Architecture ...................................................................................... 59
4.4 ADM API Files......................................................................................................... 60
4.4.1 ADM Interface Structure ......................................................................................... 60
5 Application Development Function Library - ADMNET API 63
5.1 ADMNET API Functions ......................................................................................... 64
5.2 ADMNET API Initialize Functions ........................................................................... 65
ADM_init_socket ......................................................................................................................... 65
ADM_open_sk ............................................................................................................................. 66
ADM_init_UDP_buffer ................................................................................................................. 67
5.3 ADMNET API Release Socket Functions ............................................................... 68
ADM_release_sockets ................................................................................................................ 68
ADM_close_sk ............................................................................................................................ 69
5.4 ADMNET API Send Socket Functions .................................................................... 70
ADM_send_socket ...................................................................................................................... 70
ADM_send_sk ............................................................................................................................. 71
5.5 ADMNET API Receive Socket Functions ............................................................... 72
ADM_receive_socket .................................................................................................................. 72
ADM_receive_sk ......................................................................................................................... 73
ADM_receive_buffered_UDP_sk ................................................................................................ 74
5.6 ADMNET API Miscellaneous Functions ................................................................. 75
ADM_NET_GetVersionInfo ......................................................................................................... 75
ADM_is_sk_open ........................................................................................................................ 76
6 WATTCP API Functions 77
6.1 WATTCP API Functions ......................................................................................... 78
6.2 ADMNET API Initialize Functions ........................................................................... 80
sock_init ....................................................................................................................................... 80
6.3 ADMNET API System Functionality ....................................................................... 81
tcp_tick ........................................................................................................................................ 81
tcp_open ...................................................................................................................................... 82
tcp_open_fast .............................................................................................................................. 83
udp_open..................................................................................................................................... 84
udp_open_fast ............................................................................................................................. 85
resolve ......................................................................................................................................... 86
sock_mode .................................................................................................................................. 87
sock_established ......................................................................................................................... 88
ip_timer_init ................................................................................................................................. 89
ip_timer_expired .......................................................................................................................... 90
set_timeout .................................................................................................................................. 91
chk_timeout ................................................................................................................................. 92
sockerr ......................................................................................................................................... 93
sockstate ..................................................................................................................................... 94
gethostid ...................................................................................................................................... 95
6.4 ADMNET API Release Socket Functions ............................................................... 96
Page 6 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Contents 'C' Programmable Application Development Module with Ethernet Developer's Guide
sock_exit ...................................................................................................................................... 96
sock_abort ................................................................................................................................... 97
sock_close ................................................................................................................................... 98
6.5 ADMNET API Send Socket Functions .................................................................... 99
sock_write .................................................................................................................................... 99
sock_fastwrite ............................................................................................................................ 100
sock_flush .................................................................................................................................. 101
sock_flushnext ........................................................................................................................... 102
sock_puts ................................................................................................................................... 103
sock_putc ................................................................................................................................... 104
6.6 ADMNET API Receive Socket Functions .............................................................. 105
sock_read .................................................................................................................................. 105
sock_fastread ............................................................................................................................. 106
tcp_listen .................................................................................................................................... 107
sock_gets ................................................................................................................................... 108
sock_getc ................................................................................................................................... 109
sock_dataready .......................................................................................................................... 110
rip ............................................................................................................................................... 111
inet_ntoa .................................................................................................................................... 112
inet_addr .................................................................................................................................... 113
7 Support, Service & Warranty 115
7.1 Contacting Technical Support ............................................................................... 115
7.2 Warranty Information ............................................................................................. 116
Glossary of Terms 117
Index 121
ProSoft Technology, Inc. Page 7 of 122 February 20, 2013
Contents MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
Page 8 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Introduction
In This Chapter
Operating System .................................................................................. 10
'C' Programmable Application Development Module with Ethernet Developer's Guide
1 Introduction
This document provides information needed to develop application programs for the MVI ADM Ethernet Serial Communication Module. The MVI suite of modules is designed to allow devices with a serial and Ethernet port to be accessed by a PLC. The modules and their corresponding platforms are as follows:
MVI46: 1746 (SLC) MVI56: 1756 (ControlLogix) MVI69: 1769 (CompactLogix) MVI71: 1771 (PLC)
The modules are programmable to accommodate devices with unique Serial­Ethernet protocols.
This document includes information about the available ethernet communication software API libraries, programming information, and example code. For tools, module configuration, serial communication software API, serial communication programming information, and example code for both the module and the PLC, refer to MVI ADM Developer’s Guide.
This document assumes the reader is familiar with software development in the 16-bit DOS environment using the 'C' programming language. This document also assumes that the reader is familiar with Rockwell Automation programmable controllers and the PLC platform.
ProSoft Technology, Inc. Page 9 of 122 February 20, 2013
Introduction MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
1.1 Operating System
The MVI module includes General Software Embedded DOS 6-XL. This operating system provides DOS compatibility along with real-time multitasking functionality. The operating system is stored in Flash ROM and is loaded by the BIOS when the module boots.
DOS compatibility allows user applications to be developed using standard DOS tools, such as Digital Mars and Borland compilers. User programs may be executed automatically by loading them from either the CONFIG.SYS file or an AUTOEXEC.BAT file. In addition to MVI-ADMNET, ADMTCP.CFG is required to assign an IP address to the module. Users can store the ADMTCP.CFG file directly to a Compact Flash.
The format of the ADMTCP.CFG is as follows:
# ProSoft Technology # Default private class 3 address my_ip=192.168.0.148 # Default class 3 network mask netmask=255.255.255.0 # name server 1 up to 9 may be included # nameserver=xxx.xxx.xxx.xxx # name server 2 # nameserver=xxx.xxx.xxx.xxx # The gateway I wish to use gateway=192.168.0.1 # some networks (class 2) require all three parameters # gateway,network,subnetmask # gateway 192.168.0.1,192.168.0.0,255.255.255.0 # The name of my network # domainslist="mynetwork.name"
Note: DOS programs that try to access the video or keyboard hardware directly will not function correctly on the MVI module. Only programs that use the standard DOS and BIOS functions to perform console I/O are compatible.
Page 10 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Preparing the MVI-ADMNET Module
In This Chapter
Package Contents ................................................................................. 12
Jumper Locations and Settings ............................................................. 13
Connections .......................................................................................... 14
'C' Programmable Application Development Module with Ethernet Developer's Guide
2 Preparing the MVI-ADMNET Module
ProSoft Technology, Inc. Page 11 of 122 February 20, 2013
Preparing the MVI-ADMNET Module MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
2.1 Package Contents
Your MVI-ADMNET package includes:
MVI-ADMNET Module ProSoft Technology Solutions CD-ROM (includes all documentation, sample
code, and sample ladder logic).
Null Modem Cable Mini-DIN to DB-9 Cable
Page 12 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Preparing the MVI-ADMNET Module 'C' Programmable Application Development Module with Ethernet Developer's Guide
2.2 Jumper Locations and Settings
Each module has three jumpers:
Setup Port 1 Port 2
2.2.1 Setup Jumper
The Setup jumper, located at the bottom of the module, should have the two pins jumpered when programming the module. Once programmed, the jumper should be removed.
2.2.2 Port 1 and Port 2 Jumpers
These jumpers, located at the bottom of the module, configure the port settings to RS-232, RS-422, or RS-485. By default, the jumpers for both ports are set to RS-232. These jumpers must be set properly before using the module.
ProSoft Technology, Inc. Page 13 of 122 February 20, 2013
Preparing the MVI-ADMNET Module MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
2.3 Connections
2.3.1 MVI-ADMNET Communication Ports
The MVI-ADMNET module has three physical connectors: two application ports and one debugging port, with an RJ45 plug and Ethernet port located on the front of the module.
Page 14 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment
In This Chapter
Setting Up Your Compiler ...................................................................... 16
ROM Disk Configuration ........................................................................ 33
Creating a ROM Disk Image .................................................................. 37
Downloading a ROM Disk Image .......................................................... 39
MVI System BIOS Setup ....................................................................... 41
Transferring Files to and from the Module with HyperTerminal ............. 43
Installing and Configuring the Module ................................................... 52
'C' Programmable Application Development Module with Ethernet Developer's Guide
3 Setting Up Your Development Environment
ProSoft Technology, Inc. Page 15 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
3.1 Setting Up Your Compiler
There are some important compiler settings that must be set in order to successfully compile an application for the MVI platform. The following topics describe the setup procedures for each of the supported compilers.
3.1.1 Configuring Digital Mars C++ 8.49
The following procedure allows you to successfully build the sample ADM code supplied by ProSoft Technology using Digital Mars C++ 8.49. After verifying that the sample code can be successfully compiled and built, you can modify the sample code to work with your application.
Note: This procedure assumes that you have successfully installed Digital Mars C++ 8.49 on your workstation.
Downloading the Sample Program
The sample code files are located in the ADM_TOOL_MVI.ZIP file. This zip file is available from the CD-ROM shipped with your system or from the www.prosoft-technology.com web site. When you unzip the file, you will find the sample code files in \ADM_TOOL_MVI\SAMPLES\.
Important: The sample code and libraries in the 1756-MVI-Samples folder are not compatible with, and are not supported for, the Digital Mars compiler.
Building an Existing Digital Mars C++ 8.49 ADM Project 1 Start Digital Mars C++ 8.49, and then click Project Open from the Main
Menu.
2 From the Folders field, navigate to the folder that contains the project
(C:\ADM_TOOL_MVI\SAMPLES\…).
3 In the File Name field, click on the project name (56adm-si.prj).
Page 16 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
4 Click OK. The Project window appears:
5 Click Project Rebuild All from the Main Menu to create the .exe file. The
status of the build will appear in the Output window:
Porting Notes: The Digital Mars compiler classifies duplicate library names as Level 1 Errors rather than warnings. These errors will manifest themselves as "Previous Definition Different: function name". Level 1 errors are non-fatal and the executable will build and run. The architecture of the ADM libraries will cause two or more of these errors to appear when the executable is built. This is a normal occurrence. If you are building existing code written for a different compiler you may have to replace calls to run-time functions with the Digital Mars equivalent. Refer to the Digital Mars documentation on the Run-time Library for the functions available.
6 The executable file will be located in the directory listed in the Compiler
Output Directory field. If it is blank then the executable file will be located in the same folder as the project file. The Project Settings window can be accessed by clicking Project Settings from the Main Menu.
ProSoft Technology, Inc. Page 17 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
Creating a New Digital Mars C++ 8.49 ADM Project 1 Start Digital Mars C++ 8.49, and then click Project New from the Main
Menu.
2 Select the path and type in the Project Name. 3 Click Next.
4 In the Platform field, choose DOS. 5 In the Project Settings choose Release if you do not want debug information
included in your build.
Page 18 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
6 Click Next.
7 Select the first source file necessary for the project. 8 Click Add. 9 Repeat this step for all source files needed for the project. 10 Repeat the same procedure for all library files (.lib) needed for the project. 11 Choose Libraries (*.lib) from the List Files of Type field to view all library files:
ProSoft Technology, Inc. Page 19 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
12 Click Next.
13 Add any defines or include directories desired. 14 Click Finish. 15 The Project window should now contain all the necessary source and library
files as shown in the following window:
Page 20 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
16 Click Project Settings from the Main Menu.
17 These settings were set when the project was created. No changes are
required. The executable must be built as a DOS executable in order to run on the MVI platform.
18 Click the Directories tab and fill in directory information as required by your
project’s directory structure.
19 If the fields are left blank then it is assumed that all of the files are in the
same directory as the project file. The output files will be placed in this directory as well.
ProSoft Technology, Inc. Page 21 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
20 Click on the Build tab, and choose the Compiler selection. Confirm that the
settings match those shown in the following screen:
21 Click Code Generation from the Topics field and ensure that the options
match those shown in the following screen:
Page 22 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
22 Click Memory Models from the Topics field and ensure that the options
match those shown in the following screen:
23 Click Linker from the Topics field and ensure that the options match those
shown in the following screen:
ProSoft Technology, Inc. Page 23 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
24 Click Packing & Map File from the Topics field and ensure that the options
match those shown in the following screen:
25 Click Make from the Topics field and ensure that the options match those
shown in the following screen:
26 Click OK. 27 Click Parse Update All from the Project Window Menu. The new settings
may not take effect unless the project is updated and reparsed.
28 Click Project Build All from the Main Menu.
Page 24 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
29 When complete, the build results will appear in the Output window:
The executable file will be located in the directory listed in the Compiler Output Directory box of the Directories tab (that is, C:\ADM_TOOL_MVI\SAMPLES\…). The Project Settings window can be accessed by clicking Project Settings from the Main Menu.
Porting Notes: The Digital Mars compiler classifies duplicate library names as Level 1 Errors rather than warnings. These errors will manifest themselves as "Previous Definition Different: function name". Level 1 errors are non-fatal and the executable will build and run. The architecture of the ADM libraries will cause two or more of these errors to appear when the executable is built. This is a normal occurrence. If you are building existing code written for a different compiler you may have to replace calls to run-time functions with the Digital Mars equivalent. Refer to the Digital Mars documentation on the Run-time Library for the functions available.
3.1.2 Configuring Borland C++5.02
The following procedure allows you to successfully build the sample ADM code supplied by ProSoft Technology, using Borland C++ 5.02. After verifying that the sample code can be successfully compiled and built, you can modify the sample code to work with your application.
Note: This procedure assumes that you have successfully installed Borland C++ 5.02 on your workstation.
Downloading the Sample Program
The sample code files are located in the ADM_TOOL_MVI.ZIP file. This zip file is available from the CD-ROM shipped with your system or from the www.prosoft-technology.com web site. When you unzip the file, you will find the sample code files in \ADM_TOOL_MVI\SAMPLES\.
Important: The sample code and libraries in the 1756-MVI-Samples folder are not compatible with, and are not supported for, the Digital Mars compiler.
ProSoft Technology, Inc. Page 25 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
Building an Existing Borland C++ 5.02 ADM Project 1 Start Borland C++ 5.02, then click Project Open Project from the Main
Menu.
2 From the Directories field, navigate to the directory that contains the project
(C:\adm\sample).
3 In the File Name field, click on the project name (adm.ide). 4 Click OK. The Project window appears:
5 Click Project Build All from the Main Menu to create the .exe file. The
Building ADM window appears when complete:
6 When Success appears in the Status field, click OK.
Page 26 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
The executable file will be located in the directory listed in the Final field of the Output Directories (that is, C:\adm\sample). The Project Options window can be accessed by clicking Options Project Menu from the Main Menu.
Creating a New Borland C++ 5.02 ADM Project
1 Start Borland C++ 5.02, and then click File Project from the Main Menu.
2 Type in the Project Path and Name. The Target Name is created
automatically.
3 In the Target Type field, choose Application (.exe). 4 In the Platform field, choose DOS (Standard). 5 In the Target Model field, choose Large. 6 Ensure that Emulation is checked in the Math Support field.
ProSoft Technology, Inc. Page 27 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
7 Click OK. A Project window appears:
8 Click on the .cpp file created and press the Delete key. Click Yes to delete
the .cpp file.
9 Right click on the .exe file listed in the Project window and choose the Add
Node menu selection. The following window appears:
10 Click source file, then click Open to add source file to the project. Repeat this
step for all source files needed for the project.
11 Repeat the same procedure for all library files (.lib) needed for the project.
Page 28 of 122 ProSoft Technology, Inc. February 20, 2013
MVI-ADMNET 'C' Programmable Setting Up Your Development Environment 'C' Programmable Application Development Module with Ethernet Developer's Guide
12 Choose Libraries (*.lib) from the Files of Type field to view all library files:
13 The Project window should now contain all the necessary source and library
files as shown in the following window:
ProSoft Technology, Inc. Page 29 of 122 February 20, 2013
Setting Up Your Development Environment MVI-ADMNET 'C' Programmable Developer's Guide 'C' Programmable Application Development Module with Ethernet
14 Click Options Project from the Main Menu.
15 Click Directories from the Topics field and fill in directory information as
required by your project’s directory structure.
Page 30 of 122 ProSoft Technology, Inc. February 20, 2013
Loading...
+ 92 hidden pages