User guide

56
6000 Series Programmer's Guide
Sample file for fast status structure, function declarations, and global variables (WIN6400.DLL):
SEE ALSO: Driver\vb30\AT6400.BAS
'---------------------------------------------------------------------------
' Get faststatus structure -- also provided in DRIVER\VB30\AT6400.BAS
'---------------------------------------------------------------------------
Type AT6400INFO
MotorPos(1 To 4) As Long ' commanded position (counts)
EncPos(1 To 4) As Long ' actual position (counts)
MotorVel(1 To 4) As Long ' commanded velocity (counts/sec)
AxisStatus(1 To 4) As Long ' axis status (TAS)
IntStatus As Long ' interrupt status (TINT)
SysStatus As Long ' system status (TSS)
UserStatus As Integer ' user status (TUS)
Timer As Long ' timer value (TIM - milliseconds)
Counter As Integer ' time frame counter (2ms per count)
ProgIn As Long ' programmable input status (TIN)
ProgOut As Long ' programmable output status (TOUT)
Limits As Integer ' limit status (TLIM)
Other As Integer ' other input status (TINO)
Analog As Long ' lo-res analog input voltage (TANV)
PosOffset(1 To 4) As Long ' position offset (68000-DSP)
EncVel(1 To 4) As Long ' actual velocity (counts/sec)
XEncPos(1 To 1) As Long ' extra encoder position (counts)
ANI(1 To 4) As Integer ' hi-res analog input voltage (TANI)
ANIOffset(1 To 4) As Long ' hi-res ANI offset
DAC(1 To 4) As Integer ' commanded DAC count (TDAC)
PosError(1 To 4) As Long ' position error (TPER - counts)
MasterCycleNum(1 To 4) As Long ' following master cycle number (TNMCY)
MasterCyclePos(1 To 4) As Long ' following master cycle position (TPMAS)
FollStatus(1 To 4) As Long ' following status (TFS)
PosShift(1 To 4) As Long ' following net shift (TPSHF)
MasterVel(1 To 4) As Long ' following master velocity (TVMAS)
TPCCA(1 To 4) As Long ' captured commanded position via trigger A (counts)
TPCCB(1 To 4) As Long ' captured commanded position via trigger B (counts)
TPCCC(1 To 4) As Long ' captured commanded position via trigger C (counts)
TPCCD(1 To 4) As Long ' captured commanded position via trigger D (counts)
TPCEA(4) As Long ' captured actual position via trigger A (counts)
TPCEB(1 To 4) As Long ' captured actual position via trigger B (counts)
TPCEC(1 To 4) As Long ' captured actual position via trigger C (counts)
TPCED(1 To 4) As Long ' captured actual position via trigger D (counts)
TPCAA(1 To 4) As Long ' captured ANI value via trigger A (counts)
TPCAB(1 To 4) As Long ' captured ANI value via trigger B (counts)
TPCAC(1 To 4) As Long ' captured ANI value via trigger C (counts)
TPCAD(1 To 4) As Long ' captured ANI value via trigger D (counts)
dfVAR11 As Long ' variable VAR11
dfVAR12 As Long ' variable VAR12
dfVAR13 As Long ' variable VAR13
dfVAR14 As Long ' variable VAR14
End Type
'---------------------------------------------------------------------------
' win6400.dll FUNCTION DECLARATIONS
'---------------------------------------------------------------------------
Declare Function SendAT6400Block% Lib "win6400.dll" (ByVal address%, ByVal cmd$, ByVal irqnum%)
Declare Function RecvAT6400Block% Lib "win6400.dll" (ByVal address%, ByVal resp$, ByVal irqnum%)
Declare Function osload% Lib "win6400.dll" (ByVal address%, ByVal options$, ByVal handle%)
Declare Function IsOSLoaded% Lib "win6400.dll" (ByVal address%)
Declare Function request_status% Lib "win6400.dll" (ByVal address%)
Declare Sub set_pointer Lib "win6400.dll" (ByVal address%, ByVal status_offset%)
Declare Sub read_status Lib "win6400.dll" (ByVal address%, status_high%, status_low%, status&)
Declare Function IsAT6400Ready% Lib "win6400.dll" (ByVal address%)
Declare Sub SetTimeout Lib "win6400.dll" (ByVal timeout&)
Declare Sub Delay Lib "win6400.dll" (ByVal timedelay&)
Declare Function SendAT6400File% Lib "win6400.dll" (ByVal handle%, ByVal address%, ByVal irqnum%,
ByVal filename$, ByVal options$)
Declare Function SetNTParam% Lib "win6400.dll" (ByVal address%, ByVal irqnum%)
Declare Function GetFastStatus% Lib "win6400.dll" (ByVal address%, faststatus As AT6400INFO)
Declare Function GetExFastStatus% Lib "win6400.dll" (ByVal address%, ByVal block7%, ByVal block8%,
faststatus As AT6400INFO)
'---------------------------------------------------------------------------
' mmsystem.dll FUNCTION DECLARATION
'---------------------------------------------------------------------------
Declare Function TimeGetTime& Lib "mmsystem.dll" ()
'---------------------------------------------------------------------------
' Global Variables Used
'---------------------------------------------------------------------------
Global response As String * 258 'response for the RecvAt6400Block
Global address As Integer 'device address for the at card
Global faststatus As AT6400INFO 'structure holding at6400 info
Global cmd$ 'command string to send in SendAt6400Block