background image

G

MAS

 

 

Gold

 

Maestro

 

Software

 

User’s

 

Manual

   

Software

 

User

 

Manual

 

XXXXXXXXXXXX(0.01)

 

 

3

15

 

Elmo

 

supplies

 

a

 

set

 

of

 

Wrapper

 

Functions

 

files

 

as

 

part

 

of

 

its

 

set

 

of

 

examples.

 

You

 

can

 

define

 

and

 

create

 

your

 

own

 

set

 

of

 

Wrapper

 

Functions

 

files

 

(starting

 

from

 

scratch

 

or

 

based

 

on

 

one

 

of

 

Elmo’s

 

examples),

 

as

 

suitable

 

for

 

your

 

projects

 

and

 

style

 

of

 

writing.

 

Wrapper

 

Functions

 

files

 

should

 

follow

 

the

 

following

 

guidelines:

 

 

Elmo’s

 

supplied

 

Wrapper

 

Functions

 

files

 

should

 

not

 

be

 

modified.

 

Instead,

 

if

 

modifications

 

are

 

necessary,

 

copy

 

the

 

file

 

to

 

a

 

new

 

file

 

and

 

modify

 

it.

 

 

Each

 

Wrapper

 

Functions

 

file

 

should

 

include

 

a

 

set

 

of

 

functions

 

that

 

are

 

logically

 

related.

 

Each

 

function

 

should

 

have

 

a

 

simple

 

user

 

interface.

 

 

Each

 

Wrapper

 

Functions

 

file

 

should

 

be

 

named

 

to

 

reflect

 

its

 

contents.

 

For

 

example:

 

SimplifiedSynchronizedMotions.c.

 

 

Each

 

Wrapper

 

Functions

 

C

 

file

 

should

 

have

 

a

 

header

 

file

 

(*.h),

 

with

 

the

 

same

 

name.

 

The

 

header

 

file

 

will

 

include

 

definitions

 

relevant

 

to

 

the

 

Wrapper

 

Functions

 

file,

 

as

 

well

 

as

 

prototypes

 

for

 

the

 

wrapper

 

functions

 

included

 

within

 

it.

 

 

The

 

general

 

(not

 

example

 

specific)

 

Wrapper

 

Functions

 

files

 

that

 

are

 

supplied

 

by

 

Elmo,

 

are

 

located

 

under

 

the

 

G:\GMAS\GMASCWrapperFunctionsFiles.

 

 

Additional

 

Wrapper

 

Functions

 

files

 

that

 

are

 

more

 

specific

 

to

 

a

 

given

 

project/application

 

should

 

be

 

located

 

within

 

the

 

project

 

directory.

 

 

If

 

a

 

Wrapper

 

Function

 

acquires

 

a

 

number

 

of

 

assumptions

 

(default

 

values,

 

keeping

 

previous

 

values,

 

etc.),

 

these

 

assumptions

 

must

 

be

 

clearly

 

documented

 

for

 

the

 

user.

 

 

It

 

is

 

strongly

 

recommended

 

that

 

a

 

Wrapper

 

Function

 

(unless

 

it

 

was

 

written

 

to

 

a

 

very

 

specific

 

and

 

fixed

 

project)

 

will

 

not

 

include

 

default

 

values

 

for

 

parameters.

 

An

 

easy

 

mistake

 

can

 

be,

 

for

 

example,

 

to

 

assume

 

a

 

value

 

of

 

100000

 

(for

 

example)

 

for

 

a

 

simplified

 

motion

 

function.

 

This

 

may

 

work

 

perfectly

 

for

 

a

 

given

 

example,

 

but

 

will

 

not

 

be

 

suitable

 

for

 

a

 

future

 

example,

 

when

 

no

 

one

 

will

 

remember

 

this

 

default

 

decision.

 

Other

 

solutions

 

are

 

recommended

 

(for

 

example,

 

to

 

include

 

a

 

Wrapper

 

Function

 

within

 

the

 

file

 

that

 

will

 

be

 

used

 

to

 

initialize

 

all

 

this

 

default

 

values

 

from

 

the

 

main

 

code).

 

Something

 

like:

 

InitMotionsWrapper(iSpeed,

 

iAcceleration,

 

iDecelaration,

 

iMode,

 

iSmoothing,

 

…)

 

Then

 

the

 

programmer

 

can

 

freely

 

use

 

MoveAbs(iPosition)

 

etc.

 

3.5.

 

Implementing machine sequences 

A

 

program

 

that

 

handles

 

machine

 

sequences

 

should

 

answer

 

the

 

following

 

requirements:

 

 

Capable

 

to

 

handle

 

a

 

number

 

of

 

sequences

 

in

 

parallel.

 

For

 

example,

 

assuming

 

that

 

the

 

G

MAS

 

should

 

handle

 

a

 

machine

 

with

 

three

 

axes

 

(e.g.

 

X,

 

Y

 

and

 

Z)

 

together

 

with

 

an

 

Automatic

 

Loader

 

that

 

should

 

load

 

and

 

unload

 

the

 

object

 

to/from

 

the

 

machine,

 

itself

 

consisting

 

of

 

4

 

axes.

  

Each

 

of

 

these

 

sub

assemblies

 

should

 

be

 

controlled

 

in

 

parallel,

 

having

 

sequences

 

that

 

are

 

independent

 

while

 

necessarily

 

synchronized.

 

A

 

User

 

Application

 

at

 

the

 

G

MAS

 

should

 

be

 

able

 

to

 

execute

 

both

 

sequences

 

(the

 

machine

 

and

 

the

 

Loader)

 

in

 

parallel,

 

and

 

to

 

synchronize

 

them,

 

when

 

synchronization

 

is

 

required.

 

Содержание Gold Maestro G-MAS

Страница 1: ...G MAS Gold Maestro Software User s Manual March 2011 Ver 1 0 www elmomc com...

Страница 2: ...m without prior consent in writing by Elmo Motion Control Ltd This document contains proprietary information belonging to Elmo Motion Control Ltd Such information is supplied solely for assisting user...

Страница 3: ...s Files 3 11 3 1 3 Project s Description Files 3 11 3 2 Functions Variables and Constants 3 12 3 3 C and Header Files 3 12 3 4 Wrapper functions 3 13 3 4 1 Hiding Complex and or Not Important Code Seg...

Страница 4: ...XXXXXXXX 0 01 1 2 4 3 The device network 4 53 4 4 Additional tools 4 54 4 4 1 KPA Studio 4 54 4 4 2 IP Configuration over USB 4 54 Chapter 5 The XYZ robot example 5 55 Chapter 6 Further Programming Ex...

Страница 5: ...mable control unit with built in ready to use standardized functionalities for communications motions emergencies timing events and all that is required and desired to implement a complete multi axis...

Страница 6: ...etwork device views only a very narrow axis I O portion of the overall system and therefore cannot create or control overall system sequences or multi axis synchronized motions The network devices req...

Страница 7: ...ld product family this can be found for example in the host communication MODbus Ethernet IP Device Network CANopen CANopen over EtherCAT safety PLCmotion library I Os interface circuits etc 1 3 What...

Страница 8: ...he G MAS and Gold Drives As a G MAS user you will need this application to configure your system network devices etc communicate with the G MAS and to perform a variety of features incorporated within...

Страница 9: ...dify them according to the structure of your own system Use the guidelines described within the following the table to properly modify this manual examples Your System Structure Necessary modification...

Страница 10: ...XXXXX 0 01 2 8 Your System Structure Necessary modifications for examples written for CAN Necessary modifications for examples written for EtherCAT G MAS with 1xGold drive over the CAN bus As above As...

Страница 11: ...e time to market of your project One of these guidelines is the concept of States Machine programming as you will see later on this manual It is one of few possible methods to implement machine sequen...

Страница 12: ...e of the project s directory respects the following guidelines It reflects the project application contents It has no spaces If it consists of few words each word starts with a Capital letter for easy...

Страница 13: ...various C functions All files should be named using the above file naming guidelines 3 1 3 Project s Description Files Elmo highly recommends that an application programmer should add some files to a...

Страница 14: ...word Global variables are allowed and recommended for variables accessed by more than one function They should be defined at the top of a C file in most cases the project s main C file The Global vari...

Страница 15: ...yMoveAbsolute dSpeed dPosition This function has a very simple interface can be easily used to create a motion as all you need to enter are values for Speed and Position but internally it will use the...

Страница 16: ...mstances the programmer or Elmo within its examples may define a new function that will have a simple interface with the program and will internally assume some defaults for the remaining functions ar...

Страница 17: ...ires a number of assumptions default values keeping previous values etc these assumptions must be clearly documented for the user It is strongly recommended that a Wrapper Function unless it was writt...

Страница 18: ...thods to write a program that will answer the above requirements For example multi tasking and interrupts Elmo has an extensive experience in the development of user applications We have acquired this...

Страница 19: ...nction is called This function intentionally starts the execution of the machine sequences and motions During the machine operation the MachineSequences function does not return to the main until the...

Страница 20: ...ns let s assume a TIMER_CYCLE 20ms From this point on the OS activates the MachineSequencesTimer every 20ms This timer function actually handles and manages the States Machine as explained below The M...

Страница 21: ...Immediately after termination is requested the while loop ends and MachineSequences calls to MachineSequencesClose to close everything that needs to be closed before returning to the main function to...

Страница 22: ...is will ensure that all the States Machines code as executed during this timer event will use the same values of input variables Why this is needed As the timer event is not necessarily synchronized w...

Страница 23: ...re proper synchronized and consistent operation Now let s look at the States Machines themselves Within Figure 3 below you can see that in the general case the MachineSequencesTimer function can handl...

Страница 24: ...iable giSubStateN In case a Sub State Machine see later for details is necessary this variable defines the current state of the Sub State Machine It is generally initialized by the MachineSequencesIni...

Страница 25: ...te that while theoretically unlimited parallelism and depth can be implemented the programmer is responsible to make sure that the worst case execution time of the overall MachineSequencesTimer functi...

Страница 26: ...old Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 3 24 Figure 3 Typical MachineSequencesTimer function The next figure shows the details of the code within one of the States Ma...

Страница 27: ...tates Machines Please note that handling reentrancy and the termination request has been omitted from this drawing compared to the previous example in order to maintain simplicity Of course these two...

Страница 28: ...States Machine is executed it will reach the code relevant for this state and will check for end of motion If the axis is still moving the code will return without changing the State value so that th...

Страница 29: ...the Sub States Machine Actually this ends the explanation of the States Machines programming structure Shortly within this chapter after the next section about handling errors you will find a section...

Страница 30: ...mming practices for handling these errors To clarify it is impossible for us to provide a generic function to handle the errors as each machine requires different error handling process However there...

Страница 31: ...s 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 usi...

Страница 32: ...k 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...

Страница 33: ...names of the C and header files including the wrapper functions that are always in pairs Exploring using the Eclipse the Sample c the main source file of the project we can see the file s header desc...

Страница 34: ...an occur at this phase as part of the definition but we prefer to perform all initialization within the suitable initialization functions as described in the n ext section Immediately after the Applic...

Страница 35: ...n appears Please note the comments header above the main function as well as above any other function in the code It provides details about the function such as version inputs outputs description etc...

Страница 36: ...lize communication and axes while Closing can be used to close them closing log files printing some message to the standard output etc Following these functions we see the MachineSequences It is docum...

Страница 37: ...r of the various functions appearing in the file is the order they will be called used starting from main to the other functions it calls and so forth The MachineSequencesInit initializes all variable...

Страница 38: ...unctions whose tasks are described in earlier chapters the next interesting function is EnableMachineSequencesTimer This uses system functions to enable the timer and to define the function triggered...

Страница 39: ...It is the function triggered periodically by the timer that actually executes the machine sequences the states machines It initially checks if Termination was requested and if reentrance incorrectly o...

Страница 40: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 3 38 Then the next stage is...

Страница 41: ...ine is handled exactly as we described in the flow charts above In the Sample project you can see that the main states machine supports two states two tasks XY_HOME and XY_MOVE Each one of these state...

Страница 42: ...e of a states machine code The StateXYHomingFunction is a good example for a sub states machine code While the machine is in XY_HOME state the main states machine s value is XY_HOME this function will...

Страница 43: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 3 41 Then the next stage is...

Страница 44: ...t for end of motions etc we find the function as an example SubStateXYHomingMoveToLimitFunction Please note how this function creates motion and not waiting for end of motion or any other wait and cha...

Страница 45: ...tion ends no delays no waits It will be called again at the next timer cycle 20ms in this example and so on Once both limits are set the sub state is modified to the next state and the function ends T...

Страница 46: ...more states functions but they are all written according to the above guidelines The Sample h is shown in the two diagrams below Note the functions prototyping general functions and states functions a...

Страница 47: ...3 45 This actually completes the review of the Sample project s code The SampleWrapper c and SampleWrapper h files are skeleton almost empty files to be filled with functions and definitions as may be...

Страница 48: ...odule User Projects c h Files gexe Files EtherCAT or CAN Bus User C Applications gexe Files User Files HMI or PLC Elmo EAS System Configuration GMAS Setup Motions Drives Setup Motions Drives Programmi...

Страница 49: ...that are not closely related to the axes motion sequences such as user interfaces image analysis barcode interfaces etc as maybe required for the machine In the situation where the host is a PC compu...

Страница 50: ...is used to develop and debug User C and C Programs for the G MAS Elmo decided to use the market leading Eclipse environment and not to integrate this task to the EAS in order to provide its user with...

Страница 51: ...y Elmo as part of the G MAS It automatically runs the G MAS firmware when power ON which is responsible for the following tasks TCP IP communication with the Host Process to Process communication with...

Страница 52: ...ach of the available Function Blocks Here is some brief information about the Function Block interfaces The API consists of a list of functions with input and output values For instance the MC_MoveAbs...

Страница 53: ...is sent The AxisREF is obtained via the GetAxisByNameCmd API function This function is to be called once per axis The user program either Internal or Remote can receive events that occur in the G MAS...

Страница 54: ...ased on a User Application program at the PC since such a program reduces the computational load of the Host reduces the TCP IP network load and includes enabling modular implementation of the overall...

Страница 55: ...d memory of the Host and the User Application program and they can communicate over it It is the user s responsibility to define the communication items what is to be communicated in what areas of the...

Страница 56: ...andards of this network Generally speaking the user does not need to know the details of the device network as all the details are automatically handled by the G MAS The exact list of protocols suppor...

Страница 57: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 5 55 Chapter 5 The XYZ robot example TBD...

Страница 58: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 6 56 Chapter 6 Further Programming Examples...

Страница 59: ...G MAS Gold Maestro Software User s Manual Software User Manual XXXXXXXXXXXX 0 01 7 57 Chapter 7 PC Software Installation and how to use TBD...

Отзывы: