User`s manual

http://www.adtechcn.com 78
1.5 Stop module
The stop module is mainly used to control sudden events during the drive process that require
immediate stop of all axes’ motions. The codes of stop module are provided at the button
“CmdStop” where they can be accessed by clicking. The codes are described as follows:
Private Sub Stop_Click()
For i = 1 To 4
StopRun i, 0
Next i
End Sub
) 2. VC programming
2.1 Preparation
(1) Create a new project, and save it as “VCExample.dsw”;
(2) By referring to the method mentioned earlier, add static library “8840.lib” to the project.
2.2 Motion control module
(1) Add a new category to the project, for which the header file can be saved as “CtrlCard.h”
and source file as “CtrlCard.cpp”;
(2) First self-define the initialization functions of the control card in this module and initialize
the library functions that need to be packaged into the initialization functions.
(3) Keep self-defining other related motion control functions, such as speed setting function,
single-axis motion function and interpolation motion function.
(4) The codes of the header file “CtrlCard.h” are decribed as follows:
# ifndef __ADT8840__CARD__
# define __ADT8840__CARD__
/************************* motion control module ***********************
To quickly develop application system with high usability, expansibility and
maintainability, we have 'packaged all library functions by referring to the
type on the basis of the function library of the control card. The following
example only involves one motion control card.
********************************************************************/
#define MAXAXIS 4 // max. number of axes
class CCtrlCard
{
public:
int Setup_HardStop(int value, int logic);
int Setup_Stop1Mode(int axis, int value, int logic);
int Setup_Stop0Mode(int axis, int value, int logic);
int Setup_LimitMode(int axis, int value1, int value2, int logic);
int Setup_PulseMode(int axis, int value);