[go: up one dir, main page]

0% found this document useful (0 votes)
54 views98 pages

VE Programmierhandbuch En

The VECTONUM EMBEDDED Programming Manual provides guidelines for developing application-specific software modules (VE modules) for the ARADEX VECTONUM EMBEDDED operating system, primarily using C++. It outlines the requirements for readers, necessary software, and the development process, including module creation, I/O integration, and installation packaging. The manual serves as a comprehensive resource for both beginners and experienced developers in extending the functionality of the VE system.

Uploaded by

sebasnoceras97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views98 pages

VE Programmierhandbuch En

The VECTONUM EMBEDDED Programming Manual provides guidelines for developing application-specific software modules (VE modules) for the ARADEX VECTONUM EMBEDDED operating system, primarily using C++. It outlines the requirements for readers, necessary software, and the development process, including module creation, I/O integration, and installation packaging. The manual serves as a comprehensive resource for both beginners and experienced developers in extending the functionality of the VE system.

Uploaded by

sebasnoceras97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

VECTONUM EMBEDDED

Programming Manual
Development of VE application software – Manual version 2.1

Authors: MBartsch, THartmann


Last revised: Thursday, December 1, 2022 3:54:00 PM
Filename: VE_Programmierhandbuch_en.docx
Contents

Contents
1. Introduction ............................................................................................................4
1.1. Requirements for readers ...................................................................................... 4
1.2. Required software................................................................................................. 4
2. Basic information on the development of VE modules ..................................................5
2.1. What is a VE module? .......................................................................................... 5
2.2. Basic concepts ...................................................................................................... 7
2.2.1. Creation of the VE module with VECTOSTUDIO .............................................. 7
2.2.2. System structure of VECTONUM EMBEDDED ................................................ 16
2.2.3. VeCoreInterface runtime system ................................................................... 18
2.2.4. I/Os............................................................................................................ 18
2.2.5. Unit and drive modules ................................................................................ 22
2.2.6. System callbacks.......................................................................................... 25
2.2.7. Start behavior and debugging ...................................................................... 26
3. Advanced VE module development ......................................................................... 27
3.1. Use of dynamic memory areas ............................................................................ 27
3.1.1. Dynamically allocated data is prohibited ....................................................... 27
3.1.2. Stack use..................................................................................................... 27
3.2. Use of libraries ................................................................................................... 27
3.2.1. Mathematical functions ................................................................................ 28
3.2.2. The libVePlc library ...................................................................................... 31
3.3. Callback I/Os .................................................................................................... 34
3.4. Error handling in the VE module ......................................................................... 35
3.4.1. Use of ErrorGroups ..................................................................................... 36
3.5. CAN-BUS programming ..................................................................................... 39
3.5.1. Programming of RAW-CAN applications ....................................................... 39
3.5.2. Use of CANopen ......................................................................................... 43
3.5.3. Porting incompatible CanMatrix implementations .......................................... 52
3.5.4. Use of the serial interface (UART).................................................................. 57
3.6. Position control with P8 polynomials .................................................................... 58
3.7. Implementation of motor models ........................................................................ 63
3.8. Implementation of callback functions ................................................................... 64

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
2 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Contents

3.8.1. List of callback handlers ............................................................................... 64


3.9. Multi-axis support ............................................................................................... 70
3.9.1. VE unit modules........................................................................................... 71
3.9.2. VE drive modules ......................................................................................... 71
3.9.3. Callback functions with multi-axis support ..................................................... 71
3.9.4. The example application VpTwinDriveExample .............................................. 73
3.10. I/Os .................................................................................................................. 76
3.10.1. I/O types..................................................................................................... 76
3.10.2. I/O attributes............................................................................................... 80
3.10.3. Access to I/Os from other modules ............................................................... 83
4. Creating installation packages ................................................................................ 85
4.1. Integrating a compiled VE module....................................................................... 85
4.2. Creating an installation package for later downloading........................................ 87
4.3. Creating a VEART file for series production .......................................................... 89
5. VE internals........................................................................................................... 92
5.1.1. Implementation of callback handlers ............................................................ 92
6. Document history .................................................................................................. 96
7. Own notes ............................................................................................................ 97

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
3 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Introduction

1. Introduction
This document describes the development of application-specific software modules (VE modules)
for the ARADEX VECTONUM EMBEDDED (VE) operating system. The VE is used for inverters of
the VECTOPOWER-DM2 and VECTODRIVE-50 series.

The VE modules can easily extend the functionality of the basic firmware with application-specific
functions. These functions are integrated in the I/O concept of the VE system and can use all the
analysis interfaces of the basic firmware (ANALYSER and VE_CONFIG).

1.1. Requirements for readers


This manual discusses programming with the programming language C++. Readers must
therefore have a knowledge of programming with C++ or at least C.

In addition, readers should know how to use and parameterize the VE system. It is recommended
to read the VE user manual for this purpose.

1.2. Required software


VECTOSTUDIO is used as the programming environment. This development system, which is
based on the Equinox framework (Eclipse), ideally supports the developer with programming.

VE modules can be provided together with the VE firmware and the appropriate configuration file
in an integrated installation package. This allows the inverter system to be easily commissioned in
series production.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
4 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2. Basic information on the development of VE


modules
2.1. What is a VE module?
“VE module” is short for VECTONUM EMBEDDED module. This refers to a program created by
the user that adds application-specific functions to the basic firmware of the device. VE modules
developed for special application scenarios, for example, the CAN matrix module, can also be
obtained from ARADEX. Several modules can be installed on a VE device at the same time. The
function calls of the VeCoreInterface library (for system functions such as, e.g., the I/O
initialization or time functions) or the I/O interface are the interface to the basic firmware.

Using the I/O interface has the following advantages in an application:

• I/Os can be monitored and their values can be changed in VE_CONFIG


• I/Os can be logged in the ANALYSER
• I/Os allow direct access to the interface via external bus systems (e.g., CANopen or
VECTOBUS)
All VE modules used in the device must be present in the development system when the
installation package is created.

When the device is started, the VE basic firmware searches for VE modules that are present and
initializes them. This mechanism is encapsulated in the framework of the VE modules and does
not have to be implemented when a module is created. This makes it very simple to design your
own modules, and it can also be quickly mastered by beginners.

The preferred programming language for VE modules is C++. Programming can be done offline,
although a target device is necessary to test the application. The target system is connected with
the development computer via USB, serially, or via the CAN interface. The interface to be used
depends on the device configuration. VD50 devices are preferably programmed via the USB
interface and VECTOPOWER devices via the CAN interface. When the CAN interface is used, the
development computer must be equipped with a PEAK CAN USB adapter.

The development cycle can be basically divided into the following steps:

1. Connection of the hardware of the development system with the target device (optional)
2. Starting VECTOSTUDIO
3. Checking whether the VE API package installed in VECTOSTUDIO matches the device. If
not, the right package must be installed.
4. Creation of a new VE module using the ARADEX wizard

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
5 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

5. Creation of module-specific I/Os in the ios.h file


6. Initialization of the required I/Os in the basic firmware or VE modules already present in
the .cpp or .H file created by the wizard
7. Implementation of the required functions in the matching VE system callback in the
above-mentioned files.
8. Compilation of the module
9. If not present: Creation of an application configuration file (AppConfiguration.appconfig)
using the ARADEX wizard
10. Addition of the new module to the “AppConfiguration.appconfig” application
configuration file
11. Creation of an installation package and later installation via VE_CONFIG or direct
downloading to the target system
The newly created module becomes active after it is downloaded and the target device is
rebooted.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
6 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2. Basic concepts


After the VE module development has been discussed in general, the specific development of VE
modules will be shown in the following chapters using examples.

2.2.1. Creation of the VE module with VECTOSTUDIO


After VECTOSTUDIO has been installed on the development system, it has to be started (several
versions of VECTOSTUDIO can be installed in parallel). VECTOSTUDIO greets us with a welcome
screen. For our project, we now have to select a workspace or create a new workspace. A
workspace is a container in which our VE module is stored. A workspace can contain several
modules as well as configuration and parameter files.

We will now create a new workspace in which to store our projects. To do this, we click

Create a new workspace/Open an existing workspace

In the following dialog box, we select the memory location for our workspace. In the example,
this is “C:\vectostudio\workspace_example”.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
7 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

Clicking “OK” starts the creation of the new workspace.

To set up the appropriate build environment, the workspace type is then subsequently queried:

Here we select the entry “VECTONUM Embedded”.

After confirmation with “OK”, VECTOSTUDIO automatically closes and opens the newly created
workspace.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
8 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

When the workspace name or “Go to Workbench” is clicked, VECTOSTUDIO changes to


workspace mode.

VECTOSTUDIO now appears with an empty session, which we will fill with life step by step in the
following.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
9 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.1.1. Installing the API package


In the next step, it must be ensured that the API package installed in the VECTOSTUDIO matches
the firmware on the target device.
There is a suitable API package for each target device type and each firmware version!
An already installed package can be checked via the VECTOSTUDIO menu:

Project-> Show installed VE package

An Explorer dialog box opens that displays the installed package. If this does not match the target
hardware, a new package can be installed as follows:

Project-> Install VE API package

Notes:
The API package always contains the appropriate firmware. This can be extracted from the
package using the program 7-zip, for example, and loaded to the target system.

It is also possible to store the API package in the workspace. For this reason, the corresponding
build environment for the project is automatically installed when the workspace is opened. In
addition, the firmware version of the device is checked when it is downloaded from
VECTOSTUDIO. If the firmware version does not match the project, the device is updated.

2.2.1.2. Creating the VE module with the wizard


The project wizard is called via the

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
10 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

File -> New -> Project

menu item.

Now select “VECTONUM Embedded PLC Project” in the ARADEX Wizard folder and click the Next
button.

In the following dialog box, we select “HelloWorld” as Project name and “C++” as Programming
language. The check mark next to Use default location must remain set!

Finally, we exit the wizard by clicking the Finish button.

The project can now be opened in the Project Explorer window, and the source files
HelloWorld.h, HelloWorld.cpp, and HelloWorld_ios.h can be opened by double-clicking.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
11 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

The menu item

Project -> Build Project

is used to compile our project HelloWorld. This should be possible without an error message.

2.2.1.3. Adapting the configuration file to the target device


The VE module can now be basically executed, even though it does not have any special
functionality yet. In the first step, we will therefore load it to the target device to demonstrate its
basic functioning.

Next, the configuration/application/configuration folder has to be opened in the Project Explorer


(workspace) and then the file “AppConfiguration.appconfig”.

When the “Application Configuration” node is right-clicked in the file editor and “New Child” is
selected in the context menu that opens, the target platform is selected.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
12 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

Right-clicking the added device and selecting “New Child -> Firmware” adds the Firmware node.
When you open the context menu of the Firmware node, you can open a dialog box via “New
Child -> Module” in which our HelloWorld VE module can be added to the configuration.

Clicking OK finishes the configuration.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
13 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

Note:
Several VE modules can be added to the device configuration from the workspace in the same
way!

Finally, do not forget to save the modified configuration file with

“File -> Save”.

2.2.1.4. Downloading to the target device


To install our module on the target device, it is first necessary to create a connection to this
device. This can be done via the menu

“Online -> Connect”.

The Connect dialog box opens, in which the device has to be selected.

Clicking OK creates the connection.

The VE module can now be installed on the target device via the menu item

“Online -> Download”.

Confirm this selection with Yes in the dialog box that appears after the project is compiled.

The progress bar that appears shows the downloading status.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
14 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

Note:
VECTOSTUDIO checks the firmware version on the device. If the firmware version does not
match the API package used, the firmware of the device will be automatically adapted to the
version of the API package.

After the downloading is complete, the target system reboots and our module is active. This can
be checked via the I/O System_ModuleManager_ModulesFound. The I/O should contain the value
“1”.

We have now successfully created our first VE module and installed it on the target device.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
15 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.2. System structure of VECTONUM EMBEDDED


The VE system is based on the real-time operating system µCOS. This manages the various VE
tasks and is responsible for scheduling. The central clock-pulse generator is a timer interrupt that is
triggered by the FPGA of the device and synchronized with the current controller.

VE allows the VE module to tap into the cyclic calls of the following four tasks via callback
functions:

CoreTask ControlTask RtComTask NonRtThread


VE Task

Basic timer Control task with highest Communication task Non-real-time


Function

source for the VE priority. that can only be thread for lengthy
operating system. interrupted by calculations, for
ControlTask. example

Internal! For real-time-capable For real-time Blocking calls


Use

Only use after control and regulation communication, for possible.


consultation with tasks. An efficient, non- example, via CAN. Also used by VE.
ARADEX! blocking programming is Short blocking calls
necessary! are allowed.

OnCoreTaskUpd OnUpdateHwInput() OnUpdateRtComTa OnUpdateNonRtT


Callback functions

ate() OnUpdateControlMode() sk hread


OnPostUpdateControlMo
de()
OnUpdateControlOutput()
OnUpdateMain()
OnUpdateHwOutput()

In addition, there are also event-triggered callbacks, which are described in chapter 3.8.1.2.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
16 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.2.1. Time behavior of the VE tasks


The time behavior of the VE system tasks is shown sequentially in the following diagram.
VE Module

...
OnUpdateNonRtThread()
VE Idle Task

...
OnUpdateRtComTask()
NonRtThread

OnPostUpdateControlMode()

OnUpdateControlOutput()

...
OnUpdateControlMode()

OnUpdateHwOutput()
OnUpdateHwInput()

OnUpdateMain()
OnCoreTaskUpdate()

...
VE OSTasks
RtComTask

...
ControlTask

...
...
CoreTask

X+1

Figure 1- Time behavior

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
17 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.3. VeCoreInterface runtime system


VeCoreInterface is the interface between the VE operating system and the VE module.
VeCoreInterface is used to implement the system calls of the VE modules and to provide the
application framework. The main tasks of the interface are:

• Provision of the I/O interface


• Provision of the callback functionality
• Time functions
• Error management
• Access to the VE mathematics library of the firmware (instead of linking the math.h ->
memory savings for VE modules)

2.2.4. I/Os
I/Os are global variables in the VE system. They form the interface between modules and the VE
core system.

Parameterization, diagnosis, and debugging also take place via I/Os. They can be done with
VE_CONFIG or VECTOSTUDIO.

For a description of all I/O types and parameters, see chapter 3.10.

2.2.4.1. The I/O numbers


Each I/O has a unique number. This number is used to identify the I/O in general. Alternatively,
an I/O can also be identified by its name – the name, however, can change with a new firmware
version. The I/O number consists of a combination of the vendor ID, module ID, instance ID, and
number. The vendor ID and module ID are defined in the ios.h file. The instance ID is “0” for
device I/Os and drive I/Os of the first axis. Drive I/Os of the second axis have the instance ID “1”.

The “I/O Number Calculator” integrated in VE_CONFIG allows the I/O number to be quickly
determined via the IDs and vice versa.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
18 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.4.2. Creation of I/Os


I/Os are created in the VE system using predefined macros. This is done with the ios.h file. In our
example, the file HelloWorld_ios.h is directly created in the project by the wizard.

When the file is opened in the editor, it shows that there are already templates for the existing I/O
types. These should be used as the basis for one’s own I/Os.

The following I/O types exist:

Name Description Value range

IO_FLOAT 32-bit floating-point number -3.4E+38 to +3.4E+38


(accuracy 6 decimal
points)

IO_INT 32-bit integer with polarity sign -2147483648 to


2147483647

IO_UINT 32-bit integer 0 to 4294967295

IO_BOOL Boolean variable true/false

FIELD 32-bit integer that is used for enumeration. Depending on element


(IS_ENUM) definition

FIELD 32-bit integer, the individual bits of which can be Depending on element
(IS_BITMASK) assigned a Boolean variable. definition

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
19 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

IO_ARRAY_NEW String Any binary data

In addition to the four basic types, there are the following special forms:

Name Description

IO_TYPE_CB Callback I/O. A function must be transferred that checks the value before it is set
and if necessary prevents the setting or performs further calculations (e.g., other
parameters depending on the I/O value).

IO_TYPE_P A pointer can be transferred to the location of the data.

The definition of I/Os will be examined in more detail using the example of IO_UINT
System_Scheduler_Ctrl_ActDutyTime:

IO_UINT( System_Scheduler_Ctrl_ActDutyTime /*Name*/,( 63) /*Number*/,


"s" /*Unit*/, "%01.1f" /*Formatstring*/, 0 /*Default*/, 0 /*Min*/,
UINT32_MAX /*Max*/,-6 /*Exponent*/, 1 /*Scale*/, IO_IS_UNIT | IO_IS_HIDDEN
| IO_IS_OUTPUT /*Flags*/, "Actual control loop duty time"/*Description*/);

The parameters of the IO_FLOAT I/O macro have the following meaning:

Parameter Description Example

Name The name of the I/O. System_Scheduler_Ctrl_ActDutyTime

Number Consecutive I/O number; I/O number: 1052735


the I/O number results from Identifier: 1.1.0.63
the definition of the vendor Vendor ID = 1
ID, module ID, and Module ID = 1
instance ID. Instance ID = 0
Number = 63

Unit The basic unit shown in “s” - seconds


VE_CONFIG.

Format string Format string for display "%01.1f "


(e.g., hex) and digits

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
20 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

Default value Value after the system is 0


booted (for configuration
I/Os before the current
configuration is read out)

Minimum value Minimum 0

Maximum value Maximum UINT_MAX (corresponds to


4294967295)

Exponent Only used for display in For example, value in seconds,


VE_CONFIG. The value is display in microseconds (µs).
not shown as a raw value
but multiplied by the factor
10 exponent.

Scale Also for displaying the value In the example, 1.


in VE_ CONFIG. When a
scale is given, the raw value Could, however be used for speeds
from the VE system is for converting 1/s to rpm, for
divided by the scale. In example.
other words, raw value /
scale is shown.

Attribute The attributes define the Defines the I/O as IO_IS_UNIT,


characteristics of the I/O. IO_IS_HIDDEN, and
The meaning of the flags is IO_IS_OUTPUT.
described in chapter 3.10.2. The I/O is thus a device I/O that can
only be read. VE_CONFIG hides the
I/O in the I/O tree as standard.

Description A description of the I/O in VE_CONFIG shows


text form for the purpose of "Actual control loop duty time" as a
documentation. description.

2.2.4.3. Access to system I/Os


The VE system provides I/Os for controlling and configuring the device. These can be used in VE
modules like variables. For this purpose, it is necessary to initialize the I/O object in the
corresponding VE callback function.

In our project, the I/O object has to be declared in the header file HelloWorld.h:

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
21 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

CIoUnsignedIntegerReference m_io_ActCycleCounter;

This declaration creates an I/O object that can reference an I/O of the type IO_UINT. For the
compiler to be able to link our object with the VE I/O, the object must be initialized in the
function bool CHelloWorld::bInitIos() of the file HelloWorld.cpp.

bInitSuccess &= CVeCoreInterface::poGetInterface()->bInitIo(


&m_io_ActCycleCounter, System_Scheduler_Ctrl_ActCycleCounter_NUMBER);

Note:
If several I/Os have to be initialized, the readability of the source code can be improved by
assigning the pointer to the VeCoreInterface of a variable.

auto Intf = CVeCoreInterface::poGetInterface();


bInitSuccess &= Intf->bInitIo(
&m_io_ActCycleCounter, System_Scheduler_Ctrl_ActCycleCounter_NUMBER);

In the following, the I/O could be used in the cyclic update callback

void CHelloWorld::OnUpdateMain()

in the source code, for example.

uint32_t ui32ActCycleCounterSave = m_io_ActCycleCounter;

2.2.5. Unit and drive modules


VE offers support for multi-axis devices. Based on the I/O model, it is therefore possible to
distinguish between two types of I/Os:

1. Unit I/Os
2. Drive I/Os
Unit I/Os are present in the device once. Examples of this include the configuration of the
Analyser or the statistics I/Os (cycle time, task utilization etc.).

Drive I/Os, on the other hand, exist separately for each axis. Examples include the adjustment of
the position controller or the motor settings.

If you write your own VE module, it must be distinguished whether it is a unit or a drive module.
Depending on this, the framework of the application ensures the right I/O interface and the use of
the correct callback functions (some callback functions are only implemented for drive modules).

To distinguish among the I/Os, VE uses the instance number that is contained in the I/O number.
Unit I/Os and drive I/Os for axis 1 have the instance number “0”. Drive I/Os for axis 2, on the

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
22 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

other hand, have the instance number “1”. For further axes, the instance number would be
correspondingly increased.

2.2.5.1. The configuration range of the VE module


In our example, when we open the file HelloWorld.h, we find the configuration area of the VE
module after the include instructions.

/// configuration section ////////////////////////////////////////////////


///
#warning "Please adapt the configuration options and then remove this line!"
///
/// enable option with 1; disable it with 0
///
/// configuration options for drive modules
#define APP_IS_DRIVE_MODULE 0 ///< 0 for UNIT module; 1 for DRIVE
module
#define APP_DRIVE_NUMBER USE_DRIVE_0 ///< USE_DRIVE_0; USE_DRIVE_1
or USE_DRIVE_0|USE_DRIVE_1]
#define APP_USE_CONTROL_MODE_CB 0 ///< It enables the callback for
updating the actual control mode.
#define APP_USE_USER_MOTOR_MODEL_CB 0 ///< It enables the user motor model
callback.
#define APP_USE_POST_CRITICAL_CB 0 ///< It's called when a critical error
is raised.
#define APP_USE_PS_ENABLED_CB 0 ///< It's called when the drives
powerstage is switched on.
#define APP_USE_PS_DISABLED_CB 0 ///< It's called when the drives
powerstage is switched off.

///
/// general configuration for all modules
#define APP_USE_UPDATE_MAIN_CB 1 ///< The cyclic real time callback.
#define APP_USE_RESET_ERRORS_CB 1 ///< The reset error callback.
#define APP_USE_NON_RT_THREAD_CB 0 ///< The cyclic non real time callback.
#define APP_USE_RT_COM_TASK_CB 0 ///< The high priority communication
task callback.
#define APP_USE_CYCLE_TIME_CHANGED_CB 0 ///< The notification about changes of
the cycle time.
#define APP_USE_UPDATE_HW_INPUT_CB 0 ///< It's called after the hardware
input signals are updated.
#define APP_USE_CONTROL_OUTPUT_CB 0 ///< It's called before the current
setpoints are written to the current controller.
#define APP_USE_UPDATE_HW_OUTPUT_CB 0 ///< It's called before writing the
process data to the hardware.
#define APP_USE_READ_ABS_POS_CB 0 ///< It's called when the absolute
position is updated.
#define APP_USE_LOAD_DEFAULT_VALUES_CB 0 ///< It's called when all config-I/Os
are reset to their default values.
#define APP_USE_PRE_START_CB 0 ///< It's called before the real time
interrupt is started.
#define APP_USE_LVSUPPLY_READY_OK_CB 0 ///< It's called when the internal low
voltage supply is ready.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
23 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

#define APP_USE_LVSUPPLY_READY_FAIL_CB 0 ///< It's called when the internal low


voltage supply is off.
//
/// end of configuration section /////////////////////////////////////////

The application is configured via the corresponding #define instruction. The corresponding
option can be activated with a “1”. “0” deactivates this option.

An exception is the parameter APP_DRIVE_NUMBER. Here the valid options are USE_DRIVE_0 or
USE_DRIVE_1.

After the configuration of the module has been completed, the line

#warning "Please adapt VENDOR_ID and MODULE_ID and then remove this line!"

can be deleted. It has no functional meaning but merely indicates the necessary adjustment.

2.2.5.2. Creating a unit module


A unit module can be created by setting the option APP_IS_DRIVE_MODULE to “0”. This is also
the preselection in the framework. The options

• APP_IS_DRIVE_MODULE
• APP_DRIVE_NUMBER
• APP_USE_CONTROL_MODE_CB
• APP_USE_USER_MOTOR_MODEL_CB
• APP_USE_POST_CRITICAL_CB
• APP_USE_PS_ENABLED_CB
• APP_USE_PS_DISABLED_CB
are specifically for drive modules and can be left in the default setting (0).

When I/Os are created in the ios.h file, all the I/Os of a unit module must have the attribute
IO_IS_UNIT. The framework helps us here by using the definition APP_IO_IS_UNIT. Depending
on the module type, this is defined as IO_IS_UNIT for unit modules or as 0 for drive modules.

2.2.5.3. Creating a drive module


To create a drive module, the option APP_IS_DRIVE_MODULE is set to 1. In addition, it must be
decided whether the module is created for axis 1 or axis 2. Depending on this, the option
APP_DRIVE_NUMBER must be set to USE_DRIVE_0 or USE_DRIVE_1.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
24 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

2.2.5.4. Initializing drive and unit I/Os


Drive and unit I/Os have their own functions for I/O initialization. In the case of unit I/Os, no
instance number can be transferred.
Both functions receive the basic number of the I/O. This is defined in the file VeIoNumbers.h,
which was installed by the API package.

Example:
bInitSuccess &= CVeCoreInterface::poGetInterface()->bInitIo(&m_io_ActCycleCounter,
System_Scheduler_Ctrl_ActCycleCounter_NUMBER);

It is necessary to enter the instance number to initialize drive I/Os. This can be determined with
the function uiGetDriveNumber(). The first axis has the value “0” and the second axis the value
“1”.

Example:
bInitSuccess &= CVeCoreInterface::poGetInterface()-->bInitIo( &m_io_P0KpD,
Drive_CurrentControl_Config_P0_KpD_NUMBER, uiGetDriveNumber() );

2.2.6. System callbacks


If necessary, functions in the module can be called within the block cycle in the case of special
events. The time of the call is given in Figure 1- Time behavior.

Note:
Cyclic queries (so-called “polling”) of system I/Os in the main part of the application are a poor
alternative to using callback functions. In the case of cyclic queries, it is also impossible to
specifically manipulate particular functions of the VE core, e.g., the motor model.

Since the definition of the callbacks is a complex matter, this task is performed by the framework.
The framework already contains all the definitions and the function bodies of the VE callback
functions. To minimize the module memory usage, the used callbacks first have to be activated in
the configuration section of our VE module (see chapter 2.2.5.1).

Our HelloWorld module uses the following callbacks:

Name Function Note

virtual bool bDoCreateIos() Creation of module-specific Hidden by the I/O macros; is


I/Os in the VE system. not directly called.

virtual bool bInitIos() Initialization of I/Os that are If an I/O cannot be initialized,
provided by the VE system or false must be reported back.
other modules

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
25 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Basic information on the development of VE modules

virtual void OnUpdateMain() Cyclic call of the module Called by the VE system from
the control task; real-time
capable!

virtual void OnResetErrors() Resetting of errors Executed when the “Clear


Error” function is called.

The starting point for one’s own programs is normally the function OnUpdateMain(). In chapter
3.8.1 you will find a more detailed description of all callback functions. The ARADEX project team
is also happy to advise you if you have questions regarding the implementation of a specific
application.

2.2.7. Start behavior and debugging


VE checks various hardware functions upon starting and initializes the necessary I/Os. If the
hardware initialization fails or an I/O cannot be referenced, the system will start in emergency
mode. The current status of the system is shown by the “APP” symbol in VE_CONFIG in the status
line under “Device Status”. If this is red, the system is in emergency mode.

However, especially in VE module development, a programming error can cause a system


exception to be called. Usually this concerns access to non-installed IoReference objects. The
system is then rebooted via the watchdog timer.
To avoid automatically entering an endless reboot loop after a faulty rebooting, a multi-stage
recover mechanism is implemented. The current status is indicated by the Information_BootState
I/O. In addition, the Information_GlobalError_CrashHandlerActive error is displayed. The following
recover stages are implemented:

Recover stage Status of the Information_BootState I/O

Normal system start OK_Normal or OK_FirmwareIsUpdated

System start without VE modules ERR_ModulesSkipped

System start with default parameters and ERR_ParametersSkipped


without VE modules

System start without FPGA, with default ERR_BackupSystemActive


parameters and without VE modules

If the system does not start, the following points should be checked first in the program code:

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
26 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

• Does the API package match the firmware/device?


• Access to non-initialized IoReference variable
• Division by zero
• Endless loop in the OnUpdateMain() function
If there are malfunctions in the VE module, intermediate results and statuses should be stored in
I/O variables. These can then be logged online in the VE_CONFIG or as a real-time trace via the
Analyser function.

3. Advanced VE module development


3.1. Use of dynamic memory areas

3.1.1. Dynamically allocated data is prohibited


The use of commands for creating and releasing dynamic storage, such as, e.g., new(),
delete(), malloc(), and free(), is not supported by the VE system and is forbidden. This is
due on the one hand to the limited resources of the microcontroller that is used. In addition, real-
time capability cannot be guaranteed when these commands are executed.

It is therefore necessary to define data as member variables of a class or as global variables.

3.1.2. Stack use


The individual VE tasks use separate stacks. The stacks of the tasks that are relevant for VE module
programming have the sizes that are given in the following table and can be controlled via the
following I/Os:

Task name Stack size in bytes I/O name


(entries * sizeof(int32_t))

ControlTask 1024*4 System_OS_Task_Control_Stack

RtComTask 512*4 System_OS_Task_RTCom_Stack

3.2. Use of libraries


C and C++ libraries can be used within the VE modules. A whole series of useful libraries are
supplied with the VE-API package. You can use them in your own program code. In many cases, it
is also possible to use the standard C libraries that are supplied with the compiler. However, it is
important to keep track of the size of the resulting program at the same time. Individual functions

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
27 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

such as, e.g., the formatting of strings (e.g., sprintf(…)) lead to greatly larger programs. C++
exceptions are not supported.

For example, the mathematical library should not be integrated via #include<cmath>; instead,
the functions of the VE firmware should be shared via the CVeMath object of VeCoreInterface.

3.2.1. Mathematical functions


Mathematical functions should be used as follows:

1. Bringing the pointer to the mathematics interface CVeMath of the VE firmware


2. Calling the VE-internal mathematical function via the object pointer
Example: Calling the sine function

m_sIos.MyApp_IoFloat = CVeCoreInterface::poGetInterface()->poGetVeMath()-
>sin(2.0 * fPi * fFrequency * m_fActTime)

The following functions are provided by CVeMath:

Trigonometric functions

float double

float cos(float x) double cos_dbl(double x)

float sin(float x) double sin_dbl(double x)

float tan(float x) double tan_dbl(double x)

float acos(float x) double acos_dbl(double x)

float asin(float x) double asin_dbl(double x)

float atan(float x) double atan_dbl(double x)

float atan2(float x, float y) double atan2_dbl(double x, double y)

Exponential and logarithmic functions

float
double

float exp(float x) double exp_dbl(double x)

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
28 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

float log(float x) double log_dbl(double x)

float log10(float x) double log10_dbl(double x)

float log2(float x) double log2_dbl(double x)

Exponential functions

float double

float pow(float x, float y) double pow_dbl(double x, double y)

float sqrt(float x) double sqrt_dbl(double x)

Rounding and residual functions

float double

float mod(float x, float* intpart) double mod_dbl(double x, double* intpart)

float fmod(float x, float y) {return 0;}

float ceil(float x) double ceil_dbl(double x)

float floor(float x) double floor_dbl(double x)

float round(float x) double round_dbl(double x)

float abs(float x) double abs_dbl(double x)

Unlike with C/C++, float is assumed as the default data type, since this is supported by the
mathematical coprocessor of the microcontroller. The use of double variables is not
recommended, since this causes the program to have a significantly worse runtime behavior.

The VeMath library also already contains the definitions for frequently used mathematical
constants.

Definition Description Value

VE_M_E Constant e 2.7182818284590452354

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
29 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

VE_M_LOG2E log2(e) 1.4426950408889634074

VE_M_LOG10E log10(e) 0.43429448190325182765

VE_M_LN2 ln(2) or loge(2) 0.693147180559945309417

VE_M_LN10 ln(10) or loge(10) 2.30258509299404568402

VE_M_PI Circle constant π 3.14159265358979323846

VE_M_TWOPI 2π (VE_M_PI * 2.0)

VE_M_PI_2 π/2 1.57079632679489661923

VE_M_PI_4 π/4 0.78539816339744830962

VE_M_3PI_4 ¾π 2.3561944901923448370E0

VE_M_SQRTPI √π 1.77245385090551602792981

VE_M_1_PI 1/π 0.31830988618379067154

VE_M_2_PI 2/π 0.63661977236758134308

VE_M_2_SQRTPI 2/√π 1.12837916709551257390

VE_M_SQRT2 √2 1.41421356237309504880

VE_M_SQRT1_2 1/√2 0.70710678118654752440

VE_M_LN2LO long double exact value of loge 1.9082149292705877000E-10


(2) LOW component

VE_M_LN2HI long double exact value of loge 6.9314718036912381649E-1


(2) HIGH part

VE_M_SQRT3 √3 1.73205080756887719000

VE_M_IVLN10 1/loge(10) 0.43429448190325182765

VE_M_INVLN2 1 / ln(2) 1.4426950408889633870E0

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
30 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.2.2. The libVePlc library


The libVePlc library comprises control-specific functions. These include, e.g., trigger and filter
functions. A description of the parameters is found in the header file of the respective class.
The most important classes are briefly introduced in the following tables.

Instruction for integrating the Functions.h file from libVePlc:

#include <libVePlc/Functions.h>

3.2.2.1. General functions


Name of the class Description

CTrigger and Triggers for numbers and Boolean signals


CBoolTrigger

CFifo First-in-first-out buffer

CList Double-linked list

CMatrix Matrix class for mathematical equations

Oscillation.h Functions for generating square-wave, triangular, and sawtooth


signals

3.2.2.2. Motion profiles


Name of the class Description

CPosition Class for position calculation with improved resolution

CMoveSinusSimple Simple sinusoidal setpoint generator

CMove and CAccelerationRamp Complex setpoint generator with configurable starting and
stopping ramps

CMoveRectangular Already configured setpoint generators with identical


CMoveSinusoidal starting and braking ramp (square-wave, sinusoidal, P6,
CMoveP6 P8, and trapezoidal acceleration)
CMoveP8
CMoveModifiedTrapezoidal

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
31 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.2.2.3. Filter functions


The VE module VeFilterLowPass for demonstrating a low-pass filter can be found on the
VECTOSTUDIO welcome screen under the heading

Examples –> Examples from the VE programmer's manual.

Name of the class Description

CFilter This is the abstract basic class of all filters. Use this class to
derive your own filter classes.

CFilterAvg Mean value filter over a configurable number of values

CFilterAvMax Filter that limits acceleration and speed; the end position is
always reached.

CFilterAvMaxSpeed Extension of CFilterAvMax; when the nominal speed is


reached, the motion is continued with this speed.

CFilterBandpass2 Bandpass 2nd order

CFilterBandpass2Constantinides Bandpass 2nd order using the so-called Constantinides


transformation

CFilterBandRejection2 Band elimination filter 2nd order

CFilterBessel2 Frequency filter 2nd order with optimum “rectangular


transmission behavior”

CFilterBiquad2 Biquadratic filter 2nd order

CFilterDamp Damping filter for damping characteristic frequencies at a


position

CFilterDamp2 Damping for damping characteristic frequencies at a position;


simplified implementation that uses a low-pass filter

CFilterDifferentiator Filter that shows the derivation of a signal

CFilterHighPass1 High-pass 1st order

CFilterLead1 Lead value filter with phase correction

CFilterLowPass1 Low-pass 1st order

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
32 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

CFilterLowPass2Vibratory Low-pass filter for vibration damping

CFilterLuenberger Luenberger observer filter for a linear state space

CFilterObserver2Mass Observer for a 2-mass system.

CFilterObserver2MassRk Observer for a 2-mass system using the Runge-Kutta


algorithm

CFilterObserveracc Observer for acceleration and speed using a measured


acceleration signal.

CFilterOscillationDetection Determines amplitude and phase of an oscillating signal.

CFilterPid PID filter (only P, I, and D component)

CFilterPid2 PID filter like CFilterPid but additionally with low-pass filter
for the D component.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
33 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.3. Callback I/Os


In VE, I/Os are the means of choice to save configuration parameters. If a parameter is changed
during the runtime, the system has to be notified. One possibility is to cyclically query a
parameter and execute the corresponding action when it is changed. However, this procedure
has the disadvantage that it could require a great deal of computing time if there is a lot of data.

A solution to this is provided by so-called callback I/Os. When a callback I/O is defined, a pointer
is transferred to a function that is called before the value changes. This then allows further
calculations to be initiated or the value to be checked for plausibility.

Callback I/Os are available for all I/O types except for arrays. These are identified in the I/O
configuration by the suffix _CB.

Example:

BEGIN_FIELD(MyApp_IoEnum)
ELEMENT ( 1, Enum1, "Testing I/O enum value 1")
ELEMENT ( 2, Enum2, "Testing I/O enum value 2")
ELEMENT ( 3, Enum3, "Testing I/O enum value 3")
ELEMENT (10, PostError, "Post 'MyApp_IoBitmaskError.Error0'")
END_FIELD_CB(MyApp_IoEnum, bCallback_IoEnum, (4), "", "%d", 1, 1,
10, 0, 1, IO_IS_INPUT | IO_IS_OUTPUT | IO_IS_ENUM | APP_IO_IS_UNIT,
"Testing I/O enum with callback");

In the example, the entry bCallback_IoEnum is an indicator for the callback function. For
implementation reasons, this function must be declared before the ios.h file is included. The
function also has to be defined as static.
The instruction BEGIN_FIELD must not be given the suffix _CB!

/**
* Add I/O callback functions here
*/

/**
*
* @param puiValue Pointer to the new value
* @param pIo Pointer to the I/O
* @param pThis Pointer to the module instance
* @return True if new value is valid, otherwise false
*/
static bool bCallback_IoEnum(uint32_t* puiValue, CIoUnsignedInteger* pIo,
void* pThis);

/**
* Begin I/O handling
*/
#define IO_FILE "HelloWorld_ios.h"

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
34 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

#include <libIoInterface/Macros/IoDefinitions.h>
/**
* End I/O handling
*/

The keyword static means that this function can be called even without instantiation of the
object. This has the consequence that the VE module object can no longer be directly accessed
from the callback function.

For this reason, the THIS macro has been introduced, which provides the pointer for our object.

bool CHelloWorld::bCallback_IoEnum(uint32_t* puiValue, CIoUnsignedInteger*


pIo, void* pThis)
{
if (*puiValue == EMyApp_IoEnum::PostError)
{
// raise an error and send it to the VE error log
// for accessing non static members the THIS macro must be used!
CVeCoreInterface::poGetInterface()->PostError(
&THIS->m_sIos.MyApp_IoBitmaskError,
EMyApp_IoBitmaskError::Error0);
return false; // setting this value is forbidden
}
return true; // the new value is valid
}

This trick makes it easy to call the member variables and methods of our module. It must only be
noted that this has to be declared as public.

3.4. Error handling in the VE module


In VE there is a central error logging mechanism that is responsible for saving error information in
the EEPROM as well as transferring information to VE_CONFIG, for example. The VE modules can
be informed of the reset error result via the callback function OnResetErrors().

Errors are displayed as Boolean values. They can be mirrored either directly on an I/O of the
IO_BOOL type or on individual bits of an IO_UINT. The I/O name or the name of the bit of an
IO_UINT I/O is used as the error name in the display of VE_CONFIG.

BEGIN_FIELD(IoErrorBitmask)
ELEMENT(0, Error0, "Error 0 comment")
ELEMENT(1, Error1, "Error 1 comment ")
END_FIELD(IoUIntBitmask, (4) /*Number*/, "" /*Unit*/, "%d"
/*Formatstring*/, 0 /*Default*/, 0 /*Min*/, UINT32_MAX /*Max*/, 0
/*Exponent*/, 1 /*Scale*/, IO_IS_OUTPUT | IO_IS_BITMASK | IO_IS_ERROR |
IO_IS_MSG_APPLICATION_USER | APP_IO_IS_UNIT /*Flags*/, "Testing error I/O"
/*Description*/);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
35 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

For our I/O to become an error I/O, the attribute IO_IS_ERROR must be given. If the attribute
IO_ERROR_IS_CRITICAL is also given, the enabling of the inverter will be automatically switched
off when an error is triggered.

If an I/O is only to be a warning, the attribute IO_IS_WARNING must be used.

In the case of an error or warning I/O, the corresponding ErrorGroup category should also be
specified. Here you indicate the assignment to the individual collective error groups. A description
of the attributes is found in chapter 3.4.1.1.

Errors and warnings can be triggered by the PostError() function.


If you want to trigger an error that lies on an IO_UINT, the bit number has to be given as well:

CVeCoreInterface::poGetInterface()->PostError(&m_sIos. DemoErrorUInt,
EDemoErrorUInt::MyErrorBit);

For errors that are directly represented by an IO_BOOL, the value 0 is transferred as the
parameter.

CVeCoreInterface::poGetInterface()->PostError(&m_sIos. DemoErrorBool, 0);

Errors are reset globally in the VE system via the OnResetErrors() callback. Errors must not be
reset automatically. The VE module must make sure that internal module errors are only deleted
in the OnResetErrors() method.

Warnings can reset themselves. If the warning is no longer current, the I/O or the bit can be set to
false.

3.4.1. Use of ErrorGroups


In most cases, errors and warnings must be evaluated by a higher-level control. Such a control can
be connected to the device via the CAN bus system, for example. However, if all possible errors
were forwarded to the higher-level control, this would require a great deal of programming. In
addition, if the error messages were expanded in VE, this expansion would also have to be
immediately implemented in the master control. To simplify development, ErrorGroups were
therefore developed. As described above, each error is assigned to a category. When the
PostError() function is called, the attribute of the respective category is automatically set by the
error handler. The following logic holds here:

• Device errors and axis errors have identical categories. The same holds true for warnings.
• A device error is also signaled in parallel for each axis.
• However, an axis error is not shown for the device, in order to prevent a further axis from
going into an error state as well).

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
36 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

• The first error that occurs is saved in the ErrorGroup_Drive_ErrorNumber_Id I/O. The
corresponding error bit (0 for IO_BOOL errors) is in the
ErrorGroup_Drive_ErrorNumber_Param I/O.
To check an axis for errors, it is therefore sufficient to evaluate your ErrorGroup.

Note:
A list of all errors can be obtained by exporting the error definition list of the device via the menu
item

Tools -> Development -> Export Error I/Os …

in VE_CONFIG. This error list also contains the errors of all loaded VE modules.

3.4.1.1. Description of the ErrorGroup I/Os


Device I/O Drive I/O Description

ErrorGroup_Device_Error ErrorGroup_Drive_Error Contains the bits for the individual


error categories

ErrorGroup_Device_Warning ErrorGroup_Drive_Warning Contains the bits for the individual


warning categories; the categories
for warnings and errors have an
identical structure.

ErrorGroup_Device_ ErrorGroup_Drive_ I/O number of the first error that


ErrorNumber_Id ErrorNumber_Id occurred; this is set to 0 in the case
of a ClearError command.

ErrorGroup_Device_ ErrorGroup_Drive_ I/O parameter of the first error that


ErrorNumber_Param ErrorNumber_Param has occurred; in the case of
IO_UINT, the bit number of the
error bit; this is set to 0 in the case
of a ClearError command.

The ErrorGroup I/Os (ErrorGroup_Device_Error, ErrorGroup_Device_Warning,


ErrorGroup_Drive_Error, ErrorGroup_Drive_Warning) are organized as bit registers. The following
table lists the name of the bit as well as the I/O attribute that can be added to an error or warning
I/O.

Bit name Attribute of the I/O Description

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
37 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

General IO_IS_MSG_GENERAL Group error; this is


automatically selected if no
ErrorGroup attribute is defined.

ControlLimit IO_IS_MSG_CONTROL_LIMIT A control error has occurred.

MotorLimit IO_IS_MSG_MOTOR_LIMIT Error due to a motor limitation.

MotorTemperature IO_IS_MSG_MOTOR_TEMPERATURE Temperature limit of the motor


has been reached.

DeviceTemperature IO_IS_MSG_DEVICE_TEMPERATURE Temperature limit of the


inverter has been reached.

PowerSupply IO_IS_MSG_POWER_SUPPLY Error in the low-voltage supply

PowerStage IO_IS_MSG_POWER_STAGE Error in the high-voltage supply

Encoder IO_IS_MSG_ENCODER An encoder error has occurred.

Communication IO_IS_MSG_COMMUNICATION A communication error has


occurred.

System IO_IS_MSG_SYSTEM A VE operating system error has


occurred.

TechnologyFunction IO_IS_MSG_TECHNOLOGY_FCT An error in a technology


function has occurred.

ApplicationUser IO_IS_MSG_APPLICATION_USER An error in an application


function (e.g., in VE_Modul).

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
38 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.5. CAN-BUS programming


VE has an integrated CANopen stack but also supports RAW CAN communication. An example of
this is the Can_Matrix technology module, which establishes a communications channel to the VE
device via predefined telegrams.

3.5.1. Programming of RAW-CAN applications


A correctly configured VE system is the prerequisite for using the CAN bus. The baud rate and, in
the case of VECTOPOWER devices, the correct termination must be set.

Note:
In the VECTOSTUDIO welcome screen,

Examples -> Examples from the VE programmer's manual

contains the example VeCanPingPong to demonstrate a RAW CAN application.

The RtComTask task is responsible for communication via CAN in the VE system. It runs with a
high priority and can only be interrupted by the ControlTask (control).

VE internally uses two differential prioritized FIFO buffers to send outgoing messages:

1. The PDO FIFO is reserved for real-time messages. It is forwarded by the VE system to the
CAN controller with high priority.
2. The SDO FIFO is intended for service messages. It is larger than the PDO FIFO buffer and
is also used for communication with VE_CONFIG, for example.
The priority of the sending can be influenced via the System_CanBus_RealTimePriority I/O. The
following settings are possible:

System_CanBus_RealTimePriority

OFF Messages are alternately sent from the PDO


and SDO FIFOs.

LOW After two PDO messages, an SDO message is


sent.

NORMAL After three PDO messages, an SDO message is


sent.

HARD After four PDO messages, an SDO message is


sent.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
39 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

If an FIFO does not contain any data, the other respective FIFO is sent as long as the CAN
controller can receive data.

Received messages are picked up by the CAN controller and stored in an input buffer. This takes
place at the beginning of each RtComTask cycle. Each module can read the complete buffer and
process the received CAN messages. The contents of the receive buffer are deleted at the end of
the communication cycle of the RtComTask.

VE Device Message
integrated CAN Receive
Controller List

CAN_bGetNewCanMsg(..)

CAN_bSendCanMsg(Msg,
eCanPrioSDO);

CAN_bSendCanMsg(Msg,
eCanPrioPDO);

PDO-FIFO
SDO-FIFO

VE Device
integrated CAN
Controller

Figure 2 – VE CAN communication

It is necessary to use the so-called owner ID to access the filters and the message functions. This
identifies the module in relation to the VE kernel and can be freely selected in principle.
However, it is recommended to generate this ID based on the vendor ID and the module ID so
that it is the same throughout the entire system.

m_ui2CanOwnerId = Intf->poGetVeIoExtensionCardInterface()->
CAN_uiGetOwnerId(
VE_VID_Development, MY_MODULE_ID);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
40 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

If you want to parameterize the filters of the internal CAN controller at a later time, the owner ID
is noted and the VE module can selectively delete its own filters as well later on.

const auto Intf = CVeCoreInterface::poGetInterface()-


>poGetVeIoExtensionCardInterface();
Intf->CAN_ResetFilters(m_ ui2CanOwnerId);
Intf->CAN_bSetFilterIdOnly(m_ ui2CanOwnerId, m_ui32CanOpenSdoRxId);

Instead of directly programming the filter for an identifier, it is also possible to set a mask. The
function for this is:

bool CAN_bSetFilterIdRange(
uint32_t uiOwnerId,
uint32_t uiCanId,
uint32_t uiMask,
bool bIsExtendedId = false,
bool bIsRtr = false,
uint32_t uiFifo = 0 );

The mask defines which bits have to be set in the CAN identifier. The parameter bIsExtendedId
indicates whether 9-bit or 11-bit identifiers are used.

The bIsRtr and uiFifo parameters can be used to cover special applications. Normally, the
default specifications should be used here (do not enter parameters).
If the function yields the message false, the filter has not been set. This could be because all
available filters have already been used. In this case it is possible to switch off all the filters.

If the filters are to be set so that all messages are received on the CAN bus, the function

CAN_EnableAllIdFilter(uint32_t uiOwnerId)

must be called.

The next step could be the reception of CAN messages within the VE module. In this case, the
following must be observed:

If a CAN message with a particular identifier is checked for (CAN_bGetNewCanMsg(…, CAN_ID)),


this message will be deleted from the receive buffer. Other modules will therefore not receive this
message. If the message is to be available in the receive buffer for other modules, the value
UINT32_MAX must be transferred as the identifier. The application must query the buffer until the
desired ID is reported back or the receive buffer is empty (return value of the function is then
false).

A pointer to a structure of the CVeIoExtensionCardInterface::CAN_RX_MSG type must be


transferred to the receive function. The receive data is copied to this structure.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
41 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

CVeIoExtensionCardInterface::CAN_RX_MSG sCanRxMessage;
if (CVeCoreInterface::poGetInterface()->poGetVeIoExtensionCardInterface()-
> CAN_bGetNewCanMsg(m_u32iCanOwnerId, &sCanRxMessage,
m_ui32CanOpenSdoRxId))
{
… process m_CanRxMessage
}

or

while (CVeCoreInterface::poGetInterface()-
>poGetVeIoExtensionCardInterface()-> CAN_bGetNewCanMsg(m_u32iCanOwnerId,
&m_CanRxMessage, UINT32_MAX))
{
if (m_CanRxMessage.StdId == m_ui32CanOpenSdoRxId )
{
… process m_CanRxMessage
}
}

The following program code could be used to send messages:

auto pExtCardIntf = CVeCoreInterface::poGetInterface()-


>poGetVeIoExtensionCardInterface();
uint32_t ui32SendTime = CVeCoreInterface::poGetInterface()->ui32GetTime();
while( !pExtCardIntf->CAN_bSendCanMsg(&m_CanTxMessage,
CVeIoExtensionCardInterface::eCanPrioPDO))
{
if(CVeCoreInterface::poGetInterface()-
>ui32GetElapsedTime(ui32SendTime) > 20*1000 )
{
return false;
}
}
return true;

In this example, the program tries to send the message until VE can save the new telegram in its
output buffer. If this is not possible within 20 ms, an error is reported back.

For a clearly organized program code, it is advisable to manage the send and receive data in a
structure. The structure can then be mapped onto the byte array with the user data via “casting”.

struct MyCanMsg {
uint8_t ui8Cmd;
uint16_t ui16Object;
uint8_t ui8Si;
int32_t i32Value;
} __attribute__((packed));

MyCanMsg* psMsg = reinterpret_cast<MyCanMsg *>( sCanRxMessage. Data);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
42 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

psMsg->ui8Cmd = 0x23;

3.5.2. Use of CANopen


VE has an integrated implementation of the CANopen protocol. If VE_CONFIG is connected with
the VE device via the CAN interface, the communication will take place via the CANopen
protocol, for example.

CANopen can be advantageous in respect to the application as well. In addition to the possibility
of reading and writing the I/Os of the system via SDO access, dynamically configurable transmit
and receive PDOs (TPDO, RPDO) are also integrated. The PDOs can be configured via an
external tool (e.g., the CANopen DeviceExplorer from Emtas) or by directly setting the
configuration I/Os.

Note:
For configuring external CANopen devices, a so-called EDS file is required. This can be created
via VE_CONFIG. For this purpose, the menu item

Tools -> Development -> Export CANopen electronic data sheet (EDS) file...

has to be called.

3.5.2.1. Configuration settings of the CANopen protocol


The CANopen protocol in the VE system can be configured via various I/Os. A summary is shown
in the following table. In the CANopen standard, 4 transmit and 4 receive PDOs can be used per
node address. If more PDOs are needed, additional node addresses must be used.

I/O name Description

System_CanBus_CanOpen_NodeId Node address of the CANopen device; valid


values are 1 to 127. The value 255 stands for
not configured. In this case, an LSS master
(e.g., VE_CONFIG) can assign a node address.

System_CanBus_CanOpen_ Time interval for transmitting the heartbeat; if


HeartBeatProducerTime no node address is assigned (value=255), no
heartbeat is transmitted.

System_CanBus_CanOpen_InitialNmtState CANopen network management (NMT): State


that the device is to assume after booting; if the
value is set to Operational, the device will start
to transmit and receive PDOs independently.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
43 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

System_CanBus_CanOpen_NmtState Current NMT state of the device.

System_CanBus_CanOpen_PdoCfg_Obj1400 Receive PDO configuration 1 to 4


System_CanBus_CanOpen_PdoCfg_Obj1401
System_CanBus_CanOpen_PdoCfg_Obj1402
System_CanBus_CanOpen_PdoCfg_Obj1403

System_CanBus_CanOpen_PdoCfg_Obj1600 Receive PDO mapping parameter (maximum


System_CanBus_CanOpen_PdoCfg_Obj1601 of 8 different SDO objects possible)
System_CanBus_CanOpen_PdoCfg_Obj1602
System_CanBus_CanOpen_PdoCfg_Obj1603

System_CanBus_CanOpen_PdoCfg_Obj1800 Transmit PDO configuration 1 to 4


System_CanBus_CanOpen_PdoCfg_Obj1801
System_CanBus_CanOpen_PdoCfg_Obj1802
System_CanBus_CanOpen_PdoCfg_Obj1803

System_CanBus_CanOpen_PdoCfg_Obj1A00 Transmit PDO mapping parameter (maximum


System_CanBus_CanOpen_PdoCfg_Obj1A01 of 8 different SDO objects possible)
System_CanBus_CanOpen_PdoCfg_Obj1A02
System_CanBus_CanOpen_PdoCfg_Obj1A03

3.5.2.1.1. Structure of the configuration parameter


Bit Bit Bit Bit 56..63 Bit Bit Bit Bit Bit Bit Bit
80..8 72..7 64..7 48..5 40..4 32..39 24..3 16..2 8..1 0..
7 9 1 5 7 1 3 5 7

Sync Event timer Compatibilit Inhibit time Trans- COB-ID used by PDO
coun- (ms) y entry (1/10 ms) missio
ter n type

COB-ID used by PDO:


The CAN identifier under which the message is received or transmitted

Transmission type:
Indicates whether the message is to be transferred cyclically or in relation to the SYNC signal.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
44 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Examples:
255 -> The timing of the “Event Timer” entry is valid
1 -> Send the TPDO each time that a SYNC telegram is received.
10 -> Send the TPDO at every 10th SYNC signal.

Inhibit time:
Minimum time between two PDO events.

Compatibility entry:
Not used; prescribed in the standard only for reasons of compatibility.

Event timer:
The transmission interval of the transmit PDO in milliseconds

Sync counter:
Number of SYNC events until the TPDO is sent.

Example:

Entry Value

COB-ID 0x00000181 (385)

Transmission type 0xFF (255)

Inhibit time (1/10 ms) 0x0 (0)

Compatibility entry 0x0 (0)

Event timer (ms) 0xA (10)

Sync counter 0x1 (1)

Display in VE_CONFIG (starts with byte 0):

System_CanBus_CanOpen_PdoCfg_Obj1800 = 0x81 0x01 0x00 0x00 0xFF 0x00 0x00 0x00


0x0A 0x00 0x01 0x00
Note: The last byte of the array is not used and is only for the 4-byte alignment of I/Os with the
attribute IO_IS_CONFIG

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
45 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.5.2.1.2. Structure of the mapping parameter


Byte Byte Byte Byte Byte Byte Byte 4..7 Byte 0..3
28..31 24..27 20..23 16..19 12..15 8..11

Object 8 Object 7 Object 6 Object 5 Object 4 Object 3 Object 2 Object 1

An object entry has the following structure:

Byte 3 Byte 2 Byte 1 Byte 0

Object number (SDO number) Subindex Number of bits of the data from the SDO object

Important:
A maximum of 8 I/Os with a total length of 64 bits can be parameterized for each PDO.
If, for example, two float variables or integer32’s (bit length 32) are used, the PDO will
already be completely occupied.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
46 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Example:

Object number (index: Length I/O name


subindex) (bits)

0x2401:22(0x16) 32 (0x20) System_Scheduler_Core_ActCycleCounter

0x2401:112(0x70) 1 (0x1) System_Info_BlinkerFast

Display in VE_CONFIG (starts with byte 0):

System_CanBus_CanOpen_PdoCfg_Obj1A00 = 0x20 0x16 0x01 0x24 0x01 0x70 0x01 0x24


0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00

3.5.2.2. SDO assignment to VE I/O number


The VE I/Os are stored in the manufacturer-specific area of the CANopen object dictionary. The
following assignment applies:

SDO index Byte 1 Byte 0

0x2000 + F E D C B A 9 8 7 6 5 4 3 2 1 0
SDO index

VE I/O-ID xx Vendor ID Instance ID Module ID

SDO subindex Byte 0

Bit number 7(6)5 4 / 2 10

VE I/O-ID Number + 1

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
47 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Symbolic name Description VE SDO


Vendor ID Vendor ID Vendor
ID

Reserved CANopen communication 0 – not 0


available

VE_VID_ARADEX_ VECTONUM EMBEDDED core system 1 1


VeCore

VE_VID_ARADEX_ VE driver modules for extension cards 2 2


VeDrivers produced by ARADEX.

VE_VID_ARADEX_Ve Technology modules that are part of the VE 3 3


TechnologyModules system.

VE_VID_ARADEX_ ARADEX applications 4 4


Application

VE_VID_ARADEX_ Example modules that are part of the VE 5 5


VeSamples system.

VE_VID_ARADEX_ Modules for the unit test of the core system 6 6


VeTests and VE modules

VE_VID_MAXONIC_ Reserved for ARA-C 100 8


Drivers

VE_VID_MAXONIC_ Reserved for ARA-C 101 9


Application

VE_VID_RESERVED_ Customer-specific IDs 1000 … 10 … 14


COSTUMER1 … 5 1004

VE_VID_Development Vendor ID for developing own VE modules. 4095 15

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
48 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Note:
The integrated I/O number calculator in VE_CONFIG is a great help for finding the correct ID.

3.5.2.3. Example VE module for implementing the CAN matrix using the
CANopen protocol
The VE module “CANmatrix” implements the ARADEX CAN matrix using the CANopen protocol.
A great advantage of this method is that the data to be transmitted can be easily changed or
expanded compared with the Can_Matrix module.

The interface is described in the document


CANMatrix_VECTOPOWER_DM2_ab_Firmware_3.2.14.pdf
(and subsequent versions).

Figure 3: The CAN matrix interface

Note:
In the VECTOSTUDIO welcome screen, under

Examples -> Examples from the VE Programmer's manual,

the example CANmatrix discussed in the following can be installed as a VE project.

The CCANmatrix class is the main class of the application and is also responsible for sending the
unit-specific CAN messages. In addition, the drive objects of the CCANmatrixMessage class are
instantiated here. These manage the reception of the control data and transmit the drive-specific
status messages.

To keep the bus load low, the I/Os are scaled and optimally mapped to the CAN messages.
This is done via additional I/O variables that are created by the module.

Example: VP_Control from the CCANmatrix class

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
49 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

The file CANmatrixDefinitions.h contains the description of the control word as a structure
declaration

union CANopen_Controla
{
struct
{
//Control Byte 0
struct
{
uint8_t Enable : 1; ///< Enable Drive
uint8_t ControlMode : 3; ///< 0=disabled; 1=speed;
/// 2=torque; 3=current;
/// 4=f/U 7=DCDC;
uint8_t DigiOut : 4; ///< digi out 0..3

} __attribute__ ((__packed__)) m_sControl_Byte0;

//Control Byte1
struct
{
uint8_t SendId : 1; ///< request sending VP_INFO_DEVICE
uint8_t ResetErrors : 1;
uint8_t ExtendedMode: 1;
uint8_t ReservedB1 : 5;
} __attribute__ ((__packed__)) m_sControl_Byte1;

//Control Byte 2+3


int16_t SetPoint1;
///< setpoint speed / torque / current_d /
/// output_freq depending from ControlMode
}__attribute__ ((__packed__));
uint32_t ui32Value;
};

union CANopen_Controlb
{
struct
{
/// Control Byte 4+5
int16_t SetPoint2; ///< setpoint for limp mode /../ current q /
/// output_voltage

// Control Byte 6+7


int16_t SetPoint3;
}__attribute__ ((__packed__));
uint32_t ui32Value;
};

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
50 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

These structures are described in the function

CCANmatrixMessage::UpdateControlMode(
CANopen_Controla& sControla,
CANopen_Controlb& sControlb)

with the corresponding I/O values and are assigned to the I/Os CANmatrix_Controla and
CANmatrix_Controlb.

These I/Os can be mapped on a PDO that is automatically sent by the CANopen stack of the VE
device. This is done in the function CCANmatrixMessage::DefineReceivePDOs().

CCANmatrixMessage::DefineReceivePDOs()
{
if (m_i_CANmatrix_DisableDrive2 && uiGetDriveNumber()== 1)
{
return;
}

m_poCANopenHelpers->bSetPdoCfg(
(uiGetDriveNumber()== 0 ?
&System_CanBus_CanOpen_PdoCfg_Obj1400 :
&System_CanBus_CanOpen_PdoCfg_Obj1404),
m_poCANopenHelpers->ui32GetIdentifier(eDataId_VP_Control,
uiGetDriveNumber()),
0, 0, 0, 0 //< not used for RPDOs
);

m_poCANopenHelpers->bSetPdoMappingParameter(
(uiGetDriveNumber()== 0 ?
&System_CanBus_CanOpen_PdoCfg_Obj1600 :
&System_CanBus_CanOpen_PdoCfg_Obj1604),
&m_sIos.CANmatrix_Controla, 0);

m_poCANopenHelpers->bSetPdoMappingParameter(
(uiGetDriveNumber()== 0 ?
&System_CanBus_CanOpen_PdoCfg_Obj1600 :
&System_CanBus_CanOpen_PdoCfg_Obj1604),
&m_sIos.CANmatrix_Controlb, 1);
}

The query uiGetDriveNumber()== 0 is used to test whether it is a Drive0 or a Drive1 object,


and the appropriate PDO is selected correspondingly.

The parameter ui32EntryNumber of the function bSetPdoMappingParameter(…)

bool CCANopenHelpers::bSetPdoMappingParameter(
CIoDataArrayReference<uint32_t>* pioArray,
CIo* pIo,

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
51 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

uint32_t ui32EntryNumber)

determines to which SDO subindex entry the mapping parameter is to be written (0 ->
subindex1, …, 7 -> subindex 8).

For the CANmatrix module to independently start transmitting, the VE parameter


System_CanBus_CanOpen_InitialNmtState must be set to “Operational”.

If CAN messages for drive 2 are not needed, they can be deactivated by setting the parameter
CANmatrix_DisableDrive2.

3.5.3. Porting incompatible CanMatrix implementations

3.5.3.1. Changes in comparison to VE versions < 3.1.9.0


In earlier VE versions, the VE module had direct access to the hardware of the integrated CAN
controller. Since the newly developed parameter communication via the CAN bus had to take
place independently of the VE module used, the management of the CAN interface was moved to
the VE kernel. The kernel performs the following functions:

• Initialization of the CAN interface


• Management of the CAN baud rate
• Management of the CAN filter
The CAN messages are no longer sent and received through a direct hardware access. Internal
output and input buffers have been introduced as an interface to the application. The hardware
access is managed by the VE kernel. This makes it possible to query a CAN telegram in several
modules, for example.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
52 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.5.3.1.1. Comparison with the functions from


VeIoExtensionCardInterface.h
Old function New function Comments

enum E_CAN_BAUD_RATE Eliminated I/O System_CanBus_BaudRate

CAN_Init(E_CAN_BAUD_RAT Eliminated Management by VE kernel


E) eBaudrate)

Not present virtual uint32_t The ID must be used as a


CAN_uiGetOwnerId(uint32 function parameter to read the
_t uiVendorId, uint32_t reception list from different
uiModuleId)
modules and to manage the
filters.

Not present enum Priority for sending CAN


ECAN_MessageSendPriorit messages.
y{ There is the SDO and the
PDO buffer. Depending on
eCanPrioSDO = 0, //<
the
SDO data, send with
System_CanBus_RealTimePriori
lower priority via
ty I/O, the following strategy is
buffer
selected (send PDO/send
eCanPrioPDO = 1, //< SDO):
PDO data, send as fast
as possible via buffer OFF: 1/1
LOW: 2/1
eCanPrioHardware = 2, NORMAL: 3/1
//< Blocking call until HARD: 4/1
the message has been
sent With eCanPrioHardware, the
sending is done immediately
eCanPrioMax (timeout = 10 ms). The
//< Internal value, RtComTask is blocked for this
don't use it!}; duration.

virtual bool virtual bool See also


CAN_bSendMessage(CAN_TX CAN_bSendCanMsg(CAN_TX_ MessageSendPriority
_MSG *pMessage) MSG *pMessage, uint8_t
ui8Prio)

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
53 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Old function New function Comments

virtual bool virtual bool ui32ID = UINT32_MAX


CAN_bGetMessage(CAN_RX_ CAN_bGetNewCanMsg( delivers every received
MSG *pMessage, uint32_t uint32_t uiOwnerId, message. The message stays in
ui32ID) CAN_RX_MSG*pMessage,
the reception list for other
uint32_t ui32ID =
UINT32_MAX) modules. If querying is done
with an ID, the message is
deleted from the list.

typedef struct {…} Eliminated Management by VE kernel; see


CAN_FILTER; functions for setting the filter.

virtual void virtual bool Sets the filter to a defined CAN


CAN_SetIdFilter(uint32_ CAN_bSetFilterIdOnly( ID
t uiFilterNo, uint32_t uiOwnerId,
CAN_FILTER *pFilter, uint32_t uiCanId,
bool bEnable) bool bIsExtendedId =
false,
bool bIsRtr = false,
uint32_t uiFifo = 0 )

Not present virtual bool Sets the filter mask, for


CAN_bSetFilterIdRange( example:
uint32_t uiOwnerId,
uint32_t uiCanId, Can_bSetFilterIdRange(m
uint32_t uiMask, _ui32CanOpenOwnerId,
bool bIsExtendedId = 0x600, 0x7F, false,
false, false, 1); // Receive
bool bIsRtr = false, SDOs (0x600..0x67F ;
uint32_t uiFifo = 0 ) mask 0x7F =
1100xxxxxxx) HW CAN
FIFO1

Can_bSetFilterIdOnly
(m_ui32CanOpenOwnerId,
0x7E5, false, false,
1); // Receive
LSS Master ID 0x7E5 -
HW CAN FIFO1

virtual void virtual void Parameterizes the filter to


CAN_SetReceiveAllMessag CAN_EnableAllIdFilter(u receive all CAN IDs.
esFilter(); int32_t uiOwnerId)

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
54 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Old function New function Comments

Not present virtual void Deletes the filters of all


CAN_DisableAllIdFilter( modules.
)

Not present virtual void Deletes all filters set by the VE


CAN_ResetFilters(uint32 module (with the same
_t uiOwnerId) uiOwnerId).

3.5.3.2. Porting using a CAN implementation as an example

3.5.3.2.1. Setting the baud rate and removing the CAN_Init()


Program parts for setting the baud rate and removing the CAN_Init()! For example:

CVeIoExtensionCardInterface::E_CAN_BAUD_RATE eGetBaudrate(uint32_t
uiBaudrate);
m_poExtCardInterface->CAN_Init(eGetBaudrate(m_sIos.CanMatrix_BaudRate));

The function is now the responsibility of the VE kernel. Do not forget to remove the
corresponding I/Os from the file ios.h.

Instead of this, an ID must be obtained for receiving messages and setting filters:

m_uiCanOwnerId = CVeCoreInterface::poGetInterface()
->poGetVeIoExtensionCardInterface()->CAN_uiGetOwnerId(
VE_VID_ARADEX_VeTechnologyModules, VE_MID_TechnologyModule_CanMatrix);

It is recommended to use VENDOR-ID and MODULE-ID as parameters for the function.

3.5.3.2.2. Sending messages


The function for sending messages must be adapted:

m_poExtCardInterface->CAN_bSendMessage(&CanTxMessage);

becomes

m_poExtCardInterface->CAN_bSendCanMsg(&CanTxMessage,
CVeIoExtensionCardInterface::eCanPrioPDO);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
55 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Instead of eCanPrioPDO, you can also use eCanPrioSDO. For SDO messages, the internal buffer
is larger. However, PDO messages have priority for sending.
The enclosing while{} loop should be eliminated. Firstly, the kernel now contains an output
buffer that is independent of the CAN controller, and secondly, this loop would otherwise slow
down the VE operating system as well. It is better to check whether a message has been sent, and
if this is not possible, to try sending it again in the next cycle.

3.5.3.2.3. Receiving messages


To receive messages, the initially obtained uiCanOwnerID is required as an additional function
parameter.

m_poExtCardInterface->CAN_bGetMessage(&CanRxMessage,0x110);

becomes

m_poExtCardInterface->CAN_bGetNewCanMsg(m_uiCanOwnerId, &CanRxMessage,
0x110);

3.5.3.2.4. Filter settings


The previous parameterization of the filter via a struct is replaced by an interface function.

CVeIoExtensionCardInterface::CAN_FILTER CanFilter;
CanFilter.uiStdId = 0x100;
CanFilter.uiExtId = 0;
CanFilter.bIDE = false;
CanFilter.bRTR = false;
m_poExtCardInterface->CAN_SetIdFilter(1, &CanFilter, true);

becomes

m_poExtCardInterface->CAN_bSetFilterIdOnly(0x100);

Note:
The filters may only be set once, or they must be deleted via CAN_ResetFilters(uint32_t
uiOwnerId) before being reset. Without this deletion, the filter would be entered multiple times
and thus waste valuable hardware resources.

3.5.3.3. Porting of derivatives of the CanMatrix VE standard module


The already ported version of the module is found in the release index. To keep the porting as
simple as possible, the basic class CCan_Matrix_Base() has been introduced.

ATTENTION:
The member variables

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
56 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

uint32_t m_uiCanOwnerId
bool m_bUseExtendedIdentifier
uint32_t m_ui32CanID

may only be declared in the basic class CCan_Matrix_Base() and must be removed from the
message classes. If this is forgotten, the message could be transmitted with the identifier 0x0, for
example.

3.5.4. Use of the serial interface (UART)


In the case of VD50 devices, the serial interface of the display module and the serial interface of
the communication card can be accessed from a VE module.

The following data structures should be created for accessing the interface:

CVeIoExtensionCardInterface* m_uartExtiface;// the pointer of UART


VeIoExtensionCardInterface::UART_CONFIG m_uart_config; //configuration of
the serial interface

The interface must then be configured:

m_uart_config.eParityBit =
CVeIoExtensionCardInterface::EParityBit::Parity_No ;//no parity
m_uart_config.eStopBits =
CVeIoExtensionCardInterface::EStopBits::StopBits_1;//1 stop bit
m_uart_config.uiBaudrate = 115200;
m_uartExtiface = CVeCoreInterface::poGetInterface()-
>poGetVeIoExtensionCardInterface();
m_uartExtiface -> UART_Init(m_uart_config);

The data is transmitted via the following function:

uint8_t szHelloWorld =“HelloWorld!\r\n“;


m_uartExtiface->UART_bSendBuffer(szHelloWorld, sizeof(szHelloWorld));

Before the receipt, it first has to be checked whether new data is present. If new data is present, it
is copied to a buffer:

enum { MAX_RX_DATA_SIZE = 32 };
ui8Buffer[MAX_RX_DATA_SIZE];
ui8RxCounter = 0;
while(m_uartExtiface->UART_bDataReceived())
{
m_uartExtiface->UART_bReceiveByte(&ui8Buffer[ui8RxCounter++]);
if (ui8RxCounter >= MAX_RX_DATA_SIZE)
{
break;

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
57 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

}
}

3.6. Position control with P8 polynomials


Using a positioning motion as an example, it will be shown which steps are necessary to
implement one’s own motion profiles.

Since this example already has a high complexity, the example “P8Move” in source code should
also be considered parallel to this chapter. This can be installed in the VECTOSTUDIO welcome
screen – Examples category – under “Examples from the VE programmer's manual”. Only
important aspects of the program are explained in the following.

The wizard is used to create the project with the name P8Move.
The header files for the setpoint generator (Move.h) and the PID filter (FilterPid.h) must be added
to the application framework.

#include <libVePlc/FilterPid.h>
#include <libVePlc/Move.h>

The setpoint generator and the control circuit object are defined as member variables as follows:

NMove::CMoveP8 m_oMove;
NFilter::CFilterPid m_oControlPos;

The application framework is configured next. We select the following options (deselected options
are not listed in the example):

/// configuration options for drive modules


#define APP_IS_DRIVE_MODULE 1
#define APP_DRIVE_NUMBER USE_DRIVE_0
#define APP_USE_CONTROL_MODE_CB 1
#define APP_USE_POST_CRITICAL_CB 1
#define APP_USE_PS_DISABLED_CB 1
/// general configuration for all modules
#define APP_USE_UPDATE_MAIN_CB 1
#define APP_USE_RESET_ERRORS_CB 1
#define APP_USE_CYCLE_TIME_CHANGED_CB 1
#define APP_USE_PRE_START_CB 1

Our example is to implement the function for drive 1. Since we are performing calculations for
the control circuit of the drive, it is important to call these in the OnUpdateControlMode()
callback function. This is the only way to make sure that the new setpoints are processed by the
current controller in the same cycle.

The initialization of required I/Os, which has to take place in the bInitIos() function, will not
be discussed here in further detail.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
58 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Since the setpoint generator and the control circuit filter depend on the cycle time, we initialize
them in the OnPreStart() callback function. This callback is triggered by the VE kernel once
before the block cycle starts.

void CP8Move::OnPreStart()
{
m_oControlPos.Reset(0.0);
m_oMove.Reset();
SetFilterParameters();
}
void CP8Move::SetFilterParameters()
{
m_fCycleTime = tMax<float>(m_io_fNominalCycleTime.GetValue(),
FLT_MIN);
m_oControlPos.SetCycleTime(m_fCycleTime);
m_oControlPos.SetCoefficients(
m_sIos.PosCtrl_Drv_Kp,
m_sIos.PosCtrl_Drv_Tn,
m_sIos.PosCtrl_Drv_Tv);
m_oMove.SetCycleTime(m_fCycleTime);
}

In addition, our objects have to be initialized and the control circuit parameters must be set. To
ensure that the cycle time and the control parameters are also copied when changes occur during
the running time, we use callback I/Os and the VE callback function. This makes sure that the
event-controlled transfer of information is ensured over the changed cycle time.

P8Move_ios.h:
IO_FLOAT_CB(PosCtrl_Drv_Kp, bCallback_SetPidParams , 4, "", "%.3f"
, 0 , -FLT_MAX , FLT_MAX , 0, 1 , IO_IS_INPUT | IO_IS_CONFIG,
"Proportional factor");
IO_FLOAT_CB(PosCtrl_Drv_Tn, bCallback_SetPidParams , 5, "", "%.3f"
, 0 , -FLT_MAX , FLT_MAX , 0, 1 , IO_IS_INPUT | IO_IS_CONFIG,
"Integral time");
IO_FLOAT_CB(PosCtrl_Drv_Tv, bCallback_SetPidParams , 6, "", "%.3f"
, 0 , -FLT_MAX , FLT_MAX , 0, 1 , IO_IS_INPUT | IO_IS_CONFIG,
"Differential time");
P8Move.cpp
/*static*/ bool CP8Move::bCallback_SetPidParams(float* pfValue, CIoFloat*
pIo, void* pThis)
{
pIo->SetValueInternal(*pfValue);
THIS->poGetControl()->SetCoefficients(
THIS->m_sIos.PosCtrl_Drv_Kp,
THIS->m_sIos.PosCtrl_Drv_Tn,
THIS->m_sIos.PosCtrl_Drv_Tv);
return true;
}

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
59 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Note:
The THIS macro is used to access member variables of our VE module class from the static
function. It is defined by the wizard as reinterpret_cast<CP8Move*>(pThis)

The position setpoints and the new current setpoint for the output stage are finally calculated in
the OnUpdateControlMode handler. In most cases, it is a good idea to check the set control
mode of the device. This prevents the position control of our VE module from being already
activated during the commutation, for example.

void CP8Move::OnUpdateControlMode(SUpdateControlModeParams* psParams)


{
m_oMove.Update();
m_sIos.PosCtrl_Position_NomPos = m_oMove.dGetCurrentPosition () ;
m_sIos.PosCtrl_Position_ActAcc = m_oMove.dGetCurrentAcceleration () ;
m_sIos.PosCtrl_Position_ActSpeed = m_oMove.dGetCurrentSpeed () ;

// The module is intended to use with ControlMode::Current


if (psParams->bEnable && psParams->uiControlMode ==
EDrive_ControlMaster_Act_CtrlMode::EDrive_ControlMaster_Act_CtrlMode_Curre
nt)
{
//calculate position deviation
m_sIos.PosCtrl_Drv_Deviation = m_sIos.PosCtrl_Position_NomPos -
m_io_Drive_ControlMode_Position_ActPos;
m_sIos.PosCtrl_Drv_Output =
m_oControlPos.fUpdate(m_sIos.PosCtrl_Drv_Deviation);
psParams->fSetpoint1 = m_sIos.PosCtrl_Drv_Output
* m_io_Drive_CurrentControl_SetMaxCurrent;
// no D-current is used for this example!!!
psParams->fSetpoint0 = 0.0;
UpdateSupervision(m_sIos.PosCtrl_Drv_Output);
}
else
{
// control is off
m_oMove.SetCurrentPosition(
m_io_Drive_ControlMode_Position_ActPos);
m_sIos.PosCtrl_Drv_Deviation = 0.0f;
m_sIos.PosCtrl_Drv_Output = 0.0f;
psParams->fSetpoint0 = 0.0f;
psParams->fSetpoint1 = 0.0f;
}
}

The sequence logic of the program (e.g., start and stop of the movement command) is
implemented in the OnUpdateMain() callback function. This ensures that the control algorithms
are processed as quickly as possible and the time period between the reading of the position

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
60 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

encoder values and the output of a new current setpoint is as short as possible. This also decreases
the idle time of the control path, which leads to a higher control accuracy.

void CP8Move::OnUpdateMain()
{
// start command and motor stands still
if (m_sIos.PosCtrl_Position_MoveRel &&
!m_sIos.PosCtrl_Position_IsMoving
{
if (m_io_Drive_ControlMaster_Act_CtrlMode !=
Drive_ControlMaster_Act_CtrlMode::
EDrive_ControlMaster_Act_CtrlMode_Current)
{
CVeCoreInterface::poGetInterface()->
PostError(&m_sIos.PosCtrl_Drv_Supervision_Error,
EPosCtrl_Drv_Supervision_Error::ControlModeMismatch);
}
else
{
// Optional:
// Reset move generator to minimize floating point
// rounding effects for longer runtime

m_oMove.Reset();
m_oMove.SetCurrentPosition(m_sIos.PosCtrl_Position_NomPos);
m_oMove.Update();
// configure the setpoint generator
m_oMove.SetMaxJerk ( 100000.0);
m_oMove.SetMaxAcceleration ( m_sIos.PosCtrl_Position_MaxAcc);
m_oMove.SetMaxSpeed ( m_sIos.PosCtrl_Position_MaxSpeed);
// start movement
m_oMove.MoveRelative( m_sIos.PosCtrl_Position_SetPos, 1.0 );
m_sIos.PosCtrl_Position_IsMoving = true;
}
}
else if (true == m_sIos.PosCtrl_Position_IsMoving)
{
//the motor is in moving state
if ( !m_sIos.PosCtrl_Position_MoveRel
&& !m_oMove.bIsDecelerating()
&& m_oMove.bIsMoving())
{
// motor is moving but not decelerating -> stop it
m_oMove.CancelMovement();
}
if (!m_oMove.bIsMoving())// end position reached, clear flag
{
m_sIos.PosCtrl_Position_IsMoving = false;
m_sIos.PosCtrl_Position_MoveRel = false;
}

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
61 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

}
}

Finally, the setpoint generator and the control circuit must be reset when the control is switched
off.

void CP8Move::OnPsDisabled()
{
ControlOff();
}

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
62 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.7. Implementation of motor models


In this chapter, it is briefly explained how to implement an application-specific motor model. An
application framework is set up in analogy to chapter 3.6.
The callback function is for modifying the motor model.

virtual void OnUpdateUserMotorModel(SMotorModel* psModel )

Within this function, it is possible to manipulate the Q and D current setpoints. In our example, a
constant D current is to be output. This example is only for demonstration purposes and is not
relevant for practical application.

The following configuration options have to be selected:

#define APP_IS_DRIVE_MODULE 1
#define APP_DRIVE_NUMBER USE_DRIVE_0
#define APP_USE_USER_MOTOR_MODEL_CB 1

The implementation of the motor model could look like the following:

void CMotorModel::OnUpdateUserMotorModel(SMotorModel* psModel)


{
if (m_in_bControlMasterEnabled)
{
// Useless demo function that sets the D-current fix to -1.234A
// Attention: D-current must be always negative
psModel->sOutput.fSetCurrentD = -1.234f;
}
else
{
psModel->sOutput.fSetCurrentQ = 0.0f;
psModel->sOutput.fSetCurrentD = 0.0f;
}
}

The executable example MotorModel can be installed in VECTOSTUDIO via the welcome screen
under “Examples from the VE programmer's manual”.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
63 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.8. Implementation of callback functions


If a new project is created with the VECTOSTUDIO wizard, all rump functions of the application
frame will already have been created and can be switched on or off with the configuration
options. The functions described in the following have therefore already been created by the
VECTOSTUDIO wizard.

3.8.1. List of callback handlers


The file VeCoreInterface.h provides a current list of all implemented callback handlers.

class CCreateIoCallbackHandler;
class CInitIoCallbackHandler;
class CInitModuleCallbackHandler;
class CCreateInternalCallbackHandler;
class CLoadDefaultValuesCallbackHandler;
class CResetErrorsCallbackHandler;
class CPreStartCallbackHandler;
class CPostCriticalCallbackHandler;
class CPostCtrlCycleTimeChangedCallbackHandler;
class CPsEnabledCallbackHandler;
class CPsDisabledCallbackHandler;
class CUpdateControlModeCallbackHandler;
class CPostUpdateControlModeCallbackHandler;
class CUpdateNonRtThreadCallbackHandler;
class CUpdateHwInputCallbackHandler;
class CUpdateControlOutputCallbackHandler;
class CUpdateMainCallbackHandler;
class CUpdateHwOutputCallbackHandler;
class CLVSupplyReadyOkCallbackHandler;
class CLVSupplyReadyFailCallbackHandler;
class CUpdateRtComTaskCallbackHandler;
class CReadAbsPosCallbackHandler;
class CCoreTaskUpdateCallbackHandler;
class CUpdateUserMotorModelCallbackHandler;

There are three types of callbacks:

1. Callbacks that are called during the system initialization


2. Callbacks that are called according to events
3. Callbacks that are cyclically called

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
64 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.8.1.1. System initialization


The following callbacks are called during the initialization of the system

class CCreateIoCallbackHandler;
class CInitIoCallbackHandler;
class CInitModuleCallbackHandler;
class CCreateInternalCallbackHandler;
class CLoadDefaultValuesCallbackHandler;
class CPreStartCallbackHandler;

• CreateInternalCallbackHandler
This is the first callback function that is called by the system. The call takes place directly after
the FPGA of the device is initialized.
Registration of callback handler: public CCreateInternalCallbackHandler
Declaration: virtual bool OnCreateInternal() override;

• CreateIoCallbackHandler
This is a special callback implementation. CreateIo() is used directly by the VE system, and you
must not use it in your own software modules.

• InitIoCallbackHandler
The InitIo callback is used to initialize present system I/Os (see description in chapter 2.2.4.3).
The call takes place after the system I/Os have been created via CreateIo() (I/Os from*ios.h)
and the firmware default values have been assigned to the I/Os.
Registration of callback handler: public CInitIoCallbackHandler
Declaration: virtual bool bInitIos() override;
Special feature: This callback function expects a Boolean return value. If false is output, the VE
system starts in error mode.

• InitModuleCallbackHandler
This callback handler is called after all I/Os have been initialized (in other words, after the
bInitIos() callback).
A return value is expected for this function as well. If false is output, the VE system goes into
error mode.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
65 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Registration of callback handler: public CInitModuleCallbackHandler

• LoadDefaultValuesCallbackHandler
This callback handler is called after the default values have been read from the internal
memory and written to the I/Os. The call is between the CreateIo() and bInitIos()
callback.
Registration of callback handler: public CLoadDefaultValuesCallbackHandler
Declaration: virtual void OnLoadDefaultValues() override;

• PreStartCallbackHandler
This handler is called directly before the cyclic process is started. Final initializations, for
example, can be performed here before the cyclic task starts.
Registration of callback handler: public CPreStartCallbackHandler
Declaration: virtual void OnPreStart() override;

3.8.1.2. Event-triggered callbacks


Many callbacks are triggered for an event and called whenever the event occurs.

class CResetErrorsCallbackHandler;
class CPostCriticalCallbackHandler;
class CPostCtrlCycleTimeChangedCallbackHandler;
class CPsEnabledCallbackHandler;
class CPsDisabledCallbackHandler;
class CLVSupplyReadyOkCallbackHandler;
class CLVSupplyReadyFailCallbackHandler;
class CReadAbsPosCallbackHandler;
class CUpdateUserMotorModelCallbackHandler ;

• CResetErrorsCallbackHandler
This callback handler is called as soon as the Information_ResetErrors I/O is set. The callback
function must be used to acknowledge any error states of the VE module.
Registration of callback handler: public CResetErrorsCallbackHandler
Declaration: virtual void OnResetErrors() override;

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
66 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

• CPostCriticalCallbackHandler
This callback handler is called as soon as a critical error is triggered. Critical errors are errors
that cause the output stage to switch off immediately.
Registration of callback handler: public CPostCriticalCallbackHandler
Declaration: virtual void OnPostCritical() override;

• CPostCtrlCycleTimeChangedCallbackHandler
This callback function is called after the cycle time is changed. It can be used to reconfigure
filters (low-pass, high-pass ...), for example.
Registration of callback handler: public
CPostCtrlCycleTimeChangedCallbackHandler
Declaration: virtual void OnPostCtrlCycleTimeChanged
(SPostCtrlCycleTimeChangedParams* psParams)
override;

• CPsEnabledCallbackHandler
This callback is called once when the enable of the hardware output stage is issued. In this
case, the hardware enable and the software enable are set.
Registration of callback handler: public CPsEnabledCallbackHandler
Declaration: virtual void OnPsEnabled() override;

• CPsDisabledCallbackHandler
This handler is triggered when the hardware output stage is switched off.
Registration of callback handler: public CPsDisabledCallbackHandler
Declaration: virtual void OnPsDisabled() override;

• CLVSupplyReadyOkCallbackHandler
This callback handler is called as soon as the low-voltage supply of the device is securely
applied. If it should fail in the meantime, the VE system will report when the voltage is stable
again.
Registration of callback handler: public CLVSupplyReadyOkCallbackHandler
Declaration: virtual void OnLVSupplyReadyOk() override;

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
67 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

• CLVSupplyReadyFailCallbackHandler
This callback function is called when the low-voltage supply falls below a defined value.
Registration of callback handler: public CLVSupplyReadyFailCallbackHandler
Declaration: virtual void OnLVSupplyReadyFail() override;

CReadAbsPosCallbackHandler
The callback function is called when the encoder has read a new absolute value. This allows a
setpoint generator to adjust its offset, for example.
Registration of callback handler: public CReadAbsPosCallbackHandler
Declaration: virtual void OnReadAbsPos() override;

CUpdateUserMotorModelCallbackHandler
This callback function is called during the calculation of the motor model. It is for calculating
application-specific motor models.
Registration of callback handler: public CUpdateUserMotorModel
Declaration: virtual void
OnUpdateUserMotorModel(SMotorModel* psModel)
override;

3.8.1.3. Cyclic callbacks


class CUpdateControlModeCallbackHandler;
class CPostUpdateControlModeCallbackHandler;
class CUpdateNonRtThreadCallbackHandler;
class CUpdateHwInputCallbackHandler;
class CUpdateControlOutputCallbackHandler;
class CUpdateMainCallbackHandler;
class CUpdateHwOutputCallbackHandler;
class CUpdateRtComTaskCallbackHandler;
class CCoreTaskUpdateCallbackHandler;

• CUpdateControlModeCallbackHandler

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
68 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

This function is called before the control circuit is calculated. You can implement your own
control circuits here.
Registration of callback handler: public CUpdateControlModeCallbackHandler
Declaration: virtual void OnUpdateControlMode(
SUpdateControlModeParams* psParams) override;

• CPostUpdateControlModeCallbackHandler
After the control circuit has been successfully calculated, this callback function is called. This
makes it possible to manipulate the output of the control circuit at a later time.
Registration of callback handler: public CPostUpdateControlModeCallbackHandler
Declaration: virtual void OnPostUpdateControlMode(
SPostUpdateControlModeParams* psParams)
override;
• CUpdateNonRtThreadCallbackHandler
This callback function is called from the low-priority non-real-time component of the VE
kernel. It is suitable for lengthy, time-uncritical operations.
Registration of callback handler: public CUpdateNonRtThreadCallbackHandler
Declaration: virtual void OnUpdateNonRtThread() override;

• CUpdateHwInputCallbackHandler
This callback is called after the hardware inputs have been read.
Registration of callback handler: public CUpdateHwInputCallbackHandler
Declaration: virtual void OnUpdateHwInput() override;

• CUpdateControlOutputCallbackHandler
This callback function is called before the new current setpoint is transferred to the hardware.
Registration of callback handler: public CUpdateControlOutputCallbackHandler
Declaration: virtual void OnUpdateControlOutput()
override;

• CUpdateMainCallbackHandler
This callback function is intended for real-time-capable program components. A large part of
the application-specific VE module code is usually implemented here.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
69 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

Registration of callback handler: public CUpdateMainCallbackHandler


Declaration: virtual void OnUpdateMain() override;

• CUpdateHwOutputCallbackHandler
This callback function is called as soon as the hardware outputs are written. This allows final
manipulations at the outputs.
Exception: The current setpoint has already been written to the hardware and cannot be
changed there anymore.
Registration of callback handler: public CUpdateHwOutputCallbackHandler
Declaration: virtual void OnUpdateHwOutput() override;

• CUpdateRtComTaskCallbackHandler
This callback function is called by the VE communication task. It is intended for handling the
application-specific process communication of the device. This function can only be
interrupted by the OnUpdateMain() callback; it has a higher priority than the other VE tasks,
however.
Registration of callback handler: public CUpdateRtComTaskCallbackHandler
Declaration: virtual void OnUpdateRtComTask() override;

• CCoreTaskUpdateCallbackHandler
This callback has the highest priority in the VE kernel. It is called in a 250 µs cycle by default
and can even interrupt the main task of the VE system (control). This function is only allowed
to be used for special applications. A minimum processing time must be observed, since the
drive control or the watchdog monitoring of the VE system could be disturbed.
Registration of callback handler: public CCoreTaskUpdateCallbackHandler
Declaration: virtual void OnCoreTaskUpdate() override;

3.9. Multi-axis support


The option of creating VE unit modules and VE drive modules is important for devices that have
more than one output stage. VE drive unit modules create their I/Os for specific axes, whereas
I/Os that are created by a VE unit module apply to the entire device.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
70 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.9.1. VE unit modules


These modules are called by the VE kernel once per cycle. There is no assignment to a particular
output stage.

A VE unit module is created via the “Project->New” function in VECTOSTUDIO using the
ARADEX wizard.

#define APP_IS_DRIVE_MODULE 0

must be set in the *.h file as a configuration option in the application framework.

3.9.2. VE drive modules


It can be specified whether VE drive modules are created for a particular output stage or can be
called for both output stages.

If the ARADEX wizard is used to create a module, the following must be selected in the
configuration options of the VE module to create a VE drive module:

#define APP_IS_DRIVE_MODULE 1
#define APP_DRIVE_NUMBER USE_DRIVE_0

In the example, the VE module is created for axis 1. If the VE module is to address axis 2, use the
following option:

#define APP_DRIVE_NUMBER USE_DRIVE_1

For a VE module for axis 1 and 2 at the same time, the option

#define APP_DRIVE_NUMBER USE_DRIVE_0 | USE_DRIVE_1

is used.

Note:
When I/Os are created in the file *_ios.h, the I/O attribute IO_IS_UNIT is not set.

All I/Os that are declared in the *_ios.h file are created separately for each drive. The I/O numbers
then have a different instance ID.

3.9.3. Callback functions with multi-axis support


For devices that have more than one output stage, there are callback functions that are called for
each drive.

The different callback functions are used independently of whether the VE module is a drive or a
unit module.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
71 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

This is illustrated using the OnResetErrors() callback function as an example. There are two
callback functions than can be used:

virtual void OnResetErrors(uint32_t uiDriveNr) override;


virtual void OnResetErrors() override;

The behavior of the callback function changes depending on whether the function is used in a
unit or a drive module.

3.9.3.1. OnResetErrors() callback in VE drive modules


In VE drive modules, only the OnResetErrors() callback function is called.

In the case of a global reset error via the Information_ResetErrors I/O, the function is called for
each axis/instance. The call via the axis-specific reset error command (Drive_State_ResetError)
takes place for the callback function of the respective axis.

Example: Module for 2 axes

void CTest::OnResetErrors()
{
m_sIos.Counter++;
}

Triggering via I/O Action

Information_ResetError Counter increases by 1 for each axis.

Drive_State_ResetError Counter of the respective axis increases by 1.

3.9.3.2. OnResetErrors() callback in VE unit modules


In VE unit modules, the callback functions OnResetErrors() and OnResetErrors(uint32_t
uiDriveNo) are called.

In the case of a global reset via the Information_ResetErrors I/O, the OnResetErrors() function is
called twice. This function and OnResetErrors(uint32_t uiDriveNo) are also called twice,
once for each axis. The uiDriveNo parameter contains the value 0 at the first call and the value 1
at the second call.

When an error is reset via the Drive_State_ResetError I/O, the OnResetErrors() callback function is
called once and the axis-specific OnResetErrors(uint32_t uiDriveNo) function is also

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
72 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

called once. The uiDriveNo variable contains the value of the axis for which the ResetError
command is carried out.

Example: Unit module

void CTest::OnResetErrors(uint32_t uiDriveNo)


{
m_sIos.DriveNo = uiDriveNo;
m_sIos.Counter1++;
}

void CTest::OnResetErrors()
{
m_sIos.Counter2++;
}

Triggering via I/O Action

Information_ResetError Counter 1 increases by 2.


Counter 2 increases by 2.
uiDriveNo contains the value 1, since this axis
was the last one to be called.

Drive_State_ResetError Counter 1 increases by 1.


Counter 2 increases by 1.
uiDriveNo contains the value 0.

3.9.4. The example application VpTwinDriveExample


On the VECTOSTUDIO welcome screen, the example VpTwinDriveExample can be installed
under

Examples -> Examples from the VE programmer's manual.

The following explanations for this example are to impart the basic knowledge necessary to
develop multi-axis-capable VE modules.

The configuration options in the header file of the project must be adjusted as follows:

/// configuration options for drive modules

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
73 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

#define APP_IS_DRIVE_MODULE 1
#define APP_DRIVE_NUMBER USE_DRIVE_0 | USE_DRIVE_1

This means that a drive module has to be created that is called for axes 1 and 2. The definition of
USE_DRIVE_0|USE_DRIVE_1 causes the module-specific I/Os from the ios.h file to be created
separately for each drive instance.

If I/Os of the device are to be referenced, the desired I/O must be initialized for each axis
instance. For this purpose, the I/O references are declared as fields across the total number of
available axes.

CIoBooleanReference
m_io_Drive_ControlMaster_Act_IsEnabled[MAX_DRIVES_COUNT];
CIoIntegerReference m_io_FPGA_CurCtrl_CtrlOutD [MAX_DRIVES_COUNT];
CIoIntegerReference m_io_FPGA_CurCtrl_CtrlOutQ[MAX_DRIVES_COUNT];

The definition MAX_DRIVES_COUNT is provided by VeCoreInterface and contains the total number
of axes supported by the firmware.

The initialization of the I/Os in the bInitIos() function must be done across the entire
reference variable field.

auto Intf = CVeCoreInterface::poGetInterface();


FOREACH_DRIVE //< initialize I/Os for DRIVE0 and DRIVE1
{
bInitSuccess &= Intf->bInitIo(
&m_io_Drive_ControlMaster_Act_IsEnabled[uiDrive],
Drive_ControlMaster_Act_IsEnabled_NUMBER, uiDrive);

bInitSuccess &= Intf->bInitIo(


&m_io_FPGA_CurCtrl_CtrlOutD[uiDrive],
FPGA_CurCtrl_CtrlOutD_NUMBER, uiDrive);
bInitSuccess &= Intf->bInitIo(
&m_io_FPGA_CurCtrl_CtrlOutQ[uiDrive],
FPGA_CurCtrl_CtrlOutQ_NUMBER, uiDrive);
}

The FOREACH_DRIVE is defined in VeCoreInterface as a loop via the counting variable uiDrive,
which counts from 0 to MAX_DRIVES_COUNT-1.

Note:
The FOREACH_AVAILABLE_DRIVE macro, which is also available, only counts up to the number
of axes actually present that are determined by the device.

The access to the module I/Os that are defined in the ios.h file takes place transparently. Here the
VE framework automatically selects the corresponding I/O instance.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
74 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

For reference I/Os, on the other hand, the instance of the axis must be determined using the
uiGetDriveNumber() function. The I/O belonging to the axis is then accessed by accessing the
corresponding element of the reference I/O field.

uint32_t uiDrive = uiGetDriveNumber(); //< Who I am?

m_sIos.Test_Counter_0++; //< Update this I/O for DRIVE0 and DRIVE1


if (uiDrive == 1)
{
// Update this I/O only for DRIVE1
m_sIos.Test_Counter_1++;
}

// calculate the current control out value


float fControlOutD = 0.0;
float fControlOutQ = 0.0;

if(m_io_Drive_ControlMaster_Act_IsEnabled[uiDrive])
{
fControlOutD = static_cast<float>(m_io_FPGA_CurCtrl_CtrlOutD[uiDrive])
/ 5.12; //< scale FPGA integer I/O
fControlOutQ = static_cast<float>(m_io_FPGA_CurCtrl_CtrlOutQ[uiDrive])
/ 5.12;
}

auto poMath = CVeCoreInterface::poGetInterface()->poGetVeMath();


m_sIos.Test_CurrentControlOut =
poMath->sqrt(fControlOutD * fControlOutD + fControlOutQ * fControlOutQ);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
75 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

3.10.I/Os
The following subchapters describe the I/O types used in VE and their parameters. They also
explain how the I/Os of a VE module can be initialized from a second VE module.

Chapter 2.2.3 furthermore provides a short overview of the use of I/Os.

3.10.1.I/O types

3.10.1.1. INT
In the VE system, the data type INT always has 32 bits. This data type thus has a value range of -
2147483648 (INT32_MIN) … 2147483647 (INT32_MAX).

Definition of the data type:

IO_INT(name, number, unit, printformat, default, min, max, exponent,


scale, flags, description)

Parameter Description

name Name of the I/O

number Number of the I/O in this module

unit Unit that is shown in VE_CONFIG

printformat Indicates how the value is shown in


VE_CONFIG; oriented to the printf format
from the C standard library.

default Indicates the default value. The I/O is


initialized with this default value. If the I/O is
also stored on the device, then the value that is
saved on the device is copied and overwrites
the default value.

min Lowest permissible value for this I/O. Lower


values are not taken.

max Highest permissible value for this I/O. Higher


values are not taken.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
76 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

exponent Only used for display in VE_CONFIG. The


number is not shown as a raw value but
multiplied by a factor of 10 exponent.

scale Also for displaying the value in VE_CONFIG. If


a scale is given, the raw value from the VE
system is divided by the scale. In other words,
raw value / scale is shown.

flags See chapter 3.10.2

description Description of the I/O; displayed in the


VE_CONFIG program.

3.10.1.2. UINT
Variables of the type IO_UINT are defined identically as variables of the type IO_INT. When
entering the limits (min, max), ensure that they stay within the valid range of the data type
uint32_t.

This data type has a value range of 0 … 4294967295 (UINT32_MAX)

3.10.1.3. FLOAT
The description of the parameters can also be taken from the data type IO_INT. The limits (min,
max) must be selected so that they are covered by the data type float (FLT_MIN … FLT_MAX).

A floating point number according to the IEEE standard is created with single precision (4 byte
size).

3.10.1.4. ARRAY
The data type Array is created with the macro IO_ARRAY_NEW.

Definition of the data type:

IO_ARRAY_NEW(name, number, ptr, elementcount, elementsize, unit,


printformat, default, flags, description)

Parameter Description

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
77 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

name Name of the I/O

number Number of the I/O in this VE module

ptr Pointer to the array that represents the I/O. A


pointer of the type uint8_t* must always be
transferred here (see example below).

elementcount Number of elements that are contained in the


array. This value always refers to the number of
elements, not the size in bytes!

elementsize Size of an array element in bytes. If the array


element is of the data type float, then
“sizeof(float)” (or 4), for example, must be set
at this position.

unit Unit that is shown in VE_CONFIG

printformat The parameter is present due to compatibility


reasons. Do not use!

default Not defined for the data type


IO_ARRAY_NEW.

flags See chapter 3.10.2.

description Description of the I/O; displayed in


VE_CONFIG.

Example: Creation of the I/O “Information_Device_Name”.

IO_ARRAY_NEW(Information_Device_Name, 122, (uint8_t*) &m_szDeviceName,


sizeof(m_szDeviceName), sizeof(uint8_t), "", "%s", 0, IO_IS_UNIT |
IO_IS_OUTPUT, "Device name");

3.10.1.5. FIELD
In addition to the basic data types that have been described so far, the extension FIELD also exists
in two variants.

1. FIELD as a bit field; identified by the I/O attribute IO_IS_BITMASK.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
78 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

2. FIELD as an enumeration; identified by the I/O attribute IO_IS_ENUM.


These fields always have the basic data type UINT.

Definition of the data type:

BEGIN_FIELD(name)
ELEMENT (value, name, description)
RANGE (start, stop, name, description)
END_FIELD(name, number, unit, printformat, default, min, max, exponent,
scale, flags, description)

Parameter Description

BEGIN_FIELD Name of the I/Os


name
ELEMENT

value A distinction must be made here whether it is a


bit field or an enumeration variable.

• Bit field (IO_IS_BITMASK): Indicates the


bit number within the field.
• Enumeration (IO_IS_ENUM): Value of the
variable within the enumeration.
name Name of the element (bit or element name).

description Description of the I/O. Displayed in


VE_CONFIG.

RANGE The RANGE attribute allows a section of the bit


field to be interpreted as a number again. If, for
example, the first 8 bits of a bit field are to
represent a variable, then the attribute RANGE
can be selected.

start First bit of the variable within the bit field

stop Last bit of the variable within the bit field

name Name of the element

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
79 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

description Description of the I/O; displayed in


VE_CONFIG.

END_FIELD Beginning of the parameter list; the parameters


are identical to those of the IO_INT I/O type
(see chapter 3.10.1.1.)

3.10.2.I/O attributes
I/Os must be given corresponding attributes in the definition. These define access rights and
specify special characteristics.

Attribute Bit mask Description

IO_ACCESS_PRIVILEDGED 0x00000001 I/O can only be changed with a special


access function

IO_IS_OUTPUT 0x00000002 I/O can only be read

IO_IS_INPUT 0x00000004 I/O can be read and written

RESERVED 0x00000008 reserved

IO_IS_CONFIG 0x00000010 The I/O is saved in the non-volatile


memory when the I/O is called, and it is
read again when the system is booted.

IO_IS_PERSISTENT 0x00000020 Not supported

IO_IS_WARNING 0x00000040 Additional attribute for IO_BOOL and


IO_UINT I/Os; if this value is set, then
VE_CONFIG shows the I/O as a
warning.

IO_IS_ERROR 0x00000080 Additional attribute for IO_BOOL and


IO_UINT I/Os; if this value is set, then
VE_CONFIG shows the I/O as a
warning. The error is also saved in the
non-volatile memory of the device.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
80 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

IO_ERROR_IS_CRITICAL 0x00000100 Additional attribute for I/Os with the


attribute IO_IS_ERROR. The axis is
switched off when the error is triggered
via PostError().

IO_IS_FPGA_REGISTER 0x00000200 Additional attribute for IO_INT and


IO_UINT; marks the I/O as an interface
I/O to the FPGA.

IO_IS_HANDLE 0x00000400 Additional attribute for IO_UINT.


Contains the I/O handle of another I/O.

IO_IS_ENUM 0x00000800 Additional attribute for IO_UINT;


defines the I/O as an enumeration.

IO_IS_BITMASK 0x00001000 Additional attribute for IO_UINT;


defines the I/O as a bit register.

IO_IS_UNSIGNED 0x00002000 Marks the integer I/O as non-signed.

IO_IS_NUMBER 0x00004000 Additional attribute for IO_UINT;


contains the I/O number of another I/O.

IO_IS_ARRAY_RING_BUFFER 0x00008000 Indicates that IO_ARRAY_NEW is treated


as a ring buffer.

IO_MODIFY_DRIVE_OFF 0x00010000 Indicates for hardware parameters that


the value may only be changed when
the control is switched off.

IO_IS_HIDDEN 0x00020000 Hides the I/O in VE_CONFIG as


standard. It only becomes visible when
the corresponding filter is deleted.

IO_IS_UNIT 0x00040000 Shows that it is a unit I/O.

IO_IS_CONTANALYSER 0x00080000 The I/O is recorded on the SD card of


VECTOPOWER devices (if the hardware
option is present).

IO_IS_MSG_GENERAL 0x00000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. The mask 0x0 means
that no group is specified. It is assigned
to the ErrorGroup General.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
81 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

IO_IS_MSG_CONTROL_LIMIT 0x10000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup ControlLimit.

IO_IS_MSG_MOTOR_LIMIT 0x20000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup MotorLimit.

IO_IS_MSG_MOTOR_TEMPERATURE 0x30000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup MotorTemperature.

IO_IS_MSG_DEVICE_TEMPERATURE 0x40000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup DeviceTemperature.

IO_IS_MSG_POWER_SUPPLY 0x50000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup PowerSupply.

IO_IS_MSG_POWER_STAGE 0x60000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup PowerStage.

IO_IS_MSG_ENCODER 0x70000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup Encoder.

IO_IS_MSG_COMMUNICATION 0x80000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup Communication.

IO_IS_MSG_SYSTEM 0x90000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup System.

IO_IS_MSG_TECHNOLOGY_FCT 0xA0000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup TechnologyFunction.

IO_IS_MSG_APPLICATION_USER 0xB0000000 Additional attribute for IO_IS_ERROR or


IO_IS_WARNING. It is assigned to the
ErrorGroup ApplicationUser.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
82 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

IO_IS_MSG_RESERVED_3 0xC0000000 reserved

IO_IS_MSG_RESERVED_2 0xD0000000 reserved

IO_IS_MSG_RESERVED_1 0xE0000000 reserved

IO_IS_MSG_VE_MULTI_REGISTER 0xF0000000 Reserved for internal use in the VE


kernel.

3.10.3.Access to I/Os from other modules


The bInitIo() function for initialization of I/Os requires the I/O number to be able to identify
the desired I/O in the system. This number is very indistinct for software creation and above all for
software maintenance, however. For this reason, two mechanisms can be used to make the I/O
name better recognizable.

3.10.3.1. Inclusion of the *_ios.h of the external module


The recommended method is to integrate the *ios.h file of the desired VE module. Since this is
not directly possible, the following procedure must be used:

#define _INCLUDE_IO_NUMBERS_
#undef MODULE_ID
#undef VENDOR_ID
#include
"../../../MyOtherVeModule/Source/MyOtherVeModule/MyOtherVeModule_ios.h"
bInitSuccess &= Intf->bInitIo(&m_io_MyOtherVeModuleIO,
MyOtherVeModuleIO_NUMBER);

The initialization of I/Os from other VE modules is thus no longer different from the initialization
of the firmware I/Os. This procedure is also recommended by the wizard (commented in the VE
module template).

3.10.3.2. Use of the IO_NUMBER(…) macro


A further possibility is to use the IO_NUMBER(VID, MID, INSTANCE, NUMBER) macro.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
83 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Advanced VE module development

IO_NUMBER macro (VID, MID, INSTANCE, meaning


NUMBER) Parameter

VID Vendor ID

MID Module ID

INSTANCE Instance ID (0 for unit and drive1 I/Os, 1 for


drive2 /Os)

NUMBER The I/O number that is given in the I/O macro


(file *_ios.h)

Example:

IO_NUMBER(
VE_VID_ARADEX_VeTechnologyModules,
VE_MID_TechnologyModule_CanMatrix,
0,
47);

Note:
The integrated I/O number calculator in VE_CONFIG is a great help for finding the correct ID.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
84 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

4. Creating installation packages


The following chapter describes the various possibilities for providing the user with complete
installation packages. It is not necessary to provide the source texts of your own modules and the
VECTOSTUDIO development environment. The user can install the completely configured
software package on the device using VE_CONFIG.

4.1. Integrating a compiled VE module


If you do not want to transfer the source text of a VE module or a binary VE module is present, it
can be simply integrated into an existing VE project.

When a VE module is compiled, a *.module file is created. This is found in the project directory
under

Projectname\Export\bin.

The desired module file must be integrated in the configuration folder of the workspace. The
corresponding node name in the Project Explorer of VECTOSTUDIO is:

configuration/application/firmware

Figure 4 - Example of adding the Can_Matrix VE module to the workspace

If the binary file has been added to the project, it can be added as a module to the application
configuration in the next step. This step has already been described in detail in chapter 2.2.1.3.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
85 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

Figure 5 - Example of adding the Can_Matrix VE module to the application configuration

From this time on, the external VE module is taken into account when the software is
downloaded or an installation package is created (see also chapter 4.2).

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
86 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

4.2. Creating an installation package for later downloading


A download package can be created by clicking the icon in the VECTOPOWER toolbar. This
can be subsequently transferred to the target device via VE_CONFIG. Options 1 and 4 must then
be selected in the dialog window that opens.

Clicking OK starts the build process.

The target file Modules.vemod is created. The location of the file can be determined as follows:

Project-> Show installed VE package

In the Explorer dialog box that then appears, go to the

VeModulePatcher -> bin

subdirectory.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
87 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

The installation package can now be copied via VE_CONFIG for subsequent downloading.

Note:
If this step does not function, check whether a v8configuration.xml file is in the
configuration/application/configuration node of the workspace. VE and V8 can be managed
together. VECTOSTUDIO compiles V8 projects with priority when there is no online connection
to a VE device and the file v8configuration.xml is present.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
88 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

4.3. Creating a VEART file for series production


It is often a good idea to provide the customer with a complete installation package that contains
the firmware, the application-specific VE modules, as well as the parameter set of the VE device.
VECTOSTUDIO helps you to create such a package. In the VE world, this is called a VE
application runtime and has the file extension *.veart.

For preparation, the appropriate parameter set (*.vecfg file) must be saved in the workspace. This
is done in the configuration/application/configuration node. If this node is not present, it must be
created. In the example, the file HelloWorld.vecfg has been added to the project.

Figure 6 - The parameter set added to the VE project for creating a firmware package

The parameter set that we have selected must now be added to the VE module configuration (see
also chapter 2.2.1.3). This is done by opening the file AppConfiguration.appconfig in the
configuration editor of VECTOSTUDIO. When the Firmware node is selected, the attribute “VE
configuration file” appears in the characteristics window. The name of the vecfg file (in the
example, HelloWorld.vecfg) is entered here.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
89 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

Figure 7 - Adding the vecfg file to the VE module configuration

After the configuration has been saved, the installation package can be created via the context
menu of the device node “Create Application Runtime file…”.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
90 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Creating installation packages

Figure 8 - Creating the firmware package

The firmware package can be loaded onto the device in the VE_CONFIG program at a later time.
To do this, the

Tools -> Download Application Runtime file…

menu point must be selected in VE_CONFIG.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
91 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
VE internals

5. VE internals
The following chapter contains details on implementing particular VE functions. It can be
consulted for a deeper understanding of the functionality. This detailed knowledge is not
necessary for VE module development.

5.1.1. Implementation of callback handlers


The implementation of callback handlers is explained in the following. In the VE template
module, the handler functions are already provided by the application framework.

5.1.1.1. Registration of the function by the VE callback handler


To be able to use a callback function, it must be registered with the callback handler of the VE
kernel. The callback handler manages a list with all software modules that want to use this
callback function and calls them in the order of registration.

The registration with the callback handler takes place by deriving the corresponding callback
method of the basic class of the respective callback handler.

Example 1 Registering a callback


The IoInit software module tries to register itself with three callback handlers:

• InitIoCallbackHandler
• InitModuleCallbackHandler
• UpdateMainCallbackHandler

The class CIoInit therefore has to be derived from these three callback handlers:

class CIoInit
: public CVeModuleInterface, //Base class for VE modules
public CInitIoCallbackHandler, //Callback for I/O initialization
public CInitModuleCallbackHandler,//Callback for the InitModule
//function
public CUpdateMainCallbackHandler //Callback for the cyclic
//UpdateMain fct.

After successful registration with the callback handlers, the entry function still has to be set up in
its own source code. In Example 1, three callback handlers have been registered. The following
three methods then have to be registered in the class definition (header file):

virtual bool bInitIos() override;


virtual bool bInitModule() override;
virtual void OnUpdateMain() override;

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
92 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
VE internals

Note:
The override addition increases security during programming. This characterizes functions that
are derived from a basic class. If there is no identical function in the basic class, an error would
result when the software module is compiled. This quickly identifies write errors in the names or
parameters of derived functions that would otherwise be difficult to recognize.

The functions naturally also have to be implemented in the *.cpp file; in Example 1 this could
look like the following:

bool CIoInit::bInitIos()
{
bool bInitSuccess = true;
return bInitSuccess;
}

bool CIoInit::bInitModule()
{
bool bInitSuccess = true;
return bInitSuccess;
}

void CIoInit::OnUpdateMain()
{
}

Example 2 Adding further callback handlers

If a fourth callback is to be used in addition to these three callbacks, then this list can be easily
expanded. In the case shown below, the LoadDefaultValues callback handler has been added to
the existing three callback handlers as well.

class CIoInit
: public CVeModuleInterface,
public CInitIoCallbackHandler,
public CInitModuleCallbackHandler,
public CUpdateMainCallbackHandler,
public CLoadDefaultValuesCallbackHandler

Header- file:

virtual bool bInitIos() override;


virtual bool bInitModule() override;

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
93 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
VE internals

virtual void OnUpdateMain() override;


virtual void OnLoadDefaultValues() override;

*.cpp file:

bool CIoInit::bInitIos()
{
bool bInitSuccess = true;
return bInitSuccess;
}

bool CIoInit::bInitModule()
{
bool bInitSuccess = true;
return bInitSuccess;
}

void CIoInit::OnUpdateMain() {}

void CIoInit::OnLoadDefaultValues() {}

5.1.1.2. Callbacks for drive modules


The application framework switches the callback definitions of the VE module on or off via the
configuration options. This mechanism makes it possible to activate or deactivate the required
callbacks in the program code in an easy way. The appropriate derivation hierarchies for VE unit
and VE drive modules are described in the following using the CTest module as an example.

Header file of the module:

The class definition for a VE unit module looks like the following:

class CTest
: public CVeModuleInterface,
public CInitIoCallbackHandler,
public CInitModuleCallbackHandler,
public CUpdateMainCallbackHandler

If a VE drive module is to be created, it has to be derived from the class


CVeDriveModuleInterface instead of from the basic class CVeModuleInterface.

class CTest

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
94 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
VE internals

: public CVeDriveModuleInterface,
public CInitIoCallbackHandler,
public CInitModuleCallbackHandler,
public CUpdateMainCallbackHandler

Source file of the module:

The macro CREATE_CONTROL_MODULE for VE unit modules must be replaced by the macro
CREATE_CONTROL_MODULE_DRIVE for a VE drive module. The axes for which the VE module will
be called then have to be defined in the second macro.

The following holds true for a VE module that is called for both axes:

CREATE_CONTROL_MODULE_DRIVE(CTest, USE_DRIVE_0 | USE_DRIVE_1);

For a VE module that is called for axis 1, the following parameter must be set:

CREATE_CONTROL_MODULE_DRIVE(CTest, USE_DRIVE_0);

When axis 2 is used, the following holds true:

CREATE_CONTROL_MODULE_DRIVE(CTest, USE_DRIVE_1);

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
95 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Document history

6. Document history
The present document is version 2.1.

Version Reviser Changes

2.1 MBartsch Example of CANmatrix for using CANopen added.

2.0 MBartsch Complete revision and expansion of the document. First release version
created.

1.0 THartmann Document created; chapter on I/Os and callback functions.

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
96 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Own notes

7. Own notes

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
97 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com
Own notes

Changed on Thursday, December 1, 2022 3:54:00 PM by Tahir Karaca


File: VE_Programmierhandbuch_en.docx
98 / 98 ARADEX AG
Tel: +49(0)71 72/ 91 81 0
Printed on Thursday, December 1, 2022 3:54:00 PM E-mail: info@aradex.com

You might also like