SoMachine Basic User Interface Basics
SoMachine Basic User Interface Basics
EIO0000001354 12/2017
SoMachine Basic
Operating Guide
12/2017
EIO0000001354.10
www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or technical
characteristics of the performance of the products contained herein. This documentation is not
intended as a substitute for and is not to be used for determining suitability or reliability of these
products for specific user applications. It is the duty of any such user or integrator to perform the
appropriate and complete risk analysis, evaluation and testing of the products with respect to the
relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
have any suggestions for improvements or amendments or have found errors in this publication,
please notify us.
You agree not to reproduce, other than for your own personal, noncommercial use, all or part of
this document on any medium whatsoever without permission of Schneider Electric, given in
writing. You also agree not to establish any hypertext links to this document or its content.
Schneider Electric does not grant any right or license for the personal and noncommercial use of
the document or its content, except for a non-exclusive license to consult it on an "as is" basis, at
your own risk. All other rights are reserved.
All pertinent state, regional, and local safety regulations must be observed when installing and
using this product. For reasons of safety and to help ensure compliance with documented system
data, only the manufacturer should perform repairs to components.
When devices are used for applications with technical safety requirements, the relevant
instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware products may
result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2017 Schneider Electric. All Rights Reserved.
2 EIO0000001354 12/2017
Table of Contents
Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Part I Getting Started with SoMachine Basic . . . . . . . . . . . 19
Chapter 1 Introduction to SoMachine Basic . . . . . . . . . . . . . . . . . . 21
1.1 System Requirements and Supported Devices . . . . . . . . . . . . . . . . . . 22
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Supported Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Supported Programming Languages. . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.2 SoMachine Basic User Interface Basics . . . . . . . . . . . . . . . . . . . . . . . 27
Creating Projects With SoMachine Basic . . . . . . . . . . . . . . . . . . . . . . 28
Developing Programs With SoMachine Basic . . . . . . . . . . . . . . . . . . . 29
Navigating Within SoMachine Basic . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 2 Starting with SoMachine Basic . . . . . . . . . . . . . . . . . . . . 33
2.1 The Start Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Introduction to the Start Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Registering the SoMachine Basic Software . . . . . . . . . . . . . . . . . . . . 36
Projects Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Connect Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Directly Downloading an Application . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Project Templates Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Help Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Part II Developing SoMachine Basic Applications. . . . . . . . 49
Chapter 3 The SoMachine Basic Window . . . . . . . . . . . . . . . . . . . . 51
3.1 Overview of the SoMachine Basic Window . . . . . . . . . . . . . . . . . . . . . 52
Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Status Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
System Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Print Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Chapter 4 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.1 Overview of the Properties Window . . . . . . . . . . . . . . . . . . . . . . . . . . 62
The Properties Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Project Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
EIO0000001354 12/2017 3
Chapter 5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.1 Overview of the Configuration Window . . . . . . . . . . . . . . . . . . . . . . . . 68
Overview of the Configuration Window . . . . . . . . . . . . . . . . . . . . . . . . 69
Building a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Chapter 6 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.1 Overview of the Programming Workspace. . . . . . . . . . . . . . . . . . . . . . 72
Overview of the Programming Workspace. . . . . . . . . . . . . . . . . . . . . . 72
6.2 Special Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Symbolic Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Memory Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Ladder/List Reversibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6.3 Configuring Program Behavior and Tasks . . . . . . . . . . . . . . . . . . . . . . 84
Application Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Tasks and Scan Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
6.4 Managing POUs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
POUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Managing POUs with Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Managing Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Managing Grafcet (SFC) POUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Free POUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.5 User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Creating a User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Defining a User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Managing User-Defined Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.6 User-Defined Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Creating a User-Defined Function Block . . . . . . . . . . . . . . . . . . . . . . . 115
Defining a User-Defined Function Block . . . . . . . . . . . . . . . . . . . . . . . 116
Managing User-Defined Function Blocks. . . . . . . . . . . . . . . . . . . . . . . 119
6.7 Master Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Master Task Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Configuring Master Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
6.8 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Configuring Strings in Constant words. . . . . . . . . . . . . . . . . . . . . . . . . 126
Assigning Strings in Memory Words . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Managing Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4 EIO0000001354 12/2017
6.9 Periodic Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Creating Periodic Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Configuring Periodic Task Scan Duration . . . . . . . . . . . . . . . . . . . . . . 134
6.10 Event Task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Overview of Event Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Event Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Event Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Viewing Event Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6.11 Using Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Animation Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Memory Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
System Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
I/O Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Network Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Software Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
PTO Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Drive Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Communication Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Search and Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Cross Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Symbol List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Memory Consumption View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.12 Ladder Language Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Introduction to Ladder Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Programming Principles for Ladder Diagrams. . . . . . . . . . . . . . . . . . . 175
Color Coding of Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Ladder Diagram Graphic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Comparison Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Operation Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Adding Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Programming Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
6.13 Instruction List Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Overview of Instruction List Programs . . . . . . . . . . . . . . . . . . . . . . . . . 196
Operation of List Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
List Language Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Using Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
EIO0000001354 12/2017 5
6.14 Grafcet (List) Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Description of Grafcet (List) Programming. . . . . . . . . . . . . . . . . . . . . . 208
Grafcet (List) Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
How to Use Grafcet (List) Instructions in a SoMachine Basic Program 213
6.15 Grafcet (SFC) Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Introduction to Grafcet (SFC) Programming . . . . . . . . . . . . . . . . . . . . 216
Using the Grafcet (SFC) Graphical Editor . . . . . . . . . . . . . . . . . . . . . . 219
Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Programming Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
6.16 Debugging in Online Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Trace Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Modifying Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Forcing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Online Mode Modifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Chapter 7 Commissioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
7.1 Overview of the Commissioning Window. . . . . . . . . . . . . . . . . . . . . . . 244
Overview of the Commissioning Window. . . . . . . . . . . . . . . . . . . . . . . 244
7.2 Connect to a Logic Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Connecting to a Logic Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Downloading and Uploading Applications . . . . . . . . . . . . . . . . . . . . . . 252
7.3 Controller Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Controller Firmware Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
7.4 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Managing Logic Controller Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
7.5 Controller Info. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Controller Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
7.6 RTC Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Managing the RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Chapter 8 Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Overview of the SoMachine Basic Simulator . . . . . . . . . . . . . . . . . . . . 268
SoMachine Basic Simulator I/O Manager Window . . . . . . . . . . . . . . . 270
SoMachine Basic Simulator Time Management Window . . . . . . . . . . 272
Modifying Values Using SoMachine Basic Simulator. . . . . . . . . . . . . . 275
How to Use the SoMachine Basic Simulator . . . . . . . . . . . . . . . . . . . . 280
Launching Simulation in Vijeo-Designer . . . . . . . . . . . . . . . . . . . . . . . 281
6 EIO0000001354 12/2017
Chapter 9 Saving Projects and Closing SoMachine Basic . . . . . . . 283
Saving a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Saving a Project As a Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Closing SoMachine Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Appendices ......................................... 287
Appendix A Converting Twido Projects to SoMachine Basic . . . . . . . 289
Converting Twido Projects to SoMachine Basic . . . . . . . . . . . . . . . . . 289
Appendix B SoMachine Basic Keyboard Shortcuts . . . . . . . . . . . . . . 299
SoMachine Basic Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . 299
Glossary ......................................... 305
Index ......................................... 309
EIO0000001354 12/2017 7
8 EIO0000001354 12/2017
Safety Information
Important Information
NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device
before trying to install, operate, service, or maintain it. The following special messages may appear
throughout this documentation or on the equipment to warn of potential hazards or to call attention
to information that clarifies or simplifies a procedure.
EIO0000001354 12/2017 9
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by qualified
personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of
the use of this material.
A qualified person is one who has skills and knowledge related to the construction and operation
of electrical equipment and its installation, and has received safety training to recognize and avoid
the hazards involved.
10 EIO0000001354 12/2017
About the Book
At a Glance
Document Scope
This guide describes how to use the SoMachine Basic software to configure, program, and
commission applications for supported logic controllers.
Validity Note
The information in this manual is applicable only for SoMachine Basic products.
This document has been updated for the release of SoMachine Basic V1.6.
The technical characteristics of the devices described in this document also appear online. To
access this information online:
Step Action
1 Go to the Schneider Electric home page www.schneider-electric.com.
2 In the Search box type the reference of a product or the name of a product range.
Do not include blank spaces in the reference or product range.
To get information on grouping similar modules, use asterisks (*).
3 If you entered a reference, go to the Product Datasheets search results and click on the
reference that interests you.
If you entered the name of a product range, go to the Product Ranges search results and click
on the product range that interests you.
4 If more than one reference appears in the Products search results, click on the reference that
interests you.
5 Depending on the size of your screen, you may need to scroll down to see the data sheet.
6 To save or print a data sheet as a .pdf file, click Download XXX product datasheet.
The characteristics that are presented in this manual should be the same as those characteristics
that appear online. In line with our policy of constant improvement, we may revise content over time
to improve clarity and accuracy. If you see a difference between the manual and online information,
use the online information as your reference.
EIO0000001354 12/2017 11
Related Documents
12 EIO0000001354 12/2017
Title of Documentation Reference Number
Modicon TMC2 Cartridge - Hardware Guide EIO0000001768 (ENG)
EIO0000001769 (FRE)
EIO0000001770 (GER)
EIO0000001771 (SPA)
EIO0000001772 (ITA)
EIO0000001773 (CHS)
EIO0000001774 (POR)
EIO0000001775 (TUR)
Modicon TM3 Expansion Modules Configuration - Programming EIO0000001396 (ENG)
Guide EIO0000001397 (FRE)
EIO0000001398 (GER)
EIO0000001399 (SPA)
EIO0000001400 (ITA)
EIO0000001401 (CHS)
EIO0000001374 (POR)
EIO0000001375 (TUR)
Modicon TM3 Digital I/O Modules - Hardware Guide EIO0000001408 (ENG)
EIO0000001409 (FRE)
EIO0000001410 (GER)
EIO0000001411 (SPA)
EIO0000001412 (ITA)
EIO0000001413 (CHS)
EIO0000001376 (POR)
EIO0000001377 (TUR)
Modicon TM3 Analog I/O Modules - Hardware Guide EIO0000001414 (ENG)
EIO0000001415 (FRE)
EIO0000001416 (GER)
EIO0000001417 (SPA)
EIO0000001418 (ITA)
EIO0000001419 (CHS)
EIO0000001378 (POR)
EIO0000001379 (TUR)
Modicon TM3 Expert Modules - Hardware Guide EIO0000001420 (ENG)
EIO0000001421 (FRE)
EIO0000001422 (GER)
EIO0000001423 (SPA)
EIO0000001424 (ITA)
EIO0000001425 (CHS)
EIO0000001380 (POR)
EIO0000001381 (TUR)
EIO0000001354 12/2017 13
Title of Documentation Reference Number
Modicon TM3 Safety Modules - Hardware Guide EIO0000001831 (ENG)
EIO0000001832 (FRE)
EIO0000001833 (GER)
EIO0000001834 (SPA)
EIO0000001835 (ITA)
EIO0000001836 (CHS)
EIO0000001837 (POR)
EIO0000001838 (TUR)
Modicon TM3 Transmitter and Receiver Modules - Hardware Guide EIO0000001426 (ENG)
EIO0000001427 (FRE)
EIO0000001428 (GER)
EIO0000001429 (SPA)
EIO0000001430 (ITA)
EIO0000001431 (CHS)
EIO0000001382 (POR)
EIO0000001383 (TUR)
Modicon TM2 Expansion Modules Configuration - Programming EIO0000000396 (ENG)
Guide EIO0000000397 (FRE)
EIO0000000398 (GER)
EIO0000000399 (SPA)
EIO0000000400 (ITA)
EIO0000000401 (CHS)
Modicon TM2 Digital I/O Modules - Hardware Guide EIO0000000028 (ENG)
EIO0000000029 (FRE)
EIO0000000030 (GER)
EIO0000000031 (SPA)
EIO0000000032 (ITA)
EIO0000000033 (CHS)
Modicon TM2 Analog I/O Modules - Hardware Guide EIO0000000034 (ENG)
EIO0000000035 (FRE)
EIO0000000036 (GER)
EIO0000000037 (SPA)
EIO0000000038 (ITA)
EIO0000000039 (CHS)
SR2MOD02 and SR2MOD03 Wireless Modem - User Guide EIO0000001575 (ENG)
You can download these technical publications and other technical information from our website
at http://www.schneider-electric.com/en/download
14 EIO0000001354 12/2017
Product Related Information
WARNING
LOSS OF CONTROL
The designer of any control scheme must consider the potential failure modes of control paths
and, for certain critical control functions, provide a means to achieve a safe state during and
after a path failure. Examples of critical control functions are emergency stop and overtravel
stop, power outage and restart.
Separate or redundant control paths must be provided for critical control functions.
System control paths may include communication links. Consideration must be given to the
implications of unanticipated transmission delays or failures of the link.
Observe all accident prevention regulations and local safety guidelines.1
Each implementation of this equipment must be individually and thoroughly tested for proper
operation before being placed into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
1For additional information, refer to NEMA ICS 1.1 (latest edition), "Safety Guidelines for the
Application, Installation, and Maintenance of Solid State Control" and to NEMA ICS 7.1 (latest
edition), "Safety Standards for Construction and Guide for Selection, Installation and Operation of
Adjustable-Speed Drive Systems" or their equivalent governing your particular location.
WARNING
UNINTENDED EQUIPMENT OPERATION
Only use software approved by Schneider Electric for use with this equipment.
Update your application program every time you change the physical hardware configuration.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EIO0000001354 12/2017 15
Terminology Derived from Standards
The technical terms, terminology, symbols and the corresponding descriptions in this manual, or
that appear in or on the products themselves, are generally derived from the terms or definitions
of international standards.
In the area of functional safety systems, drives and general automation, this may include, but is not
limited to, terms such as safety, safety function, safe state, fault, fault reset, malfunction, failure,
error, error message, dangerous, etc.
Among others, these standards include:
Standard Description
EN 61131-2:2007 Programmable controllers, part 2: Equipment requirements and tests.
ISO 13849-1:2008 Safety of machinery: Safety related parts of control systems.
General principles for design.
EN 61496-1:2013 Safety of machinery: Electro-sensitive protective equipment.
Part 1: General requirements and tests.
ISO 12100:2010 Safety of machinery - General principles for design - Risk assessment and risk
reduction
EN 60204-1:2006 Safety of machinery - Electrical equipment of machines - Part 1: General
requirements
EN 1088:2008 Safety of machinery - Interlocking devices associated with guards - Principles
ISO 14119:2013 for design and selection
ISO 13850:2006 Safety of machinery - Emergency stop - Principles for design
EN/IEC 62061:2005 Safety of machinery - Functional safety of safety-related electrical, electronic,
and electronic programmable control systems
IEC 61508-1:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: General requirements.
IEC 61508-2:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: Requirements for electrical/electronic/programmable
electronic safety-related systems.
IEC 61508-3:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: Software requirements.
IEC 61784-3:2008 Digital data communication for measurement and control: Functional safety
field buses.
2006/42/EC Machinery Directive
2014/30/EU Electromagnetic Compatibility Directive
2014/35/EU Low Voltage Directive
16 EIO0000001354 12/2017
In addition, terms used in the present document may tangentially be used as they are derived from
other standards such as:
Standard Description
IEC 60034 series Rotating electrical machines
IEC 61800 series Adjustable speed electrical power drive systems
IEC 61158 series Digital data communications for measurement and control – Fieldbus for use in
industrial control systems
Finally, the term zone of operation may be used in conjunction with the description of specific
hazards, and is defined as it is for a hazard zone or danger zone in the Machinery Directive
(2006/42/EC) and ISO 12100:2010.
NOTE: The aforementioned standards may or may not apply to the specific products cited in the
present documentation. For more information concerning the individual standards applicable to the
products described herein, see the characteristics tables for those product references.
EIO0000001354 12/2017 17
18 EIO0000001354 12/2017
SoMachine Basic
Getting Started with SoMachine Basic
EIO0000001354 12/2017
Part I
Getting Started with SoMachine Basic
EIO0000001354 12/2017 19
Getting Started with SoMachine Basic
20 EIO0000001354 12/2017
SoMachine Basic
Introduction to SoMachine Basic
EIO0000001354 12/2017
Chapter 1
Introduction to SoMachine Basic
EIO0000001354 12/2017 21
Introduction to SoMachine Basic
Section 1.1
System Requirements and Supported Devices
22 EIO0000001354 12/2017
Introduction to SoMachine Basic
System Requirements
Overview
The minimum system requirements for the PC on which SoMachine Basic software is installed are:
Intel Core 2 Duo processor or greater
1 GB RAM
Display resolution 1280 x 768 pixels or greater
The 32- or 64-bit version of one of the following operating systems:
Microsoft Windows 7
Microsoft Windows 8
Microsoft Windows 8.1
Microsoft Windows 10
EIO0000001354 12/2017 23
Introduction to SoMachine Basic
Supported Devices
TMC2 Cartridges
For more information about cartridge configuration, refer to the following programming and
hardware guides:
24 EIO0000001354 12/2017
Introduction to SoMachine Basic
EIO0000001354 12/2017 25
Introduction to SoMachine Basic
Overview
A programmable logic controller reads inputs, writes outputs, and solves logic based on a control
program. Creating a control program for a logic controller consists of writing a series of instructions
in one of the supported programming languages.
SoMachine Basic supports the following IEC-61131-3 programming languages:
Ladder Diagram language
Instruction List language
Grafcet (List)
Grafcet (SFC)
26 EIO0000001354 12/2017
Introduction to SoMachine Basic
Section 1.2
SoMachine Basic User Interface Basics
EIO0000001354 12/2017 27
Introduction to SoMachine Basic
Overview
SoMachine Basic is a graphical programming tool designed to make it easy to configure, develop,
and commission programs for logic controllers.
28 EIO0000001354 12/2017
Introduction to SoMachine Basic
Introduction
The following diagram shows the typical stages of developing a project in SoMachine Basic (the
Configuration, Programming and Commissioning tabs):
EIO0000001354 12/2017 29
Introduction to SoMachine Basic
Start Page
The Start Page window is always displayed when you launch SoMachine Basic. Use this window
to register your SoMachine Basic software, manage the connection to the logic controller, and
create or select a project to work with.
Module Areas
Once you have selected a project to work with, SoMachine Basic displays the main window.
At the top of the main window, a toolbar (see page 53) contains icons that allow you to perform
common tasks, including returning to the Start Page window.
Next to the toolbar, the status bar (see page 55) displays informational messages about the
current state of the connection to the logic controller.
Below this, the main window is divided into a number of modules. Each module controls a different
stage of the development cycle, and is accessible by clicking a tab at the top of the module area.
To develop an application, work your way through the modules from left to right:
Properties (see page 61)
Set up the project properties
Configuration (see page 67)
Define the hardware configuration of the logic controller and associated expansion modules
Programming (see page 71)
Develop your program in one of the supported programming languages
Display (see Modicon M221, Logic Controller, Programming Guide)
Build an operator interface for the TMH2GDB Remote Graphic Display module
Commissioning (see page 243)
Manage the connection between SoMachine Basic and the logic controller, upload/download
applications, test, and commission the application.
30 EIO0000001354 12/2017
Introduction to SoMachine Basic
Operating Modes
Introduction
The operating modes provide control to develop, debug, monitor, and modify the application when
the controller is connected or not connected to SoMachine Basic.
SoMachine Basic can operate in the following modes:
Offline mode
Online mode
Simulator mode
Offline Mode
SoMachine Basic operates in offline mode when no physical connection to a logic controller has
been established.
In offline mode, you configure SoMachine Basic to match the hardware components you are
targeting, then develop your application.
Online Mode
SoMachine Basic operates in online mode when a logic controller is physically connected to the
PC.
In online mode, you can proceed to download your application to the logic controller (downloading
and uploading application is not possible in the simulator mode because the application is directly
saved in the simulated logic controller). SoMachine Basic then synchronizes the application in the
PC memory with the version stored in the logic controller, allowing you to debug, monitor, and
modify the application.
You can modify certain elements of a program in online mode. For example, you can add or delete
rungs, or modify the values of certain function block parameters.
NOTE: Online program modifications are subjected to the predefined configuration. See Memory
Management (see page 45). Refer to Debugging in Online Mode (see page 230) for more
information.
Simulator Mode
SoMachine Basic operates in simulator mode when a connection has been established with a
simulated logic controller. In simulator mode, no physical connection to a logic controller is
established; instead SoMachine Basic simulates a connection to a logic controller and the
expansion modules to run and test the program.
For more information, refer to SoMachine Basic Simulator (see page 268).
EIO0000001354 12/2017 31
Introduction to SoMachine Basic
32 EIO0000001354 12/2017
SoMachine Basic
Starting with SoMachine Basic
EIO0000001354 12/2017
Chapter 2
Starting with SoMachine Basic
EIO0000001354 12/2017 33
Starting with SoMachine Basic
Section 2.1
The Start Page
34 EIO0000001354 12/2017
Starting with SoMachine Basic
Overview
The Start Page window is always the first window that is displayed when you start SoMachine
Basic.
The Start Page window has the following windows:
Register (see page 36)
To register SoMachine Basic software and view license details.
Projects (see page 37)
To create a new project or open an existing project.
Connect (see page 40)
To connect to a logic controller, download/upload application to/from the controller, back
up/restore controller memory, and to flash the LEDs of the connected controller.
Templates (see page 46)
To create a new project using an example project as a template.
Help (see page 47)
To display the online help, related documents, training materials, and tutorials.
About
To display information about SoMachine Basic.
Exit
To exit from SoMachine Basic.
EIO0000001354 12/2017 35
Starting with SoMachine Basic
Overview
You can use the SoMachine Basic software for 30 days before you are required to register the
software. When you register, you receive an authorization code to use the software.
Registering your SoMachine Basic software entitles you to receive technical support and software
updates.
Registering
To register your SoMachine Basic software:
Step Action
1 Click the Register now button at the top of the Start Page window.
2 Follow the instructions on the Registration Wizard. Click the Help button for more details.
To view details on the license key installed on your PC, click About on the Start Page window.
36 EIO0000001354 12/2017
Starting with SoMachine Basic
Projects Window
Overview
Use the Projects window to create a new SoMachine Basic project or to open an existing
SoMachine Basic, TwidoSoft, or TwidoSuite project to work with.
The right-hand area of the Projects window contains links to additional useful information.
Step Action
1 Click Projects on the Start Page window.
2 Do one of the following:
Click a recent project in the Recent projects list.
Click Create a new project.
Click Open an existing project and select an existing SoMachine Basic project file (*.smbp)
or a sample project file (*.smbe).
EIO0000001354 12/2017 37
Starting with SoMachine Basic
Step Action
3 Case 1
If a window asking you to enter the password appears, it means that the project is password-
protected:
1. Type the encryption password.
2. Click Apply
3. To modify the project:
a. Click on the Properties tab.
Result: A window asking you to enter the password appears.
b. Type the modification password.
c. Click Apply.
Result: The project file opens and the Configuration tab is displayed.
Case 2
If an error icon is displayed on the Properties tab, it means that the project that you want to open
was password-protected in a previous version of SoMachine Basic with View and Download
selected:
1. Click Properties tab → Project Protection.
2. Click on the Properties tab.
3. Type a password to encrypt the project.
You must encrypt the project to be allowed to save it.
4. Click Apply.
Case 3
If the Error window appears, it means that the project that you want to open was password-
protected in a previous version of SoMachine Basic with Download only selected:
1. Click OK
Result: The Properties tab is displayed.
2. Click Project Protection.
3. Click , then enter the project password.
4. If you want to remove the project protection, select Inactive and click Apply.
If you want to keep the project protection, type the encryption password, select View and
Download and click Apply.
38 EIO0000001354 12/2017
Starting with SoMachine Basic
Step Action
1 Click Projects on the Start Page window.
2 Click Open an existing project, select any of the following in the Files of type list, and then browse
and select an existing project with respective extension:
TwidoSuite Project Files (*.xpr)
Twido Archive Project Files (*.xar)
TwidoSoft Project Files (*.twd)
If the selected Twido project file is open in TwidoSoft, TwidoSoft locks the project file and it is not
possible to open it in SoMachine Basic. Close the project in TwidoSoft before opening it in
SoMachine Basic.
Result: The selected project file opens and the Configuration tab is displayed.
3 A conversion report window appears. Thoroughly examine the conversion results in order to
determine whether there are anomalies that resulted from converting from one controller platform
to another. Refer to Converting Twido Projects to SoMachine Basic (see page 289) for help on
reconciling any such anomalies.
NOTE: TwidoSuite uses %I0.0.1 (or %I0.0.7) as the Pulse input on the Very Fast Counter
(%VFC) function block. In SoMachine Basic the equivalent High Speed Counter (%HSC) function
block uses %I0.0 (or %I0.6). Make appropriate modifications to your applications after
conversion.
In general, the conversion of other controller platforms to the M221 Logic Controller and
SoMachine Basic platform is supported to the limits of the differences between those platforms.
Inevitably, you must reconcile manually those differences, such as that described in the note
above.
WARNING
UNINTENDED EQUIPMENT OPERATION
Always verify that your application program operates as it did prior to the conversion, having
all the correct configurations, parameters, parameter values, functions, and function blocks as
required.
Modify the application as necessary such that it conforms to its previous operation.
Thoroughly test and validate the newly compiled version prior to putting your application into
service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EIO0000001354 12/2017 39
Starting with SoMachine Basic
Connect Window
Connected Devices
The Connect window presents two lists of devices:
1. Local Devices
Displays all devices connected to the PC giving access to logic controllers:
via the physical COM ports of the PC (COM1, for example)
via USB cables
via the virtualized COM ports (by USB-to-serial converters or Bluetooth dongles)
via modem(s) and associated telephone number(s) that you manually add to this list
NOTE: If a COM port is selected and the Keep Modbus driver parameters check box is
activated, the communication is established with the parameters defined in the Modbus driver.
2. Ethernet Devices
Displays all logic controllers that are accessible on the same Ethernet subnet as the PC running
SoMachine Basic. Devices behind a router or any device that blocks UDP broadcasts are not
listed.
The list includes logic controllers that are automatically detected by SoMachine Basic as well as
any controllers that you choose to add manually.
You can only use the Start Flashing LEDs button for logic controllers that are automatically
added (with Auto discovery protocol enabled option selected).
Step Action
1 In the Remote Lookup field, type the IP address of the logic controller to add, for example,
12.123.134.21
2 Click Add to add the device to the Ethernet Devices list.
Step Action
1
40 EIO0000001354 12/2017
Starting with SoMachine Basic
Step Action
2 Select the COM port of the modem from the drop-down list:
Devices list and clicking on the Modify Modem Configuration button located above the list.
EIO0000001354 12/2017 41
Starting with SoMachine Basic
42 EIO0000001354 12/2017
Starting with SoMachine Basic
Connecting to a Controller
Follow these steps to connect a controller to SoMachine Basic:
Step Action
1
Click (Refresh Devices button) to refresh the list of connected devices.
2 Select one of the logic controllers in the Local Devices or Ethernet Devices lists.
If a controller is connected by Ethernet on the same network cable as your PC, the IP address of the
controller appears in the list. Selecting the IP address in the list enables (IP Address
Configuration button). Click this button to change the IP address of the controller.
NOTE: If you activate the check box Write to post configuration file, the Ethernet parameters are
modified in the post configuration file and kept after a power cycle.
3
If necessary, click (Start Flashing LEDs button) to flash the LEDs of the selected controller in
order to identify the controller physically. Click this button again to stop flashing the LEDs.
NOTE: You can only use the Start Flashing LEDs button for logic controllers that are automatically
added (with Auto discovery protocol enabled option selected).
4 Click Login to log in to the selected controller.
If the logic controller is password protected, you are prompted to provide the password. Type the
password and click OK to connect.
Result: A status bar appears showing the connection progress.
5 When the connection is successfully established, details about the logic controller appear in the
Selected Controller area of the window and the following buttons are available:
Download application to controller: To download an application to the logic controller without
opening it in SoMachine Basic. Refer to Directly Downloading an Application (see page 44).
Memory Management: To Back up (see page 257) or restore (see page 258) the logic controller
memory to or from a PC. Refer to Memory Management (see page 45).
Upload application from controller: To create a new SoMachine Basic project file by uploading an
application from the connected logic controller. Refer to Uploading an Application (see page 254).
6 Click Logout button to log out from the connected controller.
EIO0000001354 12/2017 43
Starting with SoMachine Basic
Overview
You can download the application contained in a project file to a logic controller without having to
open the project in SoMachine Basic. This is useful if the project is encrypted, which prevents users
from opening the project unless they have the password.
Only downloading is possible in this way.To upload an application from the logic controller to
SoMachine Basic, refer to Uploading an Application (see page 254).
Step Action
1 Physically connect the PC running SoMachine Basic to the logic controller using a serial, USB,
or Ethernet cable.
2 Select the Connect tab on the Start Page window.
3 Select the logic controller in the Local Devices or Ethernet Devices list and click Login.
Result: SoMachine Basic establishes the connection to the logic controller.
4 Click Download application to controller.
5 In the Project File field, click the browse button, select the SoMachine Basic project file (*.smbp)
to download, and click Open.
Information about the selected project file appears in the Information area of the window:
Whether the project file is encrypted and protected with a password.
Information about the configuration contained in the project file, for example, whether the
detected configuration of the logic controller system is compatible with the configuration
contained in the selected project.
6 SoMachine Basic compiles the application in the selected project file. Any errors detected during
compilation are listed under Compilation errors. SoMachine Basic does not allow the application
to be downloaded if compilation errors have been detected; open the project in SoMachine Basic,
correct the errors, then try again.
7 Before downloading, you can click the following buttons to control the current logic controller
state:
Stop Controller
Start Controller
Initialize Controller
44 EIO0000001354 12/2017
Starting with SoMachine Basic
Memory Management
Overview
Click the Memory Management button on the Connect window to back up or restore the logic
controller memory.
Select the action to perform:
Backing up to a PC (see page 257)
Restore from a PC (see page 258)
EIO0000001354 12/2017 45
Starting with SoMachine Basic
Overview
You can use example projects to form the basis of new SoMachine Basic projects.
Step Action
1 Select the Templates tab on the Start Page window.
2 Use the Search in templates text field located in the upper right-hand corner of the window to
search for projects. As you type, SoMachine Basic searches in the project name, the description
of the project available in the lower of the window, and the project properties. A list of matching
projects appears as you type.
Select a project template file (*.smbe) in the Projects list and click Open Template.
Result: A new project is created as a copy of the selected template.
For projects that have a help file linked to the project template, click the Open Associated Help
button for an Open associated help to be opened. If available, the option is highlighted below the
Projects list.
NOTE: SoMachine Basic also provides a Vijeo-Designer application file and a System User
Guide for some example projects. Read the description of the selected project in the Description
area to know whether these files are provided with your project or not. If these files are provided,
click Open associated folder to browse through the project template files (*.smbe) and Vijeo-
Designer application files (*.vdz) in Windows Explorer.
46 EIO0000001354 12/2017
Starting with SoMachine Basic
Help Window
Overview
This window contains links to additional SoMachine Basic resources:
The SoMachine Basic online help system
Related PDF documents, such as System User Guides (SUGs), training materials, Instruction
Sheets, and descriptions of example applications
E-Learning training materials
Tutorials
Information for converting Twido applications for use with SoMachine Basic.
EIO0000001354 12/2017 47
Starting with SoMachine Basic
48 EIO0000001354 12/2017
SoMachine Basic
Developing SoMachine Basic Applications
EIO0000001354 12/2017
Part II
Developing SoMachine Basic Applications
EIO0000001354 12/2017 49
Developing SoMachine Basic Applications
50 EIO0000001354 12/2017
SoMachine Basic
SoMachine Basic
EIO0000001354 12/2017
Chapter 3
The SoMachine Basic Window
EIO0000001354 12/2017 51
SoMachine Basic
Section 3.1
Overview of the SoMachine Basic Window
52 EIO0000001354 12/2017
SoMachine Basic
Toolbar Buttons
Introduction
The toolbar appears at the top of the SoMachine Basic window to provide an access to frequently-
used functions.
Toolbar
The toolbar has the following buttons:
Icon Description
Create a new project (CTRL+N)
Save the current project (CTRL+S). Click the down arrow to display a menu with
additional save options.
Print a report (CTRL+P). Click the down arrow to select the report to print
(see page 59) or to configure the report content and format (see page 60).
Cut (CTRL+X)
Copy (CTRL+C)
Paste (CTRL+V)
Undo (CTRL+Z). Click once to undo the most recent action in the program editor.
Click the down arrow and select an action from the list to undo all actions up to and
including the selected action.
You can undo up to 10 actions.
Redo (CTRL+Y). Click once to cancel the most recent Undo action.
Click the down arrow and select an action from the list to redo all actions up to and
including the selected action.
You can redo up to 10 actions.
Display the System Settings (see page 57) window.
Click the down arrow and select an action from the list. Display online help or
contextual help, view templates, release notes, tutorials, and e-Learning documents,
or contact Schneider Electric technical support.
EIO0000001354 12/2017 53
SoMachine Basic
Icon Description
Start the logic controller (CTRL+M). Only available in online mode and when the
controller is not already in the RUNNING state.
Stop the logic controller (CTRL+L). Only available in online mode and when the
controller is in the RUNNING state.
54 EIO0000001354 12/2017
SoMachine Basic
Status Area
Overview
The status area at the top of the main window displays information on the present system status:
1 Program status:
Indicates whether the program has errors detected or not.
2 Connection status:
Indicates the connection status between SoMachine Basic and either the logic controller or the
simulated logic controller.
3 Controller status:
Indicates the present state of the logic controller (RUNNING, STOPPED, HALTED, and so on).
4 Scan time:
Indicates the last scan time.
5 Controller last error detected:
Indicates the most recent error detected. Information is extracted from the system bits and
system words if the logic controller is in STOPPED or HALTED state.
EIO0000001354 12/2017 55
SoMachine Basic
Refer to the programming guide of the logic controller for a complete list of the system bits and
system words.
56 EIO0000001354 12/2017
SoMachine Basic
System Settings
Overview
This window allows you to set the language of the SoMachine Basic software, customize the
Ladder editor, and choose the default logic controller that appears on the Configuration tab when
you create a new project.
Step Action
1 Choose System Settings → General on the System Settings window.
2 Select the language to use in the Language list.
The default language is English.
3 Click Apply and close the System Settings window.
4 Close and restart SoMachine Basic to view the user interface in the new language.
Step Action
1 Choose System Settings → General on the System Settings window.
2 Select F1 or Shift + F1 for contextual help.
The shortcut for General help is automatically updated.
Step Action
1 Choose System Settings → Ladder Editor on the System Settings window.
2 Choose the Grid lines style for the Ladder editor.
Dots (default)
Dashed Lines
Lines
3 Set the Number of columns (11...30) for the cells in the Ladder editor.
The default value of number of cells is 11.
For more information, refer to Programming Principles for Ladder Diagrams (see page 175).
EIO0000001354 12/2017 57
SoMachine Basic
Step Action
4 Under Tool Selection Conservation, select:
Keep selected tool (default): After selecting and placing a graphic element in a rung, the most
recently selected graphic element remains selected. This allows you to place the same
element in a rung again without reselecting it. Press the ESC key or right-click an empty cell
Reset to pointer: After selecting and placing a contact or a coil in a rung, the pointer tool
is automatically selected.To insert the same contact or coil element again, select it in the
toolbar.
5 Choose the Shortcuts and toolbar style setting for the Ladder Editor:
SoMachine Basic set (default)
Asian set 1
Asian set 2
European set
American set
For the selected style, the table displays a list of keyboard shortcuts for each of the toolbar
buttons displayed.
6 Click Apply and close the System Settings window to view the changes in the Ladder editor.
Step Action
1 Choose System Settings → Configuration on the System Settings window.
2 Click Preferred controller and choose a default logic controller from the list.
3 Click Apply and close the System Settings window.
4 Close and restart SoMachine Basic to view the new default logic controller in the Configuration
tab when a new project is created.
58 EIO0000001354 12/2017
SoMachine Basic
Print Reports
Presentation
You can generate customizable reports to print or to save in PDF format on the PC.
The Print button provides the following options:
Print Project Report to print a customized report which can include the listing of the hardware
components, the application architecture and the contents of the project, program, and
application.
Print Bill Of Material to print a listing of the hardware components used in the project
configuration.
Settings to customize the project report, allowing you to select which elements to include and
the page layout.
Step Action
1
Click the down arrow to the right of the Print button on the toolbar and choose the Print
Project Report menu command, or press CTRL+P.
The Print Preview window is displayed.
2
Click on the toolbar of the Print Preview window to print the project report.
Click on the toolbar of the Print Preview window to save the project report as a PDF file
on the PC.
Step Action
1
Click the down arrow to the right of the Print button on the toolbar and choose the Print
Bill Of Material menu command.
The Print Preview window is displayed.
2
Click on the toolbar of the Print Preview window to print the Bill Of Material.
Click on the toolbar of the Print Preview window to save the Bill Of Material as a PDF
file on the PC.
EIO0000001354 12/2017 59
SoMachine Basic
Step Action
1
Click the down arrow to the right of the Print button on the toolbar and choose the Settings
menu command.
The Settings window is displayed.
2 Click the Report node to configure the format settings of the report (paper size, margins, and
orientation).
3 Select the items to include in the project report:
Description is the project description as in the Project Information window.
Bill Of Material is the listing of the hardware components used in the project configuration.
Hardware Configuration is a listing of the hardware devices used in the configuration:
IO Bus is a list of the I/O expansion modules used.
Cartridges is a list of the cartridges used.
Display is a report section containing information about the Remote Graphic Display:
General properties is the general parameters that appear on the Display tab. There is an
option to print the password in your report.
Alarm View displays a list of triggered alarms.
Pages is a list of operator interface pages created on the Display tab.
60 EIO0000001354 12/2017
SoMachine Basic
Properties
EIO0000001354 12/2017
Chapter 4
Properties
Properties
EIO0000001354 12/2017 61
Properties
Section 4.1
Overview of the Properties Window
62 EIO0000001354 12/2017
Properties
Overview
The Properties tab allows you to specify information about the project and whether it is to be
password-protected:
Details about the developer and the company developing the project.
Information about the project itself.
If the project is to be password protected, the password that must be entered correctly to open
the project in SoMachine Basic.
If the application stored in the logic controller controller is to be password protected, the
password that must be entered correctly to upload the application into a SoMachine Basic
project.
EIO0000001354 12/2017 63
Properties
Project Properties
Overview
Use the Properties window to provide details about the user of SoMachine Basic, the company
developing the application, and the project. In this window, you can also password protect the
project file and the application when stored in the logic controller.
Step Action
1 Display the Properties tab and click Project Properties → Front Page.
2 Complete the information.
3 Click Apply.
NOTE: This information appears in the Windows Explorer properties window when you right-click
on a SoMachine Basic project file.
Step Action
1 Display the Properties tab and click Project Properties → Company.
2 Complete the information.
To upload the company logo image, click Change then browse to select the file to upload. Click
Removed to delete the current image.
3 Click Apply.
Step Action
1 Display the Properties tab and click Project Properties → Project Information.
2 Complete the information.
To upload an image, such as a photograph or CAD image of the instrumented machine, click
Change then browse to select the file to upload. Click Removed to delete the current image.
3 Click Apply.
64 EIO0000001354 12/2017
Properties
Password-Protecting a Project
It is possible to encrypt and password-protect a project file.
If a project is encrypted, you are prompted for the encryption password whenever you try to open
the project.
If the project is protected against modifications, by default you can only view the project. To modify
the project, type the modification password.
Follow these steps to encrypt and password-protect a project file:
Step Action
1 Display the Properties tab and click Project Properties → Project Protection.
2 Select the Active option. Required items of information are marked with an asterisk (*).
3 Type the password and type it again as confirmation to encrypt the project.
4 Optionally, type a password and the confirmation to protect the project from modifications.
5 Click Apply.
If you want a program to be in read mode only, create a controller image and then restore it to
controller (see page 258).
Step Action
1 Display the Properties tab and click Project Properties → Project Protection.
2 Select the Inactive option.
3 Click Apply.
NOTE: If prompted to provide the modification password, type the modification password and
click Apply.
EIO0000001354 12/2017 65
Properties
Step Action
1 Display the Properties tab and click Project Properties → Application Protection.
2 Choose the level of application protection:
Select Active and leave Password blank to disable application upload from the logic controller
to the PC.
Select Active and type the same password in the Password and Confirmation fields to
password protect the application. You must then enter this password when prompted before
uploading the application from the logic controller to the PC.
3 Click Apply.
Step Action
1 Display the Properties tab and click Project Properties → Application Protection.
2 Select the Inactive option.
3 Click Apply.
NOTE: If prompted to provide the current password before the Inactive option applies
successfully, type the password and click Apply.
66 EIO0000001354 12/2017
SoMachine Basic
Configuration
EIO0000001354 12/2017
Chapter 5
Configuration
Configuration
EIO0000001354 12/2017 67
Configuration
Section 5.1
Overview of the Configuration Window
68 EIO0000001354 12/2017
Configuration
Introduction
Use the Configuration window to recreate the hardware configuration of the logic controller and
expansion modules to be targeted by the program.
EIO0000001354 12/2017 69
Configuration
Building a Configuration
Step Action
1 Click the Configuration tab.
2 Expand the logic controller category in the catalog area on the right, if it is not already displayed.
3 Select a logic controller reference. A short description of the physical properties of the logic
controller appear in the Device description area.
4 Drag the logic controller reference over the image of the existing logic controller in the central
area of the window and drop it.
5 Click Yes when prompted to confirm replacing the logic controller reference.
NOTE: The default controller reference is specified in the System Settings window (see page 57).
70 EIO0000001354 12/2017
SoMachine Basic
Programming
EIO0000001354 12/2017
Chapter 6
Programming
Programming
EIO0000001354 12/2017 71
Programming
Section 6.1
Overview of the Programming Workspace
Overview
The Programming tab is split into 3 main areas:
72 EIO0000001354 12/2017
Programming
1 The Programming Tree allows you to select the properties of the program and its objects, and functions,
as well as a number of tools which you can use to monitor and debug the program.
2 The upper central area is the programming workspace where you enter the source code of your program.
3 The lower central area allows you to view and configure the properties of the item selected in the
programming workspace or the Programming Tree.
EIO0000001354 12/2017 73
Programming
Section 6.2
Special Functions
Special Functions
74 EIO0000001354 12/2017
Programming
Objects
Overview
In SoMachine Basic, the term object is used to represent an area of logic controller memory
reserved for use by an application. Objects can be:
Simple software variables, such as memory bits and words
Addresses of digital or analog inputs and outputs
Controller-internal variables, such as system words and system bits
Predefined system functions or function blocks, such as timers and counters.
Controller memory is either pre-allocated for certain object types, or automatically allocated when
an application is downloaded to the logic controller.
Objects can only be addressed by a program once memory has been allocated. Objects are
addressed using the prefix %. For example, %MW12 is the address of a memory word, %Q0.3 is the
address of an embedded digital output, and %TM0 is the address of a Timer function block.
EIO0000001354 12/2017 75
Programming
Symbolic Addressing
Introduction
SoMachine Basic supports the symbolic addressing of language objects; that is, the indirect
addressing of objects by name. Using symbols allows for quick examination and analysis of
program logic, and greatly simplifies the development and testing of an application.
Example
For example, WASH_END is a symbol that could be used to identify an instance of a Timer function
block representing the end of a wash cycle. Recalling the purpose of this name is easier than trying
to remember the role of a program address such as %TM3.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Select the type of object with which to define a symbol, for example I/O objects → Digital inputs,
to display the properties of digital inputs.
The properties window of the object type appears in the lower central area of the Programming
window.
3 Double-click in the Symbol column of the properties table and type the symbol to define for a
particular item, for example Input_1 for the input %I0.2
4 Click Apply.
76 EIO0000001354 12/2017
Programming
Step Action
1 In the Ladder editor, click the Symbol line of a graphic element, for example a latch or function
block. A cursor appears:
2 Type the symbol to use, for example Input_1 and press Enter. The following rules apply to
symbols:
A maximum of 32 characters.
Letters (A-Z), numbers (0-9), or underscores (_).
First character must be a letter. You cannot use the percentage sign (%).
Symbols are not case-sensitive. For example, Pump1 and PUMP1 are the same symbol and
can only be used uniquely for any given object; that is, you cannot assign the same symbol
to different objects.
3 If the graphic element is not yet associated with an object, the Remark window appears. Select
an object to associate with the symbol and click OK.
Otherwise, click Yes when prompted to associate the symbol with the object.
4 Double-click either the symbol or object of the graphic element to display the symbol in the
Symbol column of the properties window:
Storing Symbols
Symbols are a part of non-program data. They are stored in the logic controller as part of a
SoMachine Basic application.
EIO0000001354 12/2017 77
Programming
Memory Allocation
Introduction
SoMachine Basic allows you to pre-allocate (reserve) blocks of logic controller memory for use by
certain object types used in a program, including simple objects (memory words, constant words)
and software objects (function blocks).
Allocation Modes
In offline mode, you can specify the memory allocation mode for each object type. When
configuring these objects (Programming → Tools), the following window then appears above the
list of configurable objects:
78 EIO0000001354 12/2017
Programming
Ladder/List Reversibility
Introduction
SoMachine Basic supports conversion of rungs from Ladder Diagram to Instruction List and from
Instruction List back to Ladder Diagram. This is called program reversibility.
In SoMachine Basic, you can toggle rungs between programming languages at any time as
required. You can therefore display a program with some rungs in Ladder Diagram and other rungs
in Instruction List.
NOTE: You cannot convert Ladder and Instruction List programs to Grafcet (SFC), or Grafcet
(SFC) programs to Ladder or Instruction List, or Grafcet (IL) to Grafcet (SFC).
Understanding Reversibility
A key to understanding program reversibility is examining the relationship between a Ladder
Diagram rung and the associated Instruction List rung:
Ladder Diagram rung: A collection of Ladder Diagram instructions that constitute a logical
expression.
List sequence: A collection of Instruction List programming instructions that correspond to the
Ladder Diagram instructions and represents the same logical expression.
The following illustration displays a common Ladder Diagram rung and its equivalent program logic
expressed as a sequence of Instruction List instructions.
EIO0000001354 12/2017 79
Programming
The use of these reversible function block instructions is not mandatory for a properly functioning
Instruction List program.
80 EIO0000001354 12/2017
Programming
EIO0000001354 12/2017 81
Programming
82 EIO0000001354 12/2017
Programming
EIO0000001354 12/2017 83
Programming
Section 6.3
Configuring Program Behavior and Tasks
84 EIO0000001354 12/2017
Programming
Application Behavior
Overview
You can configure the following aspects of how the application interacts with the logic controller:
Startup (see page 85)
Watchdog (see page 87)
Fallback behavior (see page 87)
Functional levels (see page 87)
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select the Behavior item.
Result: The Behavior properties appear in the lower central area of the Programming window.
3 Modify the properties as required.
4 Click Apply to save the changes.
Startup
Specify how the program behaves following a restart of the logic controller:
Start In Previous State: The logic controller starts in the state that it was in before it was stopped.
Start In Stop: The logic controller does not automatically start application execution.
Start In Run (default): The logic controller automatically starts application execution given run
criteria, such as the presence and charge of a battery, are met.
Unconditional Start In Run: The logic controller automatically starts application execution even
if the controller battery is absent or discharged.
When using the Start In Run feature, the controller will start executing program logic when power
is applied to the equipment. It is essential to know in advance how automatic reactivation of the
outputs will affect the process or machine being controlled. Configure the Run/Stop input to help
control the Start In Run feature. In addition, the Run/Stop input is designed to give local control
over remote RUN commands. If the possibility of a remote RUN command after the controller had
been stopped locally by SoMachine would have unintended consequences, you must configure
and wire the Run/Stop input to help control this situation.
EIO0000001354 12/2017 85
Programming
WARNING
UNINTENDED MACHINE START-UP
Confirm that the automatic reactivation of the outputs does not produce unintended
consequences before using the Start In Run feature.
Use the Run/Stop input to help control the Start In Run feature and to help prevent the
unintentional start-up from a remote location.
Verify the state of security of your machine or process environment before applying power to
the Run/Stop input or before issuing a Run command from a remote location.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
WARNING
UNINTENDED MACHINE OR PROCESS START-UP
Verify the state of security of your machine or process environment before applying power to
the Run/Stop input.
Use the Run/Stop input to help prevent the unintentional start-up from a remote location.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
When using the Unconditional Start In Run feature, the controller will attempt to start executing
program logic when power is applied to the equipment, independent of the reason the controller
had previously stopped. This occurs even if there is no charge in the battery, or if the battery is not
present. Therefore, the controller will start with all memory values re-initialized to zero or other
predetermined default values. It is conceivable that if the controller attempts to restart, for example,
after a short power outage, the values in memory at the time of the outage would be lost, and
restarting the machine may have unintended consequences as there was no battery to maintain
memory values. It is essential to know in advance how an unconditional start will affect the process
or machine being controlled. Configure the Run/Stop input to help control the Unconditional Start
In Run feature.
WARNING
UNINTENDED MACHINE OPERATION
Conduct a thorough risk analysis to determine the effects, under all conditions, of configuring
the controller with the Unconditional Start In Run feature.
Use the Run/Stop input to help avoid an unwanted unconditional restart.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
86 EIO0000001354 12/2017
Programming
Watchdog
A watchdog is a special timer used so that programs do not overrun their allocated scan time.
The watchdog timer has a default value of 250 ms. Specify the duration of the watchdog scan task.
The possible range is 10...500 ms.
Fallback Behavior
Specify the fallback behavior to use when the logic controller enters the STOPPED or an exception
state for any reason.
Two fallback behaviors exist:
Select Fallback values to set outputs to the fallback values defined in the configuration
properties of embedded logic controller and expansion module outputs. This is the default.
Refer to the Programming Guide of the logic controller or expansion module for information on
configuring fallback values for outputs.
Individual fallback values cannot be defined for configured Status Alarm, PTO, and FREQGEN
outputs. The fallback value for these objects is 0 and cannot be modified.
Select Maintain values to keep each output in the state it was when the logic controller entered
the STOPPED or an exception state. In this mode, the fallback values configured for logic
controller and expansion module outputs are ignored and, instead, are set to the last value
assumed by the output.
Maintain values behavior is not applied to fast outputs (HSC reflex outputs, PLS, PWM, PTO,
and FREQGEN); the fallback value for these objects is 0.
Functional Levels
Your system could include logic controllers with different firmware versions, and therefore with
different capability levels. SoMachine Basic supports functional level management to allow you to
control the functional level of your application.
When SoMachine Basic connects to the logic controller, it reads the functional level of the:
Logic controller firmware to authorize download of the SoMachine Basic application to the logic
controller. The functional level selected for the application must be less than or equal to the
maximum functional level supported by the logic controller. If this is not the case, a message
tells you to either update the firmware, or to manually downgrade the functional level of the
application (by selecting a level from the Functional Levels list, see below).
Application embedded in the logic controller, to determine whether to authorize upload of the
logic controller application to the PC running SoMachine Basic. To authorize application upload,
the functional level of the logic controller application must be less than or equal to the maximum
functional level supported by the installed version of SoMachine Basic. If this is not the case,
you must upgrade SoMachine Basic to the latest version before uploading.
The Commissioning window displays the functional levels of the SoMachine Basic application and
the application embedded in the connected logic controller.
EIO0000001354 12/2017 87
Programming
88 EIO0000001354 12/2017
Programming
Overview
SoMachine Basic has the following scan modes for Master task:
Normal mode
Continuous cyclic scanning mode (Freewheeling mode); a new scan starts immediately after the
previous scan has completed.
Periodic mode
Periodic cyclic scanning mode; a new scan starts only after the configured scan time of the
previous scan has elapsed. Every scan is therefore the same duration.
SoMachine Basic offers the following task types:
Master task: Main task of the application.
Master task is controlled by continuous cyclic scanning (in normal scan mode) or by specifying
the scan period of 1...150 ms (default 100 ms) in periodic scan mode.
Periodic task: A short duration subroutine processed periodically.
Periodic tasks are configured by specifying the scan period of 1...255 ms (default 255 ms).
Event task: A very short duration subroutine to reduce the response time of the application.
Event tasks are triggered by the physical inputs or the HSC function blocks. These events are
associated with embedded digital inputs (%I0.2...%I0.5) (rising, falling or both edges) or with the
high speed counters (%HSC0 and %HSC1) (when the count reaches the high speed counter
threshold). You can configure 2 events for each HSC function block.
Tasks Priorities
This table summarizes the task types and their priorities:
Events Priorities
Refer to Event Priorities and Queues (see page 138).
EIO0000001354 12/2017 89
Programming
NOTE: The master task sleep time is at least 30% of the total cycle time with a minimum of
1 millisecond.
90 EIO0000001354 12/2017
Programming
The event tasks are triggered by a hardware interruption that sends a task event to the event task.
EIO0000001354 12/2017 91
Programming
Section 6.4
Managing POUs
Managing POUs
92 EIO0000001354 12/2017
Programming
POUs
Overview
A Program Organization Unit (POU) is a reusable object used in a program. Each POU consists of
a variable declaration and a set of instructions in the source code of a supported programming
language.
One POU always exists and is linked to the master task of the program. This POU is then called
automatically whenever the program starts.
You can create additional POUs containing other objects, for example, functions or function blocks.
When first created, a POU can be either:
associated with a task (see page 94), or
a Free POU (see page 102). A Free POU is not associated with a specific task or event. A Free
POU can, for example, contain library functions that are maintained independently of the main
program. Free POUs are called from within programs as either subroutines or jumps. A periodic
task (see page 132) is a subroutine that is implemented as a Free POU.
EIO0000001354 12/2017 93
Programming
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Add a new POU by one of the following methods:
Right-click the Master Task and choose Add POU from the contextual menu that appears.
Select the Master Task and click (Add POU) on the toolbar at the top of the Tasks tab.
Result: A new POU is added to the program structure immediately below the default/last POU in
the Master Task. The default name is n - New POU, where n is an integer incremented each time
a POU is created.
3 To reposition a POU in the Master Task, select a POU and click the UP or DOWN button on the
toolbar at the top of the Tasks tab to move the selected POU up or down in the program
structure.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select an existing POU above which to insert the POU.
3 Right-click the selected POU and choose Insert POU from the contextual menu that appears.
4 To reposition a POU in the Master Task, select a POU and click the UP or DOWN button on the
toolbar at the top of the Tasks tab to move the selected POU up or down in the program
structure.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple POUs:
Select an existing POU in the Master Task.
Press and hold the CTRL key and select each POU in the Master Task.
3 Right-click one of the selected POU in the Master Task and choose Copy POU from the
contextual menu that appears.
4 Right-click the Master Task and choose Paste POU from the contextual menu that appears.
Result: One or multiple POUs are added to the program structure immediately below the
selected POU in the Master Task with the same name as the copied POU.
94 EIO0000001354 12/2017
Programming
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple existing POUs or Free POUs in the Master Task
3 Right-click on the selected POUs or Free POUs in the Master Task and choose Export POU from
the contextual menu that appears.
4 Save the POU files (*.smbf) in the Export folder that appears.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple existing POUs or Free POUs in the Master Task
3 Right-click on the selected POUs or Free POUs in the Master Task and choose Import POU from
the contextual menu that appears.
4 Select the POU files (*.smbf) from the folder that appears.
NOTE: If a maximum number of Free POUs are reached or the file is corrupted (invalid format),
an error message appears and the Free POUs are not imported.
Renaming a POU
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Edit the POU name by one of the following methods:
Right-click a POU and choose Rename POU from the contextual menu that appears.
Double-click a POU.
Select a POU and double-click the POU name in the programming workspace.
Select a POU and press the F2 key.
3 Type the new name for the POU and press ENTER.
EIO0000001354 12/2017 95
Programming
Removing POUs
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple POUs:
Select an existing POU in the Master Task.
Press and hold the CTRL key and select each POU in the Master Task.
96 EIO0000001354 12/2017
Programming
Managing Rungs
Creating a Rung
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Add a rung in a POU by any of the following methods:
Right-click a POU and choose Add Rung from the contextual menu that appears.
Select a POU and click (Add Rung button) on the toolbar at the top of the Tasks tab.
Select a POU and click (Create a new Rung button) on the toolbar at the top of the
programming workspace.
Result: A new rung is added to the program structure immediately below the last rung.
3 To reposition a rung in a POU, select a rung and click the UP or DOWN button on the toolbar at
the top of the Tasks tab to move the selected rung up or down in the program structure.
4 The rung is given sequence identifier, such as Rung0. You may additionally add a rung comment
to identify the rung by clicking the rung header.
5 The default programming language is LD (ladder). To select a different programming language
for this rung, click LD and choose a different programming language.
6 If this rung is to be called with a JUMP instruction, assign a label to the rung by clicking the drop-
down button below the rung sequence identifier Rungx, where x is the rung number in a POU,
and choose %L from the list.
Result: The rung is labeled as %Ly, where y is the label number. %L appears on the button and
the label number y appears in suffix with the button.
NOTE: The label number is incremented by 1 as you define the next label.
To modify the label number, double-click the label number in a rung and enter the new number
and then press ENTER.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select an existing rung in the Programming workspace.
3
Click (Insert a new Rung button) on the toolbar at the top of the programming
workspace.
Result: A new rung appears above the selected rung.
EIO0000001354 12/2017 97
Programming
Step Action
4 The rung is given sequence identifier, such as Rung0. You may additionally add a rung comment
to identify the rung by clicking the rung header.
5 The default programming language is LD (ladder). To select a different programming language
for this rung, click LD and choose a different language.
6 If this rung is to be called with a JUMP instruction, assign a label to the rung by clicking the drop-
down button below the rung sequence identifier Rungx, where x is the rung number in a POU,
and choose %L from the list.
Result: The rung is labeled as %Ly, where y is the label number. %L appears on the button and
the label number y appears in suffix with the button.
NOTE: The label number is incremented by 1 as you define the next label.
To modify the label number, double-click the label number in a rung and enter the new number
and then press ENTER.
Copying Rungs
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple rungs:
Select an existing rung.
Press and hold the CTRL key and select each rung.
3 Right-click one of the selected rungs to copy and do one of the following methods:
Choose Copy selected rung from the contextual menu that appears.
Press CTRL + C.
Result: A copy of the rung is inserted with the same label as the original rung. Edit the label as
required.
NOTE: You can also copy and paste rungs in the Programming window:
Step Action
1 Right-click the rung to copy and choose Copy selected rung.
2 Right-click in the programming workspace and choose Paste Rung.
98 EIO0000001354 12/2017
Programming
Renaming a Rung
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Edit the rung name by one of the following methods:
Right-click a rung and choose Rename Rung from the contextual menu that appears.
Double-click a rung.
Select a rung and double-click the rung name or the text name in the programming
workspace.
Select a rung and press the F2 key.
3 Type the new name for the rung and press ENTER.
Removing Rungs
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Delete a rung by one of the following methods:
Right-click a rung and choose Delete Rung from the contextual menu that appears.
Select a rung and click (Delete Rung button) on the toolbar at the top of the Tasks
tab.
Select a rung and click (Delete the Rung button) on the toolbar at the top of the
programming workspace.
Right-click a rung in the programming workspace and choose Delete the selected rung from
the contextual menu that appears.
Select a rung and press the DELETE key.
3 If the rung is not empty, you are prompted to confirm deleting the rung.
EIO0000001354 12/2017 99
Programming
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Add a new Grafcet POU by one of the following methods:
Right-click on Master task and choose Add Grafcet POU from the contextual menu that
appears.
Click the (Add Grafcet POU) button on the toolbar at the top of the Tasks tab.
Result: A n - Grafcet node appears below the Master task node, where n is an integer
incremented each time a Grafcet POU is created.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select an existing Grafcet POU above which to insert the new Grafcet POU.
3 Right-click the selected POU and choose Insert Grafcet POU from the contextual menu that
appears.
4 To reposition a Grafcet POU in the Master Task, select a Grafcet POU and click the UP or
DOWN button on the toolbar at the top of the Tasks tab to move the selected Grafcet POU up or
down in the program structure.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple Grafcet POUs:
Select an existing Grafcet POU in the Master Task.
Press and hold the CTRL key and select each Grafcet POU in the Master Task.
3 Right-click one of the selected Grafcet POU in the Master Task and choose Copy POU from the
contextual menu that appears.
4 Right-click the Master Task and choose Paste POU from the contextual menu that appears.
Result: One or multiple Grafcet POUs are added to the program structure immediately below the
selected Grafcet POU in the Master Task with the same name as the copied Grafcet POU.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Edit the Grafcet POU name by one of the following methods:
Right-click on a Grafcet POU and choose Rename POU from the contextual menu that
appears.
Double-click a Grafcet POU.
Select a Grafcet POU and press the F2 key.
3 Type the new name for the Grafcet POU node and press ENTER.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple Grafcet POUs:
Select an existing Grafcet POU in the Master Task.
Press and hold the CTRL key and select each Grafcet POU in the Master Task.
Free POUs
Introduction
In SoMachine Basic, a Free POU is a special type of POU that is not explicitly associated with a
task:
Each Free POU is implemented as a subroutine and is made up of 1 or more rungs written in the
Ladder or IL programming languages.
NOTE: Grafcet POUs cannot be Free POUs.
Free POUs are consumed when:
Called using a subroutine call (SRi) from within a program rung
Configured as the periodic task
Configured as an event task, for example, the subroutine for threshold 0 of a High Speed
Counter (HSC) function block (%HSCi.TH0)
When consumed as periodic or event tasks, the Free POU subroutine is automatically moved from
the Free POUs area of the Tasks window to the Periodic Task or Events area of the window,
respectively.
When no longer consumed as a periodic task of event task, the subroutine moves back to the Free
POUs area and available to be consumed by other tasks or events.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Right-click on Free POUs and choose Add Free POU from the contextual menu that appears.
Result: A new POU with the default name “Free POU_0” and default subroutine number “SR0”
appears below the Free POUs branch and a new rung appears in the Programming workspace.
3 Optionally, right-click on the new POU and choose Rename POU, then type a new name for the
POU and press Enter.
The name of the Free POU is also updated in the rung that appears in the Programming
workspace.
Step Action
4 Optionally, type a comment (see page 191) to associate with the Free POU.
5 Select Subroutine number to the right of the comment box and choose a subroutine number from
the list.
Result: The POU description in the Free POUs list is updated with the subroutine number
chosen, for example “SR11”.
6 Create the rungs/steps and source code for the Free POU/Free Grafcet POU, in the Ladder or
IL programming language.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple Free POUs:
Select an existing Free POU.
Press and hold the CTRL key and select each Free POU.
3 Right-click one of the selected Free POU and choose Copy POU from the contextual menu that
appears.
4 Right-click and choose Paste POU from the contextual menu that appears.
Result: One or multiple new Free POUs with the name Free POU_x, where x is the next available
Free POU number, and default subroutine number SRx , where x is the next available subroutine
number, appear below Free POUs. All rungs of the POU are automatically associated with the
new Free POU subroutine number.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple POUs:
Select an existing POU in the Master Task.
Press and hold the CTRL key and select each POU in the Master Task.
3 Right-click one of the selected POU in the Master Task and choose Copy POU from the
contextual menu that appears.
4 Right-click the Master Task and choose Paste POU from the contextual menu that appears.
Result: One or multiple POUs are added to the program structure immediately below the
selected POU in the Master Task with the same name as the copied POU.
Step Action
1 Select the Tasks tab in the upper left-hand area of the Programming window.
2 Select one or multiple existing Free POUs in the Master Task.
3 Right-click on the selected Free POUs in the Master Task and choose Export POU from the
contextual menu that appears.
4 Save the Export Free POU files (*.smbf) in the Export folder that appears.
Step Action
1 Select the Tasks tab in the upper left-hand area of the Programming window.
2 Select one or multiple existing Free POUs in the Master Task.
3 Right-click on the selected Free POUs in the Master Task and choose Import POU from the
contextual menu that appears.
4 Select the Free POU files (*.smbf) from the folder that appears, and click Open.
NOTE: If a maximum number of Free POUs is reached or the file is corrupted (invalid format),
an error message appears and the Free POUs are not imported.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or multiple Free POUs:
Select an existing Free POU.
Press and hold the CTRL key and select each Free POU.
NOTE: Unassign (see page 133) a Free POU from a task before removing it.
Section 6.5
User-Defined Functions
User-Defined Functions
Overview
A user-defined function allows you to create new functions with input parameters, local variables
and a return value. User-defined functions are stored as part of the SoMachine Basic project.
You can call user-defined functions in:
The Master task
Periodic tasks
Events
Free POUs
NOTE: The application must be configured with a functional level (see page 87) of at least
Level 6.0 to support user-defined functions.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Create a user-defined function using one of the following methods:
Right-click User-defined functions and choose Add user-defined function from the contextual
menu that appears.
Result: A new user-defined function is added to the program structure at the bottom of the list. If
you inserted a user-defined function, the new user-defined function is above the selected one.
The default name is FUNCTIONn, where n is an integer incremented each time a user-defined
function is created.
3 Optionally, rename the user-defined function. Refer to Renaming a User-Defined Function
(see page 113).
4 Define the user-defined function. Refer to Defining a User-Defined Function (see page 108).
You create and manage rungs in a user-defined function in the same way as rungs in a POU. Refer
to Managing Rungs (see page 97).
Presentation
The following illustration shows the actions that are available in the Properties view of the user-
defined function:
Step Action
1 Add a new user-defined function. Refer to Adding a User-Defined Function (see page 107).
2 Define the interface of the user-defined function by defining the Return value, the input
Parameters and the Local variables. Refer to Defining the Interface of a User-Defined Function
(see page 110).
3 Click Apply.
Step Action
4 Define the functionality of the user-defined function in one or more Ladder/IL rungs
(see page 97):
1. Insert a Ladder structure element.
2. Program the user-defined function.
For example:
You can also directly program the user-defined function in the IL editor:
You can call other user-defined functions in the rungs that implement a user-defined function.
NOTE: User-defined functions cannot be recursive: a user-defined function cannot call itself
directly or indirectly.
Example:
- - - Not allowed
A user-defined function cannot call a subroutine, but a subroutine can call a user-defined function.
Global variables are the other variables that you can use in a SoMachine Basic program, including
the rungs of a user-defined function.
Step Action
1
Click the Operation Block button on the toolbar.
2 Click in the Action zone (see page 175) of the rung to insert the Operation Block.
Step Action
3
Click the Selection mode button on the toolbar.
4 Double-click the operation expression line.
You can either:
Type the name of the user-defined function. For example, for the name “FUNCTION1”, type
“FU” and the names of all user-defined functions that begin with “FU” appear:
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined functions:
Click to select a user-defined function.
Select multiple user-defined functions by pressing and holding the CTRL key.
3 Right-click and choose Copy user-defined functions or Cut user-defined functions from the
contextual menu that appears.
4 Right-click User-defined functions and choose Paste user-defined function from the contextual
menu that appears.
Result: One or more user-defined functions are added at the end of the program structure in
User-defined functions. SoMachine Basic automatically assigns new name to the copied user-
defined function.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined functions:
Click to select a user-defined function.
Select multiple user-defined functions by pressing and holding the CTRL key.
3 Right-click the selected user-defined functions in User-defined functions and choose Export
user-defined function from the contextual menu that appears.
4 Save the user-defined function file (*.smbf) in the Export folder that appears.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select a user-defined function in User-defined functions.
3 Right-click the selected user-defined function in the User-defined functions and choose Import
user-defined function from the contextual menu that appears.
4 Navigate to the folder containing the user-defined function file (*.smbf) and select the user-
defined function.
5 Confirm with OK.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Rename using one of the following methods:
Right-click a user-defined function and choose Rename user-defined function from the
contextual menu that appears.
Double-click the user-defined function in the programming workspace.
Select a user-defined function and press the F2 key.
3 Enter the new name for the user-defined function and press ENTER.
The accepted characters are A...Z, 0...9, _. The name must be unique. Otherwise, the name
remains unchanged.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined functions by pressing and holding the CTRL key.
3 Delete the selected user-defined functions using one of the following methods:
Right-click a selected user-defined function in User-defined functions and choose Delete
user-defined function from the contextual menu that appears.
Press the DELETE key.
Section 6.6
User-Defined Function Blocks
Overview
A user-defined function block allows you to create new function blocks with one or more input and
output parameters, and local variables. User-defined function blocks are stored as part of the
SoMachine Basic project.
You can call user-defined function blocks in:
The Master task
Periodic tasks
Events
Free POUs
NOTE: The application must be configured with a functional level (see page 87) of at least
Level 6.0 to support user-defined function blocks.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Create a user-defined function block using one of the following methods:
Right-click User-defined function blocks and choose Add user-defined function block from the
contextual menu that appears.
Select User-defined function blocks and click (Add user-defined function block) on the
toolbar at the top of the Tasks tab.
Select an existing user-defined function block, right click and choose Insert user-defined
function block.
Result: A new user-defined function block is added to the program structure immediately at the
bottom of the list. If you inserted a user-defined function block, the new user-defined function
block is above the selected one. The default name is UDFBn, where n is an integer incremented
each time a user-defined function block is created.
3 Optionally, rename the user-defined function block. Refer to Renaming a User-Defined Function
Block (see page 120).
4 Define the user-defined function block. Refer to Defining a User-Defined Function Block
(see page 116).
You create and manage a rung in a user-defined function block in the same way as a rung in a
POU. Refer to Managing Rungs (see page 97).
Presentation
The following illustration shows the actions that are available in the Properties view of the user-
defined function:
Step Action
1 Add a new user-defined function block. Refer to Adding a User-Defined Function Block
(see page 115).
2 Define the interface of the user-defined function block by defining the input Parameters and the
Local variables. Refer to Defining the Interface of a User-Defined Function Block
(see page 117).
3 Click Apply.
Step Action
4 Specify the functionality of the user-defined function block in one or more Ladder/IL rungs
(see page 97):
1. Click the Function blocks button on the toolbar.
Global variables are all other variables you can use in a SoMachine Basic program, including the
rungs of a user-defined function block.
Step Action
1
Click the Function blocks button on the toolbar.
2
Select → the user-defined function block you want to insert.
3 Click in the Action zone (see page 175) of the rung.
4 Optionally use operation blocks to read or write function block parameters.
The syntax is %<UDFB name><instance number>.PARAMn, where n is an integer
corresponding to the parameter number.
Example:
You defined a user-defined function block named MY_FB with a parameter %PARAM0.
An instance of this user-defined function block is placed in the Master task and the instance
number 0 is assigned to it.
Result: The object %MY_FB0.PARAM0 is available in any tasks.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined function blocks:
Click to select a user-defined function block.
Select multiple user-defined function blocks by pressing and holding the CTRL key.
3 Right-click and choose Copy user-defined function blocks or Cut user-defined function blocks
from the contextual menu that appears.
4 Right-click User-defined function blocks and choose Paste user-defined function block from the
contextual menu that appears.
Result: One or more user-defined function blocks are added at the end of the program structure
in User-defined function blocks. SoMachine Basic automatically assigns new name to the copied
user-defined function block.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined function blocks:
Click to select a user-defined function block.
Select multiple user-defined function blocks by pressing and holding the CTRL key.
3 Right-click the selected user-defined function blocks in User-defined function blocks and choose
Export user-defined function block from the contextual menu that appears.
4 Save the user-defined function block file (*.smbf) in the Export folder that appears.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select a user-defined function in User-defined function blocks.
3 Right-click the selected user-defined function in the User-defined functions blocks and choose
Import user-defined function block from the contextual menu that appears.
4 Navigate to the folder containing the user-defined function block file (*.smbf) and select the user-
defined function block.
5 Confirm with OK.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Rename using one of the following methods:
Right-click a user-defined function block and choose Rename user-defined function block
from the contextual menu that appears.
Double-click the user-defined function block’s name in the programming workspace.
Select a user-defined function block and press the F2 key.
3 Enter the new name for the user-defined function block and press ENTER.
The accepted characters are A...Z, 0...9, _. The name must be unique. Otherwise, the name
remains unchanged.
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select one or more user-defined function blocks by pressing and holding the CTRL key.
3 Delete the selected user-defined function blocks using one of the following methods:
Right-click a selected user-defined function block in User-defined function blocks and choose
Delete user-defined function block from the contextual menu that appears.
Press the DELETE key.
Section 6.7
Master Task
Master Task
Overview
The master task represents the main task of the application program. It is obligatory and is created
by default. The master task is made up of sections and subroutines represented within Program
Organizational Units (POUs). Each POU of the master task can be programmed in any of the
supported programming languages.
Procedure
For Refer To
Creating a new POU in the master task Creating a New POU Associated with a Task (see page 94)
Renaming a POU in the master task Renaming a POU (see page 95)
Removing a POU from the master task Removing a POU (see page 96)
Procedure
Follow these steps to configure the master task:
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select the Master Task item.
Result: The Master Task properties appear in the lower central area of the SoMachine Basic
window.
3 Modify the properties as required.
4 Click Apply to save the changes.
Refer to the Programming Guide for your hardware platform for a complete list of system bits and
words and their meaning.
Section 6.8
Strings
Strings
Overview
Strings are a sequence of bytes containing ASCII characters that you can store in the following
memory objects:
Memory words %MW
Constant words %KW
%MWx:L
x Index of the memory object
L Number of words used by the string and must be between 1...255.
The supported controllers have a little-endian architecture; the bytes are stored from the lowest
order byte to the highest.
The following table shows you an example of the storage of the bytes for the string Basic:
Entering a String
Step Action
1 In the Programming window, click Tools → Memory objects → Constant words.
2 In Constant word properties, click %KW.
3
Click the button in the Configuration column for the constant word that you want to
configure.
If the constant word is already configured the Confirmation window appears. Click Ok to
overwrite the value. Otherwise, click Cancel.
Result: The Constant string Assistant window appears.
4 Enter the string.
Result: Constant range required define the constant words used for the string.
5 Click Apply.
Result: The entered characters are applied to the corresponding and required constant variables.
The character are inverted. Refer to the overview of this section (see page 125).
Syntax
The following describes Instruction List syntax. You can insert Instruction List operations and
assignment instructions (see page 187) in Ladder Diagram rungs using an Operation Block
graphical element.
For assigning a string in a memory word, use this syntax: Op1 := "Your string".
For example:
%MW10:20 := "This is a SoMachine Basic string."
If you want the software to calculate the memory space needed, type %MWx:? := "Your
string".
Rules of Use
When you assign a string:
Make sure there is no overlapping. You can erase a string by another string.
Do not use the “ character.
Managing Strings
Introduction
The following functions allow you to:
Copy a string.
Get the length of a string.
Concatenate two strings.
Compare two strings.
Syntax
The following describes Instruction List syntax. You can insert Instruction List operations and
assignment instructions (see page 187) in Ladder Diagram rungs using an Operation Block
graphical element.
Copying a String
For copying a string, use this syntax: Op1 := Op2.
The following table presents the authorized memory objects for Op1 and Op2:
Parameters Description
Op1 %MWx:L
Op2 %MWy:L or %KWy:L
x, y Indexes of the memory object
L must be the same for both Op1 and Op2
Parameters Description
Op1 %MWx
Op2 %MWy:L or %KWy:L
x, y Indexes of the memory object
Parameters Description
Op1 %MWx:L
Op2 %MWy:A or %KWy:A
Op3 %MWz:B or %KWz:B
x, y, z Indexes of the memory object
SoMachine Basic does not validate that L is sufficiently sized for the concatenation. Be sure that Op1 is of an
adequate, minimum length for the operation.
Stage Description
1 The application copies Op2 into Op1.
2 The copy stops if:
The end character of Op2 is reached.
The memory space assigned to Op2 is copied. %S28 is raised. Refer to System Bits
Description.
The entire memory space of Op1 is filled. %S28 is raised.
3 If the memory space of Op1 is not filled, the application continues by copying Op3 into Op1.
4 The copy stops if:
The end character of Op3 is reached.
The memory space assigned to Op3 is copied. %S28 is raised.
The entire memory space of Op1 is filled. %S28 is raised.
5 The application ensures that Op1 ends with the end character. The last character of Op1 may
be replaced by the end character if the memory space is filled.
Parameters Description
Op1 %MWx
Op2 %MWy:A or %KWy:A
Op3 %MWz:B or %KWz:B
x, y, z Indexes of the memory object
When the application detects a different character, Op1 equals the index position of the first
different character encountered left to right.
The following table presents examples of the result of string comparison:
If And if Then
The application reaches the end Op2 = Op3 Op1 := -1
character of Op2
Op2 ≠Op3 Op1 equals the different character
position.
The application finds a different – Op1 equals the different character
character before reaching the end position.
of Op2 or Op3.
The end of the memory space A≠B Op1 equals the different character
assigned to Op2 or Op3 is reached position and %S28 is raised.Refer
to System Bits Description.
A=B Op1 := -1 and %S28 is raised.
Section 6.9
Periodic Task
Periodic Task
Overview
A periodic task is a subroutine, usually of short duration, that is processed periodically. In
SoMachine Basic, this subroutine is implemented as a Free POU (see page 102). The subroutine
can be written in any of the programming languages supported by SoMachine Basic.
Step Action
1 Create a new Free POU (see page 102) containing the periodic task subroutine.
2 Select the Tasks tab in the left-hand area of the Programming window.
3 Assign a subroutine to the periodic task by one of the following methods:
Select the Periodic Task and click (Assign Free POU button) on the toolbar at the top of
the Tasks tab.
Right-click the Periodic Task and choose Assign Free POU from the contextual menu that
appears.
Result: The Select a Free POU window is displayed:
NOTE: You can directly add a Free POU to the periodic task. Right-click the Periodic Task and
choose Add Free POU from the contextual menu that appears. In this case, a Free POU is
created and assigned to the periodic task.
Step Action
4 Select a Free POU to assign to the periodic task and click OK.
Result: The selected subroutine is assigned to the Periodic Task and no longer avaialble in the
Free POU branch of the Tasks tab.
For example, if the Free POU “Free POU_0” containing the subroutine SR4 is assigned to the
periodic task, the Free POU_0 (%SR4) subroutine moves from the Free POU branch to the
Periodic Task branch of the Tasks tab.
Step Action
1 Click the Tasks tab in the left-hand area of the Programming window.
2 Remove the subroutine from the Periodic Task by one of the following methods:
Select the Periodic Task and click (Unassign Free POU button) on the toolbar at the top
of the Tasks tab.
Right-click the Periodic Task and choose Unassign Free POU from the contextual menu that
appears.
Result: The selected subroutine is removed from the Periodic Task and available as a Free POU
in the Free POUs branch of the Tasks tab.
Procedure
Follow these steps to configure scan duration for periodic task:
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select the Periodic Task item.
Result: The Periodic Task properties appear in the lower central area of the SoMachine Basic
window.
3 Modify the properties as required.
4 Click Apply to save the changes.
Section 6.10
Event Task
Event Task
Introduction
An event task:
Is a part of a program executed when a given condition is met (event source)
Has a higher priority than the main program
Produces a rapid response time, enabling the overall response time of the system to be
reduced.
Description of an Event
An event is composed of:
An event source: a software or hardware condition that interrupts the program when the event
is triggered.
A POU: an independent program entity (subroutine) associated with an event.
A priority level: a priority assigned to events to determine the order in which they are executed.
Event Sources
Overview
8 event sources are available:
4 linked to selected physical inputs of the logic controller
4 linked to the HSC function block thresholds
An event source is always attached to a single event. When an event is triggered, it interrupts the
controller, which then executes the subroutine associated with the event.
Event Priorities
Event Priorities
Events have one of 8 possible priorities, from 7 (the lowest) to 0 (the highest).
Assign a priority to each event source. Two events cannot have the same priority. Thus, the order
of execution depends on their relative priorities and the order in which they are detected.
Event tasks interrupt both master and periodic task execution. For more information, refer to Event
Priority Over Master and Periodic Tasks (see page 91).
NOTE: Care must be exercised when writing to global areas of memory or affecting I/O values
when event tasks are called during the execution of other tasks. Modifying values that are
otherwise used in the other tasks could affect logical outcomes of those tasks adversely.
WARNING
UNINTENDED EQUIPMENT OPERATION
Thoroughly test and validate all tasks (Master, Periodic and any Event tasks) and the interactive
affect they have on one another before putting your application into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
For configuring the event task priorities, refer to Programming Guide of your controller.
Event Management
Each time an interrupt linked to an event source appears, the following sequence is launched:
Step Description
1 Interrupt event occurs.
2 Save the context.
3 Execution of the programming section (subroutine labeled SRi:) linked to the event.
4 Update the embedded outputs.
5 Restore the context.
Overview
Event tasks are displayed in the Configuration tab. Refer to Configuring Digital Inputs.
You can display configured event sources, subroutines attached to events, and verify the status of
events using system bits and words.
To display the event sources and subroutines (Free POUs) assigned to events:
Step Action
1 Select the Tasks tab in the left-hand area of the Programming window.
2 Select Events:
NOTE: Configured event sources that have not yet been assigned a subroutine appear in red.
Step Action
1 Create a new Free POU (see page 102) containing the subroutine to use for the event.
2 Select the Tasks tab in the left-hand area of the Programming window.
Step Action
3 Assign a subroutine to the event source by one of the following methods:
Select the event source in the Events list and click (Assign Free POU button) on the
toolbar at the top of the Tasks tab.
Right-click the event source in the Events list and choose Assign Free POU from the
contextual menu that appears.
Result: The Select a Free POU window is displayed:
NOTE: You can directly add a Free POU to the event source. Right-click the event source in the
Events list and choose Add Free POU from the contextual menu that appears. In this case, a
Free POU is created and assigned to the event source.
4 Select a Free POU to assign to the event source and click OK.
Result: The selected subroutine is assigned to the event source and no longer avaialble in the
Free POU branch of the Tasks tab.
For example, if the Free POU “Free POU_0” containing the subroutine SR1 is assigned to the
event source, the Free POU_0 (%SR1) subroutine moves from the Free POU branch to the
event source branch of the Tasks tab.
Step Action
1 Click the Tasks tab in the left-hand area of the Programming window.
2 Remove the subroutine from the event source by one of the following methods:
Select the event source in the Events list and click (Unassign Free POU button) on the
toolbar at the top of the Tasks tab.
Right-click the event source in the Events list and choose Unassign Free POU from the
contextual menu that appears.
Result: The selected subroutine is removed from the event source and available as a Free POU
in the Free POUs branch of the Tasks tab.
The values of %S39 and %SW48 are reset to 0 and the value of system bit %S38 is set to its initial
state 1 following a cold restart or after an application is loaded. Their values remain unchanged
after a warm restart.
Section 6.11
Using Tools
Using Tools
Messages
Overview
While editing the program, SoMachine Basic analyzes the source code in the Programming tab.
SoMachine Basic also analyzes the program whenever the Compile button on the toolbar is
clicked.
If errors or advisories are detected, a clickable icon is displayed in the Programming tab:
Icon Meaning
Advisory. The rung is incomplete.
If both advisory and error messages are detected, only the Error icon is displayed.
The icon is also displayed in the Tools tab next to Messages:
Displaying Messages
To display a list of error and advisory messages:
Step Action
1 Click the icon on the Programming tab
or:
Click Tools → Messages
A list of messages is displayed in the lower central area of the Programming window.
2 In the Messages area, click the Advisory button to display advisory messages, or the Error button
to display error messages. Click the button again to hide the list of messages.
Rung Status
SoMachine Basic also displays the status of each rung in the program individually.
If the rung is syntactically valid and complete, there are no messages to display and a green tick
symbol is displayed:
An Advisory icon appears if the rung is incomplete, for example, it does not contain a final
instruction such as an END, CALL, or Jump:
An Error icon appears if SoMachine Basic detects one or more syntax errors that would prevent
successful compilation of the rung:
Advisory and Error icons are also displayed next to the name of each rung with errors in the Tasks
tab:
Animation Tables
Overview
You can add objects to animation tables to:
View symbols and comments associated with objects.
View and modify the real-time values of certain object types when SoMachine Basic is
connected to the logic controller (online mode).
Select objects to be displayed in the Trace window (see page 231).
Animation tables are a component of a SoMachine Basic application, and so are downloaded to
the logic controller as part of the non-program data together with the program. This allows the
objects stored in animation tables to be retrieved when an application is later uploaded from the
logic controller.
If you add an object that does not exist to an animation table, the Value field is displayed with a red
outline. For example, if you add %Q1.0 but there is no corresponding digital output module in the
configuration.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Right-click Animation tables and choose Add new animation table from the contextual menu that
appears.
Result: A new animation table item appears below the Animation Tables area of the Tools
window, and a properties window appears in the lower central area of the window.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Select the animation table to configure in the Animation tables area of the Tools window.
Result: The properties window appears in the lower central area of the window.
3 To add a new object to the bottom of the animation table, type the object name into the text box
and press Enter, or click Add.
The following objects can be added to an animation table:
I/O objects
Function block objects. For example, for a Timer function block %TM0, %TM0.V, %TM0.P and
%TM0.Q are automatically added to the animation table.
Bit strings (example: %Mx:L where L is the bit count, multiple of 8)
Word tables (example: %MWx:L where L is the word count)
Bits of words (example: %MWx:X where X is the offset of the bit)
Network objects (%QWE, %IWE, %QWM, %IWM)
NOTE: Network objects are only available if either the EtherNet/IP adapter (see Modicon
M221, Logic Controller, Programming Guide) of the logic controller is enabled, or Modbus
mapping is enabled in the Modbus TCP Configuration.
4 To add a new object immediately above an existing object, select a row in the animation table,
type the name of the object to add into the text box, and click Insert.
Addresses of I/O objects in animation tables are not automatically modified following configuration
changes. For example, %Q3.0 is not automatically changed to %Q1.0 when the position of the
corresponding module changes in the configuration. You must take into account any adjustments
made to I/O memory assignments within your application and update them accordingly.
WARNING
UNINTENDED EQUIPMENT OPERATION
Inspect and modify as necessary any immediate I/O addresses used in the application after
modifying the configuration.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Step Action
1 If more than 1 animation table exists, select an animation table in the Animation tables area of
the Tools window.
Result: The animation table properties window appears in the lower central area of the window.
Step Action
2 Select the Tasks window.
3 Right-click a rung and choose Add rung objects to the current animation table from the contextual
menu that appears.
Result: Objects used in the rung are added to the animation table.
NOTE:
The rung must contain no errors detected (error icon does not appear).
Only the first 64 objects used in the rung are added (the maximum size of an animation table).
If the same object appears more than once in a rung, only the first occurrence is added to the
animation table.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Select one or more animation tables in Animation tables by pressing and holding the CTRL key.
3 Right-click one of the selected animation tables in Animation tables and choose Copy animation
table or Cut animation table.
4 To paste the animation table, either:
Right-click Animation tables and choose Paste animation table.
Right-click an existing animation table and choose Paste animation table.
Result: The Confirmation window appears. To keep the symbols and comments, clear the check
box, then click Ok.
Result: One or more animation tables are added at the end of Animation tables or after the
selected animation table.
When copying/pasting an animation table, SoMachine Basic automatically assigns a new name.
For example: Animation_table_2 becomes Animation_table_2_0.
When you paste an animation table to a project with a lower functional level (see page 87), only
the object configurations supported by this functional level are copied.
If the symbols contained in the pasted animation table are already used in the project, SoMachine
Basic replaces the pasted symbol.
Step Action
1 Right-click the animation table to delete in the Animation tables area of the Tools window and
click Delete animation table.
Step Action
1 Right-click the animation table to rename in the Animation tables area of the Tools window and
click Rename animation table.
2 Type the new name of the animation table and press Enter.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 To select the animation table either:
Right-click Animation tables.
Select one or more existing animation tables by pressing and holding the CTRL key, then
right-click.
3 Click Export animation table.
4 Choose a folder and save the animation tables (.smbf).
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 To select the animation table either:
Right-click Animation tables.
Right-click an existing animation table.
If the symbols contained in the imported animation table are already used in the project,
SoMachine Basic replaces the imported symbol.
Step Action
1 Select up to 8 objects in the Trace column of an animation table.
2 Connect (see page 249) to the logic controller or launch the simulator (see page 268).
3 Select a value in the Time Base list. This determines the refresh frequency of the Trace window
(see page 231), in seconds.
4 Click Trace.
The Trace window is displayed.
Memory Objects
Overview
Memory objects include:
Memory bits
Memory words
Constant words
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click Memory objects → Constant words.
3 In Constant word properties, click Export.
Result: The Export constants window appears.
4 In the Export constants window:
1. Select the Export type.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click Memory objects → Constant words.
3 In Constant word properties, click Import.
Result: The window Import constants appears.
4
Click and navigate to the folder containing the file (*.csv) and double-click the file.
5
To modify the import parameters, click Import options and choose the separator used in
the .csv file: Semicolon or Comma.
6 Click Import.
System Objects
Overview
System objects are specific to the logic controller. For details, refer to the Programming Guide of
your logic controller.
I/O Objects
Overview
The following object types are hardware-specific and depend on the logic controller being used:
Digital inputs and outputs
Analog inputs and outputs
Advanced function blocks such as fast counters, high-speed counters, and pulse generators.
For more details, refer to the Programming Guide and Advanced Functions Library Guide of your
logic controller.
Network Objects
Presentation
Network objects are used to communicate via EtherNet/IP, Modbus TCP, or Modbus Serial
IOScanner.
There are two types of network object for EtherNet/IP communication:
%QWE: Input Assembly
%IWE: Output Assembly
There are two types of network object for Modbus TCP communication:
%QWM: Input registers
%IWM: Output registers
The following types of network object are used for the Modbus Serial IOScanner:
%IN: Digital inputs (IOScanner)
%QN: Digital outputs (IOScanner)
%IWN: Input registers (IOScanner)
%QWN: Output registers (IOScanner)
%IWNS: IOScanner Network Diagnostic Codes
NOTE: References to input and output are from the point of view of the EtherNet/IP master or
Modbus TCP client.
For more information on how to configure network objects, refer to the programming guide for your
logic controller.
Software Objects
Overview
SoMachine Basic supports the following generic software objects:
Object Description
Timers Used to specify a period of time before doing something, for example,
triggering an event.
Counters Provides up and down counting of events.
Messages Allows communication with external devices.
LIFO/FIFO Registers A memory block that can store up to 16 words of 16 bits each in FIFO or LIFO
modes.
Drums Operates on a principle similar to an electromechanical Drum Controller,
which changes step according to external events. On each step, the high
point of a cam gives a command which is executed by the logic controller.
Shift Bit Registers Provides a left or right shift of binary data bits (0 or 1).
Step Counters Provides a series of steps to which actions can be assigned.
Schedule Blocks Used to control actions at a predefined month, day, and time.
RTC Used to read the time and date from the RTC, or update the RTC in the logic
controller with a user-defined time and date.
PID Allows regulation of the Proportional Integral Derivative (PID) function.
Data Logging Allows to permanently store data from objects or strings.
Grafcet Steps Lists the Grafcet bit address (%Xi) variables in order to add or modify symbols
or comments.
These function blocks are described in the SoMachine Basic Generic Functions Library Guide
(see SoMachine Basic, Generic Functions Library Guide).
PTO Objects
Overview
The PTO objects provide the function blocks used for programming the PTO functions. The PTO
function blocks are categorized as:
Motion task tables
Allows you to configure individual PTO movements in an ordered sequence, and visualize an
estimated global movement profile.
Motion
These function blocks control motions of the axis. For example, power to axis, movement of the
axis, and so on.
Administrative
These function blocks control the status and diagnostics of the axis movement. For example,
status and value of actual velocity, actual position, axis control detected errors, and so on.
For more details on the PTO function blocks, refer to the Advanced Function Library Guide of your
controller.
Drive Objects
Overview
Drive objects control ATV drives and other devices configured on the Modbus Serial IOScanner or
Modbus TCP IOScanner.
Refer to the Advanced Functions Library Guide of your logic controller.
Communication Objects
Overview
Communication objects are used to communicate with Modbus devices, send/receive messages
in character mode (ASCII), and to send/receive SMS messages.
For details, refer to the chapter Communication Objects.
Overview
Search and Replace allows you to find all occurrences of an object used anywhere in a program
and optionally replace it with a different object.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
It is also possible to invoke the search and replace function from various other locations in
SoMachine Basic, for example, by right-clicking on an entry in an animation table (see page 145)
and selecting Search & Replace.
2 You can use any of the following methods to display the Search and Replace window:
Click Search and Replace in the Tools tab of the Programming window.
Right-click on a rung or a selected item in the rung and click Search and Replace in the
context menu that appears.
Right-click on a line in the properties window of any object and click Search and Replace in
the context menu that appears.
This graphic shows the Search and Replace window:
3 In the Find box type the object or symbol name to find. The Find field is pre-filled if the search
was started by right-clicking on a selected item in a rung or an item in a properties window of an
object.)
You can use the following wildcard characters:
Asterisk (*). Replaces 0 or more characters in the search term. For example, %MW1* would
find both %MW1 and %MW101.
Question mark (?). Replaces exactly 1 character in the search term. For example, typing
COIL?2 would find COIL12 but not COIL012
4 Optionally, in the Replace box type a replacement object or symbol name.
5 Select Program to search for the item within the source code of the current program.
Select Comments to search for the item within program comments.
Step Action
6 Click Search or Replace. You can also press ENTER to start the search.
Replace button is enabled only when the replacement object or symbol name is given in the
Replace box.
All items found are listed in the Results list:
7 Optionally, select Show symbols to display instead any symbols defined for objects:
8 Click on any of the listed results to jump directly to the line of code in the program.
Cross Reference
Overview
The cross reference view allows to display the program contained in a POU. If an object depends
on another object of the same POU, the corresponding rungs are displayed.
The cross reference view is available in both offline and online modes.
The following table presents the element of the cross reference view:
Element Description
POU Name of the POU containing the object.
Rung Name of the rung containing the object.
Code view Programming code of the object.
Symbol view Symbol of the object.
Symbol List
Overview
You can display a list of all the symbols that have been associated with objects in your program.
All objects with symbols are displayed, with the exception of symbols automatically associated with
system bits (%S) and system words (%SW). You can overwrite symbols and comments on system
bits (%S) and system words (%SW) using the System Objects properties, or by importing your own
symbols list (see below). Overwritten symbols then appear in the symbol list.
Defining and Using Symbols (see page 76) describes how to create symbols and use them in your
programs.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click Symbol list.
Result: The Symbol list window is displayed. For each item the following information is displayed:
Used: Whether the symbol is currently being used in the program.
Address: The address of the object with which the symbol is associated.
Symbol: The symbol name.
Comment: The comment associated with this object, if defined.
Assign symbol: SoMachine Basic automatically assigns a symbol to each object used without
symbol of the following types: %M, %MW, %MD, %MF, %S, %SW, %KW, %KD, %I, %IW, %Q, and %QW.
Delete default symbols: Deleting default symbols assigned.
Import: Importing symbols.
Export: Exporting symbols.
Step Action
1 Click Delete default symbols.
2 Click Yes on the confirmation window that appears.
Result: All default symbols assigned are deleted.
NOTE: If an object with a default symbol assigned is no longer used in the program, it retains its
default symbol.
Importing Symbols
Step Action
1 Either click the Import button or right-click anywhere in the list of symbols and choose Import
symbols.
Result: The Import Symbols window is displayed.
2 Browse and select the File path of the Comma Separated Values (CSV) file containing the
symbols to import.
3 Optionally, click Import options and configure formatting options for the imported symbols:
Step Action
4 Click Import.
Result: All symbols in the selected CSV file are created and displayed in the Symbol list window
with the specified formatting options.
If errors are detected during import, a report is displayed listing them:
5 Click Save to write the contents of the report to a plain text (.txt) file.
Step Action
1 Either click the Export button or right-click anywhere in the list of symbols and choose Export
symbols You are prompted to save changes.
The Export Symbols window is displayed.
2 Browse and select the File path and File name of the Comma Separated Values (CSV) file to
be created.
3 Optionally, click Export options and configure formatting options for the exported values:
4 Click Export.
Result: A CSV file is created with the specified formatting options.
Step Action
1 Start Vijeo-Designer.
2 Create/open a project in Vijeo-Designer.
3 Click the Project tab in the Navigator window, right-click IO Manager and select New Driver...
Insert.
Result: The New Driver window opens.
4 Select a driver from the Driver list, select an equipment from the Equipment list, and click OK.
For example:
Driver: Modbus TCP/IP
Equipment: Modbus Equipment
NOTE: If you have already shared the symbols with a Vijeo-Designer project before and if you
change the existing symbols and/or add new symbols to your project in SoMachine Basic, you
must update the symbols in the Vijeo-Designer project.
To update the symbols in a Vijeo-Designer project, first define new symbols and/or modify the
existing symbols, save the SoMachine Basic project, and open the Vijeo-Designer project and
follow these steps:
Step Action
1 In the Project tab of the Navigator window, right-click Variables and select Update Link.
Result: The equipment driver and the existing symbols are updated.
2 Right-click Variables again, select New Variables from Equipment and select the new variables
that you have created in the SoMachine Basic project.
Result: The new variables from the SoMachine Basic project are added in the list of variables.
These variables appear under the Variables node in the Project tab of the Navigator window.
Overview
You can display information about the controller memory used by the application, program, and
associated user data.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click Memory Consumption.
The Memory Consumption window is displayed.
Field Description
Last Compilation The date and time on which the program was last compiled.
NOTE:
This value is updated whenever:
Program lines
Field Description
Used The number of lines of code being used by the program.
Remaining The maximum number of lines available for the program minus the number of lines
being used.
NOTE: There is no direct link between the number of program lines used and the total number of lines of IL code in
rungs in the Programming tab. For example, 2 lines of IL code could generate 6 program lines.
Cache memory
Field Description
Periodic and Event tasks The amount of cache memory occupied by periodic and event tasks, in bytes.
Reserved for system The amount of cache memory reserved for system use, in bytes.
Memory remaining The amount of cache memory available to the program, in bytes.
RAM memory
Field Description
Master task and subroutines The amount of RAM memory occupied by the program master task and all
subroutines, in bytes.
Configuration The amount of RAM memory used to contain the hardware configuration of the logic
controller and expansion modules, in bytes.
Memory objects The amount of RAM memory occupied by memory objects (memory bits, memory
words, and constant words) used by the application, in bytes.
Display The size of the Remote Graphic Display application, in bytes. Zero if the logic
controller does not support the Remote Graphic Display.
Memory remaining The amount of RAM memory available to the program, in bytes.
Section 6.12
Ladder Language Programming
Introduction
Ladder Diagrams are similar to relay logic diagrams that represent relay control circuits. The main
differences between the 2 are the following features of Ladder Diagram programming that are not
found in relay logic diagrams:
All inputs and binary logic bits are represented by contact symbols ( ).
All outputs and binary logic bits are represented by coil symbols ( ).
Numerical operations are included in the graphical Ladder instruction set.
In the above illustration, all inputs associated with a switching device in the relay logic diagram are
shown as contacts in the Ladder Diagram. The M1 output coil in the relay logic diagram is
represented with an output coil symbol in the Ladder Diagram. The address numbers appearing
above each contact/coil symbol in the Ladder Diagram are references to the locations of the
external input/output connections to the logic controller.
Programming Grid
Each Ladder rung consists of a grid of up to 255 rows by 11...30 columns, organized into 2 zones
as shown in the following illustration:
Grid Cells
Cells allow you to position graphical elements in the grid. Each cell in the grid is delimited by 4 dots
at the corners of the cell.
Grid Zones
By default, the Ladder Diagram programming grid is divided into 2 zones:
Test zone
Contains the conditions that are tested in order to perform actions. Consists of columns 1 to n-
1, where n is the number of configured columns and contains contacts, function blocks, and
comparison blocks.
Action zone
Contains the output or operation that will be performed according to the results of the tests of
the conditions in the Test zone. Consists of columns n-1 to n, where n is the number of
configured columns and contains coils and operation blocks.
Use the following objects at the top of the Ladder editor to customize the content of the editor:
Object Description
IL>LD Switch from displaying all rungs in IL to Ladder.
LD>IL Switch from displaying all rungs in Ladder to IL.
- Delete one column from the Ladder grid. The button is deactivated when the minimum
number of columns (11) is reached.
+ Add one column to the Ladder grid. The button is deactivated when the maximum
number of columns (30) is reached.
Display/hide Click to display or hide comments in the rungs.
comments If T is released, the comments display on two lines.
T Click to display or hide the symbols in the rungs. If Display/hide comments is released,
the symbols are displayed on two lines.
DEC/HEX Only displayed in online mode. Click to display alternately numerical values in the rungs
in decimal or hexadecimal format.
1 - New POU Double-click to edit the default POU name that appears in the Tools → Master Task area
of the screen.
Comment Double-click to type text to associate a comment with this POU.
Zoom slider Zoom or unzoom the Ladder Editor.
You can zoom or unzoom by using the shortcut Ctrl + mouse wheel.
The position of the zoom remains even if you navigate through the project.
Offine Mode
The selected rungs are displayed in a darker green background:
Online Mode
When in online mode:
Unchanged rungs appear with a green background.
Rungs added or modified while in online mode appear with an orange background:
Rungs with no modifiable elements are locked and appear with a gray foreground:
Introduction
Instructions in Ladder Diagrams are inserted by dragging and dropping graphic elements from the
toolbar that appears above the programming workspace into a grid cell.
Step Action
1 Click the graphic element on the toolbar to insert. If the graphic element is a menu, the graphic
items in the menu appear; click the menu item to insert.
2 Move the mouse to the position in the rung to insert the graphic element and click.
Note: Some elements have to be inserted in the test or action zones of the rung; refer to the
description of individual graphic elements for details.
3
If necessary, click the [Selection mode] graphic element on the toolbar to reset the
selection.
Rungs
Use the following graphic elements to manage the rungs in a program:
Insert a rung Inserts a new empty rung immediately above the currently
(see page 97) selected rung.
Delete the rung Removes the currently selected rung from the program. If the rung
(see page 99) is not empty, you are asked to confirm that you want to delete the
contents of the rung.
Branching Modes
Use the following graphic elements to manage the branch in Ladder diagram:
Contacts
Use the following graphic elements to insert contacts (one row high by one column wide).
Normally closed LDN Passing contact when the controlling bit object is at
contact state 0.
Contact for detecting a LDR Rising edge: detecting the change from 0 to 1 of the
rising edge controlling bit object.
Contact for detecting a LDF Falling edge: detecting the change from 1 to 0 of
falling edge the controlling bit object.
Comparison Block
Comparison blocks are placed in the test zone of the programming grid. The block may appear in
any row or column in the test zone as long as the entire length of the instruction resides in the test
zone.
The graphic element for comparison blocks takes up 2 cells (1 row high by 2 columns wide).
Boolean Operations
The graphic element for boolean operations takes up 1 cell (1 row high by 1 column wide).
Functions
Function blocks always appear in the first row of the Ladder Diagram programming grid; no Ladder
instructions or lines of continuity may appear above or below the function block. Ladder test
instructions lead to the left side of the function block, and test instructions and action instructions
lead from the right side of the function.
The graphic elements of function blocks can only be placed in the test zone and require 2, 3, or 4
rows by 2 columns of cells.
Coils
The coil graphic elements can only be placed in the action zone and take up 1 cell (1 row high and
1 column wide).
Inverse coil STN The associated bit object takes the negated value
of the test zone result.
Set coil S The associated bit object is set to 1 when the result
of the test zone is 1.
Reset coil R The associated bit object is set to 0 when the result
of the test zone is 1.
Operation Blocks
The operation block element placed in the action zone and occupy 2 columns by 1 row:
Falling edge FALLING n (1) Evaluates the falling edge of the expression.
Comparison Blocks
The operands must be of the same object types: words with words, float with float, etc.
Proceed as follows:
Step Action
1
NOTE:
If the application is configured with a functional level (see page 87) of at least Level 6.0:
You can use up to five operands and three level of parentheses in a comparison block.
A minimum of 20 memory words (%MW) must be available to use multiple operands in the master
task. If using multiple operands in a periodic task as well, an additional 20 memory words must
be available.
NOTE: Multiple operand expressions cannot be used in event tasks.
Operation Blocks
The Operation Block graphical symbol can be inserted in any position in a Ladder Diagram rung
except the first column, as it cannot be used as the first contact in a rung.
If more than one Operation Block graphical symbol is used in a Ladder Diagram rung, they must
be placed in series. Operation Block instructions cannot be used in parallel.
NOTE:
If the application is configured with a functional level (see page 87) of at least Level 5.0:
You can use up to five operands and three levels of parentheses in a operation block. The
operands must be of the same object types: words with words, float with float, etc.
A minimum of 20 memory words (%MW) must be available to use multiple operands in the master
task. If using multiple operands in a periodic task as well, an additional 20 memory words must
be available.
To insert an operation block graphical symbol in a Ladder Diagram rung:
Step Action
1
Click the Operation Block button on the toolbar.
2 Click anywhere the rung to insert the Operation Block.
3
Click the Selection mode button on the toolbar.
4 Double-click the operation expression line.
The Smart Coding (see page 188) button appears at the end of the line. Click this button
for help selecting a function and with the syntax of the instruction.
5 Type a valid Instruction List operation or assignment instruction and press ENTER.
For example: %MF10 :=
((SIN( %MF12 + 60.0 ) + COS( %MF13 )) + %MF10 ) + 1.2
You can modify the expression in online mode. Refer to Online Modifications (see page 240).
The Smart Coding Assistant appears when you click the Smart Coding button in the operation
expression line:
Proceed as follows:
Step Action
1 Optionally, filter the list by category of function:
All types
ASCII
Floating point
I/O objects
Floating Point
Numerical Processing
Table
PID
User-defined function
Adding Comments
Step Action
1 Insert a graphic element into the rung.
2 If necessary, click the selection pointer or press Esc.
3 Double-click the Comment line at the top of the graphic element.
4 Type the comment for the graphic element and press ENTER.
Programming of Outputs
Physical outputs, as well as logical bits, should only be modified once in the program. In the case
of physical outputs, only the last value scanned is taken into account when they are updated.
WARNING
UNINTENDED EQUIPMENT OPERATION
Do not use the equipment configured and programmed by this software in safety-critical machine
functions, unless the equipment and software are otherwise designated as functional safety
equipment and conforming to applicable regulations and standards.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Syntax Validation
As you are programming, SoMachine Basic validates the syntax of the instructions, the operands,
and their associations.
In order to perform the same function, program the instructions in the following manner:
Section 6.13
Instruction List Programming
Introduction
A program written in Instruction List language consists of a series of instructions that are executed
sequentially by the logic controller. Each instruction is represented by a single program line and
consists of the following components:
Line number
Current value (in online mode only)
Instruction operator
Operand(s)
Optional comment
Line Numbers
Four-digit line numbers are generated when you create a new program line and managed
automatically by SoMachine Basic.
Current Values
WhenSoMachine Basic is in online mode (see page 31) (connected to a logic controller and the
program is running), SoMachine Basic displays the current value of object types in the IL editor
window.
The displayed values of these objects are updated.
Instruction Operators
The instruction operator is a mnemonic symbol, called an operator, that identifies the operation to
be performed using the operands. Typical operators specify Boolean and numerical operations.
For example, in the sample program above, LD is the mnemonic for the LOAD operator. The LOAD
instruction places (loads) the value of the operand %M1 into an internal register called the boolean
accumulator.
There are basically 2 types of operators:
Test operators
These set up or test for the conditions necessary to perform an action. For example, LOAD (LD)
and AND.
Action operators
These perform actions as a result of preceding logic. For example, assignment operators such
as STORE (ST) and RESET (R).
Operators, together with operands, form instructions.
Operands
An operand is an object, address, or symbol representing a value that a program can manipulate
in an instruction. For example, in the sample program above, the operand %M1 is an address
assigned the value of an embedded input of the logic controller. An instruction can have from 0 to
3 operands depending on the type of instruction operator.
Operands can represent the following:
Controller inputs and outputs such as sensors, push buttons, and relays.
Predefined system functions such as timers and counters.
Arithmetic, logical, comparison, and numerical operations.
Controller internal variables such as system bits and words.
Comments
To add comments to an Instruction List program
Step Action
1 Optionally, click the comment box that appears at the top of the rung above the first line 0000
and type a comment for the rung.
2 Insert an instruction line.
3 Click in the Comment area to the right of the instruction.
4 Type the comment and press Enter.
Use the following objects at the top of the IL editor to customize the content of the editor:
Object Description
IL>LD Switch from displaying all rungs in IL to Ladder.
LD>IL Switch from displaying all rungs in Ladder to IL.
- Delete one column from IL grid. The button is deactivated when the minimum number of
columns (11) is reached.
+ Add one column to IL grid. The button is deactivated when the maximum number of
columns (30) is reached.
Display/hide Click to display or hide comments in the rungs.
comments
T Click to alternately display objects in address mode or symbol mode.
DEC/HEX Only active in online mode. Click to alternately display numerical values in the rungs in
decimal or hexadecimal format.
1 - New POU Double-click to edit the default POU name that appears in the Tools → Master Task area
of the screen.
Comment Double-click to type text to associate a comment with this POU.
Zoom slider Zoom or unzoom the Ladder Editor.
You can zoom or unzoom by using the shortcut Ctrl + mouse wheel.
The position of the zoom remains even if you navigate through the project.
Introduction
Instruction List binary instructions normally have only one explicit operand; the other operand is
implied. The implied operand is the value in the Boolean accumulator. For example, in the
instruction LD %I0.1, %I0.1 is the explicit operand. An implicit operand is loaded in the
accumulator and the previous value of the accumulator is overwritten by the value of %I0.1. This
value now becomes the implicit value for the subsequent instruction.
Operation
An Instruction List instruction performs a specified operation on the contents of the accumulator
and the explicit operand, and replaces the contents of the accumulator with the result. For
example, the operation AND %I1.2 performs a logical AND between the contents of the
accumulator and the input 1.2 and will replace the contents of the accumulator with this result.
All Boolean instructions, except for Load, Store, and Not, operate on 2 operands. The value of
the 2 operands can be either True or False, and program execution of the instructions produces a
single value: either True or False. Load instructions place the value of the operand in the
accumulator while Store instructions transfer the value in the accumulator to the operand. The
Not instruction has no explicit operands and simply inverts the state of the accumulator.
Introduction
The Instruction List language consists of the following types of instructions or block of instructions:
Test Instructions
Action instructions
Function blocks
This section identifies and describes the instructions for List programming.
Test Instructions
This table describes test instructions in List language.
LDN Load Not Loads the negated boolean value of the operand into
the accumulator.
LDR Load Rising Loads the boolean value of the operand into the
accumulator when the value changes from 0 to 1
(rising edge). The value of the accumulator thereafter
will be loaded with 0 until the next transition of the
operand from 0 to 1.
LDF Load Falling Loads the boolean value of the operand into the
accumulator when the value changes from 1 to 0
(falling edge). The value of the accumulator thereafter
will be loaded with 1 until the next transition of the
operand from 1 to 0.
AND And The Boolean result is equal to the AND logic between
the Boolean result of the previous instruction (which is
stored in the accumulator) and the status of the
operand. The result of the instruction is then itself
implicitly loaded into the accumulator overwriting the
previous value.
ANDN And Not The Boolean result is equal to the AND logic between
the Boolean result of the previous instruction (which is
stored in the accumulator) and the inverse (negated)
status of the operand. The result of the instruction is
then itself implicitly loaded into the accumulator
overwriting the previous value.
Action Instructions
This table describes action instructions in List language.
STN Store Not The associated operand takes the reverse value of the
test zone result.
Function Blocks
This table describes function blocks in List language.
Using Parentheses
Introduction
With AND and OR logical operators, parentheses are used to nest logical instructions. In so doing,
they specify divergences (branches) in the Ladder editor. Parentheses are associated with
instructions as follows:
Opening the parentheses is associated with the AND or OR operator.
Closing the parentheses is an instruction (an operator with no operand) which is required for
each open parenthesis.
Rung Instruction
0 LD %I0.0
AND %I0.1
OR %I0.2
ST %Q0.0
1 LD %I0.0
AND( %I0.1
OR %I0.2
)
ST %Q0.1
NOTE: Refer to the reversibility procedure (see SoMachine Basic, Generic Functions Library
Guide) to obtain the equivalent Ladder Diagram.
Rung Instruction
0 LD %I0.0
AND %I0.1
OR( %I0.2
AND %I0.3
)
ST %Q0.0
NOTE: Refer to the reversibility procedure (see SoMachine Basic, Generic Functions Library
Guide) to obtain the equivalent Ladder Diagram.
Modifiers
This table lists modifiers that can be assigned to parentheses.
NOTE: The '[' modifier can also be used in conjunction with other instructions serving as an
operator. For more uses of the '[' in other instructions, refer to the Introduction to Numerical
Operations.
Nesting Parenthesis
It is possible to nest up to 32 levels of parentheses.
Observe the following rules when nesting parentheses:
Each open parenthesis must have a corresponding closed parenthesis.
Labels (%Li:), subroutines (SRi:), JMP instructions (JMP), and function block instructions must
not be placed in expressions between parentheses.
Store instructions (ST, STN, S, and R) must not be programmed between parentheses.
Stack instructions (MPS, MRD, and MPP) cannot be used between parentheses.
Rung Instruction
0 LD %I0.0
AND( %I0.1
OR(N %I0.2
AND %M3
)
)
ST %Q0.0
Rung Instruction
1 LD %I0.1
AND( %I0.2
OR( %I0.5
AND %I0.6
)
AND %I0.4
OR( %I0.7
AND %I0.8
)
)
ST %Q0.0
NOTE: Refer to the reversibility procedure (see SoMachine Basic, Generic Functions Library
Guide) to obtain the equivalent Ladder Diagram.
Section 6.14
Grafcet (List) Programming
Introduction
Grafcet (List) programming in SoMachine Basic offer a simple method of translating a control
sequence in to steps. You can translate control sequences in to Grafcet steps and then use these
steps in a program using Grafcet instructions.
The maximum number of Grafcet steps depend on the controller. The number of steps active at
any one time is limited only by the total number of steps.
Grafcet Instructions
A SoMachine Basic Grafcet program has the following instructions:
=*= POST Not =*= POST POST PROCESSING This instruction defnes the post-
applicable (implicit operand) processing and end sequential
processing.
-*- x -*- x STEP This instruction defines a step in
the program for transition
validation.
# Not # DEACTIVATE This instruction deactivates the
applicable CURRENT STEP current step in the program.
(implicit operand)
Introduction
A SoMachine Basic Grafcet (List) program has the following parts:
Preprocessing
Sequential processing
Post-Processing
Preprocessing
Preprocessing consists of the following:
Power returns
Error management
Changes of operating mode
Pre-positioning Grafcet steps
Input logic
In this example, the system bit %S21 is set to 1 with the rising edge of input %I0.6 (Rung1). This
disables the active steps and enables the initial steps:
Preprocessing begins with the first line of the program and ends with the first occurrence of a =*=
or -*- instruction.
System bits %S21, %S22, and %S23 are dedicated to Grafcet control. Each of these system bits is
set to 1 (if needed) by the application, normally in preprocessing. The associated function is
performed by the system at the end of preprocessing and the system bit is then reset to 0 by the
system.
Sequential Processing
Sequential processing takes place in the chart (instructions representing the chart):
Steps
Actions associated with steps
Transitions
Transition conditions
Example:
Sequential processing ends with the execution of the POST instruction or with the end of the
program.
Post-Processing
Post-processing consists of the following:
Commands from the sequential processing for controlling the outputs
Interlocks specific to the outputs
Example:
NOTE: Grafcet (List) instructions can only be used in the master task of a program.
Step Action
1 In a POU, select a rung and click the drop-down button below the rung sequence identifier Rungx,
where x is the rung number in a POU.
Step Action
1 In a POU, select a rung in your program.
2
Click (to deactivate the current step and optionally activate a specified step) or (to
deactivate the current step and to deactivate the specified step) and insert this element in the action
zone of the rung (refer to Inserting a Graphic Element (see page 179)).
3 Alternatively, Press ALT+A to use ACTIVATE instruction or press ALT+D to use DEACTIVATE
instruction in the rung.
Result: The activate or deactivate ladder symbol appears in the action zone of the rung.
Press ENTER to insert this element.
4 In the program rung, double-click Address field on the Grafcet activate or deactivate symbol and
enter the Grafcet bit address (%Xi, where i is the step number).
For example, %X4 refers to the step 4 of the Grafcet program. If %X4 is the address for the deactivate
symbol, step 4 will be deactivated when the output of the rung, in which this symbol is used, is true.
NOTE: Current step is deactivated in every case.
Section 6.15
Grafcet (SFC) Programming
Introduction
Grafcet (SFC) is a graphical programming language that describes a chronological order of
execution of discrete tasks, known as steps. The order in which steps are executed is determined
by transitions connecting the steps.
Transition: A boolean expression evaluated between steps. It is the link between two or more
steps. The boolean expression is defined in a single transition rung written in the Ladder/IL
programming languages.
The following diagram is an example of a Grafcet (SFC) POU with an initial step, one regular step,
and two transitions:
1 Initial step
2 Transition from step 1 to step 2
3 Regular step
4 Transition from step 2 back to step 1. An arrow is displayed on the link to indicate that the order of step
execution is not the default left to right, top to bottom.
3. The logic controller scans the steps (loop from lowest defined step number to highest defined
step number). When a scanned step is activated, the associated step code is called.
4. When a transition code activates or deactivates a step, this action is placed respectively in the
activation or deactivation list for the next task cycle.
5. When the last active step code is executed, the Grafcet monitor ends.
Multi-Token Behavior
SoMachine Basic Grafcet POU is multi-token which does not conform to IEC 61131-3.
The initial situation is controlled by the steps defined as initial steps.
Multiple steps can be active at the same time in a Grafcet POU.
The active signal status processes take place along the directional links, triggered by switching one
or more transitions. The direction of the process follows the directional links and runs from the
underside of the predecessor step to the top side of the successive step.
A transition is evaluated if the steps immediately preceding it are active. Transitions are not
evaluated if the steps immediately preceding them are not active.
A transition is triggered when the associated transition conditions are satisfied.
Triggering a transition marks as deactivated the immediately preceding steps that are linked to the
transition, and marks as activated the immediately following steps.
The real activation or deactivation of the steps is performed at the beginning of each master task
cycle (see Grafcet monitor (see page 217)).
If more than one transition condition in a row of sequential steps has been satisfied, then one step
is processed per cycle.
If a step is activated and deactivated at the same time, then the step will be or will remain activated.
More than one branch can be active with alternative branches.
The branches to be run are determined by the result of the transition conditions of the transitions
that follow the alternative branch. Branch transitions are processed in parallel.
The branches with satisfied transitions are triggered.
Subroutine calls can be used in step actions.
Refer to the description of System Bits (see Modicon M221, Logic Controller, Programming Guide)
for further details.
Overview
The Grafcet Graphical Editor is used for programming in Grafcet (SFC).
To display the Grafcet Graphical Editor, select any n - Grafcet node in the tree view.
The Grafcet Graphical Editor contains a grid of cells. Each cell contains one step, one transition,
or both.
The minimum size of a Grafcet POU is one step.
The maximum number of steps is 96 for the application.
To detach the window, click the button in the top right corner of the Grafcet Graphical Editor
window.
Drag the title bar of the window to move it. Close the window to revert to the normal view.
Inserting Steps
Double-click in any grid cell to add a step, or right-click in any grid cell and choose Add a step from
the contextual menu that appears.
You can see the Number of Grafcet steps used in the top right corner of the Grafcet Graphical
Editor window.
You can move a step by dragging and dropping in another grid cell.
Step Action
1 Right-click on the step to copy and choose Copy from the contextual menu that appears.
2 Right-click in an empty grid cell and choose Paste.
Result: A copy of the step appears. Copies of Ladder/IL rungs associated with the step are added
below the corresponding Step subnode in the tree view.
Creating Transitions
Link steps together to define the order of execution of steps.
To create a transition between two steps:
Step Action
1 Move the mouse over the bottom of a step.
Result: A green block appears
2 Drag the mouse to the step you want to link to.
3 Release the mouse button.
Result: A link and transition appear.
Editing Labels
To edit the default labels of any step or transition.
Step Action
1 Double-click the label of any Grafcet (SFC) step or transition.
2 Type the new name for the step or transition element and press ENTER.
For example, change the default Step_1 label to INIT.
Step Action
1 Either:
Double-click a step in the Grafcet Graphical Editor.
Select a Step node in the tree view, where n is the step number.
Step Action
3 Program the rung in the Ladder or IL programming language and create additional rungs if
needed, as described in Ladder Language Programming (see page 172) or Instruction List
Programming (see page 195).
4 To display the Grafcet Graphical Editor again, either:
Step Action
1 Either:
Double-click a transition in the Grafcet Graphical Editor.
Select a Transitions → Trn node in the tree view
Result: The Grafcet Graphical Editor is closed and a Ladder language rung displayed.
2 Program the rung in the Ladder or IL programming language, as described in Ladder Language
Programming (see page 172) or Instruction List Programming (see page 195).
Function blocks can be used in transition rungs, except those that have no outputs, for example,
Shift Bit Register, Step Counter.
When a function block is used, the END_BLK instruction must immediately follow the ENDT
instruction, for example:
NOTE: The rung ends with an ENDT (end transition) instruction. This instruction cannot be
selected or modified and must be the last instruction in the rung (unless the rung contains a FB).
Step Action
3 To display the Grafcet Graphical Editor again, either:
Undo/Redo
You can use the Undo or Redo buttons on the toolbar for a maximum of 10 actions stored.
Step Action
1 In the Grafcet Graphical Editor:
Select a step or transition and press the DELETE key.
Right-click on the step or transition and choose Delete the selected items in the contextual
menu.
Result: The selected step or transition is deleted.
NOTE: You cannot delete a step or transition from the tree view.
Branching
Introduction
A Grafcet (SFC) POU can contain branches.
Two types of branch exist:
Parallel branching: two or more steps are processed simultaneously when the preceding
transition is true.
Alternative branching: one or more alternative steps are processed depending on the result of
evaluating the preceding transition conditions (multi-token behavior).
Parallel Branching
A parallel branch allows a transition from a single step to multiple steps.
A parallel branch must be preceded and followed by a step.
Parallel branches can contain nested alternative branches or other parallel branches.
The following figure shows an example Grafcet POU with 4 steps before creation of parallel
branching:
Step Action
1 Create a transition between Step 1 and Step 2: move the mouse to the bottom of Step 1, then drag
to Step 2 and release the mouse button. A new link and transition appears.
2 Draw a link between Step 3 and the transition: move the mouse to the top of Step 3, then drag to
the transition and release the mouse button.
Result: A horizontal double line appears below the existing transition (see the figure that follows).
NOTE: To create a link between a transition and a step that is higher up in the POU, draw the link
starting from the step and dragging to the transition.
3 To rejoin the branch with the main processing branch, create a transition between Step 2 and Step 4.
4 Draw a link between Step 3 and the new transition: move the mouse to the bottom of Step 3, then
drag to the transition and release the mouse button.
Result: A horizontal double line appears above the transition (see the figure that follows).
The following figure shows a Grafcet POU after the creation of parallel branching:
Notice that the horizontal lines before and after the branched areas are double lines.
Alternative Branching
An alternative branch must begin and end with a transition.
Alternative branches can contain nested parallel branches or other alternative branches.
With multi-token behavior, more than one parallel switch can be made from the transitions. The
branches to be run are determined by the result of the transition conditions of the transitions that
follow the alternative branch. The transitions of the branches are processed. The branches with
satisfied transitions are triggered.
If alternative branches need to be switched exclusively (mono-token behavior), then this must be
defined explicitly within the transition code.
The following figure shows an example Grafcet POU with 3 steps before creation of alternative
branching for Step 3 and Step 4:
Step Action
1 Create a transition between Step 1 and Step 4.
Result: A new link and transition appears.
2 Draw a transition between Step 1 and Step 3: move the mouse to the bottom of Step 1, then drag
to Step 3 and release the mouse button.
Result: A new link and transition appears, with the branch above the existing transition (see the
figure that follows).
3 Draw a transition between Step 3 and Step 4.
Result: A new link and transition appears, with the branch below the existing transition between
Step 1 and Step 4 (see the figure that follows).
The following figure shows the Grafcet POU after creation of alternative branching:
Notice that the horizontal lines before and after the branched area are single lines.
You can add only one Grafcet POU in the same Grafcet Graphical Editor:
Crossed Links
You can have crossed links for the following reasons:
Alternative (logical OR) branching (fork or junction)
To save space on the cell grid. When lines cross there is no interaction between the lines and
it is used only for symbolic representation.
Section 6.16
Debugging in Online Mode
Trace Window
Overview
The Trace window allows you to display in graphical form the values of specific analog and/or
digital variables (limited to 12 hours of continuous recording). Each animation table can contain 1
trace at any one time. Up to 8 objects can be added to a trace. You can export the data to a file for
further analysis.
NOTE: The minimum configurable refresh period for the trace is 1 second (see page 145).
Therefore, changes in values of boolean variables between master task cycles, for example,
cannot be traced.
Select Elapsed time to set tracing start time to 00:00:00, or Controller time to use the time and date
of the logic controller as the start time of the trace.
The Trace window displays separate graphs for each data type selected for tracing in the animation
table:
Integer and real values appear in the Numerical trace area.
All numerical values share the same scale on the graph.
Select Auto scale for values to automatically adjust the vertical axis to display all values.
Otherwise, type Maximum and Minimum values to display a fixed range of values.
NOTE: You can type either integer or real values for Maximum and Minimum
Binary values appear in the Logical trace area.
Each binary value is traced on an individual scale of 0 and 1.
Modifying Values
Introduction
When in online mode, SoMachine Basic allows you to modify the values of certain object types.
Online updating is only possible if the object has read/write access. For example:
The value of an analog input cannot be modified.
The value of the Preset parameter (%TM0.P object) of a Timer function block can be updated.
Refer to the description of objects in the SoMachine Basic Generic Functions Library Guide or the
Programming Guide of your hardware platform for information on which object types have
read/write access.
To modify the value of an object, add it to an animation table (see page 147) and set its properties
as required.
Forcing Values
Overview
When in online mode, you can force the values of certain boolean object types to False (0) or True
(1). This allows you to set addresses to specific values and prevent the program logic or an external
system from changing the value. This function is used for the debugging and fine-tuning of
programs.
To force the values of boolean objects when in online mode, either:
Use an animation table (see page 145)
Modify boolean object values (see page 237) directly in the Ladder (LD) editor
NOTE: Forcing is performed at the end of the scan cycle. The image table of the outputs, however,
may be modified due to the logic of your program, and may appear in animation tables and other
data displays contrary to the forced state you selected. At the end of the scan, this will be corrected
by acting upon the requested forced state and the physical output will indeed reflect that forced
state.
Overview
It is possible to modify program while in online mode by:
Adding rungs (see page 236)
Modifying rungs (see page 236)
Modifying Boolean Values in Ladder (see page 237)
Modifying Function Block Parameters (see page 239)
Modifying Constant Words (see page 239)
Modifying Object Values in Operation and Comparison Blocks (see page 240)
Deleting rungs (see page 240)
Sending Modifications (see page 241)
Any changes made must then be sent to the logic controller (see page 241).
Adding Rungs
You can add new rungs (see page 97) to your program while in online mode.
NOTE: The application must be configured with a functional level (see page 87) of at least Level
4.1 to be able to add new rungs in online mode.
The following limitations apply until the new rung has been successfully sent to the logic controller:
Rungs containing errors ( ) cannot be sent to the logic controller.
Rungs must be written in Ladder language and cannot be converted to IL until they have been
successfully compiled.
Rungs cannot contain Grafcet (List) steps.
Labels cannot be added to the rung.
Modifying Rungs
You can modify program rungs, in both the Instruction List (IL) and Ladder (LD) editors, while in
online mode. However, the Grafcet (SFC) is not available online. Modified rungs appear with an
orange background (see page 177).
There are limits to the type of editing that you may perform and the instructions that you may edit,
depending on whether the logic controller is in RUNNING or STOPPED state. These limits help
protect the state of the controller and the integrity of the program.
You can switch the display of a rung between Instruction List (IL) and Ladder (LD), even when in
online mode.
NOTE: This table does not take into account the program structure modifications, which are not
allowed in online mode.
Move the mouse cursor over the object in the Ladder editor. If the object can be both written to 1/0
and forced to 1/0, the following buttons appear below the graphical element:
If the object can be written to 1/0 but not forced, the following buttons appear:
If the object can be forced but not written to 1/0, the following buttons appear:
The button corresponding to the present status of the object is shown in dark gray (F1 in the
example above).
To remove forcing, either:
Click again on the F0/F1 button.
Use an animation table (see page 145).
NOTE: Forcing is performed at the end of the scan cycle. The image table of the outputs, however,
may be modified due to the logic of your program, and may appear in animation tables and other
data displays contrary to the forced state you selected. At the end of the scan, this will be corrected
by acting upon the requested forced state and the physical output will indeed reflect that forced
state.
Step Action
1 In the Programming window, move the mouse cursor over the function block in the Ladder
editor.
Result: The Configuration tooltip appears.
The following illustration shows an example of the Configuration tooltip:
Step Action
1 In the Tools tab of the Programming window, choose Memory objects → Constant words.
2 Click %KW, %KD, or %KF to select the type of constant to modify.
3 Modify the value as required.
You can import the constant values. Refer to Importing the constant word properties
(see page 153).
4 Click Apply.
Result: The modified value is sent to the logic controller.
Step Action
1 In the Programming window, move the mouse cursor over an operation or comparison block in
the Ladder editor.
Result: The online modification tooltip appears:
Click .
Press Enter.
Deleting Rungs
You can delete rungs from your program while in online mode.
NOTE: The application must be configured with a functional level (see page 87) of at least Level
4.1 to delete rungs in online mode.
The following limitations apply:
The rung must be displayed in Ladder language.
The rung cannot be the only rung in a POU or Free POU. This limitation does not apply to
Grafcet POUs.
The rung must not contain Grafcet (List) steps, be a subroutine rung, or contain any of the
following instructions:
JMP
JMPC
JMPCN
END
ENDC
ENDCN
G7
Sending Modifications
In IL, the modifications, when allowed, are automatically sent to the logic controller after validation
of the edited IL line. If the modification is not allowed, a message appears.
In Ladder, the modifications are not sent automatically. When in online mode, a button bar
appears:
Click Send to send the modifications to the logic controller. This button is only active when the
program has been modified in online mode and contains no errors.
Click Rollback to discard the changes made in online mode and restore the original rung (that is,
the version stored in the logic controller). The background color of the rung changes from orange
to green. This button is only active when the program has been modified in online mode.
Click Download non program data to download updates to non program data (project properties,
symbols, comments, animation tables, and so on) to the logic controller. This button is only active
when the non program data is not synchronized between the PC and the logic controller, for
example, if an animation table has been modified prior to entering online mode.
Click Backup to synchronize the contents of the flash memory and the RAM memory on the logic
controller. This status is shown in the Controller Info window (see page 263). During the backup,
the Ethernet communications in progress (for example, using Modbus TCP or the EXCH3
instruction) are temporarily suspended.
NOTE: Be sure that online modifications have been saved to flash memory prior to creating a
clone.
Rungs that are modified are evaluated for their validity in the context of whether the controller is in
RUNNING or STOPPED state. Modifications that would cause runtime errors, or change the
structure of the program memory, are rejected in online mode.
Chapter 7
Commissioning
Commissioning
Section 7.1
Overview of the Commissioning Window
Introduction
The Commissioning window allows you:
Login to or logout from a logic controller.
Upgrade (or downgrade) the logic controller firmware.
Manage logic controller memory (for example, by performing backup and restore operations).
Display information about the logic controller, expansion module (references and, for TM3
expansion modules, firmware versions), and cartridges you are connected to.
Manage the real time clock (RTC) of the logic controller.
NOTE: The application must be configured with a functional level (see page 87) of at least Level
5.0 to be able to view the firmware version of TM3 Analog expansion modules.
Section 7.2
Connect to a Logic Controller
Overview
Click Connect on the Commissioning window to manage the connection with the logic controller.
Connected Controllers
Two lists of logic controllers are displayed:
1. Local Devices
Displays all logic controllers connected to the PC:
with the physical COM ports of the PC (COM1, for example)
with USB cables
through the virtualized COM ports (by USB-to-serial converters or Bluetooth dongles)
with a modem connection that you choose to add manually. Use a modem connection
between SoMachine Basic and a logic controller for monitoring purposes only.
NOTE: If a COM port is selected and the Keep Modbus driver parameters check box is ticked,
the communication is established with the parameters defined in the Modbus driver.
2. Ethernet Devices
Displays all logic controllers that are accessible by Ethernet (on the same subnet and not under
a router or any device that blocks UDP broadcasts). This list includes logic controllers that are
automatically detected by SoMachine Basic as well as any controllers that you choose to add
manually.
Step Action
1 In the Remote lookup field, type the IP address of the logic controller to add, for example
12.123.134.21
2 Click Add to add the device to the Ethernet Devices list.
For more details on the installation and setting of SR2MOD03 modem, refer to the SR2MOD02 and
SR2MOD03 Wireless Modem User Guide (see page 12).
To manually add a modem connection to the Local Devices list:
Step Action
2
Click (Add modem configuration button) to open the Modem configuration window.
Result: The Modem configuration window appears.
3 Select the COM port of the modem from the drop-down list:
Step Action
1
Click (Refresh Devices button) to refresh the list of connected Ethernet devices.
2 Select one of the logic controllers in the Local Devices or Ethernet Devices lists.
If a controller is connected by Ethernet on the same network cable than your PC, the IP address
of the controller appears in the list. Selecting the IP address in the list enables (IP Address
Configuration button). Click this button to change the IP address of the controller.
NOTE: If you tick the check box Write to post configuration file, the Ethernet parameters are
modified in the post configuration file and kept after a power cycle.
3
If required, click (Start Flashing LEDs button) to flash the LEDs of the selected controller
to identify the controller physically by its flashing LEDs. Click this button again to stop flashing
the LEDs.
NOTE: You can only use the Start Flashing LEDs button for logic controllers that are
automatically added (with Auto discovery protocol enabled option selected).
4 Click Login to log in to the selected controller.
If the logic controller is password protected, you are prompted to provide the password. Type the
password and click OK to connect.
Result: A status bar appears showing the connection progress.
5 When connected, the protection status of the application currently stored in the logic controller
appears in the Selected Controller area of the window.
When the connection is successfully established, details about the logic controller appear in the
Selected Controller area of the window:
The firmware revision
The logic controller reference number
The reference numbers of all expansion modules connected to the logic controller
The current state of the connection between SoMachine Basic and the logic controller.
6 SoMachine Basic verifies whether the hardware configuration of the logic controller is compatible
with the configuration of the current project.
If so, the application can be downloaded to the controller. The PC to Controller (download) button
is enabled and you can proceed to download the application (see page 252).
SoMachine Basic verifies whether the non-program data (symbols, comments, animation tables,
and so on) stored in the logic controller is the same as that of the current application. If not, an
advisory message is displayed.
SoMachine Basic also verifies whether a more recent firmware version is available and, if so,
displays a link you can click to begin the firmware upgrade.
Proceed as follows:
Step Action
1 In the message, click on Compare computer and controller applications.
Result: A popup window informs you that you must disconnect from the logic controller before
viewing the comparison.
2 Click OK to continue and disconnect from the logic controller.
Step Action
3 The Application comparison window is displayed:
Comparisons are available of the following areas of the configuration and application:
IL code
Hardware configuration
Software configuration
Display application
4 Optionally, click Export to Excel file to save the comparison in spreadsheet format.
Step Action
1 Click Connect in the commissioning tree of the Commissioning window.
2 Select one of the logic controllers in the Local Devices or Ethernet Devices lists.
3 Click Login to log in to the selected controller.
If the logic controller is password-protected, type the password and click OK to connect.
4
Optionally, click Download Settings.
If you do not want memory words (%MW) and memory bits (%M) to be reset after the download,
clear the Reset memories option.
NOTE: The option in Memories is only available for logic controllers with firmware version
greater than or equal to 1.3.3.y.
The options in Program Properties and Project Properties are only available for logic controllers
with firmware version greater than or equal to 1.4.1.y.
5 Click PC to Controller (download).
If the PC to Controller (download) button is not available, confirm whether:
The application stored in the logic controller is identical to the SoMachine Basic application.
The hardware configuration of the logic controller system is not compatible with the
configuration in the SoMachine Basic application.
6 If the non-program data of the current application is not identical to that stored in the controller,
the non-program data only is downloaded to the controller.
7 If the application has been configured to Start in Run, a hazard message is displayed and
prompts you to confirm that the application has been so configured.
Click OK to confirm the download of the application or click Cancel and modify the configuration.
8 Click OK to continue the transfer and overwrite the logic controller application.
Result: A status bar appears indicating the connection status.
9 To run the application you have downloaded, click Run controller and click OK to confirm the
action.
If a message appears informing you that the operating mode cannot be changed, click Close and
verify the RUN/STOP switch on the logic controller, and/or, the RUN/STOP input as they may
prevent the controller from passing into RUNNING. Otherwise, refer to the Hardware Guide of
your logic controller for details.
To display the Download options, click Download settings in the Commissioning window.
Each setting is selected by default. If you select or clear an option in online mode, click PC to
Controller (download) to download the modifications.
In online mode, if you modify the name or comments of a POU, rung, or IL line and if these
corresponding options are selected in Download Settings, the download is done automatically.
Reset Memories option is selected by default. This option is available in offline and online mode.
When Reset Memories is selected, the memory words and bits are reset to 0 at application
download.
When Reset Memories is cleared, the memory words and bits keep their values.
If the amount of allocated memory is different for the application residing in PC memory than that
of the application residing in the memory of the logic controller, the memory is managed as follows:
If allocated %MWx in the application of the logic controller is greater than that allocated %MWx in
the application residing in the PC memory, then the allocation of the application on the PC is
used, and the additional %MWx words are set to 0.
If allocated %MWx in the application of the logic controller is less than that allocated %MWx in the
application residing in the PC memory, then the additional %MWx words are removed from the
memory space.
If there is no application in the logic controller, %MW are set to 0. The same rules are applied for
%M. Download settings are project-dependent and saved with the project.
Uploading an Application
Follow these steps to upload the application stored in the logic controller to SoMachine Basic:
Step Action
1 Click Connect in the commissioning tree of the Commissioning window.
2 Select one of the logic controllers in the Local Devices or Ethernet Devices lists.
3 Click Login to log in to the selected controller.
If the logic controller is password protected, type the password and click OK to connect.
4 Click Controller to PC (upload).
If the Controller to PC (upload) button is not available, confirm whether the application stored in
the logic controller is identical to the SoMachine Basic application.
5 Click OK to confirm upload from the logic controller.
Result: A status bar appears indicating the connection status. When the transfer completes, the
application is uploaded from the logic controller into SoMachine Basic.
NOTE: The value of the Reset Memories option is not saved when you upload an application.
Section 7.3
Controller Update
Controller Update
Overview
You can download firmware updates to the logic controller either directly from SoMachine Basic or
using an SD card.
Step Action
1 Verify that you are not connected to the logic controller when using Firmware Update.
2 Click Commissioning → Controller Update.
3 Click Update.
The first page of the executive loader (OS loader) wizard appears.
If you remove power to the device, or there is a power outage or communication interruption during
the transfer of the application, your device may become inoperative. If a communication
interruption or a power outage occurs, reattempt the transfer. If there is a power outage or
communication interruption during a firmware update, or if an invalid firmware is used, your device
will become inoperative. In this case, use a valid firmware and reattempt the firmware update.
NOTICE
INOPERABLE EQUIPMENT
Do not interrupt the transfer of the application program or a firmware change once the transfer
has begun.
Re-initiate the transfer if the transfer is interrupted for any reason.
Do not attempt to place the device (logic controller, motion controller, HMI controller or drive)
into service until the file transfer has completed successfully.
Failure to follow these instructions can result in equipment damage.
Section 7.4
Memory Management
Memory Management
Overview
In SoMachine Basic, you can back up, restore, or erase the different elements from or to the logic
controller to which you are connected.
Backup, restore, and erase options are available only in online mode.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that the controller you are connected to is the intended target before performing the
erase or the restore operation.
Verify the state of security of your machine or process environment before performing the
erase or the restore operation from a remote location.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Step Action
1 Log in to the logic controller.
2 Select Memory Management in the left-hand area of the Commissioning window.
3 In the Action list, choose Backup from Controller.
4 To back up to a PC: Under Destination, choose PC. Click the browse button, navigate to the
folder in which to write the backup file.
or
To back up to an SD card: Under Destination, choose Controller SD Card folder. Insert an SD
card into the SD card slot of the logic controller.
NOTE: The SD card must not be empty or contain a script.cmd file to avoid creating a clone
or the script execution (see Modicon M221, Logic Controller, Programming Guide).
Step Action
5 Select the elements to back up by selecting the options:
Backup firmware
Backup program
Backup memory values
Backup log file
Backup post configuration file
When Backup memory values is selected in a PC backup, specify the First Memory Bit, Last
Memory Bit, First Memory Word, and Last Memory Word to be included in the backup.
6 Click Backup from Controller to begin the backup operation.
The elements are saved to the specified PC folder or SD card as an SD card image (.smbk).
A report window appears displaying a list of information or detected error messages about the
backup operation.
NOTE: If you choose to back up memory values, you can initiate a backup while the logic controller
is in RUNNING state. However, depending on the number of memory variables you specify to be
included in the backup, the backup may not be accomplished between logic scans. As a
consequence, the backup would not necessarily be coherent because the memory variables value
can be modified from one scan to another. If you wish to have a consistent set of values for the
variables, you may need to first put the logic controller into STOPPED state.
Restoring
Follow these steps to restore logic controller elements from a PC:
Step Action
1 Log in to the logic controller.
2 Select Memory Management in the left-hand area of the Commissioning window.
3 In the Action list, choose Restore to Controller.
4 Choose the source folder that contains the backup files on the PC.
5 Select the elements you want to restore to the logic controller.
6 Click Restore to Controller to begin the restore operation.
A report window appears displaying a list of information or detected error messages about the
restore operation.
Incomplete file transfers, such as data files, application files and/or firmware files, may have
serious consequences for your machine or controller. If you remove power, or if there is a power
outage or communication interruption during a file transfer, your machine may become inoperative,
or your application may attempt to operate on a corrupted data file. If a an interruption occurs,
reattempt the transfer. Be sure to include in your risk analysis the impact of corrupted data files.
WARNING
UNINTENDED EQUIPMENT OPERATION, DATA LOSS, OR FILE CORRUPTION
Do not interrupt an ongoing data transfer.
If the transfer is interrupted for any reason, re-initiate the transfer.
Do not place your machine into service until the file transfer has completed successfully,
unless you have accounted for corrupted files in your risk analysis and have taken appropriate
steps to prevent any potentially serious consequences due to unsuccessful file transfers.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
To restore a backup from a controller SD card, refer to the Programming Guide of the logic
controller.
Step Action
1 Select Memory Management in the left-hand area of the Commissioning window.
2 In the Action list, choose Erase in Controller.
3 Select the elements you want to erase in the logic controller.
If you select the Erase post configuration file option, the post configuration file is deleted
immediately upon clicking Erase in Controller. In order to preserve any existing Ethernet
connections, however, deletion of the file is only taken into account by the controller following an
Ethernet reinitialization, that is, any of the following events:
Unplugging and replugging the Ethernet cable
Step Action
1 If you are connected to a logic controller, click Logout in the Commissioning window.
2 Select Memory Management in the left-hand area of the Commissioning window.
3 In the Action list, choose Create Controller image.
4 In Destination → PC, click the browse button and navigate to the folder in which to write the
image file.
You can choose an SD card inserted in your PC as destination.
5 Select the elements to copy by selecting:
Include firmware
Include program
6 If you want to overwrite the post configuration file, select Erase post configuration file.
7 Click Create Controller image.
Result: The following folders and files are created:
script.cmd
usr/app/*.smbk
sys/os/*.mfw
8 If you created the controller image on your PC, copy the files in an SD card.
Step Action
1 If you are connected to a logic controller, click Logout in the Commissioning window.
2 Select Memory Management in the left-hand area of the Commissioning window.
3 In the Action list, choose Read image.
4 In Source → PC, click the browse button and navigate to the folder containing the image file
(.smbk).
Read program is selected by default. To read a image file, you have to select it.
5 Click Read image to read the program and open a project.
Section 7.5
Controller Info
Controller Info
Controller Information
Overview
Click Controller info in the left-hand area of the Commissioning window to display the following
information on the present state of the logic controller:
Executable RAM: This option verifies if a valid application is stored in the RAM memory of the
logic controller. This information can also be obtained from within a program by testing bit 14 of
the system word %SW7 (see Modicon M221, Logic Controller, Programming Guide).
Protected RAM: This option is checked if the application in the RAM memory of the logic
controller is password-protected. This information can also be obtained from within a program
by testing bit 8 of the system word %SW7 (see Modicon M221, Logic Controller, Programming
Guide).
Forced I/O: This option is checked if 1 or more digital inputs or outputs on the logic controller
are being forced to a specific value (see page 147). In this case, system bit %S14 (see Modicon
M221, Logic Controller, Programming Guide) (IO force activated) is set to 1.
RAM synchronized with Flash: This option is checked, if the application stored in non-volatile
memory is not identical to the application in RAM memory.
The option is unchecked if either:
online modifications to the application have not yet been sent to the logic controller (by
clicking the Backup button on the Programming tab).
the logic controller has not been initialized since the modifications were made (by clicking the
Initialize controller button on the toolbar).
Status: The present state of the logic controller.
This information can also be obtained from within a program by testing the system word %SW6.
For more information on controller states, see the programming guide of your logic controller.
Last stopped on: The date and time that the logic controller was last stopped (STOPPED,
HALTED, and so on).
This information can also be obtained from within a program by testing the system word %SW54
through %SW57.
Last stopped reason: Displays the reason for the most recent stop of the logic controller.
This information can also be obtained from within a program by testing the system word %SW58.
Section 7.6
RTC Management
RTC Management
Overview
The RTC Management window enables you to set the real time clock (RTC) of the logic controller.
This is only possible if SoMachine Basic is connected to a logic controller that supports an RTC.
Step Action
1 Select the RTC Management option in the left-hand area of the Commissioning window.
2 If in online mode, the Current controller time is displayed.
Choose the mode for setting the logic controller time:
Manual : This mode displays the date and time and lets you manually choose what date and
time to set in the logic controller.
Automatic : This mode sets the time in the logic controller to the current time of the PC on
which SoMachine Basic is installed.
3 Click Apply.
Chapter 8
Simulator
Simulator
Introduction
SoMachine Basic simulator allows you to:
Simulate a connection between the PC, the logic controller, and any expansion modules.
Run and test a program without a logic controller and expansion modules, connected to the PC
physically.
The simulator replicates the behavior of the logic controller and is a virtual logic controller that you
connect to with SoMachine Basic.
NOTE: Security parameters (see Modicon M221, Logic Controller, Programming Guide) are not
applied when using the simulator.
Once you launch the simulator, you can connect, run, stop and other associated actions that you
would accomplish while connected to a physical logic controller.
NOTE: The simulator supports up to 2 connections; one for SoMachine Basic and other one for
data purpose (for example, HMI communication).
Step Action
1 Ensure that the program is valid. Otherwise, the simulator launch is interrupted with a compilation
error detected message that appears on the screen.
2 Launch the simulator by any of the following methods:
Click Launch simulator in the commissioning task area.
Press CTRL+B in the Commissioning window.
After the connection between the PC and the virtual logic controller has been successfully
established (refer to How to Use the SoMachine Basic Simulator (see page 280)), SoMachine
Basic Simulator I/O manager window appears on the screen:
Overview
Simulator I/O manager window has the following components:
LED status:
To monitor the LED status of a simulated controller.
Input/output status:
To control the inputs and outputs when the program is running.
Click the pin symbol on the left-top of this window to pin or unpin the window to the foreground.
Click the minimize symbol on the right-top of this window to minimize the window in taskbar.
LED Status
The PWR, RUN, ERR, and STAT LEDs are simulated in the SoMachine Basic simulator I/O
manager window as they would appear on a connected base controller.
The following are the LED states displayed in the simulator I/O manager window of a simulated
logic controller:
Input/Output Status
Simulator I/O manager window lets you monitor and control the I/Os of a controller and expansion
module when a program is running.
The inputs and outputs are displayed in a list of numbers. This list depends on the I/Os of the
selected controller and expansion module. For example, if your controller has n digital inputs, the
number list will display number starting from 0...(n-1), where each number corresponds to the
digital input at the corresponding input channel.
For a controller, the I/Os displayed are:
IN: Digital inputs.
OUT: Digital outputs.
ANA: Analog inputs.
NOTE: The analog I/Os are displayed with their current values on right-hand side of the analog
input number.
Digital I/O status is identified by the text color of the I/O numbers:
Green: I/O is set to 1.
Black: I/O is set to 0.
Overview
Simulator Time Management window has the following components:
Date / Time simulation range for the execution of the program in the simulator:
Beginning Date and Time
End Date and Time
Stop at the End check box (stop the execution of the program when the End Date and Time
are reached)
Time control scroll bar:
To move the simulation of the passage of time manually forward or back
Control buttons:
To reset, jump back, jump forward, or end the time management associated with the RTC
Increment bar:
To fix the rate of the simulated passage of time relative to real time
Step Action
1 Right-click on the top bar of the Simulator I/O Management window.
2 Choose Time Management.
Increment Bar
The increment bar allows you to establish a relative increment for Jumping forward or back the
RTC value when using the elapsed time control buttons. By clicking the bar you can set various
increments that are relative to the simulation range you have established.
Jump Forward Allows you to move forward the time and date from its current value in increments
established by the Increment bar.
Jump Back Allows you to reverse the time and date from its current value in increments established
by the Increment bar.
End Allows you to jump the date and time to that which is set in the End time/date field.
Overview
When in online mode, SoMachine Basic simulator I/O manager window allows you to:
Modify values of the inputs.
Trace the outputs.
Step Action
1 Click the digital input number in the simulator I/O manager window to change the discrete input value.
Result: Text color of the input number changes. Digital input values are identified by the text color:
Green: I/O is set to 1.
Black: I/O is set to 0.
Follow these steps for bulk operation of modifying digital input values together:
Step Action
1 Double-click the digital input number in the simulator I/O manager window,
Result: Set Discrete Inputs window listing all digital inputs, appears on the screen:
Step Action
2 In the Operation area of the Set Discrete Inputs window, click:
Set all to 0: To set the value of all inputs to 0.
Set all to 1: To set the value of all inputs to 1.
Result: If the checkbox is selected, input value is set to 1. If not selected, input value is set 0.
3 Alternatively, in the All Discrete Inputs area of the Set Discrete Inputs window, click the checkbox
corresponding to the input to modify the values individually.
4 Click OK to save the changes and exit from the Set Discrete Inputs window.
Step Action
1 Double-click the analog input number in the simulator I/O manager window,
Result: Set Analog Inputs window listing all analog inputs, appears on the screen:
2 In the All Analog Inputs area of the Set Analog Inputs window, double-click the value field in the
Change Value column corresponding to the input to be modified.
3 Enter the value in the range 0...1023 and press ENTER.
4 Alternatively, in the Set Analog Inputs window, select an input from the Inputs list and move the slider
in the Change Value area to adjust the input value between 0...1023.
When you move the slider from left to right, the value increases and vice versa.
5 Click OK to save the changes and exit from the Set Analog Inputs window.
Step Action
1 Double-click the output number in the simulator I/O manager window,
Result: Tracing window appears on the screen.
Step Action
2 Click Configure button to select the outputs to trace.
Result: Tracing Configuration window appears on the screen.
3 In the Select checkbox column, click the checkboxes corresponding to the outputs to trace.
4 Select the Sample Interval from the drop-down menu to set the sample time interval for output tracing:
1 second
5 seconds
10 seconds
20 seconds
Step Action
5 Click Ok to save and exit from the Tracing Configuration window.
Result: Selected outputs are added to the Tracing window that displays tracing of the outputs with
simulated values:
Procedure
Follow these steps to run the SoMachine Basic Simulator to test your program:
Step Action
1 Ensure that you have a valid program by checking the status message in the status area (for more
information, refer to Status Area (see page 55)). The program status should be No errors.
You can also run SoMachine Basic simulator when the program status is Advice.
2 Launch the simulator (refer to Accessing the Simulator (see page 268)).
3 Run the controller.
In the Commissioning window, select Connect in the commissioning tree and then click Run
controller button in the commissioning task area.
4 Command your program using the simulator main window (refer to Control Buttons (see page 273)).
5 Check the LED status in the simulator main window (refer to LED Display (see page 271)).
6 Check the status of the inputs/outputs in the simulator I/O manager window (refer to Input/Output
Status (see page 271)).
7 Check the LED status in the simulator I/O manager window (refer to LED Status (see page 270)).
8 Modify the I/O values as required (refer to Modifying Values Using the Simulator (see page 275)).
9 Trace the outputs as required (refer to Tracing the Outputs (see page 277)).
10 Stop the controller.
In the Commissioning window, select Connect in the commissioning tree and then click Stop
controller button in the commissioning task area.
11 Stop the simulator.
In the Commissioning window, select Connect in the commissioning tree and then click Stop
controller button in the commissioning task area or press CTRL+W to exit from the simulator.
Procedure
Prior to launching the HMI simulation in Vijeo-Designer, first start the logic controller simulator in
SoMachine Basic (see page 268).
Follow these steps to launch the simulation in Vijeo-Designer:
Step Action
1 Start Vijeo-Designer.
2 Open the Vijeo-Designer project that contains the symbols from a SoMachine Basic project.
NOTE: If the Vijeo-Designer project does not exist, create a project in Vijeo-Designer and share the
symbols with the SoMachine Basic project. For more information, refer to Sharing Symbols Between
a SoMachine Basic Project and a Vijeo-Designer Project (see page 168).
3 Click the Project tab in the Navigator window, right-click the equipment node under the IO Manager
node, and select Configuration.
Result: The Equipment Configuration window opens.
4 Enter the IP Address and click OK.
NOTE: The IP address must be a local host address or local address of your PC. For example,
127.0.0.1
5 Start Device Simulation Tool.
6 Click the Variables tab and select the check boxes of the variables to include in the simulation.
NOTE: If the View All icon is selected, all variables selected in the Variables tab are displayed in the
Simulation tab.
7 Click the Simulation tab.
8 Select a variable, select an operation for the variable, and then select the Active check box.
NOTE: Only one simulation operation can be applied to any given variable at a time.
9 Define the parameters of the variable simulation operation.
10 Click the Simulation icon to start the simulation.
11 Change the variable values as required during the simulation:
For a slider operation, you can change the value by moving the slider, moving the wheel on your
mouse, or typing the arrow keys on the keyboard.
For a toggle operation, click Set or Reset to write the corresponding string to the variable.
Chapter 9
Saving Projects and Closing SoMachine Basic
Saving a Project
Overview
SoMachine Basic projects can be saved as files to the local PC. This file has the extension *.smbp
and contains:
The source code of the program contained on the Programming tab
The current hardware configuration contained on the Configuration tab
Settings and preferences set in the SoMachine Basic project.
Step Action
1
Click Save on the toolbar, or press Ctrl-S
2 If this is the first time you have saved the project, browse and select the folder in which to store
the project file.
3 Type the name of the project file and click Save.
Step Action
1
Click the menu arrow next to the Save button on the toolbar and choose Save as.
2 Browse and select the folder in which to store the project file.
3 Type the new name of the project file and click Save.
Overview
SoMachine Basic projects can be saved as templates. The project is then listed on the Templates
tab of the Start page (see page 46). You can then use the project as the starting point for new
projects.
Step Action
1
Click the menu arrow next to the Save button on the toolbar and choose Save as template.
By default, templates are saved to the folder: C:\Users\Public\SoMachine Basic\Examples.
2 Type the name of the project.
3 Choose Sample Project Files (*.smbe) as the file Type and click Save.
Overview
To exit SoMachine Basic, click the Close button in the top right-hand corner of the SoMachine
Basic window.
You can also click the Exit button on the Start page window.
EIO0000001354 12/2017
Appendices
Appendix A
Converting Twido Projects to SoMachine Basic
Overview
When you open a TwidoSoft or TwidoSuite (see page 39) project, it is automatically converted to
a SoMachine Basic project. A conversion report is generated listing any aspects of the TwidoSoft
or TwidoSuite project that could not be automatically converted to the equivalent SoMachine Basic
functionality.
The following provides additional conversion information.
WARNING
UNINTENDED EQUIPMENT OPERATION
Always verify that your application program operates as it did prior to the conversion, having
all the correct configurations, parameters, parameter values, functions, and function blocks as
required.
Modify the application as necessary such that it conforms to its previous operation.
Thoroughly test and validate the newly compiled version prior to putting your application into
service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Program using the Remote Link Consider modifying the program to The Remote Link protocol allows the use of
Protocol use the following M221 Logic a Twido controller as a remote I/O module
Controller features: on a serial line.
Modbus TCP mapping on the
Ethernet network
Modbus serial protocol using
Communication function blocks
(see SoMachine Basic, Generic
Functions Library Guide)
System Bits
This table presents Twido system bits that have either no equivalent on the M221 Logic Controller,
or a different purpose:
System Words
This table presents Twido system words that have no equivalent on the M221 Logic Controller, or
a different purpose:
For more details, refer to System Words %SW (see Modicon M221, Logic Controller, Programming
Guide).
Appendix B
SoMachine Basic Keyboard Shortcuts
Glossary
!
%S
According to the IEC standard, %S represents a system bit.
%SW
According to the IEC standard, %SW represents a system word.
A
animation table
A software table that displays the real-time values of objects such as input bits and memory words.
When SoMachine Basic is connected to a logic controller, the values of certain object types in
animation tables can be forced to specific values. Animation tables are saved as part of SoMachine
Basic applications.
application
A program including configuration data, symbols, and documentation.
C
configuration
The arrangement and interconnection of hardware components within a system and the hardware
and software parameters that determine the operating characteristics of the system.
controller
Automates industrial processes (also known as programmable logic controller or programmable
controller).
E
EtherNet/IP
(Ethernet industrial protocol) An open communications protocol for manufacturing automation
solutions in industrial systems. EtherNet/IP is in a family of networks that implement the common
industrial protocol at its upper layers. The supporting organization (ODVA) specifies EtherNet/IP
to accomplish global adaptability and media independence.
expansion bus
An electronic communication bus between expansion I/O modules and a controller.
F
flash memory
A non-volatile memory that can be overwritten. It is stored on a special EEPROM that can be
erased and reprogrammed.
Free POU
A programmable object unit (POU), typically containing library functions, that can be programmed
and updated independently of the master task of a program. Free POUs are available to be called
from within programs as subroutines or jumps. For example, the periodic task is a subroutine that
is implemented as a Free POU.
G
GRAFCET
The functioning of a sequential operation in a structured and graphic form.
This is an analytical method that divides any sequential control system into a series of steps, with
which actions, transitions, and conditions are associated.
I
I/O
(input/output)
instruction list language
A program written in the instruction list language that is composed of a series of text-based
instructions executed sequentially by the controller. Each instruction includes a line number, an
instruction code, and an operand (see IEC 61131-3).
L
ladder diagram language
A graphical representation of the instructions of a controller program with symbols for contacts,
coils, and blocks in a series of rungs executed sequentially by a controller (see IEC 61131-3).
M
master task
A processor task that is run through its programming software. The master task has 2 sections:
IN: Inputs are copied to the IN section before execution of the master task.
OUT: Outputs are copied to the OUT section after execution of the master task.
N
non-program data
Data in a SoMachine Basic application that is not directly used by the program, such as project
properties, symbols, and comments.
P
post configuration
(post configuration) An option that allows to modify some parameters of the application without
changing the application. Post configuration parameters are defined in a file that is stored in the
controller. They are overloading the configuration parameters of the application.
POU
(program organization unit) A variable declaration in source code and a corresponding instruction
set. POUs facilitate the modular re-use of software programs, functions, and function blocks. Once
declared, POUs are available to one another.
program
The component of an application that consists of compiled source code capable of being installed
in the memory of a logic controller.
R
RTC
(real-time clock) A battery-backed time-of-day and calender clock that operates continuously, even
when the controller is not powered for the life of the battery.
S
symbol
A string of a maximum of 32 alphanumeric characters, of which the first character is alphabetic. It
allows you to personalize a controller object to facilitate the maintainability of the application.
symbolic addressing
The indirect method of addressing memory objects, including physical inputs and outputs, used in
programming instructions as operands and parameters by first defining symbols for them using
these symbols in association with the programming instructions.
In contrast to immediate addressing, this is the preferred method because if the program
configuration changes, symbols are automatically updated with their new immediate address
associations. By contrast, any immediate addresses used as operands or parameters are not
updated (refer to immediate addressing).
T
TCP
(transmission control protocol) A connection-based transport layer protocol that provides a
simultaneous bi-directional transmission of data. TCP is part of the TCP/IP protocol suite.
U
user defined function
It allows you to create your own functions with one or more input parameters, local variables, and
a return value. The user-defined function can then be called in operation blocks. A user-defined
function is stored as part of the project and downloaded to the logic controller as part of the
application.
user defined function block
It allows you to create your own function blocks with one or more input and outputs, parameters,
and local variables. User-defined function blocks are stored as part of the project.
W
watchdog
A watchdog is a special timer used to ensure that programs do not overrun their allocated scan
time. The watchdog timer is usually set to a higher value than the scan time and reset to 0 at the
end of each scan cycle. If the watchdog timer reaches the preset value, for example, because the
program is caught in an endless loop, an error is declared and the program stopped.
Index
A comments
adding to Instruction List, 197
accumulator, 199
adding to Ladder Diagrams, 191
action zone, 175
commissioning, 30
addressing
Commissioning window, 244
symbolic, 76
connecting to a logic controller, 246
allocating memory in controller, 78
communication objects, 161
allocation mode, 78
comparison block
animation tables, 145
graphic elements for, 181
application
comparison blocks
behavior, configuring, 85
inserting IL expressions in, 186
definition of, 28
comparison expression
downloading to controller, 252
inserting in Ladder Diagram rungs, 186
protecting with a password, 63
compile, date and time of last, 170
protecting with password, 66
configuration
uploading from logic controller, 254
current, 69
whether password-protected, 263
replacing logic controller in, 70
assignment instructions
configuring
inserting in Ladder Diagram rungs, 187
application behavior, 85
hardware components with Configuration
window, 69
B master task, 122
backup memory contents, 241 periodic task duration, 134
bill of material (BOM), printing, 59 project properties, 63
Boolean tasks and scan , 89
accumulator, 199 connecting to a logic controller, 246
Boolean operators contacts
graphic elements for, 181 graphic elements for, 180
branching modes graphical representation of inputs, 173
graphic element, 180 controller time, displaying in trace, 231
buttons, toolbar, 53 converting Twido projects to SoMachine Ba-
sic, 289
copying and pasting
C Grafcet POUs, 100
cache memory, consumption of, 170 POU, 103
catalog, 69 creating
replacing logic controller with reference Free POU, 102
from, 70 Grafcet POUs, 100
coils creating projects, 28
graphic elements for, 182 customizing, Ladder Editor, 57
graphical representation of outputs, 173
D 256
forcing values
debugging in online mode, 230
in animation tables, 145
developing programs, stages of, 29
of I/Os, 263
development stages, 30
Free POU
digital inputs
assigning to an event source, 139
configuring as event sources, 137
assigning to events, 105
downloading
assigning to periodic task, 105
application directly to controller, 44
Free POU
firmware updates, 256
creating, 102
user application to controller, 252
Free POU
downloading non-program data, 241
for periodic task, 132
Drive objects, 160
introduction to, 93
Free POUs
removing, 104
E function blocks
end/jump graphic element, 182
graphic elements, 183 functional levels, 87
Ethernet
configuration using post configuration file,
263 G
event source
general settings, 57
assigning subroutine as, 139
Grafcet, 208
types of, 137
graphical elements, 183
event tasks
how to use the instructions, 213
managing, 139
instructions, 208
configuring, 89
post-processing, 212
overview, 136
preprocessing, 209
events
program structure, 209
since last cold restart, 141
sequential processing, 210
triggering subroutines with, 137
Grafcet (SFC)
EXCEPTION state
Grafcet Graphical Editor, 219
fallback behavior, 87
Grafcet POU
expansion modules
copying and pasting, 100
supported devices, 24
creating, 100
exporting
removing, 101
symbol list, 167
renaming, 101
trace, 233
graphic elements
Ladder diagrams, 179
grid lines, style of in Ladder Editor, 57
F
fallback
behavior, specifying, 87 H
values, 87
hardware components, configuring, 69
firmware updates, 256
hardware tree, 69
firmware, downloading updates to controller,
O periodic task
assigning Free POU to, 105
objects
configuring, 89
definition of, 75
configuring duration of, 134
network, 157
post configuration
to trace in animation table, 145
using Ethernet parameters from, 263
updating values of in real time, 145
using serial line parameters from, 263
offline mode
post configuration file, writing Ethernet pa-
displayed in status area, 55
rameters to, 43
overview, 31
POU
online mode, 78
copying, 103
animation tables in, 145
Free, 132
debugging, 230
managing with tasks, 94
displayed in status area, 55
overview, 93
editing values in animation table, 147
pasting, 103
overview, 31
printing reports, 59
updating RTC in, 265
priority level, of events, 136
operands, 199
program
operating modes, 31
compiling, 53
operation blocks
definition of, 28
graphic element, 183
displaying number of lines in, 170
inserting assignment instructions in, 187
jumps, 192
operations
program development, stages of, 29
inserting in Ladder Diagram rungs, 187
program organization unit (POU), 93
outputs
program, configuring fallback behaviors, 87
modifying, 192
programming
best practices, 192
grid, 175
P languages, supported, 26
parentheses workspace, 72
modifiers, 205 project
nesting, 205 configuring properties, 63
using in Ladder diagrams, 193 definition of, 28
using in programs, 204 displaying report for, 59
password protecting with password, 65
protecting an application , 66 saving, 284
removing from application, 66 saving as a template, 285
removing from project, 65 templates, 46
requiring to open project file, 65 projects
whether application is protected with, 263 creating, 28
password-protecting an application, 63 properties, 63
period, scan, 123 PTO objects, 159
periodic pulse width (TON) , 123
scan mode, 123
scan period, 134
tasks, 132
sections
R in events, 136
RAM memory of master task, 122
executable contains application, 263 selection
RAM memory, consumption of, 170 graphic element, 180
registering SoMachine Basic software, 36 sending program modifications, 241
relay circuits, representing as Ladder dia- serial line
grams, 173 configuration using post configuration file,
removing 263
Free POUs, 104 settings
Grafcet POUs, 101 general, 57
removing password protection, 65, 66 sharing
renaming symbol list, 168
a Grafcet POU, 101 sharing symbols
replacing with Vijeo Designer project, 168
logic controller in configuration, 70 simulator, 268
reports accessing the simulator, 268
exporting, 59 how to use, 280
printing, 59 I/O manager window, 270
reversibility mode, overview, 31
introduction to, 79 modifying values, 275
rollback changes, 241 modifying values of analog inputs, 276
RTC modifying values of digital inputs, 275
displaying date and time, 263 output tracing, 277
managing with system bits, 192 simulator windows, 268
updating in controller, 265 Time Management window, 272
rungs software objects, 158
copying, 98 sources of events, 137
creating, 97 stages of developing a program, 30
deleting, 99 Start Page, 30
graphic element, 179 startup state of logic controller, 85
inserting, 97 state
managing, 97 initial logic controller, configuring, 85
renaming, 99 of controller, displaying, 263
status area, 55
stop sensors, wiring, 192
S STOPPED state
scan modes, 89, 123 fallback behavior, 87
scan task, configuring watchdog, 87 subroutine
scan time assigning to periodic task, 132
displaying minimum, maximum, current, assigning to tasks, 139
263 implementing as Free POU, 93
minimum, displayed in status area, 55 of master task, 122
SD card triggering execution with an event, 137
memory management with, 257 supported devices, 24
search and replace, 162
symbol list
displaying, 165
T
task
exporting, 167
event, 136
importing, 166
periodic, 132
sharing with Vijeo Designer project, 168
tasks
symbolic addressing, 76
configuring, 89
symbols
template
addressing with, 76
project, 46
defining in graphic elements of ladder ed-
saving project file as, 285
itor, 77
test zone, 175
defining in Properties window, 76
TH0, TH1
list of used, 165
configuring as event sources, 137
storing in logic controller, 77
threshold outputs (of %HSC)
system bits
configuring as event sources, 137
%S0, 192
time base (for trace), 149
%S11, 123
timer, watchdog, 87
%S14, 263
toolbar buttons, 53
%S19, 123
tools
%S31, 141
animation tables, 145
%S38, 141
communication objects, 161
%S39, 141
Drive objects, 160
%S49, 192
input/output objects, 156
%S51, 192
memory consumption, 170
system bits/words
memory objects, 150
controlling events with, 141
network objects, 157
in symbol list, 165
PTO objects, 159
system objects, 155
search and replace, 162
system requirements, 23
software objects, 158
system words
symbols lists, 165
%SW0, 123
system objects, 155
%SW27, 123
using, 142
%SW30, 123
trace
%SW30...%SW32, 263
displaying, 231
%SW31, 123
exporting to PDF, 233
%SW32, 123
selecting objects to, 145
%SW35...%SW38, 263
selecting time base for, 149
%SW48, 141
Twido projects, converting to SoMachine Ba-
%SW54...%SW57, 263
sic, 289
%SW58, 263
%SW6, 263
U
uploading
application from logic controller, 254
preventing with a password, 66
user interface
setting language, 57
user-defined function
managing, 112
programming, 108
user-defined function block
defining, 116
managing, 119
programming, 116
W
watchdog timer, configuring, 87
wiring stop sensors, 192
X
XOR
graphic elements for, 181