• No results found

EasyPLC User Manual.pdf

N/A
N/A
Protected

Academic year: 2021

Share "EasyPLC User Manual.pdf"

Copied!
100
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

2

Table of Contents

INTRODUCTION

1. General Description

1.1 EasyPLC Programs Group

1.2 EasyPLC Installation & Minimum requirements

1.3 Demo vs. registered version

1.4 How to Register EasyPLC

2. EasyPLC Editor

2.1 Program Interface

2.2 Hardware Configuration

2.2.1 Virtual PLC CPU Parameters 2.2.2 I/O Devices

2.2.2.1 Add a New Driver 2.2.2.2 Remove a Driver. 2.2.2.3 Available Drivers

2.2.2.4 How to Develop an EasyPLC Driver.

2.3 Software Structure 2.3.1 Variables 2.3.2 Program Modules 2.3.2.1 Init 2.3.2.2 Main. 2.3.2.3 Functions 2.3.2.4 Common Area 2.3.3 Data Blocks 2.3.4 Plugins 2.4 Languages 2.4.1 Ladder 2.4.1.1 Contacts 2.4.1.2 Coils 2.4.1.3 Segments

2.4.1.4 Read/Write Analogic/Digital I/O 2.4.1.5 Using variables 2.4.1.6 Comparator 2.4.1.7 Counters 2.4.1.8 Timers 2.4.1.9 Data Blocks 2.4.1.10 Function Call 2.4.1.11 Register Transfer 2.4.1.12 Comments 2.4.1.13 Shortcuts Keys 2.4.1.14 Special Coil (Return)

2.4.2 Script

2.4.3 Function Blocks 2.4.4 Grafcet

(3)

2.5 HMI

2.6 Compilation & Transferring logic program to Virtual PLC

2.7 Cross References

2.8 Printing

2.9 Connection with Virtual PLC CPU

2.9.1 Local & Remote connection modes 2.9.2 Available Operations

2.9.3 Viewing logic programs running 2.9.4 See/Force Variables

2.10 EasyPLC Editor Customization

3. Virtual PLC CPU

3.1 Virtual PLC CPU Console

3.2 Operation Modes

3.3 Virtual PLC CPU Modules

3.3.1 CPU

3.3.2 Communication 3.3.3 I/O Modules

3.4 PLC Scan Cycle Time Graph

3.5 Virtual PLC CPU Clock

3.6 Reset Virtual PLC CPU

4.

HMI System

APPENDIX

(4)
(5)

INTRODUCTION

1. General Description

EasyPLC Sofware Suite is a group of programs that allows to make automatism control and simulation. With EasyPLC you can write logic programs like commercials PLC for multiple uses like real automatism control, domotics, simulation, initialization to the PLC’s world and much more…

The main characteristic of EasyPLC is that it emulates the operation of a PLC, using the programming languages most used in the industrial world: Ladder, Grafcet, Logic Function Blocks and Script.

You will be able to learn how to use the automatic control systems used in the industry, only with your Personal Computer, the EasyPLC software and an input/output interface or a simulated one.

A New Dimension in your PC

With EasyPLC you will be able to give a new dimension to your PC. Make your PC work with the external world; you will be able to use your PC like a PLC.

The PLC's (Programmable Logical Controller) are the electronic systems that are used in the industry to control the automatic machines, Interfaces, Robots, etc with a simple graphic programming language.

Use your PC (or even the old computer that is no longer used) to control relays, motors, lamps, alarms, push buttons, etc... Creating automatisms only limited by your imagination.

An important characteristic of EasyPLC is simulation, if you do not have at your disposition the necessary devices to automate a system, with Machines Simulator you can create your own virtual machines and simulate them in a 3D world with real time graphics and physics.

Easy Connection

EasyPLC is designed to work with the PC ports (Serial/Parallel/USB). It is not necessary to open the computer or do complex configuration tasks, only install the software, connect the interface and begin programming.

Easy Programming Languages

EasyPLC uses a standard language in the PLC's programming world, the LADDER language, this system allows the program to be written as if they were circuits with relays, counters, timers, registers, etc...

(6)

1.1 EasyPLC Programs Group

EasyPLC Software Suite is composed by the following programs: • EasyPLC Editor

• Virtual PLC CPU • HMI System

EasyPLC Editor is the utility to create, edit and compile the logic programs. Also is used to create the HMI Screens and to make debug and diagnosis of the logic programs, due is possible to connect with Virtual PLC CPU in order to view how the program is running.

Virtual PLC CPU is the application that executes the logic programs and emulates the operation of a real PLC. HMI System is a utility used to show a graphic interface between the users and the PLC, the HMI (Human Machine Interface) are the visual system to change information in a very user friendly way.

1.2 EasyPLC Installation & Minimum requirements

To make the EasyPLC installation only is necessary to execute the file EasyPLC Setup.exe.

During the installation, will be checked if the Microsoft .Net Framework 3.5 is present in your system, if not you’ll need a Internet connection, because the installation program will download and install this necessary component.

The Minimum requirements are:

Operative system: Windows XP with Service Pack 2 and Microsoft .Net Framework 3.5 Recommended: Windows 7 Hardware Processor: 400 MHz Recommended processor: 1 GHz. RAM: 96 MB Recommended RAM: 256 MB. Hard Disk Space: 290 MB

1.3 Demo vs. registered version

EasyPLC is distributed in two modes, Demo version and Registered version.

The EasyPLC Demo version is available to download freely from the www.nirtec.com website.

With the Demo version you can use all the EasyPLC features but only allows using the Simulated Driver and the Machines Simulator Demo Driver. You are not allowed to use real & physical input/output devices. Plugins also are not enabled.

(7)

1.4 How to register EasyPLC

If you want to register your EasyPLC copy, please fill the order form available at: http://www.nirtec.com/Register/register.htm

You must fill all the fields in the registration form and you should indicate the registration modality, single license or USB license. With the single license you can run the EasyPLC Software Suite in one single computer, with the USB license a USB Key is provided, and the suite can be executed in any computer where the key will be connected.

You must to type the Software Id of your product, to obtain it, go to EasyPLC Editor, make click on menu Help -> About.

Once your request has been processed and all commercial steps have been finished, you will receive a license file (if you have chosen the single modality). You must copy this file in the EasyPLC installation folder. Then you can use the registered EasyPLC version only in the computer that you have obtained the software Id code.

(8)

How to Execute EasyPLC and Virtual PLC CPU in Windows (Vista, 7) Administrator Mode.

1) Make mouse right click in the EasyPLC v.5 desktop icon:

2) Select properties:

3) Select Shortcut tab, and make click in the advanced options tab:

(9)
(10)

2. EasyPLC Editor

2.1 Program Interface

Here a screen shot of the visual interface of EasyPLC is shown. The following items are marked: • Menu, from where all the Editor options can be chosen.

• Tool Bar, fast access to most common options.

• Project Explorer: here you can see/change the hardware parameters, program structure, data blocks, plugins and HMI Screens.

(11)

Tool Bar items:

2.2 Hardware Configuration

Here we can configure the Virtual PLC CPU parameters and the input/output analogic/digital devices that are connected in the Virtual PLC CPU.

(12)

Virtual CPU Start Mode:

• Stop: if selected the Virtual PLC CPU will start in Stop Mode when launched. • Run: if selected the Virtual PLC CPU will start in Run Mode when launched.

Watchdog:

• Enabled: if this option is marked, the Virtual PLC CPU will make a control each scan cycle controlling that is smallest that the Control Time programmed. If is higher, the Virtual PLC CPU will pass to stop mode and launch a Watch Dog error message. This option is useful when must be done a very accuracy process, in order to be sure that the Virtual PLC do not have time loss.

Communication with Virtual PLC CPU:

The communication between EasyPLC Editor and Virtual PLC CPU can be done in Local or Remote mode. EasyPLC Editor can connect with Virtual PLC in order to read the current status of the running program, in this way is possible to make task like debug, diagnosis or others.

• Local: if this option is selected, EasyPLC Editor and Virtual PLC CPU will be executing in the same computer. • Remote: if this option is selected, EasyPLC Editor and Virtual PLC CPU will be executing in different computers,

the computers must be connected to the same net.

• IP Address: the Ip Address of the computer that will be executing Virtual PLC CPU.

• Port: the listening port using to attend the Editor connection (remember to open this port in your Firewall). Set Parameters Button: use this button to accept a configuration, useful when there’s no project on the Editor and the objective is to connect with Virtual PLC CPU to upload a program.

Virtual PLC CPU Properties:

Here is showed the information about the Computer microprocessor performance. These values will change in function of the computer microprocessor. It’s highly recommended to use computer with more that one microprocessor in order to have the best performance.

PLC Scan Cycle Speed:

• The Fastest: if selected the Virtual PLC CPU will run the logic program at the maximum speed available by the system.

• Limit to: if selected the Virtual PLC CPU will run the program at the selected speed, this means for example that if 10ms is selected, the cycle time will be ten milliseconds, then each loop of the logic program will be executed every 10 ms. Useful when we must to use hardware devices with limited speed transfer rates.

Disable Safe Mode Program Execution: if selected the program will execute the logic program without internal errors check, could be faster but if an error appears the Virtual PLC CPU will crash.

Frequency Signals: the Virtual PLC CPU can generate an internal frequency signal (square wave) with a time base programmed by the user. The output signal is applied to the selected variable in Variables node. The maximum number of frequency signals are 25.

(13)

2.2.2 I/O Devices

In this node you can add all the Hardware devices connected in the computer where Virtual PLC CPU will be running. To use a particular hardware you must select the available driver, once selected, this driver will be added to the I/O Devices node, making click on the Driver Node you can configure it and test it (only in registered version).

Always a new Driver is added, is necessary to click it and configure it, in order to be able to use in your project.

There are some Drivers that offers some configurations options, others not. If the driver have this possibility, make click on the Configure Button, a new window will appear where is possible to parameterize it.

(14)

Clicking in the Test Button is possible to test directly the device if is connected to the computer (only in the registered version). Click the Exit from test Mode Button to exit from this mode.

A useful option is the possibility to disable any driver. If you uncheck the Driver Enabled mark, this driver will be not processed by Virtual PLC (useful for test porpoises or when the physical device is not present).

(15)

2.2.2.1 Add a new Driver

In order to add a new device to your Project, you can make click on the I/O Devices node and click on Add new Device contextual menu. Also is possible form the EasyPLC menu -> Hardware -> Add new Hardware. Then the Add New I/O Device screen will appear:

If you click on each Driver, a description about this driver will be refreshed on the description area.

Click Ok button to add this driver to your Project.

2.2.2.2 Remove a Driver

If you want to eliminate an existing driver, click it in the I/O Devices node, press right mouse button and select Remove

(16)

2.2.2.3 Available Drivers

By default the following drivers are provided with EasyPLC:

• Joystick: allows using a compatible Windows Joystick to read two axes (X and Y) like two analogic inputs and the buttons like digital inputs.

• Machines Simulator Drivers, there are two drivers inside this category:

o Machines Simulator Demo: This driver must be used to communicate with Machines Simulator DEMO software. In Demo version only are allowed to use 12 Digital Inputs and 12 Digital Outputs. Analogic I/O are not allowed

o Machines Simulator: This driver must be used to communicate with Machines Simulator software. • Nirtec Drivers: Driver for the Nirtec USB 15I16O card (see http://www.nirtec.com/services/USB_Interf.htm)

• Parallel Port Driver: this driver uses the PC parallel port to manage the digital I/O provided by this port. In total are: 5 inputs and 8 outputs.

• Phidgets: Driver for the Phidgets InterfaceKit cards.

• Serial Drivers: This driver provides 8 inputs and 8 outputs, sending/receiving only one byte in binary mode. • Simulation Drivers: driver for Simulation purposes. Use this driver for test your logic programs (available in Demo).

When this driver is active, a window appears where is possible to force the inputs (marking the checkboxes) and see the output status.

• TCP/IP Drivers:

o TCP/IP Client: use this driver to manage digital I/O form other Virtual PLC CPU connected via TCP/IP (or also any third parties programs). The Virtual PLCCPU program using this Driver must to be executed after the Virtual PLC program using the TCP/IP Server Driver.

o TCP/IP Server: use this driver to manage digital I/O form other Virtual PLC CPU connected via TCP/IP (or also any third parties programs). The Virtual PLC CPU program using this Driver must to be executed before the Virtual PLC program using the TCP/IP Client Driver.

o TCP/IP_HTML_Server: use this driver to manage digital I/O from any Web browser program connected via TCP/IP with the same pc where is executing Virtual PLC.

2.2.2.4 How to Develop an EasyPLC Driver

Please refer to the EasyPLC v.5 SDK Guide.

Available Drivers on request:

Siemens Drivers: communication driver between Simatic S7 - PLCSIM and Virtual PLC CPU. With this driver you will be able to communicate your Step 7 logic programs directly with Virtual PLC without any additional hardware.

Create your Step 7 programs and use Machines Simulator to test it, simple, fast and secure, no additional hardware are needed (expensive PLC's, I/O cards, connections interfaces,...) only your PC and the following software:

• Siemens Simatic Step 7 v.5.4 (SP3) • Siemens S7-PLCSIM v.5.4

• EasyPLC Software Suite

• Simatic S7-PLCSIM EasyPLC Driver

For more information please consult the www.nirtec.com site

(17)

2.3 Software Structure

2.3.1 Variables

The variables are a very important entity in EasyPLC programming. The variables are the elements used to make operations (comparisons, assignments, etc…). Using variables is clearer to read the programs, if we chose adequate names, we can understand better the logic program.

The variables can be linked with the internal PLC objects like digital/analogic inputs/outputs, counters, timers or data blocks.

Variables without linked PLC elements are managed totally by the programmer. The variable types could be:

• bool: holds one of two possible values, true or false

• int: holds 32-bit signed integers. The smallest possible value of an int variable is -2,147,483,648; the largest possible value is 2,147,483,647.

• long: holds 64-bit signed integers. The smallest possible value of a long variable is 9,223,372,036,854,775,808; the largest possible value is 9,223,372,036,854,775,807.

• float: holds a 32-bit signed floating-point value. The smallest possible value of a float type is approximately 1.5 times 10 to the 45th power; the largest possible value is approximately 3.4 times 10 to the 38th power.

• double: holds a 64-bit signed floating-point value. The smallest possible value of a double is approximately 5 times 10 to the 324th; the largest possible value is approximately 1.7 times 10 to the 308th.

• String: represents a string of Unicode characters. It allows easy manipulation and assignment of strings. Linked variables take automatically the data type of the linked PLC element, being impossible to change their type. It’s possible to add a description for each variable, then will be easiest to debug the logic programs.

(18)

Delving into the variables

Variables represent storage locations. Every variable has a type that determines the values to be stored in the variable. The value of a variable can be changed through assignment or through use of the ++ and - operators.

Variables are values that can change as much as needed during the execution of a program. One reason you need variables in a program is to hold the results of a calculation. Hence, variables are locations in memory in which values can be stored.

The variable names follows the C language criteria, this is: A variable can:

• Start with a "_".

• Contain both upper case and lower case Unicode letters. Case is significant. An variable cannot:

• Start with a numeral. • Start with a symbol,

To have a keyword name (check Keywords in Appendix). • Have more than 511 characters.

Clicking in the Address column of each variable, is possible to assign easily this variable with the available PLC objects like analogic/digital I/O, CPU frequency signals, data blocks, counters or timers.

Once the user makes click on the column button, the Select Address window will appear, from there, is possible making double click to select the item to link with the variable.

From Variables Tool Bar are available the following tools: • Delete Variable: use it to delete variables. • Copy Variable.

• Paste Variable.

• Import Variables: with this option is possible to import variables from external sources. The following options are available:

o Import from Machines Simulator: an ios file (exported from Machines Simulator) can be selected, then automatically are created the analogic/digital input/outputs used in Machines Simulator installation.

o Import from csv file: the csv file must follow this format: variable name, address, type, description. Fields must be separated by comma or point and comma. Here an example is showed:

Automatic;I.0.0;bool;variable for automatic mode Manual;I.0.1;bool;variable for manual mode Motor_ON;i.0.2;bool;motor is on

Motor_OFF;i.0.3;bool;motor is off switch_1;i.0.4;bool;part detection text;;string;user text

(19)

2.3.2 Program Modules

Programs are composed by sequences. Sequence is the minimum programming unit. The sequences can be programming in several languages like Ladder, Script, Logic Blocks or Grafcet.

In order to have a structured programming method, EasyPLC provides tools to sequence the logic programs.

2.3.2.1 Init

The sequences inside the Init Program node only will be executed once, when the program starts. Useful to program initialization routines.

2.3.2.2 Main

The sequences inside the Main Program node will be executed cyclically and in the order showed in the node tree. Using the jump tools will be possible to change the sequences order if the program requires it.

(20)

In order to insert a sequence in the Init or Main Program Module, click it and press right mouse button, click Add Sequence on contextual menu. Also from the EasyPLC menu -> Program -> Add new Init Sequence or Add new Main Sequence.

The Create New Sequence window will appear, there you can write the sequence Name (without spaces) and the sequence language. Pressing Accept button, the new sequence will be created.

To insert a new function click in the Functions Program node, press right mouse button, click Add Function on contextual menu. Or from the EasyPLC menu -> Program -> Add new Function.

The Create New Function window will appear, there you can write the function Name (without spaces), the sequence language, the returned data type and the parameters passed to this function with their data types. Pressing Accept button, the new function will be created.

(21)

2.3.2.4 Common Area

The common area is designed to declare all the program components that will be common (visible) for all the sequences available in the program.

Here is possible to declare global variables or user defined types, like structures or classes.

The common area is a sequence written in Script code. To call it, select the Program node, next click right mouse button on it, and select Common Area from the contextual menu.

Once the common area is declared, will be available like an icon in the Program tree.

A special function is available, the Exit function. When you create a function called Exit (must be without parameters and void returned value), Virtual PLC CPU will call this function when pass to Stop Mode.

This feature could be useful to call to finish routines (for hardware or software unloads tasks).

In order to software reusability, Functions can be exported or imported to use in other programs, you can refer to Appendix 4.2 to learn more about this feature and to view some functions examples usage with different languages.

(22)

2.3.3 Data Blocks

The Data Blocks are a collection of data items that can be selected by indices computed at run-time. The data blocks may be declared as the same type as variables (see page 15).

The Data Blocks typically are used to store values and make operations with them. Having a vector-type structure, it is possible to access elements by index.

To create a new Data Block, select the Data Blocks node, make right click with mouse and select Add Data Block from the contextual menu.

Once the Data Block is created must to be parameterized, type the Data Blocks name, type and length (the number of elements that contain this data block). Then press Create Data Block button to create it.

The Non Volatile attribute is used to store the Data Block value when the Virtual PLC pass to stop mode and when finish. The data blocks marked with this attribute will maintain the last value stored when Virtual PLC pass to Run Mode also if is closed and re launched.

(23)

2.3.4 Plugins

The Plugins are an extensibility tool that adds specific abilities to EasyPLC. These libraries can be created by the users allowing any kind of customization giving more power to the language, or creating special functions to communicate with third party devices or software’s.

Please refer to the EasyPLC v.5 SDK guide, in order to know more about this item. All the plugins libraries must to be copied in the EasyPLC Plugins folder.

To add a new Plugin, select the Plugin node, and make right click, next select Add Plugin from the contextual menu.

Then you must select a valid EasyPLC Plugin dll file, if the library is a valid EasyPLC Plugin library, a new node will be added to the Plugins node. Making click on the new plugin node, will show all the methods information, about their name, parameters, and returned value.

(24)

2.4 Languages

2.4.1 Ladder

The Ladder is a programming language that represents a program by a graphical diagram based on the circuit diagrams of relay-based logic hardware. It is primarily used to develop software for Programmable Logic Controllers used in industrial control applications. Then Ladder allows making programs in a graphic way like you where connecting circuits with relays, counters, timers, sequencers, etc... The basic elements of a Ladder program are the contacts and the coils. The programs written in Ladder are compound by segments. A segment it’s a contact/coil group. The contacts are the conditions that are evaluated to make an action, the coils are the actions.

(25)

The Ladder tool bar offers the followings tools:

• Add Contact: adds a new open contact in the selected cell position.

• Add negate Contact: adds a new closed contact in the selected cell position. • Add Comparator: adds a new comparator contact in the selected cell position. • Add Coil: adds a new coil in the selected cell position.

• Add Set Coil: adds a new Set coil in the selected cell position. • Add Reset Coil: adds a new Reset coil in the selected cell position.

• Add Trigger Upper Coil: adds a new Upper Trigger coil in the selected cell position. • Add Trigger Down Coil: adds a new Lower Trigger coil in the selected cell position. • Add Jump coil: adds a new Jump coil in the selected cell position.

• Serialize Coil: adds a new coil serialized with the current selected coil. • Add Counter Coil: adds a new Counter coil in the selected cell position. • Add Timer Coil: adds a new Timer coil in the selected cell position.

• Add Data Block Coil: adds a new Data Block coil in the selected cell position. • Add Function Call: adds a Function call in the selected cell position.

• Add Register Transfer: adds a new Register Transfer in the selected cell position. • Add Jump Label: adds a new Jump Label in the selected cell position.

• Add Comment: adds a new Comment in the selected cell position. • Add Header Text: adds a header Text coil in the selected row position. • Add Cable: adds a new wire connection in the selected cell position • Cable Down: makes a connection with the lower cell.

• Cable Up: makes a connection with the upper cell.

• Delete Connections: deletes the current connection in the selected cell.

• Add Space between Segments: adds space between segments in the current selected cell • Reduce Space between Segments: erases space between segments in the current selected cell. • Move segment to right: move the segment to the right adding a wire in the current selected cell. • Zoom Out: reduces the zoom.

• Zoom In: increases the zoom

• Standard view: set the segments size to the standard one. • Selection Tool: allow to select segments for copy/paste operation. • Copy: copy the current selection.

• Paste: paste the last selection.

Ladder Tool Bar

(26)

2.4.1.1 Contacts

Ladder has contacts that make or break circuits to control coils. Each coil or contact corresponds to the status of a single bit in the PLC memory. Unlike electromechanical relays, a ladder program can refer any number of times to the status of a single bit, equivalent to a relay with an indefinitely large number of contacts.

So-called "contacts" may refer to physical ("hard") inputs to the programmable controller from physical devices such as pushbuttons and limit switches via an integrated or external input module, or may represent the status of internal storage bits which may be generated elsewhere in the program (Variables).

The Contact shows two areas, the elements area and the Operation area, depending what type the variable assigned to the contact, is possible to type and see different information in the contact’s area. In the previous picture we see a segment with five contacts, there are:

• I.0.0: this means the digital input number 0.0 this is the input number 0 from the diver number 0. Due digital inputs are Boolean conditions no additions information is shown in the operation area.

• PushButton: this is a variable linked with the digital input 1 of driver number 0, all the linked variables will show in the operation area the linked element between brackets.

• num: is a variable of numeric value, in order to evaluate the contact, is necessary to type the condition that will allow the contact activation, this will be that the num variable will be grater that 20.

• cont: is a variable linked with the counter number 2, the contact activation condition will be greater than 12. • tim: variable linked with Timer number 1, like the Timer elements are Boolean conditions, this contact will be

activated when the timer 1 reaches the programmed time.

Contacts can be set as negated, then will be activated if the activation condition is false.

2.4.1.2 Coils

Each segment of ladder language has one coil at the far right. Also is possible to connect more that one coil in the same segment (serialize coils).

The "coil" (output of a segment) may represent a physical output which operates some device connected to the PLC, may represent an operation with variables or a call to other element in the program.

The coils could be activated in several ways, in EasyPLC exists the following coils type:

• Level Coils: these coils are activated by level, this means, the coil status is always true while the segment is true. If the segment is false, the coils status is always false.

• Set Coils: used for Boolean variables, if the segment is true, the coil will set to true the variable assigned, if is false nothing is done.

• Reset Coils: used for Boolean variables, if the segment is true, the coil will set to false the variable assigned, if is false nothing is done.

• Trigger Up Coil: these coils are activated by upper flank, this means, the coil status is true only the first time the segment pass from false to true.

• Trigger Down Coil: these coils are activated by lower flank, this means, the coil status is true only the first time the segment pass from true to false.

• Jump Coil: used to jump to a label in any sequence.

• Serialize Coil: sets a coil serialized with the selected one, then when the segment condition will be true, this new coil also will be activated.

(27)

The Coils shows two areas, the elements area and the Operation area, depending what type the variable assigned to the coil, is possible to type and see different information in the coil’s areas. In the left picture a segment with four coils is shown, there are:

• O.0.1: this means the digital output number 0.1 this is the output number 1 from the diver number 0. Due digital outputs are Boolean conditions no additions information is shown in the operation area. • Delay: variable linked with Timer number 1, when this coil will be

activated, the timer number 1 will be initialized with value 100 milliseconds.

• PartCounter: is a variable linked with the counter number 2, when the coil is active, will increase in one unit the value of counter 2. • Value: numeric variable, when coil will be active, will add 2 to the

current variable value.

Ladder assistant tools for writing operations with contacts/coils

When a contact or coil is created or edited, is possible to type directly the operation or use the assistant wizard, for use it, click on the help button on the wizard tool.

Making double click on the contacts/coils Description and Operation area is possible to edit their values in order to modify it.

The assistant help contains tour tabs, the first tab (Help) explain the possible operations for the current contact/coil and shows some examples, the second tab (Variables) shows the available variables on our project, making double click on the selected variable, is added to the text operation without writing, the third tab (Functions) shows the available contact/coils functions to write in the operations area, and the last one (Plugins) shows the available plugins defined in our project.

(28)

Using the contacts, coils and wirings tools is possible to create the desired segments. The wiring tools are:

• Cable Left: allows drawing a horizontal wire of one grid unit.

• Cable Down: draws a wire from the current position to one lower grid position. • Cable Up: draws a wire from the current position to one upper grid position. • Cable Eraser: deletes any connection in the current cell.

The ladder draw area is designed like a grid, divided in cells. In each cell position an element can be draw (contact, coil or cable). Writing segments must be done in order form left to right, is not allowed to insert an element in an empty location.

2.4.1.3 Segments

A segment is a group of Boolean conditions that ends in one o more coils.

The writing of segments should always be from left to right and from up to down. Imaginarily, the current continues the sense from left to right

The available operations for contacts and coils are different, due contacts operations always are of comparison type (must return a Boolean value), and coils operations are assignments.

(29)

2.4.1.4 Read/Write analogic/digital Inputs/Outputs

There are several possibilities to carry out the task:

• Calling directly the analogic/digital inputs/outputs. • Using linked variables.

Let’s see some examples:

For a fast way, in the ladder programming area, make click on the first cell, then the selection dotted square will be shown:

(30)

Now we have created the first contact that will be active when the input number 0 from the Driver 0 (Simulated) will be active.

Now we’re using the variables linked method. Go to the Variables node in the Project Explorer, and in the last empty row, column Variable Name, type the name of your variable (NewInput in the example), now click on the Address button, the Select Address window appear to select the element. Select the desired one (I.1.0 in the example).

Once selected, the Address Button will show the linked element with the created variable.

Now, go to the ladder programming area, and select the cell following to the last created contact, press Insert Key or make click in the ladder tool bar contact button. When the wizard window appears, select the new created variable, and make double click.

(31)

Then the Input number 0 from the second driver will be assigned to the new contact.

Now you know the two modes to assign digital inputs to the contacts.

This is the same for the digital outputs and analogic inputs and outputs, applying also in the coils. For the outputs is used the syntax: O.X.Y (where X is the driver number and Y the output number).

For the analogic inputs is used the syntax: AI.X.Y (where X is the driver number and Y the output number). For the analogic outputs is used the syntax: AO.X.Y (where X is the driver number and Y the output number).

Following the example, now select the cell at the right of the last contact, and press Shift key + B key or make click in the ladder tool bar coil button, then write O.0.2 and press Enter Key. Now you have created a new segment, where the digital output number 2 from the driver number 0, will be activated if are actives digital input number 0 from driver 0 and digital input number 0 from driver number 1, if some of this inputs are deactivated, the output also.

(32)

In Ladder language there are several ways to declare and use variables. The possibilities are:

1. Declare first the variable in the Variables Table and then use it in the wizard window. (as seen on the previous item) 2. Using the wizard Ladder window to create a new one.

3. Typing directly the new variable name in the contacts/coils text area. Example of mode 2:

Create a new Contact, and press Create New Variable button on the right side of the wizard window.

In the New Variable window type your new variable name

Then the Create New Variable window appears, there you can customize your variable like link it with any available element, or if is not a linked variable you can define the variable type. Also is possible to insert a description about the variable.

Once the OK button is pressed, the new variable is added to the Variables project table, and is visible in the ladder wizard window.

You can make double click in order to assign it to the selected contact.

2.4.1.5 Using variables

(33)

Example of mode 3:

In the text area of a Contact or Coil, write your variable name, if this variable do not exists, the New Variable Window appears in order to create it, once accepted, this variable will be added to your project, being available at the ladder wizard window, making double click will be assigned to the selected contact or coil.

Fast access to created variables

When typing a variable name in a contact/coil, a combo box appears showing the matches starting with the same words typed, you can click in the combo in order to assign to the contact/coil.

Operation with Variables

All the operation with variables must be done following the C language Syntax. In the following example there are three contacts that carry out comparison operation with variables, if all comparisons are true (segment true), three assignments of variables take place in the coils. Look how variable T1 (int type) is compared with 1 value ( == ), Value (float type) is checked grater that 45 and DelayTime (long type) must be different from variable WaitTime (long type). If the segment is true,

variable IntVar (int type) is assigned with value, variable T2 (int type) is incremented in one unit (++) and variable Message (string type) is assigned with the string “HELLO”.

(34)

2.4.1.6 Comparator

The comparator is a contact element designed to make comparisons easily between variables or data blocks elements. To create a comparator make click in the ladder tool bar comparator button.

To make comparisons, click in the combo box to select the comparison operation, this could be equal (==), different (!=), greater than (>), minor than (<), greater or equal (>=), minor or equal (<=).

Click in the IN1 text filed, the wizard window appears, making double click over the desired variable will assign to the fist comparison operator, the same operation for the second operator (IN2).

In the example two variables are compared is are equal will activate the coil, assigning the value 125 to the variable Value.

IMPORTANT: variables compared MUST BE of the SAME TYPE.

Also is possible to write a constant in the second operator (IN2)

To make comparisons with Data Blocks, is possible to use the variables linked with each element, or if is necessary, is possible to use the function ReadDB(id, elem), that will return the element number ‘elem’ from the data block number ‘id’. Is required that the first parameter will be a numeric constant, but the second parameter can be a variable.

(35)

2.4.1.7 Counters

EasyPLC offers a special variable (long type) used to make counter operations, the counters can be used by several ways in the contacts/coils.

Counter Coils

To add a new Counter coil press on the Ladder Tool bar Counter Coil

You can type in the Id text area the counter number, and in the Increment text area the quantity to the counter must to be incremented when the coil is active. The counter will increase their value only in the upper trigger of the segment activation.

If the Counter has linked a variable, the variable name will be shown.

Counter also can be written using the standard coils, using the syntax CNT.X, where X is the counter number. Clicking in the coils operation area is possible to customize the counter operation.

Be careful with the coil type used, in the previous example, a standard coil has been using, this coils works in level mode, this means that while the segment condition is true, the coil will be executing the counter operation. The most common counter coil usage is to use a triggered coil, in the next example, when the output 0.1 is active the counter number 1 will increment their value in 5 units, but only once, the counter will not be updated since the output 0.1 will be deactivated and activated again.

Counter Contacts

To add a new Counter contact press on the Ladder tool bar coil, then type the variable name linked with the counter or use the syntax CNT.X, where X is the counter number. After, you can type the counter comparison operation, the syntax must be done in C programming syntax.

(36)

2.4.1.8 Timers

EasyPLC offers a tool to control time, this is the Timer. By default the timers works for retard to the connection. According to the following segments the timer 1 level signal would be:

Timer Coils

To add a new Timer coil press on the Ladder Tool bar Timer Coil

You can type in the Id text area the timer number, and in the Time text area the timer countdown time (could be a numeric value or a variable of Long type). In the upper trigger of the segment activation the timer will start to count, when the timer countdown arrives to zero the timer will have a true value.

Timers also can be written using the standard coils, using the syntax TMR.X, where X is the timer number. Clicking in the coils operation area is possible to customize the timer countdown time.

Be careful with the coil type used, in this example, a standard coil has been using, this coils works in level mode, this means that while the segment condition is true, the coil will be executing the timer loading value operation. The most common timer coil usage is to use a triggered coil.

(37)

Timer Contacts

To add a new Timer contact press on the Ladder tool bar coil, then type the variable name linked with the timer or use the syntax TMR.X, where X is the timer number. The contact associated to the timer will be true when the timer previously has been activated and their countdown will arrive to zero.

2.4.1.9 Data Blocks

With Ladder language is possible make operations with Data Blocks.

Data Blocks Coils

To add a new Data Block coil press on the Ladder Tool bar Data Block Coil

If you make double click on the Data Block, the Data Blocks Parameters will open in order to parameterize the coil. First select the Data Block you want to work, then select the element number. Finally select the operation you want to assign when the segment condition will be true, for instance assignations (with numeric constants or variables) or operations allowed for the type of data that make up the Data Block.

If Run on Trigger is marked, the coil operation will be done once when the segment value pass form false to true, by default the coil operation will be done by level, this means the coil Data Block operation will be done while the segment condition will be true.

(38)

Data Blocks Contacts

To add a Data Block contact press on the Ladder tool bar coil, then type the variable name linked with the Data Block element or use the syntax D.X.Y, where X is the Data Block number and Y the element number of the Data Block. The Data Blocks comparison operations must be written in C language syntax.

2.4.1.10 Function Call

Other special coil is the Function Call. To add a Function Call coil press on the Ladder Tool bar Function Call coil.

This coil allows making a call to a previously defined function, configuring the passing parameters and the returned value (if it has it).

Once the coil is created, is necessary to select the function on the combo box control.

Next the Function Parameters window will open in order to parameterize the parameters passed to the function and the returned value. Clicking in the Variable button for each parameter is possible to assign it to the selected variable from the list making double click on the variable name. Also is possible to assign a constant value clicking in the Set Constant button. If Run on Trigger is marked, the Function will be called once when the segment value pass form false to true, by default the calling will be done by level, this means the calling will be done each PLC scan time cycle while the segment condition will be true.

(39)

When confirmed, the Function Call coil will show the information about the called function name, the passed parameters and the returned value.

If you make right click on the Function name node, is possible to change the function name, change the parameters or to delete the function.

2.4.1.11 Register Transfer

The Register Transfer coil allows making common PLC register transfer operations. To add a Register Transfer coil press on the Ladder Tool bar Register Transfer coil.

(40)

Making double click on the comment is possible to customize it, changing the text, Background colour, text colour, text font and message border.

Text comments can be moved in the Ladder programming area clicking on the text and moving with mouse.

2.4.1.13 Shortcuts Keys

The following short-cuts keys are available for ladder language: • Insert Key: Insert Contact.

• Shift + Insert Key: Insert negate Contact. • Shift + B : Insert Coil.

• Shift + C: Insert horizontal Cable. • Shift + U: Insert Upper Vertical Cable. • Shift + D: Insert Lower Vertical Cable. • Shift + S: Activates Selection tool. • Control + C: copy current selection.

• Control + V: pastes current copied selection.

2.4.1.14 Special Coil (Return)

A special coil is available in Ladder language, the Return Coil. This coil allows breaking the current flow of the sequence, and jumping to the following sequence without finish the current where the return command is executed. Example:

In this example is input number 0.0 is active, the control flow of the program pass to the following sequence

(Main_Sequence_2) and the second segment I.0.1 O.0.1 is not executed.

(41)

2.4.2 Script Language

EasyPLC sequences can be programmed using a Script language.

The EasyPLC Script language uses the C# syntax. You can find more information about EasyPLC C# language in the Appendix.

Script Tool Bar

The Script tool bar offers the followings tools: • Cut text: cuts the selected text. • Copy text: copies the selected text.

• Paste text: pastes the previously selected text.

• Comment: comments the selected text area.(this commented text will be not compiled). • Un Comment: erases the comments of the selected commented text.

• Undo. • Redo.

• Check Syntax: checks if the current sequence syntax is ok. • Add Bookmark: add a bookmark in the selected position. • Previous Bookmark: moves to previous bookmark position. • Next Bookmark: moves to next bookmark position.

• Delete all Bookmarks: deletes all existing bookmarks. • Find text: finds a text on the sequence.

• Find & Replace: replaces all the matches of the selected text on the sequence.

• Code Wizard: allow to insert code snippets on the current sequence, also is possible to call to the Script Wizard.

Pressing F2 Key will show the script Wizard on the current Script sequence.

In script language is possible to use the variables defined in the project to make any kind of operation. To do it Press F2 Key and from the Script Wizard window, select the variable you want to use making double click on the variable name.

(42)

EasyPLC Script Internal Methods

EasyPLC offers a series of internal methods in order to manage the PLC logic program. These methods are:

Function Name: ReadInput(device, number) Returned Value: bool

Parameters: int device, int number

Function Description: returns the state of the digital input number 'number' from device number 'device' Function Name: ReadOutput(device, number)

Returned Value: bool

Parameters: int device, int number

Function Description: returns the state of the digital output number 'number' from device number 'device' Function Name: ReadAInput(device, number)

Returned Value: float

Parameters: int device, int number

Function Description: returns the state of the analogic input number 'number' from device number 'device' Function Name: ReadAOutput(device, number)

Returned Value: float

Parameters: int device, int number

Function Description: returns the state of the analogic output number 'number' from device number 'device' Function Name: WriteOutput(device, number, value)

Returned Value: none

Parameters: int device, int number, bool value

Function Description: writes the value 'value of the digital output number 'number' from device number 'device' Function Name: WriteAOutput(device, number, value)

Returned Value: none

Parameters: int device, int number, float value

Function Description: writes the value 'value' of the analogic output number 'number' from device number 'device' Function Name: ReadDB(number, elem)

Returned Value: object

Parameters: int number, int elem

Function Description: Returns the value of the data block number 'number' element number 'elem' Function Name: WriteDB(number, elem, value)

Returned Value: none

Parameters: int number, int elem, object value

(43)

Function Name: SetTimer(timerVariableName, v) Returned Value: none

Parameters: string timerVariableName, long v

Function Description: sets the timer timerVariableName with value v Function Name: GetTimer(timerVariableName)

Returned Value: bool

Parameters: string timerVariableName

Function Description: returns if the timer timerVariableName has been activated Function Name: ResetTimer(timerVariableName)

Returned Value: none

Parameters: string timerVariable

Function Description: resets the timer timerVariableName Function Name: Key(key)

Returned Value: bool Parameters: int key

Function Description: returns the state of the passed key (ASCII value) Function Name: Key('key')

Returned Value: bool

Parameters: char key

Function Description: returns the state of the passed key (char value) Function Name: PlaySound(path)

Returned Value: none Parameters: string path

Function Description: plays the wav file with path 'path' Function Name: KeyPad("variableName")

Returned Value: none

Parameters: string variableName Function Description:

Assigns a numeric value (double type) typed by the user to the variableName variable (declared of double type)

Function Name: KeyPadInt("variableName") Returned Value: none

Parameters: string variableName Function Description:

Assigns a numeric value (int type) typed by the user to the variableName variable (declared of int type)

Function Name: KeyPadLng("variableName") Returned Value: none

(44)

Function Name: Keyboard(variableName) Returned Value: none

Parameters: string variableName

Function Description: Assigns a string value typed by the user to variableName variable Function Name: Plugin(pluginName, methodName, parameters)

Returned Value: object

Parameters: string pluginName, string methodName, object[] parameters Function Description:

executes the method 'methodName' of the plugin 'pluginName' passing an array of objects 'parameters'

Function Name: StopPLC() Returned Value: none

Parameters: none

Function Description: makes a PLC Stop Function Name: DriverStatus(number) Returned Value: bool

Parameters: int number

Function Description: returns the driver status number 'number' Function Name: StartHMI()

Returned Value: None

Parameters: None

Function Description: Launchs the HMI System application Function Name: CloseApp(name)

Returned Value: None Parameters: String name

Function Description: Closes the ‘name’ application

Plugins usage in Script Language

The declared Plugins in the Project can be called from Script language in the following way: PluginName.PluginMethod

(45)

2.4.3 Function Blocks Language

Function Blocks language offers other graphic programming tool.

Using this graphic language programs can be written in a very easily way, selecting the items we want to use and connecting between them like components of an electrical circuit.

This language should be used to program sequences that require no complications, due is very easy and fast to use but do not offer the power functions like Ladder, Script o Grafcet languages.

In this language are the following tools:

• Condition Block: this block represents a condition, if is true their output will be true and can activate other blocks. • Action Block: this block represents an action that will be done when other block actives it.

• Set/Reset Action Block: like Action block but with possibility to make set/reset operations.

• AND Block: makes the logic AND operation of the state of their two inputs, the result is present in their output. • OR Block: makes the logic OR operation of the state of their two inputs, the result is present in their output. • NOT Block: makes the logic NOT operation of the state of their input, the result is present in their output. • Label: inserts a text label for documentation porpoises.

• Zoom in • Zoom out • Normal Zoom.

• Delete Selected Block/Wire.

Creating a Function Blocks sequence.

Next an example about how to create a Function Blocks sequence is showed. Create a new Main Function Block sequence (view page 18).

First make click in the tool bar Condition Block, then the mouse cursor will change to a cross shape, then make click in the F.B. programming area where you want to place the block. One placed, the F.B. wizard window will show in order to choose the variable associated with this block, make double click in the variable name you want to use.

(46)

Now, create other condition block and select a numeric type variable (DelayTime in the example is float type), then automatically the condition operation is filled.

As you can see by default the condition is that DelayTime will be equal to zero, if you want to change the condition, click in the block and make mouse right click, a contextual menu will appear, then click Set Operation in order to change the condition operation.

Next, add a AND Block, selecting it form the tool bar.

The following operations will be to wire the two condition Blocks with the AND Block.

To do it click on the first created Block, and make mouse right click, select Connect Out form the contextual menu, then the mouse cursor will change indicating that we are in edition connection mode.

If the connection to the element on which the cursor is located is not possible, the cursor will have an icon shaped like a prohibition, if the connection is allowed, the icon will have a hand. If you click on the F.B empty area the block will exit from the connection edition mode and will not be connected.

(47)

Following the example, click on the AND Block, then the NewInput condition block will be connected with one input of the AND Block.

Repeat the same process for DelayTime condition Block.

Now we are going to add an Action Block, to do it make click in the tool bar action block and place it in the programming area.

(48)

Then make mouse right click and select from the contextual menu, Connect In, then click the AND Block.

We have written your first Function Blocks sequence!.

This program will work in the following way: if the digital input associated to the variable name NewInput is true, and the variable DelayTime is greater than ten, the digital input associated with the variable MotorOn will be activated, else will be deactivated.

Clicking in the Assign Variable contextual menu Blocks is possible to change the associated variable. Clicking in the Set Operation is possible to change the condition operation (for Condition Blocks) or the action operation (for Action Blocks). For Boolean variables there’s no possibility to change the operation because for condition blocks always will be checked the true condition and for Action Blocks the action to make will be to assign true or false state, in function if is activated or not.

Pay attention at the Activate by trigger / Activate by Level contextual menu items of Action Blocks.

If Level mode is selected, the Action Block will be executing the action each scan loop of the PLC, while their input is true. If Trigger mode is selected, the Action Block executes the action once (the first time their input is true).

Probably for the next example, you wish the auto increment of the variable Value, will be done once, then you must to select Trigger mode for the Action Block.

(49)

The Set/Reset Action Blocks are more flexible because allow to set/reset boolean variables and take out the result in their output.

In the following example, if variable NewInput is true, MotorOn variable will be set to true, also variable Data5 will be matched to three. If variable T2 is equal to zero, MotorOn variable will be set to false.

Condition and Action Blocks allows to use internal PLC functions and Plugins, in order to select it, click on the wizard window help button, here you can see help syntax examples, access to variables, functions and plugins. Make double click on the desired name to be automatically added.

(50)

In order to delete connections between blocks make click in the wire you want to delete, then will be marked in yellow color. Now press Delete Block/Connection tool bar button.

(51)

2.4.4 Grafcet

The GRAFCET (Graph of Control of Steps of Transitions) it is a normalized functional diagram that allows to make a model of the process to automate, contemplating inputs, actions to carry out, and the intermediate processes that cause these actions. It is not a language, is a design type to elaborate the pattern thinking of the direct execution of the automatism. The Grafcet Level is compound of Steps and Transitions, the steps and transitions can be programmed in Ladder, Script or Function Blocks languages.

The Grafcet Levels are compound by the following elements:

• Initial Step: is activated when the level starts by first time, at least one initial step must be present. • Step: is a subprogram that is executed continuously while their associated transition is false. • Transition: is the condition that must be true to allow the pass to the next connected step.

• Structural Parallelism: allows to execute simultaneously all the connected steps to their output. For the Parallelism actives their outputs its necessary that all theirs inputs conditions must be true, this is, all the process that the Parallelism has been launched, must been ended to allow their finalization.

• In a Grafcet level can exist all diagrams you need. Rules that a Grafcet Level must perform:

• At least an initial step should exist, (can be more than one).

• In a step output (normal or initial) a transition should always be connected. • It is not possible to connect two transitions together or two stages together. Available tools in Grafcet programming:

• Add Initial Step: adds an initial step. • Add Step: adds a new step.

• Add Transition: adds a new transition.

• Add Parallelism: add a new structural parallelism. • Add Label: add a label for documentation porpoises. • Zoom in.

• Zoom out. • Normal Zoom • Hide/view grid points. • Delete selected item.

(52)

3. Click on the Grafcet tool bar Add Transition button, and place the transition down to the initial Step.

4. Click on the Grafcet tool bar Add Step button, and place the new Step down to the transition. Write 1 in the step number window.

5. Add a new transition and place it down to the last step.

6. Now we are going to connect the steps and the transitions. Click in the Initial Step in order to select it. Then make right click with mouse and click in the Connect Output form contextual menu. The mouse icon will change their shape, showing a prohibition image if the cursor is placed in a item that can not be connected, if the connection is possible, the icon image will change to a hand.

(53)

7. Click over the first transition, then a connection between the initial step and the transition will be done.

8. Click in the first transition, then a make mouse right click, select Connect Output from contextual menu and click over the Step number 1. Then a new connection between transition and Step 1 is done.

9. Click in the last transition, then a make mouse right click, select Connect Input from contextual menu and click over the Step number 1. A new connection between transition and Step 1 is done.

10. Now the last connection, Click in the last transition, then a make mouse right click, select Connect Output from contextual menu and click over the initial Step number 0. A connection between last transition and initial Step 0 is done. And our Grafcet diagram is totally connected.

(54)

11. Now is the time to write some code, click on the initial step 0, mouse right click and select from contextual menu Sequence Code -> Ladder.

12. Type Step_0 in the Step Name window.

13. A new Ladder sequence is created, write a segment like the example showed.

14. Click on the Grafcet Sequence in Main node Project. Next click in the first transition, once selected, mouse right click and select Sequence Code -> Ladder.

(55)

15. Write Transition_1 like in the Transition Name window.

16. As you can see automatically is created a coil labelled with Transition word. Write in this segment the conditions to enable the transition, allowing passing the control to the transition connected step.

17. Select Grafcet sequence, and click on the Step number 1, right click with mouse to show their contextual menu, and select Sequence Code -> Script. Write Step_2 in the Step Name window.

(56)

18. Now write the code in Script language for Step 2. In this example is assigned the value of the digital input number 2 from driver number 0, to digital output number 1 from driver number 0.

19. Click on the Grafcet sequence node, select last transition and from contextual menu click on Sequence Code -> Script.

20. Click on the Grafcet sequence node, select last transition and from contextual menu click on Sequence Code -> Script. Write Transition_3 in the Transition Name window. See how automatically a snippet code is shown, you must fill in the if() sentence the conditions to activate this transition, in Script code the Transition keyword is used to activate the transition.

(57)

21. Write the code in the example, here if digital input number 3 from driver 0 is active, the transition will be activated.

Now our Grafcet sequence is complete. See how in the Grafcet node from Project tree, are showed all the sequences that compounds the Grafcet sequence. You can access each sequence making double click in the Grafcet item or directly from each item in the Grafcet node.

Be careful with the Steps and Transitions names. This follows the same rules that Variables names declarations, is not allowed spaces, or not valid characters.

How this program works

The first time the program is running only is processed Step_0 and Transition_1. If input 0.0 is on, output 0.0 will be on, if input 0.0 is off, output 0.0 will be off.

(58)

Transitions also can be programmed in Function Blocks language. When a Transition is created in this language a new action block is created labelled with transition keyword. When this block is activated, the transition will be true.

(59)

2.5 HMI

In the HMI Project node are programmed the HMI screens of the project.

With the HMI System application it is possible to create a visual interface between the user and Virtual PLC, for example you can show messages, images, values of the variables or data blocks, introduce values and much more.

EasyPLC offers a tool to create easily screens for the HMI System program, this tool is integrated in the programming environment and allows to create the screens dragging the desired controls from the Control Tools window to the Screen creation area, after is possible to customize the controls behaviour, selecting the available options from the Controls Property grid.

If you need more advanced behaviour you can write C# script code in order to customize totally the HMI Screen, controlling the controls events, timers and forms.

(60)

HMI Tool Bar

• Copy Button: used to copy the current selected control • Paste Button: pastes the previously copied control.

• Control Properties: changes the current selected control properties, is possible to change the control order in the form, and program the control events.

• Delete control: deletes the current selected control

• Test HMI Page: This will launch the current screen in test mode in order to see the results. Controls Tools:

• Offers two tabs, one with standard windows controls and other with specialised graphical controls to add in the HMI screen. To add a control click on it in the control tool tab and then click in the Screen creation area in order to place it.

Screen Creation Area:

• Here you can place and move the added controls, also is possible to change the form properties clicking on it. Property Grid:

• Used for change the selected control properties. Script Programming Window:

• Here is possible to write the C# script code for the screen behaviour customization.

Example

Now an example is showing about how to create a simple screen.

1. Create a new project, then go to Variables node and create two new variables like the example.

(61)

3. Right click on the HMI Project node, select New HMI Page.

4. Click on the new HMI Page node created, then the screen will be showed.

(62)

6. Click on the Button rectangle in order to resize it.

7. In the property grid, change the Text property, and type Automatic On, then the button text will change for the new one.

(63)

9. Now change the Linked Variable property, and select form the variables list Automatic.

10. Click on the Label control from Controls Tools window, and place it in the screen area.

11. Click on the Label control from Controls Tools window, and place it in the screen area. Change the Text property for Value:

12. Add a new Label control and change the Text property for 0 value, change ForeColor and Font properties like in the example. Then change Linked Variable for Num.

(64)

13. Select the button control, and press Tool bar copy button.

14. Press Tool bar paste button. Click on the new button and place it in the new location.

Now we have finished our HMI Screen.

Now the program is showed in run mode, if the HMI Automatic On button is pressed, will activate the digital output 0.0, if the digital input 0.0 is activated the Num variable will be incremented in one unit, this value will be refreshed in the HMI label control linked with this variable.

(65)

The HMI System is composed by all the created screens in the HMI node project. When the HMI System application will be started, the screen with the StartUpPage property set to true will be launched. The screens also can be called with C# Script code, using the HMI.ShowHMI(screenName) method, for example using the click controls event.

(66)

Important tools are the external HMI Controls. These controls have a special behavior. Can be added to EasyPLC copying the necessary dll files inside the EasyPLC\ and HMILib\ folders.

These controls can be made by the users, allowing a total customization of the HMI system.

References

Related documents

A Programmable Logic Controller (PLC) will be used as the hardware of the controller where it will be connected to a LCD display to monitor the operation of the

(Foreground File Transfer is only applicable to Host File Transfer since 'Editor File Transfer does not allow you, to' transfer files in,the foreground.). Both Background,

This field allows you to select which IDE hard disk drive to use in the boot sequence. Pressing [Enter] will show the product IDs of all connected IDE hard

This field lists the total number of packets received by the station since the test began or since all values on the Run Station screen were reset by pressing

When connected to a USB 2.0 port, however, the performance (data transfer rate) of the Verbatim Hard Drive will be much lower than when the drive is connected to a USB 3.0 port..

By Pressing the “ PROFINET XML ” button from the main window for SW67612 (Fig. 2) it is possible to generate the xml file to be imported into the master PROFINET. Figure 4:

Once Control Switcher is connected to your amp and MIDI controller, you can access individual switch functions by pressing the front panel buttons. The corresponding LED will show

(This operation is generally known as Direct Memory Access [DMA] using cycle stealing.) The maximum time for the CPU to respond to a bus request is the length of a machine cycle