tm445 acopos acp10 software

81
ACOPOS ACP10 Software TM445

Upload: edward-armijo

Post on 28-Nov-2014

313 views

Category:

Documents


16 download

TRANSCRIPT

Page 1: Tm445 Acopos Acp10 Software

ACOPOS ACP10 SoftwareTM445

Page 2: Tm445 Acopos Acp10 Software

2 TM445 ACOPOS ACP10 Sof ware

Introduction

Requirements

Training modules: TM410 – The Basics of ASiM

Software: Automation Studio 2.5

Automation Runtime 2.80

Hardware: None

t

Page 3: Tm445 Acopos Acp10 Software

Introduction

Table of contents

1. INTRODUCTION 4

1.1 Training guideobjectives 5

2. OPERATING AN AXIS 6

2.1 General 6

2.2 Registering an axis 8

2.3 Executing commands 18

3. ACP10 EXAMPLE TASK 28

3.1 Initialization steps 29

3.2 Action steps 31

4. SPECIAL FUNCTIONS 33

4.1 Transferring individual ACOPOS parameters 33

4.2 Initialization of multiple parameters on ACOPOS 37

4.3 Message management 41

5. SUMMARY 42

ACOPOS ACP10 Software TM445 3

Page 4: Tm445 Acopos Acp10 Software

Introduction

1. INTRODUCTION

ACP10 is special operating software developed for ACOPOS servo drives. An object-oriented programming interface has been developed to optimize setting up processes for complex applications with several single-axistasks. It is user-friendly and also provides flexible expansion and simple maintenance.

Fig. 1 Introduction

This training module deals with the operation of the ACP10 software using an application program. Basic considerations concerning system architecture as well as the relationship between the individual system components (as mentioned in the TM410 AsiM Basis module) make up the basic information required to understand the processes in this system.

We will use different functions to create flexible commend sequences (positioning tasks, monitoring, etc). The Automation Studio online help will provide us with the necessary "supply" information.

4 TM445 ACOPOS ACP10 Software

Page 5: Tm445 Acopos Acp10 Software

Introduction

1.1 Training guideobjectives

Course participants will become familiar with use of the ACP10 software to operate the B&R drive application (ACOPOS).

Course participants will be able to use the ACP10 software functions in a structured form to control ACOPOS servo drives from an application program.

Fig. 2 Overview

ACOPOS ACP10 Software TM445 5

Page 6: Tm445 Acopos Acp10 Software

Operating an Axis

2. OPERATING AN AXIS

2.1 General

What does "object-oriented" mean?

With the NC concept (TM410 AsiM Basis), we have already seen thesystem architecture for the B&R drives (ACOPOS). The NC Manager on the controller communicates with the NC operating system on the ACOPOS servo drive. In an application program, various commands can now be transferred to the NC Manager, forwarded to the drive and then processed.

Fig. 3 Handling the NC object with ACP10 software

6 TM445 ACOPOS ACP10 Software

Page 7: Tm445 Acopos Acp10 Software

Operating an Axis

An NC object is managed by the software on the controller for each object that must be controlled ("real axis", "virtual axis"). We have the NC objects as the main objects on the first level.

Additionally, the NC objects are placed in various subgroups (subjects). For example, the NC object "real axis" contains the subgroups "controller", "encoder_if", "limit", etc.

As seen in TM410 AsiM Basis, this structuring is also found in the NC INIT parameter module (initial configuration) and in the parameter interface (configuration for test actions in NC test).

In these subgroups, various commands (NC actions) can now be used (e.g. "switch on controller", etc.). The structured (object-oriented) organization of the NC software allows clear and easy drive configuration.

Note:

Handling of the various NC objects ("real axis", "virtual axis", etc.) is done using the same principle and the same functions. In this training module, we will be mainly working with the NC object "real axis" for practical reasons. The knowledge and procedures can easily be applied to all other NC objects.

In the following steps, we will get to know the functions (NC functions) that can be used to prepare or control the ACOPOS drive for positioning. As a basis in the training module TM410 AsiM Basis, we learned how an axis object can be added to an existing project and what parameters have to be configured. Using NC test, we were already able to start specific tasks triggered by NC actions (initialization, switching on the controller, referencing, etc.).

Now we want to go over exactly how to control these procedures from an application task using the functions from the ACP10 user library. Automatic processes can be created in this way.

ACOPOS ACP10 Software TM445 7

Page 8: Tm445 Acopos Acp10 Software

Operating an Axis

Note:

Different ACOPOS types (1022, 1045, etc.) are operated using one mechansim.

Therefore, we do not have to follow any type-specific specifications, as long as ACOPOS servo drives are being used. This makes it possible to use a variety of program parts repeatedly.

The programming languages Structured Text (ST), Automation Basic (AB) or ANSI-C are recommended for programming the drives using the functions from the ACP10 software.

In the Automation Studio online help, you can find detailed information about the ACP10 software functions:

Fig. 4 Automation Studio online help, NC functions

2.2 Registering an axis

First we need a reference to the axis – a unique address or ID that we can use to access the axis object specifically. Therefore we have to inform the NC Manager via a function that we want to use a certain NC object (e.g. "real axis").

The two NC functions ncalloc and ncaccess are available for this purpose. Both functions are used for the same purpose, registering the NC object with the NC Manager. After the function executes successfully, the respective NC object is put into cyclic operation, i.e. it's added to the NC Manager's execution sequence.

We get back an axis reference (axis address) as result. This is an ID that we can use to access the axis object from now on.

Which of these two functions should we use?

We already know the two possibilities for managing(organizing/configuring) the axes in a project:

8 TM445 ACOPOS ACP10 Software

Page 9: Tm445 Acopos Acp10 Software

Operating an Axis

The drives (ACOPOS modules) can be added to the hardware treeand managed there.

This type of management requires the use of the ncalloc function to register the axis.

Another possibility for managing the NC objects is flexible NC configuration. All relevant settings (interface to the ACOPOS drive, node number, etc.) are made in the NC Deployment Table.

The ncaccess function is used for this type of management.

2.2.1 NC Function ncalloc

Fig. 5 Automation Studio online help, parameters for the ncalloc function

ACOPOS ACP10 Software TM445 9

Page 10: Tm445 Acopos Acp10 Software

Operating an Axis

In the image above we see the list of function parameters for ncalloc as they are shown in the Automation Studio online help documentation.

Which parameters does this function need?

bus_typthe bus type for the ACOPOS drive module on the PLC. Here, the code for the ACP10 software ("ncAPC10MAN") must be added to the code for the network interface used ("ncCAN_IF" or "ncPOWERLINK_IF").

modul_adrthe station number (node number) for the ACOPOS drive module in the network. (When using multiple CAN network lines, the network number has to be entered in the high byte and the station number in the low byte)

object_typspecifies the NC object type, "real axis" or "virtual axis".

channel"1". (For NC objects that only exist once on the addressed device)

nc_objectthe memory address for the NC structure of the NC object and, therefore, the reference for the NC object. Specifying this address allows us to apply the respective function to the desired NC object ("real axis") in the future.

statusreturns the function status and should therefore always be checked every time this function is called. A return value of "status=ncOK" indicates that the NC object was able to be registered successfully with the NC Manager. Information about errors that may occur when this function is called can be found by looking up the status error number in the Automation Studio help system.

2.2.2 NC Function ncaccess

Fig. 6 Automation Studio online help, parameters for the ncaccess function

In the image above we see the list of function parameters for ncaccess as they are shown in the Automation Studio online help documentation.

10 TM445 ACOPOS ACP10 Software

Page 11: Tm445 Acopos Acp10 Software

Operating an Axis

Let's have a closer look at the individual parameters:

nc_sw_idthe code for the software family, in our case the NC constant"ncACP10MAN", must be entered for the ACP10 software.

nc_obj_namethis is where the name that has been defined for the NC object in the deployment table.

Fig. 7 NC deployment table, NC object name

nc_objectthe memory address for the NC structure of the NC object and, therefore, the reference for the NC object. Specifying this address allows us to apply the respective function to the desired NC object ("real axis") in the future.

statusreturns the function status and should therefore always be checked every time this function is called. A return value of "status=ncOK" indicates that the NC object was able to be registered successfully with the NC Manager. Information about errors that may occur when this function is called can be found by looking up the status error number in the Automation Studio online help system.

Here, we also see an advantage when using the deployment table. If changes are made to the machine configuration (network, additional drives, etc.), this can be adjusted directly in the table. Existing NC object registrations (real axes, virtual axes, etc.) remain the same.

ACOPOS ACP10 Software TM445 11

Page 12: Tm445 Acopos Acp10 Software

Operating an Axis

Note:

Error number "10600" is a special case. Although the axis was able to be registered correctly and the reference address is valid, there are still errors for this NC object. These errors can be evaluated and acknowledged using a message routine (more about this later).

For performance reasons, we recommend executing the ncalloc or ncaccess function in the Init subprogram for the respective task. This guarantees that the function is called cleanly once.

2.2.3 Accessing the NC data structure

The functions ncalloc and ncaccess return the reference address of the NC structure for the NC object. With this information, it is possible to access a dynamic variable in the corresponding memory area.

What makes up this data structure?

In the NC structure, application-relevant parameters are grouped in a logical way. As we have already seen for object-oriented use of the NC software, the corresponding parameters are also divided into individual subgroups of the NC object here which are called subjects (e.g. controller, encoder, etc.).

An NC Object, for instance an axis, contains a large amount of parameter data and process information. To make this clearer, they are grouped as topics in a user data structure corresponding to the NC object type.

The contents of these structures depend on the NC object type. A real axis requires more information than a virtual axis, (e.g. encoder interface information).

12 TM445 ACOPOS ACP10 Software

Page 13: Tm445 Acopos Acp10 Software

Operating an Axis

ACOPOS ACP10 Software TM445 13

Therefore, there is an NC structure for each NC object type:

Fig. 8 Automation Studio help, NC object data types

NC structure elements contain the parameters for the individual subgroups:

E.g. data type ACP10AXIS_typ:

dig_in ... ... Digital inputs

encoder_if ... ... Encoder interface

limit ... ... Axis limit values

controller ... ... Controller settings

movement ... ... Movement settings

The parameter data in the application program can also be written to the NC structure. For example, setting the speed controller parameters would look like this:

p_ax_dat.controller.speed.kv = 0.5; /* [As/Rev.] */p_ax_dat.controller.speed.tn = 0.02; /* [s] */ for ST

p_ax_dat->controller.speed.kv = 0.5; /* [As/Rev.] */p_ax_dat->controller.speed.tn = 0.02; /* [s]*/ for ANSI-C

In addition to the parameter data, the NC structure also contains all important process and status data:

E.g. data type ACP10AXIS_typ:

monitor ... ... Axis monitor

message ... ... Messages (errors, warnings)

A complete listing of the elements and variables for this data type can be found in the Automation Studio help.

Page 14: Tm445 Acopos Acp10 Software

Operating an Axis

Fig. 9 Automation Studio online help, NC data structure

Fig. 10 Automation Studio online help, excerpt of NC data structure

In the image above, you can see an excerpt of this list for the data type"ACP10AXIS _typ" which is used for the NC object "real axis".

Note:

All status data has a gray background. These status values are read only, and they are updated by the NC Manager.The other entries are parameter data, which is used for configuration of the NC objects during operation (limit values, etc.) or for certain actions and commands (movement distance, referencing methods, etc.).

Access

To configure the parameters and request the status in this structure from the application task, the respective memory location must be accessed with a dynamic variable (e.g. a pointer in Ansi C). When doing this, the dynamic variables must have the same data type as the NC data structure (i.e. the "ACP10AXIS_typ" structure data type for the NC object "real axis").

14 TM445 ACOPOS ACP10 Software

Page 15: Tm445 Acopos Acp10 Software

Operating an Axis

ACOPOS ACP10 Software TM445 15

Fig. 11 Access of memory location using a dynamic variable

In the application task, the dynamic variables can reference the memory location (access the memory location) as follows depending on the programming language used:

Structured Text: p_ax_dat access ax_obj;

Automation Basic: p_ax_dat access ax_obj

Ansi C: p_ax_dat = (ACP10AXIS_typ*)ax_obj;

"p_ax_dat"...dynamic variable of the NC structure type"ax_obj"...valid memory address from the register function

In this way, the NC data structure is available for use to configure the NCobject or request status information in the application program.

Page 16: Tm445 Acopos Acp10 Software

Operating an Axis

Task: Registering the NC object "real axis"

Using this task, we want to get to know how to use the ncaccessfunction correctly.

Try executing the function in your controller task's Init SP and then check the function status.

If registered successfully, a dynamic variable (type "ACP10AXIS_typ") should be accessed on the NC data structure for the NC object ("real axis").

This makes the data from your drive object (parameter, stati) available in the application program.

Have a look at the corresponding dynamic structure variable ("Watch").

16 TM445 ACOPOS ACP10 Software

Page 17: Tm445 Acopos Acp10 Software

Operating an Axis

ACOPOS ACP10 Software TM445 17

The diagram shown above can now be completed. The parameters for the NC object ("axis") are available in the application program as a data structure in a logical way.

Fig. 12 Handling an NC object with ACP10, configuration using an NC data structure

Parameters (speeds, movement distances, etc.) for actions are set using this data structure before the NC Manager executes the command.

Page 18: Tm445 Acopos Acp10 Software

Operating an Axis

2.3 Executing commands

Executing the NC commands, as we know from the TM410 AsiM Basismodule, is done from the application task using the NC function ncaction.

2.3.1 NC function ncaction

Fig. 13 Automation Studio online help, parameters for the ncaction function

In the image above we see the list of function parameters for ncaction as they are shown in the Automation Studio online help documentation.

The procedure for setting the parameters for the function is extremely clear and easy. Which parameters are required?

nc_objectspecifies the NC object that the function should be applied to – the veryreference address that we received from the ncaccess or ncalloc function.

subjectspecifies the subject (subgroup) of the NC object where the function should be used, e.g. the controller, the encoder interface, etc.

actionthe action to be carried out e.g. initialization, start-up, etc.

Combining the subgroups (subjects) of the NC object with various actions results in many command possibilities. Take a look at the Automation Studio online help to see a complete list of subjects, actions and the possible combinations.

18 TM445 ACOPOS ACP10 Software

Page 19: Tm445 Acopos Acp10 Software

Operating an Axis

Fig. 14 Automation Studio online help, NC actions

Note:

As can be seen, there are actions with various priorities and a different action radius. For example, movement stop commands are given high priority, i.e. can interrupt other procedures if necessary. There are also internal actions that do not need to communicate with the NC operating system on the ACOPOS servo drive (e.g. reading message texts).

statusthe status of the function is given as a return value.

The following cases are possible:

the value "ncOK", the command was correctly received by the NC Manager

the value "ncACTIVE", the NC Manager was not able to receive the command (->Busy)

Error code, an error number that provides information about a faulty function parameter

After executing the ncaction function, the function status determines how further processing is handled in the program.

ACOPOS ACP10 Software TM445 19

Page 20: Tm445 Acopos Acp10 Software

Operating an Axis

2.3.2 Programming

There are certain processes taking place between the application task, NC Manager and the NC operating system on the ACOPOS servo drive that must be taken into consideration when executing a command using the ncaction function:

We control the ACOPOS servo drive using an application task, and can imagine the NC Manager as being an "intermediary" between the application program and ACOPOS servo drive.

Fig. 15 NC Manager as "intermediary"

With the NC function ncaction, we define a certain command in the application program and send it to the NC Manager. The function informs us if the command was able to be received using the status. The command is simply sent off and then we are no longer within the scope of the ncaction function.

Now let's assume that our command was received by the NC Manager and acknowledged ("ncOK"). It is then sent to the ACOPOS servo drive (NC operating system) via the network and executed there. This is the start of the physical process. The action is running and, in the next step, we have to wait for a response, such as:

...with the ncaction function, we have successfully ("status=ncOK") started a relative movement ("ncREL_MOVE,ncSTART") and are now waiting for the axis to reach the target position.

...we have started the controller ("ncCONTROLLER,ncSWITCH_ON") and are waiting for an indication that the controller has been switched on.

For this purpose, a corresponding status component can be found in the data for each subject or subgroup in the NC data structure. This is set to a specific value after successfully ending an action on the ACOPOS device (via the NC Manager).

20 TM445 ACOPOS ACP10 Software

Page 21: Tm445 Acopos Acp10 Software

Operating an Axis

For example, we could receive the following for our relative movement after the action has been carried out successfully:

"...move.basis.status.in_pos=ncTRUE"(immediately after calling the ncaction "ncFALSE")

or for successfully switching on the controller:

"...controller.status=ncON"(immediately after calling the ncaction "ncOFF")

We can request this information specifically in our application program and then decide what to do next.

The many command combinations that are made available to us by the ACP10 software result in a large number of parameters that must be set and status requests that must be made for the individual actions.

The Automation Studio online help will provide support here. It shows a detailed listing of all possible command combinations, separated into the individual subjects or subgroups.

Fig. 16 Automation Studio online help, subgroups and actions

In each subgroup, we find various information blocks and descriptions as well as another directory with the actions that are possible for the subject. For each action, we find complete information about the relevant parameters and status values.

ACOPOS ACP10 Software TM445 21

Page 22: Tm445 Acopos Acp10 Software

Operating an Axis

For example, take an action from the "Controller" subgroup, such as"Switch Controller On":

Fig. 17 Automation Studio online help, action "Switch Controller On"

On the right side of the help window, we find all the information we need to correctly integrate this action in our application program:

Fig. 18 Automation Studio help, action "Switch Controller On – Handling"

22 TM445 ACOPOS ACP10 Software

Page 23: Tm445 Acopos Acp10 Software

Operating an Axis

Function call:Shows how the ncaction function (to send an NC command) sets the parameters for the respective action.

Note:

The advantages of object-oriented parameters and clearly defined constants can be seen here."You program like you speak" "Switch on controller". This makes the program easier to read.

Parameter:Here, the elements from the NC data structure that are needed to set the parameters for the action are specified. Before executing the command using the ncaction function, these parameters must be set to the desired values in the NC data structure.

In our example, no special parameter settings are required, the controller just has to be switched on.

Example:

For the action to initialize the basic movement parameters ("ncBASIS_MOVE, ncINIT"), these parameters must be set tot he desired values in the NC data structure for the axis object, i.e. acceleration and speed values ("...movement.basis.parameter. ...").

Fig. 19 Automation Studio online help, basic movement parameters

With this action, these values (NC data structure on the controller) are initialized on the ACOPOS servo drive.

This entry refers to the parameters that we had to "prepare" in the NC data structure before executing the command.

ACOPOS ACP10 Software TM445 23

Page 24: Tm445 Acopos Acp10 Software

Operating an Axis

Conditions:There are certain conditions that must exist before an action can be started. For example, a relative movement doesn't make any sense before the controller has been started and a homing procedure has been carried out for the drive.

The dependencies, "When can what be done?", are not always clear. Therefore, the conditions for an action have been listed here.

For our action "Switch controller on", we have to check if the controller is ready using "...controller.ready" so that nothing is taken for granted. As we can see, the two hardware limit switches (positive and negative) are not permitted to be active at the same time.

Result:Shows the effects of the NC command, a short action description.

Status Display:As mentioned earlier, we need a status signal to monitor the process that we started by successfully executing the command (ncaction) on the ACOPOS servo drive (NC operating system). This signal is provided in the form of a status parameter in the corresponding element (subgroup) ofthe NC data structure. The NC Manager enters a value matching the actionstatus here.

For our case, we will see the value "ncON" for "...controller.status", after the action has been successfully executed and the controller is active.

Example:Additionally, a program routine is shown in the help for each command combination. The command lines are executed in the ANSI C programming language.

What information is offered here?

As we have seen, there is a certain sequence that we have to take into consideration in our application program when executing an action:

Wait for the necessary command conditions (requirements),

Set parameters for the relevant process values and execute the respective commands via the NC Manager,

Wait for a response from the process (the action on the ACOPOSservo module)

A control structure that is especially well-suited for managing these types of function sequences is the step sequencer.

24 TM445 ACOPOS ACP10 Software

Page 25: Tm445 Acopos Acp10 Software

Operating an Axis

Step sequencers allow the implementation of individual steps whose sequence can be determined by the use of a step index.

This program excerpt shows the execution of an action in the individual steps of the application program. Let's look at how the sequence can be handled in a step sequencer for the action "Switch on controller":

Fig. 20 Automation Studio online help, action "Switch controller on" – program example

The programming example shows an excerpt of a step sequencer; exactly the step we need for correct execution of our action. The sequence is controlled using the index variable "step", so let's assume that the action "Switch controller on" should be executed and the index variable was set to the value "W_CONTROLLER_READY".

In this step, the conditions for switching on the controller are checked. If the status value is correct, the index variable is used to automatically go to the next step. The conditions have been clarified, now the command canbe executed.

ACOPOS ACP10 Software TM445 25

Page 26: Tm445 Acopos Acp10 Software

Operating an Axis

Using the ncaction function, the command is sent to the NC Manager. As we already know, the function status provides information about if the command was received. Therefore, this step is repeated until this happens (Status "ncOK").

If this step is completed correctly, we move on to the next phase, monitoring the "physical process" on the ACOPOS servo drive. In this case, we wait until the controller has been switched on.

The inquiry now concerns the concrete status value in the data structure of the NC object ("real axis").

The NC actions in an application program are implemented in this way. In general, all actions can be executed according to this procedure.

Fig. 21 Carrying out an NC action

As an overview, we recommend taking time for a short look at the respective entries in the Automation Studio online help. You will quickly get a feeling for the implementation of the various actions. When doing so, it is important to become familiar with this uniform mechanism.

Note:

When carrying out consecutive actions, checking the conditions for the following step is often done together with the status check (completion) of the current step.

26 TM445 ACOPOS ACP10 Software

Page 27: Tm445 Acopos Acp10 Software

Operating an Axis

Task: Positioning routine

This task will help you practice processing commands for the ACOPOSin the application task using the ncaccess function.

1. A basic routine to prepare the drive for positioning commands will be created. Implement the following NC actions in the cyclic partof your control task using a step sequencer:

Check if the drive is ready (".network.init = ncTRUE" ?)

Global initialization ("ncGLOBAL, ncINIT")

Switch on drive controller ("ncCONTROLLER, ncSWITCH_ON“)

Homing the drive ("ncHOMING, ncSTART"). This should be done in homing mode "ncDIRECT".

After executing these actions, the process should end with a "waiting" step. Then the drive is ready for positioning commands. All errors on the drive can be acknowledged in advance in the NC test.

2. Expand the process by adding the following "positioning action":

Relative movement ("ncREL_MOVE, ncSTART")

Using a trigger variable, you can start this action in a targeted manner ("Watch"). After successfully completing the action, the program should return to the "waiting" step.

Note:

All procedures can be "tried out" in NC Test. Relevant parameters, actions and status data are represented in the testing environment.

Don't avoid this tool for testing command procedures before it has been integrated in your application program!

ACOPOS ACP10 Software TM445 27

Page 28: Tm445 Acopos Acp10 Software

ACP10 Example Task

3. ACP10 EXAMPLE TASK

In the following section, we will take a look at an example application that is included in the standard Automation Studio package. This application task contains most of the command procedures for single axis applications. We can use this program to continue with correct implementation of NC actions in a program and this example will also show us how these actions are placed in a sequence that makes sense and will function properly.

The example program should not be seen as a guideline, it is more to provide support and show an approach that makes sense.

The example project is found in the Automation Studio directory in"...\Samples\Motion\English\Acp10\acp10.pgp".

Task: Importing the ACP10 example task

This project contains tasks in two programming languages, AutomationBasic (AB) and ANSI C. Import the desired task in your project.

For a clear structure, the following segmentation can be made:

The program will include various routines.

In the Init subprogram, the NC object is registered ("real axis") and a few standard queries to check the version compatibility of the NC Manager and NC operating system on the ACOPOS servo module are carried out. Detailed information can be found in the Automation Studio online help:

Some parameters are also initialized.

The cyclic section of the program is blocked (jump to the end) if the axis is not registered correctly or the versions of the NC Manager and NC operating system are not compatible. If a special situation "Status=10600" exists when registering the NC object (axis), there is a special routine to read and acknowledge the respective error entry (more information about this will be given later). A permanent axis error inquiry takes place via the status entry "...monitor.status.error" in the NC data structure.

28 TM445 ACOPOS ACP10 Software

Page 29: Tm445 Acopos Acp10 Software

ACP10 Example Task

The heart of the application is the step sequencer where the handling of the individual NC actions takes place. The initialization step (switch controller on, homing, etc.) prepares the ACOPOS servo drive for operation, and then the action steps carry out the individual actions (e.g. movements).

Note:

The two terms initialization and action steps are only used here to provide a better overview. For programming purposes, they are completely identical. As mentioned in "2.3.2. Programming", the known steps are always needed.

Fig. 22 Carrying out an NC action

The continuity of the NC software operation is fully accommodated.

3.1 Initialization steps

What steps are needed to prepare the ACOPOS servo drive?

To prepare a drive for movement commands, the following must be true:

The drive controller must be switched on

The drive must be homed

Note:

As mentioned earlier, information about the requirements for the individual NC actions can be found in the Automation Studio online help.

ACOPOS ACP10 Software TM445 29

Page 30: Tm445 Acopos Acp10 Software

ACP10 Example Task

To guarantee complete initialization of the ACOPOS drive, certain steps and status inquiries must be included in the initialization section of the program.

In the example task, an initialization process will be shown that meets these requirements. The sequence of steps provides us with a simplified representation:

Wait for the "Network initialized" status. An inquiry is used to check if a global initialization is necessary.

If it does, the next action must switch off the controller. Then the global initialization can take place. The current parameter values in the NC structure (controller) on the ACOPOS servo module are initialized. Activation of Simulation Mode is carried out here in the example task, depending on the setting.

If global initialization is not necessary, then the "Switch controller on" phase is immediately started. It's necessary to check if the controller is ready, then the command to switch it on can be executed. After successfully completing this action, homing can take place.

Now the ACOPOS servo drive is ready for movement actions. The application is in a waiting step, the command step.

Fig. 23 Possible initialization process

30 TM445 ACOPOS ACP10 Software

Page 31: Tm445 Acopos Acp10 Software

ACP10 Example Task

3.2 Action steps

Actions (relative movements, absolute movements, etc.) can be carried out from the command step using various conditions (setting trigger variables).

Fig. 24 Action steps

Note:

Here, an "action" is not meant to only be a step in the step sequencer!Of course, certain steps must be carried out to process an action (check conditions execute commands wait for responses)

ACOPOS ACP10 Software TM445 31

Page 32: Tm445 Acopos Acp10 Software

ACP10 Example Task

In the example task, the program goes back to the command step after completing most actions. Of course, we have the possibility to vary the requirements as needed. For example, actions can be lined up directly one after the other or an action can be repeated periodically, any sequence is possible. Using the step sequencer and the object-oriented application of the ACP10 software, we can achieve a very clear structuring of the function process.

Task: ACP10 example task

In the example task, let's set up the ncaccess function so that the drive in your project is controlled by this task.

Try to implement the individual steps and actions in the program sequence and test the various functions.

32 TM445 ACOPOS ACP10 Software

Page 33: Tm445 Acopos Acp10 Software

Special Functions

ACOPOS ACP10 Software TM445 33

4. SPECIAL FUNCTIONS

In the following section, we will take a closer look at the special functions of the ACP10 software. In general, these functions are operated using the known systematic, but have a somewhat more complex relationship and should therefore be discussed in detail.

4.1 Transferring individual ACOPOS parameters

The service interface (NC data structure: "network.service") provides the user with read or write access to all parameters on the drive. This allows drive parameters that are not in the NC structure and cannot be set with an NC action or read by the NC manager to be set or read in the application task.

The relevant parameters for this action are found in the corresponding element ("...network.service") of the data structure for the axis object:

Fig. 25 Automation Studio online help, service interface parameters

The ACOPOS parameter that the action will "read" or "write" to isdetermined by the value "...service.request.par_id". (A listing of all ACOPOSparameters can be found in the Automation Studio online help.)

There are two different types of possibilities available for entering (when writing) or receiving (when reading) the parameter values:

Page 34: Tm445 Acopos Acp10 Software

Special Functions

Type 1:

The value for the parameter is at the address defined with "...network.service.data_adr". In this case, we have to use one of the following NC actions:

"ncSERVICE, ncREAD"

"ncSERVICE, ncSET"

A variable with the corresponding data type has to be available in theapplication task as source of the value (when writing) or target for the parameter value (when reading) for the operation. Before calling the NC action, the address of this variable has to be entered in "...network.service.data_adr".

Type 2:

The value of the parameter is entered in "...network.service.data_text" in text format (STRING): In this case, we have to use one of the following NC actions:

"ncSERVICE, ncREAD+ncDATA_TEXT"

"ncSERVICE, ncSET+ncDATA_TEXT"

The NC manager searches the parameter ID in the parameter list and creates a text from the parameter value (when reading a parameter) or a parameter value from the text (when setting a parameter).

34 TM445 ACOPOS ACP10 Software

Page 35: Tm445 Acopos Acp10 Software

Special Functions

ACOPOS ACP10 Software TM445 35

Note:

The NC manager identifies the data type of the ACOPOS parameter, and it is converted accordingly:

ACOPOS parameter data type

Input/output text ACOPOS parameter value

REAL “4.23“ 4.23

UDINT “4.23“

(only possible for input)

4

UDINT “17“ 17

STR32 “Motor-Identifier-Text“ “Motor-Identifier-Text“

Of course, complete operator information is also available for these actions. In the example of "ncSERVICE, ncREAD", we can see the correct procedure when using the service interface to read ACOPOS parameters from the example program:

Fig. 26 Automation Studio help, reading ACOPOS parameters - programming

Page 36: Tm445 Acopos Acp10 Software

Special Functions

In this case, the program example shows an excerpt from the step sequencer, the two steps needed for correct execution of the action. (The conditions for the action are considered to be met)

Step 1: Setting parameters, executing the command

Before calling the ncaction function, the desired ACOPOS parameter ID and the address of the task variables where the parameter value should be copied (-> read) are entered. After receiving feedback status value "ncOK", the next step is started.

Step 2: Waiting for a response

The response is received via the parameter "...service.response.par_id". If the NC command "ncSERVICE, ncREAD" was executed correctly, the value0 is entered here.

36 TM445 ACOPOS ACP10 Software

Page 37: Tm445 Acopos Acp10 Software

Special Functions

ACOPOS ACP10 Software TM445 37

As soon as the parameter value is available at the address we specified, i.e. read successfully, the Response ID from the NC Manager is set to the same value as the Request ID. If an error occurs, the value 65535 (FFFFh) is entered, the parameter could not be read.

Reading and writing parameters can also be integrated in the function in a flexible manner. All information that we need for correct handling of these functions is provided in the Automation Studio help.

Task: Transferring individual ACOPOS parameters

Implement the function for reading individual ACOPOS parameters in your control task.

4.2 Initialization of multiple parameters on ACOPOS

In addition to the ability to initialize individual parameters, the ACP10 software gives you extensive possibilities for initializing predefined parameter combinations. The initialization can be done either while booting the ACOPOS servo module, or during runtime (from the application task).

4.2.1 Initialization while booting ACOPOS

The NC deployment table is used to initialize predefined parameters while booting the ACOPOS servo module. As we saw already with the TM410AsiM Basis module, value assignments can be applied to the entire pallet of ACOPOS parameters in the ACOPOS parameter table. This predefined table can be assigned to the NC object "real axis" in the NC deployment table. This transfers the parameter values to ACOPOS during the booting procedure where they are applied (initialized) by the NC operating system.

Page 38: Tm445 Acopos Acp10 Software

Special Functions

4.2.2 Initialization during runtime

All other options involve an initialization of ACOPOS parameters during runtime, i.e. started by a program routine at a specific point in time.

How does it work?

Before (during the initialization of individual parameters in ACOPOS) we had only a single parameter with a specific value, but now we are dealing with a number of parameters with just as many values. To help with this, an intermediary has been created as a connection between the service interface („...network.service.data_adr“) and the configuration of ACOPOS parameters. A special data type ("ACP10DATBL_typ") is available for configuring the initialization.

Fig. 27 Configuring a data block

In the schematic above we see a simplified example of the procedure. On the right is the parameter configuration. Depending on the version, either an ACOPOS parameter table or a parameter array can be used.

The "ACP10DATBL_typ" basis variable requires additional settings.

38 TM445 ACOPOS ACP10 Software

Page 39: Tm445 Acopos Acp10 Software

Special Functions

Types

After calling up the NC action "ncACP10_PAR+ncSERVICE, ncDOWNLOAD" the parameters entered in an ACOPOS parameter table are individually transferred to ACOPOS and immediately initialized. The transfer takes place within the idle time task of the NC manager.

Note:

"Directly initialized" means that the parameter values are taken over immediately, and are therefore active right away.The download variant of an ACOPOS parameter table is especially useful when you need to switch back and forth between multiple predefined "parameter recipes".

In the "parameter list", the parameter configuration and the value assignment can be easily adjusted during runtime. There is an additional data type for this purpose that contains an element for the parameter ID and an element for the parameter value. Using this data type, you can create an array (-> list) in the task. Entries in this "list" can then be changed from the application program during runtime.

Fig. 28 Data array as parameter list

After calling up the NC action "ncPAR_LIST+ncSERVICE, ncINIT", all parameters in the parameter list, as for the ACOPOS parameter tables themselves, are transferred to ACOPOS and immediately initialized. Unlike the ACOPOS parameter tables, however, this transfer takes place within the cyclic NC manager task.

ACOPOS ACP10 Software TM445 39

Page 40: Tm445 Acopos Acp10 Software

Special Functions

Note:

Unlike the initialization variant, it's possible to change the parameters that are available, as well as their values, in the predefined ACOPOS parameter tables in the application program.

The "parameter sequence" uses the same array as the parameter list". Unlike the ACOPOS parameter tables or parameter lists, the parameters in the parameter sequence are not transferred individually, but as a data block. Once transferred to ACOPOS, they are not immediately initialized, but rather saved as a "recipe". The initialization takes place independent of the data transfer, and only after the command "initialize parameter sequence" is run. This command can be called up either right after the transfer or at a later time.

Using an index, it is also possible to place multiple parameter configurations together on the drive and initialize them selectively (very quickly).

Note:

Detailed information regarding the operation of these functions during program execution is available, as usual, in the Automation Studio online help.

40 TM445 ACOPOS ACP10 Software

Page 41: Tm445 Acopos Acp10 Software

Special Functions

4.3 Message management

The ACP10 software provides application-oriented message display and management. By linking a corresponding error text table (available in multiple languages), warnings or errors for the axis can be transferred for display as plain text in a multi-line character variable (two dimensional string or a structure of character elements). The structure element "message" in the NC data structure contains all necessary parameters for this purpose. If a value is exceeded (e.g. lag error stop limit), the corresponding value can also be determined.

Message management takes place using the two NC commands

"ncMESSAGE, ncTEXT" to determine the current message set

"ncMESSAGE, ncACKNOWLEDGE" to acknowledge the message set

Notes:

A complete approach for implementing message management is found in the ACP10 example task.

Additionally, the Automation Studio online help offers all of the information needed to operate this function. It also contains a list of all drive errors with the corresponding error numbers and a description of the error.

ACOPOS ACP10 Software TM445 41

Page 42: Tm445 Acopos Acp10 Software

Summary

5. SUMMARY

The ACP10 software provides an application-oriented and flexible user interface for creating positioning applications for the ACOPOS servo drives.

Fig. 29 Summary

The object-oriented structure of the NC software allows targeted access of the individual components (subgroups such as: controller, etc.) and their parameters. For this purpose, a data structure is provided that contains the corresponding status and parameter data for the respective NC object.

The command is executed by the NC Manager. After successfully completing an action ("physical process"), the corresponding status is returned using the NC data structure (entered by the NC Manager).

The processes can be clearly coordinated in the application program using a step sequencer. Answers to questions regarding the application and implementation of the individual NC actions can be found in the Automation Studio online help or in the ACP10 example project.

42 TM445 ACOPOS ACP10 Software

Page 43: Tm445 Acopos Acp10 Software

ACOPOS ACP10 Sof ware TM445 43

Summary

Overview of training modules

TM210 – The Basics of Automation Studio TM600 – The Basics of VisualizationTM211 – Automation Studio Online Communication TM610 – The Basics of ASiVTM213 – Automation Runtime TM630 – Visualization Programming GuideTM220 – The Service Technician on the Job TM640 – ASiV Alarm System, Trend and DiagnosticTM223 – Automation Studio Diagnostics TM670 – ASiV AdvancedTM230 – Structured Software GenerationTM240 – Ladder Diagram (LAD) TM700 – Automation Net PVI TM241 – Function Block Diagram (FBD) TM710 – PVI Communication TM246 – Structured Text (ST) TM711 – PVI DLL Programming TM250 – Memory Management and Data Storage TM712 – PVIServicesTM261 – Closed Loop Control with LOOPCONR TM730 – PVI OPC

TM400 – The Basics of Motion Control TM800 – APROL System ConceptTM410 – The Basics of ASiM TM810 – APROL Setup, Configuration and RecoveryTM440 – ASiM Basic Functions TM811 – APROL Runtime System TM441 – ASiM Multi-Axis Functions TM812 – APROL Operator Management TM445 – ACOPOS ACP10 Software TM813 – APROL XML Queries and Audit Trail TM446 – ACOPOS Smart Process Technology TM830 – APROL Project EngineeringTM450 – ACOPOS Control Concept and Adjustment TM840 – APROL Parameter Management and Recipes TM460 – Starting up Motors TM850 – APROL Controller Configuration and INA TM480 – Hydraulic Drive Control TM860 – APROL Library Engineering

TM865 – APROL Library Guide Book TM500 – The Basics of Integrated Safety Technology TM870 – APROL Python Programming TM510 – ASiST SafeDESIGNER TM890 – The Basics of LINUXTM540 – ASiST SafeMC

t

Page 44: Tm445 Acopos Acp10 Software

44 TM445 ACOPOS ACP10 Sof ware

Summary

Back cove numbe o pages d v s b e by 4

Con ac Headqua e s

Web nk

n e na ona y

Copy gh – Mode numbe

TM

44

5T

RE

.25

-EN

G0

90

2007

by

B&

R. A

ll ri

gh

ts r

eser

ved

.A

ll r

egis

tere

d t

rad

emar

ks

are

the

pro

pe

rty

of t

heir

re

spect

ive

ow

ner

s. W

e re

serv

e th

e ri

ght

to m

ake

tech

nic

al c

han

ges.

t