a x 2 0 0 0 s y s t e m g e t t i n g s t a r t e d - ferraris elettronica · 2010-07-30 · studio...

22
Studio Ferraris Ax2000 System Getting Started Date: 05/04/2002 Rev: 001 Page: 1/22 Studio Ferraris – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568 Maurizio Ferraris Ax2000SystemGettingStarted.doc 1/22 A A x x 2 2 0 0 0 0 0 0 S S y y s s t t e e m m G G e e t t t t i i n n g g S S t t a a r r t t e e d d Revision 001 April 05, 2002

Upload: others

Post on 06-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 1/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 1/22

AA xx 22 00 00 00 SS yy ss tt ee mm GG ee tt tt ii nn gg

SS tt aa rr tt ee dd

RR ee vv ii ss ii oo nn 00 00 11

AA pp rr ii ll 00 55 ,, 22 00 00 22

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 2/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 2/22

S u m m a r y

SUMMARY....................................................................................................................................................................... 2

REVISIONS ...................................................................................................................................................................... 3

ABSTRACT ...................................................................................................................................................................... 4

REFERENCE DOCUMENTS......................................................................................................................................... 5

AX2000 SYSTEM OVERVIEW ..................................................................................................................................... 6

SYSTEM ARCHITECTURE .......................................................................................................................................... 7

SOFTWARE COMPONENTS............................................................................................................................................... 7

AxCore ...................................................................................................................................................................... 7

Plc subsystem ............................................................................................................................................................ 8

Ax2000Deal............................................................................................................................................................... 8

Ax2000DCom............................................................................................................................................................ 8

SmallCompiler .......................................................................................................................................................... 9

LoadPlc ..................................................................................................................................................................... 9

WinMotionTest .......................................................................................................................................................... 9

VIRTUAL HARDWARE RESOURCES .................................................................................................................................. 9

VARIABLES................................................................................................................................................................... 10

MACHINE DIRECTORY .................................................................................................................................................. 11

STEP 1: START ............................................................................................................................................................. 13

STEP 2: WINMOTIONTEST ....................................................................................................................................... 15

STEP 3: FIRST PLC ...................................................................................................................................................... 17

STEP 4: RUN A PLC ..................................................................................................................................................... 19

Plc Compilation ...................................................................................................................................................... 19

Plc Start .................................................................................................................................................................. 19

I/O Forcing ............................................................................................................................................................. 20

Online Mode............................................................................................................................................................ 20

STEP 5: USING VARIABLES...................................................................................................................................... 21

STEP 4: USING SYMBOLS.......................................................................................................................................... 22

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 3/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 3/22

R e v i s i o n s

Rev. Author Date Description

000 Maurizio Ferraris 21 Jan, 2002 First Release

001 Maurizio Ferraris 5 Apr. 2002 Corrections and additions

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 4/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 4/22

A b s t r a c t

This document contains the fundamental information that must be known in order to start using theAx2000 System. This manual is organized in steps, and during each step some exercises are shownand explained.

The user either of the Demo or the complete version may follow the examples. Any differencebetween the two versions will be indicated.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 5/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 5/22

R e f e r e n c e d o c u m e n t s

Author Title Description

CompuPhase The Small C booklet Small C language reference

Studio Ferraris Ax2000BoardsUserManuals Hardware and installation manual for hardwaremodules

Studio Ferraris Ax2000SystemUserManuals User guide and reference manual for Ax2000System

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 6/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 6/22

A x 2 0 0 0 S y s t e m O v e r v i e w

The Ax2000 System is a high-performance automation system based on standard industrial PC.Modern PC have reached a great level of robustness, and reliability, and have enoughcomputational power to completely control an automation system, from motion control, to generalI/O processing, as well as offer a friendly user interface.

The Ax2000 System offers a foundation on which the system integrator may build its own userinterface and programs.

This foundation offers the following general features:

• easy and automatic integration with different hardware configurations

• Real time management of the hardware modules

• Support for User defined Real time code (PLC) in easy and interactive way

• High level of abstraction of system resources that are seen uniformly by user applications

• Support for symbolic programming

• Support for multilingual applications

• Full set of tools for debugging and deployment

• Transparent access to machine resources through Local network or the Internet

The Demo version allows the user to exploit all these functionality in the same way as the fullversion. A complete development can be done through the Demo version and easily ported to thefull version. The only differences are that the Demo does not allow access to the hardware, butrather to a simulated environment, and that the Real time modules may have greater latencies,depending on the PC load.

In this manual any difference from the Demo or Full versions will be indicated.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 7/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 7/22

S y s t e m A r c h i t e c t u r e

The Ax2000 system is composed by several modules that cooperate and work at different prioritylevels in order to accomplish all tasks in timely manner. The following picture shows the differentmodules and the timing requirement associated with each.

Software Components

AxCoreAxCore is the highest priority module; all tasks in this module have higher priority than every otheruser task. All Real time tasks are done in this module. Different tasks are assigned to differentlevels of priority, according to the Real time requirements. The motion control and trajectoryplanning computations are at the top priority. At a lower level we find the Plc interpreter, and at thelowest there are the command executor, status response and communication tasks.

AxCoreHARDWARE

Plc

VirtualizedResources

Deal

UI Applications

Plc Files

Fast Real Time

Real Time Non Real Time

local or widearea Network

Remoteapplications

UI Applications

Ax2000DCom

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 8/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 8/22

Plc subsystemThe Plc subsystem is a Real time execution environment into which the user can run dedicatedprograms. These programs are written in "Small C", a C language subset, and have nativeinstruction to operate on the motion, I/O and shared variables.

Ax2000DealAx2000Deal is a complete user callable library that hides the complexity of the communicationwith the Real time module (AxCore). It represents the bridge between the Real time and the nonReal time worlds. Dedicated functions and interfaces are available to operate on the varioussubsystems with higher level commands. The Ax2000Deal offer to the applications functions tomanage the configuration, the Plc subsystem, the axes parameters, and a great number of functionsto get system information. The Ax2000Deal library is optimized to offer an efficient and directcommunication to user programs written in C or C++. Other languages can use the Ax2000DComserver instead.

Ax2000DComThe Ax2000DCom subsystem offers a group of standard COM objects and interfaces that can beused from any language able to call COM objects, including Visual Basic, and script languages likeVbScript, JavaSript, and even HTML or ASP pages. This COM server is also able to transparentlyrelay the application requests via local or wide are networks to other systems running the Real timeprocesses, seamlessly accessing a single machine from different computers. This allows the systemintegrator to take advantage of a great number of possible architectural structures and manydifferent scenarios for his or her machines. It is possible, for example, to debug different parts ofthe same machine at the same time allowing more than one developer to work together, or to showthe machine status on one computer while another, possibly installed in a centralized location,shows the statistics or the production progress.

The Ax2000DCom server offers also a full set of objects and methods to operate on descriptionstrings. These strings can be associated with all system objects like axes, single IO points and canbe retrieved by the user application to improve user readability. The advantage of this approach isthat even different application can, without effort, show the same descriptions, and that multilingualsupport is already included.

Additionally, symbols can be attached to various elements and it is possible to automaticallygenerate include files used by PLC. This way PLC programs can use the very same definitions evenif generated by different programmers.

All these descriptions are easily imported or exported from/to text format, to easy translations intodifferent languages, or to read the descriptions directly to/from Electric CAD systems.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 9/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 9/22

SmallCompilerThis is an application that is not related to the Real time system but is used to compile the PLCprograms into a compact form suitable to be sent and executed in the Real time environment. Everychange in the source of a PLC program must be compiled before sending to the Ax2000 system.This compilation also checks for syntax errors and other kind of logic errors. This compiler isstarted from the command line and does not offer graphical user interface. This way it is easy, forexample, to start it from batch files. The WinMotionTest program offers an integrated environmentto interactively to compile and activate Plc programs in a friendlier way.

LoadPlcThis is an application that is used to send new versions of PLC programs to the Ax2000 system forexecution. This same application can be used to check the status of the running PLC programs, tostop or remove one. This application, like the SmallCompiler is started from the command line andcan be used in batch files. The WinMotionTest offers a graphical interface to show the status, toedit, compile and activate Plc programs.

WinMotionTestThis is a general purpose diagnostic tool. With this application it is possible to see the machinestatus, force I/O, move motors, perform axes tuning and record motor trajectories. It offers agraphical user interface to set up and test new machines and new programs. It offers also anintegrated environment to develop and test Plc programs.

Virtual hardware resourcesThe system, particularly the AxCore module, virtualizes the hardware resources it have found intological resources that can be accessed by the software in a common and uniform way independentlyof the underlying hardware combinations. These logical resources are uniformly numbered fromzero to the maximum value. Each access to the resource made from a user or PLC program mustreflect this numbering.

Each type of logical resource is essentially seen as a vector of those resources, and any reference tothat resource is made using the index. As an example in a configuration with two IntOut boardsthere will be a total of 64 digital outputs, numbered from 0 to 63. The user or PLC program canevenly access all 64 bits using the index, without caring that the first 32 bits will be mapped into thefirst physical board, and the other 32 bits to the second.

The available logical resources types are:

• Digital inputs

• Digital outputs

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 10/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 10/22

• Analog inputs

• Analog outputs

• Encoder counters

• Axes

VariablesIn addition to the hardware resources there are a number of variables, that can be used to storestatuses and computations results. There are different types of variables, and in different totalnumber. All variables are visible in a uniform way from applications and PLC programs, and canalso be used to share data between the two worlds. Some type of these variable is also stored in abattery backed up memory area that is able to keep the values even with the main power turned off.

The following table summarizes the different variables types and the main characteristics for eachtype:

Name Type Backed Group Netw. Description

R Int32 No No No General purpose integer variable

RR Int32 Yes No No Battery backed integer variable

D Float64 Yes No No Battery backed double precision floating pointvariable

V Float32 Yes No No Battery backed single precision floating pointvariable

M Int16 Yes No No Battery backed short integer variable

B Int8 Yes No No Battery backed byte variable

S Int32 No Yes No Grouped integer variable system variable

SV Float32 No Yes No Grouped single precision floating point systemvariable

SS Int32 Yes Yes No Battery backed, grouped integer system variable

N Int32 No Yes Yes Networked and grouped integer variable

NV Float32 No Yes Yes Networked and grouped single precision floatingpoint variable

T UInt32 No No No Timer variable, automatically decremented each

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 11/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 11/22

millisecond by the system down to zero

NT Int32 No Yes Yes Networked and grouped integer variable

These variables are shared between PLC programs and UI applications, and can be used as atemporary storage for computations, or to share data and commands. The networked types can beeven used to share data between different PC that cooperate to run a complex automation system.

Machine DirectoryThe Ax2000 System is by default installed in a directory called Ax2000 in the root of your C drive,but in order to give the user the maximum flexibility, there is a user defined "Machine" directory inwhich all configuration files for a particular machine are placed.

This method allows also to have several "Machine" directories in the same PC, with only oneAx2000 System installation. The developer may switch from one "Machine" to another effectivelybeing able to develop different machines using only one development PC.

The machine directory can be anywhere in the file system, end it is identified by containing the fileAx2000Config.xml.

This file contains the main configuration file for the system. All other configuration files and Plcfiles are contained into sub directories of this machine directory. Essentially anything related to aparticular instance of a machine should be placed into or under this "Machine" directory.

The AxCore module, when started, is told where the machine directory is, and all other tools willuse automatically the same directory for their operation. Until the AxCore module is running thecurrent Machine directory is defined and cannot be changed. To change Machine you have toterminate the AxCore module and restart it with a different configuration.

This is done to improve safety, because the configuration may contain specific hardware resourcesdefinition and parameters, and when these are connected to the physical machine damage mayoccur if the machine directory is changed to a different one. It is advisable that on the physicalmachine, only the right "Machine" directory in installed.

Inside the machine directory there is place for user defined sub directories that may contain anyuser defined configuration file specific for that machine.

The Real time module and the Ax2000 System does not use any additional file as long as theAx2000Config.xml file, and all other files that may be referenced inside this main configuration fileare present.

In order to easy the user learning curve, a Demo "Machine" directory with all needed sampleconfiguration files is installed in the Ax2000\Demo directory. Thus this directory can be selected as

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 12/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 12/22

the first "Machine" directory to run through the samples and practicing the various tools andlanguages.

Note: The installation on the Demo Machine directory is done under the main Ax2000installation directory only to easy the installation and removal of the software. It is advisableto put the normal "Machine" directory that the user will eventually create into a separatedirectory tree. Having a separate directory will simplify "Machine" backup, copy andmodifications.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 13/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 13/22

S t e p 1 : S t a r t

After installation there will be a directory Ax2000 under which all software components isinstalled. A new Start Menu group will be found under the Programs selection.

Note: The software is based on XML technology and required MSXML version 3.0 installed.This component is installed by default with MS Internet Explorer 6.0 and higher, and it ispossible to freely download this component from Microsoft's site. As a convenience for theuser the installation file "msxml3sp2Setup.exe" is included in the Ax2000 root directory. Ifyou don't have this component installed, or if you experience errors related to XML duringstart up, then you can run this executable and follow the instructions.From the start menu find and start the WinMotionTest program.

This is a general purpose development and debugging tool, and can be used to connect to the Realtime environment. This program is designed to look for a suitable Real time module running on thiscomputer or on the network. If it does not find its Real time counterpart, it will ask the user whereto connect to.

This is what will happen after you launch this program the first time, or any time when there is noReal time module is running. The following dialog appears:

Through this dialog you may select a local directory where to start a new "Machine", or a remotemachine to connect to. In this case there are no remote machines available, so press the "ChooseLocal" button, navigate to the \Ax2000\Demo directory and press OK twice.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 14/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 14/22

At this point two text mode windows will appear and after a little the GUI of WinMotionTest willshow up. The two text mode windows are debugging output from the Real time module AxCoreand the Ax2000DCom server respectively.

The following should appear:

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 15/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 15/22

S t e p 2 : W i n M o t i o n T e s t

From the main window of WinMotionTest, or from the picture above, you can identify thefollowing UI elements, that may be used later:

• Main Menu: Located just below the title contains all generally available commands

• Main Toolbar: Located just below the Main Menu, on the left. It contains general file and editcommands like New, Open, Save, …

• Recording Toolbar: Located on the right of the Main Toolbar, contains recording commandsavailable only when the main window shows the recorder, now they are grayed

• Plc Toolbar: Located on the right of the Recording Toolbar, contains Plc commands. The arenow active because the main window shows the Plc editor.

• Description Toolbar: Located on the right of the Plc Toolbar, contains Description commandsavailable only when the main window shows the description editor, now they are grayed

• View Toolbar: Located on the below the other toolbars, contains the Show/Hide buttons for allthe different resource viewers, and is always available

• Main Window Tabs: Located on the right side of the main window the are used to select thedifferent operation of the WinMotionTest tool. You can select Plc Editor, Curve viewer(recorder) or Description editor. The user can freely switch from one operation to the otherfreely.

• Status bar: Located on the bottom edge, shows command help, and specific information aboutthe current operation. The rightmost pane shows the current "Machine" directory of choice.

You can now try to open some resource viewer using the view toolbar, the one with large, redletters using the following guidelines. Each resource viewer can be left open during any operationand will show actual resource status at any time.

• M: View Motor status

• I: View Digital Input status

• Ik: View Keyboards Digital Input status

• O: View Digital Output status

• Ok: View Keyboards Digital Output status

• Ev: View Valves Digital Output status

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 16/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 16/22

• Ia: View Analog Input status

• Oa: View Analog Output status

• V: View Variables status

• Nt: View NT Variables status

• T: View Tensioner status

• L: View AxCore Log messages

• F: View Fixed Buffer status

• P: View Plc status

You can also switch operation by clicking on the right tabs. Other Steps in this manual will showyou how to work in different operations

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 17/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 17/22

S t e p 3 : F i r s t P L C

Select the Plc operation using the Plc tab on the right side.

Select file open from the Main Menu, or click the button on the Main toolbar. An Open FileDialog will open already pointing to the Plc subdir of the current machine directory, and showingthe source plc files.

The source Plc files are text files containing Plc source code and extension .sma. Choose the fileDemo.sma and press Ok.

The following code will appear into the main window:// Demo#include <ax2000>

main(){ if(RdInp(IN_DEMO)) SetOut(5); else ResOut(5);

if(!RdOut(5)) SetOut(3); else ResOut(3);}

This is your first Plc program, it is written in a "C" like language called "Small C". For details aboutthe Small language, please consult the " The Small C booklet".

The program just loaded into the editor is a very simple program. We use it to show some basic Plcfeatures. Few things must be noted first:

• Every Plc program starts with a function called "main". This is the entry point on the program,execution starts there.

• The first line is a comment. In general the portion of a line following a double forward slash (//)is considered a comment. Multiple line comments can be delimited by /* … */ signs.

• The second line causes the inclusion of a standard definition file. This file is part of the Ax2000System and contains the definition of all the functions and constants used by the Plc programs

• Functions used to access the Real time system (like RdInp, SetOut, …) may accept parameters(within parentheses). This parameters may be numbers or symbolic names as shown in the 6th

row. The symbol IN_DEMO is currently defined to have a value of 5

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 18/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 18/22

The program shown above explained is:

1. Check the digital input number 5 (IN_DEMO) and if active turn on digital output 5, otherwiseturn it off.

2. After that check the status of the digital output 5 and if not active turn the digital output 3 on,otherwise turn it off.

At this point you have the Demo Plc program loaded into the editor window. This is a syntaxhighlighting editor that shows different parts of the line in different colors. This will help modifyingthe code, or adding functionality.

But before changing the current code let us compile and run it, to see the effects.

Warning: If you are running the complete version of the Ax2000 System and you have alsophysical boards attached, remember that this simple Plc program may turn on digital outputs 3 or 5.Check if this may cause problems, or disconnect any device attached.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 19/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 19/22

S t e p 4 : R u n a P L C

To run a Plc, this must be first compiled. Also after any change to the source code, the programmust be recompiled and run again.

Select the Plc operation using the Plc tab on the right side.

Plc Compilation

Press the button or select Compile from the Plc menu. After the compilation a dialog showingthe compilation results is shown:

If there are errors they would be shown here, and also highlighted in the editor window.

If there are no errors the Done sentence appears as above.

Plc StartNow press the button or select Run from the Plc Menu.

The Plc is now running in parallel with the other PC and Real time operations. You can see this bydisplaying the Plc status viewer By pressing the P button or selecting Plc Status from the ViewMenu. Opening the Plc tree you can see the status and timings of this Plc.

Now let's see if the Plc is working: Open the digital output viewer by pressing the O button orselecting Output Status from the view menu.

You should see the output number 3 selected. If you have a physical input wired to the inputnumber 5 turn (or force) it on, and you will see the Output number 5 on and the output number 3off, giving evidence that the Plc is running in the system.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 20/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 20/22

I/O ForcingIn the Demo version it is not possible to turn on a physical input so you are left with the onlypossibility to force it on. Forcing is the operation to set digital input or output to a certain levelindependently of the Plc logic. It is possible to set the input value as seen by the Plc programswithout having a real input wired, or to set a physical output without disturbing the Plc logic.

The purpose of the I/O forcing is to prepare an environment to debug the Plc logic, in situationwhere the real machine is not ready yet, incomplete or not working.

To force the input 5, open the input viewer, with the I button or selecting Input status from the viewmenu. Right click on the input number 5 (Labeled IN_DEMO) and choose "Force to 1". Now thePlc logic sees the input as if it is set from the hardware, and immediately you should see the outputchanging (in the output status pane), having the proof that the Demo Plc is working.

Online ModeAnother powerful debugging aid is to put the editor in Online Mode. In this mode the runninginstructions are highlighted. It is immediate to see the result of if statement in this mode.

While in Online mode it is not possible to modify or compile the current Plc.

To set the online mode press the button or select On Line from the Plc menu

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 21/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 21/22

S t e p 5 : U s i n g V a r i a b l e s

One of the most powerful features of the Ax2000 System is the possibility to share variablesbetween the Real Time, Plc and application environments. There are many different types andnumber of variables. Each type may have a particular functionality associated, or be generalpurpose.

S t u d i o F e r r a r i sA x 2 0 0 0 S y s t e m G e t t i n g S t a r t e d

Date: 05/04/2002

Rev: 001

Page: 22/22

S t u d i o F e r r a r i s – Via Borgonuovo 27 – 10040 Givoletto(To) – Italy

Tel:+39-011-9947752 Fax:+39-011-9948921 Mob:+39(0)335-8061568

Maurizio Ferraris Ax2000SystemGettingStarted.doc 22/22

S t e p 4 : U s i n g S y m b o l s

Another very useful feature of the Ax2000 System, is the possibility to easily associate a symbolicname, and a number of descriptions (one for each defined language), to each element of the system.

Every single Input or output, or axis can have symbol and descriptions associated.