Pacific Scientific

Applications Department


95comm32 Arcnet/Serial Port DLL

Introduction

This file describes how to install and use the Pacific Scientific "95comm32.dll" library - a 32-bit dynamic link library for use with Windows 95 and Windows NT. 95COMM32 provides both multiple-port serial communications and high-speed Arcnet communications for multi-threaded applications. 95COMM32 communicates with Pacific Scientific 950 and 750 controllers.

Arcnet Driver Installation

Installing on NT Systems
  1. From the console, copy the file `winrt.sys' from the installation disk to your system driver directory (usually c:\winnt\system32\drivers\).
  2. Determine the hexadecimal port address of your arcnet card (e.g., 2e0).
  3. From the console, execute the program `arcnetnt xxx', replacing `xxx' with the hexadecimal address determined in step 2 above (for example, "arcnet 2e0"). This will create the necessary entries in the NT registry. You only need to do this once, at installation time. The driver will automatically be loaded on demand from this point on.

NOTE - YOU WILL NEED TO REBOOT YOUR SYSTEM FOR THIS TO TAKE EFFECT.

Installing on 95 Systems
  1. From the console, copy the file `wrtdev0.vxd' from the installation disk to your \windows\system\iosubys\ directory.
  2. Determine the hexadecimal port address of your arcnet card (e.g., 2e0).
  3. From the console, execute the program `arcnet95 xxx', replacing `xxx' with the hexadecimal address determined in step 2 above (for example, "arcnet95 2e0"). This will create the necessary entries in the Windows 95 registry. You only need to do this once, at installation time. The driver will automatically be loaded on demand from this point on.

NOTE - YOU WILL NEED TO REBOOT YOUR SYSTEM FOR THIS TO TAKE EFFECT.

95comm32 Installation

Copy the file `95comm32.dll' from the installation disk to your system path. You should now be able to use the entry points documented in the files `95comm32.bas' (for use with Visual Basic) and `comm9532.pas' (for use with Delphi). The installation disk contains a Visual Basic demonstration program, "demo1.exe", that illustrates the usage of 95COMM32. In order for the demo program to run correctly, you must use the IDE to compile and download the 950 program `demo1.bas' into your 950 controller.

The file `95comm32.lib' provides the DLL linkage information you will need if you intend to use 95comm32 with applications written in C or C++.

95comm32 and Multi-Tasking

All of the entry points provided by 95COMM32 are `thread-safe'. That means that you can have several processes (Windows programs) running at the same time, each making calls to 95COMM32. The DLL will make sure that each process's access to the Arcnet card (or the serial port) is synchronized so that messages are not garbled. This also works for multi-threaded processes - the DLL automatically keeps track of which port each thread is using

95comm32 and Symbols

95COMM32 provides `symbolic' access to both predefined and user-defined global variables. That means that you no longer need to use an integer constant (plus an optional type flag) to specify a 950 variable - you can use the name of the variable directly, as in "GetVar(axis, "runspeed",myrunspeed)", which will read the value of the predefined variable `runspeed' from the given axis, and place it in the VisualBasic variable `myrunspeed'. By using names like this, you also have access to all global user-defined variables, including constants and strings. The Visual Basic demonstration program, `demo1.vbf', shows several ways to exploit this feature.

In order to access variables by name, you must associate the axis with a symbol table. You can do this by using the `Associate' entry point, which tells 95COMM32 which binary file (the output of the 950 compiler) was downloaded on a given axis. You can associate a different symbol table with each axis, or you can use the same symbol table for two axes by associating each of them with the same symbol table.

The Visual Basic demo program `demo1.vbf' shows how to use the `Associate' entry point. It assumes that the 950 program `demo1.bin' has been downloaded to the target controller, and tells 95COMM32 to use that symbol table for axis `myaxis' with the statement `Associate(myaxis,binfile)', where `binfile' is a string containing the fully qualified pathname of the file `demo1.bin'.

Using 95comm32 with Visual Basic

The installation disk contains three files that define the Visual Basic interface to 95COMM32:

  1. 95comm32.bas - a module that gives the external declarations, and describes the syntax and semantics of each entry point.
  2. Pacsci.bas - a module that gives the constant definitions used to read and write variables by passing pre-defined integer constants to specify them.
  3. Pacsci.err - a module that gives the constant definitions of return values.

To use 95COMM32 in your Visual Basic application, just add these three modules to your project.

SPECIAL NOTES:

  1. YOU CANNOT USE 95COMM32 TO COMMUNICATE WHILE THE OC950 IDE (INTEGRATED DEVELOPMENT ENVIRONMENT) PROGRAM IS RUNNING. THE OC950 IDE AND 95COMM32 ARE NOT COMPATIBLE.
  2. THE DLL ALSO PROVIDES SOME USEFUL ENTRY POINTS FOR PACIFIC SCIENTIFIC 750 CONTROLLERS. THESE ADDITIONAL ENTRY POINTS CAN ONLY BE USED WITH THE ARCNET CARD, AND WILL NOT WORK OVER THE SERIAL PORT.
  3. THE DLL IS IN `ARCNET' MODE BY DEFAULT. IF YOU WANT TO USE THE SERIAL PORT, YOU SHOULD USE THE `INITCOMPORT' AND `USE_COMPORT' ENTRY POINTS. SEE THE DEMO1 PROGRAM FOR DETAILS.
  4. IF YOU ARE RUNNING MULTI-THREADED APPLICATIONS, EACH THREAD THAT MAPS THE DLL ALSO STARTS OUT IN `ARCNET' MODE. IF YOU WANT A NEW THREAD TO USE A COMPORT, THAT THREAD MUST USE THE `INITCOMPORT' AND `USE_COMPORT' ENTRY POINTS.

Pacific Scientific
110 Fordham Rd.
Wilmington, MA 01887
(978) 988-9800 voice
(978) 988-9940 fax

PacSci Home Page
Last updated: 20 November 1998
PS/trc