
G
‐
MAS
–
Gold
Maestro
Software
User’s
Manual
Software
User
Manual
XXXXXXXXXXXX(0.01)
3
‐
29
// Inserting the structure parameters:
sMove_Abs_in.
fAcceleration
= 100000.0; // Value of the acceleration
sMove_Abs_in.
fDeceleration
= 100000.0; // Value of the deceleration
sMove_Abs_in.
fJerk
= 2000.0; // Value of the Jerk
sMove_Abs_in.
eDirection
=
MC_POSITIVE_DIRECTION
; // MC_Direction Enumerator type
sMove_Abs_in.
eBufferMode
=
MC_BUFFERED_MODE
; // MC_BufferMode Defines the behavior of
the axis
sMove_Abs_in.
dbPosition
= 100000.0; // Target position for the motion
sMove_Abs_in.
fVelocity
= 5000.0; // Velocity in
sMove_Abs_in.
ucExecute
= 1;
//
if (
MMC_MoveAbsoluteCmd
(hConn, iAxisRef, &sMove_Abs_in, &sMove_Abs_out) != 0)
{
HandleError();
}
The
user
is
responsible
to
create
the
HandleError()
function.
This
function
can
optionally
get
arguments,
and,
of
‐
course,
different
functions
can
be
used
at
different
locations
of
the
program.
Nevertheless,
the
code
that
should
perform
a
sequence
of
calls,
becomes
a
list
of
if
‐
call
(or
call
‐
if).
This
is
a
disadvantage
of
the
C
programming
that
Elmo
is
working
to
improve
(see
below).
Some
programmers
tend
to
bypass
this
difficulty
using
one
of
the
following
methods.
We
strongly
recommend
not
using
these
bypasses.
•
Call
the
library
functions
without
checking
the
Return
Code.
Just
ignoring
it.
This
will
surely
create
a
nicer
and
simpler
code.
The
assumption
behind
using
this
bypass
is
that
the
code
is
debugged
and
that
there
should
be
no
errors
in
the
calls
to
the
library
functions.
Although
this
is
correct,
there
is
no
way
to
ensure
that
errors
will
not
happen
in
some
given
sequence
which
was
not
fully
debugged
by
the
user.
In
the
case
of
an
error,
ignoring
it
and
continuing
the
program
as
if
there
was
no
error
(the
program
assumes
that
the
function
was
executed
properly
and
completely),
will
lead
to
unexpected
machine’s
behavior,
which
can
be
in
some
cases
dangerous
and
critical.
As
stated
above,
Elmo
strongly
recommends
not
to
use
this
method.
Errors
should
be
checked
and
responded
to,
according
to
the
suitability
for
the
machine.
•
A
second
bypass
is
to
hide
the
library
function
within
a
user
developed
wrapper
function
(see
above).
In
this
case,
the
wrapper
function
will
have
no
return
value,
such
as:
MyWrapperMoveAbs(..);
MyWrapperMoveAbs(..);
MyWrapperMoveAbs(..);
And
the
main
code
will
indeed
become
simpler.
However,
it
is
important
to
note
that
the
wrapper
function
itself,
which
calls
the
library
function,
should
handle
the
Return
Code
as
specified
above.
Handling
the
error
within
the
wrapper
Содержание Gold Maestro G-MAS
Страница 1: ...G MAS Gold Maestro Software User s Manual March 2011 Ver 1 0 www elmomc com...
Страница 40: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 3 38 Then the next stage is...
Страница 43: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 3 41 Then the next stage is...