User guide

52
6000 Series Programmer's Guide
Visual Basic™ Support
NOTE
To demonstrate how to
use the DLL functions,
we've provided all the
files for a sample Visual
Basic 3.0 project using
WIN6400.DLL. Refer to
page 57 for details.
Visual Basic declarations for all DLL functions and subroutines are described below. Note that
some functions are not applicable to all DLLs, and that the syntax for the SendAT6400Block
and RecvAT6400Block functions is different when using WN956000.DLL.
TIP: Before you invoke Visual Basic, copy the desired DLL file (WIN6400.DLL,
NT6400.DLL or WN956000.DLL) and your controller's _______.OPS (operating system) file
from your Motion Architect directory to the Visual Basic root directory.
DLL Functions
SYNTAX EXPLANATION
(using the “SendAT6400Block” function as an example)
Declare Function
Visual Basic (VB)
command for declaring
an external function
(ByVal address%, ByVal cmd$, ByVal irqnum%)Lib "wn956000.dll"SendAT6400Block%
Bold type represents reserved
Visual Basic commands or notation.
“%” means that the
function will return an
integer
Function name Tells VB to find the
function in the library
called WN956000.DLL
(the 32-bit DLL for
Windows 95)
Pass by
value
Variable
name
Additional arguments
required for the function
(arguments are separated by
comma and space)
“%” means that
the variable is an
integer
NOTE: For some functions, the syntax (excluding the library call) is
identical for all DLLs. For these functions, we've used the “______.dll”
convention to indicate that you can insert the name of the DLL you are
using (WIN6400.DLL, WN956000.DLL, or NT6400.DLL).
NT6400.DLL ONLY
DLL Function: SetNTParam
Description: Initializes Windows NT driver for one card only. Call this function before any other
communications with the 6000 product, including loading the operating system.
If you are using
more than one 6000 card in your computer, use the
SetNTMultiCardAddress
function.
Syntax: Declare Function SetNTParam% Lib "nt6400.dll" (ByVal address%, ByVal irqnum%)
“address”..... Board address of the 6000 controller card (must be evenly divisible by 8).
“irqnum”
.......
Set to zero (used internally by Motion Architect for interrupt support).
Return Value: Returns FALSE (“0”) if function successful. Otherwise, TRUE (non-zero value).
NT6400.DLL ONLY
DLL Function: SetNTMultiCardAddress
Description: Initializes Windows NT driver. Call this function before any other communications with the 6000
product, including loading the operating system. If you are using more than one 6000 card in your
computer, call the SetNTMultiCardAddress function once for each card address.
Syntax: Declare Function SetNTMultiCardAddress% Lib "nt6400.dll" (ByVal address%)
“address”..... Board address of the 6000 controller card (must be evenly divisible by 8).
Return Value: Returns FALSE (“0”) if function successful. Otherwise, TRUE (non-zero value).
WN956000.DLL ONLY
DLL Function: SetDevice
Description: Initializes Windows 95 driver. Call this function before any other communications with the 6000
product, including loading the operating system.
Syntax: Declare Function SetDevice% Lib "wn956000.dll" (ByVal devnum$, ByVal address%)
“devnum”..... Device number assigned to the card. The first card addressed must be assigned
device number zero (0); the next cards must be assigned consecutive numbers
(i.e., 1,2,3, etc.).
“address”..... Board address of the 6000 controller card (must be evenly divisible by 8).
Return Value: Returns FALSE (“0”) if function successful. Otherwise, TRUE (non-zero value).