Appendix B
Ethernet API Reference
Overview
NetScan software provides an ethernet API that allows users to write programs. Support consists of two files,
NPCI_WIN.DLL for 16-bit windows developers, and NPCI_W3V.DLL for 32-bit windows developers. The only
system requirement is that the Windows TCP/IP protocol be loaded and configured.
With a mechanism called session handles, the API can simultaneously handle multiple NetScan units. All functions
rely on the session handle to keep track of the NetScan device selected for communication.
A typical session with a NetScan consists of the following basic parts:
•
Initialization - Initialization requires several functions to be called in appropriate order. These functions
include:
nSWInit
,
nSessionBegin
,
nIOLock
and
nSERIALConfigure
.
•
Actual communications (during the session) - Communication functions include
nSerialReceive
and
nSerialSend
.
•
De-initialization – De-initialization is for ending a session, and uses the functions:
NSessionEnd
and
NSWDeinit
.
Detailed descriptions of each function are covered in the following section. Examples programs are also included on
the distribution disk.
Functions
nSWInit
Function: int nSwInit(void);
Parameters: None
Returns: 0 if successful, error code if not.
Description: This function is used to allocate system resources prior to beginning a session. This function must be
called before any others.
Example:
ErrVal = nSWInit ();
nSessionBegin
Function: int nSessionBegin (short adapter, char FAR *local, char FAR *remote,
unsigned long flags, unsigned long reserved, long FAR *session);
Parameters:
Short
adapter
Always a 0.
Char FAR *
local
Always a null string.
Char FAR * remote
A null terminated string, which contains the IP address of the NetScan
device.
Unsigned long
flags
Always zero
Unsigned long
reserved
Always zero
Long FAR *
session
A variable used to receive the session handle.
Returns: 0 if successful, error code if not.
Description: This function is used to establish a session with a specific NetScan device. If a successful connection
is made, then a session handle is assigned and placed in the session argument. Since each session is unique, it is
possible to have multiple sessions active at any given time.
Example:
ErrVal = nSessionBegin(0,”\0”,”192.0.0.1\0”,0,0.session);
Summary of Contents for OMB-NETSCAN 1500
Page 6: ...iv NetScan User s Manual...
Page 18: ...1 12 Configuring and Starting NetScan NetScan User s Manual Notes...
Page 38: ...3 8 General Information and Specifications NetScan User s Manual Notes...
Page 82: ...4 44 ChartView Software Reference NetScan User s Manual Notes...
Page 118: ...6 20 Calibration NetScan User s Manual...
Page 140: ...A ii NetScan User s Manual...
Page 192: ...API Command Reference Appendix A A 52 NetScan User s Manual Notes...
Page 237: ...Appendix D Registers Data Formats Queries NetScan User s Manual D 13...
Page 244: ...NetScan Program Examples Appendix E E 2 NetScan User s Manual...
Page 248: ...ASCII Code Summary Appendix F F 4 NetScan User s Manual Notes...
Page 250: ...NetScan Error Messages Appendix G G 2 NetScan User s Manual Notes...
Page 252: ...Abbreviations Appendix H H 2 NetScan User s Manual Notes...
Page 254: ...NetScan User s Manual...