©
National Instruments Corporation
B-1
B
Initializing the Controller
Programmatically
You can initialize the motion controller from within a LabVIEW,
Visual Basic, or C/C++ program, in addition to initializing controllers in
Measurement & Automation Explorer (MAX).
Refer to Table B-1 for the steps you must take to initialize a controller
programmatically and the functions and VIs you use for each step.
Table B-1.
Steps for Programmatically Initializing Controllers
Step
Function and/or VI
1.
Clear the power-up state.
Use the Clear Power Up Status VI.
2.
Review any errors that occurred on the
controller to determine how best to handle
them.
Use the Read Error Message VI.
3.
Make sure all axes are stopped and disabled. Use the Stop Motion and Enable Axes VIs. In
the Stop Motion VI, set
Stop Type (Decel)
set to
Halt. In the Enable Axes VI, you must set
Axis
Bitmap
to
False
for each axis you want to
disable.
4.
Unconfigure vector spaces.
Use the Configure Vector Space VI with the
X
Axis
,
Y Axis
, and
Z Axis
terminals set to
None
.
5.
Configure resources for axes.
Use the Configure Axis Resources VI.
6.
Load all axis configuration options you want
to use.
Use the Axis & Resource Configuration palette.
7.
Initialize encoders and ADCs, as
appropriate.
Use the appropriate VIs on the Analog & Digital
I/O palette.
8.
Enable the axes, but leave them deactivated. Use the Enable Axes VI.
9.
Load the appropriate control loop
parameters.
Use the Load Advanced Control Parameter and
either Load Single PID Parameter or Load All
PID Parameters VIs.