Introduction aide

Introduction

You can find some information on the Motion Studio by different ways (the following sections describe these sources of information) :

  • In help on-line

  • On SERAD web site

For information on the innovations of this version, see the heading innovations of the help on-line.


Aide en ligne

On-line help

The system of help on-line provides detailed information on the functionalities of the user interface, the implementation of the languages and the programming tasks. It contains all information written in paper documentation.

To display the table of contents, choose Help | Summary of the help. To search information on the installation, the setup, the programming or other subjects, choose the tabs Index or Research and capture your request.


Aide F1

Help F1

In order to get help on a part of the Motion Studio environment development (included the menu elements, the dialog boxes, the tools bars), select the element and click on F1.

The error messages of the compiler or the binder appear in the console. To get help on the compilation errors, select a line on the console and click on F1.

It is also possible to get help on an instruction of the language ST/IT by placing the cursor on the word and clicking on


Documentation imprimée

 Documentation printing

It is possible to print all chapters of the online documentation


Service de support

Support service

SERAD offers also many support possibilities if you need additional information. For information on the support services of SERAD, visit the Web site at the address http://www.serad.fr.


Mise en garde

Caution

Before the first setting up, please read the following information in order to avoid the hardware damages and injuries.

Only suitable qualified personnel should undertake the mounting, installation, operation, and the equipment maintenance must be complied with the national and international safety regulations (DIN, VDE, EN, IEC ). Serious material damages can result from the non respect of these regulations.

Moreover, it is essential to respect the safety instructions. Personal injuries and damages can result from a misunderstanding of the safety requirements.

In case of error on the MPC, the user is responsible to secure the others devices which can be connected.


Description des symboles

Symbols description

The following caution symbols are used in the installation guide. They are planned to alert the reader on the associated safety instructions.


Historique du manuel

Manual's historic

Version | Date | Comments
R1.02 | 01/09/2008 | Updates and corrections
R1.01 | 28/05/2007 | Adding counter and camboxes
R0.59 | 03/05/2007 | Updates and corrections
R0.54 | 11/10/2006 | Updating synchronization and capture
R0.51 | 19/09/2006 | First version


Généralités

Generalities

Providing both high performances and outstanding flexibility, the MPC complies with a broad range of industrial applications.

The power of MPC processor enables it to manage complex machines at a high rate.

Its real time core executes some cyclic, acyclic, interruptive tasks.

MPC takes advantage of all the PC communications interfaces and, in addition, proposes a network Industrial Ethernet and a CANopen fieldbus port.


Données techniques

Technical features

* Option


Généralités

Generalities

Thanks to its intuitive interface and its standardized language IEC 61131-3, the software workshop Motion Studio is extremely user-friendly and permits a rapid development of your application.

User-friendly :

Ä Projects management

Ä Simplified configuration using a tree structure

Ä Multi-window

Ä Graphic editors

Ä Floating menus

Ä Intuitive navigation

Ä Tools boxes

Ä Integrated help files

Fast development:

Ä Possible programming in the 5 standardized languages

Ä Editors with syntax description

Ä Creation of function blocks

Ä Choice program types and priority

Ä Cross references

Ä Definition of CAM profiles by graphic tool

Ä Easy declaration of axes, I/O and variables

Ä List and historic errors messages

Ä Numerous integrated libraries

Setup tools :

Ä Instrument display

Ä Trace mode and single step

Ä Definition of breakpoints

Ä Axes auto-tuning

Ä Trajectories generator

Ä Motion simulator

Ä Hyper Terminal

Ä Variables watch list

Ä Animation tables

Ä Digital oscilloscope

Ä Network analyser


Applications

Ä Labels printing

Ä Packaging machines

Ä Textiles machines

Ä Press feeding

Ä Water jet cutters

Ä Pick and place robots

Ä Woodworking machines

Ä Flow regulation

Ä Dosing, ect.


Vue de face

Front view


Vue de dessus

Top view


Vue de côté

Side view


Interface CANopen

CANopen interface


Interface Industriel Ethernet

Industrial Ethernet interface


Interface Ethernet TCP/IP

Ethernet TCP/IP interface


Compact Flash

  • In order to have access to the Compact module Flash or DIPSwitchs, withdraw the two fastening screws of the cap:

  • In order to take off the Compact Flash 64 Mo, pull on the adhesive tape :

    The Compact Flash is furnished by SERAD, any other Compact Flash can involve disfonctionnements.

  • Assignation of DIPSwitchs :


Entrées logiques

Digital inputs


Sorties logiques

Digital outputs


Alimentation E/S

I/O power supply


Alimentation générale

General power supply


Interface USB

USB interface


Interface SERIAL1 et SERIAL2

SERIAL1 and SERIAL2 interface


Montage

Mounting

MPC must be installed vertically to have a natural convection cooling.

It must be sheltered from humidity, liquid projection and dust.

In order to guarantee the good air circulation, assemble the system so that top, bottom, and side spaces correspond to the following diagram:


Sécurités

Safety

ÄThe security rules impose a manual restart after a default due to a power supply falling down, a watchdog default or an emergency stop.

 MCS's watchdog must be connected in serial with the emergency stop.

ÄThe watchdog must be opened at the beginning of the program. When a fault is detected (Internal fault, power fail ...), the watchdog is automatically closed.

ÄMaxi following error parameter must be setup on each axis.

ÄThe sensors that define axes limits must be connected in serial in the emergency stop loop.

ÄIt is recommended to use software thrusts in case of finished axes.

ÄLink the information « Power Electrical cupboard OK » to a robot input and treated it in a safety non blocking task.

ÄOn a following error detected, MPC sends all axes to an open loop mode and opens the watchdog. To realize another treatment, you need to use the SECURITY instruction.

ÄIt is necessary to forecast on all static outputs some free-wheel diodes on the inductive charges. These diodes must be placed more closed possible near the load. The power and signals conductors should not be the seat of overpressures.


Mise en route

Getting started

The MPC starting is executed as follows:

Ä Start to define the axes by declaring each driver with a different node number on the Ethercat network and with a motor configuration.

Ä Declare the E/S locally or offset available.

Ä Charge the defined configuration by using the function "Send the configuration" as from the communication menu of Motion Studio.

Ä Define the global variables.

Ä Transfer the initial value of the saved variables by using "Send the variables" from the communication menu of Motion Studio.

Ä Write the different tasks.

Ä Transfer the tasks after their compilation.

Thereafter each modification brought about the tasks requires a new compilation and a transfer of the tasks in the MPC. A modification of the configuration requires a new sending of the configuration in the MPC.


Raccordement_avec_variateurs_IMD

IMD drives wiring


Raccordement avec des variateurs IMDL

IMDL drive wiring


Raccordement_des_variateurs_IMDx_au_réseau_ETHERCAT

< AJOUTER PHOTO DU BANC 5 AXES

  1. Chaque variateur doit avoir une adresse ETHERCAT différent

  2. Les câbles ETHERCAT doivent être de catégorie 5E SFTP

  3. Les adresses ETHERCAT des variateurs correspondront au numéro + 1 présent sur les DIPSwitchs au dessus des prises RJ45


Configuration de l'adresse IP par l'Assistant

IP Address setup

After creating a new project, the default IP address setting in the project is 192.168.1.1 and is not necessarily MPC's IP address.

To establish the first connection and setup project and MPC IP addresses use TCP/IP setup wizard.

Select the network interface connected to MPC network

If Windows firewall locks connection

Choose "Unlock" and then restart TCP/IP setup wizard

The wizard shows detected MPC over the network

The physically identify the MPC, the wizard shows their number on 7 segment display :

For the MPC at address 192.168.1.155, the display shows L1.

For the MPC at address 192.168.1.136, the display shows L2.

Select your MPC and click on « Next »

The wizard indicate PC and MPC setup.

Click on« Next »

Choose PC or MPC setup

Click on« Next »

The wizard show the result of the communication tests.

Click on« Finish»


Forcage de l'adresse IP par DIPSwitchs

Set default IP address using DIP switch

This procedure allow to force MPC's IP address to 192.168.1.1 and the mask to 255.255.255.0..

  • Put MPC power off

  • Set DIP2 to ON

  • Put MPC power on

  • After power on sequence (about 15s) MPC shows "C" animation on the 7 segment display

  • Without putting MPC power off, Set DIP2 to OFF and then to ON.

  • Wait for 5s

  • Put MPC power off

  • Set DIP2 to OFF

  • Put MPC power on : it's IP address is now set to 192.168.1.1 and the mask to 255.255.255.0.


Procédure de réglage d'un axe

Tuning method

The parameter setting of the axes is made from the available motor library in the software or from the drive autotuning.


Configuration du système

System configuration

Minimum configuration:

Ä PC Pentium III 800 MHz

Ä RAM 128 Mo (Windows 2000) / 256 Mo (Windows XP)

Ä Hard disk (50 Mo free)

Ä Microsoft® Windows 2000 ou XP

Ä CD-ROM (16X)

Ä Monitor SVGA 1024x768

Ä Mouse or other pointing devices

Recommended configuration:

Ä PC Pentium® IV or plus

Ä RAM 256 Mo (Windows 2000) / 512 Mo (Windows XP)

Ä Hard disk (50 Mo free)

Ä Microsoft® Windows 2000 ou XP

Ä DVD-ROM

Ä Monitor SVGA 1280x1024

Ä Mouse or other pointing devices

This application does not function with UNIX, Linux, Mac, OS, MS-DOS and Microsoft® Windows 3.11, 95, 98, Me et NT4.


Procédure d'installation du Motion Studio

Installation procedure

The software Motion Studio is supplied on CD-ROM with MPC system. The installation program will create repertories and copy the files of the disk Motion Studio installation on your PC. The installation program is very explanatory. The elementary concepts on the Motion Studio installation are given to you in the following stages:

To set up the Motion Studio

  1. Check that the system has the required configuration.

  2. Insert the CD-ROM in the appropriate drive.

  3. In the menu [image], select [image] .

  4. In the « Execute » dialog box, select [image] .

  5. In the « Parcourir » dialog box, select the drive where the CD-ROM is.

  6. Select [image] then [image] in the dialog box « Parcourir ».

  7. Select [image] in the dialog box « Execute ».

ðThe installation program of Motion Studio software is running.

  8. At the beginning of the installation, there are some dialog boxes to lead the user :

  • Installation language choice

  • Welcome message

  • Installation types

  • Start of the files copy

ð The files installation starts and is indicated by the evolution of a progress bar.

  • end of the files copy

ð The installation finishes with the adding of Motion Studio icon in the program manager.


Les répertoires

Folders

The Motion Studio software is set up by default in the directory C :\Program files\SERAD\Motion studio X.XX\

X.XX represents the setup software version. Several versions can be setup simultaneously. The directories are different for each setup version.

The DATA directory contains the system data base, where are stored the device declarations recognized by the system (IMD, input mode / outputs CAN ).

The DOC directory consolidates the documentations on the Modbus table and CANopen dictionary.

The GFX directory contains the pictures used by the software.

HELP directory contains the files relating to the online documentation.

INFO directory contains the tools necessary to the project files edition and compilation (language editor, compilator, debug tools ).

LIB directory contains the library of motor parameters, at format iDPL. This allows creating an axis in the project based on the suitable motor parameter.

In the OS directory there are a copy of the MPC system and a complete Linux picture on the compact flash card. These files are used to update the MPC or recreate a compact flash.


Contenu d'un projet

Project contents

A project created with the software Motion Studio is articulated around a main file and three subdirectories. The main file, which has extension `.MPC', defines the properties and the options used by the software. For example, for a project named "motion" we get the following directories :

These archives can be recovered at any time. See the project menu.

The directory "XXX.sdb" contains the project data base consolidating the devices data ( axes, inputs/outputs modules ) , the variables declarations and the inputs outputs affectations. This base contains also the tasks, programs, functional blocks, and all IEC1131 parameters.

The directory "XXX.idb" contains all program source files, functional blocks, functions, type declarations and all files necessary to the project compilation.

The directory "XXX.odb" contains all other files required by the project :

  • Exchanged data values

  • Scope and other tools setup

  • Project comments

  • Etc ...

In these directories the subdirectories .arch contain the project archives realized at each saving. The available archive number is setup in the preferences. See the screen preference.

These archives can, at any time, be restored. See the Project menu.


Création d'un projet

Creating project

  1. 1. Start the shop software MS

  2. 2. Click on project in the main menu

  3. 3. Click on new in the pull-down menu

  4. 4. In the window New Project, indicate the name of the new project and its location


Ecran initial

Initial screen

The elements of the programming Motion Studio environment were designed so that you are equipped with tools allowing developing quickly and intuitively applications. This section briefly describes each of these elements.

The Motion Studio is defined by a main window consisting of:

  1. The main menu and the tools bar

  2. The project browser

  3. The edition area with multiple windows

  4. The rapid commands area

  5. The exit console

The main menu contains all available commands in the form of menu and sub menu. The Motion Studio toolbars allow a fast access to the most used operations and commands. Many commands have keyboard equivalents as well as buttons in the bar of tools. When a short cut keyboard is available, it is always registered beside the command in the pull-down menu.

The project browser gives a general view, distributed per group of all the project components. Navigation is thus fast and precise. The pointer of mouse [image] indicates the presence of an accessible command by double click on a browser element.

The multi windows area contains the user opened windows and gives below a list in the form of tab. The properties of the ` multi windows` make possible to the user to be able to pass from a window to another one without having to close them.

The tabs allow both the fast trigger to a hided window and the windows closing with a click on X.


Menu Projet

Project menu

New

Icon:

Action: Defines a new project. The last running project is closed and a new configuration window appears to show the place of the new project. (as below)

Open

Icon :

Action : This command opens the « Open Project » dialog box. It allows the user to indicate the path and the name of the project to be loaded. The last running project must be closed before beginning an opening.

Open the dialog box "Open a Project". It allows the user to specify the way and the name of the project to be charged. The project in progress must be closed before undertaking an opening.

Save

Icon:

Action: To save the complete running project. When Motion Studio is connected with MPC, the parameters are automatically received before the saving.

Save as

Icon:

Action: To open the "Save as" dialog box that allows user to specify the path and name of the saving project. With this command you can create copies of projects.

Close

Icon:

Action: To close the running project.

Open from achive

Icon:

Action : Uncompress and open a previously archived project.

Archive project

Icon:

Action : Archive by compressing the project to reduce disk space consumption.

Send project by E-Mail

Icon:

Action : Compress and send the project by E-Mail by opening the default E-Mail client.

Comments

Icon:

Action: Allow to leave comment to a project in format RTF thanks to an integrated text editor.

Global search

Icon:

Action: To search a text in the entire project.

Sending of project PC sources -> MPC

Icon:

Action: To store the PC project sources in MPC.

Reception of project MPC sources -> PC

Icon:

Action: To recover the sources contained in the MPC to the PC.

Check the system version

Icon:

Action: To make comparison between PC and MPC versions for :

      • The application

      • The exploitation system

      • Linux

PC tab is grouping available informations about PC, Motion Studio associated operating system and project.

MPC tab is grouping informations about the MPC referenced in the project.

Restore the project as from an archive

Icon:

Action: To restore a project archive as from a date. The archives will be automatically created at the saving project.

Print

Icon :

Action: To realize a total or customized printing of the project. In this printing you can find the MPC setup, some tasks and the content of different programs, functions and functional blocks.

Quit

Icon:

Action: To quit the software.


Menu Objets

Objects menu

Setup

Icon :

Action : Activate the configuration tab in the project browser.

Motion

Icon :

Action : Activate the motion tab in the project browser.

PLC

Icon :

Action : Activate the automate tab in the project browser .

Programming

Icon :

Action : Activate the programming tab in the project browser .

Tools

Icon :

Action : Activate the tools tab in the project browser.


Menu Edition

Edition menu

Undo

Icon :

Action : Cancel the last action in a language editor.

Repair

Icon :

Action : Repair the last cancelled action in a language editor.

Cut

Icon:

Action : Cut some text or object in order to insert it at another place. Select it then click on cut. This command runs only in the language editors.

Copy

Icon :

Action : Copy some text or object in order to insert it at another place. Select it then click on copy. This command runs only in the language editors.

Paste

Icon :

Action : Insert the text or object you either have cut or copied. Place the insertion point at the required place, and then click on insert. This command runs only in the language editors.

Delete

Icon :

Action : Delete some text or object. Select it, and then click on delete. This command runs only in the language editors.

Select all

Icon :

Action : Select all objects or program text. This command runs only in the language editors.

Search

Icon:

Action : Research some text in the windows edition. This command runs only in the language editors.

Replace

Icon :

Action : Replace some text in the windows edition. This command runs only in the language editors.


Menu Affichage

Display menu

Zoom +

Icon:

Action: To allow the user to do an enlarging of the display zone of your diagrams SFC, Ladder, FBD and CFC

Zoom -

Icon:

Action: To allow the user to do a reduction of the display zone of your diagrams SFC, Ladder, FBD and CFC


Menu Compilation

Compilation menu

Syntax check

Icon:

Action: Check the current program syntax.

Compile

Icon:

Action: To compile the running program.

Build

Icon:

Action: To build the project.


Menu Communication

Communication Menu

Connect

Icon:

Action: Online with the MPC. This operation needs the reception of the parameters stored in the MPC in order to guarantee the consistency of the displayed information.

Disconnect

Icon:

Action: Stop the connection with the MPC.

Auto-detect setup

Icon:

Action : Receive MPC setup and automatically add detected peripherals into the project. The project must be empty to use this function.

Send setup

Icon:

Action: Send the setup and initialize the MPC with the parameters preset in the screens of project setup. At the end of the setup sending the EtherCAT network is automatically re-initialized, which stops the tasks.

Receive the setup

Icon:

Action: Update as from the MPC parameters indicated in the setup screens.

Send the variables

Icon:

Action: Send the stored variables and initialize in the MPC the value assigned to these variables. So, you neednt to initialize them in the program.

Receive the variables

Icon :

Action : Receive the stored variables and keep a copy of their value in the PC.

Send cam profiles

Icon :

Action : Send cam profiles in the MPC..

Receive cam profiles

Icon :

Action : Receive cam profiles and store them in the PC..

Send the tasks

Icon:

Action: Send all the compiled tasks in the MPC. The execution of the tasks is automatically launched after the end of the transfer.

Clear the tasks

Icon:

Action: Clear all the tasks in the MPC.

Run

Icon:

Action: Start the MPC tasks.

Continue

Icon:

Action: Continue the MPC tasks previously suspended.

Suspend

Icon:

Action: Suspend MPC tasks.

Stop

Icon:

Action: Stop MPC tasks.

Restart

Icon:

Action: Restart the MPC.

Go to saved execution position

Icon:

Action : Indicate the last line/executed instruction before MPC restart.

Go to current execution position

Icon:

Action : Indicate la line/running instruction in the MPC.


Menu Fenêtres

Windows menu

Cascade

Icon:

Action: Display the different cascade windows.

Tile

Icon:

Action: Display the different tile windows.

Console

Icon:

Action: To force the console display.


Menu Options

Options menu

Preferences

Icon:

Action: To allow the user to personalize the color and the bottom of the texts, keywords... of the programs editors.

See preferences chapter.

TCP/IP setup wizard

Icon:

Action: Set up the IP address of a MPC by Ethernet or serial link.

See TCP/IP setup wizard chapter.

Operating system

Icon:

Action: Update the MPC operating system by direct transfer in this one. If this operation fails, see « Compact Flash ».

Saved memory clearing

Icon:

Action: Clear the saved memory content (BBM) containing the setup and the saved global variables.

Compact flash

Icon:

Action: Update the entire picture of the MPC operating system (OS, Linux ) on a compact flash as from a PC fitted with a compact flash drive.


Menu Aide

Help menu

About

Icon:

Action: Open a dialog box indicating the software version, its creation date, ect...

Help summary

Icon:

Action: Open the help online of Motion Studio from the summary.

Help Tab

Icon:

Action: Open the help online of Motion Studio from the tab.

Help search

Icon:

Action: Open the help online of Motion Studio for a search per keyword.

SERAD web site

Action: Open a browser window html on the SERAD web site.

CANopen table classified per Tab/Sub

Action: Open an html browser window on the table CANopen classified per Tab/Sub.

CANopen table classified per group

Action: Open an html browser window on the table CANopen classified per group.

Modbus table cassified per Tab

Action: Open an html browser window on the table Modbus classified per Tab/Sub

Modbus table classified per group

Action: Open an html browser window on the table Modbus classified per group.


Onglet Configuration

Setup tab

The setup tab collects the MPC setup and its devices set per connexion. The mouse sign [image] indicates the presence of an available command by a double click on a browser element..

Add

Icon:

Action: Add an IMD axis or virtual, an inputs/outputs CANOPEN module.

IMD Adding

  • Name : Axis name to be added.

  • Setup : Name of the IDPL setup file to apply

  • Import : Allows the selection of the setup file to apply

  • Create from : Activates the creation by copy of an existing axis. Select the axis in the list

Adding of a virtual axis

  • Name : Name of the axis to be added.

Adding of an inputs / outputs CANopen module

  • Name : Name of inputs / outputs module to be added.

Remove

Icon:

Action: Remove the selected device after confirmation.

Menu Popup

You have access to the following popup menu with a right click of the mouse:

Rename

Icon:

Action: Rename the selected axis.

Move up

Icon:

Action: Move the selected axis up in the list.

Move down

Icon:

Action: Move the selected axis down in the list.

Import from a file

Icon:

Action: Import the axis data from an IDPL or MSS file.

Choice the file to be imported by clicking on [image] .

Select the type of file (IDPL or MSS) to be imported

Select the file and click on Ok.

Click on [image] to import the file

Export to a file

Icon:

Action: Export the axis data from an IDPL or MSS file.

Choose the file to export by clicking on [image] .

Select the file and click on Ok.

Click on [image] to export the file


Onglet Motion

Motion tab

The Motion tab represents the axes list and the associated cams files. The motion part of the axis includes its units, its velocity profile, its home and the control of its position faults (following error, position window and limits).

The axes physically connected are represented, thus that the virtual axes. The mouse pointer [image] indicates the presence of a command accessible by double click on a browser element.

Add

Icon:

Action: Add an IMD or virtual axis, an inputs / outputs CANopen module.

IMD adding

  • Name : Axis name to be added.

  • Setup : Name of the IDPL setup file to apply

  • Import : Allows the selection of the setup file to apply

  • Create from : Activates the creation by copy of an existing axis. Select the axis in the list

Adding of a virtual axis

  • Name : Name of the axis to be added.

Adding of an inputs / outputs CANopen module

  • Name : Name of inputs / outputs module to be added.

Remove

Icon:

Action: Remove the selected device after confirmation.

Menu Popup

You have access to the following popup menu with a right click of the mouse :

Rename

Icon:

Action: Rename the selected axis.

Move up

Icon:

Action: Move the selected axis up in the list.

Move down

Icon:

Action: Move the selected axis down in the list.

Import from a file

Icon:

Action: Import the axis data from a IDPL or MSS file.

Choose the file to be imported by clicking on [image] .

Select the type of file (IDPL or MSS) to be imported

Select the file and click on Ok.

Click on [image] to import the file

Export to a file

Icon:

Action: Export the axis data from an IDPL or MSS file.

Choose the file to be exported by clicking on [image] .

Select the file and click on Ok.

Click on [image] to export the file


Onglet Automate

PLC tab

PLC tab gives access to the inputs / outputs parameters. Their name, invert and filter will be defined owing to the inputs/outputs editor. You can have access to the MPC, IMD, CANopen modules inputs/ outputs on this screen. The mouse pointer [image] indicates the presence of a command accessible by a double click on a browser element.

Add

Icon:

Action: Add an IMD or virtual axis, an inputs/outputs CANopen module.

IMD adding

  • Name : Axis name to be added.

  • Setup : Name of the IDPL setup file to apply

  • Import : Allows the selection of the setup file to apply

  • Create from : Activates the creation by copy of an existing axis. Select the axis in the list

Adding of a virtual axis

  • Name : Name of the axis to be added.

Adding of an inputs/outputs CANopen module

  • Name : Name of the inputs/outputs module to add.

Remove

Icon:

Action: Remove the selected device after confirmation.

Menu Popup

You have access to the following popup menu with a right click of the mouse :

Rename

Icon:

Action: Rename the selected axis.

Move up

Icon:

Action: Move the selected axis up in the list.

Move down

Icon:

Action: Move the selected axis down in the list.

Import from a file

Icon:

Action: Imports the axis data from an IDPL or MSS file.

Choose the file to be imported by clicking on [image] .

Select the type of file (IDPL or MSS) to import

Select the file and click on OK.

Click on [image] to import the file.

Export to a file

Icon:

Action: Export the axis data from an IDPL or MSS file.

Choose the file to export by clicking on [image] .

Select the file and click on Ok.

Click on [image] to export the file


Onglet Programmation

Programming tab

The programming tab lists all files used to create the application. The files are distributed by type (Tasks, programs, functional block, functions, definitions of the type, global variables, and library). Various editors are then used to create these files. An editor of variable allows to accurately place the variables in saved memory or in the zone of exchange. The pointer of mouse [image] indicates the presence of a command accessible by a double click on a browser element.

Add

Icon:

Action: Add a task, a program, a functional block, a function, a file of type declaration, a file of global variables or a library.

Remove

Icon:

Action: Remove the selected element after confirmation.

Menu Popup

You have access to the following popup menu with a right click of the mouse :

Rename

Icon:

Action: Rename the selected element

Move up

Icon:

Action: Move the selected axis up in the list.

Move down

Icon:

Action: Move the selected axis down in the list.

In the case of the editors of saved and exchange variables, it is also possible to import and export the lists of variables.

Import from a file

Icon:

Action: Imports the global variables from a file MSV.

Select the file and click on Ok.

Click on [image] to import the file

Export to a file

Icon:

Action: Exports the global variables from a file MSV.

Choose the file to be exported by clicking on [image] .

Select the file and click on Ok.

Click on [image] to export the file


Onglet Outils

Tools tab

In the tools tab you can find all available tools for MPC, each device EtherCAT or CANopen. The pointer of the mouse [image] indicates the presence of a command accessible by a double click on a browser element.

Menu Popup

You have access to the following popup menu with a right click of the mouse :

Rename

Icon:

Action: Rename the selected axis.

Move up

Icon:

Action: Move the selected axis up in the list.

Move down

Icon:

Action: Move the selected axis down in the list.

Import from a file

Icon:

Action: Imports the global variables from a file IDPL or MSS.

Choose the file to be imported by clicking on [image] .

Select the file and click on OK.

Click on [image] to import the file

Choose the file to be imported by clicking on

Export to a file

Icon:

Action: Exports the axis data from a file IDPL or MSS.

Choose the file to be exported by clicking on [image] .

Select the file and click on Ok.

Click on [image] to export the file


Commandes rapides

Express commands

The express commands zone, on the right of the main window of Motion Studio allows getting a global view of the MPC essential functions (Display Status, Links, axes and tasks status). It acts also as an express control board.

Axes enable

Status

Icon:

Meaning: Indicate the global status of the axes enable.

  • Off : All axes are disabled

  • Yellow flasher : All axes are not enabled

  • Yellow alight : All axes are enabled.

The status is only displayed in mode "On line".

Enable

Icon:

Action: Requests for the enable of all real, in simulation or virtual axes present in the setup.

Disable

Icon:

Action: Requests for the disable of all real, in simulation or virtual axes present in the setup.

These commands are only accessible in mode "On line"

EtherCAT Link

Status

Icon:

Meaning: Indicates the global status of the link EtherCAT with the drives.

  • Off : The link EtherCAT is non initialized or interrupted.

  • Alight green: The link EtherCAT is established and the network is correctly initialized

The status is only displayed in mode "On line".

Init

Icon:

Action: Requests for the link EtherCAT initialization and the verification of the axes present on the network.

This command is only accessible in mode "On line"

CANopen Link

Status

Icon:

Meaning: Indicates the global status of the CANopen link with the inputs / outputs modules.

  • Off : The connection CANopen is not initialized or stopped.

  • Red signal: the connection is in error.

  • Green alight : The connection CANopen is established and the field bus de terrain is correctly initialized.

The state is displayed only in mode "On line".

Display status

Status

Icon:

Meaning: Indicates the display status of MPC. This allows the visualization of present errors on the MPC

The status is only displayed in mode "On line".

You can have access to the alarms screen by clicking on the display.

This screen lists the MPC detected faults.

Release

Icon:

Action: Requests for the release of the displayed defaults which were corrected. If the source of a default is still present, this one can be released.

Tasks status

Status

Icon:

Meaning: Indicates the status of the scheduler which manages the tasks in MPC.

  • : The scheduler has been stopped, all tasks are stopped.

  • : The scheduler has been suspended. All tasks are suspended.

  • : The scheduler is running. The tasks automatically started are running.

The status is only displayed in mode "On line".


Console de sortie

Output console

The console zone is the zone of communication between the software Motion Studio and the user. On this console the sequences of the required operations are reproduced (sending, reception, connection, disconnection, compilations...).

Information is indicated by using various colors to indicate their importance:

Black: General information, without special indication

Green: Positive result. The operation finished successfully.

Orange: Warning. The operation was given up, a problem occurred, or the operation is prohibited.

Red: An error occurred.


Liste des points d'arrêts

List of breakpoints

The list of breakpoints gives a fast idea of the breakpoints affixed to the programs ST and IT. This list allows you to find them easily, per file, instance and number line.

Delete

Icon:

Action: Delete the selected breakpoint

Delete all

Icon:

Action: Delete all breakpoints


Fichiers

Files


Console


langues

Languages


Mode


texte

Text


Ladder


Options


Oscilloscope

Scope


Sélection de l'interface réseau

Network interface selection

The first step consist in the selection of the network interface connected to the MPC. The MPC can only be connected on an Ethernet type connection.

The first connexion attempt can raise a Windows's firewall warning.

It's necessarily to permanently unlock the programme to allow communications with MPC.

Then we can go to auto detection of the MPC.


Auto détection

Auto detection

Auto detection phase is a search for all MPC available on the network or connected to the PC.

If auto detection have been done correctly,a detected MPC list is shown.

To locate physically the MPC, the wizard show their number on the 7 segment display :

For the MPC at address 192.168.1.136, the 7 segments display show L1.

For the MPC at address 192.168.1.155, the 7 segments display show L2.

Select the right MPC and click on "Next" to obtain a setup summary.

If the auto detection fails, it's nevertheless possible to setup MPC by serial link.

Furthermore, if it's not in the list, the checkbox "The MPC is not in the list" must be checked to be able to use serial link.

To do so, as indicated on the screen, activate DIP2 on the MPC, to be able to use setup serial link and restart MPC.

Then the serial link must be used.


Liaison série

Serial link

To use the serial link, the PC COM port connected to the MPC must be indicated to the system.

The a standard crossed serial RS232 cable must be connected to MPC's X18-COM1 port.

The MPC indicate that it's ready to communication with a "C" on the Status display.

If parameter reading have been done successfully, we can go to the setup summary.

If a ready error is indicated, check the connection between PC and MPC and start TCP/IP setup wizard again.


Résumé des configurations

Setup summary

The setup summary allow to compare project and MPC communication setups.

These informations do not take PC communication parameters into account.

In case of serial link, it's also possible to :

- Clear tasks in the MPC.

- Clear battery backup memory.

Chose "Next" to continue. If setups are the same, we go directly to setup validation.

If the serial link is use, DIP2 must be deselected and MPC restarted to validate setup.

If setups are different, a setup selection must be done.


Choix de la configuration

Setup selection

It's then possible to decide witch setup is preserved.

The setup is modified in the PC or the MPC.

Then, we can proceed setup validation.

If the serial link is use, DIP2 must be deselected and MPC restarted to validate setup.


Validation de la configuration

Setup validation

Setup process always ends by a parameters checking to verify that the PC is able to transmit correctly informations exchanged between Motion Studio and MPC. We are now sure that MPC communication setup is the same as indicated in project.

To do so, setups are compared and the compatibility is checked for :

- MPC and PC IP address classes

- Network IP addresses and mask

Checking ends with a data exchange checking (PING)

If an incompatibility is detected between MPC and PC, check PC's Ethernet communication parameters.


Configuration Interne

MPC parameter list

MPC

Possible access with a double click on the name MPC, this window allows getting the complete list of MPC parameters.


Ethernet TCP

  • Name: internal name of MPC

  • Address IP: Address IP on the Ethernet network TCP/IP

  • Mask: Mask networks on the Ethernet network TCP/IP

  • Gateway: Gateway per default on the Ethernet network TCP/IP

The parameters of the connection Ethernet TCP/IP depend on the MPC installation on the network or directly on the PC. In all caseS, call upon the network administrator to determine the adapted parameters and to use the assistant of parameter setting TCP/IP in Menu Options / parameter setting assistant TCP/IP.


EtherCAT

  • Node : internal node Ethercat of MPC, do not modify.

  • Ethercat mode : Defines the length of the Ethercat frame.


CANopen

  • Node : Number of node used by MPC, on the CANopen network

  • Velocity (Kbps) : Velocity of CANopen connection

  • Timeout (ms) : Waiting limit of answers to the requests SDO

  • Retry : Retries number of SDO requests before failure.

  • Invert double words : Transfer mode of double words by CANopen

  • Floats convert : Floats convert in fixed points for the devices which do not support the floats or which have floats differently coded

  • Precision : Number of figures after the point if the float convert in fixed point is active.


COM1

  • COM1 / Setup:

    • Velocity (bauds) : Velocity of port COM 1

    • Bits : Number of data bits on the frame RS232 or RS 485

    • Parity : Operating mode of bit parity of the frame

    • Stops : Number of stop bits on the frame RS232 or RS 485

    • Protocol : Choice of communication protocol (Free, Modbus master or Modbus slave)

    • Mode : Operating mode of the communication (RS232 only)

  • COM1 / Modbus RTU:

    • Node : Number of node used on the communication in Modbus RTU

    • Timeout (ms) : waiting time for answers to Modbus requests

    • Retry : Retries number of Modbus requests before failure

    • Invert double words : Transfer mode of double words by Modbus on COM1

    • Floats convert : Floats convert in fixed points for the devices which do not support the floats or which have floats differently coded

    • Precision : Number of figures after the point if the float convert in fixed point is active.


COM2

  • COM2 /Setup:

    • Velocity (bauds) : Velocity of port COM 2

    • Bits : Number of data bits on the frame RS232 or RS 485

    • Parity : Operating mode of bit parity of the frame

    • Stops : Number of stop bits on the frame RS232 or RS 485

    • Protocol : Choice of communication protocol (Free, Modbus master or Modbus slave)

    • Mode : Operating mode of the communication (RS232 or RS485)

  • COM2 / Modbus RTU:

    • Node : Number of used node on the communication in Modbus RTU

    • Timeout (ms) : waiting time of answers to the Modbus requests

    • Retry : Retries number of Modbus requests before failure

    • Invert double words : Transfer mode of double words by Modbus on COM2

    • Floats convert : Floats convert in fixed points for the devices which do not support the floats or which have floats differently coded.

    • Precision : Number of figures after the point if the float convert in fixed point is active.


Ajout d'un axe virtuel

Virtual axis adding

  1. In the project browser, select Setup Tab.

  2. In the project browser, click on Add [image].

  3. In "Add" window, select Virtual in the tree at left.

  4. Give a name for this axis and ends by clicking on Add


Liste des paramètres d'un axe virtuel

Virtual axis parameters list

This window allows obtaining the complete list of the virtual axis parameters by the mean of a double click on the virtual axis name.


Configuration

Setup

Internal Node : Internal node of the virtual axis. Do not change.


Modbus RTU

Node modbus : Node number used by the virtual axis on the communication in Modbus RTU


CANopen

Node CANopen : Node number used by the virtual axis on the CANopen network.


Suppression d'un axe virtuel

Deleting a virtual axis

  1. In the project browser, select Setup.

  2. Expand internal peripheral list by clicking "+" in front of « Internal ».

  3. In the project browser, left click on the virtual axis to remove.

  4. In the project browser, click on Delete [image].

  5. Confirm the deleting buy clicking on OK on the warning screen.


Ajout d'un axe IMD

Adding an IMD axis

  1. In the project browser, select Setup Tab.

  2. In the project browser, click on Add [image].

  3. In "Add" window, select IMD in the tree at left.

  4. Give a name for this axis and ends by clicking on Add

  5. Setup the IMD axis :

    1. By importing a parameter file from the library

    2. By copying an existing IMD drive using « Create from » check box

  6. Ends by clicking on Add


Configuration EtherCAT

IMD axis parameters list

This window allows obtaining the complete list of the virtual axis parameters by the mean of a double click on the axis IMD name.


Variateur

Drive

  • Mode : Operating mode of the regulation (Torque, velocity or position)

  • Model : Model of connected IMD drive

  • Node : Node number of drive on the EtherCAT network

  • Nominal current (A) : nominal current of drive

  • Max current (A) : maximal current of drive

  • Nominal voltage (V) : nominal voltage of drive (230v or 400v)

  • Simulation : Change of the axis in mode "Simulation". Allows getting the MPC to operate without connected IMD.


Régulation

Regulation

Action: principal window for the parameters setup of the drive regulation. It allows the access to the other regulation windows and to the setup windows.

  • Simple loop:

The 3 regulation loops use the same position feedback (Resolver or SinCos). It is possible to modify the direction of the position feedback from this screen.

  • Double loop:

The position loop uses a position feedback (Resolver or SinCos) different from both others regulation loops (torke and velocity). It is possible to modify the direction of the position feedback from this screen.

Current loop

Action: Setup the current loop of the drive

  • Source: Selection of the source (value, analogue input or RS232) expressed in percentage of maximal motor current.

  • Acceleration limit : Limit of the slope of the current change

  • Current limit: Current limit in percentage of the maximal current motor.

  • Integral gain : Regulation

  • Proportional gain : Regulation

The acceleration and current limits are accessible in advanced parameters mode.

Speed loop

Action: Setup the drive speed loop

  • Source : Selection of the source : value, analogue input, RS232

  • Acceleration limit: Limit of the speed slope

  • Speed limit : Speed limit in percentage of the nominal speed

  • Integral gain : Regulation

  • Proportional gain : Regulation

Match table between the acceleration limit percentage and the time necessary to change from 0 to the nominal motor speed:

The acceleration and speed limits are accessible in advanced parameters mode.

Position loop

Action: Setup the position loop of the drive.

  • Anticipation: Ensures a following error close to zero at constant speed by adding to the source a proportional component to the theoretical speed.

  • Proportional gain: Defines the tightness of the position regulation. A too low value gives a slack control; a value too high makes the system unsteady.


Entrées/sorties analogiques

Analog inputs / outputs

Action: Setup the analog inputs and outputs.

Analogue inputs:

In current loop, Analogue 1 can be use as demand source and Analogue 2 as limit current with maximum value: Inom * Imax (see Parameter \ Motor).

  • Scale : 10V= : Allow to choose the range for 10V. 100% corresponding to the maximal current or speed.
    Ex : Nominal speed = 3000tr/min

Maximal speed = 110 %

Voltage on the channel 1 -> ± 5V

We will get a maximal motor speed of 3300 tr/min and we will choose a scale of 200 % to match to 5V at the maximal speed.

  • Offset : Adds an offset to the received real value.

Analogue output:

  • Scale : Allows to choose the range of the output sign.


Sécurité

Security

Action: Adjust the security parameters for a maximal security.

DC Bus

Factory settings: do not modify it.

In case of external resistor is necessary, tick the box external resistor (if it is not ticked, the drive will use the parameters by default to manage the ballast).

This resistor will be well sized under pain of deterioration of it, its setting is accessible in advanced parameters.

  • Under voltage: active per default, minimum voltage of the drive when it is servo. Creates the default E02 under voltage.

  • Over voltage: active per default, maximum voltage of the drive. Creates the default E01 over voltage.
    : This parameter can be changed only if you are in factory mode and if the parameter nominal voltage is on « other » (parameters window, drive tab) otherwise a value per default will be attributed to it (390 for a drive 230V, 780 for a drive 400V).

  • External brake resistor : to activate only if an external resistor has been connected to the drive.

  • Braking level : allows to define from which voltage the DCBus over voltage will be cleared by the brake resistor.
    : This parameter can be changed if you are in factory mode and if the parameter nominal voltage is on « other » (parameters window, drive tab) otherwise a value per default will be attributed to it (375 for a drive 230V, 750 for a drive 400V).

  • Ton and period : allow to define the activation duration of the brake resistor :
    As long as the duration Ton is not exceeded the over voltage DCBus can be cleared by the brake resistor after the drive had gone in default E01 over voltage.
    : These parameters are used if the external brake resistor is activated otherwise default values will be attributed to them.

Temperature

Factory settings, do not change it.

  • Motor temperature: allows to define the exceeding level and the duration of motor temperature to induce the default E07..

  • Temperature IGBT: allows to define the temperature level and the exceeding duration of the module IGBT to induce the default E06.

Current

Factory settings, do not change it.

  • I²t : The motors brushless accept current crêtes (up to twice the nominal current). I2t allows controlling the average current of the drive, knowing that this one should not exceed the nominal current. Under stabilized operation, I2t must remain at 0. The duration allows to define the period on which the control of the average current is made.

  • Over current : The drive continuously controls if the current is in a certain range (depend on the type of the drive) ; if this current is off limit during the over current parameter duration, then the drive will be in default E04 over current.


Moteur

Motor

Action: Setup the motor and choose the type of motor feedback associated to the drive.

Motor

  • Nominal current : Nominal current of motor in A.

  • Maximal current : Percentage regarding to the nominal current. Per default 200% (Imax = 2 * Inom).

  • Nominal torque : Nominal torque of motor in Nm

  • NB pair of poles : According to the motor type (make an autotunning resolver).

  • Nominal speed : Nominal speed of motor in tr/mn

  • Maximal speed : Percentage of the nominal speed used in the speed loop to limit the motor speed.

Temperature sensor

  • Type : Factory setting (PTC or NTC).

  • Probe PTC : the error is triggered when the probe resistor is greater than the drive level.

  • Probe NTC : the error is triggered when the probe resistor is lower than the drive level.

Motor feedback

  • Type : Choice of motor feedback : resolver feedback X11 or SinCos feedback X13.


Résolveur / Sincos

Resolver / Sincos

Action: Setup the motor feedback associated with the drive.

Resolver

Action: Allows the setup of the resolver feedback of the drive

  • Offset : resolver alignment.

  • NB pair of poles : indicates the number of pairs of resolver poles.

  • Concerning a resolver with several pairs of poles, the rotor position on a rev. could be indent to NB pairs of poles / 360° (ex : 0, 120° or 240° for a resolver with 3 pairs of poles). In the same way, a home on TOP Z can be indent to NB pair of poles / 360°.

Sincos

Action: Allows the setup of the drive SinCos feedback

  • Resolution : Set the resolution in increments number (4 increments per point). Ex : for an encoder 500 points set 2000 increments.

  • Serial link : if any is selected, then the position feedback is relative ; if Hiperface is selected, we receive an absolute position.

  • In case of fault on the serial link, a resolver error E08 will happen at the request control.


Entrée sortie codeur multifonction

Multifunction encoder input output

Action: Setup the input and output encoder multifunction.

Input encoder multifunction

Action: Allows the parameters setup of input encoder

Incremental mode :

  • Resolution: Master encoder: set the resolution in increments number (4 increments per point). Ex : for an encoder 500 points set 2000 increments.

Stepper mode:

Allows the connection of a stepper motor command from a any manufacturer to the drive IMD. Both step number and rotating direction are adjustable.

  • Resolution : Master encoder : set the resolution of STEPPER encoder in increments number.

SSI Mode:

Allows the connection of an absolute encoder of SSI type for the master encoder functions or double loop regulation (position loop feedback).

The gearbox position is calculated from the absolute cyclic signs on the input encoder.

  • Bit : Number of bits setting the position information (from 2 to 31).

  • Frequency : Clock frequency (1,5 Mhz maxi)

  • Resolution : Master encoder : set the encoder resolution in increments number.

  • Code GRAY: Yes/No (depend on encoder type)

Warning: The resolution must be lower or equal to 2^nb Bit and the maxi duration for a testing (2^nb Bit / Frequency) must be lower to 100µs.

Multifunction encoder output

Action: Allows the parameters setup of the output encoder

  • Inactive mode: The encoder output is not used.

Active mode: The encoder output refers to an incremental sign regarding to the selected source and the captured resolution.

Mode bypass: (incremental encoder) Multifunction encoder input is copied on the encoder output.

  • Source : Resolver, SinCos, Multifunction input (incremental, stepper, SSI), Virtual, Analogue

  • Resolution: the resolution of the encoder output in increments number.


Codeur auxiliaire

Auxiliary encoder

Action : setup the auxiliary encoder


Suppression d'un axe IMD

Deleting an IMD axis

  1. In the project browser, select Setup.

  2. Expand internal peripheral list by clicking "+" in front of « EtherCAT peripherals».

  3. In the project browser, left click on the IMD axis to remove.

  4. In the project browser, click on Delete [image].

  5. Confirm the deleting buy clicking on OK on the warning screen.


Ajout d'un module E/S

Adding an I/O module

  1. In the project browser, select Setup Tab.

  2. In the project browser, click on Add [image].

  3. In "Add" window, select CANopen I/O in the tree at left.

  4. Give a name for this CANopen I/O module and ends by clicking on Add


Configuration CANopen

CANopen setup

CANIO

Action: RIO40 module setup

Node: Node number of Inputs / Outputs module on the CANopen network.


Suppression d'un module E/S

Deleting of an I/O module

  1. In the project browser, select Setup.

  2. Expand internal peripheral list by clicking "+" in front of « CANopen peripherals».

  3. In the project browser, left click on the CANopen I/O module to remove.

  4. In the project browser, click on Delete [image].

  5. Confirm the deleting buy clicking on OK on the warning screen.


Axes

IMD axis motion parameters list

Accessible with a double click on the IMD axis name, this window allows getting the complete list of motion parameters of the drive.


Principal

Action: Define the axis kinematics.

Gearbox

  • RIn : Input ratio of gearbox

  • Rout : Output ratio of gearbox

For RIn revolution at gearbox input we get Rout revolution at gearbox output. The gearing down ratio is then Rout / Rin

Unit

  • Position : Logical unit of axis position. The captured unit is only informative and does not enter in the positions calculation.

Position

  • Distance for a Rout : Covered distance by the axis for a revolution in gearbox output

  • Invert direction of rotating motion : Inverts the movement direction of the axis position regarding the physical moving of the main shaft

Modulo

  • Active : Activates the modulo on axis

  • Value : Axis modulo value

Example 1 : Infinite axis

Engine in end of ball screw with the step of 5mm.

Units = mm, Rin = 1, Rout = 1, Distance per revolution = 5.000, Modulo non activate

Example 2 : Infinite axis

Motor with gearbox of 10.

In gearbox output, capstan 360°, Units = degrees, Rin = 10, Rout = 1, Distance per revolution = 360.000, modulo activated with a value of 360.000


Profil

Profile

Action: Define the axis profile by default. This profile is used as default value in the movement instructions (if any instruction as VEL, ACC or DEC does not define a profile value). The Motion tool and the instructions which use the percentages use these values as below.

  • Speed : default axis speed

  • Acceleration : default axis acceleration

  • Deceleration : default axis deceleration

  • Urgent deceleration : Urgent deceleration, used when a limit is reached or at disable time, if the option "Use the urgent deceleration at disable time" is active.

  • "S" factor : allows having accelerations and decelerations in S shape, what relieve the movements beginnings and endings. The acceleration with a S factor. can vary from 0 to 200% of the acceleration indicated in the speed profile.

Sine acceleration development is in progress and is not available in this version.

  • Use the deceleration at disable time : Allows to induce a deceleration following the urgent deceleration slope at disable time before disabling axis in order to slow down the axis instead of continuing to coast.


Prise d'origine

Home

Action: Define the home parameters of the axis. These parameters are used by the home instruction by Motion Tool.

  • Type : Defines the home type for the motion tool. The HOME instruction can also use this parameter setting -1 as type in the instruction.

  • Input : Input used in some home types. The input can be the input E4 of the IMD or a MPC input.

  • Speed : Speed applied to the axis during the home moves.

  • Zero program : referenced physical position where the logical zero is.

The home types are detailed under the heading « Movement control programming | Axis setup | Home »


Contrôle

Control

Action: List all control axis parameters

Position

  • Following error : As soon as the axis is in servo mode, it is controlled at any time : when stopping, in movement. If the difference between its calculated theoretical position and its real position given by the encoder feedback is greater than the maxi following error, the axis is deactivated. The adjustment of this value is very important: a too small value causes spurious shutdowns on the axis, a too large value influences the safety of the electric and mechanical units.

The value of the following error is in the selected unit and depends on the parameters of the Motion control \ Units screen.

  • Position window : This parameter is used to change the minimal position window between the real and the theoretical position. After a moving, if the difference between the real and the requested position is lower than the window position, the system considers that the position has been reached.
    The value of the following error is expressed in the selected unit and depends on the parameters of the Motion control \ Units screen.

Limits

  • Mini :

  • Maxi :

Urgent deceleration (motion control/ speed profile) is used to stop the movement when we use the inputs of end movement when the drive is in position mode.

Inputs outputs

  • Fonction de l'entrée E1 :

  • Fonction de la sortie S1 :

  • Fonction de la sortie S2 :

The Drive Ready output should be connected in series in the emergency stop loop. If the brake is selected on the output 2, it is necessary to insert an extern static relay (the output nr 2 being limited at 100 mA) with a protection diode.

The logical state of the brake output corresponds to the internal drive enable.


Auxiliaire

Auxiliary

Action: List all parameters of the auxiliary encoder input

Position

  • Distance for a Rout : Distance covered by the auxiliary encoder for a revolution in output of gearbox

  • Rotation direction invert : Inverts the direction development of the auxiliary encoder position regarding to the physical moving.

Unit

  • Position : Logical unit of the auxiliary encoder. The captures unit is only informative and does not enter in the positions calculation.

Home

  • Zero program : Physical reference position where is located the logical zero.

Modulo

  • Active : Activates the modulo on the auxiliary encoder

  • Value : Value of modulo axis


Liste des paramètres Motion dun axe Virtuel

Virtual axis motion parameter list

Accessible from a double click on the Virtual axis name, this window allows getting the complete list of motion parameters of the virtual axis.


Principal

Action: Define the kinematics of virtual axis.

Gearbox

  • RIn : Ratio of gearbox input

  • Rout : Ratio of gearbox output

For RIn revolution at gearbox input we get Rout revolution in gearbox output. The gearing down ratio of the gearbox is then Rout / Rin

Unit

  • Position : Logical unit of the axis position. The captured unit is only informative and does not enter in the positions calculation.

Position

  • Distance for a Rout : Distance covered by the axis for a revolution in gearbox output

  • Rotation direction invert : Inverts the direction development of the axis position regarding to the physical moving of the main shaft.

Modulo

  • Active : Activates the modulo on the axis

  • Value : Value of axis modulo

Example 1 : Infinite axis

Motor at the end of ball screw with the step of 5mm.

Units = mm, Rin = 1, Rout = 1, Distance per revolution = 5.000, Modulo non activated

Example 2 : Infinite axis

Motor with gearbox of 10.

In gearbox output, capstan 360°, Units = degrees, Rin = 10, Rout = 1, Distance per revolution = 360.000, modulo activated with a value of 360.000


Profil

Profile

Action: Define the axis profile by default. This profile is used as default value in the movement instructions (if any instruction as VEL, ACC or DEC does not define a profile value). The Motion tool and the instructions which use the percentages use these values as below.

  • Speed : default axis speed

  • Acceleration : default axis acceleration

  • Deceleration : default axis deceleration

  • Urgent deceleration: Urgent deceleration, used when a limit is reached or at the time of deactivation, if the option "Use the urgent deceleration at disable time" is active.

  • "S" factor: allows having accelerations and decelerations in S shape, what relieve the movements beginnings and endings. The acceleration with a S factor. can vary from 0 to 200% of the acceleration indicated in the speed profile.

Sine acceleration development is in progress and is not available in this version.

  • Use the deceleration at disable time : Allows to induce a deceleration following the urgent deceleration slope at disable time before disabling axis in order to slow down the axis instead of continuing to coast.


Ajout d'un profil

Adding a cam profile

  1. In the project browser, select Motion Tab.

  2. In the project browser, click on Add [image].

  3. In "Add" window, select Cam profile in the tree at left.

  4. Give a name for this cam profile and ends by clicking on Add


Profiles de cames

Cam profiles editor presentation

Accessible from a double click on the cam name this editor allows creating / modifying the electronic cams to be executed on the axes.

The editor is composed of a graphic editor of cam in the higher part and of a zone of options distributed on three tabes.

  • Speed and acceleration

  • Table

  • Parameters

Graphic cam editor

This graphic editor gives a representation in the form of axis moving curve at the various positions of the cam. The cam points are represented by crosses on the graph.

  1. A Tool bar allows a fast access to the basic functions of the cam edition :

Cursor

Icon:

Meaning: Activates the cursor tool. Allows the measures of location on the editor screen. For that, click on the graphic editor at the place where the origin of measurement is. A small red cross appears at the position of the origin.

Move

Icon:

Meaning: Activates the tool of points moving. This tool authorizes the manual placement of the points on the screen.

Insert

Icon:

Meaning: Activates the tool of point insert. Owing to this tool we insert points one by one to form the axis moving curve.

Remove

Icon:

Meaning: Activates the tool of point removing. By clicking on a point with this tool, it is removed and the curve is recalculated taking into account of this modification.

Auto pan

Icon:

Meaning: Auto pan of the curve on the screen in such a way that it will be entirely visible.

Zoom selection

Icon:

Meaning: Activate the zoom tool by selection. Select a screen zone using this tool by keeping the button of the mouse engaged. While slackening, the selected zone is increased to occupy the totality of the edition window.

  2. A tool of vertical zoom is at the disposal of the user to refine the positioning of the points on the cam. This tool is provided with two arrows allowing the enlarging like the reduction of the scale. A bar allows the vertical shift of the curve with regard to the editor screen.

  3. Permanently, the position on the curve is available in order to precisely place the points.

  4. The graphic zone of edition allows the placing of the points, displacements, zoom of the curve. In mode "Cursor" click on the graph allows placing the origin of the measurement indicated in (3). This allows measuring the distances. In mode « Moving » a red square appears to indicate the chosen point. Click on the point to move it.

  5. A tool of horizontal zoom is at the disposal of the user to refine the positioning of the points on the cam. This tool is provided with two arrows allowing the enlarging like the reduction of the scale. A bar allows the horizontal shift of the curve regarding to the editor screen.


Onglet vitesse et accélération

Speed and acceleration tab

The tab « Velocity and acceleration » gives access to the velocity display and the acceleration resulting from the curve of captured position.


Table

Table tab or list cam editor

The tab « Table » gives access to the table of cam points.

  1. A tool bar allows a fast access to the basic functions of the list edition:

Insert

Icon :

Meaning: Activates the tool of point insert. Owing to this tool we insert the points, one by one, to form the moving axis curve.

Remove

Icon :

Meaning: Activates the tool of point removing. By clicking on a point with this tool, it is removed and the curve is recalculated taking into account of this modification.

  2. In this table we list the points with their coordinates X,Y and the slope dX,dY. The field mode indicates the calculation method of the slope at the corresponding point. According to the chosen mode, we get some different values for dX and dY. The field mode is not transmitted in the MPC. The mode is read from the values of dX and dY.

  • Mode Line : dX=X and dY=1. In this mode, a straight line is automatically calculated between this point and the following one.

  • Mode Manual : dX and dY are free. In this mode dX and dY determine the slope at the point as dY/dX.

  • Mode Auto : dX=X and dY=0. In this mode, the slope at point is automatically calculated as the arithmetical average of the slopes at the previous and next points.


Paramètres

Parameters tab

The tab « parameters » allows to define the cam.

  • Description : Information on the cam function.

  • Number : Number of cam points. Minimum 2.

  • Master begin : Origin of the positions on the master.

  • Master end : Maximal position on the master.

  • Unit : Unit on the master axis used for the graphic representation.

  • Slave begin : Origin of positions on the slave.

  • Slave end : Maximal position on the slave.

  • Unit : Unit on the slave axis used for the graphic representation.


Suppression d'un profil

Deleting a cam profile

  1. In the project browser, select Motion Tab.

  2. Expand cam profiles list by clicking "+" in front of « Cam profiles ».

  3. In the project browser, left click on the cam profile to remove.

  4. In the project browser, click on Delete [image].

  5. Confirm the deleting buy clicking on OK on the warning screen.


Affectation

Mapping

The mapping editor of the inputs/outputs has been created to define for each input its name, invert and filter. In the same way, for the outputs, it is possible to define the invert is the retreat value. Names can be affected with blocks of 8, 16 or 32 inputs or outputs. The choice of the invert, filter, number of filter and retreat value are only setup for unit inputs or outputs. The named inputs / outputs are used to create a file IO.POE used at the time of the compiling to declare the global inputs / outputs. The declarations of this file must be recaptured in the variables declaration of the programs which use it, without direct mapping (AT %XX.X).

  • Device : Name of the device to be setup

  • Name : Name of input, inputs block, output or outputs block.

  • Invert: Indicates if the input or output has been inverted.

  • Filter : Indicates if the input has been filtered.

  • Filter : Number of filter used by this input.

  • Retreat : Retreat value of the output in case of communication breaking.

  • Address : Address in the process image, calculated by the Motion Studio and useful to declare the inputs outputs in the file IO.POE.


Paramètrage des E/S MPC

MPC I/O setup

Accessible from a double click on MPC, this window allows getting the complete list of MPC inputs/outputs parameters. This window recaptures the insert values, filters of mapping tool of inputs / outputs and allows in addition the setting of the filters values.

  • Inputs 1 to 32 invert: Inputs invert in binary

  • Inputs 1 to 32 filter enable: Inputs filter enable in binary

  • Inputs 1 to 32 filter select : Inputs filter select in binary

  • Filter 1 (ms) : Filter 1 value in ms

  • Filter 2 (ms) : Filter 2 value in ms

  • Outputs 1 to 32 invert : Outputs invert in binary

The outputs parameters are indicated by a block of 32 outputs. The MPC having only 24 outputs, the other bits of this value are not taken into account.


Paramètrage des E/S IMD

IMD I/O setup

Accessible from a double click on the axis name IMD, this window allows getting the complete list of drive inputs/outputs parameters. This window recaptures the insert values, filters of mapping tool of inputs / outputs and allows in addition the setting of the filters values.

  • Inputs 1 to 32 invert: Inputs invert in binary

  • Inputs 1 to 32 filter enable: Inputs filter enable in binary

  • Inputs 1 to 32 filter select : Inputs filter select in binary

  • Filter 1 (ms) : Filter 1 value in ms

  • Filter 2 (ms) : Filter 2 value in ms

  • Input 1 function : allows a mapping of an automatic function to the input 1 (Enable)

  • Outputs 1 to 32 invert: Outputs invert in binary

  • Retreat : Retreat value of the outputs 1 to 32. Value mapped to the outputs in case of communication breaking in binary.

  • Output 1 function : allows a mapping of an automatic function to the output 1 (Drive ready)

  • Output 2 function : allows a mapping of an automatic function to the output 2 (Brake output)

The inputs parameters are indicated by a block of 32 inputs and the outputs parameters by a block of 32 outputs, the other bits of these values are not taken into account.


Paramétrage des E/S CANIO

CANopen I/O setup

Accessible from a double click on the name of CANopen I/O module, this window allows getting the complete list of CANopen inputs/outputs parameters. This window recaptures the insert values, filters of mapping tool of inputs / outputs and allows in addition the setting of the filters values.

  • Inputs number : Number of inputs present on the module. This value is used in the initialization function of the modules of CANopen inputs/outputs for the parameter setting of this last one.

  • Inputs address : Parameter calculated by the tool of inputs/outputs mapping and used in the initialization function of the modules of CANopen inputs/outputs for the parameter setting of this last one.

  • Inputs XX to XX invert : Inputs invert in binary, per block of 32 inputs according to the number of declared inputs.

  • Inputs XX to XX filter enable : Inputs filter enable in binary, per block of 32 inputs according to the number of declared inputs.

  • Inputs XX to XX filter select : Inputs filter select in binary, per block of 32 inputs, according to the number of declared inputs.

  • Filter 1 (ms) : Filter 1 value in ms

  • Filter 2 (ms) : Filter 2 value in ms

  • Outputs number : Number of outputs present on the module. This value is used in the initialization function of the modules of CANopen inputs/outputs for the parameter setting of this last one.

  • Outputs address : Parameter calculated by the tool of inputs/outputs mapping and used in the initialization function of the modules of CANopen inputs/outputs for the parameter setting of this last one.

  • Outputs XX to XX invert : Outputs invert in binary, per block of 32 outputs according to the number of declared outputs.

  • Retreat value of outputs XX to XX : Value assigned to the outputs in the event of rupture of communication into binary, per block of 32 inputs, according to the number of declared outputs.

A module of CANopen inputs/outputs which can have to 256 entries and 256 exits, the parameters of all these inputs/outputs are accessible in order to be able to modulate the size of the module according to the project evolution without being obliged to recreate it.


Configuration du multitâche

Multi task setup

Accessible from a double click on the word Tasks, this window indicates the multi tasks parameters.

  • Ageing time of cyclic tasks : Total cycle time for all cyclic tasks.

  • Watchdog action :

    • None : No action in case of a watchdog release of a task

    • System error without task stopping : The tasks are not stopped but a system error appears on the display

    • System error with tasks stopping : The tasks are stopped and a system error appears on the display

    • Warning: A warning signal appears on the display

    • System event : a system event is generated so that the program be able to manage this case.

  • Power reserved for Linux : Use percentage of the processor reserved for the operating system

  • Statistics period : Statistics calculation period shown in the performance tool.

  • Number of variables bank : Number of saved variable bank

  • Variable bank size: Size in bytes of a saved variables bank. Maximum 65283 bytes


Configuration des communications

Communications setup

Accessible from a double click on the word Tasks, this window indicates the field bus port parameters.

  • CAN communications priority: Defines the priority of the treatment task of CANopen messages in the operating system.

  • Modbus communications priority : Defines the priority of the treatment task of Modbus messages in the operating system.

  • Modbus TCP communication priority : Defines the priority of the treatment task of Modbus TCP messages in the operating system.

  • Minimal delay between two CAN messages : Defines the wait state on the BUS CANopen between two messages. Allows limiting the power supply so that the low devices could be able to treat all messages.

  • Minimal delay between two Modbus messages : Defines the wait state in Modbus between two messages. Allows limiting the power supply so that the low devices could be able to treat all messages.

  • Minimal delay between two Modbus TCP messages : Defines the wait state in Modbus TCP between two messages.
    Allows limiting the power supply so that the low devices could be able to treat all messages.


Création d'une tâche

Task creation

  1. In the project browser, select the tab Programming.

  2. In the project browser, click on the button Adding [image].

  3. In the window Adding, select Tasks in the left arborescence.

  4. Name and set your new task and then finish by clicking on Add


Configuration des tâches

Task setup

Accessible from a double click on the word Tasks, this window indicates the parameters of each task.

  • Name : Name of the task

  • Type : Type of the task (Cyclic, Timer, user event or system)

  • Priority : Task priority. See the chapter Programming language | The tasks | Tasks priority for further information.

  • Startup :

    • Automatic : Automatic startup at the end of the initialization task

    • Manual : Manual startup by instruction RUN in a program

    • Initialization : Exclusive startup before the other programs startup

  • Inputs/Outputs handle :

    • Direct : Use of the instructions INP and OUT in order to manage directly the inputs / outputs

  • By process image : Use of inputs / outputs declared in the mapping editor. The inputs / outputs are updated by the process image at the beginning and end of the task. See the chapter programming language | The tasks | Tasks principle for further information.


Modification d'une tâche

Task modification

Modification of the task parameters:

  1. In the project browser, select the tab Programming

  2. In the project browser, double click on the name « tasks ».

  3. In the window Modification, select the task to be modified from the left arborescence.

  4. Modify the parameters of your task and close the window.

Rename a task:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks by clicking on the + in front of « tasks ».

  3. Then click right on the task and select Rename in the contextual menu.

Move a task:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks by clicking on the + in front of « tasks ».

  3. Then click right on the task and select Move up or Move down in the contextual menu to move the task.


Suppresion d'une tâche

Task deleting

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks in clicking on the + in front of « tasks ».

    • Check that the task does not contain any more program.

  3. In the project browser, click left on the task to be deleted.

  4. In the project browser, click on the button Deletion [image].

  5. Confirm the deletion by clicking on OK in the warning window.


Création d'un programme

Program creation

  1. In the project browser, select the tab Programming.

  2. In the project browser, click on the button Adding [image] .

  3. Display the arborescence of program types with a click on the + in front of « Programs ».

  4. Select a type of program from the list.

  5. Name and set your new program and then finish in clicking on Add.


Configuration des programmes

Programs setup

Accessible from a double click on the word Tasks, this window indicates the parameters of each program.

  • Name : program name

  • Type : Language used to write the program

  • Active : Defines if it must be added to the programs list of the running task.

  • Task : Name of the task to which it belongs.

  • Tab : Tab in the programs list of the task. Allows to define the executing order of the programs in the task.


Modification d'un programme

Program modification

Edition of a program:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks with a click on the + in front of « tasks ».

  3. Display the arborescence of programs with a click on the + in front of the name of the « task » containing the program to modify.

  4. Double-click on the program to modify from the list.

Rename a program:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks with a click on the + in front of « tasks ».

  3. Display the arborescence of the programs with a click on the + in front of the name of the « task » containing the program to modify.

  4. Then click right on the program and select Rename in the contextual menu.

Move a program:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks with a click on the + in front of « tasks ».

  3. Display the arborescence of the programs with a click on the + in front of the name of the « task » containing the program to modify.

  4. Then click right on the task and select Move up or Move down in the contextual menu to move the task.

Property of a program:

  1. In the project browser, select the tab Programming.

  2. In the project browser, double click on the name « tasks».

  3. In the window Modification, open the arborescence of the task containing the program to modify from the left arborescence.

  4. Open the arborescence of the task containing

  5. Then click right on the program and modify the parameters of your program

  6. Close the window in order to return to the editor.


Suppression d'un programme

Program suppression

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the tasks with a click on the + in front of « tasks ».

  3. Display in the arborescence the list of programs with a click on the + in front of the task containing the program to delete.

  4. In the arborescence, select the program to delete with a left click.

  5. In the project browser, click on the button Deletion [image].

  6. Confirm the deletion with a click on OK in the warning window.


Création d'un bloc fonctionnel

Function blocs creation

  1. In the project browser, select the tab Programming.

  2. In the project browser, click on the button Adding [image].

  3. Display the arborescence of types of functional block by clicking on the + in front of « Functional blocks ».

  4. Select a type of functional blocks from the list.

  5. Name and setup your new functional block and then finish by clicking on Add.


Modification d'un bloc fonctionnel

Function blocs modification

Edition of a functional block:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the functional blocks by clicking on + in front of « functional blocks ».

  3. Double-click on the functional block to be modified from the list.

Rename a functional block:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functional blocks by clicking on the + in front of « functional blocks ».

  3. Then click right on the functional block and select Rename in the contextual menu.

Move a functional block:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functional blocks by clicking on + in front of « functional blocks ».

  3. Then click right on the functional block and select Move up or Move down in the contextual menu in order to move the task.


Suppresion d'un bloc fonctionnel

Function blocs deleting

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functional blocks by clicking on the + in front of « functional blocks ».

  3. In the arborescence, select the functional block to delete with a left click.

  4. In the project browser, click on the button Deletion [image].

  5. Confirm the deletion by clicking on OK in the warning window.


Création d'une fonction

Function creation

  1. In the project browser, select the tab Programming.

  2. In the project browser, click on the button Adding [image].

  3. Display the arborescence of function types by clicking on the + in front of « Functions ».

  4. Select a function type from the list.

  5. Name and setup your new function and then finish by clicking on Add.

Warning

The setup of the function return is done in the editing window of the task.


Modification d'une fonction

Function modification

Edition of a function:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functions by clicking on the + in front of « functions ».

  3. Double-click on the function to be modified from the list.

Rename a program:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functions by clicking on the + in front of « functions ».

  3. Then click right on the function and select Rename in the contextual menu.

Move a program:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functions by clicking on the + in front of « functions ».

  3. Then click right on the function and select Move up or Move down of the contextual menu in order to move the task.

Modify the return of a function:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of functions by clicking on + in front of « functions ».

  3. Double-click on the function to be modified from the list.

  4. The type of return of the function is displayed in the left higher corner of the edition window of the function, click on the button Change.

  5. Capture the new type of return and press OK to validate.


Suppresion d'une fonction

Function deleting

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of the functions by clicking on the + in front of « Functions ».

  3. In the arborescence, select the function to be deleted with a left click.

  4. In the project browser, click on the button Deletion [image].

  5. Confirm the deletion by clicking on OK in the warning window.


Ajout d'un fichier de type de données

Data type file adding

  1. In project browser, select Programming tab.

  2. In project browser, click on Add [image].

  3. Click on « Types definition »:

  4. Give a name for this axis and ends by clicking on Add.


Modification d'un type de données

Data type file modification

Data type file editing:

  1. In the project browser, select Programming tab.

  2. Display the arborescence of data types with a click on the + in front of « TypeDefs ».

  3. Double click on « Usertype.TYP » or on another data type file that you have created, to open data type editor.

Data type file renaming:

  1. In the project browser, select Programming tab.

  2. Display the arborescence of data types with a click on the + in front of « Typedefs ».

  3. Right click on the data type file and select rename in the contextual menu.

Data type file moving:

  1. In the project browser, select Programming tab.

  2. Display the arborescence of data types with a click on the + in front of « Typedefs ».

  3. Right click on the data type file and select move up or move down in the contextual menu.


Suppression d'un type de données

Data type file deleting

  1. In the project browser, select Programming tab.

  2. Display the arborescence of data types with a click on the + in front of « Typedefs ».

  3. In the arborescence, select the file to delete with a left click.

  4. In the project browser, click on delete [image].

  5. Confirm the deletion with a click on OK in the warning window.


Ajout d'un variable globale

Global variable file adding

  1. In the project browser, select the tab Programming.

  2. In the project browse, click on Add [image].

  3. Click on « Global variables »:

  4. Name your new global variable file and then finish by clicking on Add.


Modification d'une variable globale

Global variable file modification

Global variable file editing :

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of global variables with a click on the + in front of « Global variables ».

  3. Double click on « Global.POE » or another global variable file that you have created, to open global variables editor.

Rename a global variable file:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of global variables with a click on the + in front of « Global variables ».

  3. Right click on the global variables file and select rename in the contextual menu.

Move a global variable file:

  1. In the project browser, select the tab Programming.

  2. Display the arborescence of global variables with a click on the + in front of « Global variables ».

  3. Right click on the global variables file and select move up or move down in the contextual menu.


Suppression d'une variable globale

Global variable file deleting

  1. In the project browser, select Programming tab.

  2. Display the arborescence of global variables with a click on the + in front of « Global Variables ».

  3. In the arborescence, select the file to delete with a left click.

  4. In the project browser, click on delete [image].

  5. Confirm the deletion with a click on OK in the warning window.


Editeur de variables sauvegardées

Opening saved variables editor

  1. In the project browser, select Programming tab.

  2. Click on + in front of « G lobal variables ».

  3. Double click on « Saved variables editor ».


Utilisation de l'éditeur de variables sauvegardées

Saved variables editor using

Selecting a bank

In the upper left corner, choose a memory bank

Adding a saved variable

Click on add
The editor automatically create a variable VARxx at the end of the table

Modifying a saved variable

Click on the variable's cell

Deleting a saved variable

Click on a cell to select the variable

Click on delete

Check saved variables

At the end of the variables declaration, click on check


Fermeture de l'éditeur de variables sauvegardées

Saved variables editor closing

Before closing the saved variables editor, start a table check by clicking on

Check if error messages appears in the console

If error messages appears, they must be fixed to be able to save and close editor.


Ouverture de l'éditeur de variables d'échange

Exchange variables editor opening

  1. In the project browser, select Programming tab.

  2. Click on + in front of « Global variables ».

  3. Double click on « Exchange variables editor ».


Editeur de variables d'échange

Exchange variables editor using

Adding an exchange variable

Click on add
The editor automatically create a variable VARxx at the end of the table

Modifying an exchange variable

Click on the variable's cell

Delete an exchange variable

Click on a cell to select the variable

Click on delete

Check exchange variables

At the end of the variables declaration, click on check


Fermeture de l'éditeur de variables d'échange

Exchange variables editor closing

Before closing the exchange variable editor, start a table check by clicking on

Check if error messages appears on the console:

If error messages appears, they must be fixed to be able to save and close the editor.


Tableau de bord

Instrument display

Accessible from a double-click on Panel, this tool allows to control the MPC hardware state.

  • CPU : Gives the CPU temperature.

  • Battery : Indicates the saving battery state. If the saving battery is indicated as low, the first time, it is not enough discharged to loose the data, but it must have to be rapidly replaced.

  • PFD : Gives information on the detection of power supply defaults

    • State : current state physically provided by the fail sector detector.

    • Detects : A number of detects of sector fail since the power-up . If this figure is regularly incremented, the power supply 24 v is insufficient or damaged.

    • Fault : Indicates that a fault has been detected.

    • Cumul : Cumul of detected faults number. This figure normally increases at each time you switch off.

    • Raz : Reset of the fault indicator.

  • Dips : MPC configuration dip switch state.

  • VCore, V3.3, V5 : MPC power supply voltage state.


Entrées / Sorties

Inputs / Outputs

Accessible from a double-click on Inputs / Outputs, this tool allows controlling the MPC inputs / outputs state. Physical and logical states are indicated on this screen.

It is possible to operate the inputs and outputs by changing the inverts.

While clicking on the outputs indicators it is also possible to modify them if they are not used in one of the task using an image of process. Indeed, this last one periodically comes to physically write the outputs it uses, from the moment where they are declared in one of the task programs.


Hyper-Terminal

Accessible with a double click on Hyper-terminal, this tool allows controlling the tasks/programs state, the visualization of the axes state and the variables value.

The tool is composed of three removable distinct zones on the screen by means of separators.

  1. A zone containing the displayable elements of the system gathers available visualizations on the axes and all the variables of the project distributed by instance.

  2. The tasks and programs state they contain is accessible in this zone. A tools bar makes possible to manage the tasks execution.

Stop

Icon:

Signification: Stop the selected task.

Run

Icon:

Signification: Starts the selected task.

Suspend

Icon:

Signification: Suspend the execution of the selected task.

Continue

Icon:

Signification: Continue the execution of the selected task.

  3. A tools bar makes possible a quick access to the visualization tool functions:

Debug

Icon :

Signification: Activate / deactivate the display unit of the variables value or the axes state.

Add

Icon:

Signification: Add the selected element of the visualization list of the elements, in the list of visualization in progress.

Remove

Icon:

Signification: Remove the selected element.

Open

Icon:

Signification: Open a visualization list on file.

Save

Icon:

Signification: Save the visualization list in progress in a visualization list on file.

Remove all

Icon:

Signification: Remove the visualization list in progress.


Oscilloscope

Scope

Accessible from a double-click on Scope, this tool allow real time data observations.

This tool is composed of three zones, movable by separator and a tool bar.

- In the center, the captured data visualization

- On the right, the tool bar

Continuous

Icon :

Action : Start automatic sampling. At the end of a sampling, the data are shown and the next sampling is started.

One-shot

Icon :

Action : Start only one sampling.

Forced trigger

Icon :

Action : Force the programmed trigger activation.

Stop

Icon :

Action : Stop the current sampling and show captured data.

Zoom +

Icon :

Action : Increase zoom deepness.

Zoom -

Icon :

Action : Decrease zoom deepness.

Selection zoom

Icon :

Action : Zoom on a selected zone.

Pan

Icon :

Action : Move the display zone.

Original zoom

Icon :

Action : Restore the original zoom.

Measures

Icon :

Action : Show / hide the measure tool.

The measure tool can evaluate value and time ranges.

To do so, the current X and Y positions and the difference against reference are shown.

The measure line is a continuous line and the reference line is a discontinuous line.

Move the current time line.

Exchange the current time measure and reference lines.

Move the current value line.

Exchange the current value measure and reference lines.

Recording

Icon :

Action: Record in HTML format file the captured curves and the associated parameters.

- On the left, the observed data list

Each channel is configurable by clicking on the separator. You can then choose :

- Offset : Shift the curve vertically

- Color : Select the curve's color

- Activation : Show / hide the curve without loosing data.

- Factor : Increase or decrease the visualization range to be able to compare.

To select the source, we open the selection list :

A source can an peripheral measurable value (axe ...), a program variable.

A calculation can be used to apply a formula to existing channel to create a new one.

The formula use the other channels (CH1, CH2, CH3, CH4 ... ) and the operators and mathematical functions below :

- Basic operators : +, -, *, /, ^, DIV, MOD

- Trigonometric operators : SIN, COS, TAN, SINH, COSH, ARCTAN

- Unary mathematics operators :

EXP : Exponential

LN : Napierian logarithm

LOG10 : Log base 10

LOG2 : Log base 2

SQR : Square

SQRT : Square root

ABS : Absolute value

TRUNC,INT : Integer part

CEIL : Upper round

FLOOR : Lower round

HEAV : Negative

SIGN : Sign

ZERO : Zero

PH : Phase

RND : Random number

RANDOM : Random number

- Binary mathematics operators :

MAX : Maximal value

MIN : Minimal value

ARG : Two vectors angle

POWER : Power

INTPOWER: Integer power

LOGN : Napierian logarithm

- At the bottom, capture and visualization setup

The trigger allow to define the event or the particular condition on data that start sampling.

To do so, we must select :

- A source, selected from the same list as channels.

- The detected variation on this source : Rising on falling edge

- The time position of this event in the sampling.

The 0 position is the beginning. If the position is greater than 0, we can observe, during the duration defined by position, what was the data before and after the event.

- The reference level above (rising edge) or under (falling edge) the source must go to start sampling.

When the trigger is selected, we must define the sampling and visualization conditions.

The amplitude define the data visualization conditions on the screen. In Auto mode the scope choose automatically to right values.

That is a good choice for the first sampling. For the next samplings and if we want to observe some amplitude variations it's recommended to disable this function.

Even so, it's possible to choose resolution and sampling duration. In auto mode, the resolution in calculated with the duration in order to obtain a good refresh time with enough data fineness.


Performances

Accessible from a double click on scope, this tool allow to observe real time system performances.

To do so, it's indicated, for each task, critical execution informations :

  • State : Tasks execution state

  • Processor : This column is grouping tasks execution times seen by processor without taking tasks interruptions into account.

  • Proc (%) : Task processor usage in percent

  • Duration (µs) : Task duration on the processor

  • Max (µs) : Maximal task duration on the processor

  • Cumul (ms) : Observed execution time sum

  • Cycle : This column is grouping tasks cycle execution time including higher priority tasks interruptions

  • Duration (µs) : Current total execution time of the task cycle

  • Max (µs) : Maximal total execution time of the task cycle

  • Watchdog : Number of tasks watchdog triggering caused by a too long execution time

  • # Cycles : Number of done cycles

  • Manqués : Number of missed cycles caused by a lack of execution time


Informations

Accessible by a double click on Information, this tool allow to obtain detailed informations about the MPC and it's usage.

With this tool we can get a summary or detailed information depending on the chosen page. The detailed informations are only interpretable by SERAD technical service, it's not necessary to view it directly. Therefore, a SERAD technician can ask a report generation from these informations.

To do so, click on Report to generate it and send it by yourself or click on E-Mail to generate and send it immediately.

The summary is composed of two parts :

The hardware part is grouping MPC's hardware specifications

The usage part is grouping information concerning the resources consumption.


Alarmes

Alarms

This screen tabes the defects detected on the MPC.

Release

Icon:

Action: Request of release of displayed defaults which were corrected. If the default source is still present, this one cannot be released.


Messages

Log

Accessible by a double click on Log, this tool allow to show the MPC's event history.

The event observation begins with a update from the MPC by clicking on "Update".

The upper part of this tool is a chronological banner, in which the events are indicated.

A question mark indicate an information, an exclamation mark an error. By selecting a date on the banner, the list is shown.

The list on the right is used to setup which event must be recorded or not. The recording on compact flash period is also available on the page.

History can also be cleared.


Console

Accessible from a double-click on Console, this tool allow to access on MPC's system console. This console is also available by connecting a keyboard and a screen directly on the dedicated connectors. Therefore, using this tool is complex and it's mostly recommended to not use it only at the SERAD technical service request.


Tableau de bord

Instrument display

Accessible by a double click on Instrument display, this tool allow to control hardware status of IMD and motor.

  • I²t : Indicate an estimation of the motor heating. If this value progressively increase, the motor is not correctly dimensioned. If this value increase quickly stationary, regulation and mechanical must be checked carefully. In normal working, the I²t can increase, but only briefly.

  • Ballast: Indicate an estimation of the DC Bus resistor usage. In normal working, the I²t can increase, but only briefly, only during deceleration phases. If this value increase progressively, the DC Bus resistor is not well sized. If the internal resistor is used, deceleration must be reduce or an external resistor must be added to extract the energy surplus.

  • IGBT : Indicate the power module temperature.

  • Position : Motor shaft position.

  • Courant : Indicate the instantaneous RMS current consumed by the motor. A value in n.m is also indicated, by converting from motor specifications.

  • DC Bus : Give the actuel internal DC bus voltage. This value can increase during deceleration phases.

  • Vitesse : Indicate the motor speed in rev/min.


Entrées / Sorties

Inputs / Outputs

Accessible from a double click on Inputs / Outputs, this tool allow to control inputs / outputs hardware state. On this screen the logical and the hardware state are indicated.

It' possible to change inputs and outputs state by changing inverts.

By clicking on output signal, it's also possible to modify it, but only if they are not used in a tasks with process image.

In fact, this task will periodically write physically the outputs used or simply declared in one of the task's program.


Entrées / Sorties analogiques

Analog inputs / outputs

Accessible by a double click on Analog inputs / outputs, this tool allow to control the analog input / output hardware state.

The analog input and output voltage are indicated. It's also possible to modify the output voltage, if it's not modified by a currently executing tasks.


Motion

Accessible by a double click on Motion, this allow to check the axis dynamic behavior.

This tool is composed of three parts vertically arranged :

  • The global control on the top

This part is grouping the drive enable and the regulation working mode selection (Current, Speed, Position).

  • Axis status on the center

On the center there are the axe feedback informations : position, speed, home status.

Clear buttons are available to initialize position counters.

  • Axis driving on the bottom

Axis driving have different shapes, depending on axis working mode ( Current, Speed, Position ).

In current and speed modes

The axis driving is simply applying a profile in current or speed.

Profile execution control is achieved by Start and Stop buttons.

In backward and forward motion cycle, the amplitude is alternatively positive and negative.

In position mode

The position mode driving allow to create some moves, according to the selected mode at left (+Infinite, -Infinite, ...).

In Absolute P1 and Relative P1 modes, the P1 field value have effect. In cycle mode, T value define the waiting time between movements.

The P1 cycle is a relative P1 movement. The P1/P2 cycle allow particularly on finite axes, to execute movements between two absolute positions.

The home mode starts a home process, as it have been defined in the axis setup.


Auto tuning

Accessible in advanced mode, by a double click on Auto-tuning, this tool allow to do basic axis setup automatically.

  • Current loop auto-tuning :

During this phase, the motor will do some short moves to calculate the vibration limits and then some higher movements.

Warning : It's possible to do this phase with or without mechanical joined, but its recommended to do it without mechanical if it's fragile.

  • Speed loop auto-tuning :

During this phase, the motor will do several revolutions with an average velocity.

Warning : The axe must be infinite or not joined to the mechanical, because ne number of revolution done by the auto-tuning is not known. For an optimal setup, it's necessary to join the mechanical otherwise the axis will have a lack of stiffness.

  • Position loop auto-tuning :

During this phase, the motor will do several revolutions with at low velocity.

Warning : It's possible to do this phase with or without mechanical joined

  • Complete auto-tuning :

Allow to chain the different auto-tuning phases from position feedback to position loop.

  • Auto-tuning caution :

During auto-tuning, all the security are activated (I²t etc ...)

To reduce / remove noises at the beginning or the end of the movements, put 0 on acceleration feed forward speed loop parameter ( the following error will be higher during acceleration and deceleration phases)

To increase the system stiffness, increase to speed loop proportional gain.

To increase to system response time, increase the speed loop integral gain.

In case of lack of stability reduce or remove the speed loop integral gain.


Entrées / Sorties

Inputs / Outputs

Accessible from a double click on Inputs / Outputs, this tool allow to control inputs / outputs hardware state. On this screen the logical and the hardware state are indicated.

It' possible to change inputs and outputs state by changing inverts, but only after restarting the tasks.

The inverts are handled by the CANopen I/O module initialization function

By clicking on output signal, it's also possible to modify it, but only if they are not used in a tasks with process image.

In fact, this task will periodically write physically the outputs used or simply declared in one of the task's program.


La zone de déclaration de variables des éditeurs de code

Code editors variables declaration zone

All editors are divided in two parts :

  • The upper part for variable declarations

  • The lower part for code editing

In the declaration part, we have all variables used by the code part.

These variables are sorted by their usage (local, global, external ...) in different declaration sections of IEC61131 language

Pop-up menu

By left clicking, the following popup menu appears :

Cut

Action : Cut the selection.

Copy

Action : Copy the selection.

Paste

Action : Paste copied or cut text.

Delete

Action : Delete the selection.

Search

Action : Search a text.

Replace ...

Action : Replace a text.

Basic types ...

Action : Insert a basic type variable from a list.

Complex types ...

Action : Insert a complex type variable from a list.

Function blocks ...

Action : Insert a function bloc type variable from a list.


Editeur ST

ST and IL editors

ST and IL editors are composed of a text editing zone for entering ST or IL code, a tool bar for code editing help and debugging in connected mode and a variables declaration zone.

Tool bar

Editing zone Pop-up menu

By left clicking, the following popup menu appears :

Insert a variable

Action :Open the declared variable list window and allow to insert one of them in the code

Insert a function

Action : Open the available function list window and allow to insert one of them in the code

Undo

Action : Cancel the last editor action.

Redo

Action : Redo the last cancelled action.

Cut

Action : Cut the selection.

Copy

Action : Copy the selection.

Paste

Action : Paste copied or cut text.

Select all

Action : Select all code in editor

Toggle bookmark

Action : Add or remove a bookmark on the current line

See also :

ST language

IL Language


Editeur LD

LD editor

The LD (Ladder) editor is composed of a ladder POU editing zone,a tool bar and a variable declaration zone.
A ladder POU ladder is composed of several networks.
Each network is composed of a header / comments, only one expression associated to one output (See LD language)

Tool bar

Editing zone Pop-up menu

By left clicking, the following popup menu appears :

The menu can be different depending on the selected object type.

Insert a variable

Action :Open the declared variable list window and allow to insert one of them in the code

Insert a function

Action : Open the available function list window and allow to insert one of them in the code

Insert a function block

Action : Open the available function block list window and allow to insert one of them in the code

Insert a network

Action : Inset a new network after the current network

Insert in serial (AND)

Action : Insert a contact in serial of selected elements

Insert in parallel

Action : Insert a contact in parallel of selected elements

Insert a contact

Action : Insert a contact at the selected place

Insert a coil

Action : Insert a coil at the selected place

Insert a jump

Action : Insert a jump at the selected place

Insert a reset

Action : Insert a reset at the selected place

Insert a set

Action : Insert a set at the selected place

Insert a return

Action : Insert a return at the selected place


Editeur CFC

CFC editor

The CFC (Continuous function chart) editor is technical tool, used to graphically create automation programs.

The main elements of a CFC diagram are blocks (System blocks, user blocks, compound blocks), that can be freely arranged on the diagram, power bars (on left and right), that provide links to IEC1131 variables and virtual links within the diagram, and connections to link an output (bloc or power bar) to one or more inputs (bloc or power bar).

Level 0 :

level 1 :

Tool bar

Editing zone Pop-up menu

By left clicking, the following popup menu appears :

The menu can be different depending on the selected object type.

Cut

Action : Cut the selection.

Copy

Action : Copy the selection.

Delete

Action : Delete the selection.

Search / Replace ...

Action : Allow replacing a text

Insert a block ...

Action : Allow to insert a block at selected place

Replace a block ...

Action : Replace the selected block.

Insert a compound block

Action : Allow to create a compound block or lower level diagram.

Insert a text block

Action : Insert a block dedicated for adding comments

Zoom +

Action : Decrease showing zone.

Zoom -

Action : Increase showing zone.

Upper level :

Action : Allow to go to upper diagram (compound block).

Show documentation

Action : Show help on the selected block

Show / Hide grid

Action : Display option

Voir aussi :

Langage CFC


Editeur FBD

FBD editor

The FBD editor is technical tool, used to graphically create automation programs.

It's composed of an editing zone, a tool bar and a variable declaration zone.
A FBD diagram is composed of several networks.
Each network is composed of a header or comments and a schematic.

The main element of the FBG schematic are network and graphic symbols. With each user defined network a project have easy structure. Between the variable bars ( at left and right ) the chosen graphic elements, for example a function block are placed in fixed faces.

Tool bar

Editing zone Pop-up menu

By left clicking, the following popup menu appears :

The menu can be different depending on the selected object type.

Cut

Action : Cut the selection.

Copy

Action : Copy the selection.

Delete

Action : Delete the selection.

Select all

Action : Select all code in editor

Search / Replace ...

Action : Allow replacing a text

Insert a variable

Action :Open the declared variable list window and allow to insert one of them in the code

Insert a function

Action : Open the available function list window and allow to insert one of them in the code

Insert a function block ...

Action : Allow to insert a block at selected place

Insert a text block

Action : Insert a block dedicated for adding comments

Replace a function block

Action : Allow to replace a block at selected place

Zoom +

Action : Decrease showing zone.

Zoom -

Action : Increase showing zone.

Show / Hide printing limits

Action : Printing option

See Also :

FBD Language


Description

Introduction

Motion Studio is a programming tool powerful and easy to use. It offers a structured architecture based on standard IEC 61131-3.

This language is managed by a core multi-tasks real time, using instructions defined by standard IEC 61131-3 and also containing control functions of movement.

The language embeds also the data management in the form of global, local, saved variables

A Motion Studio project regroups:

  1. a configuration (MPC, axes, E/S )

  2. tasks containing programs

  3. functional blocks

  4. functions

  5. data


Editeur IL : introduction

IL language

Description

A program written in IL language is an instructions list.

Each instruction must be written on a text line.

An instruction can have one or several operands.

The operands can be some variables or constant expressions.

Each instruction can start with a label followed by the character ":".

The labels are the destinations for the jump instructions.

Language Structure

The IL language uses what we call a register, each instruction uses or modifies the register content :

Example : | LD | 10 | (* value 10 loaded in the register*)
 | ADD | 25 | (* The register content is added with 25*)
 | ST | A | (* The result (register content) is stored in the variable A*)

Both register and variable A now contain the same value: 35. If the next instruction does not start with LD, the following instruction will use this value too. For that reason it is important to always begin an instructions list with LD.

Concerning that language, there are no differences between the capital and the small letters at the time of the labels, operands and modifiers capture.

The operand and the current register content must obligatorily contain the same type of data.

If you must treat various types of data, it is necessary to previously convert the data contained in the register:

Conversion : | LD | 10 | (* Value 10 loaded in the register*)
 | INT_TO_REAL | 25 | (* Converted in real*)
 | ADD | 0.543 | (* Added to the value 0.543*)
 | ST | A | (* The result is stored in the variable A*)

Instructions

Logical program instructions :

Instruction | Modifier | Operand | Description
CAL | C, CN | Functional block | Call a functional block  no current result used
JMP | C, CN | label | Unconditional jump  no current result used
RET | C, CN |  | Jump at the end of the program

Boolean operations and instructions:

NOT |  | boolean |
AND | N, N (, ( | boolean | AND between the operand and the current result
OR | N, N (, ( | boolean | OR between the operand and the current result
XOR | N, N (, ( | boolean | OR exclusive between the operand and the current result
S(et) |  | boolean | Forces the operand at TRUE if current result is TRUE
R(eset) |  | boolean | Forces the operand at FALSE if the current result is TRUE

Mathematical operations :

ADD | ( | numerical | addition between the operand and the current result
SUB | ( | numerical | substraction between the operand and the current result
MUL | ( | numerical | multiplication between the operand and the current result
DIV | ( | numerical | division between the operand and the current result

Loading/Forcing Instruction :

LD | N | any type | Loads the operand in the current result
ST | N | any type | Stores the current result in the operand

Logic operators:

GT | ( | numerical | compare the current result with the operand
GE | ( | numerical | compare the current result with the operand
EQ | ( | numerical | compare the current result with the operand
NE | ( | numerical | compare the current result with the operand
LE | ( | numerical | compare the current result with the operand
LT | ( | numerical | compare the current result with the operand

Modificateurs

In the language IL, we use some modifiers, they influence the operator executing :

Modificateur | Operand | Description
N | any type | The modifier N is used to invert bit by bit the operand value. Example : In the example, C is 1, if A is 1 and B is 0. LD A ANDN B ST C
C | boolean | The modifier C is used to execute the associated instruction, if the battery value is 1 (TRUE). Example : In the example, the jump to START is only executed if A is 1 (TRUE) and B is 1 (TRUE). LD A AND B JMPC START
CN | boolean | If the modifier C is combined with the modifier N,the associated instruction is only executed if the battery value is a boolean 0 (FALSE). Example : In the example, the jump to START is only executed if A is 0 (FALSE) and B is 0 (FALSE). LD A AND B JMPCN START
( | any type | The modifier left bracket ( is used to postpone the operand evaluation till the operator right bracket ) appears. The number of right bracket operations must be equal to the number of modifiers left bracket. It is possible to overlap the brackets. Example : In this example, E will be 1, if C and/ or D are 1, as well as A and B are 1. LD A AND B AND( C OR D ) ST E The example can be programmed in this following way : LD A AND B AND( LD C OR D ) ST E

Sub-programs

The call of a sub program in language IT is made by using operators CAL and CALC. The calls of sub program do not provide return values. The called section IT must be in the same task as the calling section IT:

Function call : | ST | A
 | CAL | My_function()
 | LD | B

Ou

Function call : | ST | A
 | CAL | My_function
 | LD | B

Comments

Texts of comment can have been noted at the end of each instruction line. The comments do not have an influence on the execution of the program. A comment must be delimited by the characters "(*" and "*)". You can also note some comments on blank lines (without instruction). The comments cannot be overlapped.


Editeur ST : introduction

ST language

Description

The ST is a structured textual language. A program ST is an instructions list. Each instruction describes an action and ends in a semicolon (";").The display of the text does not have an influence on the program execution. You can insert blank characters or lines jumps anywhere in the text.

The returns to the line are not significant since we can write several instructions on a same line. In the same way, an instruction can be on several lines.

Expressions

Each instruction describes an action and can enclose some complex expressions.

An expression is evaluated:

Ä from left to right

Ä according to the priority of the operators

Ä the priority by default can be changed with some brackets

The arguments of an expression are:

Ä declared variables

Ä constant expressions

Ä function calls

The operators are executed according to their rank in the expressions:

Operator

Meaning

Rank

Possible operands

Description

( )

Setting between brackets

1 (the highest)

Expression

The setting between brackets is used to modify the execution schedule of the operators.

Example : If the operands A, B, C and D have respectively the values 1, 2, 3 and 4, then

A+B-C*D

Gives the result -9 and

(A+B-C)*D

gives the result 0.

FUNCNAME (list of the real parameters)

Function treatment (call)

2

Expression, literal value, variable, address (all data types)

The function treatment is used to execute some functions

-

Negation

3

Expression, literal value, variable, address of data type INT, DINT, UINT, UDINT or REAL

In the case of negation -, the system changes the sign of the operand value.

Example : In the example, OUT is -4, if IN1 is 4.

OUT := - IN1 ;

NOT

Complement

3

Expression, literal value, variable, address of data type BOOL, BYTE, WORD or DWORD

In case of NOT, the system makes an invert of each bit of the operand.

Example : In the example, OUT is 0011001100, if IN1 is 1100110011.

OUT := NOT IN1 ;

**

Rise in power

4

Expression, literal value, variable, address of data type REAL (base) and INT, DINT, UINT, UDINT or REAL (index)

In the case of rise in power **, the value of the first operand (base) is increased by the value of the second operand (index).

Example : In the example, OUT is equal to 625,0, if IN1 is 5,0 and IN2 4,0.

OUT := IN1 ** IN2 ;

*

Multiplication

5

Expression, literal value, variable, address of data type INT, DINT, UINT, UDINT or REAL

In the case of multiplication *, the value of the first operand is increased by the value of the second operand.

Example : In the example, OUT is equal to 20,0, if IN1 is 5,0 and IN2 4,0.

OUT := IN1 * IN2 ;

Remark : The function MULTIME of the obsolete library is destined to the multiplications of data of Time type.

/

Division

5

Expression, literal value, variable, address of data type INT, DINT, UINT, UDINT or REAL

In the case of division /, the value of the first operand is divided by the value of the second operand.

Example : In the example, OUT is equal to 4,0, if IN1 is 20,0 and IN2 5,0.

OUT := IN1 / IN2 ;

Remark : The function DIVTIME of the obsolete library is destined to the divisions of data of Time type.

MOD

Modulo

5

Expression, literal value, variable, address of data type INT, DINT, UINT or UDINT

In the case of MOD, the value of the first operand is divided by the value of the second operand and the remainder of the division (Modulo) is output as result.

Example : In the given example,

Ä OUT is 1 if IN1 is 7 and IN2 2

Ä OUT is 1, if IN1 is 7 and IN2 -2

Ä OUT is -1,if IN1 is -7 and IN2 2

Ä OUT is -1, if IN1 is -7and IN2 -2

OUT := IN1 MOD IN2 ;

+

Addition

6

Expression, literal value, variable, address of data type INT, DINT, UINT, UDINT, REAL or TIME

In the case of addition +, the value of the first operand is added to the value of the second operand.

Example : In the example OUT is equal to 9 if IN1 is 7 and IN2 2.

OUT := IN1 + IN2 ;

<

Comparison

"lower than"

7

Expression, literal value, variable, address of data type BOOL, BYTE, INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD, STRING, DT, DATE or TOD

< allows the comparison between the value of the first and the second operand. If the first operand is lower than the second one, the result is a 1 boolean. If the first operand is greater or equal to the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is lower than 10. Otherwise it is on 0.

OUT := IN1 < 10;

>

Comparison "greater than"

7

Expression, literal value, variable, address of data type BOOL, BYTE, INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD, STRING, DT, DATE or TOD

> allows the comparison between the first and the second operand. If the first operand is greater than the second operand, the result is a 1 boolean. If the first operand is lower or equal to the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is greater than 10 and is on 0 if IN1 is lower than 10.

OUT := IN1 > 10 ;

<=

Comparison "lower or equal to"

7

Expression, literal value, variable, address of data type BOOL, BYTE, INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD,

STRING, DT, DATE or TOD

<= allows the comparison between the first and the second operand. If the first operand is lower or equal to the second operand, the result is a 1 boolean. If the first operand is greater than the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is lower or equal to 10. Otherwise, it is on 0.

OUT := IN1 <= 10 ;

>=

Comparison "greater or equal to"

7

Expression, literal value, variable, address of data type BOOL, BYTE, INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD, STRING, DT, DATE or TOD

>= allows the comparison between the first and the second operand. If the first operand is greater or equal to the second operand, the result is a 1 boolean. If the first operand is lower than the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is greater or equal to 10. Otherwise, it is on 0.

OUT := IN1 >= 10 ;

=

Equality

8

Expression, literal value, variable, address of data type BOOL, BYTE,INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD, STRING, DT, DATE or TOD

= allows the comparison between the first and the second operand. If the first operand is equal to the second operand, the result is a 1 boolean. If the first operand is not equal to the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is equal to 10. Otherwise, it is on 0.

OUT := IN1 = 10 ;

<>

Inequality

8

Expression, literal value, variable, address of data type BOOL, BYTE, INT, DINT, UINT, UDINT, REAL, TIME, WORD, DWORD, STRING, DT, DATE ou TOD

<> allows the comparison between the first and the second operand. If the first operand is not equal to the second operand, the result is a 1 boolean. If the first operand is equal to the second operand, the result is a 0 boolean.

Example : In the example, OUT is on 1, if IN1 is not equal to 10. Otherwise, it is on 0.

OUT := IN1 <> 10 ;

&

AND logical

9

Expression, literal value, variable, address of data type BOOL, BYTE, WORD or DWORD

& allows the establishment of a logical link ET between the operands. For the data types BYTE, WORD and DWORD, the link is made with bit.

Example : In the examples, OUT is on

1, if IN1, IN2 and IN3 are on 1.

OUT := IN1 & IN2 & IN3 ;

AND

AND logical

9

Expression, literal value, variable, address of data type BOOL, BYTE, WORD ou DWORD

AND allows the establishment of a logical link ET between the operands. For the data types BYTE, WORD and DWORD, the link is made with bit.

Example : In the examples, OUT is on 1, if IN1, IN2 and IN3 are on 1.

OUT := IN1 AND IN2 AND IN3 ;

XOR

OR exclusive logical

10

Expression, literal value, variable, address of data type BOOL, BYTE, WORD or DWORD

XOR allows the establishment of a exclusive logical link OR between the operands. . For the data types BYTE, WORD and DWORD, the link is made with bit.

Example: In the example, OUT is on 1, if IN1 and IN2are not equal. If IN1 and IN2 have the same state (either 0 or 1), OUT is on 0.

OUT := IN1 XOR IN2 ;

If more than two operands are linked, the result of the operation is at 1 for an uneven number of states 1 and at 0 for a even number of states 1.

Example :In the example, OUT is on 1 if one or three operands are on 1. OUT is on 0 if zero, two or four operands are on 1.

OUT := IN1 XOR IN2 XOR IN3 XOR IN4 ;

OR

OR logical

11 (the lowest)

Expression, literal value, variable, address of data type BOOL, BYTE, WORD or DWORD

OR allows the establishment of a logical link OR between the operands. For the data types BYTE, WORD and DWORD, the link is made with bit.

Example : In the example, OUT is on 1, if IN1, IN2 or IN3 is on 1.

OUT := IN1 OR IN2 OR IN3 ;

Instructions

Here are the different styles of basic instructions of a program ST:

Assignation

Function call

Call of a function block

Here are the available instructions for the conditional running:

IF / THEN / ELSE (binary selector)

CASE (Listing of cases)

Here are the available instructions for the iterative running of instructions:

WHILE (with test in input loop)

REPEAT (with test in end loop)

FOR (listing)

WHILE

Comment

Some comments can be enclosed anywhere in a program ST. The comments have no influence on the program running. A comment must start by "(*" and finish by "*)". The comments can be enclosed on several lines (a comment can contain jumps of lines). The comments can be overlapped.

Example :

(* Comments are useful *)

(* This comment
is long and

requires more

than one line
*)


Editeur LD : introduction

LD Language

Description

The language Ladder Diagram (or relays diagram) is a list of networks. Each network represents a Boolean data flow from a power bar on the left towards a power bar on the right. The bar of food on the left represents the state TRUE which initializes flow in the network.

Each symbol inserted on the network modifies the data flow and/or runs an operation.

Networks

A network consists of:

Ä A label : Each network which can be a target of jump in another network will be automatically identified by an alphanumeric reference mark or decimal whole number not signed. The networks will be numbered by default. This numbering of all networks will be automatically updated every time that a network is insert. The numbering simplifies the search of a network corresponding to the line number of the textual programming languages.

Ä A comment : The network comment is represented as square area in the Ladder diagram. To write a comment, double click on this zone. The comment is always placed below the Network label. Note that the first network contains in more one comment of Ladder diagram above the Network label and the network comment.

Ä A graph : The network graph is composed of graphic objects, which can be graphic symbols or connections. The connections transport the data between the graphic symbols, which treat the data with their inputs and transfer the data treated at their outputs. Note that connections can also cross.

Here are the elements which make up a network graph:

ÄContacts

ÄOperations

ÄFunctions

ÄFunctional blocks

Contacts

The contacts are basic graphic elements of language LD. A contact is associated with a Boolean variable indicated above of the graphic symbol. A contact modifies the state of the data flow according to the state of the associated variable.

Here are the different available types of contacts:

1.) Normal: the value of the DATA flow on the right is AND Boolean between flow on the left and the value of the associated variable..

2.) Inverted: the value of the DATA flow on the right is AND Boolean between flow on the left and the inverted value of the associated variable.

Two normal contacts in series represent a logical operation AND

Two normal contacts in parallel represent a logical operation OR.

Operations

Control relays

Control relays are contacts which are inserted in front of the coils. The control relays can be used as breakpoints in the manual execution, for example. There can always be a control relay before each coil alone.

Insert -> Control relay: Use this command to insert a relay of additional control into the logical symbol.

Coils

The coiling is graphic elements of LD language. A coiling is associated with a Boolean variable, written on the top of the graphic symbol. A coiling represents a forcing of the associated variable according to the input data flow.

The different styles of coiling are:

(1) Normal: the associated variable has the value of the input flow.

(2) Invert: the associated variable has the value of the invert input flow.

(3) S(et): the associated variable is forced to TRUE if the input flow is TRUE. (Not any action is made if the input flow is FALSE).

(4) R(eset): the associated variable is forced to FALSE if the input flow is TRUE. (Not any action is made if the input flow is FALSE).

(5) The jump operations operate the control flow. With jumps, networks can be carried out only if certain conditions are hold. Jumps can be conditioned by a result of binary combination, or inconditional, i.e. obligatory. The target of jump must always be the beginning of a network, indicated by its network label.

(6) The RETURN stops the execution of the program in the current POU, and continues at the point from where the POU was called. The RETURN can be conditioned by a result of binary or unconditional connection.


Editeur CFC : introduction

CFC language

Description

A diagram CFC (Chart Function Block) represents a data flow between constant expressions or variables and operations represented by rectangular boxes. The operations can be basic operators of language, functions or functional blocks calls.

Running order

The arrangement of the blocks on a diagram is directly linked to the running order: The blocks are run column by column and from top to bottom in a column. To modify the running order, rearrange the blocks as required.

The compound blocks will be run as a set at a moment in the running order where the compound block is located. The content of the compound blocks will be run according to the same rules. This is very similar to the subprograms in modern programming languages.

Power bars

The margin bars connect the logic contained in diagram CFC to other parts of same diagram CFC, or to other parts of the application or process to be ordered.

In order to setup any element of the margin bar, make a `right click' and select `properties' starting from the context menu:

In the Name, write le name of the object. This should be a valid name of variable IEC61131-3.

If you want that editor CFC declares a variable for this object of margin bar, select Variable IEC61131. Otherwise, if you select "connection CFC", the object is employed only virtually, and all information is immediately propagated at the connected outputs. This can be more economic in running time and used memory, but it prevents from making monitoring on line.

For variables IEC61131-3, choose the section of declaration from the `combo-box'. The choice offered here depends on the type of block and the type of margin bar. For certain kinds of variables, you can choose a physical address or an initial value.

For connectors CFC, you can choose the `connector of compound block, i.e.. a connection from the interior of a compound block towards outside, "to connect to an internal connector", i.e. that you connect an input on the right margin bar to an output on the left margin bar.

The internal connector and connect to an internal connector are the same, but the first is only available on the right margin bar (where internal connectors are defined) while the last one is available only on the left margin bar, where internal connectors can be used.

The input variables of diagram CFC must be connected to the inputs of the functions boxes. The type of each variable must be coherent with the type of the input of the corresponding box. An input for diagram CFC can be a constant expression, any internal variable of input or output.

To use a constant value as input of a block, select the input (or input of the power supply bar, click right with the mouse on, select "properties" and enter the constant value in the field of edition "value" of the sheet "default value".

The output variables of diagram CFC must be connected to the outputs of the functions boxes. The type of each variable must be coherent with the type of output of the corresponding box. An output for the diagram CFC can be an internal either variable or of output, or the name of the edited program (for the functions only). When the name of the edited function is used as output of diagram, it represents an assignment of the value returned by the function.

The variables of input and output, the inputs and outputs of functions boxes are connected by connection arcs. Lines are used to represent the connections between two points of the diagram:

Ä an input variable and an input of box.

Ä an output of a box and an input of another box.

Ä an output of a box and an output variable.

Boxes

In order to add blocks to your diagram CFC, use Insert àBlock for software packages or blocks defined by the user, Insert àText Block for some Text blocks, or Insert àcomponents block for the components blocks.

The cursor of the mouse changes, click on the diagram where you want to insert the new block.

In order to rearrange some blocks, select the blocks and make a `slip to release' up to their new location.

When you add new blocks or mobile existing blocks, editor CFC will make place as it should be by moving the existing neighbouring blocks.

To remove blocks of your diagram, select and press them on DEL.

Connection

To connect two objects, select first the output object (output of a block, or of an object on the left margin bar) ; to select the input at that time (input of a function block or of an object on the right margin bar), and then press on Insertion -> Connection.

Editor CFC supports also connections between an output and multiple inputs. To create a multiple connection, create at first a connection between the expected output and an input. Then, mark the next input and click in the output. Both connection created at the first step and the output are now marked. Select InsertàConnection to create the multiple connection between the output and two inputs. You can now add more inputs by the same way.

To remove an input of a multiple connection, mark the input and press on the key delete. Only connection between this input and the output will be removed.

Text block

Use Insertion -> Text Block to insert a text block in your diagram. A text block is only for the documentation and does not add anything to the code being run.


Bloc composé: introduction

Compound block description

The compound blocks are a way of structuring your application.

The working area of editor CFC is limited to a width of page. By choosing the format paper, you determine the number of blocks which can be placed horizontally. Vertically, a diagram of function can develop to infinity.

Although you are not limited in the length of your diagram CFC, it is easy to lose the overall picture on a too large diagram. The compound blocks allow decomposing your application, hiding some groups of logical blocks relating to the inside of compound block in order to improve the legibility of the application.

The signals between the blocks inside a compound block are not visible outside. Within the compound block, only the entering and outgoing signals are visible.

On the screen, double-click on the compound block to see its content. Use 'See -> superior level' or in the tool bar the icon corresponding to Related file' to return to the screen where the compound block is called.

The compound blocks can be imbricate, i.e. inside a compound block you can define or use other compound blocks. The content of a compound block can be edited; you can add or remove blocks, redo the connections, add, modify or delete some connections entering or outgoing the compound block.

On the screen, the last connections of input and output of the compound block are shorter than any other connections, thus you can easily distinguish a compound block from another block.


Créer un bloc composé CFC

Create a compound block

In order to create a new empty compound block,

1. | Select `Insertion à Compound block ...`
2. | The pointer of the mouse changes
3. | Click on the mouse where you want to insert the new component block

You can now first fill the compound block with a double click and edit it as any other function diagram or add some inputs and outputs to the compound block, edit its content later by using the already given inputs and outputs.

When you lack space on a diagram, or think that legibility would be increased by creating hierarchical groups, you can undo some of your blocks in order to put them in compound blocks:

1. | Have a chosen block
2. | Select `Insertion à Compound block...`
3. | CFC-Editor will ask you to check if you want to convert the blocks into compound block
4. | The selected blocks will be removed from the diagram and replaced by a compound block. All the signals between these blocks will be moved with the blocks, all the signals with other blocks will be kept and changed into signals of interface of the compound block.

Notes:

Currently, the process of return in group from a compound block is not supported.


Ajouter une E/S à un bloc composé CFC

Adding input or output to a compound block

You can edit the content of a compound block like any other function diagram. When you must add some inputs or outputs, you must consequently change the interface of the compound block. You can do this from the outside (Top-Down) or inside the compound block (Bottom-Up).

Top-Down:

1. | All compound blocks have the very last connector which is shorter than the others. It is always the last connector, one on the left side as input, one on the right side as output.
2. | Cable this last E/S
3. | As soon as you use this last connector, it will be enlarged at the normal size and another shorter connector will be added at the end.

Bottom-Up:

1. | Double-click on the compound block of which you want to add a connector.
2. | Cable a connection of a block inside the compound block to the left or right margin bar (according to whether you want to create an input or an output)
3. | Click right on the connector and open the interactive box properties  via the contextual menu.
4. | Mark the objects "Connector CFC" and 'Connector of compound block' name it and close interactive box by clicking on 'OK'.

If you go up of a level by clicking the suitable symbol you see that another shorter unused connector was added to the compound block.


Editeur FBD : introduction

FBD language

Description

A diagram FBD (Function Block Diagram) represents a data flow between constant expressions or variables and operations represented by rectangular boxes. The operations can be basic operators of the language, functions calls or functional blocks.

Networks

You can structure diagram FBD with networks. Each network automatically get an identification number with 4 digits. A click or a double-click in this zone allows the capture of a name in order to bear a reference number at the network.

When we use the right button of the mouse, a selection menu appears which allows adding a new network, or passing to the following or the previous one.

Each network consists of the following elements:

Ä a power supply input bar

Ä a power supply output bar

Ä some boxes being able to be an operator, a function or a functional block

Ä some connections linking the power supply bar and the different boxes together.

Running order

The arrangement of the blocks on a diagram is directly related to the running order: The blocks are executed column by column and from top to bottom in a column. To modify the running order, rearrange the blocks as necessary.

The compound blocks will be executed as a set at a moment in the running order when the compound block is located. The content of the compound blocks will be executed according to the same rules. This is very similar to the subprograms in modern programming languages.

Power supply bars

The power supply bars on the left and right sides enable you to connect the logic contained in the FBD with the input variables (left) and output (right). Double click in the bar of margin and capture the name of the variable:

Left power supply bar :

Right power supply bar:

The input variables of diagram FBD must be connected to the inputs of the functions boxes. The type of each variable must be consistent with the type of the input of the corresponding box. An input for the diagram FBD can be a constant expression, any internal variable, of input or output.

In order to use a constant value as input block, select the input (or input of the power supply bar), click right with the mouse above, select "properties" and enter the constant value in the field of edition "value" of the sheet "default value".

The output variables of diagram FBD must be connected to the outputs of the functions boxes. The type of each variable must be consistent with the type of the output of the corresponding box. An output dor the diagram FBD can be an internal variable, or output, or the name of the edited program (only for the functions). When the name of the edited function is used as output of the diagram, it represents an assignment of the value returned by the function.

The input and output variables, the inputs and outputs of the functions boxes are connected by arc connections. Lines are used to represent the connections between two points of the diagram :

Ä an input variable and an input of box.

Ä a box output and an input of another box.

Ä a box output and an output variable.

Boxes

In order to add blocks to your diagram FBD, use Insert àBlock for the software packages or some blocks defined by the user, Insertàtext block for text blocks, or Insert àcompounds block for the compounds blocks.

The cursor of the mouse changes, click on the diagram where you want to insert the new block.

In order to rearrange blocks select the blocks and make a `slip to release' until their new slot.

When you add new blocks or mobile existing blocks, editor CFC will make place as it should be by moving the existing adjacent blocks.

To remove blocks of your diagram, choose them and press on DEL.

Connection

In order to connect two objects, select first the output object (block output, or object on the left bar of margin), to choose the input then (input of a function block, or an object on the right bar of margin), then click on Insertion - > Connection

Editor FBD supports also connections between an input and multiple outputs. In order to create a multiple connection, create initially a connection between the expected output and an input. Then, mark the next input and click in the output. The connection created at the first step and the output is now marked. Choose InsertàConnection to create the multiple connection between the output and two inputs. You can now add more inputs in the same way.

In order to remove an input of a multiple connection, mark the input and press on key DEL. Only connection between this input and the output will be removed.

Text block

Use Insertion -> Text Block to insert a text block in your diagram. A text block is only for documentation and does not add anything to the code being run.


Principe du multitâches

Tasks principle

Each task runs parallel to the others thanks to a core real time and its priority level.

A task contains one or several programs (till 255 maxi.).

There are 5 different types of tasks:

  1. cyclic (background running)

  2. timer (run at regular interval)

  3. factual user (launched on user event)

  4. factual system (a single task and launched on system event)

  5. initializing (first task to run at the MPC start-up)

Cyclic task:

They are running when the scheduler does not run the tasks timer and events.

This type of task allows execute background tasks, process management, communication...

With management of E/S per process image:

The cycle runs in a cyclic way as follows:

Inputs acquisition: writing in memory of the state of information present on the inputs.

Treatment of the different programs of the task: then the programs written by the user run.

Outputs updating: writing of outputs bits, according to the state defined by the program.

The task uptime is not limited in the time.

With management of E/S directs:

The cycle is running in a cyclic way as follows:

Treatment of the different programs of the task: then the programs written by the user run.

The access to E/S will directly happen with the functions INP and OUT.

The task uptime is not limited in the time.

Timer task:

This type allows making repetitive tasks with fixed intervals

For a timer task you must define the following parameters:

Priority: see the chapter tasks priority

Start-up: automatic or manual

Period: duration before the start-up of the task

Watchdog: period before which we open the watchdog

User Event task

This type allows starting a task when a user event arrives

For a factual task you must define the following parameters:

Priority: see the chapter tasks priority

Start-up: automatic or manual

Event: event number which will start the task

Watchdog: period before which we open the watchdog

System Event task:

This type allows starting a task when a user or system event arrives

For a factual task you must define the following parameters:

Priority: see the chapter tasks priority

Start-up: automatic or manual

Watchdog: period before which we open the watchdog

Initialization task:

This type allows creating a task of initialization permitting to setup the various networks (Ethercat, CANOpen, Modbus ), your system and realize other actions necessary to the starting or continuing the MPC cycle.

At MPC starting, the initialization task is the first one to run and then the end of this one starts the running of other tasks declared in automatic.

During the cycle, the trigger of this task by another one causes the waiting time of all other tasks till the end of this last one.


Priorité des tâches

Tasks priority

In order to share for the best the resources of the application, a scheduler manages the different tasks in the core real time of the MPC according to their types (cyclic, TIMER), their priority and their state.

Share example of MPC resources:

Timer: set of Timer and factual tasks.

Cyclic: set of cyclic tasks.

Internal: Motion treatment, communication driver Ethercat, CANopen, treatment of E/S of MPC.

System: Network TCP, Console, FLASH, software MS

The tasks are divided into two groups according to their type:

  1. Interruptive tasks : TIMER tasks, factual

  2. Cyclic tasks

And in each group, a task has a level of priority: from 1 to 31 (1 being the highest priority).

The interruptive tasks:

The factual tasks must have the highest priority (1) in order to take the hand the most quickly possible on the machine.

The Timer tasks occupy the intermediate priorities in order to have priority on cyclic tasks (of substance) but also to leave the hand to the factual tasks.

The tasks run among themselves beginning with the highest priority and finishing with the lowest one.

Ex : 2 tasks

T1 priority 5 with a period of 10 ms,

T2 priority 10 with a period of 1 ms

The cyclic tasks:

The cyclic tasks depend on the following parameters:

Ageing time (in ms)

Power PC (in %)

Each cyclic task has a priority defined by the user.

This priority is converted inside: PTx (PTx=1 / Priority x)

The reserved power with Linux is converted into time reserved for the system.

Example: we only show the substance tasks. In the same time, these tasks are stopped by the timer tasks, the internal processes (motion, com, etc).

The time allocated to each substance task is calculated at the running time of each task by supposing that the situation remains identical over all the period of ageing.

The time allocated to the task t corresponds to PTt / (sum PTx)

The time of ageing is fixed but the "real time" of its development depends on the load in task timer/evt and internal. Mechanically more this load increases and more the power available for system decreases.


Gestion des tâches

Tasks handle

Each task has a mode of starting which was set during its creation:

Automatic starting: at each starting of the MPC the task is automatically launched after the MPC initialization.

Manual starting: the task is not launched automatically.

Initialization: starts before all other tasks (see initialization task)

A project must at least contain a task with automatic starting and/or a task of initialization.

It is advised to have an initialization task where the initialization of the peripherals and the application variables will be realized and which then starts the other tasks.

We have 5 instructions to manage the tasks:

RUN | Used to start a stopped task.
SUSPEND | suspension (pause) of a running task
CONTINUE | Used to continue the execution of a suspended task where it has been stopped
HALT | Used to stop a running task
STATUS | Indicates the state of the task

Warning:

The stop and the suspension of the tasks influence the scheduler running and can modify the MPC performances.


Introduction

For each task, it is possible to have one or several programs which run one after the other.

Its programs must be written in one of the 6 languages described in the following chapters and corresponding to the standard IEC 61131-3.

IL : Instruction List

LD : Ladder Diagram

ST : Structured Text

SFC : Sequential Function Chart

FBD : Function Bloc Diagram

CFC : Continuous Function Chart

Example of program creation:


Les fonctions

Functions

Description

A function calculates a result from its input parameters.

In opposition to a functional block, a function does not have at its disposal private data for the storage of information.

A function has one and only one output.

A function can be:

  • a standard function (SHL, SIN...)

  • a function written in language "C" and integrated to the target

Example ST

In order to call a function in ST, input its name followed by its parameters into brackets and separated by commas.

The function can be fitted in a complex expression.

A function parameter can be a call to another function.

Hereunder is an example of usage of the functions "ODD" and "SEL" in ST :

(* The following formula converts an impair integer in the closest pair integer *)

iEvenVal := SEL ( ODD( iValue ), iValue, iValue+1 );

Example FBD, CFC et LD

In order to call a function in FBD and LD, it is enough to insert it in the diagram and to connect its inputs and its output.

Example IL

In order to call a function in IL, it is initially necessary to charge the first parameter of the function in the current result, and then use the name of the function as instruction

The following inputs (if the function has more than an input) are the operands of the instruction separated by commas.

The result of the function is charged in the current result.

Hereunder is an example of usage of the function "OR" in IL:

(* the following instructions execute a OR logical between IN1 and IN2 *)

Op1: | LD | IN1 |
 | OR | IN2 |
 | ST | Q | (* Q = IN1 OR IN2 *)


Les blocs fonctionnels

Function blocs

Description

A functional block gathers an algorithm and a private data file.

It can have parameters in input and output.

A functional block can be:

  • a standard block of the library (RS, TON...)

  • a block integrated to the target system

  • a user block or "User Defined Function Block" (UDFB) written in ST, FBD, LD or IL

In order to use a functional block, you must declare a block instance in the same way you declare a variable.

Each instance must be identified with a single symbol.

Each block instance represents a private data file and can be called independently of the other instances.

A call to a block instance launches the algorithm of the block on the instance data, by using the parameters passed at the time of the call.

Example ST

To call a block in ST, you must specify the name of the instance, follow-up of the parameters of call written between brackets and separated by commas.

In order to have access to an output parameter, you must specify the name of the instance followed by a point . and the name of the parameter. Voici un exemple d'utilisation du bloc TON en ST:

(* MyTimer is an instance declared of block TON *)

MyTimer (bTrig, t#2s); (* activate the functional block*)

TimerOutput := MyTimer.Q;

ElapsedTime := MyTimer.ET;

Examples FBD and LD

In order to call a functional block in FBD or LD, it is enough to insert the block in the diagram and to connect variables to its inputs/outputs.

The name of the instance is specified above the block frame.

Example IL

In order to call a block in IT, use the instruction CAL, by specifying an instance declared having the type of the block.

The name of the instance is the operand of the instruction, followed by the inputs parameters between brackets and separated by commas.

The instructions CALC, CALCN or CALNC represent a conditional call of the block:

CAL Call the block

CALC Call the block if the current result is TRUE

CALCN Call the block if the current result is FALSE

Hereunder is an example of a call block TON in IL:

(* MyTimer is a declared instance of block TON *)

Op1: | CAL | MyTimer (bTrig, t#2s
 | LD | MyTimer.Q
 | ST | TimerOutput
 | LD | MyTimer.ET
 | ST | ElapsedTimer

Op2: | LD | bCond |
 | CALC | MyTimer (bTrig, t#2s) | (* called if bCond = TRUE *)

Op3: | LD | bCond |
 | CALCN | MyTimer (bTrig, t#2s) | (* called if bCond = FALSE *)


Editeur de déclaration : introduction

Introduction

Standard IEC61131-3 requires that all the objects of data be declared like variables. Various sections of declaration are available to declare variables according to their scope:

The different storage areas of a project are :

Ä Global: This zone contains the global variables of the project. The edition of these variables is done in a textual file.

Ä Bank: This memory contains saved variables, it is divided into several blocks of adjustable size (4 banks of 64Ko by default), and these variables can also be exchanged (by Modbus or CANopen with some limit). The edition of these variables is done as from an editor.

Ä Exchange: This zone contains the global exchanged variables of the project. The edition of these variables is done as from an editor.

Ä IO: This zone contains the inputs/outputs variables declared in the tab PLC. The list of the variables is automatically generated at the moment of the declaration of the inputs/outputs in the tab PLC.

IEC61131-3 is provided with a set of the preset type of data, called also type of basic data. But, it is also possible to define derived types of data (declared by the user), structures, boards and listings.

To use a variable in a program, it should obligatorily be declared in the zone "Declaration of variable" of the window program in progress. The declarations are written in a textual format defined by standard IEC61131-3.


Sections de déclaration

Declaration sections

The variables are declared in different sections of variables, called declaration sections. A declaration section starts with a key word and ends in END_VAR (for example, VAR_GLOBAL... END_VAR).

VAR_INPUT: If a variable block must be only read inside a POU, you must declare this variable like an input variable. This variable could not be modified in this POU. An input variable can be used for the transfer of parameters in a function or a function block.

VAR_IN_OUT: A variable of input/output is accessible with the same name in a function block. The variable gets a reference (pointer) to the transferred variable and its storage place during the transfer of the parameters by the call from the block. As a writing operation has a direct effect on the content of in_Out variable, it is not authorized to use a type protected in writing for the variable transferred contrary to the variables of inputs having the CONSTANT attribute.

VAR_OUTPUT: The outputs variables are declared in a function block, which uses them for the return of values. The calling POU can reach it.

VAR_GLOBAL: A variable must be declared as a global variable in a "program" POU if this variable is used in that POU and in the function blocks called by that POU. This variable must be declared as external variable (VAR_EXTERNAL) in every function blocks which forecast to use it.

VAR_EXTERNAL: A variable declared as global used inside a function block must be declared as external variable inside this function block.

VAR: A local variable is only valid inside the POU in which it is declared. The declaration of the local variables can be completed by "RETAIN" or "CONSTANT" attributes, or by an address.

TYPE : The key-word 'TYPE ' is used for the declaration of data type (derived) defined by the user with a local scope in the "programs" types POU and 'function block', or with a global scope in the type definitions.

According to the type of POU only certain sections of variable can be used:

A POU of type program can contain the types: local, global and external

A POU of type functional block can contain the types: Input, output, E/S, local and external

A POU of type function can contain the types: Input, output and local.


Structure d'une ligne de déclaration

Structure of a declaration line

Description

A declaration line with the following form, where the optional elements are placed between brackets [ ], and the expressions are placed between brackets < >:

<Variable name> : <Type> [:= <Initial value>]; [(* <Comment> *)]

Initially one gives the name of the variable, followed by two points. The type follows behind the two points. If the variable has a value of initialization, this value will be indicated after ": =". A line always finishes with a semicolon (;). The line can be commented on with the comments placed between (* and *).

Example:

Expvariable1 : BOOL; (* variable of type BOOL *)

Expvariable2 : BOOL := TRUE; (* variable of type BOOL starting with the value TRUE *)

Examples

Variable without initial value: InterMedSum : INT;

Variable with initial value: Pieces : INT := 5;

Variable directly represented with a name and without initial value: Valve : BOOL;

Example of functional block: Counter1 : CTU;

Variable of E/S declaration for the tasks with process images

The variables of E/S are automatically declared in file IO.POE by the editor of E/S in the following form:

VAR_GLOBAL

Input_MPC_1a8 AT %IB0.0: BYTE;

Input_MPC_9a16 AT %IB1.0: BYTE;

END_VAR

To re-use these variables in a task with image of process, it is necessary to capture them in the zone of variable of the program editor and to remove attribute AT as well as addressing:

VAR_ EXTERNAL

Input_MPC_1a8: BYTE;

Input_MPC_9a16: BYTE;

END_VAR

Note

(1) The initial values must only be literal. It is not possible to use other variables to initialize variables during the declaration.

(2) The maximum length of a variable is 64 characters.

Warning

It is forbidden to make direct addressing with or without names of variables (attribute AT is forbidden), addressing is done as from the editor of E/S.


Types de donné élémentaire

Elementary data types

The software Motion Studio does not apply the following types of data defined by the standard IEC61131-3:

DATE: Day, Month, Year (only)'

TIME_OF_DAY: Time of the day (only)'

DATE_Inst_AND_TIME: Date and time'

Hierarchy of different basic types:


Type dérivé de donné

Derived data types

Description

The keywords TYPE ... END_TYPE allow creating a synonym of a basic type, a redefined type or a array.

The redefined types can be declared by SERAD or by yourself.

After definition, they can be used as basic types in the variable declaration zones of program editors.

Example

In the following example, a new redefined type is declared to represent the value of "pressure".

Type declaration :

TYPE Pressure: INT;

 tTable: Array [1..10] Of INT; END_TYPE

Variable declaration:

VAR PreValvePressure: Pressure;

 Table: tTable; END_VAR

Use of the variable of redefined type in ST:

PreValvePressure:= 0;

Table[1]:= 15;


Déclaration de tableau

Declaration of array data types

Description

The arrays contain multiple elements of the same type. Keyword ARRAY is employed to define an array. Each element of an array can be a variable of basic, redefined or structure type.

Example

Declaration of array type variable:

VAR (* Declaration of an initialized array of five integers *)

Arr1: ARRAY [1..5] OF INT := [1,2,3,4,5];

(* Declaration of an array with two dimensions of 25 elements of type structure tStuct *)

Arr2: ARRAY [1..5,10..14] of tStruct;

(* Declaration of an array with two dimensions of 4 elements of type tPressure *):

Arr3: ARRAY [0..3] Of tPressure;

END_VAR

Use of the variable of array type in ST:

Arr1[2]:= 2728;

Arr2[2,11].Param1:= 12.3;

Arr3[3]:= 12;

Warning

Motion Studio use integers 16bits for the index of array, thus the arrays must not exceed 65536 elements.


Déclarations de structure

Declaration of structured data types

Description

A structure contains multiple elements of same or various types of elementary data. The key word STRUCT is employed to define a structure. The different elements of a structure are called the members of this structure, and are reached by capturing the name of the structure, followed by a point and name of the member.

Example

Structure declaration:

TYPE RobotArm: STRUCT Angle_1: REAL;

Angle_2: REAL;

Grip: BOOL;

Length: INT;

 END_STRUCT;

END_TYPE

Variable declaration:

VAR Robot1: RobotArm;

Robot2: RobotArm;

END_VAR

Use of the variable in ST:

Robot1.Grip:= TRUE;


Déclaration de type énuméré

Declaration of enumerated data types

Description

A variable of the type data enumeration can take any value of a fixed list. The list of legal values is enumerated in the declaration of type data enumeration, separated by comma. An initial value can be indicated after the closing ')'; if the initial value is not indicated, the first value will be the value per default.

Example

The data type of TrafficLight can be 'red', 'yellow' or green. 'Yellow' ' will be the value per default.

TYPE TrafficLight: (Red, yellow, green):= yellow;END_TYPE

VAR MainRoad: TrafficLight; CrossRoad: TrafficLight;

StopCar: BOOL;

END_VAR

In the element of the instruction of POU, the defined enumerated values can be used:

Example: IL

LD MainRoadEQ redST StopCar


tBcleMode

Description

This type is an enumeration of the different modes of drive use:

  • m_torque : drive in torque mode

  • m_speed : drive in speed mode

  • m_position : drive in position mode


tEdgeType

Description

This type is an enumeration of the different edges:

  • t_falling : falling edge

  • t_rising : rising edge

  • t_all : all edge


tFilterMaster

Description

This type is an enumeration of the various filters applicable during synchronized movement:

  • filter_none

  • filter_std

  • filter_advanced

  • filter_advanced2

  • filter_interpol

  • filter_interpol2


tModeInitVal

Description

This type is an enumeration of the various parameters of transition during the passage from a drive mode to another:

  • Inital_Zero

  • Initial_real

  • Initial_theoric

  • Initial_v alue

Passage TORQUE -> TORQUE: no changement

Passage SPEED or POSITION -> TORQUE:

  • Initial_Zero : OK with TORQUE=0 and CURRENT=0

  • Initial_real : OK with TORQUE=TORQUE_S et CURRENT=CURRENT_S

  • Initial_theoric : ERROR SYSTEM

  • Initial_value : OK

Passage TORQUE -> SPEED:

  • Initial_Zero : OK with SPEED=0

  • Initial_real : OK with SPEED=SPEED_S

  • Initial_theoric : ERROR SYSTEM

  • Initial_value : OK

Passage SPEED -> SPEED: no changement

Passage POSITION -> SPEED:

  • Initial_Zero : OK with SPEED=0

  • Initial_real : OK with SPEED=SPEED_S

  • Initial_theoric : OK with SPEED=profil theoric speed

  • Initial_value : OK

Passage de TORQUE or SPEED -> POSITION:

  • Initial_Zero : ERROR SYSTEM

  • Initial_real : OK with POS=POS_S

  • Initial_theoric : ERROR SYSTEM

  • Initial_value : ERROR SYSTEM

Passage POSITION -> POSITION: no changement


tMoveDirection

Description

This type is an enumeration of the axis directions:

  • s_all : all direction

  • s_neg : negative direction

  • s_pos : positive direction


tSrcPos

Description

This type is an enumeration of the different sources of position available for an axis:

  • SRC_AXE for real axis position

  • SRC_AUX for auxiliaire axis position

  • SRC_TRC for theoretical axis position

  • SRCX_TRC for X theoretical position of the interpolated axis

  • SRCY_TRC for Y theoretical position of the interpolated axis

  • SRCZ_TRC for Z theoretical position of the interpolated axis


tSegmentDef

Declaration

TYPE tSegmentDef :
STRUCT
Count : UInt;
Active : Array [0..31] Of Bool;
OutputNum : Array [0..31] Of UInt;
BeginPosition : Array [0..31] Of Real;
EndPosition : Array [0..31] Of Real;
Direction : Array [0..31] Of tMoveDirection ;
EventIn : Array [0..31] Of UInt;
EventInParam : Array [0..31] Of UDInt;
EventOut : Array [0..31] Of UInt;
EventOutParam : Array [0..31] Of UDInt;
Mode : Array [0..31] Of tSegmentMode ;
Duration : Array [0..31] Of Udint;
END_STRUCT;
END_TYPE

Description

This type of structure allows to declare the segments of cambox

  • <Count> number of the cambox segments

  • <Active> TRUE if the segment is active else FALSE

  • <OutputNum> output number for the segment (0 to 31) define by tOutputDef
    If several segments have the same outputs (other cambox), an logical OR is doing between these diffrentes segments.

  • <BeginPosition> starting segment position

  • <EndPosition> ending segment position
    For a modulo axis, if <BeginPostion> > <EndPosition> then the segment is <BeginPosition> to <EndPosition> else the segment is <EndPosition> to <BeginPosition>
    For a not modulo axis, if <BeginPostion> < <EndPosition> then the segment will be never activate

  • <Direction> movement direction (Indifferent, Positive, Negative)
    Indifferent : doesnt hold count of the movement direction
    Positive : the segment will be activated only if one enters in the same direction as STTI+
    Negative : the segment will be activated only if one enters in the same direction as STTI-
    In the case of a positive or negative direction, the direction is tested at the moment who one ENTERS in the segment (moment where we pass to outside to inside the segment)
    If one is already in the segment (starting of cambox whereas the position source is already in the segment), one considers that one ENTERS in the segment at this moment. At stopped, with a disturbed position source (resolver), the behavior will be random (the segment will be activated or not).

  • <EventIn> user event to set when segment is activate (0 : no event)

  • <EventInParam> event parameter

  • <EventOut> user event to set when segment is desactivate.(0 : no event)

  • <EventOutParam> event parameter

  • <Mode> mode (position or duration)
    Position : segment state (activate or not)
    delay : made a pulse equal to <duration> when the terminal of beginning is crossed.
    Hysteresis is ignored, CompensationOn and Direction is used.
    This is no restarted monostable (once pulsates it armed, any passage on the activation position is ignored as much as the duration is not past).
    Activate or desactivate an segment or output of a cambox, made start again duration

  • <Duration> duration in µs (only use if <Mode> is duration)


tOutputDef

Declaration

TYPE tOutputDef:
STRUCT
Count : UINT;
Active : Array [0..31] Of BOOL;
Target : Array [0..31] Of tOutTarget ;
OutBit : Array [0..31] Of tIOBitOut ;
InBit : Array [0..31] Of tIOBitIn;
Hysteresis : Array [0..31] Of REAL;
CompensationOn : Array [0..31] Of DINT; (*compensation en µs*)
CompensationOff : Array [0..31] Of DINT; (*compensation en µs*)
Timeout : Array [0..31] Of UDINT; (*timeout en µs*)

Description

This type of structure allows to declare the cambox outputs

  • <Count> number of outputs

  • <Active> TRUE if the segment is active else FALSE

  • <Target> destination type of the cambox output

  • <OutBit> physical output name

  • <InBit> internal input name

  • <CompensationOn> duration in µs to be compensated with the activation of the output.

  • <CompensationOff> duration in µs to be compensated with the desactivation of the ouput.

The system anticipates activation/delay according to speed in progress.

    • Positive value : delay activation

    • Negative value : anticipate activation

  • <Hysteresis> hysteresis to avoid fast changes of state on the output, when one is near to the position of state change.

  • <Timeout> timeout in µs on active state of the output

0 : no timeout on the output.

If the output remains active throughout timeout it is reset as long as all the segments activating this output are not finished.


tSegmentMode

Description

This type is an enumeration used for the choice of the mode of activation in the declaration of the cambox segment:

  • <smPosition > : compared to the position

  • <smDuration > : compared to one pulsates


tOutTarget

Description

This type is an enumeration used for the choice of the target in the declaration of the cambox outputs:

  • <om_physicaloutbit> : used a physical output

  • <om_internalinbit> : used a virtual output


tCamTable

Declaration

TYPE tCamTable :

STRUCT

Nb :UDINT;

X : array [0..1023] of REAL;

Y : array [0..1023] of REAL;

Dx : array [0..1023] of REAL;

Dy : array [0..1023] of REAL;

END_STRUCT;

END_TYPE

Description

This type of structure allows to declare a cam from a table of point:

  • <Nb> : number of points in the cam

  • <X> : master position

  • <Y> : slave position

  • <dX>: tangente X

  • <dY>: tangente Y


tCapType

Description

This type is an enumeration of the various types of capture:

  • W_NONE no windows.

  • W_INT for internal windows.

  • W_EXT for external windows.


tCapImdIo

Description

This type is an enumeration all different quick inputs of IMD and IMDL drive:

  • IO_3 for quick input 3

  • IO_4 for quick input 4

  • IO_14 for quick input 14

  • IO_15 for quick input 15

  • IO_Z for the source TOP Z


tHandle

Description

This type allows to associate a number (UDINT) a physical communication port.


tIObitIn

Description

This type is an enumeration of all the inputs of the BIT type of the project; it is updated automatically by Motion Studio and corresponds to the list of the inputs of the type BIT present in the I/O editor in PLC tab:


tIObitOut

Description

This type is an enumeration of all the outputs of the BIT type of the project; it is updated automatically by Motion Studio and corresponds to the list of the outputs of the type BIT present in the I/O editor in PLC tab:


tIObyteIn

Description

This type is an enumeration of all the inputs of the BYTE type of the project, it is updated automatically by Motion Studio and corresponds to the list of the inputs of the type BYTE present in the I/O editor in PLC tab:


tIObyteOut

Description

This type is an enumeration of all the outputs of the BYTE type of the project, it is updated automatically by Motion Studio and corresponds to the list of the outputs of the type BYTE present in the I/O editor in PLC tab:


tIOwordIn

Description

This type is an enumeration of all the inputs of the WORD type of the project; it is updated automatically by Motion Studio and corresponds to the list of the inputs of the type WORD present in the I/O editor in PLC tab:


tIOwordOut

Description

This type is an enumeration of all the outputs of the WORD type of the project; it is updated automatically by Motion Studio and corresponds to the list of the outputs of the type WORD present in the I/O editor in PLC tab:


tCam

Description

This type contains all cams of the project, it is updated automatically by Motion Studio and corresponds to the list of the cams present in the Motion tab:


tGeoEntry

Declaration

TYPE tGeoEntry :

STRUCT

Input : Array [1..3] of USINT;

Output : Array [1..3] of USINT;

Param : Array [1..3] of REAL;

GeoType : tGeoType ;

END_STRUCT;

END_TYPE

Description

This type of structure allows to describe the geometrical transformations of the interpolation:

<Input> : transformation input

<Output> : transformation output

The transformation inputs and outputs of the transformation can take the following values:

  • 0 : NULL, no data, not used

  • 1 : X

  • 2 : Y

  • 3 : Z

  • 4...9 => invalide (possible other special variables of input )

  • 1119 => output axis 1 to 9

  • 2099 => invalide

  • 100...255 => Interpolation I/O who allows to connect an interpolation output to an interpolation input.

<Geotype> : transformation type:

  • TINVALID generate an error

  • TROTATESERIAL execute 3 successive rotations of the reference mark

  • TROTATEPARALELL execute 3 rotations of the reference mark compared to a fixed reference mark

  • TTRANSLATE execute a translation of the reference mark

  • TSCALE execute a scaling

  • TTANGENTIAL return the orientation of the direction of a trajectory

<Param> : value to apply to the transformation.


tGeoType

Description

This type is an enumeration of the various types of geometrical transformation for the interpolation:

  • TINVALID generate an error

  • TROTATESERIAL execute 3 successive rotations of the reference mark

  • TROTATEPARALELL execute 3 rotations of the reference mark compared to a fixed reference mark

  • TTRANSLATE execute a translation of the reference mark

  • TSCALE execute a scaling

  • TTANGENTIAL return the orientation of the direction of a trajectory


tInterpolateParam

Declaration

TYPE tInterpolateParam :

STRUCT

Axes_Count :USINT;

Axes : Array [1..10] of tPeripheral ;

Acc_Limit : Array [1..10] of BOOL;

Acc_Limit_Value : Array [1..10] of REAL;

Vel_Limit : Array [1..10] of BOOL;

Vel_Limit_Value : Array [1..10] of REAL;

Limit_Type : tInterpoLimitType ;

Geo_Count :USINT;

Geo_ReverseCount :USINT;

Geo : Array [1..10] of tGeoEntry ;

Geo_Reverse : Array [1..10] of tGeoEntry ;

END_STRUCT;

END_TYPE

Description

This type of structure allows to configure all the parameters with an interpolation:

<Axes_Count> : axies number of the model

<Axes> : table of axis name for the model

<Acc_Limit> : table of activation of the acceleration limits for the different axis.

<Acc_Limit_Value> : table of values of acceleration limit for the different axis.

<Vel_Limit> table of activation of the velocity limits for the different axis.

<Vel_Limit_Value> : table of values of volocity limit for the different axis.

<Limit_Type> : TADAPTSPEED so that the interpolation follows the most precisely possible profile speed or TADAPTTRAJ for privileged the trajectory

<Geo_Count> : transformation numbers

<Geo_ReverseCount> : reverse transformation numbers

<Geo> : table of transformation of the tGeoEntry type

<Geo_Reverse> : table of reverse transformation of tGeoEntry type


tInterpoLimitType

Description

This type is an enumeration of the various follow-up modes of the interpolation:

Ce type est une énumération des différents modes de suivi de linterpolation :

  • TADAPTSPEED so that the interpolation follows the most precisely possible profile speed.

  • TADAPTTRAJ for privileged the trajectory.


tIntParam

Description

This type is an enumeration of all the parameters accessible in configuration and of integer type.

The list of these parameters is consultable from the following windows:

Help \ CANopen Table sorted by Index/Sub

Help \ CANopen Table sorted by Groupe

Help \ modbus Table sorted by Index/Sub

Help \ modbus Table sorted by Groupe

All parameters dont containing "Real" in the "Prec" column are real type


tRealParam

Description

This type is an enumeration of all the parameters accessible in configuration and of real type.

The list of these parameters is consultable from the following windows:

Help \ CANopen Table sorted by Index/Sub

Help \ CANopen Table sorted by Groupe

Help \ modbus Table sorted by Index/Sub

Help \ modbus Table sorted by Groupe

All parameters containing "Real" in the "Prec" column are real type


tPeripheral

Description

This type is an enumeration of all the peripherals of the project; it is updated automatically by Motion Studio and corresponds to the list of the peripherals present in the Configuration tab:


tGroup

Description

This type is an enumeration of all the tasks of the project; it is updated automatically by Motion Studio and corresponds to the list of the tasks present in the Programmation tab:


tTaskStatus

Description

This type is an enumeration of the various states who can have a task:

<TSTOP>: task stopped

<TSUSPEND>: task suspended

<TRUN>: task running


Introduction

The MPC can manage more than one hundred of axes

The movement orders are directly sent to the drives via Ethercat bus.

The software Motion Studio contains many high-level functions for the movement control:

fast and accurate positioning

Gearbox with variable ratio

CAM profiles with dynamic phase adjustment

Registration with 10 µs capture window

Contact boxes

Synchronization movements

Virtual axes

linear, circular, helical Interpolations


Buffer de mouvments

Motions buffer

The MPC processor which executes the compiled tasks regularly exchanges movement information with the drives.

The movement information (MOVA, STTA, MOVS, GEARBOX, STOP ...) are transmitted from MPC to each axis via a buffer software.

The buffer movement contains 10000 sections (the simplest split movement) of which 100 are reserved for the emergency stops.

A movement can take several sections in the buffer movement according to its type and parameters.

When a task encounters a movement function, it sends it in the buffer:

Ä Any movement must go through the buffer to be executed.

Ä If the buffer is already full, the task is blocked till a place be free.

Ä The place in the buffer is released when the movement has been completely executed.

Ä MOVS consists of 1to 3 sections depending on the values of «Slave distance », « Acceleration distance », « Deceleration distance ». For example:

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 0.0, 0.0); (* 1 section *)

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 100.0, 0.0); (* 1 section *)

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 0.0, 100.0); (* 1 section *)

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 20.0, 0.0); (* 2 sections *)

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 0.0, 20.0); (* 2 sections *)

MOVS(Y, X, SRC_AXIS, Dmaster, 100.0, 20.0, 20.0); (* 3 sections *)

Warning :

Ä The functions STOP, SSTOP and STOPS stop the processing movement and remove all sections relating to the axis in the buffer.

Ä If the axis is in open loop (AXIS (Axis, OFF)), any movement function in a task go through the buffer and is directly used by the axis without movement execution.


Passage en mode non asservi

Leading in non-controlled mode

An axis leads in non-controlled mode (open loop):

Ä Each time you switch on the MPC.

Ä Each time you use the function AXIS(Axis,0) from any task.

Ä On axis following error of any servo axis (except if the SECURITY instruction of the axes is affected)

Ä With a forcing from the debug menus (close, open buttons), from the communication menu (stop tasks, restart tasks, send tasks.).

The function AXIS_S (Axis) permits to read axis state.

If a movement function is send to an axis board set in open loop, the function will be consumed, but no motion will be done.

For example:

Process task

...

... (*The MPS detected a following error on one axis *)

... (* axis => all the axis are leading in non-controlled mode

MOVA (Axis_X, 1000.0); (*The movement is consumed by the drive *)

... (* but not done*)

OUTP (S1, 1) ; (* output S1=1 *)

MOVA (Axis_X, 2000.0); (*The movement is consumed by the drive *)

... (* but not done *)

OUTP (S1, 0); (* output S1=0 *)

... (* the output S1 was changed to 1 during a very short time because *)

... (* the function Mova(X=2000.0)took a very few time to the system *)


Passage en mode asservi

Leading in controlled-mode

In order that the MPC could control and drive axis motions it must be in controlled mode

An axis leads in controlled mode (closed loop):

With a forcing from the debug menus (close button)

Ä Each time you use the instruction AXIS (Axis,1) from any task

Ä With a forcing from the debug menus (close button)

The function AXIS_S(Axis) permits to read the state in which the drive is.

For safety, it is necessary to affect a logical output of the MPC to control the function "Enable / Disable" of the drives linked to the MPC.

This output will be linked to the input "Enable" of the drive. The management of this output will be done in a non-stopping watching task.

For example

Task defaults

...

OUTP (EnableDrive,AXIS_S(Axis_X)) ; (*if axis in controlled-mode *)

... (* => OUT (EnableDrive)=1 else =0 *)

Warning

To be sure that the control is effective, write:

(* TOTAL TEST *)

AXIS (Axis_X, 1) ; (* request of controlled mode *)

WAIT (AXISREQUEST_S (Axis_X) =0); (* Wait for the end of controlled mode request *)

If (AXIS_S (Axis_X) =0) Then (* Test of controlled mode *)

FlagDefaut := 1;

Else

FlagDefaut := 0;

End_If;


Mode de fonctionnement

Working mode

There are three working modes for an axis :

Torque mode

The axis works by sending a torque set point.

Speed mode

The axis works by sending a speed set point.

Position mode

A movement generator makes moves on axis.

The drive working mode choice is done in Setup tab.

Function list

CURRENT

CURRENT_S

GETMODE

SETMODE

POS

POS_S

POS_T

POSAUX_S

POSERROR_S

SPEED

SPEED_S

TORQUE

TORQUE_S

Set current set point

Return actual current

Return actual working mode

Set axis working mode

Modify position target

Return real position

Return target position

Return auxiliary position

Indicate a following error

Set the speed set point

Return the current speed

Set torque set point

Return actual torque


Régulation

Regulation

The control of an axis is adjustable from the corrector parameters. It can be programmed in mode "velocity" or in mode "couple" and "position"; per default in mode position.

We recommend you to use the motor parameters library in order to adjust the regulation loops necessary to the good motor working. For any more information, please consult the chapter « Driver setup ».


Paramétrage d'un axe

Setting an axis

An axis must be set before using it.

The parameters access is from the index Motion of the project browser or by the use of functions READPARAM and WRITEPARAM into a task.

The simplest setting method is to input different parameters of each axis from the configuration screen of Motion of Motion Studio, and to send them to the MPC with the communication menu "send set-up".

If, later, you wish to set a parameter in real-time, we can lead online on the MPC and adjust it.


Unité utilisateur

User miscellaneous

Depending to the application, the mechanical (linear or rotation axis), we may affect to each axis a more representative unit: mm, pulse (encoder pulse * 4), degrees, radian, inch, round, or anything else.

Indeed, this unit is only used on the Motion Studio screen, to be easier to understand and practice.

For example, if the selected unit is "mm", in the screen « Principal » of the axis setup in the index Motion, speeds unit will be mm/s, and acceleration and deceleration mm/s².

Example 1 : finite axis

Motor connected to leadscrew with 5mm pitch. Units = mm, Rin = 1, Rout = 1, Distance per tour = 5.000, Modulo non activated

Example 2 : infinite axis

Motor with 10:1 reduction gearbox. 360° rotary table on output of gearbox. Units = degrees, Rin = 10, Rout = 1, Distance per tour = 360.000, modulo activated with a value of 360.000


Profil de vitesse

Speed profile

A trajectory in positioning is made of the acceleration, constant speed and deceleration phases.

The fields contained in the setup of the axis profile in the Motion index can give default values to these different phases.

The values are taken into account every time you switch on the MPC. They are also used by the Motion tool and by the functions ACC%, DEC%, VEL%.

Set in the field velocity (associated parameter _IMD_PROFILE_VELOCITY), the default velocity in units/s.

Set in the fields  Acceleration (associated parameter_IMD_PROFILE_ACCELERATION ) and  deceleration associated parameter_IMD_PROFILE_DECELERATION ), the default acceleration and deceleration in units/s²

If you wish to modify these parameters in a basic task, use the functions ACC, DEC, VEL, ACC%, DEC%, VEL%.

The VEL_S permits to read the axis speed.

They are effective at any time : axis moving or stopped.

The acceleration / deceleration phases can be linear or sine (associated parameter _IMD_GENERATEUR_SINUS ).

f sine is selected, a coefficient (associated parameter SINVAL_P) can insert a linear portion in the sine.

For example:

Remark

The urgent deceleration (associated parameter _IMD_PROFILE_DECELERATION_URG) can be used to stop the movement when we use the inputs of position limit or in case of error resulting in an urgent stop.


Prise d'origine

Homing

Description :

The Home allows determining the origin axis measure, this one being lost with each power supply cut-off.

The homing (P.O.M) allows referencing the motor position regarding to a mechanic position.

Different types of POM are available: immediate, on sensor, with release.

A POM cycle forces the counter from motor position to a referenced value.

A home takes into account:

Ä The type of the axis homing

Ä The choice of input POM (IMD_HOME_INPUT)

Ä The zero program of the axis (IMD_HOME_ZEROP)

Ä The home velocity (IMD_HOME_VELOCITY)

Ä The running acceleration and deceleration

A home on auxiliary takes into account:

Ä The type of home of the auxiliary

Ä The choice of input POM (IMD_HOME_INPUT)

Ä The zero program of the auxiliary (IMD_AUX_ZEROP)

Choice of the input used for POM:

Ä 0 : Use of the IMD input (E4)

Ä 1-32 : Use of a local MPC input

Program zero:

When the axis meets its homing position, it reset its counter and stops it with repositioning on zero. This position is the zero machine. If you wish to work in another reference mark of the program, just set a value in the field program zero. For example:

Home functions :

HOME(Axis,type)

Launches a home on an axis.

HOMEREQUEST_S(Axis)

Indicates the state of home request

HOME_S(Axis)

Indicates the home state

HOMECANCEL(Axis)

Stops an axis home.

CLEAR(Axis)

Clear the axis position at zero program

HOMEAUX(Axis,type)

Launches a home on an auxiliary position.

HOMEAUXREQUEST(Axis)

Indicates the request home state on the auxiliary

HOMEAUX_S(Axis)

Indicates the home state on the auxiliary

HOMEAUXCANCEL(Axis)

Stops a home on an auxiliary position.

CLEARAUX(Axis)

Clear the auxiliary position at the value  zero program

The types for the axis:

Type 0 : immediate :

The position counter is immediately forced at the referenced value.

Example : Reference = 100 in the capture window

HOME (0)  motor position = 100

Type 1 : on TOP Z :

The motor does not move but its position is recomputed regarding to the Top Z and the referenced value. We obtain a position being located between +/- ½ turn or reference +/- ½ motor turn.

Type 2 : On sensor, in positive direction, without release

The drive launches an infinite movement in positive direction and waits for a rising edge on the HOME input.

The position is then forced at the referenced value and the motor stops on this position.

Type 3 : On sensor, in positive direction, with release

If HOME input is already 1 then the drive first launches an infinite movement in negative direction to get clear of the HOME sensor.

The drive then launches an infinite movement in positive direction and waits for a rising edge on HOME input to force the position to the referenced value and the motor stops on this position.

Type 4 : On sensor, in negative direction, without release

The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input.

The position is then forced at the referenced value and the motor stops on this position.

Type 5 : On sensor, in negative direction, with release

If HOME input is already 1 then the drive first launches an infinite movement in positive direction to get clear of the HOME sensor.

The drive then launches an infinite movement in negative direction and waits for a rising edge on HOME input to force the position to the referenced value and the motor stops on this position.

Type 6 : On sensor and TOP Z, in positive direction, without release

The drive launches an infinite movement in positive direction and waits for a rising edge on the HOME input and for the moving via the motor TOP Z.

The position is then forced at the referenced value and the motor stops on this position.

Type 7 : On sensor and TOP Z, in positive direction, with release

If HOME input is already 1 then the drive first launches an infinite movement in negative direction to get clear of the HOME sensor.

The drive launches an infinite movement in positive direction and waits for a rising edge on the HOME input and for the moving via the motor TOP Z.

The position is then forced at the referenced value and the motor stops on this position.

Type 8 : On sensor and TOP Z, in negative direction, without release

The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input and for the moving via the motor TOP Z.

The position is then forced at the referenced value and the motor stops on this position.

Type 9 : Sur capteur et TOP Z, en sens -, avec dégagement

If HOME input is already 1 then the drive first launches an infinite movement in positive direction to get clear of the HOME sensor.

The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input and for the moving via the motor TOP Z.

The position is then forced at the referenced value and the motor stops on this position.

Type 10 : Axis position initialisation with the absolute position (only in SinCos mode or SSI otherwise initilisation to 0)

Type 11 : clear following error

The types for the auxiliary

Type 0 : Immediate  the auxiliary returns to its value Zero Program

Type 1 : On Top Z (the function waits for the top Z on the auxiliary input)

Type 2 : On sensor (the function waits for a rising edge on the sensor HOME)

Type 3 : On sensor and Top Z (the function waits for a high level on the sensor HOME and a top Z on the auxiliary coder)

Type 4 : Position initialisation of the auxiliary with the absolute position (only in SinCos mode or SSI otherwise initialisation to 0)

Remark

The parameter of home position (IMD_HOME_ZEROP) is continuously taken into account .

The parameter of home position on the auxiliary (IMD_AUX_ZEROP) is continuously taken into account.

Use AXIS OFF to stop a homing operation

The HOME function does not modify the current axis velocity, ex :

WRITEPARAMR(AXIS_Y, _IMD_HOME_ZEROP, 1.0) ;

VEL(Axis_Y, 5.0);

MOVA(Axis_Y, 1.0); (*goes to 1 with a velocity of 5*)

HOME(Axis_Y, 3); (*home on sensor with release, the release has a velocity of 1*)

STTA(Axis_Y, 10.0); (*goes to 10 with a velocity of 5*)

In case of problem on a HOME, HOMEAUX, CLEAR, CLEARAUX (following error, non control-mode or anything which can stop the movement), the function is then cancelled and HOME_S=0.


Contrôle

Control

Maxi following error

As soon as an axis passes in servo mode, it is controlled at any time: when stopping, in movement.

If the difference between its theoretical calculated position and its real position given by the return coder is greater than the maxi following error, the system passes all the servo axes in mode not controlled and opens the watchdog contact (except in case of use of function (SECURITY).

The adjustment of this value is very important: a too small value causes spurious shutdowns on the axes, a too large value has influence on the safety of the electric and mechanical units.

Set in the field «Maxi following error » of MPC (associated parameter FEMAX_P) the adequate value.

Position window

When an axis is sent to a position, the MPC considers that the movement is finished when the theoretical profile of the trajectory is carried out and that the real position is between +/- the window of position. For example on a drilling machine where we expect a precision of +/- 0.1mm, we will regulate the window with this value.

Set in the field «Position window » of Motion Studio the required precision value.

Software limits

On an axis with limited stroke, it is possible to declare mini and maxi end strokes. If the system detects that the axis is out of the limits, it stops and prevents any movement in the direction of the end stroke.

The release of the axis is done in the opposite direction

It is possible to use MPC inputs or drive limits inputs to do this function.

Security I/O

The "Enable" input allows to enable or disable an axis, there are different mode to enable an axis.

The "Drive ready" output gives the state of the drive, i.e. that if a drive fault is detected, the output falls.

The Brake" output allow to command the parking brake of the motor, the output corresponds to the image of AXIS_S.


Auxiliaire

Auxiliary

According to the application, mechanics (linear, rotary axis), it is interesting to be able to assign to each auxiliary axis a representative user unit: mm, point (coder point * 4), degrees, radian, inch, turn, unspecified unit...

In fact, the unit is only used on the screens of Motion Studio in order to bring there a comfort of use and comprehension.


Déclaration d'un axe en mode virtuel

Declaration of an axis in mode simulation

It is possible to configure axes in mode simulation. In this mode, the MPC will simulate the movements in an internal way and so any sent order will be virtually executed.

This mode is interesting during the phase development of the program: we can test the global nature of the application without having drivers and motors connected.


Déclaration d'un maître virtuel

Declaration of a virtual axis

It is possible to declare a virtual axis in order to get synchronised axes.


Mouvements absolues

Absolute movements

Start a movement: STTA

To launch a movement to an absolute position and not wait till it is over to continue the task execution, we must use STTA.

This instruction is very useful if the velocity or the position to reach changes during the motion.

With this function, absolute error is minimal.

This instruction is not jamming for the task (except if the motion buffer is full).

It uses the current values of acceleration, deceleration and velocity.

The syntax is:

STTA (<Axe>, <Position>)

For example:

VELP (X, 100.0); (* normal velocity *)

STTA (X, 2000.0); (*Absolute start to position 2000*)

WAIT (POS_S(X) >200.0); (*Wait position 2000*)

OUTP (A1, 1); (*Set an output *)

WAIT (POS_S(X) >700.0); (* Wait position 700 *)

OUTP (A1, 0); (*Reset an output *)

WAIT (NOT MOVE_S (X)); (* Wait end of motion *)

In this example, during the movement, we can change outputs because the execution is not stopped.

If the instruction MERGE is activated and you send several STTA instructions in the MPC, movements will be done one after the others without passing through a zero velocity.

If the axis is modulo, a motion to a position will be done in the positive direction if the required position is positive, in the negative direction for a negative required position. For example:

Axis modulo 360°

Axe in initial position at 90°

STTA(X, -10.0); (*Movement in the  direction for a distance de 80° *)

WAIT NOT MOVE_S(X);

STTA(X, 350.0); (* Movement in the + direction for a distance of 340° *)

WAIT NOT MOVE_S(X);

STTA(X, 20.0); (* Movement in the + direction for a distance of 30° *)

WAIT NOT MOVE_S(X);

Movement: MOVA

The function MOVA sends one or several axis to an absolute position. It uses the current values of acceleration, deceleration and velocity. The syntax is:

MOVA (<Axis>, <Position>)

This function sends <Axis1> to the absolute position which value is <position>. The program waits for the end of the motion before continuing. The absolute positioning error is minimal.

For example:

MOVA(X, 100.0);

Piercing (Diameter);

MOVA(X, 0.0);

The instruction MOVA stops the rest of the task until the movement is not over (condition MOVE_S(Axis)=0).

MOVA(X, 100.0); is equivalent to STTA (X, 100.0);

WAIT (NOT MOVE_S(X));

To get a better relative precision we can ask for an absolute movement using the current position: :

MOVA(X, POS_S(X) +100.0); (* Relative movement with relative precision *)

If the axis is modulo, the movement will be done in the positive direction if the required position is positive, in the negative direction for a negative required position. For example:

Axis modulo 360°

Axis in initial position at 90°

MOVA(X, -10.0); (*Movement in the  direction for a distance de 80° *)

MOVA(X, 350.0); (* Movement in the + direction for a distance of 340° *)

MOVA(X, 20.0); (* Movement in the + direction for a distance of 30° *)

Trajectory: TRAJA

The function Trajectory is made to simplify the definition of complex movements.

To do a movement with a specific velocity, acceleration or mentioned deceleration, these parameters must be set before launching the movement.

Syntax of the TRAJA function:

TRAJA (<Axis>, <Position>, <Velocity>, <Acceleration>, <Deceleration>)

For example:

TRAJA(X, 500.0, 1000.0, 100.0, 100.0) ;

This example is equivalent to:

VEL(X, 1000.0);

ACC(X, 100.0);

DEC(X, 100.0);

STTA(X, 500.0);

The TRAJA function doesnt stop the execution of the task till the movements are not over.

If the function MERGE is activated and we send several TRAJ in an axis, the movements will be done one after the other without passing through velocity zero.

For example:

MERGE(X, 1);

TRAJA(X, 500.0, 1000.0, 100.0, 100.0);

TRAJA(X, 1000.0, 200.0, 100.0, 100.0); (* change the velocity to a lower value at position 500 *)


Mouvements relatifs

Relative movements

Start movement: STTR

For launching a movement to a relative position and not waiting for its ending for continue the execution of the task, you have to use STTR. This function is useful if the speed or the final position may change during the movement. With this function, the absolute error is minimal.

This instruction does not stop the task (except if the movements buffer is full).

It uses the current values of acceleration, deceleration and velocity. The syntax is:

STTR (<Axis>, <Distance>)

For example:

VELP(X, 100.0); (* Fast velocity *)

Position:=POS_S(X);

STTR(X, 2000.0); (* Relative start to position 2000 *)

WAIT ((POS_S(X)-Position) >100.0); (* Wait position +100 *)

VELP(X, 10.0); (* Slow velocity *)

WAIT (NOT (MOVE_S(X))); (* Wait for the end of movement *)

If the instruction MERGE is activated and we send several STTR instructions in an axis board, the movements will be executed one after the other without passing through velocity zero.

Movement: MOVR

The function MOVR sends one axis to a relative position. It uses the current values of acceleration, deceleration and velocity. The syntax is:

MOVR (<Axis>, <Distance>)

This function sends <Axis> to a relative position <Distance>. The program waits for the end of the movement before going on. The absolute positioning error is minimal.

For example:

FOR I :=1 To 10 DO

MOVR(X, 100.0);

Piercing (Diameter);

END_FOR;

The instruction MOVR stops the task until the movement is not finished (condition MOVE_S (Axis)=0).

MOVR(X, 100.0); is equivalent to STTR (X, 100.0) ;

WAIT (NOT (MOVE_S(X)));

Trajectory: TRAJR

The function Trajectory is made to simplify the definition of complex movements.

To do a movement with a specific velocity, acceleration or mentioned deceleration, these parameters must be set before launching the movement

Syntax of the function TRAJR :

TRAJR (<Axis>, <Position>, <Velocity>, <Acceleration>, <Deceleration>)

For example:

TRAJR(X, 500.0, 1000.0, 100.0, 100.0) ;

This example is similar to:

VEL(X, 1000.0);

ACC(X, 100.0);

DEC(X, 100.0);

STTR(X, 500.0);

The TRAJR instruction doesnt stop the execution of the task until the movements are not finished.

If the function MERGE is activated and we send several TRAJ instructions in the axis board, the movements will be done one after the other without passing through speed zero.

For example:

MERGE(X, 1);

TRAJR(X, 500.0, 1000.0, 100.0, 100.0);

TRAJR(X, 1000.0, 200.0, 100.0, 100.0); (* change the speed to a lower value at the position 1500 *)


Mouvements infinis

Infinite movements

Movement : STTIP

To launch a continuous positive movement, you have to use the function STTIP. The selected axis will move with its current speed.

This instruction does not stop the task execution (except if the movements buffer is full).

The function STOP or SSTOP is necessary to stop a continuous movement.

Syntax:

STTIP (<Axis>)

Example:

WAIT (INP (Pluskey) =1) ;

STTIP(X);

WAIT (INP (Pluskey) =0);

STOP(X);

Movement: STTIM

To launch a continuous negative movement, you have to use the instruction STTIM. The selected axis will move with its current speed.

This function does not stop the task execution (except if the movements buffer is full).

The function STOP or SSTOP is necessary to stop a continuous movement.

Syntax:

STTIM (<Axis>)

Example:

WAIT (INP (Minuskey) =1) ;

STTIM(X);

WAIT (INP (Minuskey) =0);

STOP(X);

Trajectory: TRAJIP

The function Trajectory is made to simplify the definition of complex movements.

To do an infinite positive movement with a specific velocity, acceleration or deceleration, these parameters must be set before launching the movement

Syntax of the function TRAJIP :

TRAJIP (<Axis>, <Velocity>, <Acceleration>)

For example:

TRAJP(X, 1000.0, 100.0);

This example is similar to:

VEL(X, 1000.0);

ACC(X, 100.0);

STTIP(X);

The function TRAJIP does not stop the task until the movements are not finished.

If the instruction MERGE is activated and we send several TRAJ instructions in the axis board, the movements will be done one after the other without passing through speed zero.

For example:

MERGE(X, 1);

TRAJR(X, 500.0, 1000.0, 100.0, 100.0);

TRAJIP(X, 200.0, 100.0); (* changes the velocity to a lower value at position 500 *)

Trajectory: TRAJIM

The function Trajectory is made to simplify the definition of complex movements.

To do an infinite negative movement with a specific velocity and mentioned acceleration, these parameters have to be set before launching the movement.

Syntax of the function TRAJIM :

TRAJIM (<Axis>, <Velocity>, <Acceleration>)

For example:

TRAJIM(X, 1000.0, 100.0);

This example is similar to:

VEL(X, 1000.0);

ACC(X, 100.0);

STTIM(X);

The function TRAJIM does not stop the task until the movements are not finished.

If the instruction MERGE is activated and we send several TRAJ instructions in the axis board, the movements will be done one after the other without passing through speed zero.

For example:

MERGE(X, 1);

TRAJR(X, 500.0, 1000.0, 100.0, 100.0);

TRAJIM(X, 200.0, 100.0); (* changes the speed to a lower value at the position 500 *)


Arrêt d'un mouvement

Stopping a movement

To stop a movement, you have to use the functions STOP or SSTOP. They stop the selected axis using the programmed deceleration, and then empty the movements buffer.

The function STOP does not stop the task until the movement is not finished (condition MOVE_S(Axis)=0 ) when SSTOP does not stop it.

Syntax:

STOP (<Axis>)

Example: movement up to detect a sensor

STTIP(X);

WAIT (INP (Sensor)=1);

STOP(X);

The function AXIS(Axis)=O stops the movement too, but without any control because the control-mode is inhibited.


Mouvements déclenchés

Triggered movement

Introduction

The functions TRIGGER allow triggering a movement with an event:

Ä A master position

Ä A state change of an input

Ä A state change of an input in a position window

Description

The function TRIGGER can be associated with 3 types of movements and for each group we can have 1 queue trigger movement:

Group 1: MOVA, MOVR, STTA, STTR, STTIM, STTIP, TRAJA, TRAJR, TRAJIM, TRAJIP, MOVS, GEARBOX, STARTCAM

A trigger on a function of Group 1 is taken into account when the previous movement is finished:

Group 2: STOP, SSTOP, POS, GEARBOXRATIO, STOPS, BREAKCAM

A trigger on a function of Group 2 is taken into account as soon as it is loaded:

Group 3: ICORRECTION

A trigger on a function of Group 3 is taken into account as soon as it is loaded (special case of ICORRECTION, in reality as soon as the previous ICORRECTION is finished, but there is never queue ICORRECTION)

List of functions

TRIGGERP | This function indicates that the next movement will be triggered on master position
TRIGGERI | This function indicates that the next movement will be triggered on an input change state.
TRIGGERF | This function indicates that the next movement will be triggered on an input change state and in a position window.
TRIGGERAXISSET | Forces the start of a movement which was waiting for a trigger
TRIGGERAXIS_S | Returns the trigger state on an axis

Example

(* Triggering of axis X on rising edge of input 4 of MPC when the axis Y is between 10 and 20 *)

TRIGGERF (Mpc_4, 1, Axis_Y, SRC_AXIS, 10.0, 20.0, 1);

MOVR (Axis_X, 100.0);

...

(* Triggering of axis X on rising edge of input 4 of MPC *)

TRIGGERI (Mpc_4, 1);

MOVR (Axe_X, 100.0);

...

(* Triggering of axis X from the position Y= 10 in positive direction*)

TRIGGERP (Axis_Y, SRC_AXIS, 10.0, 1);

MOVR (Axis_X, 100.0);

...


Arbre électrique

Electronic gearbox

Introduction

The functions GEARBOX allow realizing an electric shaft between a master and a slave axis.

Functions list

GEARBOX | Starts an electric shaft between a master and a slave axis.
GEARBOXRATIO | Changes the reduction ratio of an electrical shaft link.
GEARBOXRATIO_S | Returns the change status of an axis ratio.

Example

(* Master: 360° per tour, modulo of 360 *)

(* Slave: 25.4 mm/tour *)

(* A ratio of 25.4 (num)/360 (den) corresponds to: 1 slave tour for a master tour *)

GEARBOX (Axis_X, Axis_Y, SRC_AXIS, 25.4, 360.0, 1, 0.0) ;

...

If GEARBOXRATIO_S(Axis_X)=1 Then

(* 2 tours on master for 1 on slave *)

GEARBOXRATIO (Axis_X, 25.4, 720.0, 0.0);

End_If;

...


Mouvements synchronisés

Synchronised movements

General formula

Functions list

MOVS | Makes a synchronisation between a slave and master axis.
STOPS | Stops the synchronisation according to the master position and a deceleration on the slave.
STOPS_S | Indicates that the slave position given by the function STOPS cannot be reached.

Applications

The function MOVS accepts the combination of the following parameters:

Velocity change phase

Velocity change phase + constant phase

Constant phase

Constant phase + Stop phase

Stop phase

Velocity change phase + constant phase + stop phase

Velocity changing phases

Zero initial velocity:

In the previous example, the phase 1 is a velocity changing phase with zero initial velocity.

MOVS (dM1, dE1, dM1, 0)

The velocity ratio at the end of this phase is equal to 2*dE1/dM1

Initial velocity greater than zero and lower than final velocity

The phase 3 represents this kind of velocity changing phase

The initial velocity ratio is dE2/dM2 and the final velocity ratio is dE4/dM4 so :

MOVS (dM3, dE3, dM3, 0)

The average velocity ratio during this phase is dE3/dM3 and is greater than the initial velocity ratio; so this is an acceleration phase.

Initial velocity greater than zero and greater than final velocity

This kind of velocity change is represented on phase 5.

The initial velocity ratio is dE4/dM4 and the final velocity ratio is dE6/dM6 so :

dE5 = dM5 * (dE4/dM4+dE6/dM6) /2

MOVS (dM5, dE5, dM5, 0)

The average velocity ratio during this phase is dE5/dM5 and is lower than the initial velocity ratio; so this is a deceleration phase.

Velocity change phases + constant phase

Zero initial velocity:

In the previous example, the phase 1 is a velocity changing phase with zero initial velocity.

dE10=dE1+dE2=1/2*dM1*dE2/dM2+dE2

dM10=dM1+dM2

MOVS (dM10, dE10, dM1, 0)

Initial velocity greater than zero and lower than final velocity :

The phase 3 represents this kind of velocity change.

The initial velocity ratio is dE2/dM2 and the final velocity ratio is dE4/dM4 so :

dE30=dE3+dE4=dM3*(dE2/dM2+dE4/dM4)/2+dE4

dM30=dM3+dM4

MOVS (dM30, dE30, dM3, 0)

The average velocity ratio during the phase is dE3/dM3 and is greater than the initial velocity ratio; so this is an acceleration phase.

Initial velocity greater than zero and greater than final velocity:

This kind of phase is represented on phase 5.

The initial velocity ratio is dE4/dM4 and the final velocity ratio is dE6/dM6 so

dE50=dE5+dE6=dM5*(dE4/dM4+dE6/dM6)/2+dE6

dM50=dM5+dM6

MOVS (dM50, dE50, dM5, 0)

The average velocity ratio during this phase 5 is dE5/dM5 and is lower than the initial velocity ratio; so this is a deceleration phase.

Constant phase

Phases 2, 4 and 6 can be directly described:

MOVS (dM2, dE2, 0, 0)

MOVS (dM4, dE4, 0, 0)

MOVS (dM6, dE6, 0, 0)

Constant phase + stop phase

In the phases 6 and 7 we realize a constant phase followed by a stop phase.

dE70=dE6+dE7=dE6+1/2*dM7*dE6/dM6

dM70=dM6+dM7

MOVS (dM70, dE70, 0, dM7)

Stop phase

The stop phase 7 is directly described:

MOVS (dM7, dE7, 0, dM7)

The velocity ratio before this phase was 2*dE7/dM7

Velocity changing phase + Constant phase + Stop phase

In this example :

dE1=1/2*dM1*dE2/dM2

dE3=1/2*dM3*dE2/dM2

dE=dE1+dE2+dE3=1/2*(dM1+dM3)*dE2/dM2

dM=dM1+dM2+dM3

MOVS (dM, dE, dM1, dM3)

Example

...

(* DOUBLE COUPE *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, DistMaster, DistSlave, DistMaster, 0.0); (* Acceleration phase *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, CoteMaxSynchro, CoteMaxSynchro, 0.0, 0.0); (* Constant phase *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, DistMaster, DistSlave, 0.0, DistMaster); (* Deceleration phase *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, Piecelength, 0.0, 0.0, 0.0); (* Stop phase of the slave *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, DistMaster, DistSlave, DistMaster, 0.0); (* Acceleration Phase *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, CoteMaxSynchro, CoteMaxSynchro, 0.0, 0.0); (* Constant Phase *)

MOVS (Axis_X, Axis_Y, SRC_AXIS, DistMaster, DistSlave, 0.0, DistMaster); (* Deceleration phase *)

WAIT (ORDER_S (Axis_X) =2);

Cut (Diameter);

BREAKCAM (Axis_X);

WAIT (ORDER_S (Axis_X) =6);

BREAKCAM (Axis_X);

Cut (Diameter);

...


Came

Cam

Introduction

Definition of a cam

The cam function permits to realise a cam profile on a slave axis linked to a master axis. This profile is defined with a points array.

Each point is defined by a master position and a slave one of the axis.

La MPC will execute a trajectory calculated with a 3rd order polynomial between two consecutive points.

The values given to the master axis position inside the array must be increasing.

The cam form depends on each mode point:

Ä Line : calculate a line from the current point to the next point (there is a speed discontinuity at the current speed, speed remains the same until the next point).

Ä Auto : calculate automatically a trajectory with a 3rd order polynomial using the previous, the current and the next two points).

Ä Manual : calculate a graph according to a tangential at the current point and with slope = master tangential / slave tangential.

Absolute or relative cam

Define as from which point the CAM profile is executed: in absolute the reference is 0, in relative the reference is the axes position at the launching of cam profile.

Example:

Cam Profile
Master | Slave
0 | 5
10 | 7
20 | 30
30 | 35
40 | 30
50 | 15

  • If master position is 20 and slave is 30, before cam starting the cam will do the following movements for an absolute cam:

    • Absolute Cam
Master | Slave
20 | 30
30 | 35
40 | 30
50 | 15

    • If master position is 20 and slave is 30, before cam starting the cam will do the following movements for a relative cam:

      • Relative Cam
Master | Slave
20 | 35
30 | 37
40 | 60
50 | 65
60 | 60
70 | 45

      Finite or infinite cam

      A mechanical cam corresponds to a finite electronic cam. In the points array, the first and the last values of the slave position are similar. The slave movement will be a linear movement with a finite magnitude.

      The electronic cam permits also to create on the slave axis a rotation infinite movement: the absolute slave position increases at each new master cycle.

      Finite cam

      Infinite cam

      Warning:

      If the master axis or the slave axis is infinite, they must be declared as modulo axes from the Motion control tab.

      If the cam is infinite and absolute, it must be declared on the total master modulo.

      Programming a cam

      Graphic editor

      See "Cam editor" in the chapter of the Motion Studio software

      Cam storage

      Cam modification

      In order to modify a cam (stored in the CF-CARD) you must transfer it in a variable of type tCamTable, you must use the following functions:

      READCAM | Registers a cam of the CF-CARD in the cam array
WRITECAM | Register a cam array in the CF-CARD.

      The type tCamTable is defined with the following structure :

      UDINT Nb ; (*nb of cam points, offset IEC : 2*)

      REAL X [1024]; (*master position , offset IEC: 18*)

      REAL Y [1024]; (*slave position : 4126*)

      REAL dX [1024]; (*tangent X: 8234*)

      REAL dY [1024]; (*tangent Y: 12342*)

      The choice of the trajectory mode for each point depends on the different values of the various elements of the tCameTable :

      Ä If X (Master position) <> dX (Master tangent) alors on a une trajectoire de type Manuel

      Ä If X (Master position) = dX (Master tangent) and dY (Slave tangent) <> 0 then we have a trajectory of type line.

      Ä If X (Master position) = dX (Master tangent) and dY (Slave tangent) = 0 then we have a trajectory of type Auto.

      Loading a cam

      In order to use a cam, you must load it in internal memory:

      LOADCAM | Loads a cam in the MPC from the CF-CARD.
LOADCAMI | Loads a cam in the MPC from a cam table.

      It is possible to have simultaneously 128 internal cams.

      An internal cam contains:

      Ä A number of cam segments

      Ä The data relating to the cam segments, ready to be used according to the options of LOADCAM

      Ä The master reference

      Ä The slave reference

      Remark

      For an absolute cam, the absolute alignments which take place with the gearing and during operation (if necessary), act on the MASTEROFFSET_S and the SLAVEOFFSET_S. They use the acceleration set for the MASTEROFFSET and the SLAVEOFFSET.

      Be careful, this alignment is affected by the functions changing the axis position, for example HOME, HOMEAUX, CLEAR, etc

      absolute

      Direction

      Gearing

      End cam (if single shoot=1)

      Disengaging (if single shoot=1)

      0

      Indif.

      Always at the cam beginning.

      If master goes in a STTIP direction (on master axis), slave goes in a STTIP direction (on slave axis)

      If master goes in a STTIM direction (on master axis), slave goes in a STTIM direction (on slave axis)

      Once the last point of the cam reached.

      If return at the beginning of the cam, cam is reversible (regearing in the opposite direction)

      0

      +

      Always at the cam beginning.

      If master goes in a STTIP direction (on master axis), slave goes in a STTIP direction (on slave axis)

      Else no gearing

      Once the last point of the cam reached.

      If return at the beginning of the cam, disengaging then regearing

      0

      -

      Always at the cam beginning.

      If master goes in a STTIM direction (on master axis), slave goes in a STTIP direction (on slave axis)

      Else no gearing

      Once the last point of the cam reached.

      If return at the beginning of the cam, disengaging then regearing

      1

      Indif.

      Anywhere in the cam

      None (need a function : STOP / BREAKCAM)

      If one leaves on a side or the other of the cam

      1

      +

      Gearing on passage of the first element of the cam

      Once the last point of the cam reached.

      If one arises at the beginning of cam

      1

      -

      Gearing on passage of the last element of the cam

      Once the first point of the cam reached.

      If one arises at the end of the cam

      Non reversible chain of cam:

      When we start several cams with several STARTCAM, we can come back to the beginning of the cam of the running STARTCAM

      LOADCAM (Slave,Master,SRC_AXIS,1,1,Came1,0,1,0,1.0,1.0,0,0);

      LOADCAM (Slave,Master,SRC_AXIS,2,1,Came2,0,1,0,1.0,1.0,0,0);

      LOADCAM (Slave,Master,SRC_AXIS,3,1,Came3,0,1,0,1.0,1.0,0,0);

      STARTCAM (1);

      STARTCAM (2);

      STARTCAM (3);

      Reversible chain of cam

      When we start several linked cams, we can return at the beginning of the cam (here in the cam 3, we can come back into the 1)

      LOADCAM (Slave,Master,SRC_AXIS,1,1,Came1,0,1,0,1.0,1.0,2,0);

      LOADCAM (Slave,Master,SRC_AXIS,2,1,Came2,0,1,0,1.0,1.0,3,1);

      LOADCAM (Slave,Master,SRC_AXIS,3,1,Came3,0,1,0,1.0,1.0,0,2);

      STARTCAM (1);

      The calculation of the cam profiles takes into account:

      Äcalculated points of the cam and their type (straight, manual, auto)

      Äthe cam be single shot or not (chain the first points with the last ones)

      Ämasters and slaves gains

      The calculation of cam profiles does not take into account:

      Ä Information next cam/previous cam. A point in auto mode at the end of cam will be systematically taken with a null slope, ensuring a correct connection between 2 cams linked with next/previous, but not being inevitably as optimized as all the points in only one cam.

      Launching of a cam

      STARTCAM

      Launches the execution of a cam.

      Example 1 : cam of 6 points, infinite, non single-shot

      (*Definition of the table in the real array TabCam *)

      MyCam.X [1] := 0.0;

      MyCam.Y [1] := 0.0;

      MyCam.dX [1] := 0.0;

      MyCam.dY [1] := 0.0;

      MyCam.X [2] := 30.0;

      MyCam.Y [2] := 20.0;

      MyCam.dX [2] := 30.0;

      MyCam.dY [2] := 0.0;

      MyCam.X [3] := 90.0;

      MyCam.Y [3] := 76.0;

      MyCam dX [3] := 90.0;

      MyCam.dY [3] := 0.0;

      MyCam.X [4] := 270.0;

      MyCam.Y [4] := 283.0;

      MyCam.dX [4] := 270.0;

      MyCam dY [4] := 0.0;

      MyCam.X [5] := 330.0;

      MyCam.Y [5] := 338.0;

      MyCam.dX [5] := 330.0;

      MyCam.dY [5] := 0.0;

      MyCam.X [6] := 360.0;

      MyCam.Y [6] := 360.0;

      MyCam.dX [6] := 360.0;

      MyCam.dY [6] := 0.0;

      MyCam.Nb := 6;

      (* Loading of the cam *)

      LOADCAMI (Slave, Master, SRC_AXIS, 1, 1, MyCam, 0, 1, 0, 1.0, 1.0, 0, 0);

      (* Launching of the cam *)

      STARTCAM (1);

      ...

      WAIT (INP (InfoStop)); (* Wait for the stop requirement *)

      ENDCAM (Esclave); (* Stop request at the end of the current profile *)

      ...

      Example 2 : chaining cams

      Here is a cycle made of three cams: C1 with an input profile single-shot, C2 repetitive profile non single-shot, and C3 with an output profile single-shot.

      C1 is chained with C2 and C2 to C3.

      ...

      (*Loading cam nr 1 : 10 points, single-shot, followed by cam nrC2 *)

      LOADCAM (Slave, Master, SRC_AXIS, 1, 0, Cam1, 1, 1, 1, 1.0, 1.0, 2, 0);

      (* Loading cam nr2 : 76 points, non single-shot, followed by cam nr3 *)

      LOADCAM (Slave, Master, SRC_AXIS, 2, 0, Cam2, 0, 1, 0, 1.0, 1.0, 3, 1);

      (* Loading cam n°3 : 6 points, single-shot *)

      LOADCAM (Slave, Master, SRC_AXIS, 3, 0, Cam3, 1, 1, 0, 1.0, 1.0, 0, 3);

      (*Launching of cam nr1 => execution of cam1, then cam2 *)

      STARTCAM (1);

      WAIT (CAMNUM_S (Slave)=2); (* Wait execution of cam2 *)

      ...

      WAIT (INP (InfoStop)=1); (* Wait for stop requirement *)

      ENDCAM(Slave); (*stop cam 2 at the end of profile and then on cam3 *)

      ...

      WAIT (CAM_S (Slave)=0); (* Wait for the end of cam3 *)

      State of the cam

      Three functions can show the current state of a cam:

      CAM_S | indicates the number of the running cam and segment.
CAMNUM_S | Indicates the number of the running cam.
CAMSEG_S | Indicates the equation number of the running cam.

      Warning : its possible to get a risk if you read separately CAMNUM_S and CAMSEG_S, in that case use CAM_S.

      Stop of a cam

      ENDCAM | Stops the slave axis movement at the end of the cam.
BREAKCAM | Stops the running synchronization movement and follows with the next without desynchronization.
BREAKCAM_POS | Returns the axis position when the last BREAKCAM or STOPS.

      Remark :

      The return of a cam towards a relooped cam transforms the latter into single shoot cam.

      Modification of cam points

      CAMREADPOINT | Calculates the slave positon <Slave position> in the cam, corresponding to the master position <master position>.
LOADCAMPOINT | Modify a cam point promptly.

      Dynamic dephasing

      These dephasings are carried out independently of the master and slave movements, their application depends on time and acceleration given, or is immediate.

      Master dephasing

      The master dephasing had as effect to dephase the master cycle relating to the slave cycle. In case of a relooped cam it is necessary to take into account this shift to position the slave relating to the master (function CAMREADPOINT takes into account this shift). The master shift can be done gradually by the application of a parameter of acceleration. The shift is applied directly if the synchronized movement is not in process or if the axis is not gearing.

      MASTEROFFSET | This function shifts dynamically the master position used by the absolute cam.
MASTEROFFSET_S ICORRECTIONA | This function returns the current value of the master offset. This function applied the compensations to be carried out to be located at the ad hoc point.

      Slave dephasing

      The slave dephasing had as effect to dephase the slave positions but keep the phase with the master cycle. In all cases, its necessary to respect this dephasing to position the slave with regard to the master (function CAMREADPOINT takes into account this shift). The slave dephasing can be progressively done by the application with an acceleration parameter. The dephasing is directly applicate if the synchronised movement is not running or if axis in not enable.

      SLAVEOFFSET | This function shifts dynamically the slave position.
SLAVEOFFSET_S ICORRECTIONA | This function returns the current value of the slave offset. This function applied the compensations to be carried out to be located at the ad hoc point.

      Started cam on capture input

      It is possible to execute synchronized cams by using functions TRIGGER


Fonction de compensation / décompensation

Compensation / uncompensation functions

Introduction

The compensation/uncompensation functions permit to make a dynamic phase displacement on a slave axis linked to a master axis.

The link between the 2 axes must be an electric shaft (GEARBOX), synchronisation (MOVS) or cam (CAM)

List of functions

ICORRECTION | Applies a correction movement on a slave axis during a distance of master axis.
ICORRECTION_S | Returns the state of the compensation cycle.
 | Applies the compensations to be done to be located at the point ad hoc.

Example

...

MOVS (Axis_X, Axis_Y, SRC_AXIS, 100.0, 50.0, 0.0, 0.0);

MOVS (Axis_X, Axis_Y, SRC_AXIS, 200.0, 250.0, 0.0, 0.0);

MOVS (Axis_X, Axis_Y, SRC_AXIS, 60.0, 60.0, 0.0, 0.0);

(* Automatic phasing, No risk of points loss consecutive to non finished ratios *)

ICORRECTIONA (Axis_X, Axis_Y, SRC_AXIS, 360.0, 360.0);

...


Fonction de superposition de mouvements

Movements superposition function

Introduction

The function ADDMOV superposes on a slave axis its own movements with those done by a master axis.

The link between the two axis must be an electric shaft (GEARBOX), synchronisation (MOVS) or cam (CAM) or positioning (MOVA, MOVR, SSTA, STTR, STTIP, STTIM).

List of functions

ADDMOV | This function allows the superposition of its movements on a slave axis with those done by a master axis.
ADDSTOP | This function allows the destruction of the superposition links of the slave axis movements.

Example

HOME (Axis_Y, 0);

HOME (Axis_X, 0);

ADDMOV (Axis_X, Axis_Y, SRC_AXIS); (* activation of superposition link*)

STTIP (Axis_Y); (* launching axis Y => axis X moves too *)

...

WAIT (INP (StartCycle));

MOVR (Axis_X, StepCycle); (* superposition of a distance movement StepCycle *)

...

STOP (Axis_X);

ADDSTOP (Axis_X); (* stops the superposition link *)


Arrêt d'une liaison maître / esclave

Stopping a master / slave link

Introduction

To stop a link between a master and a slave, you have to use the instructions STOP, SSTOP or STOPS on the slave axis.

The functions STOP and SSTOP stop the specified axis with the current deceleration when STOPS uses a synchronised stop phase.

All these functions clear the movement buffer relating to the slave axis.

List of functions

STOP | Stops the axis with the current deceleration.
SSTOP | Stops the axis with the current deceleration (non blocking).
STOPS | Stops the axis and permits the slave axis to decelerate to reach the position <SlavePos.>.
STOPS_S | Indicates if STOPS has been correctly executed

Example

GEARBOX (Slave, Master, SRC_AXIS, 25.4, 360.0, 1, 0.0); (* activation of master/slave link *)

STTIP (Master); (* master start => the slave follows *)

...

STOP (Master); (* master stop => the slave stops *)

...

STOP (Slave); (* Stop of the master/slave link *)


Linear interpolation

Introduction

STTL2D and TRAJL2D functions allow to make linear interpolation on two axis.

STTL3D and TRAJL3D functions allow to make linear interpolation on three axis.

Functions list

INTERPOLATE2D | Start 2D interpolation.
STTL2D | Launch a 2D linear movement.
TRAJL2D | Launch a 2D linear trajectory.

INTERPOLATED3D | Start 3D interpolation.
STTL3D | Launch a 3D linear movement.
TRAJL3D | Launch a 3D linear trajectory.

Example

Axe_Interpo is a virtual axis define in the project

Axe_X and Axe_Y are axies define in the project

(* Déclaration de mon interpolation Axe_Interpo selon les axes Axe_X et Axe_Y *)

INTERPOLATE2D (Axe_Interpo, Axe_X, Axe_Y);

(* Réalisation dun rectangle

STTL2D(Interpo_2D, 100, 0.0, 1);

STTL2D(Interpo_2D, 100, 10.0, 1);

STTL2D(Interpo_2D, 0.0, 10.0, 1);

STTL2D(Interpo_2D, 0.0, 0.0, 1);


Circular interpolation

Introduction

STTC2D and TRAJC2D functions allow to make circular interpolation on two axis.

STTC3D and TRAJC3D functions allow to make circular interpolation on three axis.

Functions list

INTERPOLATE2D | Start 2D interpolation.
STTC2D | Launch a 2D circular movement.
TRAJC2D | Launch a 2D circular trajectory.

INTERPOLATE3D | Start 3D interpolation.
STTC3D | Launch a 3D circular movement.
TRAJC3D | Launch a 3D circular trajectory.

Example

Axe_Interpo is a virtual axis define in the project

Axe_X and Axe_Y are axies define in the project

(* Déclaration de mon interpolation Axe_Interpo selon les axes Axe_X et Axe_Y *)

INTERPOLATE2D (Axe_Interpo, Axe_X, Axe_Y);

(* Réalisation dun cercle *)

MERGE() ;

TRAJC2D(Interpo_2D, CentreX, CentreY, RX, RY, 0, 1) ;

TRAJC2D(Interpo_2D, CentreX, CentreY, -RX, -RY, 0, 1) ;


Helical interpolation

Introduction

STTH3D and TRAJH3D functions allow to make helical interpolation on three axis.

Functions list

INTERPOLATE3D | Start 3D interpolation.
STTH3D | Launch a 3D helical movement.
TRAJH3D | Launch a 3D helical trajectory.

Exemple

Axe_Interpo is a virtual axis define in the project

Axe_X , Axe_Y and Axe_Z are axies define in the project

(* Déclaration de mon interpolation Axe_Interpo selon les axes Axe_X et Axe_Y *)

INTERPOLATE3D (Axe_Interpo, Axe_X, Axe_Y, Axe_Z);

(* Réalisation dun mouvement hélicoïdale *)

STTH3D(Interpo_3D, Xcentre, Ycentre, ZPas, Angle, Sens, Abs) ;


Resultant acceleration / velocity

As a positioning, an interpolated movement is made of an acceleration phase, a constant speed, and a deceleration phase.
These values correspond to the resultant acceleration and speed of the interpolated axis.

The instruction ACC (<Axe_Interpo>, <Expression>) affects a resultant acceleration and deceleration. It is taken at any time.

The instruction DEC (<Axe_Interpo>, <Expression>) affects a resultant acceleration and deceleration. It is taken at any time.

The instruction DEC (<Axe_Interpo>, <Expression>) affects a resultant speed value. It is taken in account at any time.

If the instruction MERGE (< Axe_Interpo >,1) is activated and we send several TRAJL and TRAJC instructions in the movement buffer, the acceleration phase will be effective until the required resultant speed is reached. Then, the movements are chained; we go from one to the next at the same velocity. The deceleration phase will be done onto the last movement(s).

' Warning : For pieces which have some arcs of a circle and for which we use the linked movements (MERGE(Axe_Inter,1), the real acceleration may become very high:

Accel (t) = - ( Vi² / r ) * Cos ( Téta i + (( Vi / r ) * t ))

Accel. maxi = - ( Vi² / r )

with Vi = initial velocity before the arc of circle in m / s

r = radius of the arc en m

Accel in m / s²

Accel maxi = - ( 0.5² / 0.01 ) = -25 m/s²


Stopping a movement

To stop an interpolated movement during the motion, you have to use the instruction STOP (<Axe_Inter >). The axis stop following the interpolated trajectory and using the deceleration given by the instruction DEC (<Axe_Inter>). The movement buffer is emptied: we will not be able to go on to the trajectory.

This instruction stops the task until the movement is over (condition MOVE_S(Axe_Inter)=0 ). For example:

VEL (Axe_Interpo, 300.0) ; (* Vitesse interpolée *)
ACC (Axe_Interpo, 2000.0) ; (* Accélération interpolée *)
DEC (Axe_Interpo, 2000.0) ;
INTERPOLATE2D(Axe_Interpo, X, Y) ;
MERGE (Axe_Interpo, 1) ; (* Mouvements enchaînés *)
STTL2D (Axe_Interpo, 0.0, 2.0, 0) ; (* Déplacement interpolé en 0,20*)
STTL2D (Axe_Interpo, 10.0, -10.0, 0) ; (* Déplacement en 10,-10 - Gravure du M*)
...

STOP (Axe_Inter);

If we wish to have a break during the movement, you have to set the resultant speed to zero. For example:

VEL (Axe_Interpo, 300.0) ; (* Vitesse interpolée *)
ACC (Axe_Interpo, 2000.0) ; (* Accélération interpolée *)
DEC (Axe_Interpo, 2000.0) ;
INTERPOLATE2D(Axe_Interpo, X, Y) ;
MERGE (Axe_Interpo, 1) ; (* Mouvements enchaînés *)
STTL2D (Axe_Interpo, 0.0, 2.0, 0) ; (* Déplacement interpolé en 0,20*)
STTL2D (Axe_Interpo, 10.0, -10.0, 0) ; (* Déplacement en 10,-10 - Gravure du M*)
...

IF (FlagStop=1) Then

FlagStop:=0 ;

VEL (Axe_Interpo, 0.0) ; (* Vitesse interpolée *)

END_IF;

IF (FlagStart=1) Then

FlagStart:=0 ;

VEL (Axe_Interpo, 300.0) ; (* Vitesse interpolée *)

END_IF;

...


Examples

Glue lifting

Program :

Axe_Interpo est un axe virtuel déclaré dans le projet

X et Y sont des axes déclarés dans le projet

MarcheDepose:=1000;
VEL (X, 1000.0) ; (* Vitesse en mode positionnement *)
VEL (Y, 1000.0) ;
ACC (X, 1500.0) ; (* Accélération et décélération *)
ACC (Y, 1500.0) ;
DEC (X, 1500.0) ; (* en mode positionnement *)
DEC (Y, 1500.0) ;
AXIS (X, 1) ;
AXIS (Y, 1) ;
VEL (Axe_Interpo, 1000.0) ; (* Vitesse interpolée *)
ACC (Axe_Interpo, 1500.0) ; (* Accélération interpolée *)
DEC (Axe_Interpo, 1500.0) ;
INTERPOLATE2D(Axe_Interpo, X, Y);
MERGE (Axe_Interpo, 1) ; (* Mouvements enchaînés *)

STTA (X, 20.0) ; (* Déplacement de positionnement au 1er point *)
STTA (Y, 10.0) ;
WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;
OUTP (Depose, 1) ; (* Activation *)
DELAY (MarcheDepose) ; (* Tempo *)
STTL2D (Axe_Interpo, 110.0, 0.0, 0) ; (* Déplacement interpolé en 130,10 *)
STTC2D (Axe_Interpo, 10.0, 10.0, 0.0, 10.0, 0, 0) ; (* Déplacement en 140,20 sens anti-horaire *)
STTL2D (Axe_Interpo, 0.0, 60.0, 0) ;  (* Déplacement interpolé en 140,80 *)
STTC2D (Axe_Interpo, -20.0, 0.0, -10.0, 0.0, 0, 0) ; (* Déplacement en 120,80 sens anti-horaire *)
STTC2D (Axe_Interpo, -10.0, -10.0, -10.0, 0.0, 1, 0) ; (* Déplacement en 110,70 sens horaire *)
STTL2D (Axe_Interpo, -90.0, 0.0, 0) ; (* Déplacement interpolé en 20,70 *)
STTC2D (Axe_Interpo, -10.0, -10.0, 0.0, -10.0, 0, 0) ; (* Déplacement en 10,60 sens anti-horaire *)
STTL2D (Axe_Interpo, 0.0, -40.0, 0) ; (* Déplacement interpolé en 10,20 *)
STTC2D (Axe_Interpo, 10.0, -10.0, 10.0, 0.0, 0 ,0) ; (* Déplacement en 20,10 sens anti-horaire *)
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ; (* Attente de la fin des déplacements *)
OUTP (Depose, 0) ; (* Désactivation *)
DELAY (ArretDepose) ; (* Tempo *)

STTA (X, 0.0) ; (* Retour origine *)
STTA (Y, 0.0) ;
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;

In this example, the X and Y axis are used to lift a glue string. Lifting is the output, which commands the glue lifting. After a movement from the origin to the first position (20,10), the lifting begins, following the drawing. When the movement links the starting point, the output is disabled and the axis are going back to the origin.

Engraving or cutting

Program:

VEL (X, 1000.0) ; (* Vitesse en mode positionnement *)
VEL (Y, 1000.0) ;
ACC (X, 1500.0) ; (* Accélération et décélération *)
ACC (Y, 1500.0) ;
DEC (X, 1500.0) ; (* en mode positionnement *)
DEC (Y, 1500.0) ;
AXIS (X, 1) ;
AXIS (Y, 1) ;
VEL (Axe_Interpo, 300.0) ; (* Vitesse interpolée *)
ACC (Axe_Interpo, 2000.0) ; (* Accélération interpolée *)
DEC (Axe_Interpo, 2000.0) ;
INTERPOLATE2D(Axe_Interpo, X, Y) ;
MERGE (Axe_Interpo, 0) ; (* Mouvements non enchaînés *)

STTA (X, 0.0) ; (* Déplacement de positionnement au 1er point *)
STTA (Y, 10.0) ;
WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;
OUTP (Graveuse, 1) ; (* Activation *)
DELAY (MarcheGraveuse) ; (* Tempo *)
STTL2D (Axe_Interpo, 0.0, 20.0, 0) ; (* Déplacement interpolé en 0,20*)
STTL2D (Axe_Interpo, 10.0, -10.0, 0) ; (* Déplacement en 10,-10 - Gravure du M*)
STTL2D (Axe_Interpo, 10.0, 10.0, 0) ; (* Déplacement interpolé en 20,20 *)
STTL2D (Axe_Interpo, 0.0, -20.0, 0) ; (* Déplacement interpolé en 20,0 *)
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ; (* Attente de la fin des déplacements *)
OUTP (Graveuse, 0) ; (* Désactivation *)
DELAY (ArretGraveuse) ; (* Tempo *)

STTA (X, 40.0) ; (* Déplacement en 35,0 *)
STTA (Y, 0.0) ;
WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;
OUTP (Graveuse, 1) ; (* Activation *)
DELAY (MarcheGraveuse) ; (* Tempo *)
STTL2D (Axe_Interpo, 5.0, 0.0, 0) ; (* Déplacement interpolé en 35,0 *)
STTC2D (Axe_Interpo, 20.0, 0.0, 10.0, 0.0, 1, 0) ; (* Déplacement en 35,20 - Gravure du C *)
STTL2D (Axe_Interpo, 5.0, 0.0, 0) ; (* Déplacement interpolé en 40,0 *)
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ; (* Attente de la fin des déplacements *)
OUTP (Graveuse, 0) ; (* Désactivation *)
DELAY (ArretGraveuse) ; (* Tempo *)

STTA (X, 60.0) ; (* Déplacement en 60,20 *)
STTA (Y, 20.0) ;
WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;
OUTP (Graveuse, 1) ; (* Activation *)
DELAY (MarcheGraveuse) ; (* Tempo *)
STTL2D (Axe_Interpo, -10.0, 0.0, 0) ; (* Déplacement interpolé en 50,20 *)
STTC2D (Axe_Interpo, 0.0, -10.0, 0.0, -5.0, 0, 0) ;  (* Déplacement en 50,10 *)
STTL2D (Axe_Interpo, 10.0, 0.0, 0) ;  (* Déplacement interpolé en 60,10 - Gravure du S *)
STTC2D (Axe_Interpo, 0.0, -10.0, 0.0, -5.0, 1, 0) ;  (* Déplacement en 60,0 *)
STTL2D (Axe_Interpo, -10.0, 0.0, 0) ; (* Déplacement interpolé en 50,0 *)
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ; (* Attente de la fin des déplacements *)
OUTP (Graveuse, 0) ; (* Désactivation *)
DELAY (ArretGraveuse) ; (* Tempo *)

STTA (X, 0.0) ; (* Retour origine *)
STTA (Y, 0.0) ;
WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;


Declaration of an interpolation axis

Principle:

  1. To carry out an interpolation, it is necessary to declare an axis virtual in the Motion tab

  2. In tasks, you define the geometrical model and the list of the slaves axes .

Interpolation rule:

  1. The axes slaves must be controlled.

  2. The management of the desactivation of the axes when an axis of an interpolation passes in error depends SECURITY instruction.

  3. Any other movement started on the axes slaves, at the time of a movement of interpolation, is strictly prohibited.

  4. The functions of control of movement of the virtual axes are usable with the axis of interpolation

  5. During a movement of interpolation, a modification of numerator, denominator or distance on an axis slave is not taken into account.

  6. The MOVE_S of the axes slaves is to 1 as long as the movement of interpolation is not finished.


Definition of the geometrical model

INTERPOLATE instruction makes it possible to define a geometrical model and to define the whole parameters necessary to the interpolation.

The geometrical model is taken into account at the moment of the starting of a movement.

The parameters necessary to the interpolation are contained in a structure of the tInterpolateParam type:

  1. Axes_Count: numbers of axis of the model

  2. Axes[ ]: array of the names of axis of the model

  3. Acc_Limit[ ]: array of activation of the limits of acceleration of the various axes

  4. Acc_Limit_Value[ ]: array of the values of limit of acceleration of the various axes

  5. Vel_Limit[ ]: array of activation of the speed limits of the various axes

  6. Vel_Limit_Value [ ]: array of the values of speed limit of the various axes

  7. Limit_Type [ ]: TADAPTSPEED so that the interpolation follows the most precisely possible profile speed or TADAPTTRAJ for privileged the trajectory

  8. Geo_Count: transformation numbers

  9. Geo_ReverseCount: reverse transformation numbers

  10. Geo: array of transformation of the type tGeoEntry

  11. Geo_Reverse: array of reverse transformation of tGeoEntry type

The parameters necessary to the geometrical description of the tranformations are contained in a structure tGeoEntry:

  1. Input: transformation inputs

  2. Output: transformation outputs

the inputs and outputs of the transformation can take the following values:

  • 0: NULL, no data, not used

  • 1: X

  • 2: Y

  • 3: Z

  • 4...9 = invalid (possible other special variables of entries...)

  • 11...19 = output axis from 1 to 9

  • 20...99 = invalid

  • 100...255 = internal entry allowing to connect an input to an output.

  3. Geotype: type of transformation:

  • TINVALID generate an error

  • TROTATESERIAL carry out 3 successive rotations of the reference mark

  • TROTATEPARALELL carry out 3 rotations of the reference mark compared to a fixed reference mark

  • TTRANSLATE carry out a translation of the reference mark

  • TSCALE turns over the orientation of the direction of a trajectory

  4. Param: the value to be applied to the transformation.

Transformation type:

TROTATESERIAL:

This transformation made 3 successive rotations of the reference

  • Angle y (degrees) Param[0] according to Z, y

  • Then angle q (degrees) Param[1] according to Xy, q

  • Then angle j (degrees) Param[2] according to Zq , j

TROTATEPARALLEL:

This transformation made 3 rotations on a fixed reference

  • Angle a (degrees) Param[0] according to X

  • Angle b (degrees) Param[1] according to Y

  • Angle g (degrees) Param[2] according to Z

TTRANSLATE :

This transformation made a translation of the reference

  • +Param[0] in X

  • +Param[1] in Y

  • +Param[2] in Z

TSCALE:

This transformation made scaling / dilatation / inversion of the reference

  • * Param[0] in X

  • * Param[1] in Y

  • * Param[2] in Z

TTANGENTIAL :

This transformation returns the orientation of the trajectory direction. The value returned is between -0.5 and 0.5 slave rev.

  • Input [0] : X

  • Input [1] : Y

P1 : Axis X

P2 : Axis Y

Z : Axis Z


Examples

Tangential cutting

Direct geometrical model:

Opposite geometrical model:

Program :

Axe_Interpo is a virtual axis declared in project

X and Y are axes declared in project

OutilTAN is a the axis controlling the orientation of the tool of cutting

InterpoParam.axes_count:=3; (* Déclaration des axes *)

InterpoParam.axes[1]:=X;

InterpoParam.axes[2]:=Y;

InterpoParam.axes[3]:=OutilTAN;

;

InterpoParam.geo_count:=2; (* Déclaration du modèle géométrique direct *)

InterpoParam.geo[1].Input[1]:=1; (* Axe X *)

InterpoParam.geo[1].Input[2]:=2; (* Axe Y *)

InterpoParam.geo[1].Input[3]:=0; (* aucun *)

InterpoParam.geo[1].Output[1]:=11;

InterpoParam.geo[1].Output[2]:=12;

InterpoParam.geo[1].Output[3]:=0;

InterpoParam.geo[1].Param[1]:=0.0;

InterpoParam.geo[1].Param[2]:=0.0;

InterpoParam.geo[1].GeoType:=TTRANSLATE;

InterpoParam.geo[2].Input[1]:=1; (* Axe X *)

InterpoParam.geo[2].Input[2]:=2; (* Axe Y *)

InterpoParam.geo[2].Input[3]:=0; (* aucun *)

InterpoParam.geo[2].Output[1]:=13;

InterpoParam.geo[2].Output[2]:=0;

InterpoParam.geo[2].Output[3]:=0;

InterpoParam.geo[2].GeoType:=TTANGENTIAL;

;

InterpoParam.geo_reversecount:=2; (* Déclaration du modèle géométrique inverse *)

InterpoParam.geo_reverse[1].Input[1]:=11;

InterpoParam.geo_reverse[1].Input[2]:=12;

InterpoParam.geo_reverse[1].Input[3]:=0;

InterpoParam.geo_reverse[1].Output[1]:=1;

InterpoParam.geo_reverse[1].Output[2]:=2;

InterpoParam.geo_reverse[1].Output[3]:=0;

InterpoParam.geo_reverse[1].Param[1]:=0.0;

InterpoParam.geo_reverse[1].Param[2]:=0.0;

InterpoParam.geo_reverse[1].GeoType:=TTRANSLATE;

InterpoParam.geo_reverse[2].Input[1]:=13;

InterpoParam.geo_reverse[2].Input[2]:=0;

InterpoParam.geo_reverse[2].Input[3]:=0;

InterpoParam.geo_reverse[2].Output[1]:=13;

InterpoParam.geo_reverse[2].Output[2]:=0;

InterpoParam.geo_reverse[2].Output[3]:=0;

InterpoParam.geo_reverse[2].GeoType:=TTANGENTIAL;

;

VEL (X, 1000.0) ; (* Vitesse en mode positionnement *)

VEL (Y, 1000.0) ;

ACC (X, 1500.0) ; (* Accélération et décélération *)

ACC (Y, 1500.0) ;

DEC (X, 1500.0) ; (* en mode positionnement *)

DEC (Y, 1500.0) ;

AXIS (X, 1) ;

AXIS (Y, 1) ;

AXIS (OutilTan, 1) ;

VEL (Axe_Interpo, 1000.0) ; (* Vitesse interpolée *)

ACC (Axe_Interpo, 1500.0) ; (* Accélération interpolée *)

DEC (Axe_Interpo, 1500.0) ;

INTERPOLATE(Axe_Interpo, InterpoParam);

MERGE (Axe_Interpo, 1) ; (* Mouvements enchaînés *)

;

STTA (X, 20.0) ; (* Déplacement de positionnement au 1er point *)

STTA (Y, 10.0) ;

STTA (OutilTan, 0.0) ;

WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) And (MOVE_S (OutilTan) = 0) ) ;

OUTP (Outil, 1) ; (* Activation *)

DELAY (MarcheDepose) ; (* Tempo *)

STTL2D (Axe_Interpo, 120.0, 10.0, 0) ; (* Déplacement interpolé en 130,10 *)

STTC2D (Axe_Interpo, 10.0, 10.0, 0.0, 10.0, 0, 0) ; (* Déplacement en 140,20 sens anti-horaire *)

STTL2D (Axe_Interpo, 0.0, 60.0, 0) ; (* Déplacement interpolé en 140,80 *)

STTC2D (Axe_Interpo, -20.0, 0.0, -10.0, 0.0, 0, 0) ; (* Déplacement en 120,80 sens anti-horaire *)

STTC2D (Axe_Interpo, -10.0, -10.0, -10.0, 0.0, 1, 0) ; (* Déplacement en 110,70 sens horaire *)

STTL2D (Axe_Interpo, -90.0, 0.0, 0) ; (* Déplacement interpolé en 20,70 *)

STTC2D (Axe_Interpo, -10.0, -10.0, 0.0, -10.0, 0, 0) ; (* Déplacement en 10,60 sens anti-horaire *)

STTL2D (Axe_Interpo, 0.0, -40.0, 0) ; (* Déplacement interpolé en 10,20 *)

STTC2D (Axe_Interpo, 10.0, -10.0, 10.0, 0.0, 0 ,0) ; (* Déplacement en 20,10 sens anti-horaire *)

WAIT ((MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ; (* Attente de la fin des déplacements *)

OUTP (Outil, 0) ; (* Désactivation *)

DELAY (ArretDepose) ; (* Tempo *)

;

STTA (X, 0.0) ; (* Retour origine *)

STTA (Y, 0.0) ;

WAIT ( (MOVE_S (X) = 0) And (MOVE_S (Y) = 0) ) ;


Capture

Introduction

A capture is used to record the current position of an axis following certain condition.

You can dispose of 128 capture registers. (From 0 to 127)

With the starting of the tasks, all registers are re-initialized to 0 and all captures in progress are cancelled

Restarting of the sequencer)

List of the functions

CAPTURE | Records the current position of an axis or the master position.
CAPTURECANCEL | Cancels a processing capture.
CAPTUREIMD | Records the current position of an axis or the master position.
REG_S | Indicates if a capture position was realized.
REGPOS_S | Returns the last captured position on the axis by the execution of function CAPTURE.

Example

(* Real capture position of the motor on rising edge of input 4 of MPC when the axis is between 10 and 20. *)

CAPTURE (1, Axis_X, SRC_AXIS, Mpc_4, 1, W_NONE , 10.0, 20.0) ;

WAIT (REG_S(1) = 1) ; (* Wait for a capture *)

Position:= REGPOS_S(1) ; (* Position = value of the position at the moment of capture *)

Warning

The number of simultaneous captures depends on the internal ressources.


Inputs reading

The function INP is used to read 1 input, INPB an 8 inputs block and INPW an 16 inputs block.


Outputs writing

The function OUTP is used to write 1 output, OUTB an 8 outputs block and OUTW a 16 outputs block.


Outputs reading

The function OUTP_S is used to read 1 output, OUTB_S a 8 outputs block and OUTW_S a 16 outputs block.


Events handling

It is possible to wait for a change status on an input thanks to the instruction WAIT.


State test

It is possible to test the input status thanks to the instruction IFTHENELSE END_IF

The syntax is: IF (<Condition>) THEN <Action1> ELSE <Action2> END_IF

The structure IFTHENELSE is used to test a condition at a given time. The validation of the <Condition> allows executing the <Action1>. In the contrary, the <Action2> is executed.

Example :

IF (Inp(Bouton Depart)=On) THEN (* Test de létat de lentrée *)
(* Bouton Depart *)
Out(LedMarche, ON) ; (* Action associée à Bouton Depart=On *)
RUN(Cycle) ;
ELSE
Out(LedMarche, OFF) ; (* Action associée à Bouton Depart=Off *)

HALT (T_Cycle) ;

END_IF;


Inputs reading

The function ADC is used to read an analog input.


Outputs writing

The function DAC is used to write on an analog output.


Outputs reading

En cours de développement


Passive waiting

The function DELAY is used to establish a passive waiting.

With this function, the program waits the indicated duration.


Active waiting

The instructions LOADTIMER and TIMER allow the establishment of the active waiting.

LOADTIMER allows loading the stalling.

TIMER indicates that the stalling is passed.

Warning:

These instructions use an internal timer of long entire type which represents the thousandths of seconds passed since the last powering. This timer can thus be used like time basis. It agrees in particular with the machines which are undervoltage less than 25 days. Indeed at the setting undervoltage, the timer is initialized at 0. Beyond 25 days, the variable reaches its maximum value 2^31 and passes then to 2^-31. This transition called overflow can cause in certain case some errors of temporization.


Events

In a multitasks system, the mechanisms of events are useful for the communication between the tasks.

The management of events can also provide some functions of process control. Several programs can wait or send the same event.

The Motion Studio offers two types of factual tasks to realize these mechanisms:

  • factual task system (only one per project)

  • factual task user (unlimited number)

System event task

Principle of the system event task

It has a "queue". Each event system is placed in this queue (FIFO), as long as the file is nonempty, the task event system is started (it must thus empty this file).

If the task of system error does not depilate (via GETSYSTEMEVENT ()) the system errors, either it has a WD and it starts, otherwise the task is permanently ready (and it is the only one which is running if it has priority over the others)

If this task has a watchdog and if it is over it, whatever the configuration of Watchdog is, that involves an error LZS which stops all the tasks

If the task of error does not treat the errors rather quickly, the buffer fills what involves an internal error

If there no system event tasks the system events are ignored.

List of system events:

  • 1 : Watchdog of tasks (the watchdog action must be configured in « Evénement système »)

  • 2 : Ethercat (lost of communication or no communication or initialisation error Ethercat when a RESTART(1))

  • 3 : Error LZS

  • 4 : Error Read/Write : in case of error on a READ/WRITE/PARAM/REAL

  • 5 : Error Init Task error : error at the time of the initialisation task execution

  • 6 : Error NodeGuarding slave : error activated by the nodeguarding local slave/server (the MPC has not received the package NodeGuarding of a distant master before the timeout)

  • 7 : Error CAN Hard

  • 8 : Error NodeGuarding master : error activated by the NodeGuarding of a distant node (a distant node did not answered to the request NodeGuarding of MPC)

List of functions for the management of the factual system tasks

GETLASTSYSEVENT

GETSYSTEMEVENT

Returns the last event of the stack system

Returns the first event of the stack system

Factual user task

Principle of the user event task

Standard mode

This task has an arbitrary number of events given by the user. By default, it has no events list. In this mode it is put to be ready to be executed (trigged) at each time that an event occurs (with its Nr). If an event occurs even though the task runs, it is lost. In this mode, no acknowledge is necessary.

Mode with « queue »

It is possible to add a « queue » to get the same working as a factual system task. In this mode the "queue" stores in addition a parameter allowing the differentiation between several sources of a same event (and to treat these different sources in only one task).

Several tasks can await a user event.

Several tasks can await the same user event.

Each task waits only for one event

A user event task non associated with an event list « does not know » the events received when it is complying.

A user event task associated with an event list, « keeps » the events received by it and get back automatically as long as all the events were not treated. If the task does not manage to treat all its events on standby, a system error is started.

List of functions being able to generate a user event:

SIGNAL

CAPTUREEVENT

CAMBOX

COUNTEREVENT

Generating event

Associate an event with the capture

Cam box

Associate an event with the counter

List of functions to manage the user factual tasks

GETUSEREVENTPARAM

SETTASKEVENTLIST

Gets back the parameter associated with the last event

Associates an events list


Counters

The MPC includes 64 counters 32 bits.

Each system input (MPC, IMD, CANopen ) can be mapped to a counter.

The available functions are:

COUNTER

COUNTER_S

COUNTEREVENT

COUNTERSET

STARTCOUNTER

STOPCOUNTER

Counter setup

Counter reading

Associate an event with the counter

Set the counter with a value

Start the counter

Stop the counter

Warning

- When the counter reaches its maximum value, it passes by again 0 at the next edge


Cambox

The cam box allows driving outputs TOR following angular positions:

Motion Studio accepts till 32 cam boxes with up to 32 segments and 32 outputs per box.

These cam boxes are refreshed every 300 µs

The available functions are :

CAMBOX

CAMBOX_S

CAMBOXOUT

CAMBOXSEG

SETINP

STARTCAMBOX

STOPCAMBOX

Cambox

Cambox status

Modifies a cambox output

Modifies a segment of cambox

Forces the input status

Executes a cambox

Stops a cambox

The types necessary to the declaration of camboxes are:

tSegmentDef

tOutputDef

tSegmentMode

tOutTarget

Allows segments declaration

Allows outputs declaration

Selects a mode for the segments

Selects the type of output

Example of cambox declaration:

In this example, the axis <Axe_X> is a modulo axis 360

The cambox is written as follows:

VAR

SegmentDef : tSegmentDef;

OutputDef : tOutputDef;

END_VAR

(* Déclaration des segments *)

SegmentDef.Count:=6;

(* Le segment 1 met la sortie 1 à 1 entre 20° et 60° *)

SegmentDef.Active[0]:=1;

SegmentDef.OutputNum[0]:=1;

SegmentDef.BeginPosition[0]:=20.0;

SegmentDef.EndPosition[0]:=60.0;

SegmentDef.Direction[0]:=S_ALL;

SegmentDef.Mode[0]:=SMPOSITION;

(* Le segment 2 met la sortie 2 à 1 entre 100° et 135° *)

SegmentDef.Active[1]:=1;

SegmentDef.OutputNum[1]:=2;

SegmentDef.BeginPosition[1]:=100.0;

SegmentDef.EndPosition[1]:=135.0;

SegmentDef.Direction[1]:=S_ALL;

SegmentDef.Mode[1]:=SMPOSITION;

(* Le segment 3 met la sortie 1 à 1 entre 135° et 180° *)

SegmentDef.Active[2]:=1;

SegmentDef.OutputNum[2]:=1;

SegmentDef.BeginPosition[2]:=135.0;

SegmentDef.EndPosition[2]:=180.0;

SegmentDef.Direction[2]:=S_ALL;

SegmentDef.Mode[2]:=SMPOSITION;

(* Le segment 4 met la sortie 3 à 1 entre 200° et 240° *)

SegmentDef.Active[3]:=1;

SegmentDef.OutputNum[3]:=3;

SegmentDef.BeginPosition[3]:=200.0;

SegmentDef.EndPosition[3]:=240.0;

SegmentDef.Direction[3]:=S_ALL;

SegmentDef.Mode[3]:=SMPOSITION;

(* Le segment 5 met la sortie 1 à 1 entre 200° et 240° *)

SegmentDef.Active[4]:=1;

SegmentDef.OutputNum[4]:=1;

SegmentDef.BeginPosition[4]:=200.0;

SegmentDef.EndPosition[4]:=240.0;

SegmentDef.Direction[4]:=S_ALL;

SegmentDef.Mode[4]:=SMPOSITION;

(* Le segment 6 met la sortie 3 à 1 entre 350° et 10° *)

SegmentDef.Active[5]:=1;

SegmentDef.OutputNum[5]:=3;

SegmentDef.BeginPosition[5]:=350.0;

SegmentDef.EndPosition[5]:=10.0;

SegmentDef.Direction[5]:=S_ALL;

SegmentDef.Mode[5]:=SMPOSITION;

(* Déclaration des sorties *)

OutputDef.Count:=3;

(* Assigne la sortie MPC 4 à la sortie 1 de la boite à came *)

OutputDef.Active[0]:=1;

OutputDef.Target[0]:=OM_PHYSICALOUTBIT;

OutputDef.OutBit[0]:=MPC_OUT_4;

(* Assigne la sortie MPC 3 à la sortie 2 de la boite à came *)

OutputDef.Active[1]:=1;

OutputDef.Target[1]:=OM_PHYSICALOUTBIT;

OutputDef.OutBit[1]:=MPC_OUT_3;

(* Assigne la sortie MPC 12 à la sortie 3 de la boite à came *)

OutputDef.Active[2]:=1;

OutputDef.Target[2]:=OM_PHYSICALOUTBIT;

OutputDef.OutBit[2]:=MPC_OUT_12;

(* Paramètrage de la boite à came *)

CAMBOX(1,axe_X,SRC_AXE,FILTER_NONE,SegmentDef,OutputDef);

;

STARTCAMBOX(1); (* Lancement de la boîte *)

DELAY(1000);

STOPCAMBOX(1,1); (* Arrêt de la boîte et remise à zéro des sorties activées *)


Opérations de base

Basic operations

Here are the principal language elements for the data handling:

Assignation

Access to bits of a word

Brackets

Function call

Call of functional block

Here are the principal language elements for the control of the program running:

Labels

Jumps

RETURN


Conversion de type

Function of type conversion


Opérations mathématiques

Mathematic Functions

Here are the standard operators for arithmetic calculation:

Addition

Substraction

Multiplication

Division

MOVE (assignation)

Here are the standard functions making mathematical operations:

ABS SQRT LN LOG EXP EXPT MOD | Absolute value Square root logarithm of base e logarithm of base 10 exponential of base e exponential of base 10 modulus
TRUNC FRAC NEG SGN | Entire part divisive part invert the sign number Sign number
FIXTOREAL REALTOFIX UDINTSWAP | Convert a fixed decimal number in real number Convert a real number in a fixed decimal number Words inversion

Here are the trigonometric standard functions:

SIN

COS

TAN

ASIN

ACOS

ATAN

Sine

Cosine

Tangent

arc-sine

arc-cosine

arc-tangent


Registres

Shift Functions of bits

Here are the standard functions for the handling of shift registers :

SHL

SHR

ROL

ROR

Left shift

Right shift

Left rotation

Right rotation


Opérations booléennes

Boolean functions

Here are the standard operators for the boolean operations:

AND

OR

XOR

NOT

AND boolean

OR boolean

OR exclusive

Inversion boolean (operator unaire)


Sélections

Functions of selection

MIN | minimum of two integer values
MAX | maximum of two integer values
LIMIT | Defines an integer between two limits
SEL | selection
MUX | Mux function


Opérations de comparaison

Operations of comparison

Here are the operators and standard blocks making some comparisons:

Greater

Greater or equal

Different

Equality

Lower or equal

Lower


Manipulation des chaines de caractères

Handling of the strings

LEN | Current length of a string
LEFT | extract some left characters of a string
RIGHT | extract some right characters of a string
MID | extract some characters in a string
CONCAT | concatenation of two strings
INSERT | insert characters in a string
DELETE | delete characters in a string
REPLACE | replace characters in a string
FIND | find characters in a string


Bistable

RS

SR

Bistable with priority RESET

Bistable with priority SET


Détection de front

Detection of edge

R_TRIG

F_TRIG

Detection of rising edge

Detection of falling edge


Compteurs

Counter

CTU

CTD

CTUD

Counter

Down counter

Counter/Down counter


Temporisateurs

Time switch

TON

TOF

TP

Time switch at the engaging

Time switch at the starting

Impulse time switch


A

Gestion of the tasks

CONTINUET

GETLASTSYSEVENT

GETSYSTEMEVENT

HALT

INIT_S

INITGETCONTEXT

INITSETRESULT

NEXTTASK

RUN

SIGNAL

STATUS_S

SUSPEND

Continue the task execution

Returns the last event of the system pile

Returns the first event of the system pile

Stops a task

Returns the state of the initialization task

Returns the context of the initialization task

Forces the return value of the initialization task

Bistable immediately to the next task

Launches a task

Event generation

Task state

Suspend a task


Contrôle de l'axe

Axis control

ACC

ACC_T

ACCP

AXIS

AXIS_S

AXISREQUEST_S

BUFMOV_S

CLEAR

CLEARAUX

CLEARAXISFAULT

CURRENT

CURRENT_S

DEC

DEC_T

DECP

FE_S

FEMAX_S

GETMODE

HOME

HOME_S

HOMEAUX

HOMEAUX_S

HOMEAUXCANCEL

HOMEAUXREQUEST_S

HOMECANCEL

HOMEREQUEST_S

MERGE

MOVE_S

ORDER

ORDER_S

ORDER_T

POS

POS_S

POS_T

POSAUX_S

POSERROR_S

SETMODE

SPEED

SPEED_S

STTH

STTHAUX

TORQUE

TORQUE_S

VEL

VEL_T

VEL_S

VELAUX_S

VELP

Acceleration

Returns the ACC value

Acceleration in percent

Axis loop control

Reads axis loop state

Axis loop state

Number of movements in the buffer

Resets the axis position

Resets the auxiliary position

Deletes the axis defaults.

Force the current consign

Return the actual current

Deceleration

Returns the DEC value

Deceleration in percent

Value of continuation error

Limit of continuation error

Change axis operating mode

Home

Home state

Home on the auxiliary coder

Home state on the auxiliary

Cancel the origin plug on the auxiliary

State of Home auxiliary request

Define the sequence

Cancel the origin plug on the auxiliary

Movement merging

Movement state

Current order number

Order number of the last movement

Position to reach

Modify the position to reach

Real position

Returns the position to reach

Auxiliary position

Indicates a movement error

Return axis operating mode

Force the speed consign

Return the actual speed

Non blocking home

Non blocking home on the auxiliary

Force the torque consign

Return the actual torque

Velocity

Returns the VEL value

Velocity

Velocity of the auxiliary coder

Velocity in percent


Positionnement

Positioning

MOVA

MOVR

SSTOP

STOP

STTA

STTIM

STTIP

STTR

TRAJA

TRAJIM

TRAJIP

TRAJR

Absolute movement

Relative movement

Axis stop without wait

Axis stop

Launches an absolute movement

Launches an infinite movement in negative direction

Launches an infinite movement in positive direction

Launches a relative movement

Absolute trajectory

Launch an infinite movement in negative direction

Launch an infinite movement in positive direction

Relative trajectory


Mouvements déclenchés

Triggered movements

TRIGGERAXIS_S

TRIGGERAXISSET

TRIGGERF

TRIGGERI

TRIGGERP

Returns the state of trigger axis

Forces a trigger on a movement to get on immediately

The next movement will be triggered on a window

The next movement will be triggered on the state change of an input

The next movement will be triggered on master position.


Synchronisation

Synchronization

BREAKCAM

BREAKCAM_POS

CAM_S

CAMNUM_S

CAMREADPOINT

CAMSEG_S

ENDCAM

FILTERMASTER

GEARBOX

GEARBOXRATIO

GEARBOXRATIO_S

ICORRECTION

ICORRECTION_S

ICORRECTIONA

LOADCAM

LOADCAMI

LOADCAMPOINT

MASTEROFFSET

MASTEROFFSET_S

MOVS

READCAM

SLAVEOFFSET

SLAVEOFFSET_S

STARTCAM

STOPS

STOPS_S

WRITECAM

Stops the running cam

Returns the master or slave position at the last breakcam

State of the cam

Number of the running cam

Returns the slave position

Equation number of the running cam

Stops the cam at its end

Applies a filter at the moment of synchronous movement

Gearbox

Modify the gearbox ratio

Returns the gearbox ratio

Function of the compensation

State of the compensation

Function of the compensation

Load a cam from CF-CARD

Load a cam from memory

Modification of cam points

Master Offset on an absolute cam

Current value of the offset

Synchronized movement

Read a cam

Slave Offset on an absolute cam

Current value of the shift

Launches the execution of a cam

Allows stopping a running synchronization

State of the synchronized movement

Writes a cam


Capture

CAPTURE

CAPTURECANCEL

CAPTUREIMD

CAPTUREEVENT

REG_S

REGPOS_S

Launches a capture position

Cancels a capture

Launches a capture position on a drive IMD

Associate an event to capture

State of a captye

Captured position


Interpolation

INTERPOLATE | Starts an interpolation
INTERPOLATE2D | Starts an interpolation 2D
INTERPOLATE3D | Starts an interpolation 3D
STTL2D | Starts a linear movement 2D
STTL3D | Starts a linear movement 3D
TRAJL2D | Starts a linear trajectory 2D
TRAJL3D | Starts a linear trajectory 3D
STTC2D | Starts a circular movement 2D
STTC3D | Starts a circular movement 3D
TRAJC2D | Starts a circular trajectory 2D
TRAJC3D | Starts a circular trajectory3D
STTH3D | Starts an helical movement
TRAJH3D | Starts an helical trajectory


Automate

PLC

Logic inputs/outputs

INP

INPB

INPW

OUTP

OUTP_S

OUTB

OUTB_S

OUTW

OUTW_S

Reading of an input TOR

8 inputs block reading

16 inputs block reading

Writing of an output

Lecture d'une sortie TOR

8 outputs block writing

8 outputs block reading

16 outputs block writing

16 outputs block reading

Analogue inputs/outputs

ADC

DAC

Analogue inputs

Analogue outputs

Temporizings

DELAY

WAIT

Passive waiting

Condition waiting

Events

GETLASTSYSEVENT

GETSYSTEMEVENT

GETUSEREVENTPARAM

SETTASKEVENTLIST

SIGNAL

Returns the last event of the pile systemRetourne le Returns the first event of the pile system

Return the parameter of the last associated event

Associate a user event list to a task

Event generation

Counters

COUNTER

COUNTER_S

COUNTEREVENT

COUNTERSET

STARTCOUNTER

STOPCOUNTER

Setup counter

Returns the counter current value

Associate an event to counter

Force a counter to a given value

Starts a counter

Stops a counter

Cambox

CAMBOX

CAMBOX_S

CAMBOXOUT

CAMBOXSEG

SETINP

STARTCAMBOX

STOPCAMBOX

Define a cambox

Cambox state

Cambox output

Cambox segment

Forces the state of an internal MPC input

Starts a cambox

Stops a cambox.


Mots clefs de déclaration

Declaration keywords

TYPE

END_TYPE

VAR_EXTERNAL

VAR_GLOBAL

VAR

VAR_IN

VAR_IN_OUT

VAR_OUTPUT

END_VAR


Instructions du langage IL

Instructions of language IL

Programming Instructions:

Brackets

CAL Instance name

CALC Instance name

CALCN Instance name

JMP Label

JMPC Label

JMPCN Label

RET

RETC

RETCN

Instructions and bolean operations :

NOT

AND

ANDN

OR

ORN

XOR

XORN

S BOOL

R BOOL

Mathematic operations:

ADD

SUB

MUL

DIV

Instructions of CR register:

LD ANY

LDN ANY_BIT

ST ANY

STN ANY_BIT

Logical operators:

GT

GE

EQ

NE

LE

LT


Instructions du langage ST

Instructions of language ST

CASE

OF

END_CASE

Select an instructions group

IF

THEN

ELSE

ELSEIF

END_IF

Conditional execution of instructions

FOR

TO

BY

DO

END_FOR

Instructions criteria

REPEAT

UNTIL

END_REPEAT

Repeat instructions till the condition is TRUE

WHILE

END_WHILE

Repeat instructions as long as the condition is TRUE

EXIT

Exit an iterative loop


Flash, Sécurité, Divers

Flash, Security, Others

Display

DISPLAY

7 segments display

Security

WATCHDOGOFF | Opens watchdog
WATCHDOGON | Closes watchdog
WATCHDOG_S | Returns the watchdog status
WDTASKRAZ | Resets the number of starting of a task
WDTASK_S | Returns the number of starting of a WD task

Clock

LOADTIMER TIMEH | Load a TIMER Time passed since the MPC starting
TIMEL TIMER | Time passed since the MPC starting Return if TIMER is ended

Parameters

READ | Reading of the CANOpen table of a peripheral
READPARAM | Reading of the CANOpen table of a peripheral
READPARAMR | Reading of the CANOpen table of a peripheral
READR | Reading of the CANOpen table of a peripheral
SECURITY WRITE | Define security actions Writing in the CANOpen table of a peripheral
WRITEPARAM | Writing in the CANOpen table of a peripheral
WRITEPARAMR | Writing in the CANOpen table of a peripheral
WRITER | Writing in the CANOpen table of a peripheral

System

BATERY_S CLEARFLASH FLASHOK_S IOFAULT_S RAMTOFLASH RESTART | State of the BBM safeguard pile Erases the content of the MPC FLASH State of the last FLASH memory copy Indicates if the inputs/outputs are in overloads Copies contained BBM memoryin the FLASH memory Restart system
RESTART_S | Returns the reason of the last restart
VERSION | Operating System Version


Accès aux bits d'un mot

Access to the bits of a word

You can directly specify a bit of an entire variable in the expressions and diagrams using the following syntax:

Variable.BitNo

Or:

Variable: is the name of a variable of type ANY_BIT
BitNo: constant showing the bit number of the variable

The variable can have one of the following types:

BYTE (8 bits from .0 to .7)
WORD (16 bits from .0 to .15)
DWORD (32 bits from .0 to 31)

0 always represents the bit de poids le plus faible.

To be able to access to a bit of a variable ANY_BIT via a variable, you must use one of the following functions:

SETBITB | Modify a bit of a variable BYTE
SETBITW | Modify a bit of a variable WORD
SETBITD | Modify a bit of a variable DWORD
GETBITB | Returns a bit of a variable BYTE
GETBITW | Returns a bit of a variable WORD
GETBITD | Returns a bit of a variable DWORD

Example ST

VAR
 a: BYTE;
 b: DWORD;
 c: DWORD;
 j: USINT;
END_VAR

If a.1=1 Then (* Make a test on the 1st bit of a *)
 For j:=1 To 8 Do
SETBITD(c, j, GETBITD (b, j)); (* Copy the 8 first bits of b->c *)
 End_For;
End_If;


Assignation

Assignment of variable

Syntax

<Variable> := <Expression>

Accepted types

<Variable> : ANY
<Expression> : ANY

Description

The forced variable and the expression must be of the same type.
In IL, the instruction LD is used to load the value in the current result, and the instruction ST forces the variable.
The current result and the instruction operand ST must be of the same type.
Instructions LD and ST can be modified by suffix "N" to indicate an inversion in the case of a Boolean operand.

Remarks

:= is a keyword reserved to ST language, it is defined by the norm IEC61131-3.

Example ST

VAR
 a: INT;
 b: ARRAY [0..5] OF INT;
 c: REAL;
 e: INT;
END_VAR

a := 5; (* assign 5 at a *)
b[1]:= a*2; e := a; (* double assignations *)
e:= REAL_TO_INT( c ); (* assignment with a call function *)

Example IL

VAR
IN: BOOL;
IN1: BOOL;
IN2: BOOL;
Q: BOOL;
END_VAR

Op1: LD IN (* current result: IN *)
 ST Q (* Q = IN *)
 LDN IN1 (* current result: NOT (IN1) *)
 ST Q (* Q = NOT (IN1) *)
 LD IN2 (* current result: IN2 *)
 STN Q (* Q = NOT (IN2) *)

See also

Brackets


Parenthèses

Brackets

Syntax

( )

Description

The bracket allows to force the order of evaluation of a complex expression.
The brackets are used in ST and in IL to change the default order at the time of the evaluation of the elements of a complex expression.
For example, the default order for the expression evaluation "2 * 3 + 4" en ST gives a result of 10 as the operator "*" has priority.
To change the order with brackets for "2 * ( 3 + 4 )" gives a result of 14.
The brackets can be overlapped in an expression.

Remarks

Here is the priority range applied by default for the language ST operators (The first one has the most important priority):
Operators unaires: - NOT
Multiplication/Division: * /
Addition/Soustraction: + -
Comparisons: < > <= >= = <>
ET boolean: & AND
OU boolean: OR
OU exclusive: XOR

In IL, the default order is given by the instructions order in the sequence. Each new instruction modifies the current result. In IL, an open bracket"(" must be written between an instruction and its operand. The close bracket ")" is written alone on a line without operand.

Example ST

VAR
IN1: INT;
IN2: INT;
IN3: INT;
IN4: INT;
Q: INT;
END_VAR

Q := (IN1 + (IN2 / IN 3)) * IN4;

Example IL

VAR
IN1: INT;
IN2: INT;
IN3: INT;
IN4: INT;
Q: INT;
END_VAR

Op1: LD IN1
 ADD( IN2
 MUL IN3
 )
SUB IN4
 ST Q (* Q = IN1 + (IN2 * IN3) - IN4 *)

See also

Assignation


Etiquettes

Labels  Destination of a jump instruction

The labels are the destinations of the jump instructions in FDB, LD or IT . The jumps and the labels are not available in ST. A label is represented by a single name followed by two points (":").In LD et FBD, a label identifies a ladder and is registered above the left power bar. In IL, the labels are the destinations of instructions JMP, JMPC, JMPCN. They must be registered at the beginning of line, before an instruction, and must come before a valid instruction: LD (loading), unconditional instructions such as CAL, JMP or RET.

The label can also be inserted only on a line, before a valid instruction. In all languages, it is not obligatory that a label be the destination of a jump. The labels can also be used like reference marks in the programs to increase legibility of it.

Example ST

Not available

Example FBD

(* In this example, the second ladder is not evaluated if IN1 = TRUE *)

Example LD

(* In this example, the second ladder is not evaluated if IN1 = TRUE *)

Example IL

VAR
IN1: BOOL;
IN2: BOOL;
IN3: BOOL;
Q2: BOOL;
Q3: BOOL;
END_VAR

Start: LD IN1 (* unused label *)
JMPC TheRest (* Jump to "TheRest" if IN1 = TRUE *)
LD IN2 (* These instructions are not executed *)
ST Q2 (* if IN1 = TRUE *)

TheRest: LD IN3 (* jump destination *)
ST Q3

See also

Jumps

RETURN


Sauts

Jumps

A jump to a label reroutes the program execution to the specified label. Both jumps and labels are not available in ST. In FBD, a jump is represented by a block operator JMPC containing the name of the destination label. The input flow of the block must be connected to a Boolean variable which governs the connection. The jump is executed only if the input flow is TRUE. In LD, operator JMP or JMPN, followed by the name of a label, finishes a ladder. The jump is executed if the flow is TRUE for a JMP and FALSE for a JMPN. In IT, the instructions JMP, JMPCand JMPCN indicate jump operations. The jump destination is the instruction operand.

Warning: The back jumps can create infinite loops and block the cycle.

Example ST

Not available.

Example FBD

(* In that example, the second ladder is not evaluated if IN1 = TRUE *)

Example LD

(* In that example, the second ladder is not evaluated if IN1 = TRUE *)

Example IL

The following instructions are available:
JMP unconditional connection
JMPC Connection if current result = TRUE
JMPCN same as JMPNC

VAR
IN1: BOOL;
IN2: BOOL;
IN3: BOOL;
Q2: BOOL;
Q3: BOOL;
END_VAR

Start: LD IN1 (* unused label *)
JMPC TheRest (* Jump to "TheRest" if IN1 = TRUE *)
LD IN2 (* These instructions are not executed *)
ST Q2 (* if IN1 = TRUE *)

TheRest: LD IN3 (* jump destination *)
ST Q3

See also

Labels

RETURN


Addition

Syntax

<Q> := <IN1> + <IN2>

Accepted type

<IN1> : ANY_NUM or TIME
<IN2> : ANY_NUM or TIME
<Q>: ANY_NUM or TIME

Description

This operator adds two numerical expressions and returns a value of the same type as the operands. < IN1> and < IN2> must be valid expressions and must be of the same type.

Remarks

In language LD and FBD, several functions ADD are available according to the data type.
In language IL, the input value must be charged in the current result before calling the function.
See the Table E.1: The error conditions for a result with excess.

Example ST

VAR
IN1: INT;
IN2: INT;
Q: INT;
END_VAR

Q := IN1 + IN2;

Exemple FBD

(* The block can have 16 inputs *)

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN1: INT;
IN2: INT;
IN3: INT;
Q: INT;
END_VAR

Op1: LD IN1
 ADD IN2
 ST Q (* Q = IN1 + IN2 *)
Op2: LD IN1
ADD IN2
ADD IN3
ST Q (* Q = IN1 + IN2 + IN3 *)

See also

Substraction

Multiplication

Division


Soustraction

Substraction

Syntax

<Q> := <IN1> - <IN2>

Accepted types

<IN1> : ANY_NUM or TIME
<IN2> : ANY_NUM or TIME
<Q>: ANY_NUM or TIME

Description

This operator subtracts the expression <IN2> from the expression <IN1> and returns a value of the same type as these operands.
< IN1> and < IN2> must be valid expressions and must be of the same type.

Remarks

In language LD and FBD, several functions SUB are available according to the data type.
In language IL, the input value must be charged in the current result before calling the function.
See the Table E.1: Conditions error for a result with excess.

Example ST

VAR
IN1: INT;
IN2: INT;
Q: INT;
END_VAR

Q := IN1 - IN2;

Example FBD

(* the block can have till 16 inputs *)

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN1: INT;
IN2: INT;
IN3: INT;
Q: INT;
END_VAR

Op1: LD IN1
 SUB IN2
 ST Q (* Q = IN1 + IN2 *)

Op2: LD IN1
SUB IN2
SUB IN3
ST Q (* Q = IN1 + IN2 + IN3 *)

See also

Addition

Multiplication

Division


Multiplication

Syntax

<Q> := <IN1> * <IN2>

Accepted type

<IN1> : ANY_NUM or TIME
<IN2> : ANY_NUM
<Q>: ANY_NUM or TIME

Description

This operator multiplies two numerical expressions and returns a value of the same type as the operands.
< IN1> and < IN2> must be valid expressions and must be of the same type.

Remarks

In language LD and FBD, several functions MUL are available according to the data type.
In language IL, the input value must be charged in the current result before calling the function.
See the Table E.1: Conditions error for a result with excess.

Example ST

VAR
IN1: INT;
IN2: INT;
Q: INT;
END_VAR

Q := IN1 * IN2;

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN1: INT;
IN2: INT;
IN3: INT;
Q: INT;
END_VAR

Op1: LD IN1
MUL IN2
ST Q (* Q = IN1 * IN2 *)

Op2: LD IN1
MUL IN2
MUL IN3
ST Q (* Q = IN1 * IN2 * IN3 *)

See also

Addition

Substraction

Division


Division

Syntax

<Q> := <IN1> / <IN2>

Accepted types

<IN1> : ANY_NUM or TIME
<IN2> : ANY_NUM
<Q>: ANY_NUM or TIME

Description

This operator divides two numeric expressions and returns a value of the same type as these operands.
< IN1> et < IN2> must be valid expressions and of the same type.

Remarks

In language LD and FBD, several functions DIV are available depending on the data type.
In language IL, the input value must be charged in the current result before the call of the function.
See the E.1: The error conditions for a result with overflowing.

Example ST

VAR
IN1: INT;
IN2: INT;
Q: INT;
END_VAR

Q := IN1 / IN2;

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN1: INT;
IN2: INT;
IN3: INT;
Q: INT;
END_VAR

Op1: LD IN1
DIV IN2
ST Q (* Q = IN1 / IN2 *)

Op2: LD IN1
DIV IN2
DIV IN3
ST Q (* Q = IN1 / IN2 / IN3 *)

See also

Addition

Substraction

Multiplication


Négation

Negation

Syntax

<Q> := - <IN>

Accepted type

<IN1> : ANY_NUM
<Q>: ANY_NUM

Description

This operator returns the operand negation.

Remarks

In language IL, the input value must be charged in the current result before calling the function.

Example ST

VAR
IN: INT;
Q: INT;
END_VAR

Q := - IN;


Inférieur

Lower

Syntax

<Q> := <EN1> LT <EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

Allows comparing the register content with the operand content, if the register content is inferior to the operand one, the result is TRUE. If the register content is greater or equal to the operand one, the result is FALSE.

Remarks

Both inputs must be of the same type.

In LD, the input flow (EN) governs the operation, and the output flow is the comparison result.
In IL, the instruction LE compares the current result with the operand.
Both operand and current result must be of same type.
The comparison can be used for characters strings.
In that case, the system makes a lexicographical comparison of the strings.
For example, "ABC" is smaller than "ZX" ; "ABCD" is greater than "ABC".

Example ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q := IN1 < IN2;

Language FBD

Language LD

(* The comparison is executed if EN = TRUE *)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
 LT IN2
 ST Q

See also

Lower or equal

Equality

Different

Greater or equal

Greater


Inférieur ou égal

Lower or equal

Syntax

<Q> := <EN1> LE <EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

Allows comparing the register content with the operand content, if the register content is inferior or equal to the operand one, the result is TRUE. If the register content is greater than the operand one, the result is FALSE.

Remarks

Both inputs must be of the same type.
In LD, the input flow (EN) governs the operation, and the output flow is the comparison result.
In IL, the instruction LE compares the current result with the operand.
Both operand and current result must be of same type.
The comparison can be used for characters strings.
In that case, the system makes a lexicographical comparison of the strings.
For example, "ABC" is smaller than "ZX" ; "ABCD" is greater than "ABC".

Example ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q := IN1 <= IN2;

Language FBD

Language LD

(* The comparison is executed if EN = TRUE *)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
LE IN2
ST Q

See also

Lower

Equality

Different

Greater or equal

Greater


Egalité

Equality

Syntax

<Q> := <EN1>EQ<EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

It makes possible to compare the content of the register with the content of the operand. If the content of the register is equal to the operand content, the result is TRUE. If the content of the register is not equal to the operand content, the result is FALSE.

Remarks

Both inputs must be the same type.
In LD, the input flow (EN) determines the operation, and the output flow is the result of the comparison.
In IL, the instruction EQ compares the current result and the operand.
The operand and the current result must be the same type.
The comparison can be used for characters chains.
In that case the system makes a lexicographic comparison of the chains.
For example, "ABC" is smaller than "ZX" ; "ABCD" is greater than "ABC".

The tests of equality cannot be used with TIME inputs. Indeed, an active temporization grows with the resolution of time cycle and certain values can never appear.

Language ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q :=IN1=IN2 ;

Language FBD

Language LD

(*The comparison is executed if EN=TRUE*)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
 EQ IN2
 ST Q

See also

Lower

Lower or equal

Different

Greater or equal

Greater


Différent

Different

Syntax

<Q> := <EN1> NE <EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

It allows comparison between the register content and the operand content. If the register content is different from the operand one, the result is TRUE. If the register content is equal to the operand content, the result is FALSE.

Remarks

Both inputs must be of the same type.
In LD, the input flow (EN) governs the operation and the output flow is the result of the comparison.
In IL, the instruction EQ compares the current result and the operand.
Both operand and current result must be of the same type.
The comparison can be used for characters strings.
In that case, the system makes a lexicographic comparison of strings.
For example, « ABC » is smaller than « ZX » ; « ABCD » is greater than « ABC ».
The equality tests cannot be used with inputs of TIME type. Indeed, an active temporization grows with the resolution of time cycle and certain values can never appear.

Language ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q :=IN1<> IN2 ;

Language FBD

Language LD

(*The comparison is executed if EN=TRUE*)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
 NE IN2
 ST Q

See also

Lower

Lower or equal

Equality

Greater or equal

Greater


Supérieur ou égal

Greater or equal

Syntax

<Q> := <EN1> EQ <EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

It makes possible to compare the content of the register with the content of the operand. If the content of the register is greater or equal to the operand content, the result is TRUE. If the content of the register is lower to the operand content, the result is FALSE.

Remarks

Both inputs must be the same type.
In LD, the input flow (EN) determines the operation, and the output flow is the result of the comparison.
In IL, the instruction EQ compares the current result and the operand.
The operand and the current result must be the same type.
The comparison can be used for characters chains.
In that case the system makes a lexicographic comparison of the chains.
For example, "ABC" is smaller than "ZX" ; "ABCD" is greater than "ABC".

Example ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q := IN1 >= IN2;

Language FBD

Language LD

(* the comparison is executed if EN = TRUE *)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
 EQ IN2
 ST Q

See also

Lower

Lower or equal

Equality

Different

Greater


Supérieur

Greater

Syntax

<Q> := <EN1> GT <EN2>

Accepted types

<IN1> : ANY
<IN2> : ANY
<Q> : BOOL

Description

It makes possible to compare the content of the register with the content of the operand. If the content of the register is greater to the operand content, the result is TRUE. If the content of the register is lower or equal to the operand content, the result is FALSE.

Remarks

Both inputs must be the same type.
In LD, the input flow (EN) determines the operation, and the output flow is the result of the comparison.
In IL, the instruction EQ compares the current result and the operand.
The operand and the current result must be the same type.
The comparison can be used for characters chains.
In that case the system makes a lexicographic comparison of the chains.
For example, "ABC" is smaller than "ZX" ; "ABCD" is greater than "ABC".

Example ST

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Q := IN1 > IN2;

Language FBD

Language LD

(* The comparison is executed if EN = TRUE *)

Language IL

VAR
IN1: INT;
IN2: INT;
Q: BOOL;
END_VAR

Op1: LD IN1
 GT IN2
 ST Q

See also

Lower

Lower ou equal

Eguality

Different

Greater or equal


ABS

ABS  Calculate the absolute value

Syntax

<Q> := ABS (<IN>)

Accepted types

<IN> : ANY_NUM
<Q>: ANY_NUM

Description

This function provides the absolute value of <IN>. A negative number is then converted in a positive number.
<IN> must be a valid numerical expression. The absolute value of a number is its no-signed value.

Remarks

In language LD and FBD, several ABS functions are available according to the type of data.
In language IL, the input value must be charged in the current result before the calling of the function.

Example ST

VAR
     IN: INT;
     Q: INT;
END_VAR

Q := ABS (IN);

Example FBD

Example LD

(* The function is executed if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
     IN: INT;
     Q: INT;
END_VAR

Op1: LD  IN
     ABS
     ST  Q

See also

TRUNC

LOG

SQRT

EXP


ACC

ACC  Acceleration

Syntax

ACC(<Axis>, <Expression>)

Unit

<Expression> user unit per s² (Ex : mm/s², degree/s², tr/s²)

Limit

<Expression> must be higher or equal to à 0

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This instruction modifies the current acceleration value.
<Expression> contains the value to apply.

Remark

The current acceleration can be modified at any time.

Example ST

VAR
Acceleration : REAL;
END_VAR

ACC(Axis_X, 500.0); (* Acceleration of 500 units/s² *)

See also

DEC

VEL

ACC_T

ACCP


ACC_T

ACC_T  Acceleration

Syntax

<Variable> := ACC_T(<Axis>)

Unit

<Variable> user unit per s² (Ex : mm/s², degree/s², tr/s²)

Limit

<Variable> is greater or equal to 0

Accepted types

<Axis> : tPeripheral
<Variable> : REAL

Description

This instruction returns current acceleration.

< Expression > contains the value turned over by the function

Remark

The current acceleration can be read at any time.

Example ST

VAR
SpeedX : REAL;
END_VAR

ACC(Axis_X, 500.0); (* Acceleration of 500 units/s² *)
SpeedX := ACC_T(Axis_X); (* SpeedX = 500 *)

See also

DEC_T

VEL_T

ACC

ACCP


ACCP

ACCP  Acceleration in percent

Syntax

ACCP(<Axis>,<Expression>)

Limit

<Expression> 0 to 100

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function sets current acceleration in percent of default acceleration parameter defined in the profile of the axis.
<Expression> contains the percent to apply.

Remarks

The value of acceleration can be set in the screen "Speed Profile" during the board configuration Motion of the axis and can modify a task.

Example ST

VAR
Acceleration : REAL;
END_VAR

ACCP (Axis_X, 10.0) ; (* 10% of the acceleration defined in the speed profile *)

See also

DECP

VELP

ACC

ACC_T


ACOS

ACOS  inverse Cosinus

Syntax

<Q> := ACOS (<IN>)

Accepted types

<IN> : REAL
<Q>: REAL

Description

This function restores the arccosines of <IN>. This function restores an angle expressed in radian.
<IN> must be a valid numerical expression.

Remarques

In language LD, the inverse Cosines function is called: ACOS_REAL
In language FBS, the inverse Cosines function is called: ACOS_REAL_FBD
In language IL, the input (IN) must be charged in the current result before calling the function.

Example ST

VAR
IN: REAL;
Q: REAL;
END_VAR

Q := ACOS (IN);

Example FBD

Example LD

(* The function is only executed if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN: REAL;
Q: REAL;
END_VAR

Op1: LD IN
ACOS
ST Q

See also

ASIN

ATAN

COS

SIN

TAN


ADC

ADC  analogue inputs IMD

Syntax

<Variable> := ADC (<Axis>, <Input>)

Unit

<Variable> in Volt

Limit

<Variable> reading value, after application of the scale and the offsets associated to the ANA entry.

Accepted types

<Axis> : tPeripheral
<Input> : UINT
<Variable> : REAL

Description

This function returns the voltage of an analogue input +/- 10 V.
<Axis> name of the axis
<Input> must represent the number of an analogue input:

  • 1 corresponds to the drive CONSIGNS entry (ANA1)

  • 2 corresponds to the drive LIMITING entry (ANA2)

<Variable> contains the value returned by the function.

Example ST

VAR
Temperature : REAL;
END_VAR

Temperature:= ADC (Axis_X, 1); (* Temperature is equal to the voltage on input ANA1 of the drive Axis_X *)

See also

DAC


ADD

ADD  Addition (language IL)

See Addition


AND

Syntax

<Q> := <IN1> AND <IN2>

Accepted types

<IN1> : ANY_BIT
<IN2> : ANY_BIT
<Q> : ANY_BIT

Description

This function performs a binary AND between two expressions and returns a value of the same type as the operand.
<IN1> and <IN2> must be of the same type.

Remark

AND is defined by the norm IEC61131-3.

Example ST

VAR
IN1 : BOOL;
IN2 : BOOL;
IN3 : BOOL;
Q : BOOL;
END_VAR

Q:= IN1 AND IN2;
Q:= IN1 & IN2 & IN3;

Example FBD

Example LD

(* contacts in serie *)

Example IL

VAR
IN1 : BOOL;
IN2 : BOOL;
IN3 : BOOL;
Q : BOOL;
END_VAR

Op1: LD IN1
 & IN2 (* "&" et "AND" are equals *)
ST Q (* Q = IN1 AND IN2 *)

Op2: LD IN1
 AND IN2
 &N IN3 (* "&N" et "ANDN" are equals *)
ST Q (* Q = IN1 AND IN2 AND (NOT IN3) *)

See also

OR

XOR

NOT


ANDN

ANDN  Operator AND with the inverted input 2

See AND with the inverted input 2


ASIN

ASIN Inverse sine

Syntax

<Q> := ASIN (<IN>)

Accepted types

<IN> : REAL
<Q>: REAL

Description

This function restores the arcsine of <IN>. This function restores an angle expressed in radiant.
<IN> must be a valid numerical expression.

Remarks

In language LD, the inverse Sine function is called: ASIN_REAL
In language FBS, the inverse Sine function is called: ASIN_REAL_FBD
In language IL, the input (IN) must be charged in the current result before calling of the function.

Example ST

VAR
IN: REAL;
Q: REAL;
END_VAR

Q := ASIN (IN);

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN: REAL;
Q: REAL;
END_VAR

Op1: LD IN
ASIN
ST Q

See also

ACOS

ATAN

COS

SIN

TAN


ATAN

ATAN  Inverse tangent

Syntax

<Q> := ATAN (<IN>)

Accepted types

<IN> : REAL
<Q>: REAL

Description

This function restores the arctangent of <IN>. This function restores an angle expressed in radiant.
<IN> must be a valid numerical expression.

Remarks

In language LD, the function inverse tangent is called: ATAN_REAL
In language FBS, the function inverse tangent is called: ATAN_REAL_FBD
In language IL, the input (IN) must be charged in the current result before calling of the function.

Example ST

VAR
IN: REAL;
Q: REAL;
END_VAR

Q := ATAN (IN);

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

VAR
IN: REAL;
Q: REAL;
END_VAR

Op1: LD IN
ATAN
ST Q

See also

ACOS

ASIN

COS

SIN

TAN


AXIS

AXIS  Axis loop control

Syntax

AXIS (<Axis>, <Instruction>)

Accepted types

<Axis> : tPeripheral
<Instruction> : UINT

Description

This function is used to open and close the axis loop.

When the axis loop is closed (AXIS=ON), all the instructions of movement are transmitted to the axis by the intermediary of the buffer of movement and are carried out. If the axis passes in open loop (AXIS=OFF), the buffer of movement is emptied, instructions MOVE_S and FE_S return to value 0.
<Axis>: Name of axis
<Instruction> 1 or ON to ask for a control loop and 0 or OFF to ask for an axis disables.

Remarks

Ä The Axis function carries out a request for control loop. The processing time depends on the axis (real, simulation, virtual) and on its parameters.

Ä Any function of movement sent to an axis which is in open loop will be consumed by the axis but will not be really run.

Example ST

VAR
FlagDefaut : BOOL;
END_VAR

(* COMPLETE TEST *)
AXIS (Axis_X, 1); (* Control loop request *)
WAIT (AXISREQUEST_S (Axis_X) =0); (* Waiting for the end of control loop request*)
If (AXIS_S (Axe_X) =0) Then (* Control test *)
FlagDefaut := 1;
Else
FlagDefaut := 0;
End_If;

(*BLOCKING IF DEFECT DURING CONTROL *)
AXIS (Axis_X, 1) ; (* Control loop request *)
WAIT (AXIS_S (Axis_X) =1); (* Waiting for control axis loop *)

(* NO CHECKING OF CONTROL *)

AXIS (Axis_X, 1) ; (* Control request *)
Delay (10) ;
MOVA (Axis_X, 100.0);

See also

AXIS_S

AXISREQUEST_S

SECURITY


AXIS_S

AXIS_S  read the state of the control loop

Syntax

<Axisstate> := AXIS_S(<Axis>)

Accepted types

<Axis> : tPeripheral
<Axisstate> : BOOL

Description

This instruction is used to read the state of the control loop and returns a value 1 or 0.
<Axis> : Name of axis

Remark

This function can be used at any time to see if the axis loop is enable.

Example ST

VAR
FlagDefaut : BOOL;
END_VAR

(* TEST COMPLET *)
AXIS (Axis_X, 1) ; (* Request for control *)
WAIT (AXISREQUEST_S (Axis_X) =0); (* Wait for the end of the request control*)
If (AXIS_S (Axis_X) =0) (* Test of control *)
FlagDefaut := 1;
Else
FlagDefaut := 0;
End_If;

See also

AXIS

AXISREQUEST_S

SECURITY


AXIS_REQUEST_S

AXISREQUEST_S  reads axis loop state

Syntax

<StateRequestAxis> := AXISREQUEST_S(<Axe>)

Accepted types

<Axis> : tPeripheral
< StateRequestAxis > : BOOL

Description

This instruction is used to read the state of the control loop and returns a value 1 or 0.
<Axis> : Name of the axis

Remarks

This function can be used at any time to see if the AXIS loop is on hand.

Example ST

VAR
FlagDefaut : BOOL;
END_VAR

(* COMPLETE TEST *)
AXIS (Axe_X, 1) ; (*Control loop request *)
WAIT (AXISREQUEST_S (Axis_X) =0); (*Waiting for control axis loop *)
If (AXIS_S (Axis_X) =0) (* Test of control axis loop *)
FlagDefaut := 1;
Else
FlagDefaut := 0;
End_If;

See also

AXIS

AXIS_S

SECURITY


BATERY_S

Syntax

<Q> ::= BATERY_S (0)

Accepted types

<Q> : BOOL

Description

This function indicates the state of the BBM safeguard pile of the MPC: to 1 indicates that the pile of safeguard is OK.

See also

RAMTOFLASH

CLEARFLASH


BOOL

See elementary data types

Notes

This data type is defined by the IEC61131-3.


BREAKCAM

BREAKCAM  Stop the synchronisation movement

Syntax

BREAKCAM (<Axis>)

Accepted types

<Axis> : tPeripheral

Description

This function is used to break the processing synchronisation movement and go to the next.
<Axis> : Axis name

See also

BREAKCAM_POS


BREAKCAM_POS

BREAKCAM_POS  Position after a BREAKCAM/STOPS

Syntax

<Position> = BREAKCAM_POS (<Axis>, <Source>)

Accepted types

<Axis> : tPeripheral
<Source> : UINT
<Position> : REAL

Description

This function returns the axis position at the last BREAKCAM or STOPS.
<Axis> : Axis name
<Source> : allows selection the source:

  • 0 for the slave position

  • 1 for the master position

  • 2 for the following error

See also

BREAKCAM


BUFMOV_S

BUFMOV_S  Number of movements in the buffer

Syntax

<Variable>=BUFMOV_S (<Axis>)

Accepted Types

<Axis> : tPeripheral
<Variable> : UDINT

Description

This function returns the number of waiting movements in the axis board buffer
The current movement of the axis board is not contained in the result of this function.
This function can be used after starting movements, to know if a movement is finished.
If the buffer of movements is full, the task is blocked and continues until a place becomes available.
<Axis> : Name of the axis

Remark

This operating mode degrades the performances of the MPC.

Example ST

STTR(X, 100.0) ;
STTR(X, 50.0) ;
STTR(X, 50.0) ;
WAIT (BUFMOV_S(X) <2) ; (* Wait for the end of the first movement *)


BY

See FOR


BYTE

See elementary data types

Notes

This data type is defined by the IEC61131-3.


CAL

CAL  Call of a functional block (language IL)

See Call of a functional block


CALC

CALC  Call of a functional block (language IL)

See Call of a function block


CALCN

CALCN  Call of a functional block (language IL)

See Call of a function block


CAM_S

CAM_S  Came state

Syntax

< Variable > := CAM_S (< Slave >)

Accepted Types

< Slave >: tPeripheral
< Variable > : UDINT

Description

This function allows knowing which number and segment of cam is running in only one function.
< Slave > : Name of slave axis where the cam is running

Remarks

See CAMNUM_S and CAMSEG_S for the detail of the possible values.

Example ST

VAR
NumCame : UINT;
NumSegment : UINT;
EtatCame : UDINT;
END_VAR

(* Risk *)
NumCame:= CAMNUM_S(Axis_X);
...
NumSegment:= CAMSEG_S(Axis_X);

(* No risk *)
CameState:=CAM_S (Axis_X);
...
NumCame:= DWORD_TO_UINT (SHR (UDINT_TO_DWORD (CameState) ,16));
...
NumSegment:= UDINT_TO_UINT(CameState);

See also

CAMNUM_S

CAMSEG_S


CAMBOX

CAMBOX define a cambox

Syntax

CAMBOX (<NumCamBox>, <Axis_Ref>, <Src_Pos>, <Filtrage>, <SegmentDef>, <OutputDef>)

Accepted types

<NumCamBox> : USINT
<Axis_Ref> : tPeripheral
<Src_Pos> : tSrcPos
<Filtrage> : tFilerMaster
<SegmentDef> : tSegmentDef
<OutputDef> : tOutputDef

Description

This function define a cambox.
<NumCamBox> : vambox number (0..31)
<Axis_Ref> : axis on which is the position source
<Src_Pos> : reference of the position source
<Filtrage> : filtering type of on the position source
<SegmentDef> : segments definition
<OutputDef> : outputs definition

Remarks

If the cambox is active, the execution of this function stopped the cambox (but the outputs are not reset).
If a parameter is incorrect or an error occurs, the cambox is still inactive.

See also

CAMBOX_S

CAMBOXOUT

CAMBOXSEG

SETINP

STARTCAMBOX

STOPCAMBOX


CAMBOX_S

CAMBOX_S  cambox state

Syntax

<Q> := CAMBOX_S (<NumCamBox>)

Accepted types

<NumCamBox> : USINT
<Q> : BOOL

Description

This function return the state of a cambox : TRUE is the cambox is running.

See also

CAMBOX

CAMBOXOUT

CAMBOXSEG

SETINP

STARTCAMBOX

STOPCAMBOX


CAMBOXOUT

CAMBOXOUT  cambox output

Syntax

CAMBOXOUT (<NumCamBox>, <NumOut>, <OutputDef>)

Accepted types

<NumCamBox> : USINT
<NumOut> : USINT
<OutputDef> tOutputDef

Description

This function modifies a cambox output. NumOut contains the output number to modify, its data are taken at the place corresponding in the table of output definition passed in parameter.
The call of this function influence all the segments connected to the selected output.
<NumCamBox> : cambox number (0..31)
<NumOut> : output number (0..31)
<OutputDef> : outputs definition

Remarks

It is possible to add/remove an output on flight.
The function is blocking until the output is taken into account (300µs max).
In the case of a modification of the concerned output, the initial output cares its value at the moment of the change.

See also

CAMBOX

CAMBOX_S

CAMBOXSEG

SETINP

STARTCAMBOX

STOPCAMBOX


CAMBOXSEG

CAMBOXSEG  cambox segment

Syntax

CAMBOXSEG (<NumCamBox>, <NumSeg>, <SegmentDef>)

Accepted types

<NumCamBox> : USINT
<NumSeg> : USINT
<SegmentDef> : tSegmentDef

Description

This function modifies a cambox segment. NumSeg contains the segment number to modify, its data are taken at the place corresponding in the table of segment definition passed in parameter.
<NumCamBox> : cambox number (0..31)
<NumOut> : segment number (0..31)
<OutputDef> : segments definition

Remarks

I It is possible to add an segment on flight.
The function is blocking until the segment is taken into account (300µs max).
In the case of a modification of the concerned output, the initial output cares its value at the moment of the change.

See also

CAMBOX

CAMBOX_S

CAMBOXOUT

SETINP

STARTCAMBOX

STOPCAMBOX


CAMNUM_S

CAMNUM_S  Number of the running came

Syntax

<Variable> := CAMNUM_S (<Slave >)

Accepted types

< Slave >: tPeripheral
< Variable > : UINT

Description

This instruction permits to know the number of the running cam (between 1 and 128).
< Slave >: Axis name

Remarks

The returned value is significant only if CAM_S is 1.
CAMNUM_S returns 0 if no cam is launch.
If a cam is launch but is not yet gearing or is on standby by a TRIGGER, its number will nevertheless be return by CAMNUM_S.

Example ST

If (CAMNUM_S(Axis_X)=1) Then
 FlagCame1EnCours:= 1; (* Came 1 running *)
End_If;
If (CAMNUM_S(Axis_X)=2) Then
 FlagCame2EnCours:= 1; (* Came 2 running *)
End_If;

See also

CAM_S

CAMSEG_S


CAMREADPOINT

CAMREADPOINT  Slave position in the cam

Syntax

<Slave Position> := CAMREADPOINT (<Master Position>, <Nr Cam>)

Accepted types

<Slave Position> : REAL
<Master Position> : REAL
< Nr Cam > : UINT

Description

This instruction allows calculating the slave position <Slave Position> in the cam, corresponding to the master position <Master Position>.

Remarks

This instruction use MASTEROFFSET and SLAVEOFFSET values in progress for this axis.

See also

CAM_S

CAMSEG_S


CAMSEG_S

CAMSEG_S  Equation number of the running cam

Syntax

<Variable> := CAMSEG_S( < Slave >)

Accepted types

< Slave >: tPeripheral
< Variable > : UINT

Description

This instruction permits to know which segment of the cam is running (between 1 and the cam position number -1)..
< Slave >: Axis name

Remarks

The returned value has got a sense only if CAM_S is set.
CAMSEG_S returns 0 if no cam is launch.
If a cam is launch but is not yet gearing or is on standby by a TRIGGER, CAMSEG_S return 1.

Example ST

If (CAMSEG_S(Axis_X)=1) Then
Segment1EnCours :=1 ; (* Segment between point 1 and point 2 *)
End_If ;
If (CAMSEG_S(Axis_X)=2) Then
Segment2EnCours :=1 ; (* Segment between point 2 and point 3 *)
End_If ;

See also

CAM_S

CAMNUM_S


CAPTURE

CAPTURE  Start of a position capture

Syntax

CAPTURE (<Number>, <Axis>, <Source>, <InputRef>, <Edge>, <Window>, <Min>, <Max>)

Accepted types

<Number> : UINT
<Axis> : tPeripheral
<Source> : tSrcPos
<InputRef> : tIObitIn
<Edge> : USINT
<Window> : tCapType
<Min> : REAL
<Max> : REAL

Description

The function CAPTURE is used to register the current position of the axis or the master position.

With this instruction, the drive waits for a rising edge (possibly of a window) on a capture input.
When the edge is detected, the position is stored in variable REGPOS1_S.

The flag REG1_S is set as true.

<Number> is the register number storing the capture (0 to 127)
<Axis> : axis name
<Source> : allows to select the source of the capture
<Input Ref> : The input reference on which we wait for the rising edge (name of E/S declared in the editor E/S)
<Edge> : 1 for rising edge or 0 for falling edge.
<Window> : > W_NONE for none window, W_INT for internal window or W_EXT for external window.
<Mini> must always be inferior to <Maxi>.

Example ST

(* Capture real motor position on the rising edge of the input 4 of MPC when the axis is between 10 and 20 *)
CAPTURE (1, Axis_X, SRC_AXIS, Mpc_4, 1, W_NONE , 10.0, 20.0);
WAIT (REG_S(1) = 1); (* Wait for a capture *)
Position:= REGPOS_S(1); (* Position = value of the position at the moment of the capture *)

See also

CAPTUREIMD

CAPTURECANCEL


CAPTURECANCEL

CAPTURECANCEL  Cancel a capture

Syntax

CAPTURECANCEL (<Number>)

Accepted types

<Number> : UINT

Description

The function CAPTURECANCEL is used to cancel a processing capture.

<Number> : is the register number storing the capture (from 0 to 127).

See also

CAPTURE

CAPTUREIMD


CAPTUREIMD

CAPTUREIMD  Start of a position capture from a rapid input IMD

Syntax

CAPTUREIMD (<Number>, <Axis>, <Source>, <InputRef>, <Edge>, <Window>, <Min>, <Max>)

Accepted types

<Number> : UINT
<Axis> : tPeripheral
<Source> : tSrcPos
<InputRef> : tCapImdIo
<Edge> : USINT
<Window> : tCapType
<Min> : REAL
<Max> : REAL

Description

The function CAPTUREIMD is used to register the current axis position or the masters position.
With this instruction the drive waits for a rising edge (possibly of a window) on the capture input.
When the edge is detected, the position is stored in variable REGPOS1_S.
The flag REG_S is set as true.
<Number> is the register number storing the capture (0 to 127)
<Axis> : axis name
<Source> : allows to select the source of the capture.
<InputRef> : the IMD input reference on which we wait for the rising edge
<Edge> : 1 on rising edge or 0 on falling edge.
<Window> : > W_NONE for none window, W_INT for internal window or W_EXT for external window.
<Mini> must always be inferior to <Maxi>.

Example ST

(*Capture motor position on the rising edge of input 3 of the IMD when the axis is between 10 and 20 *)
CAPTURE (1, Axis_X, SRC_AXIS, IO_3, 1, W_NONE , 10.0, 20.0);
WAIT (REG_S(1) = 1); (* Wait for a capture *)
Position:= REGPOS_S(1); (* Position = value of the capture position *)

Warning

It is forbidden to use simultaneously the same input and edge on the movement triggered functions, the captures and the counters.

See also

CAPTURE

CAPTURECANCEL


CAPTUREEVENT

CAPTUREEVENT Associate an event to capture

Syntax

CAPTUREEVENT (<Number>, <Event>, <Paramter>)

Accepted types

<Number> : UINT

<Event> : UINT

<Paramter> : UDINT

Description

This function associates an event to a capture.
<Number> is the register number storing the capture (0 to 127)
<Event> : event number to launch
<Parameter> : parameter for the event

Remarks

If the event is equal to 0, the event is disassociated.

See also

CAPTURE

CAPTURECANCEL

CAPTUREIMD


CASE

CASE OF ELSE END_CASE  Multi Test

Syntax

CASE <expression > OF
<value> :
<instructions>
<value> , <value> :
<instructions>;
<value> .. <value> :
<instructions>;
ELSE
<instructions>
END_CASE;

Accepted types

<expression> : ANY_BIT ou ANY_INT

Description

This instruction allows the execution of an instructions group according to the value of an expression.

Remarks

All the enumerated values correspond to the <expression>, and represent possibilities at the program execution. The instructions after ELSE are executed if the expression takes a value which is not enumerated. For each case, you must specify either a value, or a list of values separated by commas (",") or a range specified by an interval "min .. max".

Warning

For each case of CASE, the<expression> is recalculated which might cause some incoherencies and especially multi calls in the case of a function.
You must use an intermediate variable in order to have a constant value for the different cases.

Example ST

(* this example tests the prime numbers up to 5 *)
iNumber := Number;
CASE iNumber OF
0 :
Alarm := TRUE;
AlarmText := '0 = no result';
1 .. 3, 5 :
bPrime := TRUE;
4, 6 :
bPrime := FALSE;
ELSE
Alarm := TRUE;
AlarmText := 'I dont know after 6 !';
END_CASE;

See also

IF

WHILE

REPEAT

FOR

EXIT


CLEAR

CLEAR  Clear the axis position

Syntax

CLEAR (<Axis>)

Accepted types

<Axis> : tPeripheral

Description

This instruction forces the position of the axis to the value of the -ZERO_P parameter.
<Axis>: axis name

Example ST

CLEAR(Axis_X);
Position :=POS_S(Axis_X); (* Result : Position=0.0 *)


CLEARAUX

CLEARAUX  Clear the position of the auxiliary

Syntax

CLEARAUX (<Axis>)

Accepted types

<Axis> : tPeripheral

Description

This instruction forces the position of the axis to the value of the -ZEROAUX_P parameter.
<Axis>: axis name

Example ST

CLEARAUX(Axis_X);
Position :=POSAUX_S(Axis_X) ; (* Result : Position=0.0 *)


CLEARAXISFAULT

CLEARAXISFAULT  To clear the axis defaults

Syntax

CLEARAXISFAULT (<Axis>)

Accepted Types

<Axis> : tPeripheral

Description

CLEARAXISFAULT clears all axis defaults (including the following error).
<Axis>: axis name


CLEARFLASH

Syntax

CLEARFLASH (0)

Description

This function erases the content of the MPC FLASH memory.

See also

RAMTOFLASH

FLASHOK_S


CONCAT

CONCAT  concatenation of two characters strings

Syntax

<Q> := CONCAT(<In1>, <In2>)

Accepted types

<In1> : STRING
<In2> : STRING
<Q>: STRING

Description

The characters strings 'IN1 and IN2 'in the operating register are assembled to form a character string which is charged in the operating register.

The strings IN1 to IN2 are written from the left to the right in ascending order of the operand Q.


CONTINUET

CONTINUET  Continue task execution

Syntax

CONTINUET(< task >)

Accepted types

< Task > :tGroup

Description

This instruction is used to continue the execution of a suspended task.

Remarks

This function has no effect on the stopped or running task.
< Task > : task name

Example ST

Delay (100);
Run (MyTask);
Delay (100);
SUSPEND(MyTask);
Delay (100);
CONTINUE(MyTask);

See also

RUN

HALT

SUSPEND


COS

COS  Cosine

Syntax

<Q> := COS (<IN>)

Unit

<IN> is expressed in radians

Accepted types

<IN> : REAL
<Q>: REAL

Description

This function returns the cosine of <IN>.
The argument <IN> must be a valid numerical expression.
The function COS takes an angle and returns the two sides ratio of a rectangle triangle.

The ratio is the length of the adjacent side divided by the length of the hypotenuse.

Remarks

In language LD, the inverse function Cosine is called: COS_REAL
In language FBS, the inverse function Cosine is called: COS_REAL_FBD
In language IL, the input (IN) must be charged in the current result before calling the function.

Example ST

Q := COS (IN);

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

Op1: LD IN
COS
ST Q

See also

ACOS

ASIN

ATAN

SIN

TAN


COUNTER

COUNTER  Setup counter

Syntax

COUNTER (<NumCounter>, <Src_io>, <Up>, <Edge>)

Accepted types

<NumCounter> : USINT
<Src_io> : tIOBitIn
<Up> : BOOL
<Edge> : tEdgeType

Description

This function allows to setup counter
<NumCounter> : counter number (from 0 to 63)
<Src_io> : input counter name
<Up> : TRUE rise up, FALSE rise down
<Edge> : edge type

Remarks

If the counter is already launched, this function stops the counter, reset to 0 and removes the associated event.

See also

COUNTER_S

COUNTEREVENT

COUNTERSET

STARTCOUNTER

STOPCOUNTER


COUNTER_S

Syntax

<Q> := COUNTER_S (<NumCounter>)

Accepted types

<NumCounter> : USINT
<Q> : UDINT

Description

This function returns the counter current value.
<NumCounter> : counter number (0 to 63)

See also

COUNTER

COUNTEREVENT

COUNTERSET

STARTCOUNTER

STOPCOUNTER


COUNTEREVENT

COUNTEREVENT  Associate an event to counter

Syntax

COUNTEREVENT (<NumCounter>, <Modulo>, <Event>, <Param>, <Use_modulo>)

Accepted types

<NumCounter> : USINT
<Modulo> : UDINT
<Event> : UINT
<Param> : UDINT
<Use_modulo> : BOOL

Description

This function associates an event to a counter.
<NumCounter> : counter number (from 0 to 63)
<Modulo> : Modulo value
<Event> : event number to launch (0 if no event)
<Param> : parameter for the event
<Use_modulo> : use modulo

Up counter mode :
When the counter reached modulo', the event is launched (except if 0).
The value of the counter is reset to 0 if use_modulo is TRUE

Down counter mode :
When the counter reached 0, the event is launched (except if 0).
The value of the counter is set to modulo if use_modulo is TRUE

Remarks

There is only one event by counter, one 2nd call on the same counter replaces the affected event at this counter.
In modulo, the counter goes from 0 to modulo-1, if the meter is initialized with a value outside the modulo, it will return there only when it reaches the natural value of the modulo

See also

COUNTER

COUNTER_S

COUNTERSET

STARTCOUNTER

STOPCOUNTER


COUNTERSET

Syntax

COUNTERSET (<NumCounter>, <Value>)

Accepted types

<NumCounter> : USINT
<Value> : UDINT

Description

This function force a counter to a given value
<NumCounter> : counter number (from 0 to 63)
<Value> : valeur to set the counter

See also

COUNTER

COUNTER_S

COUNTEREVENT

STARTCOUNTER

STOPCOUNTER


CTD

CTD  Down counter

Syntax

CTD(<CD >,< LOAD >,< PV>)
CTD.<Q>
CTD.<CV>

Accepted types

<CD> : bool
<LOAD> : bool
<PV> : int
<Q> : bool
<CV> : int

Description

Makes possible to realise a function block which serves to count down.
<CD> is the input of the counting down. The counter will be decreased at each rising edge of CD
<LOAD> is the loading value. The counter is forced to PV if LOAD = TRUE
<PV> is the maximum programmed value
<Q> is at TRUE if the counting is finished, i.e.if CV = 0

CV> is the current value of the counter

Remark

At initialisation, the counter is charged to the value "0".

Example ST

(* MyCounter is a declared request of the block CTD *)
MyCounter(CD:=0,LOAD:=1,PV:=10); (* Initialization of the discounting machine at the value 10 *)
MyCounter(LOAD:=0);
MyCounter(CD:=1); (* CV = 9 *)
MyCounter(CD:=0);
MyCounter(CD:=1); (* CV = 8 *)
Q_BOOL := MyCounter.Q;
CV := MyCounter.CV;

Example LD

Example FBD

Example IL

(* MyCounter is a declared request of the block CTD *)

Op1: CAL MyCounter(CD:=0,LOAD:=1,PV:=10)
 CAL MyCounter(LOAD:=0)
 CAL MyCounter(CD:=1)
 CAL MyCounter(CD:=0)
 CAL MyCounter(CD:=1)
 LD MyCounter.Q
 ST Q_BOOL
 LD MyCounter.CV
 ST CV

See also

CTU

CTUD


CTU

CTU  Counter

Syntax

CTU(<CU>,< RESET >,< PV>)
CTU.<Q>
CTU.<CV>

Accepted types

<CD> : bool
<RESET> : bool
<PV> : int
<Q> : bool
<CV> : int

Description

Allows realizing a discounting block function
<CD> is the discounting input. The counter will be decreased at each rising edge of CD
< RESET > is the loading value. The counter is forced to PV if LOAD = TRUE
<PV>is the programmed counter upper limit
<Q> is at TRUE if the counting is finished, i.e. if CV = 0
<CV> is the current value of the counter

Remark

On initialisation, the counter will be set to "0".

Example ST

(* MyCounter is a declared request of block CTD *)
MyCounter(CD:=0,LOAD:=1,PV:=10); (* Initialisation of the discounting machine at the value 10 *)
MyCounter(LOAD:=0);
MyCounter(CD:=1); (* CV = 9 *)
MyCounter(CD:=0);
MyCounter(CD:=1); (* CV = 8 *)
Q_BOOL := MyCounter.Q;
CV := MyCounter.CV;

Example LD

Example FBD

Example IL

(* MyCounter is a declared request of the block CTD *)
Op1: CAL MyCounter(CD:=0,LOAD:=1,PV:=10)
 CAL MyCounter(LOAD:=0)
 CAL MyCounter(CD:=1)
 CAL MyCounter(CD:=0)
 CAL MyCounter(CD:=1)
 LD MyCounter.Q
 ST Q_BOOL
 LD MyCounter.CV
 ST CV

See also

CTD

CTUD


CTUD

CTUD  Counter/Discounting machine

Syntax

CTUD(<CU>,<CD>,< RESET >,<LOAD>,< PV>)
CTUD.<QU>
CTUD.<QD>
CTUD.<CV>

Accepted types

<CU> : bool R_EDGE
<CD> : bool R_EDGE
< LOAD > : bool
< RESET > : bool
<PV> : int
<QU> : bool
<QD> : bool
<CV> : int

Description

Allows the realization of a discounting block function
<CU> is the bool counting impulses for counting up. The counter will be increased at each rising edge of Cu
<CD> is the bool counting impulses for counting down. The counter will be decreased at each rising edge of CD
< RESET > is the reset condition. The counter is forced at PV if RESET = TRUE
< LOAD > is the loading value. The counter is forced at PV if LOAD = TRUE
<PV> is the maximum programmed value
<QU> is TRUE if the counting has been finished, i.e. if CV >= PV
<QD> is TRUE if the counting has been finished, i.e. if CV <= 0
<CV> is the current value of the counter

Remark

At the initialization the counter is charged with the value "0".

Example ST

(* MyCounter is a declared request of the block CTUD *)
MyCounter(CU :=0 ;CD:=0, RESET :=1,LOAD:=0,PV:=10); (* Initialization of the discounting machine at the value 10 *)
MyCounter(RESET:=0);
MyCounter(LOAD:=0);
MyCounter(CD:=1); (* CV = 9 *)
MyCounter(CD:=0);
MyCounter(CD:=1); (* CV = 8 *)
MyCounter(CU:=1); (* CV = 9 *)
Q_BOOL := MyCounter.Q;
CV := MyCounter.CV;

Example LD

Example FBD

Example IL

(* MyCounter is a declared request of the block CTUD *)
Op1: CAL MyCounter(CU:=0,CD:=0, RESET:=1;LOAD:=0,PV:=10)
 CAL MyCounter(RESET:=0)
 CAL MyCounter(LOAD:=0)
 CAL MyCounter(CD:=1)
 CAL MyCounter(CD:=0)
 CAL MyCounter(CD:=1)
 CAL MyCounter(CU:=1)
 LD MyCounter.Q
 ST Q_BOOL
 LD MyCounter.CV
 ST CV

See also

CTU

CTD


CURRENT

Syntax

CURRENT (<Axis>, <Expression>)

Units

<Expression> in A

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function forces the current demand.
<Axis> : axis name
<Expression> value to force.

Example ST

CURRENT (Axe_X, 5.20); (* Current 5.2 A *)

See also

TORQUE

TORQUE_S

CURRENT_S

SPEED

SPEED_S


CURRENT_S

Syntax

<Q> := CURRENT_S (<Axis>)

Units

<Q> en A

Accepted types

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the current value.
<Axis> : axis name

See also

TORQUE

TORQUE_S

CURRENT

SPEED

SPEED_S


DAC

DAC  Analogue outputs

Syntax

DAC (<Axis>, <Expression>)

Unit

<Expression > : Volts

Limits

<Expression> : from -10 to +10

Accepted types

<Axis> Name of the axis
<Expression> : REAL

Description

This function sends a voltage on an analogue output of a drive IMD.

Exemple ST

DAC(Axis_X, 5.2);

See also

ADC


DEC

DEC  Modify the deceleration

Syntax

DEC (<Axis>, <Expression>)

Unit

<Expression> in user unit per s² (Ex: mm/s², degree/s², tr/s²)

Limit

<Expression> must be higher or equal to 0

Accepted types

<Axis>: Name of axis
<Expression>: REAL

Description

This instruction modifies the current deceleration
<Expression> contains the value to apply

Remark

The current deceleration can be modified at any time.

Example ST

DEC(AXIS_X, 500.0) ; (*Deceleration of 500 units/s²*)

See also

ACC*ACC

VEL

DEC_T

DECP


DEC_T

DEC_T  Send back the deceleration

Syntax

<Variable> := DEC_T(<Axis>)

Unit

<Variable> in user unit per s² (Ex : mm/s², degree/s², tr/s²)

Limit

<Variable> is greater or equal to 0

Accepted types

<Axis> : Name of axis
<Variable> : REAL

Description

This instruction returns current acceleration.
<Expression> contains the value returned by the function

Remarks

The current deceleration can be read at any time.

Example ST

DEC (Axis_X, 500.0); (*Deceleration of 500 units/s²*)
DecX : = DEC_T (Axis _X); (*DecX=500*)

See also

ACC_T

VEL_T

DEC

DECP


DECP

DECP  Deceleration in percent

Syntax

DECP(<Axis>, <Expression>)

Limits

<Expression> from 0 to 100

Accepted types

<Axis> : Name of the axis
<Expression> : REAL

Description

This function sets current acceleration in percent of default deceleration parameter defined in the profile of the axis.
<Expression> contains the percent to apply

Example ST

DECP (Axis_X, 10.0); (*10% of the deceleration defined in the speed profile *)

See also

ACCP

VELP

DEC

DEC_T


DELAY

DELAY  Passive waiting

Syntax

DELAY <Duration>

Unit

<Duration> : milliseconds

Accepted Type

Duration : UDINT

Description

This function initiates a passive waiting according to the specified duration.
It blocks the task and passes execution on to the next task.

Warning

This instruction can be used in any type of task, however its use in a TIMER or EVENT task-driven can involve the opening of the task watchdog.

Example

DELAY(500);     (* Duration of 0.5 s. *)
DELAY(Tempo1) ;


DELETE

DELETE  Deletes some characters in a string

Motion Studio does not implement this function.


DINT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


DISPLAY

DISPLAY  7 segments Display

Syntax

DISPLAY <Expression>

Accepted Type

<Expression>: BYTE

Description

This function fixes the state of the MPC status display.

Remark

Each bit of <Expression> represents a segment.
The bit b8 is not used.

Example ST

Display (109); (* 5 on the display *)


DIV

DIV- Division (language IL)

See Division


DO

See FOR et WHILE


DWORD

See elementary data types

Notes

This data type is defined by the IEC61131-3.


ELSE

See IF


ELSIF...THEN

ELSIF

See IF


END_CASE

See CASE


END_FOR

See FOR


END_IF

See IF


END_REPEAT

See REPEAT


END_TYPE

See theVoir declaration sections and the redefined types.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.

Both TYPE and END_TYPE keywords do not have to be inserted in some blocks VAR..END_VAR but in the declaration files of type at the project level.


END_VAR

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs.
It is defined byIEC61131-3.


END_WHILE

See WHILE


ENDCAM

ENDCAM  Stop a cam

Syntax

ENDCAM(<Slave>)

Accepted Types

<Slave> : tPeripheral

Description

The function stops the Slave axis movement at the came while the function STOP stops the movement immediately.
<Slave> : axis name

Remarks

If ENDCAM is applied to a cam which has been declared in non-single shot and linked with another one, the cam ends its profile and goes on to the next.

See also

STOP


EQ

EQ  Equality (language IL)

See Equality


EXIT

EXIT  Abort an iterative statement

Syntax

EXIT

Description

The message EXIT indicates that the current loop (WHILE, REPEAT or FOR) must be left.
The execution is rerouted after the instruction END_WHILE, END_REPEAT or END_FOR from the loop where EXIT has been inserting.
EXIT only refers to a loop and cannot be used to leave several overlapping loops.

Example ST

VAR
 start: INT :=0;
 summe: INT :=0;
 ende : INT := 10;
END_VAR

FOR Start:=1 TO Ende BY 2 DO
Summe := Summe + 1;
IF Summe > 4 THEN
EXIT;
END_IF;
END_FOR;
(* Will continue here *)

See also

IF

WHILE

REPEAT

FOR

CASE


EXP

EXP  Exponential

Syntax

<Q> := EXP (<IN>)

Accepted types

(<IN>) : REAL
(<Q>) : REAL

Description

This function restores the base of the natural logarithms raised to the power (<Expression>).
The argument (<Expression>) must be a valid numerical expression. The returned value is of real type.

Remarks

In language LD and FBD, several functions EXPS are available according to the data type.
In language IL, the input value must be charged in the current result before calling the function.

Example ST

Q :=EXP (IN);

Example FBD

Example LD

(*The function is executed only if EN is TRUE*°
(*ENO has the same value as EN*°

Example IL

Op1: LD IN
EXP
ST Q

See also

LOG


EXPT

EXPT  Power

Syntax

<Q> := EXPT (<IN>, <Exp>)

Accepted types

<IN>, <Q> : ANY_REAL
<Exp> : ANY_NUML

Description

This function raises <IN> to the power (<Exp>).
The argument (<Exp>) must be a valid numerical expression. The returned value is of real type.

Remarks

In language LD and FBD, several functions EXPT are available according to the data type.
In language IL, the input value must be charged in the current result before calling the function.

Example ST

Q :=EXPT (IN1,IN2) ;
Q := IN1**IN2 ;

Example FBD

Example LD

(*The function is executed only if EN is TRUE*°
(*ENO has the same value as EN*°

Example IL

Op1: LD IN1
 EXPT IN2
 ST Q

See also

LOG


F_TRIG

F_TRIG  Detection of falling edge

Syntax

F_TRIG (<CLK>)
F_TRIG.Q

Accepted types

<CLK> : BOOL
<Q> : BOOL

Description

The function block ´F_TRIG´ detects the status of the input operand ´CLK´.
The status change from ´1´ to ´0´ in a processing cycle is detected and indicated in the subsequent cycle with the activation of the output ´Q´.

The output is ´1´ during the processing cycle in which the change of the status of ´CLK´ is detected and a falling edge is indicated.

Example ST

(* F_TRIG1 is a declared request of the block F_TRIG *)
F_TRIG1(CLK:=IN_BOOL);
Q_BOOL:=F_TRIG1.Q;

Example FBD

Example LD

Example IL

(* F_TRIG is a declared request of the block F_TRIG *)
Op1: CAL F_TRIG1(CLK:=IN_BOOL)
LD F_TRIG1.Q
ST Q_BOOL

See also

R_TRIG


FALSE

Constant value of type BOOL


FE_S

FE_S  Value of following error

Syntax

<Q> := FE_S(<Axis >)

Accepted types

< Axis > : tPeripheral
<Q> : BOOL

Description

This function returns the value of the current following error
<Slave> : axis name

Remarks

This function is used to know the current value of the following error. Thus, we can verify the behaviour of the regulation in real time.
This flag can be treated in a task of defaults management.
It is possible also to read the defaults state of an IMD/IMDL drive:
READPARAM (Axe_X, IMD_FAULT_STATUS);
READPARAM (Axe_X, IMD_FAULT_STATUS2);

Example ST

ValErrPoursuit := FE_S(Axis_X);
If (ValErrPoursuit>10.0) Then
 FlagDefautAxisX:=1;
End_If;

See also

FEMAX_S

SECURITY


FEMAX_S

FEMAX_S  Following error limit

Syntax

<Q> := FEMAX_S(<Axis>)

Accepted types

< Axis > : tPeripheral
<Q> : BOOL

Description

This function indicates maximum following error overflow.
< Axis > : axis name

Remarks

This function is used to know which axis passed in following error.

It will be necessary to use this flag in an error-handling task.

Example

IF FEMAX_S(Axis_X) THEN
FlagDefautAxisX:=1;
End_If;
IF FEMAX_S(Axis_X) THEN
FlagDefautAxisY:=1;
End_If;

See also

FE_S

SECURITY


FIND

FIND  To search characters position in a string.

Syntax

<Q> := FIND (<IN1>, <IN2>)

Accepted Types

<IN1> : STRING String

<IN2> : STRING String containing the sequence of characters to be searched
<Q> : INT Position of the first STR character in IN, or 0 if the research failed

Description

This function allows searching the characters position in a string.
<IN1> is the string to be scanned.
<IN2> is the string containing the sequence of characters to be searched.
<Q> is the position of the first character <IN2> in <IN1>, or 0 is the research has failed.

Remarks

The first valid position is 1.
A return value 0 means that < IN2 > was not found.
The research takes into account the breakage.
In LD, the input flow (EN) validates the operation, and the output flow remains unchanged.
In IL, the first parameter (the string) must be charged in the current result before calling the function.
The second parameter is the function operand.

Language ST

POS := FIND (IN, STR);

Language FBD

Language LD

(* The function is called if EN = TRUE *)
(* ENO is equal to EN *)

Language IL

Op1: LD IN
 FIND STR
 ST POS

See also

+

MLEN

DELETE

INSERT

REPLACE

LEFT

RIGHT

MID


FILTERMASTER

FILTERMASTER  Apply a position filter during a synchronization

Syntax

FILTERMASTER (<Type>)

Accepted Type

<Type> : UINT

Description

This function allows applying different filter positions during synchronization. The values of <Type> are :
0 : no filter, synchronization is very quick but risk velocity discontinuous shock if ratio is high (for 1 master tour, le slave makes several tours)
1 : standard filter (by default)
2 : Thanks to low time constant and advanced filter, the synchronization remains fast and greatly reduces the discontinuous velocity shocks. (Particularly for high ratios)
3 : Thanks to high time constant and advanced filter, the synchronization greatly cancels the discontinuous velocity shocks but synchronization loses precision. (Increases the answering time)
4 : Interpolation filter for high ratio where master speed changes a few.
5 : Advanced interpolation filter for high ratio where master speed change a few, the synchronization cancels all discontinuous velocity shocks but loses precision. (Increases the answering time)


FIXTOREAL

Syntax

<Q> := FIXTOREAL (<IN>, <PREC>, <INV>)

Accepted type

<IN> : UDINT
<PREC> : USINT
<INV> : BOOL
<Q> : REAL

Description

This function converts a fix decimal number (udint) into a real with the indicated precision.

<INV> to TRUE, allow to inverse word order before converts <IN> to real.

Langage ST

Valeur := FIXTOREAL (123, 2, 0); (* Valeur = 1.23 *)


FLASHOK_S

Syntax

<Q> := FLASHOK_S (0)

Accepted types

<Q> : BOOL

Description

This function returns the state of the last copy in MPC FLASH memory.

See also

RAMTOFLASH

CLEARFLASH


FOR

FOR  Loop FOR

Syntax

FOR <index> = <minimum> TO <maximum> BY <step> DO
<instructions>
END_FOR

Accepted types

<index>, <minimum>, <maximum>, <step> : SINT, INT ou DINT

Description

This instruction allows repeating a set of instructions boundlessly.
<index> is used as index
<minimum> is used as initial index value
<maximum>is used as maximum authorized value for the index
<step> is the step of increment of the index after each iteration (1 per default)

Remarks

In that case: <step> = 1, the mention "BY <step>" can be neglected.

Warning

It is possible to create infinite loops if the values <maximum> correspond to the maximum of the<index> type, "For index:=0 to 255" with index of type SINT create an infinite loop.

Example ST

iArrayDim := 10;
(* force to 0 all elements of a schedule *)
FOR iPos := 0 TO (iArrayDim - 1) DO
MyArray[iPos] := 0;
END_FOR;

(* force to 1 all elements with uneven index *)
FOR iPos := 1 TO 9 BY 2 DO
MyArray[ipos] := 1;
END_FOR;

Example FBD

Not available

Example LD

Not available

Example IL

Not available

See also

IF

WHILE

REPEAT

CASE

EXIT


FRAC - Partie fractionnelle

FRAC  Fractional part

Syntax

<Q> := FRAC(<Expression>)

Accepted type

<Expression>: real

Description

This function returns the fractional part of <Expression>.

Remark

This function returns a real value.

See also

INTP


GE

GE  Superior or equal (language IL)

See Superior or equal


GEARBOX

GEARBOX  Gearbox

Syntax

GEARBOX(<SlaveAxis>,<MasterAxis>,<MasterSource>,<Numerator>,<Denominator>,<Reversible>, <Acceleration>)

Units

<Numerator> in the slave unit
<Denominator> in the master unit

Accepted types

<SlaveAxis> : tPeripheral
<MasterAxis> : tPeripheral
<MasterSource> : tSrcPos
<Numerator> : REAL
<Denominator> : REAL
<Reversible> : BOOL
<Acceleration> : REAL

Description

This function links 2 axis in gearbox.
<SlaveAxis> : slave axis name
<MasterAxis> : master axis name
<MasterSource> :select the master source.
The ratio is defined by <Numerator> / <Denominator> :
<Reversible>is a Boolean which indicates that the gearbox is reversible.

  • If Reversible = TRUE:

The gearing phase must be finished (acceleration distance must be done in one direction) so that the ratio is constant.
The gearing phase is entirely reversible, including if the Master change direction (disturbed position resolver)
Ratio:

If the sign of <Numerator> > is positive, the slave goes in the same direction as a STTIP on his axis
The sign of <Denominator> has no effect

  • If Reversible = FALSE
    The slave is linked to the master only in the master gearing direction.

    The other direction is not taken into account but memorized and the same distance will have to be recovered in the gearing direction before restart synchronization.

    The slave restart synchronization can be very violent!
    If the sign of <Numerator> > is positive, the slave goes in the same direction as a STTIP on his axis
    The master gearing direction is in relation with the sign of <Denominator>.

<Acceleration> is a parameter which allows the definition of a master acceleration period.

Remark

It is possible to use a TRIGGER to start a gearbox.
This instruction does not block the task (unless the movement buffer is full).

The link between the master and slave is valid as long as the instruction STOP (slave) or AXIS (slave) = OFF has not been set.
A null value of <Denominator> causes an error LZS.
The sign of <Acceleration> is ignored because it is systematically taken in the feed direction.

Example ST

(* Master: 360° per tour, modulo of 360 *)
(* Slave: 25.4mm/tour *)
(* A ratio of 25.4 (num)/360(den) is equal to: 1 slave tour for a master tour *)
GEARBOX (Axis_X, Axis_Y, SRC_AXIS, 25.4, 360.0, 1, 0.0);

See also

CAM

CAMBOX

MOVS

STOP

AXIS


GEARBOXRATIO

GEARBOXRATIO  Change the reduction ratio of an electrical shaft

Syntax

GEARBOXRATIO (<SlaveAxis>,<Numerator>,<Denominator>,< Acceleration >)

Units

<Numerator> in the slave unit
<Denominator> in the master unit

Accepted Types

<SlaveAxis> : tPeripheral
<Numerator> : REAL
<Denominator> : REAL
<Acceleration> : REAL

Description

This function changes the ratio of the electrical shaft.

<SlaveAxis> : slave axis name
The shaft ratio is defined by : <Numerator> / <Denominator>

  • If the GEARBOX is reversible:
    The ratio is taken into account however the master direction be.
    If the sign of <Numerator> > is positive, the slave goes in the same direction as a STTIP on his axis

  • If the GEARBOX is not reversible:
    The ratio is taken into account only in the feed master direction.
    If the sign of <Numerator> > is positive, the slave goes in the same direction as a STTIP on his axis

<Acceleration> is a parameter which allows definition of a master acceleration period.

Remark

The function is taken into account only when the GEARBOX acceleration period is finished otherwise it is ignored.
The instruction is non-blocking except if the buffer movement is full.
The link between the master and slave is valid as long as the instruction STOP (slave) or AXIS (slave) = OFF has not been set.
The sign of <Acceleration> is ignored because it is systematically taken in the feed direction.
The sign of < Denominator > is ignored.
A null value of <Denominator> causes an error LZS.

Example ST

WAIT (GEARBOXRATIO_S(Axis_X));
GEARBOXRATIO(Axe_X,1.0,1.0,0.0);

See also

CAM

CAMBOX

MOVS

STOP

AXIS


GEARBOXRATIO_S

GEARBOXRATIO_S  State of the ratio change

Syntax

<Q> := GEARBOXRATIO_S (<Axis_X>)

Accepted types

<Axis_X> : tPeripheral
<Q> : BOOL

Description

This function returns TRUE if it is possible to change the ratio.

Example

WAIT (GEARBOXRATIO_S (Axis_X));
GEARBOXRATIO (Axis_X, 1.0, 1.0, 0.0);

See also

CAM

CAMBOX

MOVS

STOP

AXIS


GETBITB

GETBITB  Returns a bit of a BYTE variable

Syntax

<Q> := GETBITB (<Data>, <Number>)

Limite

< Number > must be between 0 and 7

Accepted type

<Data> : BYTE
<Number> : USINT
<Q> : BOOL

Description

This function returns the bit value of a BYTE variable.


GETBITD

GETBITD  Returns a bit of a variable DWORD

Syntax

<Q> := GETBITD (<Data>, <Number>)

Limite

< Number > must be between 0 and 31

Accepted types

<Data> : DWORD
<Number> : USINT
<Q> : BOOL

Description

This function returns the bit value of a variable DWORD.


GETBITW

GETBITW  Returns a bit of a variable WORD

Syntax

<Q> := GETBITW (<Data>, <Number>)

Limite

< Number > must be between 0 and 15

Accepted types

<Data> : WORD
<Number> : USINT
<Q> : BOOL

Description

This function returns the bit value of a variable WORD.


GETLASTSYSEVENT

GETLASTSYSEVENT  Returns the last event of the pile system

Syntax

<Q> := GETLASTSYSEVENT (0)

Accepted type

<Q> : UINT

Desccription

This function returns the last event of the pile system:

1 : Watchdog error : a task configured with watchdog and that the parameter watchdog action be Event system
2 : Error Ethercat
3 : Error LZS
4 : Reading Writing error : error with the functions READ, WRITE, READR, WRITER, READPARAM, WRITEPARAM, READPARAMR, WRITEPARAMR
5 : Error Init Task error : error at the time of the init task execution
6 : Error NodeGuarding slave : error caused by the Nodeguarding slave/ local server (the MPC did not received package NodeGuarding from a distant master before the timeout)
7 : Error CAN Hard
8 : Error NodeGuarding master : error caused by the NodeGuarding of a distant node (a distant node did not answer the NodeGuarding request of MPC)

Remark

The exceeding of the system event pile causes the error E54.52


GETMODE

Syntax

<Q> := GETMODE (<Axe>)

Accepted types

<Axe> : tPeripheral
<Q> : tBcleMode

Description

This function return the operating mode of an axis.
<Axe> : Nom de laxe
<Q> : Mode de fonctionnement de laxe

See also

SETMODE


GETSYSTEMEVEN

GETSYSTEMEVENT  returns the first event of the pile system

Syntax

<Q> := GETSYSTEMEVENT (0)

Accepted type

<Q> : UINT

Description

This function returns and removes the oldest executed system:

1 : Error Watchdog : a task configured with watchdog with the parameter "watchdog action" being "system event" 2 : Error Ethercat
3 : Error LZS
4 : Reading, writing Error: error with the functions READ, WRITE, READR, WRITER, READPARAM, WRITEPARAM, READPARAMR, WRITEPARAMR
5 : Error Init Task error : error at the time of the execution of init task
6 : Error NodeGuarding slave : error caused by the nodeguarding slave/ local server (the MPC did not receive NodeGuarding package from a distant master before the timeout)
7 : Error CAN Hard
8 : Error NodeGuarding master : error caused by NodeGuarding of a distant node (a distant node did not answer to the request NodeGuarding of MPC)

Remark

The exceeding of the pile system causes the error E54.52

Voir aussi

GETLASTSYSEVENT

GETUSEREVENTPARAM

SETTASKEVENTLIST

SIGNAL


GETUSEREVENTPARAM

GETUSEREVENTPARAM  return the parameter of the last associated event

Syntax

<Param> := GETUSEREVENTPARAM ( 0 )

Accepted types

<Prama> : UDINT

Description

This function return the parameter associated to the last received event.
<Param> : Paramètre

See also

GETLASTSYSEVENT

GETSYSTEMEVENT

SETTASKEVENTLIST

SIGNAL


GT

GT  Greater (language IL)

See Greater


HALT

HALT  Stop a task

Syntax

HALT(<Task>, <Synchro>)

Accepted type

<Task> : tGroup
<Synchro> : UDINT

Description

This instruction is used to stop a running task or a suspended task.
<Task> : task name
<Synchro> allows defining the stopping of Timer task:

  • 0 for an immediate stopping

  • 1 for a stopping at the end of the task cycle

Remarks

This function has no effect on a task already stopped.
It does not affect current movements or the movements buffers.


HOME

HOME  Home

Syntax

HOME(<Axis>, <Type>)

Accepted type

<Axis> : tPeripheral
<Type> : SINT

Description

Home allows the system to determine the origin measure of the axis, this one being lost with each power supply cut-off.

The home machine (P.O.M) makes possible to reference the motor position with regard to the mechanics position.

Different types of POM are available: immediate, on sensor, with release.

A cycle of POM forces the counter of motor position to a Zero Program value.

<Axis> : axis name

<Type> :

  • -1 : Type of origin home setup in the profile

  • 0 : Immediate  the axis goes back to its value Zero Program

  • 1 : On TOP Z
    The motor does not carry out any movement but its position is recomputed with regard to Top Z motor and the value ` Zero Program'.
    We obtain a position being located between +/- ½ tour or reference +/- ½ tour motor.

  • 2 : On sensor, in positive direction +, without release
    The driver then launches an infinite movement in positive direction and waits for a rising edge on the input HOME to force the position at the value Zero Program and the motor will stop at this position.
    The position is then forced with the value ` Zero Program' and the motor stops on this position.

  • 3 : On sensor, in positive direction +, with release
    If the input HOME is already to 1 then the driver first launches an infinite movement in negative direction - to emerge from the sensor HOME.

  • 4 : On sensor, in negative direction -, without release
    The driver then launches an infinite movement in positive direction and waits for a rising edge on the input HOME to force the position at the value Zero Program and the motor will stop at this position.

  • 5 : On sensor, in negative direction -, with release
    If the input HOME is already to 1 then the driver first launches an infinite movement in positive direction + to emerge from the sensor HOME.
    The driver then launches an infinite movement in positive direction and waits for a rising edge on the input HOME to force the position at the value Zero Program and the motor will stop at this position.

  • 6 : On sensor and TOP Z, in positive direction +, without release
    The driver then launches an infinite movement in positive direction and waits for a rising edge on the input HOME and the passage via the TOP Z motor.
    The position is then forced at the value Zero Program and the motor will stop on this position.

  • 7 : on sensor and TOP Z, in positive direction +, with release
    If the entry HOME is already to 1 then the driver first launches an infinite movement in negative direction - to emerge from the sensor HOME.
    The driver then launches an infinite movement in positive direction and waits for a rising edge on the input HOME and the passage via the TOP Z motor.
    The position is then forced at the value Zero Program and the motor will stop on this position.

  • 8 : On sensor and TOP Z, in negative direction , without release
    The driver launches an infinite movement in negative position and waits for a rising edge on the input HOME and the passage via the TOP Z motor.
    The position is then forced at the value Zero Program and the motor will stop on this position.

  • 9 : On sensor and TOP Z, in negative direction -, with release
    If the entry HOME is already to 1 then the driver first launches an infinite movement in positive direction + to emerge from the sensor HOME.
    The driver launches an infinite movement in negative position and waits for a rising edge on the input HOME and the passage via the TOP Z motor.
    The position is then forced at the value Zero Program and the motor will stop on this position.

  • 10 : Initialize the position of the axis with the absolute position (only in SinCos ou SSI mode otherwise initialization to 0)

  • 11 : Clear following error

Remark

This function HOME locks the task as long as the home is not finished. A home takes into account:

  • The home position (zero Program)

  • The home velocity (parameter) 2740h 02h (_IMD_HOME_VELOCITY parameter)

  • The acceleration and the deceleration in process on axis

These movements do not modify the current velocity of the axis.

Example ST

HOME(Axis_X,0); (*Immediate home *)

See also

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


HOME_S

HOME_S  Home state

Syntax

<Q> := HOME_S (<Axis>)

Accepted type

<Axis> : tPeripheral

Description

This function indicates the home state
<Axis> : axis name

Remark

This function is used to know if the home has already been successfully executed.
During a home cycle, HOME_S is forced in 0.
When the home cycle is finished, HOME_S becomes 1.

Example ST

WAIT (HOME_S=1);

See also

HOME

HOMECANCEL

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


HOMEAUX

HOMEAUX  Home on the auxiliary

Syntax

HOMEAUX(<Axis>, <Type>)

Accepted type

<Axis> : tPeripheral
<Type> : SINT

Description

This function makes possible to have a home on the auxiliary of an axis
<Axis> : axis name
<Type>:

  • 0 : immediate  the auxiliary returns to its value Zero Program

  • 1 : On Top Z The function waits for the top Z on the auxiliary input).

  • 2 : On sensor (the function is waiting for an input edge on the sensor Home)

  • 3 : On sensor and Top Z (the function is waiting for an input edge on the sensor Home and a top Z on the auxiliary sensor)

  • 4 : Initialize the position of the auxiliary with the absolute position (only with SinCos or SSI otherwise initialization to 0)

Remark

The function HOMEAUX is blocking till the home is executed.

Example ST

HOMEAUX(Axe_X,0); (*Immediate home on the auxiliary*)

See also

HOME

HOMECANCEL

HOME_S

HOMEAUXCANCEL

HOMEAUX_S


HOMEAUX_S

HOMEAUX_S  Home state on the auxiliary

Syntax

<Q> := HOMEAUX_S (<Axis>)

Accepted type

<Axis> : tPeripheral

Description

This function indicates the home state on the auxiliary
<Axis> : axis name

Remark

This function is used to know if the home has already been successfully completed or not on the auxiliary. During a home cycle, the HOMEAUX_S flag is forced to 0.

When the home cycle is finished, HOMEAUX_S becomes 1.

Example ST

WAIT (HOMEAUX_S=1);

See also

HOME

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUXCANCEL


HOMEAUXCANCEL

HOMEAUXCANCEL  Cancel the origin plug on the auxiliary

Syntax

HOMEAUXCANCEL(<Axis>)

Accepted type

<Axis> : tPeripheral

Description

This function allows cancelling an origin plug in process on the auxiliary.
<Axis> : axis name

Remark

This function is used in another task than the one which contains the function HOMEAUX

See also

HOME

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUX_S


HOMEAUXREQUEST_S

HOMEAUXREQUEST_S  State of Home auxiliary request

Syntax

<Q> := HOMEAUXREQUEST_S (<Axis>)

Accepted types

<Axis> : tPeripheral
<Q> : BOOL

Description

This function indicates a HOMEAUX is executing on auxiliary.
<Axis> : axis name

Remarque

During a homing cycle the HOMEAUXREQUEST_S flag becomes 1.
When the cycle is complete the HOMEAUXREQUEST_S becomes 0.

Example ST

STTHAUX (Axis_s,0);
WAIT (HOMEAUXREQUEST_S (Axis_X) =0);

See also

HOME

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


HOMECANCEL

HOMECANCEL  Cancel the origin plug

Syntax

HOMECANCEL(<Axis>)

Accepted type

<Axis> : tPeripheral

Description

This function allows cancelling an origin plug in process.
<Axis> : axis name

Remark

This function is used in a task which is different from the one containing the function HOME.

See also

HOME

HOME_S

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


HOMEREQUEST_S

HOMEREQUEST_S  Home request state

Syntax

<Q> := HOMEREQUEST_S (<Axis>)

Accepted type

<Axis> : tPeripheral
<Q> : BOOL

Description

This function indicates HOME is executing on axis.
<Axis> : axis name

Remark

During a home cycle, the indicator HOMEREQUEST_S is put at 1.
As soon as the cycle is completely finished, HOMEREQUEST_S is 0.

Example

STTH (Axis_s,0);
WAIT (HOMEREQUEST_S(Axis_X)=0);

See also

HOME

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


ICORRECTION

ICORRECTION  Function of correction

Syntax

ICORRECTION (<Slave>, <Master>, <Source>, <Dist.master>, <Dist.slave>, <Dist. accel>)

Units

< Dist.master >, < Dist.slave > : user unit (Ex : mm, degree,)
<Dist.accel> : user unit/s²

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
< Dist.master >, < Dist.slave >, <Dist.accel> : REAL

Description

This function applies a correction movement on a slave axis during a distance of master axis.
The slave must be linked to a master by a gear box function (GEARBOX), of synchronized movement (MOVS) or cam (CAM) before the execution of the correction instruction. With the normal synchronized movement of the slave axis, the next movement is superposed: During the distance of the master axis, a movement <Dist.slave> is added with an acceleration and a deceleration on a master distance of <Dist accel>.

The functions STOP et STOPS allow stopping the correction
<Slave>, <Master> : axis names
<Source> : select the master source

Remarks

The function is not taken into account if a correction is already running
The function is blocking if the buffer of movement is full.

See also

CORRECTION_S

ICORRECTIONA


ICORRECTION_S

ICORRECTION_S  Status of the correction

Syntax

<Q> := CORRECTION_S (<Axis>)

Accepted types

<Axis> : tPeripheral

<Q> : BOOL

Description

This function allows knowing the status of the running correction: return 1 if ICORRECTION is running else return 0.
<Axis> : axis name

See also

ICORRECTION

ICORRECTIONA


ICORRECTIONA

ICORRECTIONA  Function of correction

Syntax

ICORRECTION(<Slave>, <Master>, <Source>, <Dist.master>, <Dist.slave>,)

Units

<Dist.master>, < Dist.slave > : user unit (Ex : mm, degree,)

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
< Dist.master >, < Dist.slave > : REAL

Description

This function allows to calculate and apply the corrections to be done in order to be placed at the point ad hoc.
The slave will have to be previously linked to a master by a gear box function (GEARBOX), of a synchronized movement (MOVS) or cam (CAM) before the execution of a correction. With the synchronized movement of the slave axis, we superpose the necessary movements to get the master position = <Dist.master> and the slave position <Dist.slave>.
The functions STOP et STOPS allow stopping the correction
<Slave>, <Master> : axis names
<Source> : select the master source

Remark

This function holds account of the current values of SLAVEOFFSET and MASTEROFFSET.
The function is blocking if the buffer of movement is full.
An ICORRECTIONA is applied as MASTEROFFSET or SLAVEOFFSET function (subjected to the same rules on stop of the movement ...)
A MOVS + ICORRECTIONA sequence will produce no physical shift (at the application of the ICORRECTIONA, because there is no more movement in the buffer).
A sequence ICORRECTIONA + MOVS will produce no physical shift (at the application of the ICORRECTIONA, because the MOVS is not yet in the buffer of movement).
A sequence MIOVS + ICORRECTIONA + MOVS will produce the desired effect.

Example

WHILE (NOT Fin_Mvt)
MOVS(Axe_X,Axe_Y, SRC_AXE,100.0,50.0,0.0,.0.0) ;
MOVS(Axe_X,Axe_Y, SRC_AXE,200.0,250.0,0.0,.0.0) ;
MOVS(Axe_X,Axe_Y, SRC_AXE,60.0,60.0,0.0,.0.0) ;
(* Automatic readjustment because of risk of waste point with not finished ratios *)
ICORRECTIONA(Axe_X,Axe_Y, SRC_AXE,360.0,360.0) ;
END_WHILE ;

See also

CORRECTION_S

ICORRECTION


IF

IF THEN ELSE ELSIF END_IF

Syntax

IF <expression BOOL> THEN
<instructions>
ELSIF <expression BOOL> THEN
<instructions>
ELSE
<instructions>
END_IF;

Accepted types

<Expression> : BOOL

Description

The instruction IF is only used in ST.The execution of the instructions is governed by the value of the boolean expression. The instructions ELSIF and ELSE are optional. It is possible to get several instructions ELSIF.

Example ST

(* simple condition *)
IF bCond THEN
 Q1 := IN1;
 Q2 := TRUE;
END_IF;

(* binary selection *)

IF bCond THEN
 Q1 := IN1;
 Q2 := TRUE;
ELSE
 Q1 := IN2;
 Q2 := FALSE;
END_IF;

(* enumerated conditions *)

IF bCond1 THEN
 Q1 := IN1;
ELSIF bCond2 THEN
 Q1 := IN2;
ELSIF bCond3 THEN
 Q1 := IN3;
ELSE
 Q1 := IN4;
END_IF;

See also

CASE

WHILE

REPEAT

FOR

EXIT


INIT_S

INIT_S  Returns the initialization task status

Syntax

<Q> := INIT_S ( )

Accepted type

<Q> : USINT

Description

This function returns the initialization task status:

  • 1 if the task is in progress

  • 0 if the task is stopped

Remark

This function allows in a system task to treat the particular case of initialization (to avoid starting again in loop the initialization task).


INITGETCONTEXT

INITGETCONTEXT  Returns the initialization task context

Syntax

<Q> := INITGETCONTEXT ( )

Accepted type

<Q> : USINT

Description

This function returns the initialization task context:

  • 0 : first initialization (called at the time of RUN of the global sequencer)

  • 1 : reinitialization (called by the user) ( RESTART(1); )


INITSETRESULT

INITSETRESULT  Forces the return value of the initialization task

Syntax

INITSETRESULT ( <EN> )

Accepted type

<EN> : USINT

Description

This function forces the result of the initialization task return:

  • 0 : OK

  • 1 : error no sent result (value per default)

  • 2-255 : specific error, returned as it is on the display (error 64-xx)

Remark

An initialization task must imperatively call this function.


INP

INP  Reading of an TOR input

Syntax

<Q> := INP (<input>)

Accepted types

<Input> : tIOBitIn
<Q> : BOOL

Description

This function gives the state of a TOR input.
<Input> : BOOL input name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_Input_MPC_1 := INP(Input_MPC_1) ;

See also

INPB

INPW


INPB

INPB  Reading of a block of 8 inputs

Syntax

<Q> := INPB (<Inputs>)

Accepted types

<Inputs> : tIOByteIn
<Q> : BYTE

Description

This function returns the state of a block of 8 inputs TOR.
<Inputs> : BYTE input name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_Input_MPC_1a8 := INPB(Input_MPC_1a8) ;

See also

INP

INPW


INPW

INPW  Reading of a 16 inputs block

Syntax

<Q> = INPW (<Inputs>)

Accepted types

<Inputs> : tIOWordIn

<Q> : WORD

Description

This function returns the state of a block of 16 inputs TOR.
<Inputs>: WORD input name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_Input_MPC_1a16 := INPW (Input_MPC_1a16) ;

See also

INP

INPB


INSERT

Motion Studio does not implement this function.


INT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


INTERPOLATE

Syntax

INTERPOLATE (<Axe_virt >, < Param >)

Accepted types

<Axe_virt> : tPeripheral

<Param>: tInterpolateParam

Description

This function starts an interpolation on a virtual axis following the parameters defining the geometrical model
<Axe_virt> : Virtual axis name
<Param>: Description of the geometrical model


INTERPOLATE2D

Syntax

INTERPOLATE2D (<Axe_virt >, < Axe_ X>, < Axe_ Y>)

Accepted types

<Axe_virt> : tPeripheral
< Axe_ X>, < Axe_ Y> : tPeripheral

Description

This function starts an interpolation with 2 dimensions.
<Axe_virt> : virtual axis name
< Axe_ X>, < Axe_ Y> : axies names


INTERPOLATE3D

Syntax

INTERPOLATE3D (<Axe_virt >, < Axe_ X>, < Axe_ Y>, < Axe_ Z>)

Accepted types

<Axe_virt> : tPeripheral
< Axe_ X>, < Axe_ Y>, < Axe_ Z> : tPeripheral

Description

This function starts an interpolation with 3 dimensions.
<Axe_virt> : virtual axis name
< Axe_ X>, < Axe_ Y>, < Axe_ Z> : axies names


IOFAULT_S

Syntax

<Q> := IOFAULT_S (0)

Accepted types

<Q> : BOOL

Description

This function indicates if the inputs/outputs are in overloads.

Remarks

The flag state is reset after the execution of the instruction.


JMP

JMP  Jump

Syntax

JMP label

Description

The JMP function allows jumping to a label.

Remarks

A jump to a label reroutes the execution of the program after the specified label.

The jumps and the labels are not available in ST.
In FBD, a jump is characterized by the symbol ">>" followed by the name of the destination label.
The input flow of the symbol "> >" must be connected to a Boolean variable which determines the connexion.
The jump is only executed if the input flow is TRUE.
In LD, the symbol ">>", followed by the name of a label, finishes a ladder.
The jump is executed if the flow is TRUE.
In IL, the instructions JMP, JMPC, JMPCN and JMPNC specify jumping operations.
The jump destination is the operand of the instruction.

Warning

The back jumps can create infinite loops and block the cycle.

Example FDB

(* In that example, the block TON is not called if bEnable = TRUE *)

Example LD

(* In that example, the second ladder is not evaluate if IN1 = TRUE *)

Example IL

The following instructions are available:

JMP | Absolute connexion
JMPC | Connexion if the current result = TRUE
JMPCN | Connexion if the current result = FALSE

Start: LD IN1
JMPC TheRest (* Jump to "TheRest" if IN1 = TRUE *)
LD IN2 (* these instructions are not executed *)
ST Q2 (* if IN1 = TRUE *)
JMP TheEnd (* absolute connexion to "TheEnd" *)

TheRest: LD IN3
 ST Q3

TheEnd:

See also

RETURN


JMPC

See JMP


JMPCN

See JMP


LD

See Assignation


LDN

See Assignation


LE

LE - Comparison (language IL)

See Lower or equal


LEFT

LEFT  Left part of a string

Syntax

<Q> := LEFT (<IN>, <NBC>)

Accepted types

<IN> : STRING
<NBC> : UINT
<Q> : STRING

Description

This function returns the <NBC> left part characters of a string.
<IN> is the string from where the characters are to be extracted
<NBC> is the number of characters to be extracted
<Q> is the string containing the <NBC> first characters of<IN>.

Remarks

In LD, the input flow (EN) governs the operation, and the flow remains unchanged in output.
In IL, the first input must be charged in the current result before calling the function.
The second input is the function operand.

Example ST

Q := LEFT (IN, NBC);

Example FBD

Example LD

(* The function is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 LEFT NBC
 ST Q

See also

+

MLEN

DELETE

INSERT

FIND

REPLACE

RIGHT

MID


LEN

LEN  Length of a string

Syntax

<NBC> := LEN (<IN>)

Accepted types

<IN> : STRING
<NBC> : INT

Description

This function returns the number of characters of a string.
<IN> is the characters string
<NBC> is the number of characters in the string. 0 if the string is empty

Language ST

NBC := LEN(IN);

Language FBD

Language LD

(* The function is called if EN = TRUE *)
(* ENO is equal to EN *)

Language IL

Op1: LEN IN
ST NBC

See also

+

FIND

DELETE

INSERT

REPLACE

LEFT

RIGHT

MID


LIMIT

LIMIT  Limit an entire value

Syntax

<Q> := LIMIT (<IMIN>, <IN>, <IMAX>)

Accepted types

<Q>, <IMIN>, <IN>, <IMAX> : ANY_NUM

Description

This function makes possible to limit an entire value between two limits.
<IMIN> is the lowest limit
<IN> is the input value

<IMAX> is the highest limit
<Q> is the return value : IMIN if IN < IMIN; IMAX if IN > IMAX; IN in the other cases

Remarks

In LD, the input flow (EN) governs the operation, and the flow remains unchanged in output.
In IL, the first input must be charged in the current result before calling the function.
The other inputs are the function operands, separated by a coma.

Example ST

Q := LIMIT (IMIN, IN, IMAX);

Example FDB

Example LD

(* the operation is executed if EN = TRUE *)
(* ENO is equal EN *)

Example IL

Op1: LD IMIN
LIMIT IN, IMAX
ST Q

See also

MIN

MAX

MOD

ODD


LN

LN  Logarithm to the base e

Syntax

<Q> := LN (<IN>)

Accepted types

(<IN>) : REAL
(<Q>) : REAL

Description

This function restores the natural logarithm (base e) of <IN>.
The argument <IN> must be a valid numerical expression.
The returned value is of real type.

Remark

In language IL, the input value must be charged in the current result before calling the function.

Example ST

Q :=LN (IN) ;

Example FBD

Example LD

(*The function is executed only if EN is TRUE*)
(*ENO has the same value as EN*)

Example IL

Op1: LD IN
 LN
 ST Q

See also

EXP


LOADCAM

LOADCAM  Load a cam

Syntax

LOADCAM (<Slave>,<Master>,<Source>, <Nrcam>, <Absolute>, <Reference>, <SingleShot>, <Reversible>, <PositiveDirection>, <MasterGain>, <SlaveGain>, <NrNextCam>, <NrPreviousCams>)

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
<Nrcam> : UINT
<Absolute> : BOOL
<Reference> : tCam
<SingleShot> : BOOL
<Reversible> : BOOL
<PositiveDirection> : USINT
<MasterGain> : REAL
<SlaveGain> : REAL
<NumberNextCam> : UINT
<NumberPreviousCam> : UINT

Description

This instruction loads a cam to memory
<Slave> : slave axis name
<Master> : master axis name
<Source> : allows to select the <Master> source
<Nrcam> : cam number
<Absolute> : 1 for absolute cam and 0 to relative.
<Reference> : cam name
<SingleShot> : to 1 if cam is not relooped.
<Reversible> : Indicates if the <Slave> must follow the <Master> both ways.

  • Input 0 for a non-reversible cam: if the master moves in the opposite way as the one defined in <PositiveDirection>, the slave stops. It will start off again when the master will go in the right way and reach the master position where the slave stopped.

  • Input 1 for a reversible cam: The slave follows its cam profile whatever is the master direction.

<PositiveDirection> : gearing mode.

  • 0 : Indifferent direction : embraye dans nimporte quel sens, en inversant la came pour suivre lesclave. Si on inverse le sens, le maître ET lesclave sont inversés.
    Ce mode permet également dembrayer à nimporte position dune came absolue.

  • 1 : Negative direction :
    For a relative cam : le sens des positions maître est pris dans le sens dun STTIM sur le maître. Les points esclaves sont dans le sens dun STTIP sur lesclave
    For an absolute cam : the direction of the master and slave positions are in the direction of a STTIP on the respective axes
    On embraye la came que lorsque lon rentre dans le dernier élément

  • 2 : Positive Direction :
    For a relative cam : le sens des positions maître est pris dans le sens dun STTIP sur le maître. Les points esclaves sont dans le sens dun STTIP sur lesclave
    For an absolute cam : the direction of the master and slave positions are in the direction of a STTIP on the respective axes
    On embraye la came que lorsque lon rentre dans le dernier élément

<MasterGain> : Applied cfficient to cam master position
<SlaveGain> : Applied cfficient to cam slave position
<NumberNextCam> : Input 0 if the cam must not be followed by another one.
<NumberPreviousCam>: Input 0 if the cam will not start on a previous cam


LOADCAMI

LOADCAMI  Charge une came

Syntax

LOADCAMI (<Slave>,<Master>,<Source>, <Nrcam>, <Absolute>, <Data>, <SingleShot>, <Reversible>, <PositiveDirection>, <MasterGain>, <SlaveGain>, <NrNextCam>, <NrPreviousCams>)

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
<Nrcam> : UINT
<Absolute> : BOOL
<Data> : tCamTable
<SingleShot> : BOOL
<Reversible> : BOOL
<PositiveDirection> : USINT
<MasterGain> : REAL
<SlaveGain> : REAL
<NumberNextCam> : UINT
<NumberPreviousCam> : UINT

Description

This instruction loads a cam to memory
<Slave> : slave axis name
<Master> : master axis name
<Source> : allows to select the <Master> source
<Nrcam> : cam in memory (variable)
<Absolute> : 1 for absolute cam and 0 to relative.
<Reference> : cam name
<SingleShot> : to 1 if cam is not relooped.
<Reversible> : Indicates if the <Slave> must follow the <Master> both ways.

  • Input 0 for a non-reversible cam: if the master moves in the opposite way as the one defined in <PositiveDirection>, the slave stops. It will start off again when the master will go in the right way and reach the master position where the slave stopped.

  • Input 1 for a reversible cam: The slave follows its cam profile whatever is the master direction.

<PositiveDirection> : gearing mode.

  • 0 : Indifferent direction : embraye dans nimporte quel sens, en inversant la came pour suivre lesclave. Si on inverse le sens, le maître ET lesclave sont inversés.
    Ce mode permet également dembrayer à nimporte position dune came absolue.

  • 1 : Negative direction :
    For a relative cam : le sens des positions maître est pris dans le sens dun STTIM sur le maître. Les points esclaves sont dans le sens dun STTIP sur lesclave
    For an absolute cam : the direction of the master and slave positions are in the direction of a STTIP on the respective axes
    On embraye la came que lorsque lon rentre dans le dernier élément

  • 2 : Positive Direction :
    For a relative cam : le sens des positions maître est pris dans le sens dun STTIP sur le maître. Les points esclaves sont dans le sens dun STTIP sur lesclave
    For an absolute cam : the direction of the master and slave positions are in the direction of a STTIP on the respective axes
    On embraye la came que lorsque lon rentre dans le dernier élément

<MasterGain> : Applied cfficient to cam master position
<SlaveGain> : Applied cfficient to cam slave position
<NumberNextCam> : Input 0 if the cam must not be followed by another one.
<NumberPreviousCam>: Input 0 if the cam will not start on a previous cam


LOADCAMPOINT

LOADCAMPOINT  Change points of a cam

Syntax

LOADCAMPOINT (<Nrcame >, < Nr point >, <X>, <Y>, <dX>, <dY>)

Limite

< Nrcame > from 1 to 127
< Nr point > from 1 1 to n cam points

Accepted types

<Nrcame>, <Nr point> : UINT
<X>, <Y>, <dX>, <dY> : REAL

Description

This function allows changing instantly a cam point

See also

LOADCAM


LOADTIMER

Syntax

<TEMPO> := LOADTIMER (<DELAI>)

Limit

<DELAI>: must be lower than 2^31 (about 25 days)

Accepted types

<TEMPO> : UDINT
<DELAI>: UDINT

Description

This function is used to establish active waiting (compound with TIMER).
It stores in the <TEMPO> variable, the sum of the internal variable Time + <DELAI>.

Remarks

Time is a long integer which represents the thousandths of seconds passed since the last powering.
This variable can thus be used as bases time.

Example ST

Tempo := LOADTIMER (3000) ; (* Load an 3s waiting *)

BOUCLE :
IF (TIMER (Tempo) = FALSE) THEN

GOTO BOUCLE ; (* Wait the end of delay *)

END_IF ;

See also

TIMER


LOG

LOG  Logarithm to the base 10

Syntax

<Q> := LOG (<IN>)

Accepted ypes

<Q>, <IN> :REAL

Description

This function returns the decimal logarithm (base 10) of <IN>
<IN> must be a numeric expression.
The returned value is of real type.

Remarks

In LD, the input flow (EN) governs the operation, and the flow remains unchanged in output.
In IL, the input must be charged in the current result before calling the function.

Example ST

Q := LOG (IN);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
LOG
ST Q (* Q is: LOG (IN) *)

See also

ABS

TRUNC

POW

SQRT


LT

LT - Comparison (language IL)

See Lower


MASTEROFFSET

MASTEROFFSET  Shift dynamically the master position

Syntax

MASTEROFFSET (<Slave>, <Master>, <Source>, <Offset>, <Acceleration>)

Units

<Offset> : Distance in the user unit (Ex : mm, degree,)
<Acceleration> : Acceleration in the user unit (Ex : mm/s², degree/s²,)

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
<Offset> : REAL
<Acceleration> : REAL

Description

This instruction shifts dynamically the master position.
<Slave>, <Master> : Axis name
<Source> : allows to select the <Master> source
<Offset> : Offset value to apply
<Acceleration> Acceleration used to apply the offset.

Remark

The shift is applied directly if no movement is in hand or if axis is not gearing.

This function is mainly used for absolute cam.

See also

MASTEROFFSET_S


MASTEROFFSET_S

MASTEROFFSET_S  Current value of the masteroffset

Syntax

<Q> := MASTEROFFSET_S (<Slave>, <Master>, <Source>)

Unit

<Q> : Distance in the user unit (Ex : mm, degree,)

Accepted types

<Slave>, <Master> : tPeripheral
<Source> : tSrcPos
<Q> : REAL

Description

This function returns the current value of the masteroffset.
<Slave>, <Master> : Axis name
<Source> : allows to select the <Master> source

Remark

When the current value is equal to the <Offset> value of the function MASTEROFFSET, the offset is then finished.

See also

MASTEROFFSET


MAX

MAX  Returns the maximum of two values

Syntax

<Q> = MAX (<IN1>, <IN2>)

Accepted types

<IN1>, <IN2>, <Q> : ANY_NUM

Description

This function returns the maximum of two numeric values:
If IN1> IN2 then Q = IN1 otherwise Q = IN2

Remarks

In LD, the input flow governs the operation, and the flow remains unchanged in output.
In LD and FBD languages, several functions MAX are available according to the type of data.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := MAX (IN1, IN2);

Example FBD

Example LD

(* the operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN1
 MAX IN2
 ST Q

See also

MIN

LIMIT

MOD

ODD


MERGE

MERGE  Movement merging

Syntax

MERGE (<Axis>, <MergeOn>)

Accepted types

<Axis> : tPeripheral
<MergeOn> : UINT

Description

This instruction is used to activate or disable consecutive movements merging.
<Axis> : axis name
<MergeOn> at 1 makes possible to activate the MERGE and at 0 to stop the MERGE.
The instruction MERGE acts at the moment of the entry in the part "deceleration" of a movement.
When the MERGE is active and that another movement can be connected, deceleration is not carried out and the connection is then carried out.

Remark

Merge between a fast movement and a low movement can involve a exceeding of the coast to be reached (flag POS_ERREUR_S then becomes 1).

The instructions of change of velocity profile like VEL, ACC, DEC... are taken into account with the next movement

The instruction POS does not work during a MERGE

Example ST

MERGE(Axis_X,1);
TRAJA(Axis_X,1000.0,500.0,1000.0,1000.0); (* Movements merge without *)
TRAJA(Axis_X,1500.0,200.0,1000.0,1000.0); (* crossing with a null velocity *)
MERGE(Axis_X,0);
TRAJA(Axis_X,1800.0,700.0,1000.0,1000.0); (* crossing with a null velocity at the position 1500 *)


MID

Motion Studio does not implement this function.


MIN

MIN  Returns the minimum of two values

Syntax

<Q> := MIN (<IN1>, <IN2>)

Accepted types

<IN1>, <IN2>, <Q> : ANY_NUM

Description

This function returns the minimum of two numeric values:
If IN1< IN2 then Q = IN1 otherwise Q = IN2

Remarks

In LD, the input flow governs the operation, and the flow remains unchanged in output.
In LD and FBD language, several functions MIN are available according to the type of data.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := MIN (IN1, IN2);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal EN *)

Example IL

Op1: LD IN1
 MIN IN2
 ST Q

See also

MAX

LIMIT

MOD

ODD


MOD

MOD  Division (language IL)

Syntax

<Q> := MOD (<IN1>, <IN2>)

Accepted types

<Q>, <IN1>, <IN2> : ANY_INT

Description

This function allows to divide the value of the first operand by the value of the second operand and to leave the remainder of the division (modulo) as result.

Example ST

Div : LD A (*C=1 for A=7 et B=2*)
 MOD B (*C=(-1) for A=7 et B=(-2)*)
 ST C (*C=(-1) for A=(-7) et B=2*)
 (*C=1 for A=(-7) et B=(-2)*)


MOVA

MOVA  Absolute movement

Syntax

MOVA (<Axis>, <Distance>)

Unit

<Distance> : user unit (Ex : mm, degree,)

Accepted types

<Axis> : tPeripheral
<Distance> : REAL

Description

This function allows moving the axis to an absolute position.
The execution of this instruction passed the execution of the next task.
The system waits for the end movement (Condition MOVE_S(Axe)=0) before executing the next instruction
The axes use the current speed, acceleration and deceleration values.
<Axis> : axis name

Example ST

MOVA(Axis_X, 1200.0);

See also

MOVR

STTA

STTR

STTIP

STTIM

MOVE_S


MOVE

See Assignation


MOVE_S

MOVE_S  movement status

Syntax

<Q> = MOVE_S (<Axis>)

Accepted types

<Axis> : tPeripheral
<Q> : BOOL

Description

This function indicates if the axis is moving (simple or synchronized movement).
<Axis> : axis name
If the axis is open loop (AXIS OFF), the instruction MOVE_S = 0.
If the axis is closed loop, MOVE_S is equal to 0 if the 4 following points are true:

  • The current positioning movement (STTA,TRAJ) is complete. (Theoretic trajectory is finished).

  • The following error is inside the positioning window (+/- the input value in the menu Parameters/Securities/Position)

  • The buffer of movement is empty (STTA, TRAJ).

  • In case of a slave axis linked with a CAM or GEARBOX function, the link will have to be cut

If one of this point is false, the instruction MOVE_S(Axis) returns a value of 1.

Example ST

STTA (Axis_X, 100.0);
WAIT (MOVE_S (Axis_X) = 0) ; (* Wait the axis is stopped *)


MOVR

MOVR  Relative movement

Syntax

MOVR (<Axis>, <Distance>)

Unit

<Distance> : unit user (Ex : mm, degree,)

Accepted Types

<Axis> : tPeripheral
<Distance> : REAL

Description

This instruction moves the axis to a relative position.
The execution of this instruction launches the execution of the next task.
The task waits for the movement end (condition MOVE_S=0) before executing the next instruction.
The axis uses the current velocity, acceleration and deceleration values.
<Axis> : axis name

Example

MOVR (Axis_X, 1200.0);

See also

MOVA

STTA

STTR

STTIP

STTIM

MOVE_S


MOVS

MOVS  Synchronised movement

Syntaxe

MOVS( <SlaveAxis>,<MasterAxis>,<MasterSource>, <MasterDistance>, <SlaveDistance>, <AccelerationDistance>, <DecelerationDistance>)

Units

<MasterDistance>, <SlaveDistance> : user unit (Ex : mm, degree,)
<AccelerationDistance>, <DecelerationDistance> : user unit (Ex : mm, degree,)

Accepted types

<SlaveAxis>,<MasterAxis> : tPeripheral
<MasterSource> : tSrcPos
<MasterDistance>, <SlaveDistance>, <AccelerationDistance>, <DecelerationDistance> : REAL

Description

This instruction is used to link a slave axis to a master axis during a certain distance of the master axis with acceleration and deceleration phases on the slave axis.

If the buffer of movement is full, the task is blocked up to a place is liberated.
<SlaveAxis>, <MasterAxis> : Axis name
<Source> : allows to select the <Master> source
The <AccelerationDistance> and <DecelerationDistance> are expressed in distance on the master axis and can be zero.

Example ST

(*Flying shear *)

ORDER(Axis_X,0); (*initialise the n°+1 of next movement sent in the buffer *)
MOVS(Axis_X, Axis_Y, SRC_AXIS, 0.8, 0.4, 0.8, 0.0); (* Acceleration movement 1 *)
MOVS(Axis_X, Axis_Y, SRC_AXIS, 0.2, 0.2, 0.0, 0.0); (*Synchro phase movement 2 *)
MOVS(Axis_X, Axis_Y, SRC_AXIS, 0.8, 0.4, 0.0, 0.8); (* Deceleration movement 3 *)
MOVS(Axis_X, Axis_Y, SRC_AXIS, 0.8, 0.2, -1.0, 0.5); (*Back movement 4 *)
WAIT (ORDER_S(Axis_X)>=2); (*Wait for the execution end of movement 2 *)
OUT(Cutter,1); (*Activation of cutter *)
WAIT (ORDER_S(Axis_X)>=3); (*Wait for the execution of movement 3 *)
OUT(Cutter,0); (*Stop the cutter *)

See also

CAM

CAMBOX

GEARBOX


MUL

MUL  Multiplication (language IL)

See Multiplication


MUX

Motion Studio does not implement this function.


NE

NE - Comparison (language IL)

See Different


NEXTTASK

Syntax

NEXTTASK (0)

Description

This instruction allows going immediately towards the next task.


NEG

NEG  Negation (language IL)

See Negation


NOT

NOT  Complement operator

Syntax

<Q> = NOT <IN>

Accepted types

<IN> : ANY_BIT

Description

This function makes a logical inversion of the input.

Remark

NOT is defined by the norm IEC61131-3.

Example ST

Q := IN;

Example FBD

(* use of the block "NOT" *)
(* connexion with inversion: Q = IN1 AND NOT IN2 *)

Example LD

(*inverse contact: Q = IN1 AND NOT IN2 *)

(* inverse winding: Q = NOT (IN1 AND IN2) *)

Example IL

Op1: LDN IN1
 OR IN2
 ST Q (* Q = (NOT IN1) OR IN2 *)

Op2: LD IN1
 AND IN2
 STN Q (* Q = NOT (IN1 AND IN2) *)

See also

OR

XOR

AND


OF

See CASE


OR

OR  Operator OU

Syntax

<Q> = <IN1> OR <IN2>

Accepted types

<IN1> : ANY_BIT
<IN2> : ANY_BIT
<Q> : ANY_BIT

Description

This function makes a binary OR between two expressions and returns a value of the operands type.
<IN1> and <IN2> must be of the same type.

Remark

OR is defined by the norm IEC61131-3.

Example ST

Q := IN1 OR IN2;
Q := IN1 OR IN2 OR IN3;

Example FBD

Example LD

(* contacts in parallel *)

Example IL

Op1: LD IN1
 OR IN2
 ST Q (* Q = IN1 OR IN2 *)

Op2: LD IN1
 ORN IN2
 ST Q (* Q = IN1 OR (NOT IN2) *)

See also

AND

XOR

NOT


ORDER - Numéro d'ordre du mouvement

ORDER  Movement order number

Syntax

ORDER (<Axis>, <Expression> )

Accepted Types

<Axis> : tPeripheral
<Expression>: UDINT

Description

This instruction fixes the order number of the next movement to <Expression> +1.
<Axis> : axis name

Remark

This instruction can be used with the ORDER_S function.
At initialization, an ORDER (0) is carried out.

Example ST

ORDER (Axis_X, 0);
MOVS (Axis_X, Axis_Y, SRC_AXIS, 50.0, 100.0, 10.0, 10.0) ;
NumMouv := ORDER_S(Axis_X); (* 'Result : NumMouv=1 *)

See also

ORDER_S


ORDER_S - Numéro d'ordre courant

ORDER_S  Current order number

Syntax

<Q> := ORDER_S (<Axis>)

Accepted types

<Axis> : tPeripheral
<Q> : UDINT

Description

This instruction returns the order number of the movement in the course of execution.
<Axis> : axis name

Remark

This instruction can be used with the function ORDER.

Example ST

ORDER (Axis_X, 0);
MOVS (Axis_X, Axis_Y,SRC_AXIS, 50.0,100.0,10.0,10.0) ;
NumMouv := ORDER_S(Axis_X); (* 'Result : NumMouv=1 *)

See also

ORDER


ORDER_T

ORDER_T  Last movement order number

Syntax

<Q> : = ORDER_T (<Axis>)

Accepted types

<Axis> : tPeripheral
<Q> : UDINT

Description

This function returns the order number of the last movement put in the movement buffer.

<Axis> : axis name

See also

ORDER_S


ORN

ORN  Operator OR with inverted input 2

See OR with the inverted input 2


OUTP

OUTP  Output writing

Syntax

OUTP (<Output>, <Expression>)

Accepted types

<Output> : tIOBitOut
<Expression> : BOOL

Description

This function changes the logical state of a TOR output.
<Output> : BOOL output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

OUTP (Output_MPC_1, 1) ;

See also

INP

INPB

INPW

OUTB

OUTW


OUTP_S

OUTP_S  Output reading

Syntax

<Q> := OUT_S (<Output>)

Accepted types

< Output > : tIOBitOut
<Q> : BOOL

Description

This function returns the state of an TOR output.
<Output> : BOOL output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_Output_MPC_1 := OUTP_S(Output _MPC_1) ;

See also

OUTB

OUTW


OUTB

OUTB  Writing of a 8 outputs block

Syntax

OUTB (<Outputs>, <Expression>)

Accepted types

<Outputs> : tIOByteOut
<Expression> : BYTE

Description

This function changes the logical states to a block of 8 TOR outputs.
<Output> : BYTE output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

OUTB (Output_MPC_1a8, 32) ;

See also

INP

INPB

INPW

OUTP

OUTW


OUTB_S

OUTB_S  Reading of a 8 outputs block

Syntax

<Q> := OUTB_S (<Outputs>)

Accepted types

< Outputs > : tIOByteOut
<Q> : BYTE

Description

This function returns the state of a block of 8 TOR outputs.
<Output> : BYTE output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_ Outputs _MPC_1a8 := OUTB_S(Outputs _MPC_1a8) ;

See also

OUTP

OUTW


OUTW

OUTW  Writing of a 16 outputs block

Syntax

OUTB (<Outputs>, <Expression>)

Accepted types

<Outputs> : tIOWordOut
<Expression> : WORD

Description

This function changes the logical states to a block of 16 TOR outputs.
<Output> : WORD output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

OUTB (Output_MPC_1a16, 2756) ;

See also

INP

INPB

INPW

OUTP

OUTB


OUTW_S

OUTW_S  Reading of a 16 outputs block

Syntax

<Q> := INPW (<Outputs>)

Accepted types

< Outputs > : tIOWordOut
<Q> : WORD

Description

This function returns the state of a block of 16 TOR outputs.
<Output> : WORD output name

Remark

This function must to be use in a task with direct I/O handle.

Example ST

State_ Outputs _MPC_1a16 := OUTW_S( Outputs _MPC_1a16) ;

See also

OUTP_S

OUTB_S


POS

POS  Target position

Syntax

POS(<Axis>, <Expression>)

Unit

<Expression> : user unit (Ex : mm, degree,)

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function sets the target position in the chosen unit.
This function is used to change the final position of the current motion.
The position can be modified at any time.
<Axis> : axis name

Remark

The execution of POS during a MOVA, changes the absolute final position
The execution of POS during a MOVR, changes the movement in MOVA
The execution of POS during a STTM or STTP, changes the movement in MOVA
The bad utilisation of POS can involve an excess of the coast to reach (the flag POS_ERROR_S then goes to 1).

Example ST

STTA(Axis_X, 5000.0); (* Start of the axis *)
WAIT (INP(Cell,1); (* Wait for the cell *)
POS(Axis_X)=POS_S(Axis_X)+50; (* STOP 50 mm after the sensor *)
WAIT (NOT (MOVE_S(Axis_X))); (* Wait for the axis stop *)

See also

ACC

DEC

VEL


POS_S

POS_S  Real Position

Syntax

<Expression> := POS_S(<Axis>)

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function returns the real position of the axis
Thus; we can obtain the image of the axis position in real time.
<Axis> : axis name

Example

STTA (Axis_X, 100.0); (* Axis start *)
WAIT (POS_S(Axis_X)>50.0)); (* Waiting for a position > 50 *)
OUTP (Verin,1) ;

See also

VEL_S


POS_T

POS_T  Target Position

Syntax

<Expression> := POS_T(<Axis>)

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function returns the target position by the axis movement on hand:
For an axis modulo, the function returns the target position in the modulo (ex: POS -5.1 with modulo of 1.0 = >re turns 0.9).

For a movement MOVA/STTA, the function returns the position of destination of the MOVA.
For a movement MOVR/STTR, the function returns the absolute position of destination.
For a movement STTIM/STTIP, the position is not updated in POS_T.
For a movement POS, the position is updated with the value POS.
For an STOP/SSTOP order or urgent deceleration, the function returns the stop position system.
For the other movement instructions, the target position is not updated.
<Axis> : axis name

See also

POS_S


POSAUX_S

POSAUX_S  Auxiliary real Position

Syntax

<Expression> := POSAUX_S (<Axis>)

Accepted types

<Axis> : tPeripheral
<Expression>: REAL

Description

This function returns the auxiliary position of the axis.
Thus, we can obtain the image of the axis auxiliary position in real time.
<Axis> : axis name

See

POS_S


POSERROR_S

POSERROR_S  Indicates an error of movement

Syntax

<Q> := POSERROR_S (<Axis>)

Accepted types

<Axis> : tPeripheral
<Q> : USINT

Description

This function indicates that a movement was not generable (ex reduction in slope of deceleration during deceleration, stop position exceeded for a POS...).
The generator of trajectory could not respect the required movement.
<Axis> : axis name


R Reset langage IL

R  Force a boolean variable to FALSE

Syntax

<Q> := R (<Reset>)

Accepted types

<Reset> : BOOL
<Q> : BOOL

Description

This function allows forcing a Boolean variable to FALSE.

Remarks

The operators S and R are available in IL.
In LD, They are represented by the windings (S) and (R).
In FBD, you can also use the windings (S) and (R), but the blocks RS and SR are also available.
The operations S and R do not have direct equivalence in ST.

Example ST

Not available

Example FBD

Use the functional blocks RS and SR

Example LD

(* example of utilisation of a winding "R" *)

Example IL

Op1: LD Reset
R Q (* Q is forced to FALSE if RESET = TRUE *)
(* no action if RESET = FALSE *)

See also

S

RS

SR


R_TRIG

R_TRIG  Detection of rising edge

Syntax

R_TRIG (<CLK>)
R_TRIG.Q

Accepted types

<CLK> : BOOL
<Q> : BOOL

Description

The function block ´R_TRIG´ detects the status of the input operand ´CLK´.
The status change from ´0´ to ´1´ in a processing cycle is detected and indicated in the next cycle by the activation of ´Q´.
The output is ´1´ during the processing cycle in which the change of the status of ´CLK´ is detected and a rising edge is indicated.

Example ST

(* R_TRIG1 is a declared request of block R_TRIG *)
R_TRIG1(CLK:=IN_BOOL);
Q_BOOL:=R_TRIG1.Q;

Example FBD

Example LD

Example IL

(* F_TRIG is a declared request of block F_TRIG *)
Op1: CAL R_TRIG1 (CLK:=IN_BOOL)
LD R_TRIG1.Q
ST Q_BOOL

See also

F_TRIG


RAMOK_S

Syntax

<Q> := RAMOK_S (0)

Accepted types

<Q> : USINT

Description

This function indicates the state of BBM memory (RAM) at the starting of the MPC:

  • 0 : indicates that the configuration was incorrect with at starting (thus if one is now carrying out the tasks, it has being reloaded).

  • 1 : indicate that the configuration in BBM was correct with starting (on the other hand there can be peripherals which are not present on the bus Ethercat.

  • 2 : indicate that the configuration was restored.

See also

RAMTOFLASH

CLEARFLASH


RAMTOFLASH

Syntax

RAMTOFLASH (0)

Description

This function copies contained BBM memory (RAM) in the FLASH memory of the MPC

See also

CLEARFLASH

FLASHOK_S


READCAM

READCAM  Load a cam in a schedule

Syntax

<CamTable> = READCAM (<Cam>)

Accepted types

<Cam> : tCam
<CamTable> : tCamTable

Description

This function loads a cam in a cam schedule, what allows modifying it.
<CamTable> cam table (variables table who can be modified)
<Cam> cam name (saved in CF-CARD)

See also

WRITECAM


REAL

See elementary data types

Notes

This data type is defined by the IEC61131-3.


REALTOFIX

Syntax

<Q> := REALTOFIX (<IN>, <PREC>, <INV>)

Accepted type

<IN> : REAL
<PREC> : USINT
<INV> : BOOL

Description

This function converts a real into a fix decimal number (udint) with the indicated precision.

Description

<PREC> is the precision of a decimal number.
<INV> at TRUE: allows reversed strong weight (16bits) and the weak weight (16bits) from the result of REALTOFIX.

Langage ST

Value := REALTOFIX (1.23, 2, 0); (* Value = 123 *)


REG_S

REG_S  Capture status

Syntax

<Q> := REG_S (<Number>)

Accepted types

<Number> : UINT(between 0 and 127)
<Q> : BOOL

Description

This function indicates if a position capture has taken place.
The returned value is only true once per capture.
REG_S is automatically reset to 0 when it is read.
On re-launching another capture and if REG_S is 1 then REG1_S is 0.

Example ST

(*Real capture motor position on the rising edge of input 4 of MPC when the axis is between 10 and 20. *)
CAPTURE (1, Axis_X, SRC_AXIS, Mpc_4, 1, W_NONE , 10.0, 20.0);
WAIT (REG_S(1) = 1); (* Wait for a capture *)
Position:= REGPOS_S(1); (* Position = value of the capture position *)

See also

CAPTURE

REGPOS_S

CAPTUREIMD

CAPTURECANCEL


REGPOS_S

REGPOS_S  Capture value

Syntax

<Q> := REGPOS_S (<Number>)

Accepted types

<Number> : UINT (between 0 and 127)
<Q> : BOOL

Description

This function returns the last position captured for this register by execution of the instruction CAPTURE.

Example ST

(* Real capture motor position on rising edge of the input 4 of MPC when the axis is between 10 and 20. *)
CAPTURE (1, Axis_X, SRC_AXIS, Mpc_4, 1, W_NONE , 10.0, 20.0);
WAIT (REG_S(1) = 1); (* Wait for a capture *)
Position:= REGPOS_S(1); (* Position = value of the capture position *)

See also

CAPTURE

REG_S

CAPTUREIMD

CAPTURECANCEL


REPEAT

REPEAT  Loop REPEAT

Syntax

REPEAT
<instructions>
UNTIL <expression>
END_REPEAT;

Accepted types

<Expression>: BOOL

Description

The instructions between "REPEAT" and "UNTIL" are executed as long as the Boolean expression value is TRUE.
The condition is evaluated after the execution of the instructions.
The instructions are executed at least once.

Remarks

The loop instructions might block the cycle in an infinite loop.

Example ST

iPos := 0;
REPEAT
 MyArray[iPos] := 0;
 iNbCleared := iNbCleared + 1;
 iPos := iPos + 1;
UNTIL iPos = iMax
END_REPEAT;

Example FBD

Not available

Example LD

Not available

Example IL

Not available

See also

IF

WHILE

FOR

CASE

EXIT


REPLACE

Motion Studio does not apply the REPLACE function.


RESTART

RESTART  Restart system

Syntax

RESTART (<Type>)

Accepted type

<Type>: USINT

Description

This function restarts the system.
<Type>: at 0 restarts the MPC as an electric restart, at 1 stops the tasks, causes the reinitialisation of Ethercat and the restarting of the tasks.


RESTART_S

RESTART_S  Returns the reason of the last restart

Syntax

<Q> := RESTART_S (0)

Accepted type

<Q> : USINT

Description

This function returns the reason of the last restart:

  • 0 following to a switch on or RESTART(0).

  • 1 if manual restart of the tasks.

  • 2 if restart by RESTART(1).


RET

See RETURN


RETC

See RETURN


RETCN

See RETURN


RETURN

RETURN  Skip at the end of the program

Syntax

RETURN

Description

This instruction "RETURN" indicates a skip at the end of the program.

In FBD and in LD, the symbol "<RET>" is available. The skip is conditioned by the left bolean flow.

In IL, the instructions RET, RETC et RETCN can be used.

When it is used in a stage action SFC, instruction RETURN corresponds to a skip towards the end of the action block.

Example ST

IF NOT bEnable THEN
 RETURN;
END_IF;
(*the remainder of the program is ignored if bEnabled = FALSE... *)

Example FBD

(* In that example, the TON block is not evaluated if bIgnore = TRUE *)

Example LD

(* The second ladder is not evaluated if ENABLE = FALSE *)

Example IL

Available instructions:
RET Unconditional skip
RETC Skip if the current result is TRUE
RETCN Skip if the current result is FALSE

Start: LD IN1
RETC (* skip at the end if IN1 = TRUE *)
LD IN2 (* instructions non executed... *)
ST .Q2 (* ...if IN1 = TRUE *)
RET (* unconditional skip *)
LD IN3 (* instructions never executed *)
ST Q3


RIGHT

RIGHT  Right part of a string

Syntax

<Q> := RIGHT (<IN>, <NBC>)

Accepted types

<IN> : STRING
<NBC> : UINT
<Q> : STRING

Description

This function returns the <NBC> right characters of a string.
<IN> is the string from where the characters are to be extracted
<NBC> is the number of characters to be extracted
<Q> is the string containing the <NBC> first characters of <IN>.

Remarks

In LD, the input flow (EN) governs the operation, and the flow remains unchanged in output.
In IL, the first input must be charged in the current result before calling the function.
The second input is the function operand.

Example ST

Q := RIGHT (IN, NBC);

Example FBD

Example LD

(* The function is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 RIGHT NBC
 ST Q

See also

+

MLEN

DELETE

INSERT

FIND

REPLACE

LEFT

MID


ROL

ROL  Rotation of bits on the left

Syntax

<Q> := ROL ( <IN>, <NBR> )

Accepted types

<IN>, <Q> : ANY_BIT
<NBR> : UNIT

Description

This function allows rotating on the left of bits of a variable of type ANY_BIT.

Remarks

In LD and FBD language, several functions ROL are available according to the type of data.
In LD, the input flow governs the operation, and the flow remains unchanged in output.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := ROL (IN, NBR);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 ROL NBR
ST Q

See also

ROR

SHL

SHR


ROR

ROR  Rotation of bits on the right

Syntax

<Q> := ROR (<IN>, <NBR>)

Accepted types

<IN>, <Q> : ANY_BIT
<NBR> : UNIT

Description

This function allows rotating on the right bits of an operand of type ANY_BIT.

Remarks

In LD and FBD language, several functions ROR are available according to the type of data.
In LD, the input flow governs the operation, and the flow remains unchanged in output.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := ROR (IN, NBR);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 ROR NBR
ST Q

See also

ROL

SHL

SHR


RS

RS  Flip flop reset dominant

Syntax

<Q> := RS (<SET>, <RESET>)

Accepted types

<SET>, <RESET>, <Q>: BOOL

Description

This function made a bistable filp flop reset dominant.
The output is not changed if both inputs are FALSE.
When both entries are TRUE, the output is forced to FALSE (priority reset).

SET | RESET | Q prec | Q
0 | 0 | 0 | 0
0 | 0 | 1 | 1
0 | 1 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 0 | 1
1 | 0 | 1 | 1
1 | 1 | 0 | 0
1 | 1 | 1 | 0

Example ST

(* MyRS is a declared request of block RS *)
MyRS (SET, RESET1);
Q := MyRS.Q;

Example FBD

ExampleLD

Example IL

(* MyRS is a declared request of block RS *)
Op1: CAL MyRS(SET, RESET1)
LD MyRS.Q
ST Q

See also

R(eset)

S(et)

SR


RUN

RUN  Launch a task

Syntax

RUN (<Nom>)

Accepted type

<Name>: tGroup

Description

This instruction is used to launch a stopped task (ex: task declared with manual start).
This instruction runs a suspend task.
<Name>: task name

Remark

This function has no effect on a task already launched.

Example ST

Wait (Inp(Power)=1) ;
RUN (knife) ;
Wait (Inp(Power)=0) ;
HALT (knife) ;

See also

CONTINUE

HALT

SUSPEND


S - (langage IL)

S  Force a boolean variable to TRUE

Syntax

<Q> := S (<Set>)

Accepted types

<Set> : BOOL
<Q> : BOOL

Description

This function allows forcing a boolean variable to TRUE.

Remarks

The operators S and R are available in IL.
In LD, They are represented by the windings (S) and (R).
In FBD, you can also use the windings (S) and (R), but the blocks RS and SR are also available.
The operations S and R do not have direct equivalence in ST.

Example ST

Non available

Example FBD

Use the functional blocks RS and SR

Example LD

(*example of use of a winding "S" *)

Example IL

Op1: LD Set
S Q (* Q is forced to TRUE if SET = TRUE *)
(* no action if SET = FALSE *)

See also

R

RS

SR


SECURITY

SECURITY  Defines security actions

Syntax

SECURITY (<Axis>, <WatchDog>)

Accepted type

<Axe>, <WatchDog>: UINT

Description

This instruction is used to define how the system will react when errors on MPC are detected.
<Axis> = TRUE activates the axis securities, i.e. the axis are disabled on the following defaults:

  • Following error on 1 axis

  • 1 drive default

  • 1 communication error Ethercat

  • 1 error MPC (IEC, internal, communication...)

<Axe> = FALSE : axis are disabled on the following defaults:

  • 1 Ethervat communication error

  • 1 default on the concerned drive

<WatchDog> = TRUE activates the MPC securities Watchdog; i.e. the watchdog is opened on the following defaults:

  • Following error on 1 axis

  • 1 drive default

  • 1 communication error Ethercat

  • 1 error MPC (IEC, internal, communication...)

<WatchDog> = FALSE : the watchdog does not open automatically

Remarks

The MPC restart causes the watchdog opening.
We can reset the watchdog by the function WATCHDOGON.
The axis following error does not open its output DRIVE_READY.
The MPC restart or an internal wrongness passes all E/S to 0.


SECURITYFEMAX

Syntax

SECURITYFEMAX (<Axe>, <Droff>)

Accepted types

<Axe> : tPeripheral
<Droff> : UINT

Description

This function allows management "Drive Ready" of an axis for the following error (E12).
<Axe> axis name.
<Droff> TRUE to activate management.

See also

Par défaut la gestion de lerreur de poursuite est activée.


SEL

Motion Studio does not apply the SEL function.


SPEED

Syntax

SPEED (<Axe>, <Expression>)

Units

<Expression> in user units

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This instruction forces the speed consign in speed loop.
<Axis> : Axis name
<Expression> value to applicate.

Example ST

SPEED (Axe_X, 2300.00); (* Velocity of 2300 tr/mn *)

See also

TORQUE

TORQUE_S

CURRENT

CURRENT_S

SPEED_S


SPEED_S

Syntax

<Q> := SPEED_S (<Axe>)

Units

<Expression>: in user units

Accepted types

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the current velocity.
<Axis>: axis name

See also

TORQUE

TORQUE_S

CURRENT

CURRENT_S

SPEED


SETBITB

SETBITB  Modifies a bit of a variable BYTE

Syntax

<Target> := SETBITB (<Source>, <Number>, <Expression>)

Limit

<Number> must be between 0 and 7

Accepted types

< Target > : BYTE
< Source > : BYTE
<Number> : USINT
<Expression> : BOOL

Description

This function modifies a bit of a variable BYTE.


SETBITD

SETBITD  Modifies a bit of a variable DWORD

Syntax

<Target> := SETBITD (<Source>, <Number>, <Expression>)

Limit

<Number> must be between 0 and 31

Accepted types

< Target > : DWORD
< Source > : DWORD
<Number> : USINT
<Expression> : BOOL

Description

This function modifies a bit of a variable DWORD.


SETBITW

SETBITW  Modifies a bit of a variable WORD

Syntax

<Target> := SETBITW (<Source>, <Number>, <Expression>)

Limit

<Number> must be between 0 and 15

Accepted types

< Target > : WORD
< Source > : WORD
<Number> : USINT
<Expression> : BOOL

Description

This function modifies a bit of a variable WORD.


SETMODE

Syntax

SETMODE (<Axis>, <Mode>, <Ini_Val>)

Accepted types

<Axis> : tPeripheral
<Mode> : tBcleMode
<Ini_Val> : tModeInitVal

Description

This function allows to change the operating mode of an axis.
<Axe> : axis name
<Mode> : drive mode
<Ini_Val> : transition between 2 modes

See also

GETMODE


SETINP

SETINP  Force létat dune entrée

Syntax

SETINP (<Input>>, <Value>)

Accepted types

<Input> : tIOBitIn
<Value> : BOOL

Description

This function forces the state of an internal MPC input.
<Input> : Input to modify
<Value> : Value

See also

CAMBOX

CAMBOX_S

CAMBOXSEG

CAMBOXOUT

STARTCAMBOX

STOPCAMBOX


SETTASKEVENTLIST

SETTASKEVENTLIST - Associe une liste dévènement

Syntax

SETTASKEVENTLIST (<Task >)

Accepted types

< Task > : tGroup

Description

This function allows to associate a user event list to a task..
< Task > : task name

See also

GETLASTSYSEVENT

GETSYSTEMEVENT

GETUSEREVENTPARAM

SIGNAL


SGN

SGN  Sign

Syntax

<Sign> := SGN (<Expression>)

Accepted type

<Expression>, <Sign>: REAL

Description

This function returns a real equal to 1 for the negative numbers, 1 for the positive numbers and 0 for the zero numbers.

Example

Sign: =SGN (-10.0); (* Result: Singe = -1 *)


SHL

SHL  Shift of bits to the left

Syntax

<Q> := SHL ( <IN>, <NBR> )

Accepted types

<IN>, <Q> : ANY_BIT
<NBR> : UNIT

Description

This function allows shifting on the left of a variable of type ANY_BIT.

Remarks

In LD and FBD language, several functions SHL are available according to the type of data.
In LD, the input flow governs the operation, and the flow remains unchanged in output.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := SHL (IN, NBR);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 SHL NBR
ST Q

See also

ROL

ROR

SHR


SHR

SHR  Shift of the bits on the right

Syntax

<Q> := SHR ( <IN>, <NBR> )

Accepted types

<IN>, <Q> : ANY_BIT
<NBR> : UNIT

Description

This function makes possible to shift on the right the bits of a variable of type ANY_BIT.

Remarks

In LD and FBD language, several functions SHR are available according to the type of data.
In LD, the input flow governs the operation, and the flow remains unchanged in output.
In IL, the first parameter must be charged in the current result before calling the function.
The second parameter is the function outline.

Example ST

Q := SHR (IN, NBR);

Example FBD

Example LD

(* The operation is executed if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 SHT NBR
ST Q

See also

ROL

ROR

SHL


SIGNAL

SIGNAL  Event generation

Syntax

SIGNAL (<Event>, <Parameter>)

Accepted type

<Event>: UINT
<Parameter>: UDINT

Description

This instruction generates an event for the user event tasks.
<Event> is the number of the factual task to launch.
<Parameter> could be recovered in the user event tasks.

See also

GETLASTSYSEVENT

GETSYSTEMEVENT

GETUSEREVENTPARAM

SETTASKEVENTLIST


SIN

SIN  Sine

Syntax

<Q> = SIN (<IN>)

Unit

<IN> is expressed in radians

Accepted types

<IN> : REAL
<Q>: REAL

Description

This instruction returns the sine of <IN>.
The argument <IN> must be a valid numerical expression.
The function SIN takes an angle and returns the two sides ratio of a rectangle triangle.

The ratio is the length of the opposite side divided by the length of the hypotenuse.

Remarks

In language LD, the inverse function Cosine is called: SIN_REAL
In language FBS, the inverse function Cosine is called: SIN_REAL_FBD
in language IL, the input (IN) must be charged in the current result before calling the function.

Example ST

Q := SIN (IN);

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

Op1: LD IN
SIN
ST Q

See also

ACOS

ASIN

ATAN

COS

TAN


SINT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


SLAVEOFFSET

SLAVEOFFSET  Shift dynamically the slave position

Syntax

SLAVEOFFSET (<Slave>, <Offset>, <Acceleration>)

Units

<Offset> : Distance in the user unit (Ex : mm, degree,)
<Acceleration> : Acceleration in the user unit (Ex : mm/s², degree/s²,)

Accepted types

<Slave> : tPeripheral
<Offset> : REAL
<Acceleration> : REAL

Description

This instruction dynamically shifts the slave position.
<Slave> : Axis name
<Offset> : Offset value to apply
<Acceleration> acceleration used to apply the offset (in the master unit).

Remark

The offset is directly applied if no synchronised movement is running or if axis in not enable.
If the movements end and if there is no more movement in progress, the SLAVEOFFSET_S immediately takes the value of SLAVEOFFSET. The axis thus does not carry out the totality of retiming.

An AXIS OFF does not reset the slaveoffset, the current value is kept

SLAVEOFFSET can be used in and out synchro

See also

SLAVEOFFSET_S


SLAVEOFFSET_S

SLAVEOFFSET_S  Current value of slaveoffset

Syntax

<Q> := SLAVEOFFSET_S (<Slave>)

Unit

<Q> : Distance in the user unit (Ex : mm, degree,)

Accepted type

<Slave> : tPeripheral

Description

This function returns the current value of the slaveoffset.
<Slave> : Axis name

Remark

When the current value is equal to the < Offset > value of function SLAVEOFFSET, the shift is then finished.

See also

SLAVEOFFSET


SQRT

SQRT  Square root

Syntax

<Q> := SQRT (<IN>)

Accepted type

<IN>, <Q> : REAL

Description

This function returns the square root of <IN>

Remarks

In LD, the input flow (EN) governs the function call, and the flow remains unchanged in output.
In IL, the input must be charged in the current result before calling the function.

Example ST

Q := SQRT (IN);

Example FBD

Example LD

(* the function is called if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
SQRT
ST Q

See also

ABS

TRUNC

LOG

POW


SR

SR  Flip flop set dominant

Syntax

<Q> := SR (<SET>, <RESET>)

Accepted types

<SET>, <RESET>, <Q> : BOOL

Description

This function made a bistable filp flop set dominant..
The output does not change if both inputs are FALSE.
When both entries are TRUE, the output is forced to TRUE (priority set).

SET | RESET | Q prec | Q
0 | 0 | 0 | 0
0 | 0 | 1 | 1
0 | 1 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 0 | 1
1 | 0 | 1 | 1
1 | 1 | 0 | 1
1 | 1 | 1 | 1

Example ST

(* MySR is a declared request of block SR *)
MySR (SET, RESET1);
Q := MySR.Q;

Example FBD

ExempleLD

Example IL

(* MySR is a declared request of block SR *)
Op1: CAL MySR(SET, RESET1)
LD MySR.Q
ST Q

See also

R(eset)

S(et)

RS


SSTOP

SSTOP  Axis stop

Syntax

SSTOP (<Axis>)

Accepted type

<Axis>: Name of the axis

Description

This function stops <Axis> with the current deceleration.

This function does not block the task.
If <Axis> is a master axis linked with the CAM, GEARBOX or MOVS functions then <Axis> and its slave are stopped but the link is not broken.
If <Axis> is a slave axis linked with the CAM, GEARBOX or MOVS functions, then <Axis> is stopped and the link with the master axis is broken.
The instruction SSTOP empties the movement buffer and stops the axis using the current deceleration.
This instruction does not block the task and does not only wait for MOVE_S=0.

Remarks

This function, blocks the task until the buffer movement is complete.
At the end of the deceleration withdraw all the movements on standby. If a movement is sent after a SSTOP and before it is finished, this movement will be ignored, except if it acts as a STOP/SSTOP which will modify the slope of deceleration and will take into account the new slope.

Example ST

SSTOP (Axis_X);

See also

STTA

STTR

STTI

CAM

GEARBOX

MOVS


ST

See Assignation


STARTCAM

STARTCAM  launches the execution of a cam

Syntax

STARTCAM (<Nrcam>)

Accepted type

<Nrcam> : UINT (between 1 and 128)

Description

This instruction launches the execution of a cam which was charged beforehand by a LOADCAM or LOADCAMI.

See also

LOADCAM

LOADCAMI

CAM_S


STARTCAMBOX

STARTCAMBOX  Lance une boîte à cames

Syntax

STARTCAMBOX (<NumCamBox>)

Accepted types

<NumCamBox> : USINT

Description

This function launches a cambox previously definite.
<NumCamBox> : cambox number (0..31)

Remarks

Outputs are not inevitably refresh once left this function (that depends on the process exchange).

See also

CAMBOX

CAMBOX_S

CAMBOXOUT

CAMBOXSEG

SETINP

STOPCAMBOX


STARTCOUNTER

Syntax

STARTCOUNTER (<NumCounter>)

Accepted types

<NumCounter> : USINT

Description

This function starts a counter.

<NumCounter> : counter number (0 to 63)

See also

COUNTER

COUNTER_S

COUNTEREVENT

COUNTERSET

STOPCOUNTER


STATUS_S

STATUS_S  Task status

Syntax

<Status> := STATUS_S (<Name>)

Accepted type

<Name>: tGroup
<Status>: tTaskStatus

Description

This function returns a task state.
<Name>: task name

<Status>: task status

Example

Run (Percage);

Wait (Status_s (Percage) =0);


STN

See Assignation


STOP

STOP  Axis stop

Syntax

STOP (<Axe>)

Accepted type

<Axis> : tPeripheral

Description

This function stops <Axis> with the current deceleration.
<Axis> : axis name.
This function blocks the task.
If <Axis> is a master axis linked with the CAM, GEARBOX or MOVS functions then <Axis> and its slave are stopped but the link is not broken.
If <Axis> is a slave axis linked with the CAM, GEARBOX or MOVS functions, then <Axis> is stopped and the link with the master axis is broken.
The instruction SSTOP empties the movement buffer and stops the axis using the current deceleration.
This instruction does not block the task and does not only wait for MOVE_S=0.

Remarks

This function, blocks the task until the buffer movement is complete.
At the end of the deceleration withdraw all the movements on standby. If a movement is sent after a SSTOP and before it is finished, this movement will be ignored, except if it acts as a STOP/SSTOP which will modify the slope of deceleration and will take into account the new slope.

Example ST

STOP (Axis_X);

See also

STTA

STTR

STTI

CAM

GEARBOX

MOVS


STOPCAMBOX

STOPCAMBOX  Arrête une boîte à came

Syntax

STOPCAMBOX (<NumCamBox>, <ResetOutput>)

Accepted types

<NumCamBox> : USINT
<ResetOuput> : BOOL

Description

This function stops a cambox.
<NumCamBox> : cambox number (0..31)
<ResetOutput> : reset outputs before stop the cambox

See also

CAMBOX

CAMBOX_S

CAMBOXOUT

CAMBOXSEG

SETINP

STARTCAMBOX


STOPCOUNTER

Syntax

STOPCOUNTER (<NumCounter>)

Accepted types

<NumCounter> : USINT

Description

This function stops a counter.
<NumCounter> : counter number (0 to 63)

See also

COUNTER

COUNTER_S

COUNTEREVENT

COUNTERSET

STARTCOUNTER


STOPS

STOPS  Stop MOVS instruction

Syntax

STOPS (<Slave>, <Pos. Slave>)

Unit

<Pos. Slave> : user unit (Ex : mm, degree,)

Accepted type

<Slave> : tPeripheral

<Pos. Slave> : REAL

Description

This function allows the slave axis to decelerate in order to reach the position <Pos.slave>
<Slave> : axis name

Remark

The call of STOPS instruction reset STOPS_S flag.

Example ST

TRIGGERI (FinDeSynchro,1); (* Wait for a rising edge on the input FinDeSynchro *)
STOPS (105.0); (* Deceleration until position 105 *)


STOPS_S

STOPS_S  Error in the processing of function STOPS

Syntax

<Q> = STOPS_S (<Axis>)

Accepted Types

<Axis> : tPeripheral
<Q> : BOOL

Description

This function is used to know if a STOPS could be carried out correctly:
<Axis> : axis name
STOPS_S = TRUE if :

  • The slave position asked by STOPS instruction is not possible to obtain (ex: slave position asked by STOPS has already been passed.).

  • 2nd case: If slave speed is null.

Else returns FALSE

Remark

It is reset after each reading.

Example

STOPS (Axis_X, 105.0);
WAIT (MOVE_S (Axis_Y) =0);
If (STOPS_S (Axis_X) =1) Then
Default: = 1;
End_If;


STTA

STTA  Launch an absolute movement

Syntax

STTA (<Axis>, <Distance>)

Unit

<Distance> : user unit (Ex : mm, degree,)

Accepted types

<Axis> : tPeripheral

<Distance>: REAL

Description

This instruction launches a movement to an absolute position.
<Axis>: axis name.
The system doesnt wait for the end movement (MOVE_S=0) and executes the next instruction.
The axis uses the current velocity, acceleration and deceleration values.

Example ST

STTA (Axis_X, 1200.0);
WAIT (MOVE_S (Axis_X) = 0);

See also

STTR

MOVA

MOVR

STTIP

STTIM

MOVE_S


STTC2D

Syntax

STTL2D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Centre_ X>, < Centre_Y>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y > : REAL
< Centre_ X>, < Centre_Y> : REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a circular movement of interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.
The axis uses the current speed, acceleration and deceleration values.


STTC3D

Syntax

STTL3D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Distance_ Z>, < Centre_ X>, < Centre_Y>, < Centre_Z>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y >, < Distance_ Z> : REAL
< Centre_ X>, < Centre_Y>, < Centre_Z> : REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a circular movement of interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.
The axis uses the current speed, acceleration and deceleration values.


STTH3D

Syntax

STTH3D (<Axe_virt >, < Centre_ X>, < Centre_Y>, < Pas>, <Angle>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Centre_ X>, < Centre_Y> : REAL
< Pas >, <Angle> :REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a movement of helical interpolation.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.
The axis uses the current speed, acceleration and deceleration values.

<Axe_virt> : Virtual axis name.


STTH

STTH  Non blocking Home

Syntax

STTH (<Axis>, <Type>)

Accepted types

<Axis> : tPeripheral

<Type> : SINT

Description

With the home the system can determine the origin axis measure, the one being lost at each power cut.

The Home machine (P.O.M) can reference the motor position with regard to a position of the machine.

Different types of POM are available: immediate, on sensor, with disengagement.

A POM cycle forces the counter from the motor position to a value Zero Program.

<Axis> : axis name
<Type> :

  • -1 : Type of home set up in the profile

  • 0 : Immediate  the axis returns to its value Zero Program

  • 1 : On TOP Z
    The motor does not move but its position is recalculated with regard to the Top Z motor and to the value Zero Program.
    We obtain a position located between +/- ½ tour or reference +/- ½ motor tour.

  • 2 : On sensor, in positive direction +, without disengagement
    The drive launches an infinite movement in positive direction and waits for a rising edge on the input of the axis HOME.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 3 : On sensor, in positive direction, with disengagement
    If the HOME input is already 1 then the drive launches first an infinite movement in negative direction to get free from the HOME sensor.
    After that the drive launches an infinite movement in positive direction and waits for a rising edge on HOME input to force the position to the value Zero Program and the motor stops at this position.

  • 4 : On sensor, in negative direction, without disengagement
    The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 5 : On sensor, in negative direction, with disengagement
    If the HOME input is already 1 then the drive launches first an infinite movement in positive direction to get free from the HOME sensor.
    After that the drive launches an infinite movement in negative direction and waits for a rising edge on HOME input to force the position to the value Zero Program and the motor stops at this position.

  • 6 : On sensor and TOP Z, in positive direction, without disengagement
    The drive launches an infinite movement in positive direction and waits for a rising edge on the HOME input and then the passage via the TOP Z motor.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 7 : On sensor and TOP Z, in positive direction, with disengagement
    If the HOME input is already 1 then the drive launches first an infinite movement in negative direction to get free from the HOME sensor.
    The drive launches an infinite movement in positive direction and waits for a rising edge on the HOME input.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 8 : On sensor and TOP Z, in negative direction, with disengagement
    The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input and then the passage via the TOP Z motor.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 9 : On sensor and TOP Z, in negative direction, with disengagement
    If the HOME input is already 1 then the drive launches first an infinite movement in positive direction to get free from the HOME sensor.
    The drive launches an infinite movement in negative direction and waits for a rising edge on the HOME input and then the passage via the TOP Z motor.
    The position is then forced to the value Zero Program and the motor stops at this position.

  • 10 : Axis position initialisation with the absolute position (only in SinCos mode or SSI else initilisation to 0)

  • 11 : Clear following error

Remark

The function STTH is not blocking.

A home takes into account :

  • The home position (zero Program)

  • The home velocity (parameter_IMD_HOME_VELOCITY)

  • The processing acceleration and deceleration

These movements do not change the current axis velocity.

Example ST

STTH(Axis_X,0); (*Immediate home *)

See also

HOMECANCEL

HOME_S

HOMEAUX

HOMEAUXCANCEL

HOMEAUX_S


STTHAUX

STTHAUX  Non blocking Home on the auxiliary

Syntax

SSTHAUX(<Axis>, <Type>)

Accepted types

<Axis> : tPeripheral

<Type> : SINT

Description

This function allows doing a home on the axis auxiliary
<Axis> : axis name
<Type> :

  • 0 : immediate  the auxiliary returns to its value Zero Program

  • 1 : On Top Z (the function waits for the top Z on the auxiliary input).

  • 2 : On sensor (the function waits for a rising edge on the HOME sensor HOME)

  • 3 : On sensor and Top Z (the function waits for a high level on the HOME sensor and a top Z on the auxiliary coder)

  • 4 : Initialize the auxiliary position with the absolute position (only in mode SinCos or SSI else initialization to 0)

Remark

The function HOMEAUX is not blocking.

Example ST

STTHAUX (Axis_X,0); (*Immediate home on the auxiliary*)

See also

HOME

HOMECANCEL

HOME_S

HOMEAUXCANCEL

HOMEAUX_S


STTIM

STTIM  Launch an infinite movement in negative direction

Syntax

STTIM (<Axis>)

Accepted types

<Axis> : tPeripheral

<Axis> : Name of the axis

Description

This function allows launching an infinite movement in negative direction.
<Axis> : axis name
The system doesnt wait for the movement end (MOVE_S=0) and executes the next instruction.
The axis uses the current velocity, acceleration and deceleration values.

Example ST

STTIM (Axis_X);

WAIT (INP (Stop)) = 0);

STOP (Axis_X);

See also

STTA

STTR

MOVA

MOVR

STTIP

MOVE_S


STTIP

STTIP  Launch an infinite movement in positive direction

Syntax

STTIP (<Axis>)

Accepted types

<Axis> : tPeripheral

Description

This function allows launching an infinite movement in positive direction.
<Axis> : axis name
The system doesnt wait for the movement end (MOVE_S=0) and executes the next instruction.
The axis uses the current velocity, acceleration and deceleration values.

Example ST

STTIP (Axis_X);

WAIT (INP (Stop)) = 0);

STOP (Axis_X);

See also

STTA

STTR

MOVA

MOVR

STTIM

MOVE_S


STTL2D

Syntax

STTL2D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y > : REAL
< Absolu > : BOOL

Description

This function allows launching a linear movement of interpolation to an absolute position.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.
The axis uses the current speed, acceleration and deceleration values.

<Axe_virt> : virtual axis name


STTL3D

Syntax

STTL3D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Distance_ Z>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y >, < Distance_ Z> : REAL
< Absolu > : BOOL

Description

This function allows launching a linear movement of interpolation to an absolute position.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.
The axis uses the current speed, acceleration and deceleration values.

<Axe_virt> : virtual axis name


STTR

STTR  Launch a relative movement

Syntax

STTR (<Axis>, <Distance>)

Unit

<Distance> : user unit (Ex : mm, degree,)

Accepted types

<Axis> : tPeripheral

<Distance> : REAL

Description

This function allows launching a movement to a relative position.
The system doesnt wait for the end of the movement (MOVE_S=0) and executes the next instruction.
The axis uses the current velocity, acceleration and deceleration values.

<Axe_virt> : virtual axis name

Example ST

STTR (Axis_X, 1200.0) ;
WAIT (MOVE_S (Axis_X) = 0);

See also

STTA

MOVA

MOVR

STTIP

STTIM

MOVE_S


SUSPEND

SUSPEND  Suspend a task

Syntax

SUSPEND (<Task>)

Accepted type

< Task > : tGroup

Description

This function suspends a running task.

Remarks

This instruction has no effect on stopped tasks.
< Task > : task name
It does not affect current movements or the movement buffer.
The blocking functions continue to be executed during a SUSPEND (DELAY, MOVA ).

Example ST

Wait (Inp(Power)=0);
SUSPEND (knife);
Wait (Inp(Power)=1);
RUN (knife);

See also

RUN

CONTINUE

HALT


SUB

SUB  Substraction (language IL)

See Substraction


TAN

TAN  Tangent

Syntax

<Q> := SIN (<IN>)

Unit

<IN> is expressed in radians

Accepted types

<IN> : REAL
<Q>: REAL

Description

This function restores the tangent of <IN>.
The argument <IN> must be a valid numerical expression.
The function TAN takes an angle and returns the ratio of two sides of the rectangle triangle. The ratio is the length of the opposite side of an angle divided by the length of the adjacent side of the angle.

Remarks

In language LD, the inverse Cosine function is called: TAN_REAL
In language FBS, the inverse Cosine function is called: TAN_REAL_FBD
In language IL, the input (IN) must be charged in the current result before calling of the function.

Example ST

Q := TAN (IN);

Example FBD

Example LD

(* The function is executed only if EN is TRUE *)
(* ENO has the same value as EN *)

Example IL

Op1: LD IN
TAN
ST Q

See also

ACOS

ASIN

ATAN

COS

SIN


THEN

See IF


TIMEH

TIMEH  Time passed since the starting of the MPC

Syntax

<Q> := TIMEH (0)

Accepted type

<Q>: UDINT

Description

This instruction returns the number of ms, which represents the number of milliseconds from the last starting beyond 49 days (32 bits of strong weight).

See also

TIMEL


TIMEL

TIMEL  Time passed since the starting of the MPC

Syntax

<Q> := TIMEL (0)

Limit

<Q> : 32 bits or 1193h or 49.71j max

Accepted type

<Q> : UDINT

Description

This instruction returns the number of ms, which represents the number of milliseconds from the last starting (32 bits of low weight).

See also

TIMEH


TIMER

Syntax

<ETAT_TEMPO> := TIMER (<TEMPO>)

Accepted types

<ETAT_TEMPO>: BOOL
<TEMPO> : UDINT

Description

Instruction TIMER is used to establish active waitings.
It indicates if a temporization charged by LOADTIMER is past.

Remarks

The time between the loading and the test of temporization should not exceed 2^31, which corresponds to approximately 25 days.

Example ST

Tempo := LOADTIMER (3000) ; (* Load an 3s waiting *)
BOUCLE :
IF (TIMER (Tempo) = FALSE) THEN
GOTO BOUCLE ; (* Wait the end of delay *)
END_IF ;

See also

LOADTIMER


TO

See FOR


TOF

TOF  Time switch at the engaging

Syntax

TOF (<IN>, <PT>)
<Q>:= TOF.Q
<ET>:= TOF.ET

Accepted types

<IN> : BOOL
<PT> : TIME
<Q> : BOOL
<ET> : TIME

Description

This function makes it possible to carry out a delay temporization at the setting.
The temporization starts on a falling edge of <IN>.
It stops when the passed time is equal to the programmed time <PT>.
A rising edge of <IN> changes the temporization to 0.
The output signal <Q> passes to 1 when <IN> passed to 1, and changes to 0 when the programmed time is passed.
The output operand <ET> contains the current time value. It will grow up to the programmed value time < PT > as long as the order < IN > is to ` 0' and is changed to ` 0' on rising edge of < IN >.

Remark

In LD, the input flow is the order IN. The output flow is the operand Q.

Example ST

(* MyTimer is a declared request of the block TOF *)
MyTimer (IN, PT);
Q := MyTimer.Q;
ET := MyTimer.ET;

Example FBD

Example LD

Example IL

(* MyTimer is a declared authority of the block TOF *)
Op1: CAL MyTimer (IN, PT)
LD MyTimer.Q
ST Q
LD MyTimer.ET
ST ET

See also

TON

TP


TON

TON  Time switch at the engaging

Syntax

TON (<IN>, <PT>)
<Q>:= TON.Q
<ET>:= TON.ET

Accepted types

<IN> : BOOL
<PT> : TIME
<Q> : BOOL
<ET> : TIME

Description

This function makes it possible to carry out a delay temporization at the setting.
The temporization starts on a rising edge of <IN>.
It stops when the passed time is equal to the programmed time<PT>.
A Time switch falling edge of <IN> changes the temporization to 0.
The output signal <Q> passes to 1 when the programmed time is passed, and changes to 0 when the order <IN> falls.
The output operand <ET> contains the current time value. It will grow up to the programmed value time < PT > as long as the order < IN > is to ` 0' and is changed to ` 0' on rising edge of < IN >.

Remarks

The change of < Pt > value is only taken into account on rising edge of < IN >.

in LD, the input flow is the order IN. The output flow is the signal Q.

Example ST

(*MyTimer is a declared request of the block TON *)
MyTimer (IN, PT);
Q := MyTimer.Q;
ET := MyTimer.ET;

Example FBD

Example LD

Example IL

(* MyTimer is a declared request of the block TON *)
Op1: CAL MyTimer (IN, PT)
LD MyTimer.Q
ST Q
LD MyTimer.ET
ST ET

See also

TOF

TP


TORQUE

Syntax

TORQUE (<Axis>, <Expression>)

Units

<Expression> in N.m

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This instruction forces the torque consign in torque loop.
<Axis> : Axis name
<Expression> value to applicate.

Example ST

TORQUE (Axe_X, 5.20); (* Torque to 5.2 N.m *)

See also

TORQUE_S

CURRENT

CURRENT_S

SPEED

SPEED_S


TORQUE_S

TORQUE_S - Retourne le couple

Syntax

<Q> := TORQUE_S (<Axis>)

Units

<Q> en N.m

Accepted types

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the current torque.
<Axis>: axis name

See also

TORQUE

CURRENT

CURRENT_S

SPEED

SPEED_S


TP

TP  Timer of impulses

Syntax

TON (<IN>, <PT>)
<Q>:= TON.Q
<ET>:= TON.ET

Accepted types

<IN> : BOOL
<PT> : TIME
<Q> : BOOL
<ET> : TIME

Description

Allows realising a monostable function block.
The timer starts on a rising edge of <IN>.
It stops when the programmed time is passed.
A falling edge of <IN> changes the timer to 0, only after the programmed time.
All input impulses <IN> during the programmed time are ignored.
The output operand <Q> is 1 as long as the timer is active.
The output operand <ET> contains the timer value.
After the time is passed, the output operand <ET> stays at the programmed timer value <PT> as long as the order <IN> is at 1.

Remarks

The change of value of <PT> is only taken into account on rising edge of <IN>.
In LD, the input flow is the order IN. The output flow is the operand Q.

Example ST

(* MyTimer is a declared request of block TP *)
MyTimer (IN, PT);
Q := MyTimer.Q;
ET := MyTimer.ET;

Example FBD

Example LD

Example IL

(* MyTimer is a declared request of block TP *)
Op1: CAL MyTimer (IN, PT)
LD MyTimer.Q
ST Q
LD MyTimer.ET
ST ET

See also

TON

TOFF


TRAJA

TRAJA  Absolute trajectory

Syntax

TRAJA (<Axis>, <Distance>, <Vitesse>, <Acceleration>, <Deceleration>)

Unit

<Distance> : user unit (Ex : mm, degree,)
<Velocity> : user unit (Ex : mm/s, degree/s,)
<Acceleration>, <Deceleration> : user unit/s² (Ex : mm/s², degree/s²,)

Accepted types

<Axis> : tPeripheral
<Distance>, <Velocity>, <Acceleration>, <Deceleration> : REAL

Description

This instruction can be used to launch a complex trajectory to an absolute position.
<Axis> : axis name
The system doesnt wait for the movement end (MOVE_S=0) and executes the next instruction.

Example ST

MERGE (Axis_X,1); (* Move at a slow velocity *)
TRAJA (Axis_X, 1000.0, Vrapid, 100.0, 100.0); (* to position 1000 *)
TRAJA (Axis_X, 1500.0, Vslow, 100.0, 100.0); (* without stopping the axis*)
MERGE (Axis_X, 0);

See also

TRAJR

STTA

STTR

MOVA

MOVR

STTIP

STTIM

MOVE_S


TRAJC2D

Syntax

STTL2D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Centre_ X>, < Centre_Y, <Vitesse>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y > : REAL
< Centre_ X>, < Centre_Y> : REAL
<Vitesse> : REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a complex trajectory of circular interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.


TRAJC3D

Syntax

STTL3D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Distance_ Z>, < Centre_ X>, < Centre_Y>, < Centre_Z>, <Vitesse>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y >, < Distance_ Z> : REAL
< Centre_ X>, < Centre_Y>, < Centre_Z> : REAL
<Vitesse> : REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a complex trajectory of circular interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.


TRAJH3D

Syntax

STTL3D (<Axe_virt >, < Centre_ X>, < Centre_Y>, < Pas>, <Angle>, <Vitesse>, <Sens>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Centre_ X>, < Centre_Y> : REAL
< Pas >, <Angle> :REAL
<Vitesse> : REAL
< Sens> : BOOL
< Absolu > : BOOL

Description

This function allows launching a complex trajectory of helical interpolation.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.


TRAJIM

TRAJIM  Launches an infinite movement in negative direction

Syntax

TRAJIM (<Axis>>, <Velocity>, <Acceleration>,)

Unit

<Velocity> : user unit (Ex : mm/s, degree/s,)
<Acceleration> : user unit/s² (Ex : mm/s², degree/s²,)

Accepted types

<Axis> : tPeripheral
<Velocity>, <Acceleration> : REAL

Description

The function can be used to produce a movement in negative direction.
<Axis> : axis name
The system does not wait for the end of the movement (MOVE_S=0) and executes the next instruction.

Example ST

TRAJIM (Axis_X, 50.0, 250.0) ;
WAIT (INP (Stop)) = 0);
STOP (Axis_X) ;

See also

TRAJA

TRAJR

TRAJIP


TRAJIP

TRAJIP Launches an infinite movement in positive direction

Syntax

TRAJIP (<Axis>>, <Velocity>, <Acceleration>,)

Unit

<Velocity> : user unit (Ex : mm/s, degree/s,)
<Acceleration> : user unit/s² (Ex : mm/s², degrees²,)

Accepted types

<Axis> : tPeripheral
<Velocity>, <Acceleration> : REAL

Description

The function can be used to produce a movement in positive direction.
<Axis> : axis name
The system does not wait for the end of the movement (MOVE_S=0) and executes the next instruction.

Example ST

TRAJIP (Axis_X, 50.0, 250.0);
WAIT (INP (Stop)) = 0);
STOP (Axis_X);

See also

TRAJA

TRAJR

TRAJIM


TRAJL2D

Syntax

STTL2D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, <Vitesse>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y > : REAL
<Vitesse> : REAL
< Absolu > : BOOL

Description

This function allows launching a linear movement of interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.


TRAJL3D

Syntax

STTL3D (<Axe_virt >, < Distance_ X>, < Distance_ Y>, < Distance_ Z>, <Vitesse>, < Absolu>)

Accepted types

<Axe_virt> : tPeripheral< Distance_ X >, < Distance_ Y >, < Distance_ Z> : REAL
<Vitesse> : REAL
<Absolu> : BOOL

Description

This function allows launching of a complex trajectory of linear interpolation to an absolute position.
<Axe_virt> : Virtual axis name.
The system does not wait for the end of movement (MOVE_S=0) and runs the next instruction.


TRAJR

TRAJR  Relative trajectory

Syntax

TRAJR (<Axis>, <Distance>, <Velocity>, <Acceleration>, <Deceleration>)

Unit

<Distance> : user unit (Ex : mm, degree,)
<Velocity> : user unit (Ex : mm/s, degree/s,)
<Acceleration>, <Deceleration> : user unit/s² (Ex : mm/s², degré/s²,)

Accepted types

<Axis> : tPeripheral
<Distance>, <Acceleration>, <Deceleration> : REAL

Description

This function allows launching a complex trajectory to a relative position.
<Axis> : axis name
The system doesnt wait for the movement end (MOVE_S=0) and executes the next instruction.

Example ST

MERGE (Axis_X,1); (*Move at a slow velocity *)
TRAJA (Axis_X, 1000.0, Vrush, 100.0, 100.0); (* to position 1000 *)
TRAJR (Axis_X, 500.0, Vslow, 100.0, 100.0); (* without stopping the axis *)
MERGE (Axis_X, 0);

See also

TRAJA

STTA

STTR

MOVA

MOVR

STTIP

STTIM

MOVE_S


TRIGGERAXIS_S

TRIGGERAXIS_S  Trigger status

Syntax

<Q> = TRIGGERAXIS_S (<Axis>)

Accepted type

<Axis> : tPeripheral
<Q> : BYTE

Description

This function returns the trigger status of an axis.
<Axis> : axis name
Return TRUE, if a trigger movement is on standby of release on this axis
Return FALSE, if a movement is not on standby of release.


TRIGGERAXISSET

TRIGGERAXISSET  Activate the triggered movement

Syntax

TRIGGERAXISSET (<Axis>)

Accepted type

<Axis> : tPeripheral

Description

This function makes it possible to force the release of a trigger movement immediately.
This function is used in another task that containing the TRIGGERx instruction.
<Axis> : axis name


TRIGGERF

TRIGGERF  Trigger movement on window

Syntax

TRIGGERF (<Input Nr>, <Edge>, <Axis>, <Source>, <Min>, <Max>, <Interior>)

Accepted types

<Input Nr> : tIOBitIn
<Edge> : USINT
<Axis> : tPeripheral
<Source> : tSrcPos
<Mini> : REAL
<Maxi> : REAL
<Interior> : BOOL

Description

This function allows trigging a movement in a window position of an axis and a status change of an input.
<Input Nr> : Input reference (type BIT) declared in I/O editor
<Edge> : 1 for rising edge or 0 for falling edge.
<Axis> : axis name
<Source> : allows to select the <Axis> source
<Mini> must be always inferior to <Maxi>.
<Interior> is used to indicate if the trigger is carried out in the interior or exterior of the window.
The execution of the instruction causes the trigger to the next task.

Remarks

Outside modulo: if Min>Max, the TRIGGERF will never be started.
Inside modulo: if Min>Max, the release is carried out outside the window.

Example ST

(* Moving of the axis X on the rising edge of the input 4 of MPC when the axis Y is between 10 and 20 *)
TRIGGERF (Mpc_4, 1, Axis_Y, SRC_AXIS, 10.0, 20.0, 1);
MOVR (Axis_X, 100.0);

See also

TRAGGERI

TRIGGERP

TRIGGERAXIS_S

TRIGGERAXISSET


TRIGGERI

TRIGGERI  Trigger movement on input state

Syntax

TRIGGERI (<Input Nr>, <Edge >)

Accepted types

<Input Nr> : tIOBitIn
<Edge> : USINT

Description

<Input Nr> : Input reference (type BIT) declared in I/O editor
the editor E/S)
<Edge> : 1 for rising edge or 0 for falling edge.

Example ST

(* Movement of the axis X on rising edge of the input 4 of MPC *)
TRIGGERF (Mpc_4, 1);
MOVR (Axis_X, 100.0);

See also

TRAGGERF

TRIGGERP


TRIGGERP

TRIGGERP  Trigger movement on a position

Syntax

TRIGGERP (<Axis>, <Source>, <Position>, <Direction>)

Accepted Types

<Axis> : tPeripheral
<Source> : tSrcPos
<Position> : REAL
<Direction> : tMoveDirection

Description

This function allows triggering a movement on detection of an axis position.
<Axis> : axis name
<Source> : allows to select the <Axis> source
<Position> is the position to launch the trigger.
<Direction> is used to indicate the trigger direction:

  • S_ALL if not any

  • POS if positive direction

  • S_NEG if negative direction

Example ST

(* Moving of the axis X from the position Y= 10 in positive direction *)
TRIGGERP (Axis_Y, SRC_AXIS, 10.0, S_POS);
MOVR (Axis_X, 100.0);

See also

TRAGGERI

TRIGGERF


TRUE

Constant value of type BOOL


TRUNC

TRUNC  Truncate the decimal part of a number

Syntax

<Q> := TRUNC (<IN>)

Accepted types

<IN> : REAL
<Q> : ANY_INT

Description

This function truncates the decimal part of a number.

Remarks

In LD, the operation is only executed if the input flow (EN) is 1.
The flow remains unchanged in output (ENO).
In IL, the input value must be charged in the current result before calling the function.

Example ST

Q := TRUNC (IN);

Example FBD

Example LD

(* the function is called if EN = TRUE *)
(* ENO is equal to EN *)

Example IL

Op1: LD IN
 TRUNC
 ST Q

See also

ABS

LOG

POW

SQRT


TYPE

See the declaration sections and the redefined types.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.

Both TYPE and END_TYPE keywords do not have to be inserted in some blocks VAR..END_VAR but in the type declaration files at the project level.


UDINT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


UINT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


UNTIL

See REPEAT


USINT

See elementary data types

Notes

This data type is defined by the IEC61131-3.


UDINTWSWAP

UDINTWSWAP  Reverse words

Syntax

<Q> := UDINTSWAP (<IN>)

Accepted type

<IN>, <Q> : UDINT

Description

This function allows reversing words of 16 bits by a word of 32 bits (ABCD => CDAB)


VAR

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VAR_EXTERNAL

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VAR_GLOBAL

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VAR_IN

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VAR_IN_OUT

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VAR_OUTPUT

See the declaration sections.

Notes

This keyword is only for declaration zones of POUs
It is defined byIEC61131-3.


VEL

VEL  Velocity

Syntax

VEL(<Axis>, <Expression>)

Unit

<Expression> user unit per s (Ex : mm/s, degree/s, tr/s)

Limit

<Expression> must be greater or equal to 0

Accepted types

<Axis>: Name of the axis
<Expression>: REAL

Description

This instruction modifies the current velocity.
<Axis> : axis name
<Expression> contains the value to apply.

Remark

The current velocity can be modified at any time.

Example ST

VEL (Axis_X, 500.0); (* Speed of 500 units/s *)

See also

VEL_S

VEL_T

VELP

ACC

DEC


VEL_S

VEL_S  Velocity

Syntax

<Q> := VEL_S (<Axis>)

Unité

<Q> in user unit per s (Ex : mm/s, degree/s, tr/s)

Accepted type

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the current velocity.
<Axis> : axis name

See also

VEL

VEL_T

VELP


VEL_T

VEL_T  Value of the velocity order

Syntax

<Q> := VEL_T (<Axis>)

Unit

<Q> in user unit per s (Ex : mm/s, degree/s, tr/s)

Accepted type

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the applicable velocity order for this axis.
<Axis> : axis name

Example ST

VEL(Axe_X, 500.0); (* Vitesse de 500 unités/s *)

ConsigneVitesse := VEL_T(Axe_X) ; (* ConsigneVitesse = 500 *)

See also

VEL

VEL_S

VELP

ACC_T

DEC_T


VELAUX_S

VELAUX_S  Velocity

Syntax

<Q> := VELAUX_S (<Axis>)

Unit

<Q> in user unit per s (Ex : mm/s, degree/s, tr/s)

Accepted type

<Axis> : tPeripheral
<Q> : REAL

Description

This function returns the current velocity of the auxiliary.
<Axis> : axis name

See also

VEL_S


VELP

VELP  Velocity in percent

Syntax

VELP(<Axis>,<Expression>)

Limit

<Expression> must be greater or equal to 0

Accepted types

<Axis> : tPeripheral
<Expression> : REAL

Description

This function adjusts the current velocity as a percentage of the default velocity parameter in the profile of the axis.
<Axis> : axis name
<Expression> contains the percent to apply.

Remarks

The velocity value can be entered in the speed profile screen during the Motion configuration of the axis and can modify a task.

Example ST

VELP(Axis_X, 10.0); (* 10% of the defined velocity defined in the velocity profile *)

See also :

VEL

VEL_S

VELT

ACCP

DECP


VERSION

VERSION  Operating System Version

Syntax

<Q> := VERSION ( )

Accepted Type

<Q>: UDINT

Description

This function returns the OS version of the MPC.


WAIT

WAIT  Waiting for a condition

Syntax

WAIT <Condition>

Description

This instruction allows the system to wait for a true condition.
The execution of this instruction launches the execution of the next task

Remarks

The WAIT instruction, the following instructions are not executed as long as the <Condition> is false.
This instruction provides a passive waiting for a condition.

Example

WHILE (INP (Sensor, 0)) DO (* Active waiting*)
END WHILE;

This program can be replaced by:
WAIT (INP (Sensor, 1)); (* passive waiting *)


WATCHDOGOFF

WATCHDOGOFF  Open the watchdog

Syntax

WATCHDOGOFF (0)

Description

This function allows the user to open the watchdog relay.

Remarks

The watchdog state under power-on is OFF. Then, it must be set to ON when the program starts.

The SECURITY function can also modify its behaviour.


WATCHDOGON

WATCHDOGON  Close the watchdog

Syntax

WATCHDOGON (0)

Description

This function makes it possible to the user to close the watchdog relay.

Remarks

The watchdog state under power-on is OFF. Then, it must be set to ON when the program starts.

The SECURITY function can also modify its behaviour.


WATCHDOG_S

WATCHDOG_S  Returns the watchdog state

Syntax

<Q> := WATCHDOG_S (0)

Accepted type

<Q> : BOOL

Description

This function returns the state of the processing watchdog


WDTASKRAZ

WDTASKRAZ  Reset the starting number of a task

Syntax

WDTASKRAZ (<Task>)

Accepted type

<Task> : tGroup

Description

This function resets the starting number of the watchdog of a task.
<Task> : task name


WDTASK_S

WDTASK_S  Returns the WD starting number of a task

Syntax

<Q> := WDTASK_S (<Task>)

Accepted type

<Task> : tGroup

Description

This function returns the number of starting of the watchdog of a task.
<Task> : task name


WHILE

WHILE  LOOP WHILE

Syntax

WHILE <expression> DO
<instructions>
END_WHILE

Accepted type

<expression> : BOOL

Description

The instructions between "DO" and "END_WHILE" will be executed as long as the boolean expression value is TRUE.
The condition is evaluated before execution of the instructions.
If the condition is FALSE at the first evaluation, the instructions will not be executed.

Warning

The loop instructions might block the cycle in an indefinite loop.

Example ST

iPos := 0;
WHILE iPos < iMax DO
 MyArray[iPos] := 0;
 iNbCleared := iNbCleared + 1;
END_WHILE;

Example FBD

Not available

Example LD

Not available

Example IL

Not available

See also

IF

REPEAT

FOR

CASE

EXIT


WORD

See elementary data types

Notes

This data type is defined by the IEC61131-3.


WRITECAM

WRITECAM  Write a cam in a table

Syntax

<Cam> := WRITECAM (<CamTable>)

Accepted Types

<CamTable> : tCamTable
<Cam> : tCam

Description

This function saves a cam table in CFCARD.
<CamTable> cam table (variables table that can be modified)

<Cam> cam name (saved in CF-CARD)

See also

READCAM


XOR

XOR  Exclusive OR operator

Syntax

<Q> := <IN1> XOR <IN2>

Accepted types

<IN1> : ANY_BIT
<IN2> : ANY_BIT
<Q> : ANY_BIT

Description

This function performs a binary Exclusive OR between two expressions and returns a value of the same type as the operand.

<IN1> et <IN2> must be of the same type.

Remark

XOR is defined by the norm IEC61131-3.

Example ST

Q := IN1 XOR IN2;
Q := IN1 XOR IN2 XOR IN3;

Example FBD

Example LD

(* contacts in parallel *)

Example IL

Op1: LD IN1
 XOR IN2
 ST Q (* Q = IN1 OR IN2 *)
Op2: LD IN1
 XORN IN2
 ST Q (* Q = IN1 OR (NOT IN2) *)

See also

AND

OR

NOT


XORN

XORN  Exclusive Operator OR with inverted input 2

See XOR with the inverted input 2


C10006

Data type 'REAL' is not supported.

Data type REAL is not supported by the active hardware. For a list of data types supported by the software MS see the IEC 1131-3 Compliance statement Please consult your hardware documentation for a list of data types supported by your hardware.


C10007

Data type 'DATE' is not supported.

Data type DATE is not supported by the active hardware. For a list of data types supported by software MS see IEC 1131-3 Compliance statement. Please consult your hardware documentation for a list of data types supported by your hardware.


C10009

Data type 'STRING' is not supported.

Data type STRING is not supported by the active hardware. For a list of data types supported by software MS see the IEC 1131-3 Compliance statement. Please consult your hardware documentation for a list of data types supported by your hardware.


C10008

Data type 'TIME_OF_DAY' is not supported.

Data type TIME_OF_DAY is not supported. For a list of data types supported by software MS see IEC 1131-3 Compliance statement. Please consult your hardware documentation for a list of data types supported by your hardware.


C10010

Data type 'DATE_Inst_AND_TIME' is not supported.

Data type DATE_Inst_AND_TIME is not supported. For a list of data types supported by software MS see the IEC 1131-3 Compliance statement. Please consult your hardware documentation for a list of data types supported by your hardware.


C10012

Data type 'TIME' is not supported.

Data type TIME is not supported by the active hardware. For a list of data types supported by software MS see the IEC 1131-3 Compliance statement. Please consult your hardware documentation for a list of data types supported by your hardware.


C10017

The sections 'VAR_INPUT', 'VAR_OUTPUT' and 'VAR_IN_OUT' are not supported in programs.

VAR_INPUT, VAR_OUTPUT and VAR_IN_OUT sections in programs are not supported. For more information about supported variable types see the IEC 1131-3 Compliance statement.


C10019

Directly represented variables are not allowed in this POU.

Either the program organization unit is a function or a function block or a file with global symbolic variable definitions. Directly represented variables are not allowed in functions or function blocks. If you want to access to a directly represented variable from a function block, declare the variable with a symbolic name in the VAR_GLOBAL section of a program and use this symbolic name in a declaration in the VAR_EXTERNAL section of the function block. Functions cannot access to directly represented variables.

Directly represented resource global variables have to be declared in a specific file.


C10021

Constant must not be negative.

A negative constant has been found where an unsigned operand has been expected. Please change the constant value or the variable type (if possible).


C10024

Constant is out of range.

The constant at the given position is not in the range of the associated data type.


C10025

IN/OUT parameters must always be supplied with actual parameters.

A formal in/out parameter has been declared in a function block, but not supplied with an actual parameter in the CAL statement of an instance. In/out parameters are references and must be supplied with an actual parameter.


C10026

Unsupported address.

The address at the given position is not supported by the active hardware. Please consult your hardware documentation for a list of addresses supported by the hardware.


C10028

Inout-parameters of type structure are not supported.

Structured in/out-parameters are not supported. Please define an input parameter and an output parameter of this kind.


C10031

RETAIN-variables are not supported by this hardware.

Your hardware doesnt support RETAIN variables. Please remove the attribute. For a list of supported variable types consult your hardware documentation.


C10034

Invalid command for this hardware.

The command at the given position is not supported by this hardware. For a list of unsupported commands please consult your hardware documentation. For a list of commands not supported by software MS see the IEC 1131-3 Compliance statement.


C10035

The operand/parameter must be of type 'UINT'.

An actual parameter of type UINT has been expected in a function call (operation), but the actual parameter is not of this type.

Example:

VAR

StringVariable : STRING;

Length : INT := 32;

END_VAR

LD EXAMPLE

LEFT length (* Error: This parameter must be of type UINT *)

ST StringVariable


C10036

Structures and arrays of complex data types are not supported by this hardware.

An array of a structured type, an array of an array type, a structure with a structured member or a structure with an array member has been declared. This is not supported by the hardware. For further information about supported data types for your hardware, consult your hardware documentation.

Example:

TYPE

DayOfWeek : STRUCT

Name : STRING;

DayNumber : UINT;

END_STRUCT;

DayDescriptions : ARRAY[1..100] OF DayOfWeek; (* Error: Day of Week is a complex data type

Array of complex data types are not supported by the hardware. *)

Presence : STRUCT

Name : STRING;

OursPerDay : ARRAY[1..31] OF UINT; (* Error: ARRAY is a complex data type.

A complex data structure is not supported by the hardware *)

END_STRUCT;


C10038

Couldn't detect the type of the constant.

The type of a constant could not be determined. Please initialise a variable of the expected type with this constant and use the variable instead of the constant.


C10043

Implementation code is not allowed.

Implementation code has been found in a file with resource global variable declarations. This is not allowed. Please declare the requested variable in another program organisation unit as an external variable and move the code in the respective file.

The implemented code is not authorized.


C10045

Function blocks instances are not allowed in this section.

An instance declaration of a function block has been found in a section where this is not allowed. Please move the declaration in a section, where function block instances are supported.


C10046

'VAR_GLOBAL' is not allowed.

A VAR_GLOBAL section has been found in a management program unit where this section kind is not supported. Please change the section kind or move the variable declaration in a file, where global variables are supported.

According to the IEC 61131-3 VAR_GLOBAL sections are supported only in PROGRAMs. However the hardware manufacturer may restrict the declaration of global variables to resource global variable files. I. e. global variables are allowed only in specific files which contain only global variable declarations.


C10047

Only 'VAR_GLOBAL' are allowed.

A variable declaration section, which is not a VAR_GLOBAL section, has been found in a file for resource global variable declaration. This is not allowed. Please change the section kind or move the variable declaration in another file, where this kind of declarations is supported.


C10049

String too long.

A string has been declared with a length specification, which exceeds the maximum string length supported by the hardware.

For the maximum string length supported by MS software see the IEC 1131-3 Compliance statement. However, the hardware-manufacturer can restrict the maximum string length by changing the value of the "MaxStringLength" parameter in the [MODULE] section of the hardware description file.


C10055

This variable can not be initialized.

Either an initialization of a directly represented variable has been found or the hardware doesnt support variable initializations. The initialization of directly represented variables is not supported by MS software. The initialization of symbolic variables can be forbidden by the manufacturer by changing the value for the "InitVariables" parameter in the [MODULE] section of the hardware description file to 0. Please consult your hardware documentation to find out, if variable initialization is supported by your hardware.


C10057

Data type is not supported.

The data type at the given position is not supported. For a list of data types supported by Software MS see the IEC 1131-3 Compliance statement. For a list of data types supported by your hardware, please consult your hardware documentation.


C10060

LD/ST of function block instances is not allowed.

A LD or ST instruction with a function block instance as an operand has been found. This is not allowed.


C10063

An error occurred while opening a file.


C10064

Internal Compiler Error No. %1. Please contact your manufacturer.

An internal compiler error occurred. Please contact your manufacturer.


C10067

Structure declarations are not supported.

A structure declaration has been detected, but is not supported by the hardware. Structure declarations are supported by software MS. The hardware manufacturer however, can forbid structure declarations by setting the value of the "StructAllowed" field in the [MODULE] section of the hardware description file to 0. Please consult your hardware documentation to find out if structure declarations are supported by your hardware.


C10068

Array declarations are not supported.

An array declaration has been detected, but is not supported by the hardware. Array declarations are supported by software MS. The hardware manufacturer however, can forbid array declarations by setting the value of the "ArrayAllowed" field in the [MODULE] section of the hardware description file to 0. Please consult your hardware documentation to find out if array declarations are supported by your hardware.


C10069

Enumerated data type declarations are not supported.

An enumerated data type declaration has been detected, but is not supported by the hardware. Enumerated data type declarations are supported by software MS. The hardware manufacturer however, can forbid these declarations by setting the value of the "EnumAllowed" field in the [MODULE] section of the hardware description file to 0. Please consult your hardware documentation to find out if enumerated data type declarations are supported by your hardware.


C10078

Invalid type of a global or directly represented variable.

A directly represented variable of a complex or an user defined type has been declared. This is not supported. Global variables of structured types are also not supported.


C10075

Invalid array index. It has to range between -32767 and 32767.

An array index is out of the supported range [-32767, 32767].


C10083

Only directly represented variables are allowed in this POU.

Resource global variables are separated in two kinds of files: Files which contain only symbolic variables and files which contain the directly represented variables. In these files symbolic and directly represented variables must not be mixed up.


C10084

Global structures are not supported.

Please declare this variable in a local section and use input and output parameters, if the value should be changed by a function or function block. The type declaration for the desired structure must be done on project level.

Example:

(*The following structure has to be declared as a project global type *)

TYPE

DayOfWeek : STRUCT

Name : STRING;

DayNumber : UINT;

END_STRUCT;

END_TYPE

FUNCTION_BLOCK AdjustDayName

VAR_INPUT

DayIn : DayOfWeek;

END_VAR

VAR_OUTPUT

DayOut : DayOfWeek;

END_VAR

LD DayIn

ST DayOut

LD DayIn.DayNumber

EQ 1

LD MONDAY

ST DayOut.Name

LD DayIn.DayNumber

EQ 2

LD TUESDAY

ST DayOut.Name

END_FUNCTION_BLOCK

PROGRAM main

VAR

Day : DayOfWeek;

DayNumber : UINT;

END_VAR

LD DayNumber

ST Day.DayNumber

CAL AdjustDayName(DayIn := Day | Day := DayOut)

END_PROGRAM


C10092

Memory allocation failure.


C10108

Constant of type TIME is out of range.

For the range of TIME constants supported by Software MS see the IEC 1131-3 Compliance statement.


C10109

Invalid data type for this operation. Integer or real type expected.

The operation at the given position is only supported for integer and real operands


C10100

Invalid expression for parameter.

An invalid expression has been passed as an actual parameter in a call of a function or a function block instance.


C10110

Nested functions are not supported.

A function call has been passed as an actual parameter in the call of a function or a function block instance. This is not supported. Please save the return value of the function in a variable and pass this variable as an actual parameter to the called program management unit.


C10112

Type conflict.

Either the current result is incompatible with the expected data type or the type of an actual parameter is incompatible with the type of the respective formal parameter.


C10113

Operation not supported for this data type.

The data type of an operand is not allowed for the operation at the given position. For more information about allowed data types for this operation see IEC 61131-3 and the IEC 1131-3 Compliance statement.


C10114

Parameter expressions are not supported for this operation.

An expression has been used as an actual parameter. This is not supported. Please store the result of the expression in a variable and pass this variable to the called function or function block.


C10115

Retain attribute for FB instances is forbidden.

RETAIN function block instances are not supported. Please remove the attribute or move the instance declaration out of this section.


C11007

Function has no input parameter. Is this intended?

A function call to a function with no parameters has been detected. Was this to be forecasted? Functions do not contain internal state information and can be supplied only with input parameters. Generally the return value is computed by using the input parameters. Because of these reasons a function without input parameters usually doesnt make sense. Please check if the called function makes sense.


L10001

Variable declared twice: <Variable name>.

The variable with the specified name has been declared twice.

Advice:

If the variable is declared in a PROGRAM POU, check if a resource global variable with the same name has been declared. If the variable is a resource global variable check if a global variable with the same name has been declared in a PROGRAM POU of the resource.

If one of the above cases is true, change the name of one of the variables or move the variable declaration in the PROGRAM POU in a VAR_EXTERNAL section. Warning: if you move the variable into the external section, every access to the external variable accesses to the resource-global variable with the same name.


L10004

Unresolved external: <Variable name>.

Either a global variable with the specified name has not been found, or a function block type with the specified name has not been found.

Advice:

Make sure that the variable name is correctly spelled.

If the variable is not a function block instance, make sure that a variable with this name is declared in the VAR_GLOBAL section of the calling program or in a file with resource-global variable declarations.

If the variable is a function block instance, make sure that the function block has been successfully compiled; i. e. an execution file for this function block exists.


L10026

Invalid address

The address <AddressDescription> is not supported by this hardware.

Advice:

Check if the address is correctly spelled.

Check if the syntax of the address description is correct. The syntax of the address description is hardware dependent, but must be a string formed with the percent sign "%" followed by a location prefix, a size prefix and one or more unsigned integers, separated by periods (.). The size prefix may be empty. For valid location and size prefixes consult your hardware documentation.


L10027

Invalid hardware description: %1..

The hardware description file for this peripheral name has not been found.

Advice:

· Check if the resource specification contains a valid hardware module name.

· Reinstall software MS. If this doesnt remove your error, consult your hardware documentation or refer to your hardware manufacturer.


L10029

Hardware configuration error.

An error occurred while reading firmware information. Please check if the hardware configuration file is correct or if the DLL for the specified firmware is installed in your MS directory.

WARNING: This file should be only modified by the manufacturer.


L10030

Invalid type for variable: %1.

A directly represented variable of a complex type (array, structure, string) has been found. This is not supported by the hardware.


L10031

Initialisations of directly represented variables are not allowed.

An initialisation of a directly represented variable has been found. This is not supported by the hardware. Please remove the initialisation.


L10032

Address <AddressDescription> invalid in this context.

The address with the specified description is a valid address but not allowed in this context (Task, POU, Resource, Configuration).


L10033

Attribute RETAIN not supported for directly represented variables.

A directly represented variable with RETAIN attribute has been found. This is not supported by the hardware. Please move the variable declaration in another section or remove the attribute from the section.


L10034

Attribute CONST not supported for the variables directly represented.

A variable directly represented with attribute CONST was found. This one is not supported by the material. Please move the declaration of variable in another section or remove the attribute of the section.


L10035

Instance limit for function block <FunctionBlockName> reached.

The maximum number of instances of the specified function block has already been exceeded. The maximum number of instances of a firmware function block is hardware dependent and can be changed by the hardware manufacturer by setting or changing the "MaxInstances" input in the specifications section of the function block in the hardware description file. Please consult your hardware documentation, for the maximum number of instances of a firmware function block.


L10036

Invalid process image description. Please contact your manufacturer.

The description of the process image in the hardware configuration file is invalid. Please check if the sizes for the input, output and marker sections are correct and if all size inputs are of the same unit. They should be specified either in bits or bytes.

WARNING: This file should be only modified by the manufacturer.


L10063

An error occurred while opening a file: %1.


L10105

Internal error while loading function or DLL: <DLL/Function-Name>.

The DLL or specified function could not be loaded. Either your MS directory does not contain a DLL with the specified name, or your DLL has an invalid version. Please reinstall your system or consult your hardware description.


L10106

Native code compiler needed for selected optimization. Please choose another optimization or install a native code compiler.

"Speed only" optimization is activated but no native code compiler is defined for this hardware. "Speed only" optimisation is only valid, if a native code compiler is installed. If you do not have a native code compiler please select another optimization in the "Edit Resource Specifications" dialog. For a native code compiler for your hardware please refer to your manufacturer.


L12001

Type conflict. Type of external variable doesn't match with type of the global variable with the same name.

A global variable with the same name as the external variable has been found, but the types of the global and the external variable are different.

Advice:

Make sure that the external variable name is correctly spelled.

Make sure that the type of the external variable is correctly spelled.

Make sure that the global variable is the requested variable.

Change the type of the external or global variable.


L12002

Readable access to this variable is not allowed: <Variable name>.

A read access to a variable that has only write access has been attempted.

Advice:

Make sure that the specified variable name is correctly spelled.

The specified variable is a constant. Write access to a constant variable is not allowed. Check if the CONSTANT attribute can be removed from the variable.

The specified variable is an output location. A read access to this output location is not allowed


L12003

Writable access to this variable is not allowed: <Variable name>.

A write access to a variable that has only read access has been attempted.

Advice:

Make sure that the specified variable name is correctly spelled.

The specified variable is a constant. Write access to a constant variable is not allowed. Check if the CONSTANT attribute can be removed from the variable.

The specified variable is an input location. A write access to this input location is not allowed


L12005

Internal linker error no.: <errorno>. Please contact your manufacturer.


L12006

Memory allocation failure. Not enough memory to perform operation.


L12007

No object information found for task <TaskName>. Please rebuild all.

The object file (<TaskName>.crd) for the specified task has not been found. Please completely rebuild the resource.


L12008

Interpreter stack overflow in task <TaskName>.

Interpreter call-stack-overflow. Please reduce the depth of the calling hierarchy of <TaskName>.


L12996

Unknown command: <Command>.

An unknown command line argument has been used with ITLINK.


L12997

Unkown object kind: <ObjectKindSpecification>.

An invalid object file has been found. Please completely rebuild the resource.


L12998

Invalid object kind. Kind found/requested: <ObjectKind>.

An invalid object file has been found. Please completely rebuild the resource.


L12999

Invalid object version found. Object version found/expected: <ObjectVersion>.

The object file version and the compiler object version are different. The object file has been created with a different compiler version. Please completely recompile the resource.


L13000

Load of resource global variable information failed.

The execution file with the resource global information has not been found. Please completely rebuild the resource.


L13001

No object information found for pou <pouname>

The execution file (<pouname>.obj) for the specified POU has not been found. Please completely rebuild the resource.


S1000

Nested comments are not allowed.

You are using an IEC 61131-3 compatible version. In this version nested comments are not allowed.


S1001

Invalid character.

An unsupported character was used. See also Table 1: Character set features


S1002

End of file found in comment.

The end of the file was reached before an open comment has been closed. Please close the comment before calling the syntax check.


S1003

Reserved keyword.

A reserved keyword was used an identifier


S1004

Invalid value for hour.

The numeric value for the hour unit of a TIME_OF_DAY OR DATE_Inst_AND_TIME literal must be an integer in the range [0, 23].


S1005

Invalid value for minute.

The numeric value for the minute unit of a TIME_OF_DAY ou DATE_Inst_AND_TIME literal must be an integer in the range [0, 59].


S1006

Invalid value for second.

The numeric value for the seconds unit of a TIME_OF_DAY or a DATE_Inst_AND_TIME literal must be a fixed point number in the range [0, 60).


S1008

Invalid value for month.

The numeric value for the month unit of a TIME_OF_DAY or a DATE_ Inst_AND_TIME literal must be an integer in the range [1, 12].


S1009

Invalid day range.

The numeric value for the day unit of a TIME_OF_DAY ou DATE_Inst_AND_TIME literal must be an integer in the range [1, 31], giving the day of the month. I. e. if the respective month has less than 31 days, the maximum number of day is the greatest valid value of the month.


S1010

Exponent too large.

The numeric value for the exponent of a real literal must be an integer in the range [37, 38] and for a LREAL literal an INT in the range [307, 308].


S1011

Incorrect direct address.

The numeric value for a location field in the hierarchical address of a directly represented variable is hardware dependent integer, but must not exceed 4294967295. Please consult your hardware documentation to determine the maximum value for each field in the address hierarchy.


S1012

Invalid day entry.

The numeric value for the day unit of a TIME literal must be a fixed point number in the range [0, 255].


S1013

Invalid hour entry.

The numeric value for the hour unit of a TIME literal must be a fixed point number in the range [0, 24] if the hour is not the most significant unit of the duration literal. An overflow is only permitted if the hour unit is the most significant unit of the TIME literal.

Example:

T#25h_15m is authorized.

T#1d_25h_15m is not authorized. The correct representation of this duration literal is: T#2d_1h_15m.


S1014

Invalid minutes entry.

The numeric value for the minute unit of a TIME literal must be a fixed point number in the range [0, 60] if minute is not the most significant unit of the duration literal. An overflow is only permitted if the minute unit is the most significant unit of the TIME literal.

Example:

T#75m is authorized.

T#5h_75m is not authorized. The correct representation of this duration literal is: T#6h_15m.


S1015

Invalid seconds entry.

The numeric value for the seconds unit of a TIME literal must be a fixed point number in the range [0, 60] if seconds are not the most significant unit of the duration literal. An overflow is only permitted if the seconds unit is the most significant unit of the TIME literal.

Example:

T#75s is authorized.

T#5m_75s is not authorized. The correct representation of this duration literal is: T#6m_15s.


S1016

Invalid milliseconds entry.

The numeric value for the milliseconds unit of a TIME literal must be a fixed point number in the range [0, 1000] if the milliseconds are not the most significant unit of the duration literal. An overflow is only permitted if the milliseconds unit is the only significant unit of the TIME literal.

Example:

T#1200s is authorized.

T#1s_1200ms is not authorized. The correct representation of this duration literal is: T#2s_200ms.


S1017

Direct address too complex.

The maximum number of location fields in the address hierarchy of a directly represented variable is hardware dependent but must not exceed 8. Please consult your hardware documentation to determine the maximum depth of the address hierarchy.


S1018

Integer constant too large/small.

A constant value must be in the range of representative values for its type. The type of an integer constant depends on the type of the variable of which constant is assigned to but must not exceed the range of a LINT/ULINT (8 byte integer/unsigned integer).


S1019

Integer constant too large/small (does not fit into 32 bits).

The numeric value of the given constant exceeds the range of values of type DINT/UDINT.


S1020

Numeric value too large/small.

A constants value must be in the range of representative values for its type. The type of a signed integer constant depends on the type of the variable the constant is assigned to but must not exceed the range of a LINT (8 byte integer).


S1021

Error while processing of a floating coma function of the math library.


S1022

Invalid string constant.

The given string constant contains an invalid character. A character string literal is a sequence of zero or more characters prefixed and terminated by the single quote character (). All valid characters are printable characters except $. The three-character combination beginning with the dollar sign ($) followed by two hexadecimal digits shall be interpreted as an hexadecimal representation of the eight bit character code as shown in table Character string literal feature.

Additionally, two-character combinations beginning with the dollar sign shall be interpreted as shown in table Two-character combinations in character strings when they occur in character strings.


S1024

Invalid constant.

The given constant contains invalid characters.

For a list of valid constant representations see Table 53: Function block invocation features for IL language.


S1025

Invalid direct address.

A directly represented variable contains invalid characters.

The direct representation of a variable shall be declared by the concatenation of the percent sign "%", a location prefix, an optional size prefix and one or more unsigned integers separated by periods (.)

The manufacturer shall specify the correspondence between the direct representation of a variable and the physical or logical location of the addressed item in memory, input or output. When a direct representation is extended with additional integer fields separated by periods, it shall be interpreted as a hierarchical physical or logical address with the far left field representing the highest level of the hierarchy, with successively lower levels appearing to the right. For example, the variable %IW2.5.7.1 may represent the first "channel" (word) of the seventh "module" in the fifth "rack" of the second "I/O bus" of a programmable controller system.

The use of directly represented variables is only authorized in programs. The maximum number of levels of hierarchical addressing is hardware dependent and must not exceed 8.

Please consult your hardware documentation to determine the maximum levels of hierarchical addressing.


S1026

Invalid identifier (name, variable, parameter,...)

An identifier contains one or more invalid characters.

An identifier is a string of letters, digits, and characters _ which shall begin with a letter or character _. The letters can be upper or lower case. Multiple leading or multiple embedded underlines are not allowed.

Spaces in the identifier are not allowed.


S1027

End of file found in file header.

An error occurred while reading the file header. You can correct this error, by opening the file with a text editor and removing all lines preceding the PROGRAM, FUNCTION or FUNCTION_BLOCK keyword. If this error occurs more often, please contact your manufacturer.


S1028

This identifier is too long (> 64 characters).

The length of an identifier is greater than the maximum supported length. In this implementation only identifiers lower or equal to 64 characters are supported.


S1029

This word (identifier, constant literal, string, comment) is too long (> 1024 characters).

A word (identifier, constant literal, string, comment) exceeds 1024 characters. In this implementation of execution, only up to 1024 characters are supported.


S1030

Too many identifiers.

The maximum number of identifiers has been exceeded. Maximum 65535 identifiers are supported


S3001

Fonction not present.

A call to an unknown function has been found.

A function must be declared before it can be used. The parameters that a function uses must be specified in a declaration, or prototype, before the function can be used.

Advice:

Make sure that the file containing the declaration or prototype of the function is in the area of the project or that the function is part of the firmware.

Make sure that the function name is correctly spelled.


S3002

Incorrect parameter.

The requested parameter was not found in the formal parameter list of the function block.

Advice:

Make sure that the parameter name is correctly spelled.

Make sure that the parameter list of the function block-definition contains a parameter with the name used in the task.


S3003

Label jump not present.

A JMP instruction to an unknown label has been found.

A label has to be defined in the instruction unit of the program unit in which it is used.

Advice:

Make sure that the label is defined in the same program.

Make sure that the name of the label is correctly spelled.


S3004

Attribution multiple de variable/nom..

The given identifier was defined more than once.

Advice:

Make sure the identifier has not been defined twice in the same program.

Make sure the identifier has not been used in a user type declaration, a global type declaration or as a function, function block or program name.


S3005

This is not a function block instance.

A variable with the name used in a CAL-statement has been found but is not an instance of a function block.

Advice:

Make sure that the identifier is correctly spelled.

Make sure that a function block instance with the specified name has been declared either in the scope of the program unit or in the global scope.


S3006

This is not a structure variable or a function block instance.

An access to a member of a structure or function block variable has been attempted, but the variable specified by the identifier is not a function block or a structure.

Advice

Make sure that the identifier is spelled correctly.

Make sure that the variable with the given name is a structure or a function block.


S3007

This is not a FUNCTION-POU.

An identifier used as a function name has been defined but is not a function name.

Advice

Make sure that the identifier is correctly spelled.

Make sure that the identifier is the name of the function and not the name of a function block.

Make sure that at the requested position it is a use of function and not a call of a function block instance.


S3008

Any structure element or block parameter.

An access to a member of a structure or function block variable has been attempted, but the member specified by the identifier is not a parameter of the function block or structure instance.

Advice

Make sure that the identifier is correctly spelled.

Make sure that the right function block or structure instance is used.

If the accessed variable is an instance of a function block, make sure that the function block has a parameter with the name given by the identifier.

If the accessed variable is an instance of a structure, make sure that the structure has a member with the name given by the identifier.


S3009

No jump label.

The identifier used in the JMP/JMPC/JMPCN-statement at the given position has been found but is not a label name.

Advice

Make sure that the identifier is correctly spelled.

Make sure that identifier used after the JMP/JMPC/JMPCN-statement is a label name.


S3010

Type or function block name expected.

A type or a function block name has been expected. The identifier has been found in the current scope but is neither a type nor a function block name.

Advice:

Check if the name is correctly spelled.

Make sure that the identifier is not a variable name (e. g. a function block name).


S3011

Identifier is not a variable or type name.

A variable or a function block instance has been expected. The identifier has been found in the current scope but is neither a variable nor a function block instance.

Advice:

Check if the name is correctly spelled.

Make sure that the identifier is not a type name (e. g. a function block name).


S3012

Variable name or constant expected.

This error occurs, if an identifier, which is not a variable name or an enum constant, is used where a variable name or a constant is expected.

Example:

TYPE

Colours : (red, yellow, blue) := red;

END_TYPE

VAR

Colour : Colours := Colours; (* Error: expected enum constant.

EnumType is of name type *)

END_VAR

LD Colours (* Error: Constant or expected name of variable. EnumType is of type name *)

ST Colour


S3014

Numeric data type was expected.

Operator and operand type are incompatible. An operand of an ANYNUM type was expected.

L'opérateur et le type d'opérande sont incompatibles. Un opérande d'un type ANYNUM était attendu.


S3017

Boolean value type was expected.

Operator and operand type are incompatible. An operand of type BOOL was expected.


S3016

Bit data type was expected.

Operator and operand type are incompatible. An operand of an ANYBIT type was expected


S3018

Numeric data type was expected.

Illegal operand type. Operand of an ANYNUM type expected.


S3019

Incompatible operand types.

Operand and result types are incompatible.


S3020

Operand types incompatible.

This error occurs if an illegal combination of time and date data types is used for the input parameters of a SUB operation. For allowed combination of the input and output data types for this operation see Table 30 - Functions of time data types in the IEC 1131-3

Example:

VAR

TimeVar : TIME;

DateVar : DATE;

END_VAR

LD DateVar

SUB TimeVar (* Error: SUB is not defined for the this combination of input parameters *)

ST DateVar


S3022

Type dopérande invalide pour cette opération.

Nonvalid type of operand for the operation with the position indicated. An operand of the TIME type or ANYNUM is expected.


S3023

Invalid operand type for this operation.

Invalid operand type for the operation on the specified position. An operand of type TIME, TIME_OF_DAY, DATE_Inst_AND_TIME or ANYNUM type was expected.


S3024

Invalid operand type for this operation.

Invalid operand type for the operation on the specified position. An operand of an ANYBIT type has been expected


S3025

Boolean result required.

Incompatible result type. The result should be of BOOL type.


S3026

Undeclared identifier.

This error occurs, if the identifier at the given position has not been defined in the valid scope for the compiled program organisation unit.

Example:

TYPE

Colours: (red, yellow, blue) := red;

END_TYPE

VAR

Colour: Colours: = green; (* Error: green has been declared as an enum constant *)

END_VAR

LD IntVar (* Error: IntVar has not been declared. *)

ADD 5

ST IntVar


S3028

Comparison not defined for the data type of the current result.

The comparison on the given position is not defined for the type of the current result. I. e. the type of the actual parameter is incompatible with the type of the first formal parameter. For more information see Table 28 - Standard comparison functions in the IEC 1131-3 Compliance Statement.

Nondefinite comparison for the data type of the current result.

Example:

TYPE

Day_of_Week : STRUCT

Name : String;

DayNon : INT(1..7);

END_STRUCT;

END_TYPE

VAR

DayVar1 : Day_of_Week;

DayVar2 : Day_of_Week;

BoolVar : BOOL;

END_VAR

LD DayVar1

GT DayVar2 (* Error: comparisons on structured variables not allowed *)

ST boolVar


S3030

Comparison not defined for this type.

The type of the operand at the given position is not allowed for comparisons. I. e. the type of the actual parameter is incompatible with the type of the formal parameter. For more information see Table 28 - Standard comparison functions in the 1131-3 Compliance Statement.

Example:

TYPE

Day_of_Week : STRUCT

Name : String;

DayNon : INT(1..7);

END_STRUCT;

END_TYPE

VAR

DayVar1 : Day_of_Week;

DayVar2 : Day_of_Week;

BoolVar : BOOL;

END_VAR

LD DayVar1

GT DayVar2 (* Error: comparisons on structured variables are not allowed *)

ST boolVar


S3032

Self-referencing (i.e., recursive) declarations are not allowed.

A recursion has been detected. A function cannot be called itself recursively, neither directly nor indirectly (i. e. by calling another function, that calls one of the functions in the calling hierarchy). Function blocks and programs cannot declare instances of themselves, neither directly nor indirectly (i. e. by calling an instance of another function block that declares an instance of a function block type in the calling hierarchy).


S3033

Operand of type TIME expected.

A constant or a variable of type TIME was expected and the operand at the given position is of another type.

Example:

VAR

StartTime : TIME_OF_DAY;

StopTime : TIME_OF_DAY;

RunTime : TIME := T#10s;

END_VAR

LD StartTime

ADD 10000 (* Error: the operand must be of type TIME *)

ST StopTime

LD StartTime

ADD RunTime (* Correct *)

ST Stop Time


S3034

String too long for the variable.

A literal string has been assigned to a string variable but the literal string does not fit in the string variable. I. e. the length of the literal string is greater than the allocated length of the string variable.


S3035

Unallowed operand type for this function! Numeric operand or operand of date or time type expected.

The operation at the given position is not defined for the type of the current result (i.e. the first actual parameter).

Example:

VAR

BitMake: WORD;

END_VAR

LD BitMask (* Error: the operand must be of type TIME, ANY_DATE or ANY_NUM *)

SUB 3

ST BitMask


S3036

Integer constant is out of range.

The integer constant at the given position is not in the range of the associated data type.

Example:

VAR

Range1 : UINT(-1..1000); (* Error: Sign mismatch. Values for UINT must not be negative *)

Range2 : INT(-1..36000); (* Error : Overflow: the upper range is greater than the

Maximum value of type INT*)

END_VAR


S3037

The lower bound of the subrange must not be greater than the upper bound.

The value of the upper bound in the subrange declaration on the specified position is lower than the value of the lower bound. The lower and greater values of a subrange are of an integer type and the upper limit has to be greater than the lower limit.


S3038

Initialisation is out of bounds of subrange (Data type is a subrange type).

A variable of a subrange type has been initialised with a value that is out of the range of this subrange type. A subrange declaration specifies that the value of any data element of this type can only take values between and including the specified upper and lower limits.


S3039

The index is out of bounds.

An access to a variable of an array type has been attempted with an index whose value is out of the range specified in the type or variable declaration.


S3040

Invalid data type. ANY_NUM required.

The operation at the given position is not defined for the type of the current result (i.e. the first actual parameter).

Example:

VAR

BitMake: WORD;

END_VAR

LD BitMask (* Error: the operand must be of type TIME, ANY_DATE or ANY_NUM *)

NEG

ST BitMask


S3041

Unallowed EN/ENO type. Must be of type bool. Must not be RETAIN.

An input variable with the name EN or an output variable with name EN has been declared with an illegal type or with the RETAIN qualifier.

The identifier EN is reserved for input variables of type BOOL

The identifier ENO is reserved for output variables of type BOOL This variable must not be declared with RETAIN qualifier.


S3042

Missing EN. Use of ENO allowed only in combination with EN.

An output variable with the name ENO has been defined but no input variable with name EN has been found. The output variable ENO can only be used in combination with EN.


S3044

Data missing. You either need a load or an expression.

The current result is undefined. Either a LD instruction or an expression must precede the instruction on the current position. This error occurs as a consequence of error Syntax Error S5010 . Please move the instruction out of the brackets.


S4000

'AT%': Simultaneous declaration of several direct variables is invalid.

A list of identifiers has been used in a located variable declaration. Direct representations can only be associated to a single identifier.

Example:

The following declaration is not allowed:

VAR

dirVar1, dirVar2, dirVar3 : at%I0.0;

END_VAR


S4001

Too many variables (identifiers). Maximum is 60 identifiers.

Too many identifiers in the identifier list of a variable declaration. Only an identifier lists with maximum 60 identifiers are supported.


S4003

Array too big.

The elements number of a dimension in an array declaration exceeds the maximum number of elements supported by MS software. The maximum elements number is determined by the type index array.


S4005

Upper bound must be greater or equal than lower bound.

The value of the upper bound index in the array declaration on the specified position is lower than the value of the lower bound index of the same dimension. The upper bound index of a dimension must be greater or equal than the associated lower bound index.


S4006

Syntax error. [Advice: In certain cases, the actual error is located in a previous line (';' missing etc.)].


S4007

Self-referencing (i.e., recursive) declarations are invalid.

A recursion has been detected. A function cannot be called recursively, neither directly nor indirectly (i. e. by calling another function, that calls one of the functions in the calling hierarchy). Function blocks and programs cannot declare some examples of themselves, neither directly or indirectly (i. e. by calling an instance of another function block that declares an instance of a function block type in the calling hierarchy).


S4008

Too many attributes 'RETAIN' or 'CONSTANT'. You may use only one.

Too many qualifiers used in a variable declaration.


S4009

A STRUCTure must contain at least one structure element (variable declaration).

An empty structure has been declared. This is not allowed. A structure must contain at least one member variable.

Example:

Not allowed:

TYPE

Mastructure : struct end_struct;

END_TYPE

Allowed:

TYPE

Mastructure : STRUCT

M1 : int;

END_STRUCT

END_TYPE


S4010

Simultaneous type declarations are not allowed.

The type declaration on the specified position contains a list of identifiers. This is not allowed. Please write an identifier for any new type.

Exemple:

Not allowed:

TYPE

MonInt1, MonInt2, MonInt3 : int;

END_TYPE

Allowed:

TYPE

MonInt1 : int;

MonInt2 : int;

MonInt3 : int;

END_TYPE


S4011

Valid only in PROGRAMs and there within VAR- and VAR_GLOBAL-Sections.

A directly represented variable has been declared in a program organization unit or a variable declaration zone in which it is not supported. Located variable declarations are supported only in VAR- or VAR_GLOBAL of PROGRAMs.


S4012

Valid only in PROGRAMs, FUNCTION_BLOCKs, and in FUNCTIONs.

An element of the variable declaration (VAR <declarations> END_VAR) has been found in a unit where it is not supported. Variable declaration elements are allowed in programs, functions and function blocks.


S4013

Valid only in PROGRAMs, FUNCTION_BLOCKs, and in FUNCTIONs.

An element of the input variable declaration (VAR_INPUT <declarations> END_VAR) has been found in a program organization unit where it is not supported.


S4014

Valid only in PROGRAMs and in FUNCTION_BLOCKs.

An element of a variable declaration of E/S (VAR_IN_OUT <declarations> END_VAR) has been found in a program organization unit where it is not supported.


S4015

Valid only in PROGRAMs and in FUNCTION_BLOCKs.

An element of output variable declaration (VAR_OUTPUT <declarations> END_VAR) has been found in a program organization unit where it is not supported.


S4016

Valid only in PROGRAMs and FUNCTION_BLOCKs.

An element of external variable declaration (VAR_EXTERNAL <declarations> END_VAR) has been found in a program organization unit where it is not supported. External variable declarations are supported in PROGRAMs and FUNCTION_BLOCKs


S4017

Valid only in PROGRAMs.

An element of global variable declaration (VAR_GLOBAL <declarations> END_VAR) has been found in a program organization unit where it is not supported. Global variable declarations are allowed in PROGRAMs only


S4018

Valid only in VAR- and in VAR_GLOBAL-Sections.

A CONSTANT has been used in a variable declaration unit in which it is not supported.


S4019

Valid only in PROGRAMs or in FUNCTION_BLOCKs and within sections VAR-, VAR_OUTPUT-, or VAR_GLOBAL.

A RETAIN has been employed in a zone of declaration of variable in which it is not supported.


S4020

Valid only in PROGRAMs or in FUNCTION_BLOCKs and within sections VAR_INPUT having 'BOOL' type without initialization).

A variable has been declared with an edge qualifier in a program organization unit or variable declaration unit where it is not supported.


S4021

Valide seulement dans les sections VAR_ENTRÉE, VAR_OUTPUT, et VAR_IN_OUT.

A variable has been declared with the ADDRESS qualifier in a program organization unit or variable declaration unit where it is not supported


S4022

Valid only in FUNCTION_BLOCKs or FUNCTIONs and within VAR..END_VAR-Sections without CONSTANT/RETAIN.

A variable has been declared with the ATTRIBUTES qualifier in a program organization unit or variable declaration unit where it is not supported. This attribute is supported only in VAR-Sections without CONSTANT or RETAIN qualifiers of FUNCTIONs and FUNCTION_BLOCKs.

Note: Keyword ATTRIBUTES is supported by MS software in special versions to define additional attributes for variables in extension to IEC61131-3. You should not see this message in standard MS software.


S4023

Valid only in TYPE..END_TYPE-Sections.

A structure declaration has been found in a declaration part where it is not supported. Structure declarations are supported only in TYPE declaration elements.


S4024

Valid not within VAR_EXTERNAL-Sections.

A variable has been declared in an EXTERNAL declaration section with an initial value. It is not allowed. Please assign the initial value in the respective GLOBAL variable declaration.

Example:

VAR_EXTERNAL

A : INT := 5;

END_VAR

VAR_EXTERNAL

A : INT;

END_VAR

VAR_GLOBAL

A : INT := 5

END_VAR


S4033

Multiple initialization.

A member of a structure variable has been initialised more than once. This error occurs when both an explicit structure initialization and an initialization per element are made.

Example:

The following initialisation is not allowed:

TYPE

StructType : Struct

Member1 : int := 5;

Member2 : bool;

END_STRUCT := (Member1 := 4, Member2 := true);

END_TYPE

Use one of the following initialisations:

TYPE

StructType : Struct

Member1 : int ;

Member2 : bool;

END_STRUCT := (Member := 4, Membre := true);

END_TYPE

or

TYPE

StructType : Struct

Member1 : int := 5;

Member2 : bool := true;

END_STRUCT;

END_TYPE


S4034

Non valid POU name.

This error occurs when a keyword has been used as a POU name or if no name has been defined.


S4035

Invalid Typefor a function.

The function type must be a predefined type or an identifier. This error occurs most commonly, when a keyword, a IEC61131-3 character string or a number is used as a function type or if no function type has been defined


S4036

FUNCTIONs need at least an input parameter VAR_INPUT.

A function has been defined without an input parameter. In IEC61131-3 a function needs at least one input-parameter


S5000

Wrong parameter type.

The type of an actual parameter of a function or a function block instance is incompatible with the type of the formal parameter it has been assigned to.


S5001

Expected array. This is not an array.

An indexed access has been attempted to a variable which is not an array.

Example:

PROGRAM

VAR

x : INT;

y : INT;

END_VAR

LD x[3] (* not authorized if the variable is not an array *)

ST y

END_VAR


S5002

This FUNCTION_BLOCK is called by CAL if EN=TRUE. CALC/CALCN are both invalid.

An instance of a function block with an EN input parameter has been called via CALC/CALCN. This is not allowed. Use the CAL instruction instead. The code of a function block with an EN parameter is called if the value of this parameter is TRUE.


S5003

Function block instance may not be 'CONSTANT.

An instance of a function block has been defined in a variable section with CONSTANT attribute. This is not allowed. Please remove the attribute or move the instance declaration in another variable section, which has no CONSTANT attribute.


S5004

The function blocks instances are invalid in 'FUNCTION'-POUs, STRUCTs, and in ARRAYs.

An instance of a function block has been defined in a variable section of a function or as a member of a STRUCT or an ARRAY type. IEC61131-3 doesnt allow declarations of function block instances in functions. Function block instances as members of STRUCT and ARRAY types are not supported by the software MS.


S5005

Function block instances as function result is not supported.

Function block instances as result type of a function is not supported in MS software.


S5006

Function block instance as parameter is not supported.

Parameters of a function block type are not supported in MS software.


S5008

Expected an integer or an enum. Invalid array index.

The type variable or constant used as an index in an filed variable access is invalid. An index must be of type INT or of an enumeration type.


S5009

Invalid sequence beginning. Current result is empty. Use 'LD' to initialise current result.

This error occurs when a sequence of statements starts with an instruction that uses the current result. The first instruction is usually a load statement. This error can also occur, if the current result is used in the first instruction after a CAL, a JMP or a label.

Example:

PROGRAM main

VAR

Switch : BOOL;

END_VAR

ST Switch (* Error: The current result courant is undefined. *)

LD Switch

EQ TRUE

JMPC NextStep

LD TRUE

JMP End (* The value loaded in the previous statement will be lost after the JMP-statement *)

NextStep:

LD FALSE

END:

ST Switch (* Error: Current result is undefined after a label *)

(* Code *)

END_PROGRAM


S5010

Invalid instruction within a brackets calculation.

The instruction at the given position is not allowed between parentheses. Please replace the instruction or move it out of the brackets.

Example:

FUNCTION_BLOCK Count

VAR_INPUT

StartValue : DINT;

FReset : BOOL;

END_VAR

VAR_OUTPUT

CurrentCountValue : DINT;

END_VAR

VAR

CountValue : DINT;

END_VAR

LD fReset

EQ TRUE

JMPCN Continue

LD StarValue

ST CountValue

Continue:

LD CountValue

ADD 1

ST CountValue

ST CurrentCountValue

END_FUNCTION_BLOCK

PROGRAM main

VAR

Counter : Count;

StartValue : DINT;

Result : DINT;

END_VAR

LD 5

ADD (StartValue

ST Counter.StartValue

EQ 1000

ST Counter.fReset

CAL Counter (* Error: CAL is not allowed in the brackets *)

LD Counter.CurrentCounter (* Error: Load is not allowed in the brackets *)

)

ST Result

END_PROGRAM.


S5011

ARRAYs of function block instances are invalid.

Arrays of function blocks are not supported


S5012

Result type and operand type are incompatible.

The result type of the previous operation and the type of the variable in which this result is stored are incompatible.

Example:

VAR

X : INT;

END_VAR

LD 65000

ST x (* 65000 is not of type INT *)


S5013

Result type and type of the first formal input parameter are incompatible.

The result type of the previous operation and the type of the first input parameter in a function or function block call are incompatible.

Example:

FUNCTION Fun1

VAR

InVar : INT;

END_VAR

(* Code *)

END_FUNCTION

PROGRAM main

VAR

X : DINT;

END_VAR

LD x

ADD 1000

Fun1 (* Error: Type of result of the previous operation is a DINT, the type of the first input parameter of Fun1 is a INT *)

ST x

END_PROGRAM


S5014

Wrong number of parameters.

Too many parameters found in a call of a function or a function block.


S5015

Invalid type for direct address.

A located variable has been declared with an unsupported type. Only located variables of type ANY_NUM or ANY_BIT are supported


S5016

Variable is read-only. Write-access invalid.

A write access has been attempted to a variable that has only read access.


S5017

The variable is not a STRUCTure.

An initialization value for a structure has been assigned to a variable which is not of a structured type.

Example.

VAR

A : INT := (m1 := 5, m2 := TRUE); (* not authorized *)

END_VAR


S5018

Variable is no array.

An array initialisation has been assigned to a variable which is not of an array type.

Example.

VAR

A : INT := [4]; (* not authorized *)

END_VAR


S5019

Initialization value and variable type incompatible.

The type of the initialization value and the type of the variable are incompatible

Example:

VAR

X : INT := 65000;

END_VAR


S5020

Too many initialization values.

The initialization value for an array type or variable has more elements as provided by the array declaration.

Example:

VAR

A : ARRAY [1..5] OF INT := [1, 2, 3, 4, 5, 6]; (*too many initialization values, array has only 5 elements *)

END_VAR


S5021

Formal parameter incorrectly declared.

The name of an output parameter has been expected. The identifier has been found in the current scope but is not the name of an output parameter.

Advice:

Check if the name is correctly spelled.

Make sure that the identifier is not an input or E/S parameter.


S5022

Multiple assignments to a parameter in a call of a function block instance.

This error occurs, when in a call of a function block instance a parameter is initialised twice.

Example:

FUNCTION_BLOCK Fb1

VAR_INPUT

InParam1 : int;

InParam2 : int;

InParam3 : bool;

END_VAR

(* Code *)

END_FUNCTION_BLOCK

PROGRAM main

VAR

fbInst : fb1;

END_VAR

(* Code *)

cal fbInst( InParam1 := 1,

InParam1 := 2,

InParam3 := true

)

(* Code *)

END_PROGRAM


S5023

Too much initialisation data.

This error occurs, when a member of a structure type or instance is initialised twice in an explicit structure initialization.

Example:

TYPE

StructType : STRUCT

Member1 : int;

Member2 : int;

Member3 : bool;

END_STRUCT;

END_TYPE

VAR

StructVar : StructType := (Member1 := 1, Member1 := 2, Member3 := FALSE);

END_VAR


S5024

Unallowed type for this operation.

The operation on the given position is not defined for the type of the current result. I. e. the type of the actual parameter is incompatible with the type of the first formal parameter

Example:

VAR

X : REAL;

END_VAR

LD 1 (* The constant 1 can be implicitly converted in an integer or a bit *)

LN (* Error: LN is only defined for the type ANY_REAL *)

ST X


S5025

Unallowed parameter type for this function.

The type of the actual parameter is incompatible with any type allowed for the parameter at the given position.

Example:

VAR

X : STRING;

END_VAR

LD EXAMPLE

LEFT 3.0 (* Error: the second parameter of LEFT has type UINT *)

ST X


S5026

Invalid formal parameter type.

The name of an input or E/S parameter has been expected. The identifier has been found in the current scope but is neither the name of an input nor of an output parameter.

Advice:

Check if the name is correctly spelled.

Make sure that the identifier is not an output parameter.


S5027

Incompatible operand types.

The operands for the operation at the given position must be compatible. I. e. they must have the same type or, if at least one of the parameter is a constant, an implicit cast identical to the type of the other operand can be possible.

Example:

VAR

X : REAL;

END_VAR

LD 1 (* The constant 1 can be converted implicitly in integer or bit *)

MAX X (* Error: X is of type REAL *)

ST X


S5028

Data type not allowed for this operation.

This error occurs, if the type of an actual parameter is not allowed for the operation at the given position.

Example:

VAR

StringVar : STRING;

END_VAR

LD 1

CONCAT EXAMPLE(* Error: CONCAT expects a STRING operand as first input parameter *)

ST StringVar


S5029

Invalid function block call.

This error occurs, if a call to a function block instance is attempted and this instance is an input parameter of the calling function block or program.

Example:

FUNCTION_BLOCK Fb1

VAR_INPUT

InParam1 : int;

InParam2 : int;

InParam3 : bool;

END_VAR

(* Code *)

END_FUNCTION_BLOCK

FUNCTION_BLOCK Fb2

VAR_INPUT

fbInstInput : Fb1;

(* other Input declarations *)

END_VAR

VAR

(* local variable declarations *)

END_VAR

(* Code *)

cal fbInstInput( InParam1 := 1,

InParam2 := 2,

InParam3 := true

)

(* Code *)

END_PROGRAM


S5030

Variable is write-only. Read-access invalid.

A read access has been attempted to a variable which has only write access.


S5031

Bit access allowed only on bit data types.

This error occurs if a bit selection is attempted on a variable that is not of a bit data type or of type BOOL.

Example:

VAR

DintVar : DINT;

BoolVar : BOOL;

END_VAR

LD DintVar.4 (*Error: bit selection allowed only on variables of type ANY_BIT except BOOL *)

ST BoolVar


S5032

Bit position is greater than the number of bits in the selected variable.

This error occurs, when the bit position given in a bit selection is greater than the number of the most significant bit of the selected variable. The number of bits accessible in a bit selection depends on the variables data type. The bit positions are counted from the least significant bit at position 0 to the most significant bit at position n  1, where n is the number of bits in the data type.

Example:

VAR

wVar : WORD := 5;

fVar : BOOL := FALSE;

END_VAR

(* Code *)

LD wVar.16 (*The selected variable is of type WORD. I. e. it has 16 bits with bit positions

From 0 to 15. *)

ST fVar

(* Code *)


S5033

IN_OUT parameter missing. Please supply every formal IN_OUT parameter with an actual parameter.

This error occurs, if at least one of the IN_OUT parameters of a function block is not supplied with an actual parameter, when calling an instance of the respective function block. IN_OUT parameters are references and have to be supplied with an actual parameter in every call of a function block instance.

Example:

FUNCTION_BLOCK Fb1

VAR_IN_OUT

InOutParam1 : INT;

InOutParam2 : BOOL;

END_VAR

(* Code *)

END_FUNCTION_BLOCK

PROGRAM main

VAR

fbInst : fb1;

IntVar1 : INT;

IntVar2 : INT;

END_VAR

(* Code *)

cal fbInst() (*Error: none of the FB1 variables is supplied with an actual parameter *)

cal fbInst( InOutParam1 := IntVar1

) (* Error: the actual parameter for the second IN_OUT parameter is missing *)

cal fbInst ( InOutParam1 := IntVar1,

InOutParam2 := IntVar2

) (*Correct : every formal IN_OUT parameter of FB1 is supplied with an actual parameter *)

(* Code *)

END_PROGRAM


S5034

Invalid IN_OUT parameter. IN_OUT parameters must not be expressions or constants.

This error occurs, if an IN_OUT parameter is supplied with an expression or a constant value. This is not allowed because IN_OUT parameters are references.

Example:

FUNCTION_BLOCK Fb1

VAR_IN_OUT

InOutParam1 : INT;

InOutParam2 : BOOL;

END_VAR

(* Code *)

END_FUNCTION_BLOCK

PROGRAM main

VAR

fbInst : fb1;

IntVar1 : INT;

IntVar2 : INT;

END_VAR

(* Code *)

cal fbInst( InOutParam1 := IntVar1,

InOutParam2 := 5

) (* Error: the actual parameter for the second IN_OUT parameter is a constant *)

cal fbInst( InOutParam1 := IntVar1,

InOutParam2 := (IntVar1

ADD IntVar2)

) (*Error: the actual parameter for the second parameter IN_OUT is an expression. *)

cal fbInst ( InOutParam1 := IntVar1,

InOutParam2 := IntVar2

) (* Correct: Both parameters of FB1 are supplied with variables. *)

(* Code *)

END_PROGRAM


S5035

Generic data types are not allowed.

This error occurs, if an ANY data type is used in a variable or parameter declaration. The use of generic data types is allowed only for function overloading and type conversion in standard function or functions provided by the manufacturer.

Example:

FUNCTION IntegerToString : STRING

VAR_ENTRÉE

InVar : ANY_INT; (* Error: User-defined functions cannot be overloaded *)

END_VAR

(* Code *)

END_FUNCTION


S5036

Local types are not allowed in this variable section.

This error occurs, if a local user defined type is used in the declaration of a global or external variable or in the declaration of a parameter. Global and external variables as well as parameters have to be of a predefined type or of a global type. Global types are either hardware dependent types, provided by the firmware or project global user defined types.

Example:

PROGRAM main

TYPE

StructType : STRUCT

Member1 : BOOL;

Member2 : STRING;

END_STRUCT;

(* Other type definitions *)

END_TYPE

VAR_GLOBAL

GlobVar : StructType; (* Not authorized because StructType is not known in POU *)

(* Other global variables definitions *)

END_VAR

VAR

(* Local variables definitions *)

END_VAR

(* Code *)

END_PROGRAM

FUNCTION_BLOCK Fb1

TYPE

StructType : STRUCT

Member1 : BOOL;

Member2 : STRING;

END_STRUCT;

END_TYPE

VAR_EXTERNAL

GlobVar : StructType; (* Not authorized because StructType is not known in POU *)

(* Other external declarations *)

END_VAR

VAR_ENTRÉE

InVar : StructType; (* Not allowed because StructType is not known in other POUs *)

(* Other input declarations *)

END_VAR

(* Code *)

END_FUNCTION_BLOCK


S5037

Too many indices within the braces [....] of an array-access.

This error occurs, if an access to an array element is attempted with more indices as dimensions provided in the type definition of the elements data type.

Example:

PROGRAM main

TYPE

ArrayType : Array[1..5, 1..20] of INT;

(* Other type definitions *)

END_TYPE

VAR

ArrayVar : ArrayType;

IntVar : INT;

(* Other variables definitions *)

END_VAR

LD ArrayVar[1, 2, 3] (* Error: Variable of type Array has only 2 dimensions *)

ST IntVar

(* Code *)

END_PROGRAM


S5038

Directly represented variables are not allowed as parameters in prototypes.

A directly represented variable has been declared in the VAR_INPUT, VAR_OUTPUT or VAR_IN_OUT section of a program organization unit. This is not allowed. Directly represented variables are not allowed in functions and function blocks. VAR_INPUT, VAR_OUTPUT and VAR_IN_OUT variables are not supported in programs.

If you want to access to a directly represented variable of a function block, declare the variable with a symbolic name in the VAR_GLOBAL section of a program and use this symbolic name in a declaration in the VAR_EXTERNAL section of the function block.

Functions cannot access to directly represented variables.

Example:

FUNCTION_BLOCK SetOutput

VAR_EXTERNAL

OutputLocation : BOOL;

END_VAR

VAR_INPUT

Value : BOOL;

END_VAR

LD Value

ST OutputLocation

END_FUNCTION_BLOCK

PROGRAM main

VAR_GLOBAL

OutputLocation AT%Q0.0 : BOOL;

END_VAR

VAR

Switch : SetOutput;

CurrentValue : BOOL;

END_VAR

LD CurrentValue

NOT

CAL Switch(Value := CurrentValue)

END_PROGRAM.


S5039

'&x' is only allowed if x is a direct variable.

The identifier preceded by the &-operator is not a name of a directly represented variable.

Advice:

Make sure that the name is correctly spelled.

Make sure that the variable is a directly represented variable


S5040

Too few indices within the braces [....] of an array access.

This error occurs, if an access to an array element is attempted with less indices as dimensions provided in the type definition of the elements data type.

Example:

PROGRAM main

TYPE

ArrayType : Array[1..5, 1..10, 1..20] of INT;

(* Other type definitions *)

END_TYPE

VAR

ArrayVar : ArrayType;

IntVar : INT;

(* Other variables definitions *)

END_VAR

LD ArrayVar[1, 2] (* Error: Variables of type Array have 3 dimensions *)

ST IntVar

(* Code *)

END_PROGRAM


S5041

Values of type INT24 or REAL48 are invalid in this context.

Operation not supported for this type


S5042

Function block instances musnt be 'RETAIN'.

An instance of a function block has been defined in a variable section with RETAIN attribute. This is not supported. Please remove the attribute or move the instance declaration in another variable section, which has no RETAIN attribute.


S6002

No prototype.

An unknown type name has been used in a variable declaration or a function call.

Advice

Make sure that a type, a function or function block with this name is declared in the context of the active project.

Make sure that the name of the type, function or function block is correctly spelled.

Recompile the whole project.

Please consult your hardware documentation if none of the above actions eliminates the problem


S6004

Recursion (i.e., direct or indirect self-reference) detected.

Recursion detected. A function cannot call itself recursively, neither directly nor indirectly (i. e. by calling another function, that calls one of the functions in the calling hierarchy). Function blocks and programs cannot declare instances of themselves, neither directly nor indirectly (i. e. by calling an instance of another function block which declares an instance of a function block type already used in the calling hierarchy).


S6005

Too many types and function blocks. For the maximum number of type definitions please consult your hardware documentation.

This error occurs, if too many types, functions or function blocks have been used in the calling hierarchy of a program organization unit. For the maximum number of types, functions and function blocks supported see the Table D.1: Implementation-dependent parameters


Les erreurs du MPC

MPC errors

The numbers of the detected errors are displayed on the display 7 segments of the MPC by ascending order with relooping on the first error.

A defect always begins with a triple E followed by the error code then a dash and finally an information code.

Ex : For an error of motor temperature E07 and a following error E12 on a drive having the node number 3, we will have :

Error coming from a drive IMD:

Code | Detail | Description
01 | Nr of driver | Overvoltage
02 | Nr of driver | Undervoltage
03 | Nr of driver | I2t
04 | Nr of driver | Over current
05 | Nr of driver | Short circuit
06 | Nr of driver | Temp IGBT
07 | Nr of driver | Temp Motor
08 | Nr of driver | Position return
09 | Nr of driver | Parameters
10 | Nr of driver | Drive model
11 | Nr of driver | DPL(doesnt exist)
12 | Nr of driver | Following error
13 | Nr of driver | Flash
14 | Nr of driver | FPGA
15 | Nr of driver | Over speed
16 | Nr of driver | Saturation resolver
17 | Nr of driver | Power 24V
18 | Nr of driver | Memory stick writing
19 | Nr of driver | Corrupt Memory Stick
20 | Nr of driver | Corrupt Memory Stick
21 | Nr of driver | Error "extern"

Configuration error Ethercat:

Code | Detail | Description
33 | Node nr | Unknown peripheral on the bus ethercat
34 | Node nr | Error on Version OS IMD [The flashage can fail because of an older boot on IMD]
35 | Node nr | Parameter error Motion IMD
36 | Node nr | Error Axis not found on the network
37 | Node nr | Error an address is used twice in the configuration
38 | Node nr | Error 2 IMD have the same address on their DIPs
39 | Node nr | Error parameter Motion Virtual (split of this error motion in order to differentiate an error on a physical périph and an error on a virtual periph)

Internal error MPC:

Code | Detail | Description
50 | 0 | Tasks IEC error
51 |  | Allocation segment BBM error
 | 0 | A segment containing saved variables is not global
 | 1 | A segment containing some saved variables is not global
52 |  | Error Out of BBM memory
 | 0 | No more place at the moment of the reservation of segments in BBM (independant of data sent in the program) Indicates that config+ nb of segment in BBM*size of segments in BBM in the config > total size BBM
 | 1 | One of the segments to put in BBM re§u contains a segment number (first byte) >= to the segments number declared in the config
 | 2 | 2 (or +) segments re§us want to embed in the same segment of BBM
 | 3 | Too many segments to put in BBM found in the program re§u
 | 4 | Impossible to allow the buffers for the segments masks BBM
 | 5 | Exchange segment greater than the definition
 | 6 | Impossible to allow the data zone for the exchange segment
 | 7 | Impossible to allow the buffers for the segments masks BBM
53 |  | Serious error at the system initialization (start) Error Nr of init : see at the top
54 |  | Internal error
 | 0 | Exceeding of max cyclic size. Too many axes !
 | 1 | Synchro FIFO trap
 | 2 | Addition of an element motion NULL
 | 3 | Error at the management of an instruction VEL=
 | 4 | Command High Level Kernel Ethercat unknown
 | 5 | Trap 1 ethercat
 | 6 | Trap 2 ethercat
 | 7 | Trap 3 ethercat
 | 8 | Trap 4 ethercat
 | 9 | Memory leak in a list
 | 10 | Modulo computing thread error (too many loops)
 | 11 | Cam computing thread error (too many loops)
 | 12 | Overload, cannot run user timer
 | 13 | Overload, cannot run slow user timer
 | 14 | BBM segment allocation error (too many segments ???)
 | 15 | Communication task crashed ...
 | 16 | Motion task crashed ...
 | 17 | For internal tests
 | 18 | Profile adding thread have returned anything wrong (modif)
 | 19 | Profile adding thread have returned anything wrong (set)
 | 20 | No more available fifos ...
 | 21 | Too many elements to add in a period
 | 22 | Cam computing thread error (computing time exceeded)
 | 23 | Motion Trap 1
 | 24 | Motion Trap 2
 | 25 | Allocation error in kernel list
 | 26 | Allocation error in user list
 | 27 | Allocation error in an ethercat list
 | 28 | Sem_wait call error
 | 29 | Canhost error
 | 30 | Ethercat Trap 5
 | 31 | Error No more available Ram memory
 | 32 | TimerU thread crashed
 | 33 | TimerUS thread crashed
 | 34 | Schedule thread crashed
 | 35 | LZS commands thread
 | 36 | LXRT trap
 | 37 | Not implemented in LZS
 | 38 | Fixed size file length exceeded
 | 39 | IEC flash backup data inconsistency (masks)
 | 40 | Out of memory in IEC mask
 | 41 | Malloc under realtime
 | 42 | Flash trap
 | 43 | Garbage collector full
 | 44 | Garbage collector corrupted
 | 45 | Garbage trap
 | 46 | LZS orders overload
 | 47 | A trigger refuses to stop
 | 48 | Exchange segment initialization error
 | 49 | Too many breakpoints notifications to handle
 | 50 | Incorrect I/O definition
 | 51 | Incorrect event number in kevent
 | 52 | Too many waiting system events
 | 53 | Unknown action in an event
 | 54 | Too many nested events
 | 55 | Opening physical error
 | 56 | Modbus serial handler TRAP1
 | 57 | Mixed CANHost requests !!
 | 58 | Pb modbus<=>CAN
 | 59 | Pb notif CAN => User
 | 60 | Pb notif CAN => User
 | 61 | No more available CAN
 | 62 | Pb notif CAN => User
 | 63 | Pb notif CAN => User
 | 64 | No more available CANREQUEST
 | 65 | Problem in the list of PDO to send on SYNC
 | 66 | Problem in the list of PDO to refresh on SYNC
 | 67 | Too many nodes to put in nodeguarding
 | 68 | Can Host Motion trap 1
 | 69 | No more motion elements (kernel request)
 | 70 | A file is already opened !
 | 71 | Cam live data retrieve
 | 72 | Too many waiting triggers in this motor
 | 73 | No more trigger for a PDO
 | 74 | No more trigger to start a movement
 | 75 | No more possible to add elements in kernel
 | 76 | No more available LZS memory
 | 77 | IEC Malloc trap
 | 78 | User stub error
 | 79 | Scope frame not received !
 | 80 | Scope frame not expected
 | 81 | Canhost request from stack => forbidden
 | 82 | Motion tool signal initialization error
 | 83 | Unknown ethercat initialization mode
55 |  | Ethercat bus initialization error
 | 0 | Cannot initialize a peripheral
 | 1 | IMD parameter initialization error
 | 2 | (on the network) Ethercat peripheral address range error (<=0 || >=AXIS_MAX)
 | 3 | 2 MPC found in setup
 | 4 | Essential pheripheral entry not found in setup
 | 5 | (in setup) Ethercat peripheral address range error (<=0 || >=AXIS_MAX)
 | 6 | Memory allocation error
 | 7 | MPC parameters initialization error
56 |  | Ethercat communication error
 | 1 | Cyclic frame not sent
 | 2 | A slave did not answer
 | 3 | Last frame not sent (hardward/overload problem)
 | 4 | A cyclic frame has been truncated
 | 5 | Ethercat bus voluntary crash
 | 6 | Breakpoint halt on error (debug only)
57 |  | Internal "Host" error
 | 1 | No CANHOST callback
 | 2 | Unknown IMD variable
 | 3 | Large download access (>4 bytes) not implemented
 | 4 | Upload access not implemented
 | 5 | Internal TRAP
 | 6 | Not valid slave
 | 7 | No more handle canhost available
 | 8 | Large access COE (>4 bytes) not implemented
 | 9 | TRAP coe
 | 10 | CAN access, invalid slave
 | 11 | Large access SDO not implemented
 | 12 | TRAP coe answer
 | 13 | internal TRAP request
 | 14 | Internal TRAP for test
 | 15 | Nr of COBID too high
 | 16 | Not enough CAN messages available
 | 17 | Not enough CAN available
58 |  | Problem on the BBM
 | 0 | The BBM memory was delete because of a soft inconsistency
 | 1 | The BBM memory was delete twice (hard problem?)
 | 2 | The BBM memory has not been restored as from the flash (data in invalid flash)
 | 3 | The BBM memory has not been restored as from the flash(DIP4 not set)
 | 4 | The BBM memory has not been restored as from the flash (error at the time of restoring)
59 |  | IEC error [Stops the tasks LZS !!!]
 | 1 | Unknown FB firmware
 | 2 | Division per 0
 | 3 | Index number of an incorrect array
 | 4 | Unknown error
 | 5 | Error flash opening
 | 6 | Error flash reading
 | 7 | Error flash writing
 | 8 | Error flash closing
 | 9 | Internal error at LZS
 | 10 | Impossible to free a user task (system) by the sequencer
 | 11 | Too many programs in LZS
 | 12 | Too many programs in a group
 | 13 | Invalid program number in a group
 | 14 | Program not found in LZS
 | 15 | Invalid priority in a program group
 | 16 | Type of unknown group
 | 17 | Type of unknown release event
 | 18 | Too many requests in inputs on VM
 | 19 | Starting type unknown
 | 20 | No program structure LZS !
 | 21 | Out of memory to start the tasks.
 | 22 | Inconsistancy data structure LZS
 | 24 | A task started its WD
 | 25 | Too many WD to manage
 | 26 | No program in a group
 | 27 | Reference error on I/O
 | 28 | Incorrect task number
 | 29 | Incorrect request
 | 30 | Too many global segments in LZS
 | 31 | OOM LZS internal
 | 32 | More than one event task system
 | 33 | The task system error has released its watchdog
 | 34 | Invalid user event
 | 35 | Incorrect user event
 | 36 | Too many actions for a user event
 | 37 | List of CAN elements (Modbus=>can) TRAP !
 | 38 | Mapping of a PDO results in a too great PDO (>8 bytes)
 | 39 | Invalid NMT request
 | 40 | Too many preinitialized tasks
 | 41 | Register number of incorrect capture
 | 42 | Incorrect axis number
 | 43 | No more capture available
 | 44 | Error when adding a capture
 | 45 | Type of unknown home
 | 46 | Capture source/unknown trigger
 | 47 | Type of incorrect master source
 | 48 | Denominator of GEARBOX/GEARBOXRATIO null
 | 49 | Trap GEARBOX
 | 50 | Reading/writing error of a cam in flash
 | 51 | Invalid can number
 | 52 | Memory allocation error on a cam
 | 53 | The cam gains are invalid
 | 54 | Not enough points for the cam
 | 55 | Invalid direction
 | 56 | Starting cam error
 | 57 | The can is not monotonique croissante on the master
 | 58 | Incorrect bit number in a function GET/SET BIT x
 | 59 | Cam not loaded !
 | 60 | Incorrect capture/trigger source !
 | 61 | Info type for unknown breakcampos
 | 62 | No task! impossible to start
 | 63 | No more trigger available
 | 64 | Loading of a running cam !
 | 65 | LoadCamI, error when cam IEC description
 | 66 | Forbidden writing, not recognized flash
 | 67 | Invalid mode for SetMode
 | 68 | Initialization tasks error
60 |  | Initialization error of MPC/Sub parameters
61 |  | Serious error at the system preinitialization (starting)!!! Externally defined : DO NOT MODIFY
 | 0 | Error before kernel/RTAI insert
 | 1 | IMS_START didnt start correctly or stopped
 | 2 | IMS_PROXY didnt start correctly or stopped
 | 3 | OS files checksum incorrect at the starting
 | 5 | Corrupted updating
 | 6 | This updating cannot be put on the outstanding picture
 | 7 | DIP3 on  reloading request
 | 8 | Failure during the step 0 initialization
 | 9 | Failure during the step 1 initialization (module kernel not found !)
62 |  | Crash of a thread | sub : index nr of thread
63 |  | IEC error [Doesnt stop the tasks LZS !!!]
 | 5 | No task
 | 6 | A task has released its WD (non fatal)
 | 7 | Invalid Cmd at VM LZS
 | 8 | Invalid Opcode
 | 9 | Non supported Opcode
 | 10 | Invalid extension
 | 11 | Powerflow not available
 | 12 | Invalid Bit ref
 | 13 | Data restoring error
 | 14 | Invalid reference on a bit field
 | 15 | Assertion failure
64 |  | LZS initialization task returned an error (data in Sub)
 | 1 | No task initialization return, see the function INITSETRESULT
65 |  | Warning MPC system
 | 1 | Warning, selected slacks in power supply 24V.
 | 2 | Warning, battery backup BBM out.
 | 3 | Warning, BBM setup restored as from flash
 | 4 | Warning, overload on I/O
67 |  | MPC error
 | 1 | Over temperature CPU
 | 2 | Error the power supply is out


Adresses IP

IP Addresses

Two versions of IP addresses exists today. Almost network use IP addresses 4th version (IPv4), but a rising number of educational and research networks ad changed to IP addresses 6th version. We will explain only IPv4 in detail in the chapter.

  • Machine's IP address is called logical address
  • IP addresses are coded in 32 bits / 4 bytes. The textual coding use four decimal values separated by points.
  • A computer's IP address consist of two parts :
    • The first part is called NetID, correspond to the network address, also called network identifier. The network identifier identify systems on the same physical network . The NetID must be the same on a local segment.
    • The second part is called HostID, correspond to the computer address on the network, also called computer identifier. The computer identifier identify the workstation, the server, the router or all other TCP/IP equipment on the network. The HostID for each equipment must be unique. A computer connecter to the network is using both NetID and HostID to know which frames it must receive or ignore and to find which peripherals must receive data that it send.

There is an example

11000100 | 11101001 | 11111101 | 01111011
196 | 233 | 253 | 123
196.233.253. | 123
NetID | HostID

Each byte in the IP address string are from 0 to 255. The complete range of the IP address is from 0.0.0.0 to 255.255.255.255. There are 4.294.967.296 possible IP addresses.

See also:

Address classes

Sub network masks

The forbidden networks

Address distribution and connectivity


Classes d'adresses

Address classes

There are five IP address classes, the three first classes (A, B and C) are used in standard networks.

    ▪ A Class :

      . 1st byte: for the network (NetID)
      . 2nd,3rd, 4th bytes : for the computers (HostID)
      . 0XXXXXX1 -----> 01111110
      Addresses are from 1.0.0.1 to 126.255.255.254

      The A class of IP addresses allow 127 networks of more than 16 million of computers by network.

    ▪ B Class :

      . 1st, 2nd bytes : for the network
      . 3rd, 4th bytes : for the computers
      . 10XXXXXX -----> 10111111
      Addresses are from 128.0.0.1 to 191.255.255.254
      127.0.0.1 : localhost address

      The B class of IP addresses allow 16575 networks of more than 65000 computers by network.

    ▪ C Class :

      . 1st, 2nd, 3rd bytes : for the network
      . 4th byte : for the computers
      . 110XXXXX -----> 11011111
      Addresses are from 192.0.0.1 to 223.255.255.254

      The C class of IP addresses allow more then 2 million networks of 254 computers by network.

    ▪ D Class :

      This address class is reserved for multicast : spreading to a group of computers.
        Addresses are from 224.0.0.0 to 239.255.255.255
      The multicast is mostly used in research network. It's not used in normal networks.

    ▪ E Class :

      . Reserved for a future use.
      There may not be used in IP networks. Some research organizations use these E class addresses for experimental purpose.

See also:

IP Addresses

Sub network masks

The forbidden networks

Address distribution and connectivity


Masque sous réseau

Sub network mask

▪ The network mask

      To know the network part (NetID) ant the computer part (HostID) of the IP address, it's enough to use the "NetMask" or network mask. To obtain the NetID, a "and" is made, bit wise, between IP address and NetMask. To obtain the computer identifier, a "and" must be made, bit wise, between the IP address and the complement of the network mask.

      Example:
          A "C" class IP address : 192.168.4.211 with a network mask 255.255.255.0

          11000000101010000000010011010011
        AND
          11111111111111111111111100000000
          __________________________________

          11000000101010000000010000000000
          192 . 168 . 4 . 0
        The network identifier is : 192.168.4, we can write NetID : 192.168.4.0
        The computer identifier is : 211
    ▪ Default Netmask

          Address Class | IP Address | Default mask
A | 1.X.Y.Z à 126.X.Y.Z | 255.0.0.0
B | 128.X.Y.Z à 191.X.Y.Z | 255.255.0.0
C | 192.X.Y.Z à 223.X.Y.Z | 255.255.255.0

    ▪ Other notation:

      If you take 192.168.67.0 NetID with the mask 255.255.255.0 (24 bits).
      You can wrote 192.168.67.0/24
    ▪ Broadcast address:

      This address allow a computer to send a datagram to all other computers on the network. This address is obtained by putting 1 on all HostID bits.
      Example:
          200.140.29.255 is the broadcast address over all the 200.140.29.0 network
          150.70.255.255 is the broadcast address over all the 150.70.0.0 network

See also:

IP Addresses

Address classes

The forbidden networks

Address distribution and connectivity


Les réseaux interdits

The forbidden networks

    It's forbidden to use the addresses from 127.0.0.0 to 127.255.255.255. These addresses are reserved for loop back. The message send to these addresses are not sent to the network, it will be return to the application by the network board driver. The IP address 127.0.0.1 is used by the local host and to test if the network board is correctly installed and works properly.

    Some IP addresses are also reserved for local networks connected to Internet. They can't be used over Internet because they are not handled by the routers and not transmitted to other computers.
          Forbidden addresses
From | 10.0.0.0 | to | 10.255.255.255
From | 172.16.0.0 | to | 172.16.255.255
From | 192.168.0.0 | to | 192.168.255.255
    It's also forbidden to assign a network (ex : X.Y.Z.0) or a broadcast (ex : X.Y.Z.255) address to computer.

See also :

IP Addresses

Address classes

Sub network masks

Address distribution and connectivity


Distribution des adresses et connectivité

Address distribution and connectivity

    . IP addresses distribution :
  • Over 'Internet, the IANA organization (Internet Assigned Numbers/Naming Authority) have the responsibility of the IP addresses distribution. This organization give the IP addresses to the Internet providers.
  • When you don't connect your network to Internet, you can use all A, B and C class IP addresses. Therefore, all devices connected directly to Internet must have a network identifier assigned by the Internet community. The organization responsible to manage the network identifier assignation for the devices connected directly to Internet is the "Internet Network Information Center (InterNIC)".
  • To assign the IP address over a IP network, you can use two ways :
    • Static : The network manager must assign manually a unique IP address to each workstation of the network
    • Dynamic : The IP address is assigned by a DHCP server
    . Connectivity :
  • The IP address is not always necessary to connect two computers.
  • The multipoint network use IP addresses for the connection, data sharing, resources, etc.
  • In general, a computer have only one network interface, but it can have two or more interfaces allowing connection between several networks.
  • A computer connected to Internet by a PSTN (Public Switched Telephonic Network) modem will only have one IP address. This address is given by the ISP (Internet Service Provider)
  • A computer connected to a local network and Internet by a modem will have two IP addresses.

See also :

IP Addresses

Address classes

Sub network masks

The forbidden networks


Serial communication introduction

The serial free protocol use functions COMOPEN and COMCLOSE as well as modbus. This protocol use :

  • A 1024 bytes buffer for sending + 16 bytes FIFO

  • A 1024 bytes buffer for receiving

According to serial port setup, the sent data have:

  • 1 start bit

  • 6, 7 or 8 data bits

  • 1 or 2 stop bits

So a data represent from 8 to 11 bits.

When receiving, the FIFO works as normal FIFO, we can then receive up to 16 bytes per interrupts (150µs). So the 115200 bauds rate can be easily achieved on serial port.

When sending, the FIFO is used as a complementary 16 bytes buffer. This buffer is filled only when it is empty. We achieve then a maximal constant throughput of 66666 bauds (in 8N1). Above this value, there are some possible spaces between the 16 bytes groups.

If one of the sending buffers (when calling COMWRITE) or receiving buffer (when receiving chars), is full the respective bits in MODBUSERROR are set.

For the serial communication functions, an invalid handle raise a system error.

By opening a TCP connection by COMOPENTCP, the free TCP protocole can be used, with the functions COMREAD, COMWRITE, COMCARIN and COMOUTEMPTY. The free TCP protocol allow to make output connection to any addresses / ports, including Internet services. It's not possible to create a listening port in free protocol. This function is reserved by TCP modbus.


COMCARIN

COMCARIN  Return the number of bytes in the receive buffer

Syntax

<NbCar> := COMCARIN (<Com>)

Accepted types

<Com> : tHandle
<NbCar>:UDINT

Description

This function return the number of bytes in the receive buffer.


COMCLEARIN

COMCLEARIN  Clear receive buffer

Syntax

COMCLEARIN (<Com>)

Accepted types

<Com> : tHandle

Description

This function clear the receive buffer.


COMCLEAROUT

COMCLEAROUT  Clear send buffer

Syntax

COMCLEAROUT (<Com>)

Accepted types

<Com> : tHandle

Description

This function clear the send buffer.


COMCLOSE

COMCLOSE  Close the serial communication port

Syntax

COMCLOSE (<Com>)

Accepted type

<Com> : tHandle

Description

This instruction allows closing the serial communication port.
<Com> variable of port communication type.


COMGETCTS

COMGETCTS  Read CTS

Syntaxe

COMGETCTS (<Com>)

Accepted types

<Com> : tHandle

Description

This function return CTS signal state

Remark

This function use only SERIAL 1 port otherwise it raise a system error.


COMMODBUSCRC

COMMODBUSCRC  Calculate CRC

Syntax

<CRC> := COMMODBUSCRC (<Address>, < Size>)

Accepted types

< Address> : UINT
< Size> : UINT
< CRC > : UINT

Description

This function calculate the CRC (16 bits for Modbus) of a data block
<Address> : address in the exchange segment
<Size> : Number of byte used by the calculation


COMOPEN

COMOPEN  Open a communication port

Syntax

<ComSerie> := COMOPEN (<NumPortSerie>)

Accepted type

<NumPortSerie> : USINT
<ComSerie> : tHandle

Description

This instruction allows opening the serial communication port.
<NumPortSerie> put 1 for the COM1 or 2 for the COM2
<ComSerie> variable of port communication type.


COMOPENTCP

COMOPENTCP  Open a communication port TCP

Syntax

<ComTCP> := COMOPENTCP (<Adresse> <Port>)

Accepted type

<Adresse> : UDINT

<Port> : UINT

<ComTCP> : tHandle

Description

This instruction allows opening the Modbus communication port on bus ETHERNET TCP/IP.
<Adresse> address IP of the slave peripheral.
<Port> port IP to contact, put 0 via the default port (port 502)

<ComTCP> variable of the port communication type.


COMOUTEMPTY

COMOUTEMPTY  Return TRUE if send buffer is empty

Syntax

<Empty> := COMMOUTEMPTY (<Com>)

Accepted types

<Com> : tHandle

Description

This function return TRUE if there is no waiting bytes in send buffer otherwise it return FALSE.


COMREAD

COMREAD  Read data from a link

Syntax

<ReceivedSize> := COMREAD (<Com>, <Address>, < Size>)

Accepted types

<Com> : tHandle
< Address> : UINT
< Size> : UINT
< ReceivedSize> : UDINT

Description

This function read data from a link without locking program.
This function get values from the receive buffer and return as much as possible of bytes.
<Address> : address of the buffer in the exchange segment (see address column in the Echange variables editor).
<Size> : Size of the buffer
<ReceivedSize> : Number of byte read

Remark

If the selected protocol for serial port is slave modbus, then calling this function raise a system error.
A maximum of 1024 bytes can be read from the serial port ( buffer size) , above a system error is raised.


COMSETRTS

COMSETRTS  Set RTS

Syntax

COMSETRTS (<Com>,<Actif>)

Accepted types

<Com> : tHandle
<Actif> : BOOL

Description

This function set RTS signal to 0 or 1.


COMWRITE

COMWRITE  Send data on a link, without locking

Syntax

<SendedSize> := COMWRITE (<Com>, <Address>, < Size>)

Accepted types

<Com> : tHandle

< Address> : UINT
< Size> : UINT
< SendedSize> : UDINT

Description

This function send data on a link without locking program.
<Address> : Data received buffer address in the exchange segment (see address column of the Echange variable editor).
<Size> : Number of byte to send
<SendedSize> : Number of sended bytes

Remark

If the selected protocol for serial port is slave modbus, then calling this function raise a system error.
If not all the bytes are written into the buffer, "Output buffer overflow" bit is set in MODBUSERROR
When copying data in the send buffer, this function take the "Exchange zone" system signal.

In case of RS 485, sending is done in one block until buffer is empty.


ROUTEIMDADD

Syntax

ROUTEIMDADD (<Add>)

Accepted type

<Add> : UDINT

Description

This function changes the N° of basis nud in the routage Modbus/CAN=>IMD on Ethercat


Introduction Modbus RTU/ASCIL

the protocol ModBus (Modicon builder is a protocol of dialog creating a hierarchical structure with a master and one or several slaves).

Model OSI :

Principle Master / Slave :

This kind of protocol allows to question from the master, one or more intelligent slaves

Two kinds of dialog are possible between the master and the slave:

The Master speaks with a slave and waits for his answer.

The Master speaks with all slaves without waiting for the answer.

The master manages the exchanges and it is the only one on the initiative.

This master repeats the question during an erroneous exchange and declares the slave absent after a failure to reply in a given time (time out). There can be only one equipment on the line emitting.

No slave can itself send a message without being invited. All communications between slaves can only exist if the software of the Master were conceived to receive data and to return them from one slave to another one.

The Master can address 127 pieces of equipment marked from the equipment n°1 to the equipment n°126, equipment 0 being preset.

If the Master uses the number of equipment 0, diffusion towards all the slaves will be carried out. The use of equipment 0 is authorized only in writing. .

Tableau of requests for master MODBUS :

List of supported MODBUS functions

03 : Reading of n words **

04 : Reading of n inputs words

06 : Writing of a word

16 : Writing of n words**

** : This function is also used for the access to the format "double word" and to the format "floating word".

Table of requests for slave MODBUS :

List of supported MODBUS functions

03 : Reading of n words **

04 : Reading of n inputs words

06 : Writing of a word

16 : Writing of n words**

ModBus RTU / ASCII :

Definition of a layout to format RTU:

Slave Nr | : 0 à 255
Function Code | : Indicates the type of exchange
Data zone | : Field of information containing the parameters related to the function: address word, value of word, number of words ...etc.
CRC16 | : Word used to detect the transmission errors (Cyclic Redundary Check).

READING OF N WORDS: Function code 03 or 04 (03 or 04 in Hexa)

Command :

Peripheral address | Function Code 03 or 04 | First word address |  | Number of words to read |  | CRC
1 byte | 1 byte | MSB | LSB | MSB | LSB | LSB | MSB

Answer :

Peripheral address | Function Code 03 or 04 | Number of read bytes | Value of the first word |  | ... | Value of last word |  | CRC
1 byte | 1 byte | 1 byte | MSB | LSB | ... | MSB | LSB | LSB | MSB

WRITING OF A WORD: function code 06 (06 in Hexa)

Request:

Peripheral address | Function code 06 | Word address |  | Value of the word |  | CRC
1 byte | 1 byte | MSB | LSB | MSB | LSB | LSB | MSB

Answer:

Peripheral address | Function code 06 | Word address |  | Value of the word |  | CRC
1 byte | 1 byte | MSB | LSB | MSB | LSB | LSB | MSB

WRITING OF N WORDS: Function code 16 (10 in Hexa)

Request:

Peripheral address | Function code 10 | First word address |  | Number of written words |  | Number of data bytes(n) | Data | CRC
1 byte | 1 byte | MSB | LSB | MSB | LSB | 1 byte | n bytes | LSB | MSB

Answer:

Peripheral address | Function code 10 | First word address |  | Number of written words |  | CRC
1 byte | 1 byte | MSB | LSB | MSB | LSB | LSB | MSB

ERRONEOUS ANSWER

Peripheral address | Function code | Code of erroneous answer | CRC
1 byte | 1 byte | 1 byte | LSB | MSB

The coding of the data is always carried out in the order strong weight weak weight except for the CRC where the order is reversed!


Introduction Modbus TCP

The MODBUS protocol on TCP/IP uses the MODBUS mail service for the application layer and TCP/IP for the Ethernet communication.

Model OSI :

We can represent the whole of the layers carried out for MODBUS on TCP according to the following model:

The number of the port used for the exchanges is the 502.

All protocols TCP/IP are realised according to the Modicon specifications:

Layer 4 : | TCP -> RFC 793 UDP -> RFC 768
Layer 3 : | ICMP :-> RFC 792 IP -> RFC 791 ARP -> RFC 826
Layer 2b : | Ethernet V2
Layer 2a : | IEEE 802.3 CSMA/CD

The layers 5 and 6 are not used.

The TCP/IP solution provides the following functionality:

Definition of a standard data ModBus layout :

ADU | : Application Data Unit
PDU | : Protocol Data Unit

Definition of a data ModBus layout on TCP/IP :

There are thus some differences between the protocol Modbus RTU and the TCP/IP:

The address field of the slave used by the standard Modbus protocol is replaced by a bit identifying in the heading HBAP. This bit is called "Unit Identifier".

All requests and answers of modbus are conceived in such a way that the addressee can check that a message is finished.

The length information is spread in the heading of MBAP to make possible to the addressee to identify the borders of the messages even if the message were cut in several packages for the transmission.

The heading MBAP consists of 7 bytes.

Description of the heading MBAP :

Fields | length | description | customer | server
Identifier of the transaction | 2 Bytes | Identification of ModBus requests or answers | Initialized by the customer | Reproduced by the server as soon as the request has been received
Identifier of the protocol | 2 Bytes | 0 = ModBus protocol | Initialized by the customer | Reproduced by the server as soon as the request has been received
Length | 2 Bytes | Number of bytes of PDU | Initialized by the customer (request) | Initialized by the server (answer)
Identifier | 1 Byte | Slave Nr (generally 1) | Initialized by the customer | Reproduced by the server as soon as the request has been received


Modbus Maître

Master Modbus

Introduction

MODBUS is a master/slave protocol mainly used in industrial applications. It allows supervisory equipment (Human Machine Interface, Supervisory Control and Data Acquisition), to communicate with various industrial devises (Programmable Logic Controllers, sensors, etc.).

This protocol functions using requests. These messages can be transmitted on a physical support as serial link such as RS232, RS422 or RS485.

To distinguish slave equipment from another one, each piece of equipment is given an address (Unit ID). Owing to this number, and in case of multiple links, only the concerned slave equipment will answer a request from the master.

The MPC operates the protocol MODBUS RTU slave.

The transmission speed can be up to 128000 bauds.

Functions of reading words (function n°3 or 4) and writing words (function n°16) are recognized by the drive.

Dictionnaire

The MPC dictionary is directly accessible in the soft Motion Studio as from Help menu \ Table Modbus classified per ...


Modbus Esclave

Slave Modbus

Introduction

MODBUS is a master/slave protocol mainly used in industrial applications. It allows supervisory equipment (Human Machine Interface, Supervisory Control and Data Acquisition), to communicate with various industrial devises (Programmable Logic Controllers, sensors, etc.).

This protocol functions using requests. These messages can be transmitted on a physical support as serial link such as RS232, RS422 or RS485.

To distinguish slave equipment from another one, each piece of equipment is given an address (Unit ID). Owing to this number, and in case of multiple links, only the concerned slave equipment will answer a request from the master.

The MPC operates the protocol MODBUS RTU slave.

The transmission speed can be up to 128000 bauds.

Functions of reading words (function n°3 or 4) and writing words (function n°16) are recognized by the drive.

Dictionary

The MPC dictionary is directly accessible in the soft Motion Studio as from Help menu \ Table Modbus classified per ...

Instructions

MODBUSCOUNTER | Returns the Modbus message number
MODBUSERRORCOUNTER | Returns the Modbus message number
ROUTEIMDADD |


MODBUSREAD

MODBUSREAD  Reading of n words in Modbus

Syntax

<Retour> := MODBUSREAD (<Com>, <Destination>, <Adresse>, <Segment>, <Taille>)

Accepted type

<Com> : tHandle
<Destination> : USINT
<Adresse> : UINT
<Segment> : UINT
<Taille> : UINT
<Etat> : BYTE

Description

This instruction allows reading n words in Modbus (sending of a command Modbus of type 3 and waiting for the answer).
<Com> variable of port communication type.
<Destination> : Nr node Modbus of destination

  • In serial Modbus, it indicates the number of node Modbus on the network.

  • In Modbus TCP, it indicates the number of node Modbus of the element addressed by the gateway.

<Adresse> : address in the table Modbus of destination
<Segment> : address in the exchange segment
<Taille> : number of words of 16 bits to read
<Retour> Instruction feedback :

  • 0 if the port is not opened or invalid

  • 1 if no default

Remarks

In case of error, this instruction starts a system event.
The size is limited to:

  • 125 words in normal mode (serie or modbus TCP)

  • 4096 words in wide mode (modbus TCP)


MODBUSWRITE

MODBUSWRITE  Writing of n words in Modbus

Syntax

<Retour> := MODBUSWRITE (<Com>, <Destination>, <Adresse>, <Segment>, <Taille>)

Accepted type

<Com> : tHandle
<Destination> : USINT
<Adresse> : UINT
<Segment> : UINT
<Taille> : UINT
<Etat> : BYTE

Description

This instruction allows writing n words in Modbus (sending of a command Modbus of type 16 -write multiple registers and waiting for the answer).
<Com> variable of port communication type.
<Destination> : Nr node Modbus of destination

  • In serial Modbus, it indicates the number of node Modbus on the network.

  • In Modbus TCP, it indicates the number of node Modbus of the element addressed via the gateway.

<Adresse> : address in the table Modbus of destination
<Segment> : address in the exchange segment
<Taille> : nb of words of 16 bits to read
<Retour> instruction feedback:

  • 0 if the port is not opened or invalid

  • 1 if zero default

Remarks

In case of error, this instruction starts a system event.
The size is limited to:

  • 123 words in normal mode (serie or modbus TCP)

  • 4096 words in wide mode (modbus TCP)


MODBUSCOUNTER

MODBUSCOUNTER - Retourne le nombre de message du Modbus

Syntax

<Q> := MODBUSCOUNTER (<NumCompteur>)

Accepted type

<NumCompteur> : USINT

<Q> : UDINT

Description

This function returns the number of message of one of the Modbus counters

<NumCompteur>

10 : numbers of total access on port COM1

11 : number of reading access on port COM1

12 : number of writting access on port COM1

20 : number of total access on port COM1

21 : number of reading access on port COM1

22 : number of writting access on port COM1


MODBUSERROR

MODBUSERROR  Returns the state of the port defaults

Syntax

<EtatCOM> := MODBUSERROR (<Com>)

Accepted type

<Com> : tHandle
<EtatCOM> : DWORD

Description

This instruction returns the state of the port communication defaults.
<Com> variable of the port communication type.
< EtatCOM > :

  • Bit 0 at 1 if error UART

  • Bit 1 at 1 if timeout

  • Bit 2 at 1 if protocol error (modbus TCP)

  • Bit 3 at 1 if identifier error (modbus TCP)

Remark

If <Com> is not opened or invalid thus <EtatCOM> = 0, but that does not start a system error.


MODBUSERRORCOUNTER

MODBUSERRORCOUNTER  Returns the error number of Modbus

Syntax

<Q> := MODBUSERRORCOUNTER (<NumCOM>)

Accepted type

<Q> : USINT

Description

This function returns the number of messages of one of the Modbus counters

<NumCOMt>

10 : errors number port COM1

20 : errors number port COM2


MODBUSERRORRESET

MODBUSERRORRESET  Reset the bits of defaults

Syntax

MODBUSERRORRESET (<Com>)

Accepted type

<Com> : tHandle

Description

This instruction reset the bits of defaults of MODBUSERROR.
<Com> variable of port communication type

Remark

If <Com> is not opened or invalid no error system is started.


MODBUSSETEXTENDED

Syntax

MODBUSEXTENDED (<Acces>, <Etat>)

Accepted type

<Acces> : USINT

<Etat> : BOOL

Description

This function allows transferring the Modbus TCP in upgrade mode.
<Acces> : 0 for le Modbus TCP
<Etat> : 0 to deactivate the upgrade mode and 1 to activate it


STRINGIP_TO_UDINT

Syntax

<Adr_UDINT> := STRINGIP_TO_UDINT (<Adr_STRING>)

Accepted type

<Adr_STRING> : STRING
<Adr_UDINT> : UDINT

Description

This instruction changes a string with an IP in UDINT.


Introduction CANopen

CANopen introduction

The CAN bus (Controller Area Network) appeared in the middle of the 80ies as an answer for the data transmission in the automotive fields. This kind of bus allows getting high transfer rates.

The CAN specifications are defining 3 layers among the OSI model: the physical one, the data linking one and the application one. The physical layer defines the data transmission mode regarding the transmission support. The data linking layer is the nucleus of the CAN protocol because it deals with the frame to send, the arbitrage, the defaults detection, etc. The last layer is also called CAL (CAN Application Layer). It is a general description of the language for the CAN networks which offers many communication services.

CANopen is a type of network based on the serial bus system and the application layer CAL. CANopen offers only part of the communication services that CAL has at its disposal. Those are the necessary advantages that need small performances computer, with low storage capability.

So the CANopen is an application layer standardised by the CIA (CAN In Automation) specifications: DS-201DS-207

The network manager permits an easier network initialisation. The network can be extended with all the components the user wants to.

The CAN bus is a multi-master bus. Contrary to the other field buses, the sent messages are identified, and not the connected modules.. The network elements are allowed to send their message each time the bus is free. Bus conflicts are solved with a priority level given to messages. The CAN bus emits messages divided among 2032 priority levels. All the network elements have the same rights, so this communication is possible only without master bus.

Each element is deciding itself when it has data to send. However it is possible to send data with another element. This demand is made with the distant frame.

The CANopen specifications (DS-201DS-207) define the technical and functional characteristics needed by any device to be plugged in the network. The CANopen bus makes a distinction between the server devices and the client devices.


La communication CANopen

 CANopen communication

The CANopen communication profile permits to specify information for data exchange in real time and parameters. The CANopen uses optimised services following the different data types:

Ä PDO (Process Data Object)

ðData exchange in real time

ðHigh priority identifier

ð Synchronous or asynchronous transmission

ð 8 bytes (one message) maximum

ð Pre-defined format

Ä SDO (Service Data Object)

ð Access to the objects dictionary of a device

ð Low priority identifier

ð Asynchronous transmission

ð Data distributed in several telegrams

ð Data addressed with an index

The characteristics diffused by the CAN bus are received and evaluated by all the connected devices. Each service of a CAN device is configured by a COBID (Communication OBject IDentifier). The COBID is an identifier which characterises the message. It tells to a device if the message must be taken in account. For each service (PDO or SDO), it is necessary to specify a COBID during the emission (sending a message) and a reception COBID (receiving a message). For the first SDO server, the COBID is fixed and can not be modified remotely. Moreover, it is calculated from the Node-ID. The Node-ID is the parameter which characterises the device and permits the unique access to it.

PDO (Process Data Object)

It is a data exchange arbitrated between 2 modules. The PDO can transfer in turn some synchronisations or controlled events to realise the message sending request. With the controlled events mode, the bus load can be reduced at the minimum. A device can therefore realise a high performance communication with a law transfer rate.

The data exchange with the PDO uses the CAN advantages:

Ä Messages can be sent from an asynchronous event (controlled events)

Ä Messages can be sent from Sending messages can be done from the reception of a synchronisation event.

Ä Recovery from a remote frame.

SDO (Service Data Object)

It is a data exchange point to point. A device is asking for an access in the objects list of a SDO. This SDO sends back information corresponding to the type of request made by the caller. Each SDO can be either client and / or server. A server SDO cannot send a request to another SDO, but it can answer any request from another client SDO. Unlike the PDOs, the SDOs must follow a particular communication protocol. The sent frame consists of 8 bytes:

Ä Domain Protocol (Octet 0) : i t defines the command (Upload, Download,.).

Ä Index on 16 bits (Octet 1 and 2) : it defines the objects dictionary address.

Ä Sub-index on 8 bits (Octet 3) : it defines the element of the selected object in the dictionary.

Ä Parameter (Octet 4 to 7) : I t defines the value of the parameter read or written.

The network manager has a simplified mode to start the network up. The network configuration is not necessary in all the cases. The default configuration of the parameters may be enough. If the user wants to optimise the CANopen network or increase its functionalities, he can then modify these parameters. In the CANopen networks, each device has the same rights and the data exchange is directly regulated between each participant device.

The profile of a device defines the necessary parameters for a communication. The content of this profile is specified by the constructor. Devices with the same profile are directly interchangeable. Most of the parameters are described by the constructor. The profile has empty places too, which are for the future functionality extensions.

In most of the master/slave buses, the efficiency of the master determinates the comportment of the whole network. Moreover, slaves cannot directly communicate amoung themselves. All these characteristics are increasing the transmission errors. CANopen suppress all of these drawbacks. The timing comportment can be specified individually for each respective task of the participant devices. Like that, the whole communication system does not need to have more efficiency if only some of the devices need so. Moreover, an automatic task can be separated for each participant device. So the available performances of the network manager can be used in an optimised way and can be increased at any time by adding new participant devices.

The variables mapping used during the PDO type exchanges permits to use in an optimal way the current bandwidth of the bus. CANopen determinates default values of all the parameters.


Configuration du réseau CANopen

Network configuration

The CanOpen network is made of several devices; each of them can be master and slave. They are identified in the network by an arbitrary number, called Node-Id. This parameter must be unique: two different devices of the Can Open network can not have the same Node-Id. This Node-Id is very important; it is the real identity card of the peripheral on the Can Open network.

Example of CanOpen network configuration

The wiring principle is the following:

Wiring principle of a CanOpen network

Warning: Do not forget the ending resistors at each end of the Can Open network.

For the MPC, the resistor is validated if the jumper DIP is put at On. In the contrary, the resistor is un-validated.

For the other products, see the constructor notice.


Type de messages envoyés

Type of send messages

There are two big families of messages sent with Can Open connection :

Ä SDO (Service Data Object) are transmitting data

Ä PDO (Process Data Object) are transmitting events.


Présentation

Presentation

Construction in process


Caractéristiques

Characteristics

Construction in process


Raccordement

Connection

Construction in process


Diagnostic du bus

Test and diagnostic of the Can Open network

Construction in process


DictionnaireCANOpen

Dictionary

The MPC dictionary is directly accessible in the soft Motion Studio as from the menu Help\CANopen Table classified by ...


CANCOUNTER

CANCOUNTER Counter of server SDO of MPC

Syntax

<Variable> := CANCOUNTER(<Nr of counter> )

Accepted Types

<Variable> : UDINT
<Nr of counter> : BYTE

Description

CANCOUNTER allows knowing the number of messages issued by the server SDO OF MPC.

<Nr of counter> :

  • 0 : total

  • 1 : reading

  • 2 : writing

Remarks

<Nr of counter> 0 for the total number of messages, 1 for the number of readings, 2 for the number of writings.

Example ST

NbMessageSDO := CANCOUNTER(0);


CANERROR

CANERROR  Errors detection

Syntax

<Variable> := CANERROR(0)

Unit

<Variable> : DWORD

Description

This function allows the detection of an occurred error:

  • Bit 0 is 1 if bus error (triggers the system event task, if the error was not yet positioned)

  • Bit 1 is 1 if the answering time of SDO is finished

  • Bit 2 is 1 if Node Guarding error


CANERRORCOUNTER

CANERRORCOUNTER  Returns the number of communication errors on the bus CAN

Syntax

<Variable> := CANERRORCOUNTER()

Unit

<Variable> : UDINT

Limits

<Variable> : de 0 à 65535

Description

CANERRORCOUNTER allows knowing the number of errors which had occurred since the counter has been reset.

Remark

Some other defaults counters CAN are available from the hyper-terminal.


CANERRORRESET

CANERRORRESET Reset the bits of communication errors of bus CAN

Syntax

CANERRORCOUNTER (0)

Description

CANERRORRESET allows the reinitialization of CAN communication errors flags.


CANEVENT

CANEVENT  Indicate if a CAN frame have been received on the reception COBID

Syntaxe

<TrameRecue> := CANEVENT ( 0 )

Types acceptés

< TrameRecue > : BOOL

Description

This function return true if a frame have been received on the RX COBID and that is available for reading.
This flag is cleared when frame is read.


CANGETNMT

CANGETNMT  Returns the state of local NMT

Syntax

< NMTLocal >: = CANGETNMT(0)

Unit

< NMTLocal > : USINT

Description

This instruction returns the state of local NMT:

  • 1 for PREPARED

  • 2 for OPERATIONAL


CANGUARDADD

CANGUARDADD  To add a peripheral to the Node Guarding

Syntax

CANGUARDADD(<CANperiph>)

Unit

< CANperiph > : tPeripheral

Description

CANGUARDADD is used to add a peripheral to check to Node Guarding.

Example

CANGUARDADD(RIO1) ;


CANGUARDPARAM

CANGUARDPARAM  To set up the Node Guarding master

Syntax

CANGUARDPARAM(<Time>, <Retry>,<COBID>, <State>)

Unit

<Time> : UNIT

<Retry> : USINT

<COBID> : UDINT

<State> : BOOL

Description

CANGUARDPARMAT is used to set up the Node Guarding master of bus CAN :

  • <Time> : Node Guarding period in ms

  • <Retry> : number of tests

  • <COBID> : interrogation cobid (by default : 0x700)

  • <State> : At 1 forces to check that the node state has been started (by default : TRUE)

Example

CANGUARDPARAM(100,1,16#700,FALSE);


CANGUARDDEL

CANGUARDDEL  To delete a peripheral from Node Guarding

Syntax

CANGUARDDEL(<CANperiph>)

Unit

< CANperiph > : tPeripheral

Description

CANGUARDDEL is used to delete a peripheral from the list Node Guarding.

Example

CANGUARDDEL(RIO1) ;


CANGUARDRESET

CANGUARDRESET  To reset all peripherals from Node Guarding

Syntax

CANGUARDRESET(0)

Description

CANGUARDDEL is used to reset all peripherals from the master list Node Guarding of bus CAN.


CANREAD

CANREAD  Receive a CAN frame on the receiving COBID

Syntax

<TailleRecue> := CANREAD (<Adresse>, < Taille >)

Accepted types

< Adresse > : UINT
< Taille > : UINT
< TailleRecue > : UINT

Description

This function read a CAN frame on the RX COBID.
Only the last received frame on this COBID is available, there is no receive buffer and all newer frame received replace the existing one, even if it's not already read.
<Adresse> : Exchange segment address where received data is written
<Taille> : Size of the data to receive, if size is greater than 8, an error is generated
<TailleRecue> : Size of the received data.

Remark

The "exchange zone" signal is locked during reading and transfer in the exchange zone


CANSENDNMT

CANSENDNMT  Send a NMT on CANbus

Syntax

CANSENDNMT( <Periph>, <Command>)

Unit

<Periph> : tPeripheral

<Command> : USINT

Description

This instruction allows the start of a peripheral in CAN (sending of PDO) :

<Periph> : declared peripheral in the project

  • MPC : auto starts the NMT in local

  • IMD : none action

  • Module CAN declared in setup, sends a NMT to this peripheral

Remark

It is possible to use a number of Node direct with the function NODECAN(x)


CANSENDSYNCHRO

CANSENDSYNCHRO  Send SYNC message

Syntax

CANSENDSYNCHRO (<COBID>)

Accepted types

< COBID > : UDINT

Description

This function send a SYNC message on the standard COBID.


CANSETUP

CANSETUP  Define sending and receiving COBID for CAN free protocol

Syntax

CANSETUP (<COBID_TX>, < COBID_RX >)

Accepted type

< COBID_TX > : UDINT
< COBID_RX > : UDINT

Description

This function allow to define the COBID used on the CAN free protocol.
During setup, if a message have been previously received, it's lost.
If COBID_RX is 0, receiving in disabled, but it's still possible to send.
If COBID_RX is equal to a COBID used by the system, then the behavior is unpredictable, no error are generated.


CANSETUPSYNCHRO

CANSETUPSYNCHRO  Automatic SYNC sending setup

Syntax

CANSENDSYNCHRO (<COBID>, <Period>)

Accepted types

< COBID > : UDINT
< Period > : UDINT

Description

This function setup an automatic (<Period> in ms) sending of of the SYNC message on the standard COBID (default COBID : 0x80).

If <Period> or <COBID> are equal tot 0, the function is disabled.
If the function is called when a SYNC message is already setup, parameters are updated and the next SYNC message take care about the changes


CANWRITE

CANWRITE  Send a frame CAN with the sending COBID

Syntax

CANWRITE (<Adrdess >, < Size>)

Accepted types

< Adrdess > : UINT
< Size> : UINT

Description

This function send a CAN frame on the COBID TX.
This function do not wait for the end of the transmission, the transmission can take more or less time depending of the MPC internal load and especially the CANopen bus load.
The sending can fails in case of the bus is disconnected for exmple, this function do not return any informations.
<Address> : address of the data to send in the exchange segment
<Size> : Size of the data to send, if the size is greater then 8, an error is generated

Remark

The "exchange zone" signal is locked during reading and transfer in the exchange zone


NODECAN

Development in progress


PDOEVENT

Syntax

PDOEVENT (<NumPDO>)

Unit

<NumPDO> : UINT

Description

This function tells if a PDO has been received on the setup PDO, it is reset at each reading.


READ

READ  Reading of the table CANOpen of a peripheral

Syntax

<Q> = READ (<Peripheral>, <Index>, <SubIndex>, <Size>)

Accepted types

< Peripheral > : tPeripheral
<Index> : UINT
<SubIndex> : USINT
<Size> : USINT
<Q> : UDINT

Description

This function returns a value of type UDINT of the table CANOpen of a peripheral

Remark

This function is also used for reading an index of the CANOpen of MPC

See also

READR

WRITE

READPARAM

WRITEPARAM


READPARAM

READPARAM  Reading of the table CANOpen of a peripheral

Syntax

<Q> = READPARAM (<Peripheral>, <Parameter>)

Accepted types

< Peripheral > : tPeripheral
<Parameter> : name of the peripheral parameter

<Q> : UDINT

Description

This function returns the value of type UDINT of a peripheral parameter

Remark

This function is also used to read an index of the table CANOpen of MPC

See also

READ

WRITE

READPARAMR

WRITEPARAM


READPARAMR

READPARAMR  Reading of the table CANOpen of a pheripheral

Syntax

<Q> = READPARAMR (<Peripheral>, <Parameter>)

Accepted types

< Peripheral > : tPeripheral
<Parameter> : name of the peripheral parameter

<Q> : REAL

Description

This function returns the value of type REAL of a parameter of the peripheral

Remark

This function is also used to read an index of the table CANOpen of MPC

See also

READR

WRITER

READPARAM

WRITEPARAMR


READR

READR  Reading of the table CANOpen of a peripheral

Syntax

<Q> = READR (<Peripheral>, <Index>, <SubIndex>, <Size>)

Accepted types

< Peripheral > : tPeripheral
<Index> : UINT
<SubIndex> : USINT
<Size> : USINT
<Q> : REAL

Description

This function returns a value of type REAL of the table CANOpen of a peripheral

Remark

This function is also used to read an index of the table CANOpen of MPC

See also

READ

WRITER

READPARAMR

WRITEPARAMR


PDOTX

Syntax

PDOTX (<NumPDO>)

Unit

<NumPDO> : UINT

Description

This function forces the construction and the emission of a PDO.


WRITE

WRITE  Writing in the table CANOpen of a peripheral

Syntax

WRITE (<Peripheral>, <Index>, <SubIndex>, <Size>, <Data>)

Accepted types

< Peripheral > : tPeripheral
<Index> : UINT
<SubIndex> : USINT
<Size> : USINT
<Data> : UDINT

Description

This function is used to write a value of type UDINT in the table CANOpen of a peripheral

Remark

This function is also used to write in an index of the table CANOpen of MPC

See also

WRITER

READ

WRITEPARAM

WRITEPARAM


WRITEPARAM

WRITEPARAM  Writing in the CANOpen of a peripheral

Syntax

WRITEPARAM (<Peripheral>, <Parameter>, <Data>)

Accepted types

< Peripheral > : tPeripheral
<Parameter> : Name of peripheral parameter
<Data> : UDINT

Description

This function allows writing a value of type UDINT in a parameter of peripheral

Remark

This function is also used to write in an index of the table CANOpen of MPC

See also

WRITE

WRITER

WRITEPARAMR

READPARAM


WRITEPARAMR

WRITEPARAMR  Writing in the table CANOpen of a peripheral

Syntax

WRITEPARAMR (<Peripheral>, <Parameter>, <Data>)

Accepted types

< Peripheral > : tPeripheral
<Parameter> : Name of peripheral parameter
<Data> : REAL

Description

This function allows writing a value of type REAL in a peripheral parameter

Remark

This function is also used to write in an index of the table CANOpen of MPC

See also

WRITE

WRITER

WRITEPARAM

READPARAMR


WRITER

WRITER  Writing of the table CANOpen of a peripheral

Syntax

WRITER (<Peripheral>, <Index>, <SubIndex>, <Size>, <Data>)

Accepted types

< Peripheral > : tPeripheral
<Index> : UINT
<SubIndex> : USINT
<Size> : USINT
<Data> : REAL

Description

This function allows writing a value of type REAL in the table CANOpen of a peripheral

Remark

This function is also used to write in an index of the table CANOpen of MPC

See also

WRITE

READR

WRITEPARAM

WRITEPARAMR


Initialisation de module RIO

Initialization of RIO module

MPC initialization task

This task initializes the different MPC peripherals and bus.

To initialize the RIO modules, this task calls the InitRio() function.

PROGRAM P_INIT

VAR_EXTERNAL

Fault :Word;

ErrCanIO :Bool;

ErrEthercat :Bool;

Inhibit :udint;

END_VAR

VAR_GLOBAL

END_VAR

VAR

IntParam : tIntParam;

RioModule:tPeripheral;

END_VAR

If (InitGetContext(0)=0) Then

ErrEthercat:=1; (* Forcing of EtherCAT initialization*)

ErrCanIO:=1; (* Forcing of CANOPEN IO initialization *)

End_If;

(* Ethercat initialization*)

If (ErrEtherCAT=1) Then

ErrEtherCAT:=0;

End_If;

;

(* Initialization CAN*)

If (ErrCanIO=1) Then

(* ---------------- Init on MPC -------------------- *)

InitRio(RIO1);

InitRio(RIO2);

InitRio(RIO3);

InitRio(RIO4);

;

(* ---------------- Servers starting------------------- *)

ErrCanIO:=0;

CANGUARDPARAM(100,1,16#700,FALSE); (* guarding time in ms, Tests number, COBID of request and NO NMT state checking *)

CANGUARDADD(RIO1);

CANGUARDADD(RIO2);

(*CANGUARDADD(RIO3);

CANGUARDADD(RIO4);*)

CANSENDNMT(RIO1,1); (*NMT start onIMD*)

CANSENDNMT(RIO2,1); (*NMT start on IMD*)

CANSENDNMT(RIO3,1); (*NMT start on IMD*)

CANSENDNMT(RIO4,1); (*NMT start on IMD*)

CANSENDNMT(MPC,1); (*NMT start in local*)

End_If;

(*Authorization of starting the other tasks *)

Fault:=0;

INITSETRESULT(0);

RIO initialization function

FUNCTION INITRIO : BOOL

VAR_INPUT

RioModule:tPeripheral;

END_VAR

VAR

ModuleNodeID:udint; (* Node ID of module *)

TxPdoParamIndex:uint; (* Parameter Index of PDO emission *)

TxPDOCOBID:udint; (* COBID of TxPDO *)

TxPdoMappingIndex:uint; (* Mapping Index of PDO emission *)

OutRefreshTime:uint := 50; (* Frequency of outputs refreshment : 10 ms *)

Adr:udint; (* CANopen address of corresponding area in process picture *)

RxPdoParamIndex:uint; (* Parameters Index of PDO reception *)

RxPDOCOBID:udint; (* COBID du RxPDO *)

RxPdoMappingIndex:uint; (* Mapping Index of PDO reception *)

GuardTime:uint := 100; (* Node guarding period *)

LifeTimeFactor:uint := 3; (* Tests number *)

InRefreshTime:uint := 50; (* Frequency of inputs refreshment : 10 ms *)

InputInvert:Dword; (* Inputs inversion *)

Invert:Byte; (* Inversion of a 8 inputs block *)

Filter1Period:usint; (* Filter 1 *)

Filter2Period:usint; (* Filter 2 *)

FilterEnable:DWord; (* Activation of the filters *)

Enable:Byte;

FilterNum:DWord; (* Filter number *)

Num:Byte;

END_VAR

(***************************************************************************************)

(* *)

(* Initialization of module RIO 40 *)

(* *)

(***************************************************************************************)

(* *)

(* Warning, this program uses TxPDO 64+NodeID and RxPDO 64+NodeID *)

(* *)

(***************************************************************************************)

(* Init PDO setupin emission on MPC *)

ModuleNodeID:=READPARAM(RioModule,_CANIO_NODE_ID);

TxPdoParamIndex:=UDINT_TO_UINT(16#1800+64+ModuleNodeID);

TxPDOCOBID:=16#200+ModuleNodeID;

WRITE(MPC,TxPdoParamIndex,1,32,TxPDOCOBID); (* COBID on which the outputs are sent *)

WRITE(MPC,TxPdoParamIndex,2,08,254); (* Tx periodic *)

WRITE(MPC,TxPdoParamIndex,3,16,0); (* Pas d'inhibit *)

WRITE(MPC,TxPdoParamIndex,5,16,UINT_TO_UDINT(OutRefreshTime)); (* emission period in ms *)

;

(* Init mapping PDO in emission on MPC *)

TxPdoMappingIndex:=UDINT_TO_UINT(16#1A00+64+ModuleNodeID);

WRITE(MPC,TxPdoMappingIndex,0,32,1); (* 1 element *)

Adr:=READPARAM(RioModule,_CANIO_OUTPUT_ADDRESS); (* Address reading in process picture *)

Adr:=((Adr-512)+16#611000)*256+16#10; (* Address conversion in Index/Sub CANopen *)

WRITE(MPC,TxPdoMappingIndex,1,32,Adr); (* Mapping writing of TxPDO *)

;

(* Init PDO setup in reception on MPC *)

RxPdoParamIndex:=UDINT_TO_UINT(16#1400+64+ModuleNodeID);

RxPDOCOBID:=16#180+ModuleNodeID;

WRITE(MPC,RxPdoParamIndex,1,32,RxPDOCOBID); (* COBID on which the inputs are received *)

WRITE(MPC,RxPdoParamIndex,2,08,254); (* Periodic immediate *)

;

(* Init mapping PDO in reception on MPC *)

RxPdoMappingIndex:=UDINT_TO_UINT(16#1600+64+ModuleNodeID);

WRITE(MPC,RxPdoMappingIndex,0,32,1); (* 1 element *)

Adr:=READPARAM(RioModule,_CANIO_INPUT_ADDRESS); (* Address reading in process picture *)

Adr:=((Adr-512)+16#610000)*256+16#20; (* Address conversion in Index/Sub CANopen *)

WRITE(MPC,RxPdoMappingIndex,1,32,Adr); (* Writing of mapping of RxPDO *)

;

(* Initialization of Node Guarding of RIO *)

WRITE(RioModule,16#100C,0,16,UINT_TO_UDINT(GuardTime)); (* Guarding time in ms *)

WRITE(RioModule,16#100D,0,8,UINT_TO_UDINT(LifeTimeFactor)); (* Tests number *)

;

(* Initialization of TxPDO of RIO *)

WRITE(RioModule,16#1800,2,8,254); (* Transmission type 254 *)

WRITE(RioModule,16#1800,3,16,UINT_TO_UDINT(InRefreshTime)); (* Inputs Inhibit time *)

;

(* Initialization of RIO inversions *)

InputInvert:=UDINT_TO_DWORD(READPARAM(RioModule,_CANIO_INPUTS_INVERT_1));

Invert:=DWORD_TO_BYTE(InputInvert);

WRITE(RioModule,16#6002,1,8,BYTE_TO_UDINT(Invert)); (* Inputs Inversion 1 to 8 *)

InputInvert:=SHR(InputInvert,8);

Invert:=DWORD_TO_BYTE(InputInvert);

WRITE(RioModule,16#6002,2,8,BYTE_TO_UDINT(Invert)); (* Inputs inversion 9 to 16 *)

InputInvert:=SHR(InputInvert,8);

Invert:=DWORD_TO_BYTE(InputInvert);

WRITE(RioModule,16#6002,3,8,BYTE_TO_UDINT(Invert)); (* Inversion entrées 17 à 24 *)

;

(* Initialization des filtres du RIO *)

Filter1Period:=UDINT_TO_USINT(READPARAM(RioModule,_CANIO_FILTER_PERIOD));

Filter2Period:=UDINT_TO_USINT(READPARAM(RioModule,_CANIO_FILTER_2_PERIOD));

WRITE(RioModule,16#2000,1,8,USINT_TO_UDINT(Filter1Period)); (* Filter 1 *)

WRITE(RioModule,16#2000,2,8,USINT_TO_UDINT(Filter2Period)); (* Filter 2 *)

;

(* Initialization of RIO filtrage *)

FilterEnable:=UDINT_TO_DWORD(READPARAM(RioModule,_CANIO_FILTER_ENABLE_1));

Enable:=DWORD_TO_BYTE(FilterEnable);

WRITE(RioModule,16#6003,1,8,BYTE_TO_UDINT(Enable)); (* Inputs filters 1 to 8 *)

FilterEnable:=SHR(FilterEnable,8);

Enable:=DWORD_TO_BYTE(FilterEnable);

WRITE(RioModule,16#6003,2,8,BYTE_TO_UDINT(Enable)); (* Inputs filters 9 to 16 *)

FilterEnable:=SHR(FilterEnable,8);

Enable:=DWORD_TO_BYTE(FilterEnable);

WRITE(RioModule,16#6003,3,8,BYTE_TO_UDINT(Enable)); (* Inputs filters 17 to 24 *)

;

(* Initialization of RIO filters numbers *)

FilterNum:=UDINT_TO_DWORD(READPARAM(RioModule,_CANIO_FILTER_NUM_1));

Num:=DWORD_TO_BYTE(FilterNum);

WRITE(RioModule,16#2100,1,8,BYTE_TO_UDINT(Num)); (* Inputs filter number 1 to 8 *)

FilterNum:=SHR(FilterNum,8);

Num:=DWORD_TO_BYTE(FilterNum);

WRITE(RioModule,16#2100,2,8,BYTE_TO_UDINT(Num));

(*Inputs filter number 9 to 16 *)

FilterNum:=SHR(FilterNum,8);

Num:=DWORD_TO_BYTE(FilterNum);

WRITE(RioModule,16#2100,3,8,BYTE_TO_UDINT(Num));

(*Inputs filter number 17 to 24 *)

;

InitRIO:=True;

;

END_FUNCTION


Ethercat

Construction in progress.


Connection

The remote control allows via a an internet link the remote control of a MPC with a software Motion Studio.

Architecture

The different elements are connected as follows:

The MPC is connected to the distant PC via port 6100

Connection between the MPC and its internet access

Type : Ethernet TCP/IP

Connection between the distant PC and its internet access

Type : local internet access (Modem RTC, ADSL )

Internet access via local network (Router)

· For the 2 types of access, it is necessary that port 6100 is open on the distant PC (stop or modification of the parameters of the firewall)

In the case of an access by local network, it is necessary to redirect port 6100 of the router towards the distant PC (see with your administrator network).


Setup

Setup of the Ethernet TCP

SETUP \ MPC \ ETHERNET TCP \ ETHERNET TCP

· Name : name given to the MPC (optional)

· Address IP : address IP of MPC (to fill in order to access to the MPC via direct connection)

· Mask : mask of under network (to fill in order to use the remote control)

· Gateway: address IP of the network gateway on which the MPC is connected (to fill in order to use the remote control)

· DNS : address of the DNS server (to fill in order to use the remote control via a DNS server)

Setup of the remote control

SETUP \ MPC \ ETHERNET TCP \ REMOTE CONTROL

· IP Remote control : address IP of distant PC or router (obligatory, this address must be provided or filled by the final user via a terminal operator).

· Use the input 32 : activation of the remote control via the input 32

The port 6100 must be opened in TCP on the distant PC (stop or modification of the firewall parameters if necessary). Moreover in the case of a connection Internet by local network, port 6100 of the router must be redirected towards the distant PC (see your administrator network).

It is possible to visualize address IP of the distant PC by starting the assistant of remote control software C Motion Studio


Link establishment

The starting of remote control requires 2 people: The 1st person on the site of the MPC must be able to modify the setup of remote control (addresses IP of remote control) and to start connection via a terminal operator, the second person on the site of the distant PC will have to be able to provide the address of the remote control.

Once the connection established, the person on the site of the MPC is not necessary any more.

Activation of the remote control on MPC

· Request of remote control on MPC :

Either by the execution of the instruction Remote (1)

Or by the modification of the parameter _MPC_REMOTE_CONTROL via the bus CANopen or Modbus.

Or by a rising edge on the input 32 of MPC (if the parameter « Utilise lentrée 32 » is activated)

Cyclic display of the letters H L P on the display 7 segment of MPC.

If at the end of 10 mn, it did not have connection with the distant PC, the request for remote control stops and the display of HLP disappears.

Activation of the remote control of distant PC

· Start the assistance of the remote control by clicking on remote control in the menu Options (from the version 0.59) or the icon of the Motion Studio software.

· Select the interface (network card, modem ) used for the connection with the MPC :

· Start the distant PC connection by clicking on START

· The distant PC waits for the MPC connection

· The MPC is connected to the distant PC

· Start the communication between the Motion Studio and the MPC by clicking on Connect in the menu Communication or on the icon of the Motion Studio software.

Permanent display of a H on the display 7 segment of MPC.

In remote control mode, it is possible to reload the operating system, to start again the MPC without loss of connection.

Stop of the remote control

· Stop of the remote control:

Either by the execution of the instruction Remote (0)

or by the modification of the parameter _MPC_REMOTE_CONTROL via the bus CANopen or Modbus.

Or a falling edge on the input 32 of MPC (if the parameter « Utilise lentrée 32 » is activated)


Panel screen example

Command screen of the remote control:

From this screen , we can reach the setup screen of the remote control.

The button start (_MPC_REMOTE_CONTROL) allows starting or stopping the remote control, it corresponds to the instruction REMOTE (x).

The status of the connection is returned by the parameter _MPC_REMOTE_STATUS, it corresponds to the status of the instruction REMOTE_S (0).

Name of the parameter | Adr. Modbus - size | Function
_MPC_REMOTE_CONTROL | 430203 (1) | Remote control
_MPC_REMOTE_STATUS | 430204 (1) | Status

Setup screen of the remote control :

This screen allows modifying all parameters necessary for the remote control.

Name of the parameter | Adr. Modbus - size | Function
_MPC_IP_ADDRESS | 430101 (2) | Address IP
_MPC_IP_MASK | 430103 (2) | Mask
_MPC_IP_GATEWAY | 430105 (2) | Gateway
_MPC_IP_DNS | 430107 (2) | DNS
_MPC_REMOTE_IP | 430201 (2) | IP Remote control


REMOTE

Syntax

REMOTE (<Cmd>)

Accepted type

<Cmd> : USINT

Description

This function allows starting/stopping the remote control :

  • Force <Cmd> at 0 to stop the remote control

  • Force <Cmd> at 1 to start the remote control.


REMOTE_HOST

Syntax

REMOTE_HOST (<HostName>)

Accepted types

<HostName> : STRING

Description

tHIS function allow to force the hostname of the remote control


REMOTE_S

Syntax

<Q> := REMOTE_S (0)

Accepted types

<Q> : USINT

Description

This function returns to the state of the remote control :

  • 0 : no curren remote control

  • 1 : waiting connexion

  • 2 : connected to the remote PC


C11001

Cannot determine clearly the type of constant -> take %1.

The type of a numeric constant cannot be clearly determined. In this case usually the biggest supported data type of the expected data type class (ANY_INT, ANY_REAL, ANY_BIT) is presumed.


S1023

Invalid number (i.e., numerical constant).

The given numeric constant contains an invalid character. See table Numeric literals for examples of valid numeric literals.


S1031

Unallowed usage of EN. Allowed as an identifier for a bool variable in input section.

A variable with the name EN has been declared in the wrong variable section or with incorrect type.

The name EN (enable) is reserved for Boolean input variables.

If the value of EN is FALSE when the function or function block is called the operations defined by the function/function block shall not be executed. If the Boolean output parameter ENON has been defined too than the value of ENON is reset to FALSE.

If the value of EN is TRUE when the function or function block is called the operations defined by the function/function block are executed. These operations can include the assignment of a Boolean value to the Boolean output parameter ENO, if this parameter has been defined too.


S1032

Unallowed usage of ENO. Allowed as an identifier for a bool variable in output section.

A variable with the name ENO has been declared in the wrong variable section or with incorrect type.

The name ENO (Enable Out) is reserved for Boolean output variables. The variable ENO requires the Boolean input variable EN.

If the value of EN is FALSE when the function or function block is called the operations defined by the function/function block shall not be executed and the output parameter ENON is reset to FALSE.

If the value of EN is TRUE when the function or function block is called the operations defined by the function/function block are executed. These operations can include the assignment of a Boolean value to ENO.


S3000

Function non declared.

A CAL to an unknown function block instance has been found.

An instance of a function block must be declared before it can be used.

Advice:

Make sure that an instance of the requested function block is declared in one of the variable declaration sections.

Make sure that the name of the function block instance is correctly spelled.


S3046

Type names can not be used as an instance names.

A type name or the name of a program organisation unit has been used in a declaration as a variable name. Program organisation units and types defined on project level are known in the whole project scope and their names can not be used as identifiers for local variables

Example:

FUNCTION Power

(* function block declarations *)

(* statements *)

END_FUNCTION

PROGRAM main

VAR

Power: REAL; (* Error: Power is not allowed as a variable name, because it already has been

used as a function name *)

END_VAR

(* Code *)

END_PROGRAM


Télémaintenance

Remote control

Construction in progress.


DATE

See elementary data types

Notes

This data type is defined by the IEC61131-3.

Warning

This data type is currently not implemented in Motion Studio.


DATE_AND_TIME

See elementary data types

Notes

This data type is defined by the IEC61131-3.

Warning

This data type is currently not implemented in Motion Studio.


ELSIF

See IF


ADDMOV

ADDMOV  Superposition of movements

Syntax

ADDMOV (<Slave>, <Master>, <Source>)

Accepted types

<Slave> : tPeripheral
<Master> : tPeripheral
<Source> : tSrcPos

Description

This function allows the superposition of its own movements and the master axis movements on a slave axis.
<Slave> : Name of the axis
<Master>: Name of the axis
<Source> allows the selection of the source <Master>

Remark

The master and the slave can execute any type of movements like positioning, synchronization or interpolation.

Example ST

ADDMOV (Axis_X, Axis_Y, SRC_AXIS) ; (* Superperposition on the Axis_X of the movements of the Axis_Y *)

See also

ADDSTOP


ADDSTOP

ADDSTOP  Stop the superposition of movements

ADDSTOP (<SlaveAxis>)

Accepted types

<SlaveAxis> : tPeripheral

Description

This function cuts off the links of superposition movements of the slave axis.
<SlaveAxis> Name of the axis

Remarks

If the slave axis passed in open loop mode (AXIS(Slave)=Off), the link between the master and the slave axis is also cutting off.

Example ST

ADDMOV(Axis_X,Axis_Y, SRC_AXIS); (* Superperposition on the Axis_X of movements of Axis_Y *)
Delay(10000);
ADDSTOP(Axis_X); (* Stop of the superposition on the Axis_X after 10s *)

See also

ADDMOV


R Reset langage IL


STRING

See elementary data types

Notes

This data type is defined by the IEC61131-3.


TIME

See elementary data types

Notes

This data type is defined by the IEC61131-3.


TIME_OF_DAY

See elementary data types

See elementary data types

Notes

This data type is defined by the IEC61131-3.

Warning

This data type is currently not implemented in Motion Studio.


Editeur SFC : introduction

SFC language

Description

The language SFC (sequential function chart), or GRAFCET, is a graphic language used to describe the sequential operations. The process is represented as a known succession of steps (stable states), connected between themselves by transitions. A boolean condition is attached to each transition. The actions in the steps are described with the languages ST, IL.

Elements of a SFC

A SFC program is a graphic network of steps and transitions, connected by directed connections. The multiple bonds of connections are represented by divergences. Part of the graph, named `macro step' can be isolated, and represented in the principal graph by only one symbol.

Äa step cannot be followed by another step

Äa transition cannot be followed by another transition

The sequential diagram of function offers the following elements of language:

Step:

A step contains many actions. The actions contain fragments of code. A step, which is running, is called "active". If a step is activated, the actions contained will run. A step can be activated by: commutation of a previous transition, an element of jump, configuration of an initial flag (c.f initial step).

Initial step:

The initial situation of a program SFC is represented by its initial steps. It is different from the other steps thanks to the double square. A program SFC must contain at least an initial step.

Transition :

The flow of program is temporally and structurally commanded by commutation of the transitions. A transition will commutate if the state of transition is true and if all the previous steps are in activity. Once the transition commutates, all the previous steps become inactive and all the following steps become active.

Divergence in AND:

A transition can activate several steps at the same time while passing by a divergence in AND. If all steps preceding transition T1 are active and that the transition is TRUE, all the steps (for example, S1, S2) which follow the divergence in AND will get on.

Convergence in AND:

A transition can deactivate several steps at the same time if it is preceded by a convergence in AND. If all the previous steps (for example, S1, S2) are activated and that the condition of transition (T1) is TRUE, all the previous steps will be deactivated and the steps following the transition T1 will be activated.

Divergence in OR:

If the step preceding the divergence in OR is activated, all transitions (for example, T1, T2) are checked from left to right. The first transition which is `TRUE' is shift; this transition deactivates the step (S1) and activates the following step.

Convergence in OR:

The convergence in OR comes to close a divergence in OR. If one of the transitions (T1 or T2) commutates, the steps preceding the transition will be deactivated, and the following steps will be activated.

Jump :

The flow of the program continues on another space. The name of the jump is the name of the step which will be active if the previous transition (T1) commutates.


Etapes et étapes initiales

Steps and initial steps

The code of a step is recurrently executed if and only if it is an active state. In theory, we can indicate that the code is surrounded by a loop which is written if a previous transition commutates, and is left if a following transition commutates. If a step were activated, its code is executed at least once. The initial steps are always activated at the beginning of program which means that the previous NOT transition is necessary. . Each step can be converted into initial step by activating control ActiveX `initial step' in the window of properties. Removing this option will redefine the step in a normal stage.

The name of a step must correspond to following syntax:

The first character of the step name is a letter ("a`-"z`, "A`-"z`)

Each other character is a letter or a number (,0` - "9`) or the character underlined ("_`).

`Step1' and 'S_1 are valid names, _Step1 and 1Step are not authorized

The steps names have a maximum length of 31 characters. To get more information, see Jumps.


Sauts vers des étapes

Jumps

The predecessor of a jump element is always a transition. The target of a jump is always a step. The target of the jump is fixed by giving to the jump the same name as the selected target step. If a step is indicated as target of a jump, its name must be single. If a jump is not available or more the once available, some corresponding error messages are created during the checking of syntax.

To guarantee the uniformity of a plan SFC, the insertion of a jump is possible only as last element of a divergence of choice of order.


Transitions

The transition is responsible for the change of the active state of the previous step (s) at the following step (s). The transitions show a state change from FALSE to TRUE (Boolean).

The transition code must be written so that the current result at the end of the code is of type BOOL. The transition commutates if and only if the value of the accumulator is TRUE. The communication with other elements SFC occurs by local variables.

Example:

(*The transition commutates if the temperature is over 70° C *)

LD variable of temperature

GT 70


Accessoires

Accessories

  • Clock : Controls and adjusts the MPC internal clock. This clock real time allows the time-stamping of the events and to manage by program of machine operating time for example.

  • Watchdog : Displays and changes the state of MPC relay watchdog.

  • Backup : Allows to define the management system of saved data (Parameters and saved variables). With this tool, you can control the state of the saved memory and its flash backup. It is also possible to define an automatic flash backup (at start-up and/or on low battery). At least some tools are available to manually save or delete saved data.


Editeur de type de donnée

Data type editor

Build in process


Editeur de variables globales

Global variables editor

Build in process


Editeur IL

IL editor

Build in process


Editeur SFC

SFC editor

Build in process


Générateur

Generator

Building in process