comm930.zip is a pk-zipped 32-bit Windows NT / Windows 95 DLL that provides functionality similar to that of 95comm32.dll, but for the 930 controller. This DLL allows you to read and write 930 variables (and execute commands) by name, as in
int stat = GetVar930("AInNull",&AInNull); // C, C++
stat := GetVar930('AInNull',AInNull); // Delphi 2.0 or higher
stat = GetVar930("AInNull",AInNull) // VB 5.0
The C / C++ interface is as follows:
int InitComPort930(int argPortNum);
int ExeCmd930(const char *cmd);
int GetVar930(const char *name, double *value);
int PutVar930(const char *name, double value);
int SetAxis930(int a);
The Delphi (2.0 or higher) interface is:
function InitComPort930(port : longint) : longint;
stdcall; external 'comm930';
function GetVar930(name : pchar; var value : double) : longint;
stdcall; external 'comm930';
function PutVar930(name : pchar; value : double) : longint;
stdcall; external 'comm930';
function ExeCmd930(name : pchar;) : longint;
stdcall; external 'comm930';
function SetAxis930(axis : longint) : longint;
stdcall; external 'comm930';
The VB (5.0 or higher) interface is:
Declare Function InitComPort930 Lib "comm930.dll" ( _
ByVal port As Integer) As Long
Declare Function GetVar930 Lib "comm930.dll" ( _
ByVal name As String, ByRef value As Double) As Long
Declare Function PutVar930 Lib "comm930.dll" ( _
ByVal name As String, ByVal value As Double) As Long
Declare Function ExeCmd930 Lib "comm930.dll" ( _
ByVal name As String) As Long
Declare Function SetAxis930 Lib "comm930.dll" ( _
ByVal axis As Long) As Long
(The '_' characters at the end of some of the lines above this paragraph are, to my surprise, legal VB code for breaking a statement across multiple lines. Mirabile Dictu! Did you guys know that?)
The 'int' args and return values are all 32-bit integers. The standard return value is 0 for success, or one of the following positive error codes:
#define E_NOSYMBOL 1
#define E_TYPE_ERROR 2
#define E_NO_PORT 3
#define E_NO_RESPONSE 4
#define E_NOT_AVAILABLE 5
#define E_COMM_ERROR 6
By default, each thread or process that maps the DLL starts out talking to axis 255 on com port 1.