Introduction
MultiFlex PCI 1000 Series User's Manual
7
execution. Any MCCL command or routine can also be downloaded and called from a high-level program
(C/C++/C#/VB etc) via the appropriate Motion Control API function libraries.
For additional information on Motion Control API and MCCL programming, please refer to the
Motion
Control API Reference Manual
and the
Motion Control Command Language (MCCL) Reference
Manual
which are both available for download at:
www.pmccorp.com/support/mfxpci1000.php
.
Motion Control API example
Function prototypes
C/C++
MCMoveAbsolute(HCTRLR hCtlr, WORD axis, double position);
C#/.NET
Mcapi.Error Mcapi.MoveAbsolute(Int16 axis, Double position);
Delphi:
procedure MCMoveAbsolute( hCtlr: HCTRLR; axis: Word; position: Double ); stdcall;
VB:
Sub MCMoveAbsolute(ByVal hCtrlr As Integer, ByVal axis As Integer, ByVal position As Double)
LabVIEW:
//C/C++ Example, Move Axis 1 to position 85000
MCMoveAbsolute( hCtlr, 1, 85000.0 );
MCCL command example
MA
M
ove
A
bsolute
MCCL command
:
aMAn
a = Axis number n = integer or real
applies to
:
Analog Command Axis, Pulse Command Axis
see also
:
MR, PM
These MCCL command sequences cause the motion controller to execute a move to absolute position n.
;Example:
1MA1000 ;Axis
1
move
to
position
1000
2MA-25000
;Axis 2 move to position -25000
The following example illustrates MCCL multi-tasking. This example shows how a user would monitor the
state of a digital input while an axis is moving in order to ‘automatically’ stop the axis as soon as the input
is activated:
;Example:
AL0,AR10
;define user register 10 as input #4 active
AL0,AR100
;define user register #100 as background task
MD100,IN4,MJ101,NO,1JR-3
;jump to macro 101 when digital input #4 turns on
MD101,1ST,1WS.05
; macro 101 defined, stop axis #1.
AL1,AR10,ET@100
;terminate
background
task
i
There is not necessarily a one-to-one relationship between each Motion Control
API function and eacn MCCL command. Although any MCCL command can be
called directly using the Motion Control API’s pmccmdex() function, most Motion
Control API functions ease the task of programming by encapsulating additional
functionality within each function.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com