User guide
42
6000 Series Programmer's Guide
Creating Your Own DOS-Based Application Program
Creating a program to control an application can often be difficult. To ease the programming
burden, Compumotor has provided communication interface routines for ASSEMBLY, BASIC,
C, and PASCAL. The routines are supplied in the seven sub-directories on the DOS Support
Disk (see table below).
Directory File to use Function of the file
FASTTERM FASTTERM.ASM Shows how to communicate with the controller using ASSEMBLY.
MC6ØTERM MC6ØTERM.C
MC6ØLIB.C
Shows how to communicate with the controller using Microsoft C. The
file MC6ØTERM.C shows how to use the subroutines created within
MC6ØLIB.C.
TC2ØTERM TC2ØTERM.C
TC2ØLIB.C
Shows how to communicate with the controller using Borland Turbo C.
The file TC2ØTERM.C shows how to use the subroutines created within
TC2ØLIB.C.
TP5ØTERM TP5ØTERM.PAS
TP5ØPLIB.PAS
Shows how to communicate with the controller using Borland Turbo
Pascal. The file TP5ØTERM.PAS shows how to use the subroutines
created within TP5ØPLIB.PAS.
QB45TERM QB45TERM.BAS
QB45LIB.BAS
Shows how to communicate with the controller using Microsoft
QuickBASIC. The file QB45TERM.BAS shows how to use the
subroutines created within QB45LIB.BAS.
MC6ØTRMI MC6ØTRMI.C
MC6ØLIBI.C
Shows how to communicate with the controller using Microsoft C. This
file also shows how to use the interrupt capability of the controller. The
file MC6ØTRMI.C shows how to use the subroutines created within
MC6ØLIBI.C.
SAMPLES
DOS5Ø
TC2Ø
TP5Ø
QB45
MC6Ø
DOS5ØBAS.BAS
TC2ØFAST.C
TC2ØMOVE.C
TC2ØLIB.C
TC2ØLIB.H
TP5ØFAST.PAS
TP5ØMOVE.PAS
TP5ØPLIB.PAS
QB45FAST.BAS
QB45MOVE.BAS
QB45LIB.BAS
MC6ØFAST.C
MC6ØMOVE.C
MC6ØLIB.C
MC6ØLIB.H
Shows how to communicate with the controller using DOS QuickBASIC.
Shows how to use the controller's fast status area (Borland Turbo C 2.0).
Shows samples of basic moves (Borland Turbo C 2.0).
Command routines for the controller (used with TC2ØMOVE.C)
Command routines for the controller (used with TC2ØMOVE.C)
Shows how to use the controller's fast status area (Borland Turbo Pascal
5.0).
Shows samples of basic moves (Borland Turbo Pascal 5.0).
Command routines for the controller (used with TP5ØMOVE.PAS)
Shows how to use the controller's fast status area (Microsoft QuickBASIC
4.5).
Shows samples of basic moves (Microsoft QuickBASIC 4.5).
Command routines for the controller (used with QB45MOVE.BAS)
Shows how to use the fast status area (Microsoft C 6.0).
Shows samples of basic moves (Microsoft C 6.0).
Command routines for the controller (used with MC6ØMOVE.C)
Command routines for the controller (used with MC6ØMOVE.C)
The above sample programs (“SAMPLES” directory) utilize the functions
SendAT6nnnBlock(param1,param2) and RecvAT6nnnBlock() to communicate with the
AT6nnn product. The two parameters that are passed are the board address (in decimal) and a
string. In SendAT6nnnBlock(address,command), the “command” is either a 6000 Language
command string or a string variable representing a 6000 Language command line. In
RecvAT6nnnBlock(address,response), the “response” is a string variable containing the
response from the card.
☞
Preventing the output
buffer from filling up
It is important that the responses are read from the controller when sending commands;
otherwise, the output buffer of the controller will fill up and the card will not accept any more
commands until the output buffer is read via RecvAT6nnnBlock(). This can happen
when the default error level, ERRLVL4, is set (all prompts and error messages are returned).
Each time a valid command is received by the controller, a prompt (ERRORK characters) is
returned, indicating that the controller is ready for another command. If the output buffer is
never read, it will eventually fill up with the ERRORK characters. If you do not want to read a
response each time a command is sent to the controller, then set the error level to ERRLVL1
or ERRLVLØ. With these two settings, no error messages or prompts are generated by the
controller, but bear in mind that all requested data (such as TPE, TAS, etc.) will be returned
with minimal formatting.










