0% found this document useful (0 votes)
688 views1,848 pages

WEG WPS Programming Software User Manual 10001381480 en

Uploaded by

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

WEG WPS Programming Software User Manual 10001381480 en

Uploaded by

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

Motors | Automation | Energy | Transmission & Distribution | Paints

Software
WPS v2.5X

User Manual
User Manual

Series: WPS
Language: English
Document number: 10001381480 / R11

Publication date: 03/2019


Contents

Contents

1 WPS v2.5X
..........................................................................................................23
2 Introduction
..........................................................................................................24
2.1 Welcome
......................................................................................................................................... 24
2.2 System
.........................................................................................................................................
Requirements 24
2.3 Supported
.........................................................................................................................................
Equipments 24
2.4 Copyright
.........................................................................................................................................
Notice 25
2.5 Safety
.........................................................................................................................................
Notice 25

3 What's..........................................................................................................26
New
3.1 What's
.........................................................................................................................................
New - This Version 26
3.2 What's
.........................................................................................................................................
New - Previous Versions 26

4 Installation/Uninstallation
..........................................................................................................33
4.1 Before
.........................................................................................................................................
Installing 33
4.2 Installing
......................................................................................................................................... 33
4.3 Uninstalling
......................................................................................................................................... 33

5 Getting
..........................................................................................................34
to Know the Environment
5.1 Environment
......................................................................................................................................... 34
5.2 Configuration
.........................................................................................................................................
Structure 34

6 Quick ..........................................................................................................36
Start
6.1 Welcome
.........................................................................................................................................
Window 36
6.2 Creating
.........................................................................................................................................
New Configuration 51
6.3 New Configuration
.........................................................................................................................................
- Online Equipment 52
6.4 New Configuration
.........................................................................................................................................
- Offline Equipment 60
6.5 Creating
.........................................................................................................................................
New Resource 68
6.6 New Resource
.........................................................................................................................................
- Online Equipment 68
6.7 Pop-up
.........................................................................................................................................
Menu 76
6.8 Pop-up
.........................................................................................................................................
Menu - Configuration 76
6.9 Pop-up
.........................................................................................................................................
Menu - Resource 91

7 Communication
..........................................................................................................100
7.1 Equipment
.........................................................................................................................................
Parameterization 100
7.2 Establishing
.........................................................................................................................................
Communication - USB Serial Port 100
7.3 Establishing
.........................................................................................................................................
Communication - RS232 104
7.4 Establishing
.........................................................................................................................................
Communication - RS485 109
7.5 Cables
......................................................................................................................................... 114
7.6 USB/Serial
.........................................................................................................................................
Converter 116

WPS v2.5X | 3
8 Ladder
..........................................................................................................118
8.1 Concepts
......................................................................................................................................... 118
8.1.1 Introduction
.......................................................................................................................................................................................... 118
8.1.2 Legend
.......................................................................................................................................................................................... 120
8.1.3 Contact
..........................................................................................................................................................................................
Logic 121
8.1.4 Data
..........................................................................................................................................................................................
types 123
8.1.5 Direct
..........................................................................................................................................................................................
Representation 123
8.2 Editor
......................................................................................................................................... 124
8.2.1 Desktop
.......................................................................................................................................................................................... 124
8.2.2 Ladder
..........................................................................................................................................................................................
Menu 125
8.2.3 Rungs
.......................................................................................................................................................................................... 126
8.2.3.1 Overview
....................................................................................................................................................................................... 126
8.2.3.2 Editing
....................................................................................................................................................................................... 127
8.2.3.3 Title
.......................................................................................................................................................................................
and Comment 127
8.2.3.4 Inserting
.......................................................................................................................................................................................
Elements 128
8.2.3.4.1 Overview
................................................................................................................................................................................ 128
8.2.3.4.2 In Series
................................................................................................................................................................................ 129
8.2.3.4.3 In Parallel
................................................................................................................................................................................ 130
8.2.3.5 Brow
.......................................................................................................................................................................................
sing 130
8.2.3.5.1 With................................................................................................................................................................................
the Keyboard 130
8.2.3.5.2 With................................................................................................................................................................................
the Mouse 132
8.2.3.6 Copy/Paste
....................................................................................................................................................................................... 133
8.2.4 Variables
.......................................................................................................................................................................................... 137
8.2.4.1 Overview
....................................................................................................................................................................................... 137
8.2.4.2 Fields
....................................................................................................................................................................................... 138
8.2.4.3 Editing
.......................................................................................................................................................................................
in the Rung 140
8.2.4.4 Literals
.......................................................................................................................................................................................
in the Rung 142
8.2.4.5 Arrays
.......................................................................................................................................................................................
in the Rung 142
8.2.4.6 Instances
.......................................................................................................................................................................................
and Structures in the Rung 143
8.2.4.7 Volatile
.......................................................................................................................................................................................
and Retentive Instances 144
8.2.5 Com
..........................................................................................................................................................................................
pile 148
8.2.6 Transfer
.......................................................................................................................................................................................... 149
8.2.7 Online
..........................................................................................................................................................................................
Monitoring 150
8.3 Working
.........................................................................................................................................
with USERFBs 154
8.3.1 Creating
..........................................................................................................................................................................................
USERFBs 154
8.3.2 Adding
..........................................................................................................................................................................................
input/output 156
8.3.3 Editing
..........................................................................................................................................................................................
the Ladder 159
8.3.4 Using
..........................................................................................................................................................................................
USERFBs 160

9 Diagnostic
..........................................................................................................162
9.1 Monitoring
.........................................................................................................................................
Variable 162
9.2 Trend
......................................................................................................................................... 163
9.2.1 Overview
.......................................................................................................................................................................................... 163
9.2.2 Configuration
.......................................................................................................................................................................................... 164

10 Wizards
..........................................................................................................167
10.1 Overview
......................................................................................................................................... 167
10.2 Monitoring
.........................................................................................................................................
Wizard 167
10.3 Configuration
.........................................................................................................................................
Wizard 169

11 Equipments
..........................................................................................................175
(Devices)

WPS v2.5X | 4
Contents

11.1 CFW100
......................................................................................................................................... 175
11.1.1 Description
.......................................................................................................................................................................................... 175
11.1.2 System
..........................................................................................................................................................................................
Markers 175
11.1.3 I/O's
.......................................................................................................................................................................................... 178
11.1.4 Im..........................................................................................................................................................................................
port from WLP 179
11.1.5 Param
..........................................................................................................................................................................................
eters 181
11.1.5.1 Overview
....................................................................................................................................................................................... 181
11.1.5.2 Configuration
....................................................................................................................................................................................... 183
11.1.5.3 Read
.......................................................................................................................................................................................
and Write of Parameters 185
11.1.5.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 188
11.1.5.5 User
.......................................................................................................................................................................................
Parameters 198
11.1.6 Ladder
.......................................................................................................................................................................................... 200
11.1.6.1 Coil
....................................................................................................................................................................................... 200
11.1.6.1.1 DIRECTCOIL
................................................................................................................................................................................ 200
11.1.6.1.2 INVERTEDCOIL
................................................................................................................................................................................ 201
11.1.6.1.3 RESETCOIL
................................................................................................................................................................................ 203
11.1.6.1.4 SETCOIL................................................................................................................................................................................ 204
11.1.6.1.5 TOGGLECOIL
................................................................................................................................................................................ 205
11.1.6.2 Communication
.......................................................................................................................................................................................
Netw ork 206
11.1.6.2.1 Modbus ................................................................................................................................................................................
RTU 206
11.1.6.2.1.1 Modbus
................................................................................................................................................................................
RTU Overview 206
11.1.6.2.1.2 MB_MasterControlStatus
................................................................................................................................................................................ 207
11.1.6.2.1.3 MB_ReadBinary
................................................................................................................................................................................ 209
11.1.6.2.1.4 MB_ReadRegister
................................................................................................................................................................................ 213
11.1.6.2.1.5 MB_SlaveStatus
................................................................................................................................................................................ 217
11.1.6.2.1.6 MB_WriteBinary
................................................................................................................................................................................ 219
11.1.6.2.1.7 MB_WriteRegister
................................................................................................................................................................................ 223
11.1.6.3 Compare
....................................................................................................................................................................................... 227
11.1.6.3.1 COMP_EQ................................................................................................................................................................................ 227
11.1.6.3.2 COMP_GE................................................................................................................................................................................ 229
11.1.6.3.3 COMP_GT................................................................................................................................................................................ 231
11.1.6.3.4 COMP_LE................................................................................................................................................................................ 233
11.1.6.3.5 COMP_LT................................................................................................................................................................................ 235
11.1.6.3.6 COMP_NE................................................................................................................................................................................ 237
11.1.6.4 Contact
....................................................................................................................................................................................... 238
11.1.6.4.1 NCCONTACT
................................................................................................................................................................................ 238
11.1.6.4.2 NOCONTACT
................................................................................................................................................................................ 240
11.1.6.4.3 NTSCONTACT
................................................................................................................................................................................ 241
11.1.6.4.4 PTSCONTACT
................................................................................................................................................................................ 242
11.1.6.5 Control
....................................................................................................................................................................................... 244
11.1.6.5.1 PID ................................................................................................................................................................................ 244
11.1.6.6 Conversion
....................................................................................................................................................................................... 249
11.1.6.6.1 BOOL ................................................................................................................................................................................ 249
11.1.6.6.1.1 BYTE_TO_BOOL
................................................................................................................................................................................ 249
11.1.6.6.1.2 DWORD_TO_BOOL
................................................................................................................................................................................ 251
11.1.6.6.1.3 REAL_TO_BOOL
................................................................................................................................................................................ 252
11.1.6.6.1.4 WORD_TO_BOOL
................................................................................................................................................................................ 254
11.1.6.6.2 BYTE ................................................................................................................................................................................ 255
11.1.6.6.2.1 BOOL_TO_BYTE
................................................................................................................................................................................ 255
11.1.6.6.2.2 DWORD_TO_BYTE
................................................................................................................................................................................ 257
11.1.6.6.2.3 REAL_TO_BYTE
................................................................................................................................................................................ 258
11.1.6.6.2.4 WORD_TO_BYTE
................................................................................................................................................................................ 260
11.1.6.6.3 DWORD ................................................................................................................................................................................ 262
11.1.6.6.3.1 BOOL_TO_DWORD
................................................................................................................................................................................ 262

WPS v2.5X | 5
11.1.6.6.3.2 BYTE_TO_DWORD
................................................................................................................................................................................ 263
11.1.6.6.3.3 REAL_TO_DWORD
................................................................................................................................................................................ 265
11.1.6.6.3.4 WORD_TO_DWORD
................................................................................................................................................................................ 266
11.1.6.6.4 REAL ................................................................................................................................................................................ 268
11.1.6.6.4.1 BOOL_TO_REAL
................................................................................................................................................................................ 268
11.1.6.6.4.2 BYTE_TO_REAL
................................................................................................................................................................................ 269
11.1.6.6.4.3 DWORD_TO_REAL
................................................................................................................................................................................ 271
11.1.6.6.4.4 WORD_TO_REAL
................................................................................................................................................................................ 272
11.1.6.6.5 WORD ................................................................................................................................................................................ 274
11.1.6.6.5.1 BOOL_TO_WORD
................................................................................................................................................................................ 274
11.1.6.6.5.2 BYTE_TO_WORD
................................................................................................................................................................................ 275
11.1.6.6.5.3 DWORD_TO_WORD
................................................................................................................................................................................ 277
11.1.6.6.5.4 REAL_TO_WORD
................................................................................................................................................................................ 278
11.1.6.7 Counter
....................................................................................................................................................................................... 280
11.1.6.7.1 CTD................................................................................................................................................................................ 280
11.1.6.7.2 CTU................................................................................................................................................................................ 283
11.1.6.7.3 CTUD ................................................................................................................................................................................ 286
11.1.6.8 Data
.......................................................................................................................................................................................
Transfer 291
11.1.6.8.1 DEMUX ................................................................................................................................................................................ 291
11.1.6.8.2 ILOAD ................................................................................................................................................................................ 293
11.1.6.8.3 ILOADBOOL
................................................................................................................................................................................ 294
11.1.6.8.4 ISTORE ................................................................................................................................................................................ 296
11.1.6.8.5 ISTOREBOOL
................................................................................................................................................................................ 297
11.1.6.8.6 MUX................................................................................................................................................................................ 299
11.1.6.8.7 SEL ................................................................................................................................................................................ 302
11.1.6.8.8 STORE ................................................................................................................................................................................ 304
11.1.6.8.9 USERERR................................................................................................................................................................................ 306
11.1.6.9 Filter
....................................................................................................................................................................................... 308
11.1.6.9.1 LOWPASS................................................................................................................................................................................ 308
11.1.6.10 Logic
....................................................................................................................................................................................... 311
11.1.6.10.1 Logic................................................................................................................................................................................
Bit 311
11.1.6.10.1.1 RESETBIT
................................................................................................................................................................................ 311
11.1.6.10.1.2 SETBIT
................................................................................................................................................................................ 313
11.1.6.10.1.3 TESTBIT
................................................................................................................................................................................ 315
11.1.6.10.2 Logic................................................................................................................................................................................
Boolean 317
11.1.6.10.2.1 AND ................................................................................................................................................................................ 317
11.1.6.10.2.2 NOT ................................................................................................................................................................................ 318
11.1.6.10.2.3 OR................................................................................................................................................................................ 320
11.1.6.10.2.4 XNOR................................................................................................................................................................................ 321
11.1.6.10.2.5 XOR ................................................................................................................................................................................ 323
11.1.6.10.3 Logic................................................................................................................................................................................
Rotate 324
11.1.6.10.3.1 ROL ................................................................................................................................................................................ 324
11.1.6.10.3.2 ROR ................................................................................................................................................................................ 326
11.1.6.10.4 Logic................................................................................................................................................................................
Shift 328
11.1.6.10.4.1 ASHL................................................................................................................................................................................ 328
11.1.6.10.4.2 ASHR................................................................................................................................................................................ 330
11.1.6.10.4.3 SHL ................................................................................................................................................................................ 332
11.1.6.10.4.4 SHR ................................................................................................................................................................................ 334
11.1.6.11 Math
....................................................................................................................................................................................... 336
11.1.6.11.1 Math................................................................................................................................................................................
Basic 336
11.1.6.11.1.1 ABS ................................................................................................................................................................................ 336
11.1.6.11.1.2 ADD ................................................................................................................................................................................ 338
11.1.6.11.1.3 DIV................................................................................................................................................................................ 340
11.1.6.11.1.4 MOD ................................................................................................................................................................................ 342

WPS v2.5X | 6
Contents

11.1.6.11.1.5 MUL ................................................................................................................................................................................ 344


11.1.6.11.1.6 NEG ................................................................................................................................................................................ 346
11.1.6.11.1.7 SUB ................................................................................................................................................................................ 348
11.1.6.11.2 Math................................................................................................................................................................................
Extended 350
11.1.6.11.2.1 ALOG10
................................................................................................................................................................................ 350
11.1.6.11.2.2 EXP ................................................................................................................................................................................ 352
11.1.6.11.2.3 LN................................................................................................................................................................................ 354
11.1.6.11.2.4 LOG10
................................................................................................................................................................................ 356
11.1.6.11.2.5 POW ................................................................................................................................................................................ 357
11.1.6.11.2.6 ROUND
................................................................................................................................................................................ 359
11.1.6.11.2.7 SQRT................................................................................................................................................................................ 360
11.1.6.11.2.8 TRUNC
................................................................................................................................................................................ 362
11.1.6.11.3 Math................................................................................................................................................................................
Trigonometry 363
11.1.6.11.3.1 ACOS................................................................................................................................................................................ 363
11.1.6.11.3.2 ASIN................................................................................................................................................................................ 365
11.1.6.11.3.3 ATAN................................................................................................................................................................................ 367
11.1.6.11.3.4 ATAN2
................................................................................................................................................................................ 368
11.1.6.11.3.5 COS ................................................................................................................................................................................ 370
11.1.6.11.3.6 SIN ................................................................................................................................................................................ 372
11.1.6.11.3.7 TAN ................................................................................................................................................................................ 373
11.1.6.11.4 Math................................................................................................................................................................................
Util 375
11.1.6.11.4.1 MAX ................................................................................................................................................................................ 375
11.1.6.11.4.2 MIN ................................................................................................................................................................................ 377
11.1.6.11.4.3 SAT ................................................................................................................................................................................ 379
11.1.6.12 Module
....................................................................................................................................................................................... 382
11.1.6.12.1 USERFB ................................................................................................................................................................................ 382
11.1.6.13 Motion
.......................................................................................................................................................................................
Control 383
11.1.6.13.1 MW_RefVelocity
................................................................................................................................................................................ 383
11.1.6.14 Timer
....................................................................................................................................................................................... 386
11.1.6.14.1 TON................................................................................................................................................................................ 386
11.1.6.14.2 TOF................................................................................................................................................................................ 390
11.1.6.14.3 TP ................................................................................................................................................................................ 393
11.1.6.15 Structures
....................................................................................................................................................................................... 396
11.1.7 Com
..........................................................................................................................................................................................
m unication 399
11.1.7.1 Force
.......................................................................................................................................................................................
I/O 399
11.2 CFW300
......................................................................................................................................... 400
11.2.1 Description
.......................................................................................................................................................................................... 400
11.2.2 System
..........................................................................................................................................................................................
Markers 401
11.2.3 I/O's
.......................................................................................................................................................................................... 404
11.2.4 Im..........................................................................................................................................................................................
port from WLP 405
11.2.5 Param
..........................................................................................................................................................................................
eters 408
11.2.5.1 Overview
....................................................................................................................................................................................... 408
11.2.5.2 Configuration
....................................................................................................................................................................................... 410
11.2.5.3 Read
.......................................................................................................................................................................................
and Write of Parameters 412
11.2.5.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 415
11.2.5.5 User
.......................................................................................................................................................................................
Parameters 425
11.2.6 Ladder
.......................................................................................................................................................................................... 427
11.2.6.1 Coil
....................................................................................................................................................................................... 427
11.2.6.1.1 DIRECTCOIL
................................................................................................................................................................................ 427
11.2.6.1.2 INVERTEDCOIL
................................................................................................................................................................................ 428
11.2.6.1.3 RESETCOIL
................................................................................................................................................................................ 430
11.2.6.1.4 SETCOIL................................................................................................................................................................................ 431
11.2.6.1.5 TOGGLECOIL
................................................................................................................................................................................ 432
11.2.6.2 Communication
.......................................................................................................................................................................................
Netw ork 433

WPS v2.5X | 7
11.2.6.2.1 Modbus
................................................................................................................................................................................
RTU 433
11.2.6.2.1.1 Modbus
................................................................................................................................................................................
RTU Overview 433
11.2.6.2.1.2 MB_MasterControlStatus
................................................................................................................................................................................ 434
11.2.6.2.1.3 MB_ReadBinary
................................................................................................................................................................................ 436
11.2.6.2.1.4 MB_ReadRegister
................................................................................................................................................................................ 440
11.2.6.2.1.5 MB_SlaveStatus
................................................................................................................................................................................ 444
11.2.6.2.1.6 MB_WriteBinary
................................................................................................................................................................................ 446
11.2.6.2.1.7 MB_WriteRegister
................................................................................................................................................................................ 450
11.2.6.3 Compare
....................................................................................................................................................................................... 454
11.2.6.3.1 COMP_EQ................................................................................................................................................................................ 454
11.2.6.3.2 COMP_GE................................................................................................................................................................................ 456
11.2.6.3.3 COMP_GT................................................................................................................................................................................ 458
11.2.6.3.4 COMP_LE................................................................................................................................................................................ 460
11.2.6.3.5 COMP_LT................................................................................................................................................................................ 462
11.2.6.3.6 COMP_NE................................................................................................................................................................................ 464
11.2.6.4 Contact
....................................................................................................................................................................................... 465
11.2.6.4.1 NCCONTACT
................................................................................................................................................................................ 465
11.2.6.4.2 NOCONTACT
................................................................................................................................................................................ 467
11.2.6.4.3 NTSCONTACT
................................................................................................................................................................................ 468
11.2.6.4.4 PTSCONTACT
................................................................................................................................................................................ 469
11.2.6.5 Control
....................................................................................................................................................................................... 471
11.2.6.5.1 PID ................................................................................................................................................................................ 471
11.2.6.6 Conversion
....................................................................................................................................................................................... 476
11.2.6.6.1 BOOL ................................................................................................................................................................................ 476
11.2.6.6.1.1 BYTE_TO_BOOL
................................................................................................................................................................................ 476
11.2.6.6.1.2 DWORD_TO_BOOL
................................................................................................................................................................................ 478
11.2.6.6.1.3 REAL_TO_BOOL
................................................................................................................................................................................ 479
11.2.6.6.1.4 WORD_TO_BOOL
................................................................................................................................................................................ 481
11.2.6.6.2 BYTE
................................................................................................................................................................................ 482
11.2.6.6.2.1 BOOL_TO_BYTE
................................................................................................................................................................................ 482
11.2.6.6.2.2 DWORD_TO_BYTE
................................................................................................................................................................................ 484
11.2.6.6.2.3 REAL_TO_BYTE
................................................................................................................................................................................ 485
11.2.6.6.2.4 WORD_TO_BYTE
................................................................................................................................................................................ 487
11.2.6.6.3 DWORD
................................................................................................................................................................................ 489
11.2.6.6.3.1 BOOL_TO_DWORD
................................................................................................................................................................................ 489
11.2.6.6.3.2 BYTE_TO_DWORD
................................................................................................................................................................................ 490
11.2.6.6.3.3 REAL_TO_DWORD
................................................................................................................................................................................ 492
11.2.6.6.3.4 WORD_TO_DWORD
................................................................................................................................................................................ 493
11.2.6.6.4 REAL................................................................................................................................................................................ 495
11.2.6.6.4.1 BOOL_TO_REAL
................................................................................................................................................................................ 495
11.2.6.6.4.2 BYTE_TO_REAL
................................................................................................................................................................................ 496
11.2.6.6.4.3 DWORD_TO_REAL
................................................................................................................................................................................ 498
11.2.6.6.4.4 WORD_TO_REAL
................................................................................................................................................................................ 499
11.2.6.6.5 WORD
................................................................................................................................................................................ 501
11.2.6.6.5.1 BOOL_TO_WORD
................................................................................................................................................................................ 501
11.2.6.6.5.2 BYTE_TO_WORD
................................................................................................................................................................................ 502
11.2.6.6.5.3 DWORD_TO_WORD
................................................................................................................................................................................ 504
11.2.6.6.5.4 REAL_TO_WORD
................................................................................................................................................................................ 505
11.2.6.7 Counter
....................................................................................................................................................................................... 507
11.2.6.7.1 CTD................................................................................................................................................................................ 507
11.2.6.7.2 CTU................................................................................................................................................................................ 510
11.2.6.7.3 CTUD ................................................................................................................................................................................ 513
11.2.6.8 Data
.......................................................................................................................................................................................
Transfer 518
11.2.6.8.1 DEMUX ................................................................................................................................................................................ 518

WPS v2.5X | 8
Contents

11.2.6.8.2 ILOAD ................................................................................................................................................................................ 520


11.2.6.8.3 ILOADBOOL
................................................................................................................................................................................ 521
11.2.6.8.4 ISTORE ................................................................................................................................................................................ 523
11.2.6.8.5 ISTOREBOOL
................................................................................................................................................................................ 524
11.2.6.8.6 MUX................................................................................................................................................................................ 526
11.2.6.8.7 SEL ................................................................................................................................................................................ 529
11.2.6.8.8 STORE ................................................................................................................................................................................ 531
11.2.6.8.9 USERERR................................................................................................................................................................................ 533
11.2.6.9 Filter
....................................................................................................................................................................................... 535
11.2.6.9.1 LOWPASS................................................................................................................................................................................ 535
11.2.6.10 Logic
....................................................................................................................................................................................... 538
11.2.6.10.1 Logic................................................................................................................................................................................
Bit 538
11.2.6.10.1.1 RESETBIT
................................................................................................................................................................................ 538
11.2.6.10.1.2 SETBIT
................................................................................................................................................................................ 540
11.2.6.10.1.3 TESTBIT
................................................................................................................................................................................ 542
11.2.6.10.2 Logic................................................................................................................................................................................
Boolean 544
11.2.6.10.2.1 AND ................................................................................................................................................................................ 544
11.2.6.10.2.2 NOT ................................................................................................................................................................................ 545
11.2.6.10.2.3 OR................................................................................................................................................................................ 547
11.2.6.10.2.4 XNOR................................................................................................................................................................................ 548
11.2.6.10.2.5 XOR ................................................................................................................................................................................ 550
11.2.6.10.3 Logic................................................................................................................................................................................
Rotate 551
11.2.6.10.3.1 ROL ................................................................................................................................................................................ 551
11.2.6.10.3.2 ROR ................................................................................................................................................................................ 553
11.2.6.10.4 Logic................................................................................................................................................................................
Shift 555
11.2.6.10.4.1 ASHL................................................................................................................................................................................ 555
11.2.6.10.4.2 ASHR................................................................................................................................................................................ 557
11.2.6.10.4.3 SHL ................................................................................................................................................................................ 559
11.2.6.10.4.4 SHR ................................................................................................................................................................................ 561
11.2.6.11 Math
....................................................................................................................................................................................... 563
11.2.6.11.1 Math................................................................................................................................................................................
Basic 563
11.2.6.11.1.1 ABS ................................................................................................................................................................................ 563
11.2.6.11.1.2 ADD ................................................................................................................................................................................ 565
11.2.6.11.1.3 DIV................................................................................................................................................................................ 567
11.2.6.11.1.4 MOD ................................................................................................................................................................................ 569
11.2.6.11.1.5 MUL ................................................................................................................................................................................ 571
11.2.6.11.1.6 NEG ................................................................................................................................................................................ 573
11.2.6.11.1.7 SUB ................................................................................................................................................................................ 575
11.2.6.11.2 Math................................................................................................................................................................................
Extended 577
11.2.6.11.2.1 ALOG10
................................................................................................................................................................................ 577
11.2.6.11.2.2 EXP ................................................................................................................................................................................ 579
11.2.6.11.2.3 LN................................................................................................................................................................................ 581
11.2.6.11.2.4 LOG10
................................................................................................................................................................................ 583
11.2.6.11.2.5 POW ................................................................................................................................................................................ 584
11.2.6.11.2.6 ROUND
................................................................................................................................................................................ 586
11.2.6.11.2.7 SQRT................................................................................................................................................................................ 587
11.2.6.11.2.8 TRUNC
................................................................................................................................................................................ 589
11.2.6.11.3 Math................................................................................................................................................................................
Trigonometry 590
11.2.6.11.3.1 ACOS................................................................................................................................................................................ 590
11.2.6.11.3.2 ASIN................................................................................................................................................................................ 592
11.2.6.11.3.3 ATAN................................................................................................................................................................................ 594
11.2.6.11.3.4 ATAN2
................................................................................................................................................................................ 595
11.2.6.11.3.5 COS ................................................................................................................................................................................ 597
11.2.6.11.3.6 SIN ................................................................................................................................................................................ 599

WPS v2.5X | 9
11.2.6.11.3.7 TAN ................................................................................................................................................................................ 600
11.2.6.11.4 Math................................................................................................................................................................................
Util 602
11.2.6.11.4.1 MAX ................................................................................................................................................................................ 602
11.2.6.11.4.2 MIN ................................................................................................................................................................................ 604
11.2.6.11.4.3 SAT ................................................................................................................................................................................ 606
11.2.6.12 Module
....................................................................................................................................................................................... 609
11.2.6.12.1 USERFB ................................................................................................................................................................................ 609
11.2.6.13 Motion
.......................................................................................................................................................................................
Control 610
11.2.6.13.1 MW_RefVelocity
................................................................................................................................................................................ 610
11.2.6.14 Timer
....................................................................................................................................................................................... 613
11.2.6.14.1 TON................................................................................................................................................................................ 613
11.2.6.14.2 TOF................................................................................................................................................................................ 617
11.2.6.14.3 TP ................................................................................................................................................................................ 620
11.2.6.15 Structures
....................................................................................................................................................................................... 623
11.2.7 Com
..........................................................................................................................................................................................
m unication 626
11.2.7.1 Force
.......................................................................................................................................................................................
I/O 626
11.3 CFW500
......................................................................................................................................... 627
11.3.1 Description
.......................................................................................................................................................................................... 628
11.3.2 Param
..........................................................................................................................................................................................
eters 628
11.3.2.1 Overview
....................................................................................................................................................................................... 628
11.3.2.2 Configuration
....................................................................................................................................................................................... 630
11.3.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 632
11.3.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 635
11.3.2.5 User
.......................................................................................................................................................................................
Parameters 645
11.4 CFW501
......................................................................................................................................... 647
11.4.1 Description
.......................................................................................................................................................................................... 647
11.4.2 Param
..........................................................................................................................................................................................
eters 648
11.4.2.1 Overview
....................................................................................................................................................................................... 648
11.4.2.2 Configuration
....................................................................................................................................................................................... 650
11.4.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 652
11.4.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 655
11.4.2.5 User
.......................................................................................................................................................................................
Parameters 665
11.5 CFW-11
......................................................................................................................................... 667
11.5.1 Description
.......................................................................................................................................................................................... 667
11.5.2 Param
..........................................................................................................................................................................................
eters 668
11.5.2.1 Overview
....................................................................................................................................................................................... 668
11.5.2.2 Configuration
....................................................................................................................................................................................... 669
11.5.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 672
11.5.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 675
11.5.2.5 User
.......................................................................................................................................................................................
Parameters 685
11.5.3 Diagnostic
.......................................................................................................................................................................................... 687
11.5.3.1 Trace
....................................................................................................................................................................................... 687
11.5.3.1.1 Overview
................................................................................................................................................................................ 687
11.5.3.1.2 Configuration
................................................................................................................................................................................ 689
11.6 LDW900
......................................................................................................................................... 695
11.6.1 Description
.......................................................................................................................................................................................... 695
11.6.2 System
..........................................................................................................................................................................................
Markers 696
11.6.3 Oriented
..........................................................................................................................................................................................
Start-Up 699
11.6.4 Auto-Tuning
.......................................................................................................................................................................................... 703
11.6.5 Im..........................................................................................................................................................................................
port from WLP 705
11.6.6 Param ..........................................................................................................................................................................................
eters 0
11.6.7 Ladder.......................................................................................................................................................................................... 0
11.6.7.1 Logic....................................................................................................................................................................................... 0

WPS v2.5X | 10
Contents

11.6.7.2 Math....................................................................................................................................................................................... 0
11.6.7.3 Motion .......................................................................................................................................................................................
Control 0
11.6.8 Cam
..........................................................................................................................................................................................
Profiles 708
11.6.9 Structures
.......................................................................................................................................................................................... 719
11.6.10 Diagnostic
.......................................................................................................................................................................................... 0
11.6.11 Com..........................................................................................................................................................................................
m unication 0
11.7 MW500
......................................................................................................................................... 722
11.7.1 Description
.......................................................................................................................................................................................... 722
11.7.2 Param
..........................................................................................................................................................................................
eters 722
11.7.2.1 Overview
....................................................................................................................................................................................... 722
11.7.2.2 Configuration
....................................................................................................................................................................................... 722
11.7.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 725
11.7.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 728
11.7.2.5 User
.......................................................................................................................................................................................
Parameters 738
11.8 PLC300
......................................................................................................................................... 740
11.8.1 Description
.......................................................................................................................................................................................... 740
11.8.2 New
..........................................................................................................................................................................................
Features and Corrections 741
11.8.3 I/O's
.......................................................................................................................................................................................... 748
11.8.4 System
..........................................................................................................................................................................................
Markers 752
11.8.5 Ladder
.......................................................................................................................................................................................... 760
11.8.5.1 Coil
....................................................................................................................................................................................... 760
11.8.5.1.1 DIRECTCOIL
................................................................................................................................................................................ 760
11.8.5.1.2 IMMEDIATECOIL
................................................................................................................................................................................ 761
11.8.5.1.3 INVERTEDCOIL
................................................................................................................................................................................ 762
11.8.5.1.4 RESETCOIL
................................................................................................................................................................................ 763
11.8.5.1.5 SETCOIL................................................................................................................................................................................ 764
11.8.5.1.6 TOGGLECOIL
................................................................................................................................................................................ 765
11.8.5.2 Communication
.......................................................................................................................................................................................
Netw ork 766
11.8.5.2.1 CANopen................................................................................................................................................................................ 766
11.8.5.2.1.1 CANopen
................................................................................................................................................................................
Overview 766
11.8.5.2.1.2 CO_MasterControlStatus
................................................................................................................................................................................ 768
11.8.5.2.1.3 CO_SDORead
................................................................................................................................................................................ 771
11.8.5.2.1.4 CO_SDOWrite
................................................................................................................................................................................ 774
11.8.5.2.1.5 CO_SlaveStatus
................................................................................................................................................................................ 777
11.8.5.2.2 Modbus ................................................................................................................................................................................
RTU 778
11.8.5.2.2.1 Modbus
................................................................................................................................................................................
RTU Overview 778
11.8.5.2.2.2 MB_MasterControlStatus
................................................................................................................................................................................ 779
11.8.5.2.2.3 MB_ReadBinary
................................................................................................................................................................................ 781
11.8.5.2.2.4 MB_ReadRegister
................................................................................................................................................................................ 785
11.8.5.2.2.5 MB_SlaveStatus
................................................................................................................................................................................ 789
11.8.5.2.2.6 MB_WriteBinary
................................................................................................................................................................................ 791
11.8.5.2.2.7 MB_WriteRegister
................................................................................................................................................................................ 795
11.8.5.2.3 Modbus ................................................................................................................................................................................
TCP 799
11.8.5.2.3.1 Modbus
................................................................................................................................................................................
TCP Overview 799
11.8.5.2.3.2 MBTCP_ClientControlStatus
................................................................................................................................................................................ 799
11.8.5.2.3.3 MBTCP_ReadBinary
................................................................................................................................................................................ 802
11.8.5.2.3.4 MBTCP_ReadRegister
................................................................................................................................................................................ 806
11.8.5.2.3.5 MBTCP_ServerStatus
................................................................................................................................................................................ 810
11.8.5.2.3.6 MBTCP_WriteBinary
................................................................................................................................................................................ 813
11.8.5.2.3.7 MBTCP_WriteRegister
................................................................................................................................................................................ 817
11.8.5.3 Compare
....................................................................................................................................................................................... 821
11.8.5.3.1 COMP_EQ................................................................................................................................................................................ 821
11.8.5.3.2 COMP_GE................................................................................................................................................................................ 823
11.8.5.3.3 COMP_GT................................................................................................................................................................................ 825

WPS v2.5X | 11
11.8.5.3.4 COMP_LE................................................................................................................................................................................ 827
11.8.5.3.5 COMP_LT................................................................................................................................................................................ 829
11.8.5.3.6 COMP_NE................................................................................................................................................................................ 831
11.8.5.4 Contact
....................................................................................................................................................................................... 832
11.8.5.4.1 NCCONTACT
................................................................................................................................................................................ 832
11.8.5.4.2 NOCONTACT
................................................................................................................................................................................ 834
11.8.5.4.3 NTSCONTACT
................................................................................................................................................................................ 835
11.8.5.4.4 PTSCONTACT
................................................................................................................................................................................ 836
11.8.5.5 Control
....................................................................................................................................................................................... 838
11.8.5.5.1 PID ................................................................................................................................................................................ 838
11.8.5.5.2 PID2................................................................................................................................................................................ 843
11.8.5.6 Conversion
....................................................................................................................................................................................... 850
11.8.5.6.1 BCD................................................................................................................................................................................ 850
11.8.5.6.1.1 BCD_TO_WORD
................................................................................................................................................................................ 850
11.8.5.6.1.2 WORD_TO_BCD
................................................................................................................................................................................ 851
11.8.5.6.2 BOOL ................................................................................................................................................................................ 853
11.8.5.6.2.1 BYTE_TO_BOOL
................................................................................................................................................................................ 853
11.8.5.6.2.2 DWORD_TO_BOOL
................................................................................................................................................................................ 854
11.8.5.6.2.3 REAL_TO_BOOL
................................................................................................................................................................................ 856
11.8.5.6.2.4 WORD_TO_BOOL
................................................................................................................................................................................ 858
11.8.5.6.3 BYTE ................................................................................................................................................................................ 859
11.8.5.6.3.1 BOOL_TO_BYTE
................................................................................................................................................................................ 859
11.8.5.6.3.2 DWORD_TO_BYTE
................................................................................................................................................................................ 861
11.8.5.6.3.3 DWORD_TO_BYTES
................................................................................................................................................................................ 862
11.8.5.6.3.4 REAL_TO_BYTE
................................................................................................................................................................................ 865
11.8.5.6.3.5 WORD_TO_BYTE
................................................................................................................................................................................ 867
11.8.5.6.3.6 WORD_TO_BYTES
................................................................................................................................................................................ 868
11.8.5.6.4 DWORD ................................................................................................................................................................................ 871
11.8.5.6.4.1 BOOL_TO_DWORD
................................................................................................................................................................................ 871
11.8.5.6.4.2 BYTE_TO_DWORD
................................................................................................................................................................................ 872
11.8.5.6.4.3 BYTES_TO_DWORD
................................................................................................................................................................................ 873
11.8.5.6.4.4 REAL_TO_DWORD
................................................................................................................................................................................ 875
11.8.5.6.4.5 STRING_TO_DWORD
................................................................................................................................................................................ 877
11.8.5.6.4.6 WORD_TO_DWORD
................................................................................................................................................................................ 879
11.8.5.6.4.7 WORDS_TO_DWORD
................................................................................................................................................................................ 880
11.8.5.6.5 Rad-Deg................................................................................................................................................................................ 882
11.8.5.6.5.1 DEG_TO_RAD
................................................................................................................................................................................ 882
11.8.5.6.5.2 RAD_TO_DEG
................................................................................................................................................................................ 883
11.8.5.6.6 REAL ................................................................................................................................................................................ 885
11.8.5.6.6.1 BOOL_TO_REAL
................................................................................................................................................................................ 885
11.8.5.6.6.2 BYTE_TO_REAL
................................................................................................................................................................................ 886
11.8.5.6.6.3 DWORD_TO_REAL
................................................................................................................................................................................ 888
11.8.5.6.6.4 STRING_TO_REAL
................................................................................................................................................................................ 889
11.8.5.6.6.5 WORD_TO_REAL
................................................................................................................................................................................ 892
11.8.5.6.7 STRING ................................................................................................................................................................................ 893
11.8.5.6.7.1 DWORD_TO_STRING
................................................................................................................................................................................ 893
11.8.5.6.7.2 REAL_TO_STRING
................................................................................................................................................................................ 895
11.8.5.6.8 WORD ................................................................................................................................................................................ 897
11.8.5.6.8.1 BOOL_TO_WORD
................................................................................................................................................................................ 897
11.8.5.6.8.2 BYTE_TO_WORD
................................................................................................................................................................................ 898
11.8.5.6.8.3 BYTES_TO_WORD
................................................................................................................................................................................ 900
11.8.5.6.8.4 DWORD_TO_WORD
................................................................................................................................................................................ 901
11.8.5.6.8.5 DWORD_TO_WORDS
................................................................................................................................................................................ 903
11.8.5.6.8.6 REAL_TO_WORD
................................................................................................................................................................................ 905

WPS v2.5X | 12
Contents

11.8.5.7 Counter
....................................................................................................................................................................................... 907
11.8.5.7.1 CTD................................................................................................................................................................................ 907
11.8.5.7.2 CTU................................................................................................................................................................................ 910
11.8.5.7.3 CTUD ................................................................................................................................................................................ 913
11.8.5.8 Data
.......................................................................................................................................................................................
Transfer 918
11.8.5.8.1 ARRAYCOPY
................................................................................................................................................................................ 918
11.8.5.8.2 DEMUX ................................................................................................................................................................................ 921
11.8.5.8.3 DEMUX2 ................................................................................................................................................................................ 924
11.8.5.8.4 ILOAD ................................................................................................................................................................................ 926
11.8.5.8.5 ILOADBOOL
................................................................................................................................................................................ 928
11.8.5.8.6 ISTORE ................................................................................................................................................................................ 929
11.8.5.8.7 ISTOREBOOL
................................................................................................................................................................................ 931
11.8.5.8.8 MUX................................................................................................................................................................................ 933
11.8.5.8.9 MUX2 ................................................................................................................................................................................ 936
11.8.5.8.10 ReadRecipe
................................................................................................................................................................................ 938
11.8.5.8.11 SCALE ................................................................................................................................................................................ 941
11.8.5.8.12 SEL ................................................................................................................................................................................ 944
11.8.5.8.13 STORE ................................................................................................................................................................................ 946
11.8.5.8.14 SWAP ................................................................................................................................................................................ 948
11.8.5.8.15 SWAP2 ................................................................................................................................................................................ 949
11.8.5.8.16 WriteRecipe
................................................................................................................................................................................ 951
11.8.5.9 Filter
....................................................................................................................................................................................... 955
11.8.5.9.1 LOWPASS................................................................................................................................................................................ 955
11.8.5.10 Hardw
.......................................................................................................................................................................................
are 957
11.8.5.10.1 IMMEDIATE_INPUT
................................................................................................................................................................................ 957
11.8.5.10.2 IMMEDIATE_OUTPUT
................................................................................................................................................................................ 959
11.8.5.10.3 P_RAMP ................................................................................................................................................................................ 961
11.8.5.10.4 PWM................................................................................................................................................................................ 965
11.8.5.10.5 READENC................................................................................................................................................................................ 967
11.8.5.10.6 READENC2
................................................................................................................................................................................ 968
11.8.5.10.7 READENC3
................................................................................................................................................................................ 971
11.8.5.10.8 READENC4
................................................................................................................................................................................ 972
11.8.5.11 Logic
....................................................................................................................................................................................... 974
11.8.5.11.1 Logic................................................................................................................................................................................
Bit 974
11.8.5.11.1.1 RESETBIT
................................................................................................................................................................................ 974
11.8.5.11.1.2 SETBIT
................................................................................................................................................................................ 977
11.8.5.11.1.3 TESTBIT
................................................................................................................................................................................ 979
11.8.5.11.2 Logic................................................................................................................................................................................
Boolean 981
11.8.5.11.2.1 AND ................................................................................................................................................................................ 981
11.8.5.11.2.2 NOT ................................................................................................................................................................................ 982
11.8.5.11.2.3 OR................................................................................................................................................................................ 984
11.8.5.11.2.4 XNOR................................................................................................................................................................................ 985
11.8.5.11.2.5 XOR ................................................................................................................................................................................ 987
11.8.5.11.3 Logic................................................................................................................................................................................
Rotate 988
11.8.5.11.3.1 ROL ................................................................................................................................................................................ 988
11.8.5.11.3.2 ROR ................................................................................................................................................................................ 990
11.8.5.11.4 Logic................................................................................................................................................................................
Shift 992
11.8.5.11.4.1 ASHL................................................................................................................................................................................ 992
11.8.5.11.4.2 ASHR................................................................................................................................................................................ 994
11.8.5.11.4.3 SHL ................................................................................................................................................................................ 996
11.8.5.11.4.4 SHR ................................................................................................................................................................................ 998
11.8.5.12 Math
....................................................................................................................................................................................... 1000
11.8.5.12.1 Math ................................................................................................................................................................................
Basic 1000
11.8.5.12.1.1 ABS
................................................................................................................................................................................ 1000

WPS v2.5X | 13
11.8.5.12.1.2 ADD
................................................................................................................................................................................ 1002
11.8.5.12.1.3 DIV
................................................................................................................................................................................ 1004
11.8.5.12.1.4 MOD
................................................................................................................................................................................ 1006
11.8.5.12.1.5 MUL
................................................................................................................................................................................ 1008
11.8.5.12.1.6 NEG
................................................................................................................................................................................ 1010
11.8.5.12.1.7 SUB
................................................................................................................................................................................ 1012
11.8.5.12.2 Math ................................................................................................................................................................................
Extended 1014
11.8.5.12.2.1 ALOG10
................................................................................................................................................................................ 1014
11.8.5.12.2.2 EXP
................................................................................................................................................................................ 1016
11.8.5.12.2.3 LN................................................................................................................................................................................ 1018
11.8.5.12.2.4 LOG10
................................................................................................................................................................................ 1020
11.8.5.12.2.5 POW
................................................................................................................................................................................ 1021
11.8.5.12.2.6 ROUND
................................................................................................................................................................................ 1023
11.8.5.12.2.7 SQRT
................................................................................................................................................................................ 1024
11.8.5.12.2.8 TRUNC
................................................................................................................................................................................ 1026
11.8.5.12.3 Math ................................................................................................................................................................................
Trigonometry 1027
11.8.5.12.3.1 ACOS
................................................................................................................................................................................ 1027
11.8.5.12.3.2 ASIN
................................................................................................................................................................................ 1029
11.8.5.12.3.3 ATAN
................................................................................................................................................................................ 1031
11.8.5.12.3.4 ATAN2
................................................................................................................................................................................ 1032
11.8.5.12.3.5 COS
................................................................................................................................................................................ 1034
11.8.5.12.3.6 SIN
................................................................................................................................................................................ 1036
11.8.5.12.3.7 TAN
................................................................................................................................................................................ 1037
11.8.5.12.4 Math ................................................................................................................................................................................
Util 1039
11.8.5.12.4.1 MAX
................................................................................................................................................................................ 1039
11.8.5.12.4.2 MIN
................................................................................................................................................................................ 1041
11.8.5.12.4.3 SAT
................................................................................................................................................................................ 1043
11.8.5.13 Module
....................................................................................................................................................................................... 1046
11.8.5.13.1 CALL ................................................................................................................................................................................ 1046
11.8.5.13.2 USERFB
................................................................................................................................................................................ 1047
11.8.5.14 RTC
....................................................................................................................................................................................... 1049
11.8.5.14.1 INTIME
................................................................................................................................................................................ 1049
11.8.5.14.2 INWEEKDAY
................................................................................................................................................................................ 1053
11.8.5.15 Screen
....................................................................................................................................................................................... 1057
11.8.5.15.1 SETSCREEN
................................................................................................................................................................................ 1057
11.8.5.16 String
....................................................................................................................................................................................... 1059
11.8.5.16.1 STR_COMPARE
................................................................................................................................................................................ 1059
11.8.5.16.2 STR_CONCAT
................................................................................................................................................................................ 1063
11.8.5.16.3 STR_COPY
................................................................................................................................................................................ 1064
11.8.5.16.4 STR_COPY_LAST
................................................................................................................................................................................ 1067
11.8.5.16.5 STR_DELETE
................................................................................................................................................................................ 1070
11.8.5.16.6 STR_FIND
................................................................................................................................................................................ 1073
11.8.5.16.7 STR_FIND_LAST
................................................................................................................................................................................ 1076
11.8.5.16.8 STR_INSERT
................................................................................................................................................................................ 1079
11.8.5.16.9 STR_LENGTH
................................................................................................................................................................................ 1082
11.8.5.16.10 STR_REPLACE
................................................................................................................................................................................ 1084
11.8.5.17 Timer
....................................................................................................................................................................................... 1087
11.8.5.17.1 TOF ................................................................................................................................................................................ 1087
11.8.5.17.2 TON ................................................................................................................................................................................ 1089
11.8.5.17.3 TP ................................................................................................................................................................................ 1093
11.8.5.18 Tasks
....................................................................................................................................................................................... 1096
11.8.5.19 Structures
....................................................................................................................................................................................... 1104
11.8.5.20 Recipes
....................................................................................................................................................................................... 1106
11.8.6 Screen
.......................................................................................................................................................................................... 1110

WPS v2.5X | 14
Contents

11.8.6.1 Alarms
....................................................................................................................................................................................... 1110
11.8.6.2 Screen
.......................................................................................................................................................................................
Editor 1115
11.8.7 Event
..........................................................................................................................................................................................
Log 1127
11.8.8 Setup
.......................................................................................................................................................................................... 1136
11.8.8.1 Configuration
....................................................................................................................................................................................... 1136
11.8.8.2 Configuration
.......................................................................................................................................................................................
Window s 1137
11.8.8.2.1 Display
................................................................................................................................................................................ 1137
11.8.8.2.2 Analog
................................................................................................................................................................................ 1137
11.8.8.2.3 Encoder
................................................................................................................................................................................ 1138
11.8.8.2.4 RS232................................................................................................................................................................................ 1138
11.8.8.2.5 RS485................................................................................................................................................................................ 1139
11.8.8.2.6 CAN ................................................................................................................................................................................ 1139
11.8.8.2.7 LAN ................................................................................................................................................................................ 1140
11.8.8.2.8 Modbus
................................................................................................................................................................................
TCP 1140
11.8.8.2.9 Clock................................................................................................................................................................................
Settings 1141
11.8.8.2.10 Language
................................................................................................................................................................................ 1141
11.8.8.2.11 Watchdog
................................................................................................................................................................................ 1142
11.8.9 Com
..........................................................................................................................................................................................
m unication 1142
11.8.9.1 Online
.......................................................................................................................................................................................
Commands 1142
11.8.9.2 Force
.......................................................................................................................................................................................
I/O 1145
11.8.9.3 Dow
.......................................................................................................................................................................................
nload 1147
11.8.9.4 Hot
.......................................................................................................................................................................................
Dow nload 1150
11.8.9.4.1 Overview
................................................................................................................................................................................ 1150
11.8.9.4.2 Enable/Disable
................................................................................................................................................................................
Hot Dow nload 1150
11.8.9.4.3 Restrictions
................................................................................................................................................................................ 1153
11.8.9.4.4 Operation
................................................................................................................................................................................ 1155
11.8.9.5 Upload
....................................................................................................................................................................................... 1157
11.8.9.6 Comparison
.......................................................................................................................................................................................
of resource and device 1158
11.8.9.7 Modbus
.......................................................................................................................................................................................
File Manager 1160
11.8.9.8 Communication
.......................................................................................................................................................................................
RS232 1162
11.8.9.9 Communication
.......................................................................................................................................................................................
RS485 1165
11.9 PSRW
......................................................................................................................................... 1167
11.9.1 Description
.......................................................................................................................................................................................... 1167
11.10 SCA06
......................................................................................................................................... 1167
11.10.1 Description
.......................................................................................................................................................................................... 1167
11.10.2 System
..........................................................................................................................................................................................
Markers 1168
11.10.3 Oriented
..........................................................................................................................................................................................
Start-Up 1172
11.10.4 Auto-Tuning
.......................................................................................................................................................................................... 1176
11.10.5 Im
..........................................................................................................................................................................................
port from WLP 1178
11.10.6 Param
..........................................................................................................................................................................................
eters 1181
11.10.6.1 Overview
....................................................................................................................................................................................... 1181
11.10.6.2 Configuration
....................................................................................................................................................................................... 1183
11.10.6.3 Read
.......................................................................................................................................................................................
and Write of Parameters 1185
11.10.6.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 1188
11.10.6.5 User
.......................................................................................................................................................................................
Parameters 1198
11.10.7 Ladder
.......................................................................................................................................................................................... 1200
11.10.7.1 Coil
....................................................................................................................................................................................... 1200
11.10.7.1.1 DIRECTCOIL
................................................................................................................................................................................ 1200
11.10.7.1.2 IMMEDIATECOIL
................................................................................................................................................................................ 1201
11.10.7.1.3 INVERTEDCOIL
................................................................................................................................................................................ 1203
11.10.7.1.4 RESETCOIL
................................................................................................................................................................................ 1204
11.10.7.1.5 SETCOIL
................................................................................................................................................................................ 1205
11.10.7.1.6 TOGGLECOIL
................................................................................................................................................................................ 1206
11.10.7.2 Communication
.......................................................................................................................................................................................
Netw ork 1208

WPS v2.5X | 15
11.10.7.2.1 CANopen
................................................................................................................................................................................ 1208
11.10.7.2.1.1 CANopen
................................................................................................................................................................................
Overview 1208
11.10.7.2.1.2 CO_SDORead
................................................................................................................................................................................ 1209
11.10.7.2.1.3 CO_SDOWrite
................................................................................................................................................................................ 1213
11.10.7.3 Compare
....................................................................................................................................................................................... 1216
11.10.7.3.1 COMPEQ
................................................................................................................................................................................ 1216
11.10.7.3.2 COMPGE
................................................................................................................................................................................ 1218
11.10.7.3.3 COMPGT
................................................................................................................................................................................ 1220
11.10.7.3.4 COMPLE
................................................................................................................................................................................ 1222
11.10.7.3.5 COMPLT
................................................................................................................................................................................ 1224
11.10.7.3.6 COMPNE
................................................................................................................................................................................ 1226
11.10.7.4 Contact
....................................................................................................................................................................................... 1227
11.10.7.4.1 NCCONTACT
................................................................................................................................................................................ 1227
11.10.7.4.2 NOCONTACT
................................................................................................................................................................................ 1229
11.10.7.4.3 NTSCONTACT
................................................................................................................................................................................ 1230
11.10.7.4.4 PTSCONTACT
................................................................................................................................................................................ 1231
11.10.7.5 Control
....................................................................................................................................................................................... 1233
11.10.7.5.1 PID................................................................................................................................................................................ 1233
11.10.7.6 Conversion
....................................................................................................................................................................................... 1238
11.10.7.6.1 BCD ................................................................................................................................................................................ 1238
11.10.7.6.1.1 BCD_TO_WORD
................................................................................................................................................................................ 1238
11.10.7.6.1.2 WORD_TO_BCD
................................................................................................................................................................................ 1239
11.10.7.6.2 BOOL ................................................................................................................................................................................ 1241
11.10.7.6.2.1 BYTE_TO_BOOL
................................................................................................................................................................................ 1241
11.10.7.6.2.2 DWORD_TO_BOOL
................................................................................................................................................................................ 1242
11.10.7.6.2.3 LREAL_TO_BOOL
................................................................................................................................................................................ 1244
11.10.7.6.2.4 REAL_TO_BOOL
................................................................................................................................................................................ 1245
11.10.7.6.2.5 WORD_TO_BOOL
................................................................................................................................................................................ 1247
11.10.7.6.3 BYTE ................................................................................................................................................................................ 1248
11.10.7.6.3.1 BOOL_TO_BYTE
................................................................................................................................................................................ 1248
11.10.7.6.3.2 DWORD_TO_BYTE
................................................................................................................................................................................ 1250
11.10.7.6.3.3 DWORD_TO_BYTES
................................................................................................................................................................................ 1251
11.10.7.6.3.4 LREAL_TO_BYTE
................................................................................................................................................................................ 1254
11.10.7.6.3.5 REAL_TO_BYTE
................................................................................................................................................................................ 1255
11.10.7.6.3.6 WORD_TO_BYTE
................................................................................................................................................................................ 1257
11.10.7.6.3.7 WORD_TO_BYTES
................................................................................................................................................................................ 1258
11.10.7.6.4 DWORD................................................................................................................................................................................ 1261
11.10.7.6.4.1 BOOL_TO_DWORD
................................................................................................................................................................................ 1261
11.10.7.6.4.2 BYTE_TO_DWORD
................................................................................................................................................................................ 1262
11.10.7.6.4.3 BYTES_TO_DWORD
................................................................................................................................................................................ 1263
11.10.7.6.4.4 LREAL_TO_DWORD
................................................................................................................................................................................ 1265
11.10.7.6.4.5 REAL_TO_DWORD
................................................................................................................................................................................ 1266
11.10.7.6.4.6 WORD_TO_DWORD
................................................................................................................................................................................ 1268
11.10.7.6.4.7 WORDS_TO_DWORD
................................................................................................................................................................................ 1269
11.10.7.6.5 LREAL................................................................................................................................................................................ 1271
11.10.7.6.5.1 BOOL_TO_LREAL
................................................................................................................................................................................ 1271
11.10.7.6.5.2 BYTE_TO_LREAL
................................................................................................................................................................................ 1272
11.10.7.6.5.3 DWORD_TO_LREAL
................................................................................................................................................................................ 1273
11.10.7.6.5.4 REAL_TO_LREAL
................................................................................................................................................................................ 1274
11.10.7.6.5.5 WORD_TO_LREAL
................................................................................................................................................................................ 1275
11.10.7.6.6 Rad-Deg
................................................................................................................................................................................ 1276
11.10.7.6.6.1 DEG_TO_RAD
................................................................................................................................................................................ 1276
11.10.7.6.6.2 RAD_TO_DEG
................................................................................................................................................................................ 1277
11.10.7.6.7 REAL ................................................................................................................................................................................ 1279

WPS v2.5X | 16
Contents

11.10.7.6.7.1 BOOL_TO_REAL
................................................................................................................................................................................ 1279
11.10.7.6.7.2 BYTE_TO_REAL
................................................................................................................................................................................ 1280
11.10.7.6.7.3 DWORD_TO_REAL
................................................................................................................................................................................ 1282
11.10.7.6.7.4 LREAL_TO_REAL
................................................................................................................................................................................ 1283
11.10.7.6.7.5 WORD_TO_REAL
................................................................................................................................................................................ 1284
11.10.7.6.8 WORD ................................................................................................................................................................................ 1286
11.10.7.6.8.1 BOOL_TO_WORD
................................................................................................................................................................................ 1286
11.10.7.6.8.2 BYTE_TO_WORD
................................................................................................................................................................................ 1287
11.10.7.6.8.3 BYTES_TO_WORD
................................................................................................................................................................................ 1289
11.10.7.6.8.4 DWORD_TO_WORD
................................................................................................................................................................................ 1290
11.10.7.6.8.5 DWORD_TO_WORDS
................................................................................................................................................................................ 1292
11.10.7.6.8.6 LREAL_TO_WORD
................................................................................................................................................................................ 1294
11.10.7.6.8.7 REAL_TO_WORD
................................................................................................................................................................................ 1295
11.10.7.7 Counter
....................................................................................................................................................................................... 1297
11.10.7.7.1 CTD ................................................................................................................................................................................ 1297
11.10.7.7.2 CTU ................................................................................................................................................................................ 1300
11.10.7.7.3 CTUD ................................................................................................................................................................................ 1303
11.10.7.8 Data
.......................................................................................................................................................................................
Transfer 1308
11.10.7.8.1 ARRAYCOPY
................................................................................................................................................................................ 1308
11.10.7.8.2 DEMUX................................................................................................................................................................................ 1311
11.10.7.8.3 DEMUX2
................................................................................................................................................................................ 1314
11.10.7.8.4 ILOAD................................................................................................................................................................................ 1316
11.10.7.8.5 ILOADBOOL
................................................................................................................................................................................ 1318
11.10.7.8.6 ISTORE
................................................................................................................................................................................ 1319
11.10.7.8.7 ISTOREBOOL
................................................................................................................................................................................ 1321
11.10.7.8.8 MUX ................................................................................................................................................................................ 1323
11.10.7.8.9 MUX2 ................................................................................................................................................................................ 1326
11.10.7.8.10 SCALE ................................................................................................................................................................................ 1328
11.10.7.8.11 SEL................................................................................................................................................................................ 1331
11.10.7.8.12 STORE ................................................................................................................................................................................ 1333
11.10.7.8.13 SWAP ................................................................................................................................................................................ 1335
11.10.7.8.14 SWAP2 ................................................................................................................................................................................ 1336
11.10.7.8.15 USERERR ................................................................................................................................................................................ 1338
11.10.7.9 Filter
....................................................................................................................................................................................... 1341
11.10.7.9.1 LOWPASS
................................................................................................................................................................................ 1341
11.10.7.10 Hardw
.......................................................................................................................................................................................
are 1344
11.10.7.10.1 IMMEDIATE_INPUT
................................................................................................................................................................................ 1344
11.10.7.10.2 IMMEDIATE_OUTPUT
................................................................................................................................................................................ 1346
11.10.7.10.3 READENC5................................................................................................................................................................................ 1348
11.10.7.11 Logic
....................................................................................................................................................................................... 1351
11.10.7.11.1 Logic ................................................................................................................................................................................
Bit 1351
11.10.7.11.1.1 RESETBIT
................................................................................................................................................................................ 1351
11.10.7.11.1.2 SETBIT................................................................................................................................................................................ 1353
11.10.7.11.1.3 TESTBIT
................................................................................................................................................................................ 1355
11.10.7.11.2 Logic ................................................................................................................................................................................
Boolean 1357
11.10.7.11.2.1 AND ................................................................................................................................................................................ 1357
11.10.7.11.2.2 NOT ................................................................................................................................................................................ 1358
11.10.7.11.2.3 OR ................................................................................................................................................................................ 1360
11.10.7.11.2.4 XNOR ................................................................................................................................................................................ 1361
11.10.7.11.2.5 XOR ................................................................................................................................................................................ 1363
11.10.7.11.3 Logic ................................................................................................................................................................................
Rotate 1364
11.10.7.11.3.1 ROL ................................................................................................................................................................................ 1364
11.10.7.11.3.2 ROR ................................................................................................................................................................................ 1366
11.10.7.11.4 Logic ................................................................................................................................................................................
Shift 1368

WPS v2.5X | 17
11.10.7.11.4.1 ASHL ................................................................................................................................................................................ 1368
11.10.7.11.4.2 ASHR ................................................................................................................................................................................ 1370
11.10.7.11.4.3 SHL ................................................................................................................................................................................ 1372
11.10.7.11.4.4 SHR ................................................................................................................................................................................ 1374
11.10.7.12 Math
....................................................................................................................................................................................... 1376
11.10.7.12.1 Math ................................................................................................................................................................................
Basic 1376
11.10.7.12.1.1 ABS ................................................................................................................................................................................ 1376
11.10.7.12.1.2 ADD ................................................................................................................................................................................ 1378
11.10.7.12.1.3 DIV ................................................................................................................................................................................ 1380
11.10.7.12.1.4 MOD ................................................................................................................................................................................ 1382
11.10.7.12.1.5 MUL ................................................................................................................................................................................ 1384
11.10.7.12.1.6 NEG ................................................................................................................................................................................ 1386
11.10.7.12.1.7 SUB ................................................................................................................................................................................ 1388
11.10.7.12.2 Math ................................................................................................................................................................................
Extended 1390
11.10.7.12.2.1 ALOG10
................................................................................................................................................................................ 1390
11.10.7.12.2.2 EXP ................................................................................................................................................................................ 1392
11.10.7.12.2.3 LN ................................................................................................................................................................................ 1394
11.10.7.12.2.4 LOG10................................................................................................................................................................................ 1396
11.10.7.12.2.5 POW ................................................................................................................................................................................ 1397
11.10.7.12.2.6 ROUND................................................................................................................................................................................ 1399
11.10.7.12.2.7 SQRT ................................................................................................................................................................................ 1400
11.10.7.12.2.8 TRUNC................................................................................................................................................................................ 1402
11.10.7.12.3 Math ................................................................................................................................................................................
Trigonometry 1403
11.10.7.12.3.1 ACOS ................................................................................................................................................................................ 1403
11.10.7.12.3.2 ASIN ................................................................................................................................................................................ 1405
11.10.7.12.3.3 ATAN ................................................................................................................................................................................ 1407
11.10.7.12.3.4 ATAN2................................................................................................................................................................................ 1408
11.10.7.12.3.5 COS ................................................................................................................................................................................ 1410
11.10.7.12.3.6 SIN ................................................................................................................................................................................ 1412
11.10.7.12.3.7 TAN ................................................................................................................................................................................ 1413
11.10.7.12.4 Math ................................................................................................................................................................................
Util 1415
11.10.7.12.4.1 MAX ................................................................................................................................................................................ 1415
11.10.7.12.4.2 MIN ................................................................................................................................................................................ 1417
11.10.7.12.4.3 SAT ................................................................................................................................................................................ 1419
11.10.7.13 Module
....................................................................................................................................................................................... 1422
11.10.7.13.1 CALL ................................................................................................................................................................................ 1422
11.10.7.13.2 USERFB ................................................................................................................................................................................ 1423
11.10.7.13.3 Working................................................................................................................................................................................
w ith USERFBs 1425
11.10.7.13.3.1 Creating
................................................................................................................................................................................
USERFBs 1425
11.10.7.13.3.2 Adding
................................................................................................................................................................................
input/output 1427
11.10.7.13.3.3 Editing
................................................................................................................................................................................
the Ladder 1430
11.10.7.13.3.4 Using................................................................................................................................................................................
USERFBs 1431
11.10.7.14 Motion
.......................................................................................................................................................................................
Control 1432
11.10.7.14.1 Motion ................................................................................................................................................................................
Control Cam 1432
11.10.7.14.1.1 MC_CamIn
................................................................................................................................................................................ 1432
11.10.7.14.1.2 MC_CamOut
................................................................................................................................................................................ 1437
11.10.7.14.1.3 MC_CamTableSelect
................................................................................................................................................................................ 1439
11.10.7.14.1.4 MW_CamCalc
................................................................................................................................................................................ 1441
11.10.7.14.2 Motion ................................................................................................................................................................................
Control Command 1446
11.10.7.14.2.1 MC_Pow
................................................................................................................................................................................
er 1446
11.10.7.14.2.2 MC_Reset
................................................................................................................................................................................ 1449
11.10.7.14.2.3 MC_Stop
................................................................................................................................................................................ 1451
11.10.7.14.2.4 MW_IqControl
................................................................................................................................................................................ 1455
11.10.7.14.3 Motion ................................................................................................................................................................................
Control Gear 1457

WPS v2.5X | 18
Contents

11.10.7.14.3.1 MC_GearIn
................................................................................................................................................................................ 1457
11.10.7.14.3.2 MC_GearInPos
................................................................................................................................................................................ 1462
11.10.7.14.3.3 MC_GearOut
................................................................................................................................................................................ 1465
11.10.7.14.3.4 MC_PhasingRelative
................................................................................................................................................................................ 1466
11.10.7.14.4 Motion ................................................................................................................................................................................
Control Homing 1469
11.10.7.14.4.1 MC_FinishHoming
................................................................................................................................................................................ 1469
11.10.7.14.4.2 MC_HomeDirect
................................................................................................................................................................................ 1470
11.10.7.14.4.3 MC_StepAbsoluteSw
................................................................................................................................................................................
itch 1473
11.10.7.14.4.4 MC_StepLimitSw
................................................................................................................................................................................
itch 1477
11.10.7.14.4.5 MC_StepReferencePulse
................................................................................................................................................................................ 1480
11.10.7.14.5 Motion ................................................................................................................................................................................
Control Move 1483
11.10.7.14.5.1 MC_MoveAbsolute
................................................................................................................................................................................ 1483
11.10.7.14.5.2 MC_MoveRelative
................................................................................................................................................................................ 1489
11.10.7.14.5.3 MC_MoveVelocity
................................................................................................................................................................................ 1495
11.10.7.15 RTC ....................................................................................................................................................................................... 1500
11.10.7.15.1 INTIME ................................................................................................................................................................................ 1500
11.10.7.15.2 INWEEKDAY................................................................................................................................................................................ 1503
11.10.7.16 Timer
....................................................................................................................................................................................... 1507
11.10.7.16.1 TOF ................................................................................................................................................................................ 1507
11.10.7.16.2 TON ................................................................................................................................................................................ 1509
11.10.7.16.3 TP ................................................................................................................................................................................ 1513
11.10.7.17 Cam .......................................................................................................................................................................................
Profiles 1516
11.10.7.18 Structures
....................................................................................................................................................................................... 1527
11.10.8 Diagnostic
.......................................................................................................................................................................................... 1530
11.10.8.1 Monitoring
.......................................................................................................................................................................................
Panel 1530
11.10.8.1.1 Main ................................................................................................................................................................................
Signals 1530
11.10.8.2 Log
....................................................................................................................................................................................... 1531
11.10.8.2.1 Overview
................................................................................................................................................................................ 1531
11.10.8.2.2 Configuration
................................................................................................................................................................................ 1532
11.10.8.3 Trace
....................................................................................................................................................................................... 1533
11.10.8.3.1 Overview
................................................................................................................................................................................ 1533
11.10.8.3.2 Configuration
................................................................................................................................................................................ 1534
11.11 SSW-06
......................................................................................................................................... 1540
11.11.1 Description
.......................................................................................................................................................................................... 1540
11.11.2 Param
..........................................................................................................................................................................................
eters 1541
11.11.2.1 Overview
....................................................................................................................................................................................... 1541
11.11.2.2 Configuration
....................................................................................................................................................................................... 1542
11.11.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 1545
11.11.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 1548
11.11.2.5 User
.......................................................................................................................................................................................
Parameters 1558
11.12 SSW-07
......................................................................................................................................... 1560
11.12.1 Description
.......................................................................................................................................................................................... 1560
11.12.2 Param
..........................................................................................................................................................................................
eters 1561
11.12.2.1 Overview
....................................................................................................................................................................................... 1561
11.12.2.2 Configuration
....................................................................................................................................................................................... 1563
11.12.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 1565
11.12.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 1568
11.12.2.5 User
.......................................................................................................................................................................................
Parameters 1578
11.13 SSW-08
......................................................................................................................................... 1580
11.13.1 Description
.......................................................................................................................................................................................... 1580
11.13.2 Param
..........................................................................................................................................................................................
eters 1581
11.13.2.1 Overview
....................................................................................................................................................................................... 1581
11.13.2.2 Configuration
....................................................................................................................................................................................... 1583

WPS v2.5X | 19
11.13.2.3 Read
.......................................................................................................................................................................................
and Write of Parameters 1585
11.13.2.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters 1588
11.13.2.5 User
.......................................................................................................................................................................................
Parameters 1598
11.14 SSW900
......................................................................................................................................... 1600
11.14.1 Description
.......................................................................................................................................................................................... 1600
11.14.2 I/O's
.......................................................................................................................................................................................... 1601
11.14.3 System
..........................................................................................................................................................................................
Markers 1601
11.14.4 Volatile
..........................................................................................................................................................................................
Markers 1605
11.14.5 Im
..........................................................................................................................................................................................
port from WLP 1606
11.14.6 Param
..........................................................................................................................................................................................
eters 1609
11.14.6.1 Overview
....................................................................................................................................................................................... 1609
11.14.6.2 Configuration
....................................................................................................................................................................................... 1611
11.14.6.3 Read
.......................................................................................................................................................................................
and Write of Parameters 1613
11.14.6.4 Hide/Unhide
.......................................................................................................................................................................................
Parameters and Group of Parameters_2 1616
11.14.6.5 User
.......................................................................................................................................................................................
Parameters 1626
11.14.7 Ladder
.......................................................................................................................................................................................... 1628
11.14.7.1 Coil
....................................................................................................................................................................................... 1628
11.14.7.1.1 DIRECTCOIL
................................................................................................................................................................................ 1628
11.14.7.1.2 INVERTEDCOIL
................................................................................................................................................................................ 1629
11.14.7.1.3 RESETCOIL
................................................................................................................................................................................ 1631
11.14.7.1.4 SETCOIL
................................................................................................................................................................................ 1632
11.14.7.1.5 TOGGLECOIL
................................................................................................................................................................................ 1633
11.14.7.2 Communication
.......................................................................................................................................................................................
Netw ork 1634
11.14.7.2.1 Modbus
................................................................................................................................................................................
RTU 1634
11.14.7.2.1.1 Modbus
................................................................................................................................................................................
RTU Overview 1634
11.14.7.2.1.2 MB_MasterControlStatus
................................................................................................................................................................................ 1635
11.14.7.2.1.3 MB_ReadBinary
................................................................................................................................................................................ 1637
11.14.7.2.1.4 MB_ReadRegister
................................................................................................................................................................................ 1641
11.14.7.2.1.5 MB_SlaveStatus
................................................................................................................................................................................ 1645
11.14.7.2.1.6 MB_WriteBinary
................................................................................................................................................................................ 1647
11.14.7.2.1.7 MB_WriteRegister
................................................................................................................................................................................ 1651
11.14.7.3 Compare
....................................................................................................................................................................................... 1655
11.14.7.3.1 COMP_EQ
................................................................................................................................................................................ 1655
11.14.7.3.2 COMP_GE
................................................................................................................................................................................ 1657
11.14.7.3.3 COMP_GT
................................................................................................................................................................................ 1659
11.14.7.3.4 COMP_LE
................................................................................................................................................................................ 1661
11.14.7.3.5 COMP_LT
................................................................................................................................................................................ 1663
11.14.7.3.6 COMP_NE
................................................................................................................................................................................ 1665
11.14.7.4 Contact
....................................................................................................................................................................................... 1666
11.14.7.4.1 NCCONTACT
................................................................................................................................................................................ 1666
11.14.7.4.2 NOCONTACT
................................................................................................................................................................................ 1668
11.14.7.4.3 NTSCONTACT
................................................................................................................................................................................ 1669
11.14.7.4.4 PTSCONTACT
................................................................................................................................................................................ 1670
11.14.7.5 Control
....................................................................................................................................................................................... 1672
11.14.7.5.1 PID................................................................................................................................................................................ 1672
11.14.7.6 Conversion
....................................................................................................................................................................................... 1677
11.14.7.6.1 BOOL ................................................................................................................................................................................ 1677
11.14.7.6.1.1 BYTE_TO_BOOL
................................................................................................................................................................................ 1677
11.14.7.6.1.2 DWORD_TO_BOOL
................................................................................................................................................................................ 1679
11.14.7.6.1.3 REAL_TO_BOOL
................................................................................................................................................................................ 1680
11.14.7.6.1.4 WORD_TO_BOOL
................................................................................................................................................................................ 1682
11.14.7.6.2 BYTE ................................................................................................................................................................................ 1683
11.14.7.6.2.1 BOOL_TO_BYTE
................................................................................................................................................................................ 1683
11.14.7.6.2.2 DWORD_TO_BYTE
................................................................................................................................................................................ 1685

WPS v2.5X | 20
Contents

11.14.7.6.2.3 REAL_TO_BYTE
................................................................................................................................................................................ 1686
11.14.7.6.2.4 WORD_TO_BYTE
................................................................................................................................................................................ 1688
11.14.7.6.3 DWORD................................................................................................................................................................................ 1690
11.14.7.6.3.1 BOOL_TO_DWORD
................................................................................................................................................................................ 1690
11.14.7.6.3.2 BYTE_TO_DWORD
................................................................................................................................................................................ 1691
11.14.7.6.3.3 REAL_TO_DWORD
................................................................................................................................................................................ 1693
11.14.7.6.3.4 WORD_TO_DWORD
................................................................................................................................................................................ 1694
11.14.7.6.4 REAL ................................................................................................................................................................................ 1696
11.14.7.6.4.1 BOOL_TO_REAL
................................................................................................................................................................................ 1696
11.14.7.6.4.2 BYTE_TO_REAL
................................................................................................................................................................................ 1697
11.14.7.6.4.3 DWORD_TO_REAL
................................................................................................................................................................................ 1699
11.14.7.6.4.4 WORD_TO_REAL
................................................................................................................................................................................ 1700
11.14.7.6.5 WORD ................................................................................................................................................................................ 1702
11.14.7.6.5.1 BOOL_TO_WORD
................................................................................................................................................................................ 1702
11.14.7.6.5.2 BYTE_TO_WORD
................................................................................................................................................................................ 1703
11.14.7.6.5.3 DWORD_TO_WORD
................................................................................................................................................................................ 1705
11.14.7.6.5.4 REAL_TO_WORD
................................................................................................................................................................................ 1706
11.14.7.7 Counter
....................................................................................................................................................................................... 1708
11.14.7.7.1 CTD ................................................................................................................................................................................ 1708
11.14.7.7.2 CTU ................................................................................................................................................................................ 1711
11.14.7.7.3 CTUD ................................................................................................................................................................................ 1714
11.14.7.8 Data
.......................................................................................................................................................................................
Transfer 1719
11.14.7.8.1 DEMUX................................................................................................................................................................................ 1719
11.14.7.8.2 ILOAD................................................................................................................................................................................ 1721
11.14.7.8.3 ILOADBOOL
................................................................................................................................................................................ 1722
11.14.7.8.4 ISTORE
................................................................................................................................................................................ 1724
11.14.7.8.5 ISTOREBOOL
................................................................................................................................................................................ 1725
11.14.7.8.6 MUX ................................................................................................................................................................................ 1727
11.14.7.8.7 SEL................................................................................................................................................................................ 1730
11.14.7.8.8 STORE................................................................................................................................................................................ 1732
11.14.7.8.9 USERERR
................................................................................................................................................................................ 1734
11.14.7.9 Filter
....................................................................................................................................................................................... 1735
11.14.7.9.1 LOWPASS
................................................................................................................................................................................ 1735
11.14.7.10 Logic
....................................................................................................................................................................................... 1737
11.14.7.10.1 Logic ................................................................................................................................................................................
Bit 1737
11.14.7.10.1.1 RESETBIT
................................................................................................................................................................................ 1737
11.14.7.10.1.2 SETBIT................................................................................................................................................................................ 1739
11.14.7.10.1.3 TESTBIT
................................................................................................................................................................................ 1741
11.14.7.10.2 Logic ................................................................................................................................................................................
Boolean 1743
11.14.7.10.2.1 AND ................................................................................................................................................................................ 1743
11.14.7.10.2.2 NOT ................................................................................................................................................................................ 1744
11.14.7.10.2.3 OR ................................................................................................................................................................................ 1746
11.14.7.10.2.4 XNOR ................................................................................................................................................................................ 1747
11.14.7.10.2.5 XOR ................................................................................................................................................................................ 1749
11.14.7.10.3 Logic ................................................................................................................................................................................
Rotate 1750
11.14.7.10.3.1 ROL ................................................................................................................................................................................ 1750
11.14.7.10.3.2 ROR ................................................................................................................................................................................ 1752
11.14.7.10.4 Logic ................................................................................................................................................................................
Shift 1754
11.14.7.10.4.1 ASHL ................................................................................................................................................................................ 1754
11.14.7.10.4.2 ASHR ................................................................................................................................................................................ 1756
11.14.7.10.4.3 SHL ................................................................................................................................................................................ 1758
11.14.7.10.4.4 SHR ................................................................................................................................................................................ 1760
11.14.7.11 Math
....................................................................................................................................................................................... 1762
11.14.7.11.1 Math ................................................................................................................................................................................
Basic 1762

WPS v2.5X | 21
11.14.7.11.1.1 ABS ................................................................................................................................................................................ 1762
11.14.7.11.1.2 ADD ................................................................................................................................................................................ 1764
11.14.7.11.1.3 DIV ................................................................................................................................................................................ 1766
11.14.7.11.1.4 MOD ................................................................................................................................................................................ 1768
11.14.7.11.1.5 MUL ................................................................................................................................................................................ 1770
11.14.7.11.1.6 NEG ................................................................................................................................................................................ 1772
11.14.7.11.1.7 SUB ................................................................................................................................................................................ 1774
11.14.7.11.2 Math ................................................................................................................................................................................
Extended 1776
11.14.7.11.2.1 ALOG10................................................................................................................................................................................ 1776
11.14.7.11.2.2 EXP ................................................................................................................................................................................ 1778
11.14.7.11.2.3 LN ................................................................................................................................................................................ 1780
11.14.7.11.2.4 LOG10 ................................................................................................................................................................................ 1782
11.14.7.11.2.5 POW ................................................................................................................................................................................ 1783
11.14.7.11.2.6 ROUND ................................................................................................................................................................................ 1785
11.14.7.11.2.7 SQRT ................................................................................................................................................................................ 1786
11.14.7.11.2.8 TRUNC ................................................................................................................................................................................ 1788
11.14.7.11.3 Math ................................................................................................................................................................................
Trigonometry 1789
11.14.7.11.3.1 ACOS ................................................................................................................................................................................ 1789
11.14.7.11.3.2 ASIN ................................................................................................................................................................................ 1791
11.14.7.11.3.3 ATAN ................................................................................................................................................................................ 1793
11.14.7.11.3.4 ATAN2 ................................................................................................................................................................................ 1794
11.14.7.11.3.5 COS ................................................................................................................................................................................ 1796
11.14.7.11.3.6 SIN ................................................................................................................................................................................ 1798
11.14.7.11.3.7 TAN ................................................................................................................................................................................ 1799
11.14.7.11.4 Math ................................................................................................................................................................................
Util 1801
11.14.7.11.4.1 MAX ................................................................................................................................................................................ 1801
11.14.7.11.4.2 MIN ................................................................................................................................................................................ 1803
11.14.7.11.4.3 SAT ................................................................................................................................................................................ 1805
11.14.7.12 Module
....................................................................................................................................................................................... 1808
11.14.7.12.1 USERFB ................................................................................................................................................................................ 1808
11.14.7.13 Timer
....................................................................................................................................................................................... 1809
11.14.7.13.1 TOF ................................................................................................................................................................................ 1809
11.14.7.13.2 TON ................................................................................................................................................................................ 1812
11.14.7.13.3 TP ................................................................................................................................................................................ 1816
11.14.7.14 RTC....................................................................................................................................................................................... 1819
11.14.7.14.1 INTIME ................................................................................................................................................................................ 1819
11.14.7.14.2 INWEEKDAY
................................................................................................................................................................................ 1823
11.14.7.15 Structures
....................................................................................................................................................................................... 1827
11.14.8 Com
..........................................................................................................................................................................................
m unication 1829
11.14.8.1 Force
.......................................................................................................................................................................................
I/O 1829

12 WComm
..........................................................................................................1832
12.1 Introduction
......................................................................................................................................... 1832
12.2 Configuration
......................................................................................................................................... 1834
12.2.1 Menus
.......................................................................................................................................................................................... 1834
12.2.2 Quickstart
..........................................................................................................................................................................................
Guide for FTP 1838
12.2.3 Configuration
..........................................................................................................................................................................................
File 1841
12.3 Add/Remove
.........................................................................................................................................
Connections 1845

Index 1848

WPS v2.5X | 22
WPS v2.5X

1 WPS v2.5X

Technical Support: Contact a local branch or representative.

Contact us: http://www.weg.net

Publication date: 03/2019

Start

Click the Welcome button to start.

Welcome

WPS v2.5X | 23
Introduction

2 Introduction
2.1 Welcome
Welcome to the WPS!

WPS v2.5X is an innovative integrated tool to access several families of WEG products, adding the concepts
of:

Multi-Products, aiming at meeting wide range of WEG products;


Multi-Use, in order to enable:
o Equipment configuration,
o Equipment programming in Ladder language,
o Monitoring of equipment, and
o Assistance for creation and configuration of applications in the automation area.

The programming environment of the Ladder language meets the requirements of IEC 61131-3.

It is strongly recommended that the user is familiar with these guidelines and concepts that this standard
presents in order to use the software optimally.

2.2 System Requirements


Item Description
Plataform Window s 7 or greater
Minimum: Core i3
Processor
Recommended: Core i5
Minimum: 1 GB
Memory
Recommended: 4 GB
Screen Resolution 1024x768 or greater
Disk Space 2 GB
Communication USB, Ethernet TCP/IP and Serial Port

2.3 Supported Equipments


The following table shows the equipments and firmware versions supported by WPS v2.5X :

WPS v2.5X | 24
Introduction

Ladder Available
Equipm ent Trace Trend Param eters
WLP WPS
PLC300 - v1.76+ - v1.76+ v1.76+
SCA06 <v2.00 v2.00+ v1.10+ v1.10+ v1.10+
CFW300 - v1.00+ - v1.00+ v1.00+
CVW500 v1.00+ - - v1.00+ v1.00+

PSRW - - - v1.00+ v1.00+


SSW900 - v1.10+ - v1.00+ v1.00+
CFW100 <v3.00 v3.00+ - v3.00+ v3.00+
CFW-11 v1.00+ - v1.00+ v1.00+ v1.00+

CFW500 v1.10+ - - v1.10+ v1.10+

CFW501 v1.30+ - - v1.30+ v1.30+

MW500 v1.50+ - - v1.50+ v1.50+

SSW06 v1.40+ - - v1.30+ v1.30+

SSW07 - - - v1.20+ v1.20+

SSW08 - - - v1.30+ v1.30+

WLP: WEG Ladder Programming

2.4 Copyright Notice


This computer program is protected by international treaties and copyright laws. Its partial or total
reproduction or distribution without previous authorization may result in several civil and criminal penalties,
subject to penalties provided in the law.

2.5 Safety Notice


Using this software may alter the drive's operation and performance. The user is responsible for adopting the
necessary precautions in order to guarantee the safety of the equipment and persons involved. Before
applying this Software, carefully read the Online Help Instructions. Non compliance with these instructions
may cause serious damage to the device and result in severe bodily injury.

WPS v2.5X | 25
What's New

3 What's New
3.1 What's New - This Version
WPS v2.5X

New Functions:

Included CFW500 V1.10+;


Included CFW501 V1.30+;
Included MW500 V1.50+;
Included CFW-11 V1.00+;
Included SSW06 V1.30;
Included SSW07 V1.20;
Included SSW08 V1.30.

Enhancements:

Corrections in the manual (help).

3.2 What's New - Previous Versions


WPS V2.40

Functionalities:

Configuration Wizard for CFW300, PSRW, SSW900;


Main signal monitoring window's - CFW300, SSW900;
CALL block for PLC300 since V3.41 and V4.11 (according to hardware model);
USB driver enabling communication with PSRW;
Enhanced search system (includes search by blocks, indexed variables, texts).

Improvements:

Corrections in the manual (help);


WComm (communication manager supporting FTP protocol);
WEG USB driver supports Windows 10 (x86 and x64) - including build 1607 or newer;
New markers addresses for setting up HMI LEDs (PLC300 V4.1X).

WPS V2.30

Functionalities:

Included CFW300 V1.0X and V1.2X;


Included PLC300 V3.3X;
Windows 10 support (x86 and x64);
Automatic installation of the WEG USB driver;
Automatic installation of the FTDI driver;
Welcome window with quick access to some functions;
Improved communication configuration.

Improvements:

WPS v2.5X | 26
What's New

Improved performance and trend graph interface;


Improved organization of menus.

WPS V2.20

Functionalities:

Function to remove unused variables


Function to search and replace variables in the resource
Variables filter option inside the variables table

Improvements:

JRE (Java) embedded into WPS installation


Improvements in trend performance
Improvements in design, icons, windows ...
Main resource set was simplified
Menu actions restructured and actions sensitive to the context
Configuration import with validation of .bkp file
Alphabetic ordering of configurations and resources
Support to bitfields in parameters table
Parameter monitoring inside ladder

WPS V2.10

Functionalities:

PLC300 v2.30 with support to Hot Download and Watchdog


Importer/Conversor from WLP Projects to WPS to the equipment SCA06
Full impression of configurations and resources
Variables Monitoring with functionality to backup and restore variables values
Created window with information about the device connected
Create window with additional information such author, description and client about the resource

Improvements:

WPS Help rewriten to all ladder blocks


Window of variable selection changed to a table format with filter options
Move variables from one block to another in the ladder editor
Search of variables with filters
Support the movement of multiple variables simultaniously in structures and also record of last type added
for future additions
USB Driver with support to Windows 8.1

WPS V2.00

Functionalities:

Support to SCA06 starting at firmware version v2.00, agregatting the functios of SuperDrive G2 and WLP
PLC300 v2.10 with support to Strings

WPS v2.5X | 27
What's New

WPS V1.80

Functionalities:

PLC300 V2.00 Support (Hardware Version 2)


P_RAMP Block (Pulse Train)

WPS V1.70

Functionalities:

Upload and download variable data, this function allows to preserve variables values during the program
download. This function is compatible with firmware v1.70 or above.
Export and download binaries
Creation of "text input" component on screen editor

Improvements:

Project management:
Creation of multiple CANopen configurations
Possibility of association of a ladder to a task on the last wizard step during the new ladder wizard
Ladder editor:
Optimization in ladder diagram editor, reducing the use of CPU and memory
Dragging variable from variables list and dropping it into the block argument
RUNG title length increased
Number of elements per RUNG increased
Automatic tag break
Screen name display during configuration of F buttons in screen editor
Optimization in monitoring to reduce the response time
Optimization in compiler to reduce compile-time
Clock synchronization between the computer clock and project setup

Corrections:

Correction during removal of POU from task, where changes are not saved when another action is not made
in sequence
Correction in the compiler when the same POU was linked to more than one task
Correction of lock during the load of variables table when large structure type is used
Correction for performance increase during search of structure fields
When the component "numeric input" was configured as INT and contains decimal digits the limit values
were not being compiled correctly
Unset of main selection during resource version change
Function keys were not working when used with variables of type BOOL with size bigger than 0 (zero), the
compiler was not generating the correct memory address for this variables
SD Card password was being stored even with the related option disabled, the compiler was not checking
the signal of SD Card password
During compiling errors where the variable does not exist anymore, the compiler was not displaying the
variable name
When two variable nodes of structures were expanded on variables table at the same time one of the
structures displays the variables names as ???
The variables sampled in event log were not displaying the correct values
Correction of functional deviation in the compiler when any argument from the USERFB was a member of a

WPS v2.5X | 28
What's New

structure or an instance. In this case the number of bits that was being considered was the size of the
whole structure, when the correct should be only the size of this member
Correction of functional deviation in the compiler when distinct ladders were calling USERFB instances with
the same name, occasionally, the compiler was inverting the call of USERFB's. The compiler was
overwriting the arguments file from the USERFB, when the name of instance was the same
Do not allow creation of folder and files related to USERFB with invalid names
Block of "text" component editing when it reaches his limit size
Alarm compilation was not displaying correct variables names in case of compiling errors
Correction of validation on new task creation
During compilation in case of duplicated variables the compiler was not displaying the duplicated variable
name
Correction into resource comparison, in specific situations in Ladder files, some small differences are not
being detected by the function

WPS V1.60

Functionalities:

USERFB User Function Block


Comparison of the resource in the application to a resource of the device
Download of the device setup and CANopen configuration
New faster and easy-to-use screen editor
Options to enable and disable alarms on the editor

Improvements:

Project management:
"Save as..." in the resource configuration
"Search" for the variables in all the resource
Properties of the resource folder
Edition of structure members
Indication in the files open on the editor if they belong to the main selection
Highlight on the programs not used in any tasks
Link on the output window of the compiler
Alarm keys:
Automatic resizing of the Message component
Shortcut keys in the alarm edition
Printing of the screens with their properties
Ladder editor:
Allow to change the contact or coil type already inserted in the ladder
Change of the output variables of the BYTE counters for BOOL to use in contacts
Variables:
Possibility to erase multiple variables from the variable window
Disable the variable window when closing or changing the resource selection
Selection of the variable address by means of the Modbus address

Corrections:

Increase of the number of retries before displaying the error messages during the online monitoring
Correction of fault when saving the renamed variables. After renaming the variables, the save button was not
being enabled and the changes were not being saved.
Change of the default .csv variable importation file from "," to ";".
Locking of the renaming action in the GLOBAL_IO group.

WPS v2.5X | 29
What's New

Change of the maximum memory area size of the screens


Compiler presented error when compiling structure with invalid element. Change to accept repeated variables
in GLOBAL_IO group.
32-bit data types (DWORD, DINT, UDINT, REAL) enabled for the network variables
Fault in the compilation of the watchdog variables of the start, stop and main tasks
Fault in the compilation of String variables using the STRING# syntax in the ReadRecipe and WriteRecipe
blocks. Correction to generate error in this situation
Fault when using the STORE block of a REAL variable for a member of a REAL structure
Correction of a fault when saving the monitoring variables. The new variables created were not being saved.
Correction of the ordering of the numerical fields in the variable table. .When ordering the table, the
numerical fields were not correctly ordered
Locking of the edition of system variables. It was possible to edit the variable and duplicate it.
Correction of the fault in the resource exportation. Not all the internal files were being copied.
Correction of the fault when importing resource with the override option enabled. The configuration was not
being overridden correctly.
Correction to remove the selection edge of the component after copying components on different screens.
Correction to reduce the memory consumption when loading the screens.
Problem in the alignment of the structures containing the BOOL data type. It was observed that the
monitoring of the BOOL array was presenting incorrect values.
Correction of the edition of the array of the SDO_Write block.

WPS V1.50

Functionalities:

Program upload
Force I/O
Language configuration in the PLC300 setup
Option to display variables on the alarm screens
Option of filling in the fields "Numeric Input" and "Numeric Output" with zeros on the user’s screens
Download option:
Initialize output and volatile variables
Stop/Start the execution of the program automatically
Online command menu for the password-protected operations of recording and loading program, setup and
firmware on the SD card.

Improvements:

Printing of the ladder diagrams

Corrections:

Increase the number of retries before displaying the error messages during the online monitoring
Correction of fault when recording the renamed variables. After renaming the variables, the save button was
not being enabled and the changes were not being recorded.
Change of the default .csv variable import file to ";" instead of ",".
Locking of the renaming action in the GLOBAL_IO group.
Change of the maximum memory area size of the screens
Compiler presented error when compiling the structure with invalid element. Change to accept repeated
variables in GLOBAL_IO group.
32-bit data types (DWORD, DINT, UDINT, REAL) enabled for the network variables
Fault in the compilation of the watchdog variables of the start, stop and main tasks
Fault in the compilation of String variables using the STRING# syntax in the ReadRecipe and WriteRecipe

WPS v2.5X | 30
What's New

blocks. It was corrected to generate error in this situation


Fault when using the STORE block of a REAL variable for a member of a REAL structure
Correction of a fault when recording the monitoring variables. The new variables created were not being
recorded
Correction of the ordering of the numerical fields in the variable table. When ordering the table, the numerical
fields were not correctly ordered
Locking of the system variables edition. It was possible to edit the variable and duplicate it.
Correction of the fault in the resource export. Not all the internal files were being copied.
Correction of the fault when importing resource with the override option enabled. The configuration was not
being overridden correctly.
Correction to remove the component selection edge after copying component on different screens.
Correction to reduce the memory consumption when loading the screens.
Problem in the alignment of the structures containing the BOOL data type. It was observed that the
monitoring of the BOOL array was presenting incorrect values.
Correction in the edition of the SDO_Write block array.

WPS V1.40

Functionalities:

WPS translated to english and spanish


Update center

Corrections:

Move variables between groups by the ladder editor


Open modbus file manager

WPS V1.30

Functionalities:

Variables Editor Update


Ethernet configuration at Setup
Structure Configuration
Recipe Configuration
Event Log Configuration
Modbus File Manager

Ladder Editor:

Changes in the Desktop


Use of Literals
Use of Arrays
Use of Instances and Structures
Function Blocks Optional Arguments
Copy/Paste New Features
Online Monitoring New Features

Corrections:

Optimization of the ladder editor so as to guarantee ladder files with up to 200 rungs and moderate memory
and CPU consumption. In such situation, the 1.20 version of WPS presented slow performance and

WPS v2.5X | 31
What's New

crashes.

PLC300:

New Features and Corrections of PLC300.

WPS V1.20

Communication with the PLC300 V1.2X equipment,


Task programming,
Change in tag addresses for compatibility with Modbus,
Tool to import/export projects,
Checking the PLC300 firmware version during download,
Stop/run programs as global actions,
Environment persistence when exiting,
Improvements in communication,
Download options:
o Initialize retentive variables,
o Clear alarm history,
o Font code download.

WPS v2.5X | 32
Installation/Uninstallation

4 Installation/Uninstallation
4.1 Before Installing
Check the following items before installing the WPS v2.5X:

If the PC meets the minimum requirements;


If the version of the WPS v2.5X is compatible with your equipment; and
If your current user account has administrator privileges to install the software.

4.2 Installing
When installing a newer version of WPS it is recommended that the previous version be removed first and the
system be rebooted, to make sure that the new installation is performed correctly.

Close all running programs to avoid interference with the installation process and follow the steps below.

1. Double-click the installer icon to start the installer. The installation program will start and a welcome window
will appear.
2. In the installation wizard, respond to the License Agreement, then press Next button.
3. Specify an empty folder inside which the WPS v2.5X will be installed. Make sure the installation location is
correct and that there is sufficient disk space for installation.
4. Confirm to create an empty folder.
5. Select the type of installation you want.
6. Select the program group to create the shortcuts for the WPS v2.5X.
7. Select shortcuts for additional programs: create a shortcut on the desktop and create a shortcut for quick
start.
8. Click the Install button to start installation.
9. Click the Finish button to complete the setup.

4.3 Uninstalling
If necessary, remove the WPS v2.5X by using the following procedures.

NOTE!
Always use the Add or Remove Programs application to remove WPS. Do not delete files and
folders manually.

1. From the Start menu, select Control Panel.


2. Double click on the Add or Remove Programs button.
3. Select WPS v2.5X from the list, and click on the Remove button.
4. Follow the instructions to remove the software.

WPS v2.5X | 33
Getting to Know the Environment

5 Getting to Know the Environment


5.1 Environment
The main window of WPS v2.5X may be divided in 6 main parts:

1. Menus: show the several options for editing, visualization, communication, and help in the development
environment;
2. Toolbar: displays the main commands of the software;
3. Configurations Window: shows the tree including the open Configuration structure;
4. Editor Window: main part of the development environment where the edition of the components that will
form the source file takes place;
5. Palette Window: includes the components to be inserted into the editor through drag'n drop;
6. Output Window: shows compilation and download messages.

5.2 Configuration Structure


The WPS software follows the resolutions of the standard IEC 61131-3.

Therefore, every application developed on it has a configuration with the following hierarchical structure:

Configuration: is at the highest level of the hierarchy, defining all the elements contained in a software
application that interact to perform the control functions.
o Resource: second level of the hierarchy, represents any element with processing capacity to implement
programs. In the WPS, resources are independent from each other, and each one has a linked product to
it. Global variables in an application are in this scope.

WPS v2.5X | 34
Getting to Know the Environment

POU (Program Organization Unit): describe the instructions to be executed, in order to be


implemented and how they interact with each other. Function blocks, functions and programs are
contained in this category. In the WPS, the POU that stands out is the Ladder Diagram. Local variables
of an application are in this scope, each confined to its own POU.
Tasks: processes that control the order and the execution time of the POUs.

The following figure shows the layout of this hierarchy in the WPS.

Lettering:

1. Configuration;
2. Resource;
3. POUs;
4. Tasks;

WPS v2.5X | 35
Quick Start

6 Quick Start
6.1 Welcome Window
This chapter contains some basic information so that you get familiar with the software.

We will start by the welcome window.

The welcome window appears when the program is started for the first time.

The following options are available in this window:

Quick Monitoring of Parameters


New Configuration
Open Configuration
Import Configuration

There is also one more option, Always display welcome window, which will be explained below.

The user can also close this window without selecting any of the options and use his/her own working
methodology.

The following figure shows the WPS welcome window.

Quick Monitoring of Parameters

The quick monitoring of parameters allows viewing and changing the parameters online, but it is possible
neither to create a new configuration, nor to save the parameters on the computer.

WPS v2.5X | 36
Quick Start

1) Function Selection

Click the option Quick Monitoring of Parameters.

2) Communication Configuration

The next window defines the options for communication with the equipment.

WPS v2.5X | 37
Quick Start

3) Select the Communication Options

Choose the correct communication options.

If you select one equipment, the default communication configuration of the equipment will be loaded to the
window.

However, check that the window configuration is the same as of the equipment. If not, update this window
according to the equipment configuration.

WPS v2.5X | 38
Quick Start

4) Testing the Communication

You can check if the communication is correct by clicking the Test button in this window.

The field is refreshed. The connected equipment appears in the status field.

WPS v2.5X | 39
Quick Start

Then click OK.

5) Monitoring in Progress

A window containing all the parameters of the equipment is shown.

The Online field displays the real value of the parameters on the equipment, and most parameters allow
modification. Reading parameters cannot be changed.

WPS v2.5X | 40
Quick Start

6) Close the Window

In order to end the monitoring, click the Close button in the window.

WPS v2.5X | 41
Quick Start

New Configuration

This creates a new configuration.

1) Function Selection

Click the New Configuration option.

WPS v2.5X | 42
Quick Start

From this step on, see Creating New Configuration for further details.

Open Configuration

It allows opening a configuration created previously.

1) Function Selection

Click the Open Configuration option.

2) Open Configuration Window

WPS v2.5X | 43
Quick Start

All configurations are displayed in a window.

3) Configuration Selection

Select the desired configuration and click the Open Configuration button.

4) Configuration Window

WPS v2.5X | 44
Quick Start

At this moment, the configuration opens. In the configuration window, you can view the configuration and the
resources that are part of the configuration.

Import Configuration

It imports a configuration previously generated by the WPS.

1) Function Selection

Click the Import Configuration option.

2) Import Window

Click the ... button in order to open the selection of the backup file containing the configuration that you wish
to import.

WPS v2.5X | 45
Quick Start

3) Backup File Selection

Select the file with the bkp extension that you wish to import and click Open.

WPS v2.5X | 46
Quick Start

4) BKP file to Be Imported

The Backup File field is filled out with the file selected in the previous step.

Click Next to continue.

WPS v2.5X | 47
Quick Start

5) Configuration Location

Click Finish to import and end the wizard.

WPS v2.5X | 48
Quick Start

6) Imported Configuration

The imported configuration can be viewed in the output window.

In the configuration window, you can view the imported configuration and its resources.

WPS v2.5X | 49
Quick Start

Always Show Welcome Window Option

The Always show welcome window option allows the window to be displayed in the initialization of the
WPS.

This option is in the lower part of the Welcome Window.

Uncheck this option if you do not wish to see the welcome window in the next initialization.

You can enable this option later in Help > Welcome.

WPS v2.5X | 50
Quick Start

6.2 Creating New Configuration


There are two situations in which a new configuration may be created:

Equipment is online (connected to the WPS)


Equipment is offline.

Examples

Equipment is online:

New Configuration - Online Equipment

Equipment Offline:

New Configuration - Offline Equipment

WPS v2.5X | 51
Quick Start

6.3 New Configuration - Online Equipment


In the following example, we will create a configuration with the CFW300. The windows may be different if other
equipments are configured.

CFW300

1) New Configuration Menu Item/Button

In the File menu, click New Configuration.

You can also use the keyboard shortcut (Ctrl+Shift+C) or the New Configuration button on the Toolbar:

2) New Configuration Window

A window will pop up prompting you to enter the configuration name and the first resource to be created. Enter
the names in the respective fields and click Next.

WPS v2.5X | 52
Quick Start

3) Communication Configuration

The next window defines the options for communication with the equipment.

WPS v2.5X | 53
Quick Start

4) Select the Communication Options

Choose the correct communication options.

If you select one equipment, the default configuration of the communication of the equipment will be loaded to
the window.

Still, check that the window configuration is the same as of the equipment. If not, update this window
according to the equipment configuration.

WPS v2.5X | 54
Quick Start

NOTE!
In this example, the CFW300-CUSB accessory is being used, which appears in Windows as a
USB serial port (virtual COM port);
When the cable is connected to the personal computer/equipment, the Windows device manager
informs the name of the USB serial port which was created.

5) Testing the Communication

You can check if the communication is correct by clicking the Test button in this window.

The status field is refreshed. The connected equipment appears in the status field.

WPS v2.5X | 55
Quick Start

Then click Next.

6) Equipment Selection

The window shows the equipment that is connected to the resource that was created.

WPS v2.5X | 56
Quick Start

7) Read ID

If you click the Read ID button, a window containing the information on the equipment will open. Click OK to
close it.

In order to go to the next step, click Next.

8) Import from WLP

WPS v2.5X | 57
Quick Start

A new window pops up enabling to import from the CFW100 a Ladder project developed on the WLP (WEG
Ladder Programmer).

Click Finish to close the wizard.

9) Configuration Tree

After those steps, the tree with the configurations should look like the following image.

WPS v2.5X | 58
Quick Start

10) Resource Properties

The settings made in the setup can be changed later in resource properties.

WPS v2.5X | 59
Quick Start

NOTE!
Depending on the equipment, new windows may appear from this step on, with initial settings
and oriented start-ups.

6.4 New Configuration - Offline Equipment


In the following example, we will create a configuration with the CFW300. The windows may be different if other
equipments are configured.

CFW300

1) New Configuration Menu Item/Button

In the File menu, click New Configuration.

WPS v2.5X | 60
Quick Start

You can also use the keyboard shortcut (Ctrl+Shift+C) or the New Configuration button on the Toolbar:

2) New Configuration Window

A window will pop up prompting you to enter the configuration name and the first resource to be created. Enter
the names in the respective fields and click Next.

3) Communication Configuration

The next window defines the options for communication with the equipment.

WPS v2.5X | 61
Quick Start

4) Select the Communication Options

Choose the correct communication options.

If you select one equipment, the default communication configuration of the equipment will be loaded.

WPS v2.5X | 62
Quick Start

Depending on the physical layer, it will be necessary to review this configuration when the equipment is
connected to the WPS.

For example, if the CFW300-CUSB accessory is used on the CFW300, Windows creates a USB serial port
which is only known at the moment of the connection of the equipment and personal computer.

5) Testing the Communication

At this moment, it is not possible to test the communication (equipment is not connected).

Thus, when you click Test, the status indicates Equipment offline.

WPS v2.5X | 63
Quick Start

6) Equipment Selection

The window shows the equipment that is connected to the resource that was created.

WPS v2.5X | 64
Quick Start

7) Read ID

If you click the Read ID button, as there is no equipment connected, a fault window pops up (Device
connection Failure). Click OK to close it.

In order to go to the next step, click Next.

8) Import from WLP

WPS v2.5X | 65
Quick Start

A new window pops up enabling to import from the CFW100 a Ladder project developed on the WLP (WEG
Ladder Programmer).

Click Finish to close the wizard.

9) Configuration Tree

After those steps, the tree with the configurations should look like the following image.

WPS v2.5X | 66
Quick Start

10) Resource Properties

The settings made in the setup can be changed later in resource properties.

WPS v2.5X | 67
Quick Start

6.5 Creating New Resource


A new resource may be created within a configuration.

There are 2 situations:

Equipment is online (connected to the WPS)


Equipment is offline.

Example

Equipment is online:

New Resource - Online Equipment

6.6 New Resource - Online Equipment


In the following example, we will create a new resource with the CFW300. The windows may be different if
other equipments are configured.

CFW300

WPS v2.5X | 68
Quick Start

1) New Resource Menu Item/Button

In the File menu, click New Resource.

You can also use the keyboard shortcut (Ctrl+Shift+R) or the New Resource button on the Toolbar:

2) New Configuration Window

A window will pop up prompting you to enter the configuration name and the first resource to be created. Enter
the names in the respective fields and click Next.

WPS v2.5X | 69
Quick Start

3) Communication Configuration

The next window defines the options for communication with the equipment.

4) Select the Communication Options

Choose the correct communication options.

If you select one equipment, the default configuration of the communication of the equipment will be loaded to
the window.

Still, check that the window configuration is the same as of the equipment. If not, update this window
according to the equipment configuration.

WPS v2.5X | 70
Quick Start

NOTE!
In this example, the CFW300-CUSB accessory is being used, which appears in Windows as a
USB serial port (virtual COM port);
When the cable is connected to the personal computer/equipment, the Windows device manager
informs the name of the USB serial port which was created.

5) Testing the Communication

You can check if the communication is correct by clicking the Test button in this window.

The status field is refreshed. The connected equipment appears in the status field.

WPS v2.5X | 71
Quick Start

Then click Next.

6) Equipment Selection

The window shows the equipment that is connected to the resource that was created.

WPS v2.5X | 72
Quick Start

7) Read ID

If you click the Read ID button, a window containing the information on the equipment will open. Click OK to
close it.

In order to go to the next step, click Next.

8) Import from WLP

WPS v2.5X | 73
Quick Start

A new window pops up enabling to import from the CFW100 a Ladder project developed on the WLP (WEG
Ladder Programmer).

Click Finish to close the wizard.

9) Configuration Tree

After those steps, the tree with the configurations should look like the following image.

WPS v2.5X | 74
Quick Start

10) Resource Properties

The settings made in the setup can be changed later in resource properties.

WPS v2.5X | 75
Quick Start

NOTE!
Depending on the equipment, new windows may appear from this step on, with initial settings
and oriented start-ups.

6.7 Pop-up Menu


The popup menu is known as context menu.

The pop-up menu is a floating menu accessed with the second or third button of the mouse, which enables
quick access to the options related to the object selected by the cursor.

On the WPS, a pop-up menu adds options to make some operations simpler:

Pop-up Menu - Configuration

Pop-up Menu - Resource

6.8 Pop-up Menu - Configuration


The configuration pop-up menu provides some functions described below.

WPS v2.5X | 76
Quick Start

Click the link for quick access:

New Configuration
New Resource
---
Save As...
Rename...
Delete
---
Export Binaries for Download...
Export Configuration
---
Open in Explorer
---
Print
---
Properties

New Configuration

See the section Creating New Configuration in order to create a configuration.

New Resource

See the section Creating New Resource in order to create a resource.

WPS v2.5X | 77
Quick Start

Save As...

In order to duplicate a configuration, click Save As in the pop-up menu.

In the Name field, enter the configuration new name.

Click OK to accept or
Click Cancel in order to cancel the operation.

Rename...

In order to rename a configuration, click Rename in the popup menu.

Enter the new name.

Click OK to accept or
Click Cancel in order to cancel the operation.

Delete

In order to delete a configuration, click Delete in the pop-up menu.

A message requests confirmation to delete a configuration.

Click OK to delete or
Click Cancel in order to cancel the operation.

Export Binaries for Download

The WPS v2.5X compiler generates binary files from the source files in the resource. When these files are
transferred to the machine, they are interpreted and executed.

The export binaries for download functionality encapsulates the binaries files into a .bbp file. This .bbp file can
be redistributed, but the original source file can not be viewed or changed.

1) Export from the Configuration (Pop-up Menu)

Right-click the configuration that contains the resource to be exported, and then, in the popup menu, click
Export Binaries for Download.

WPS v2.5X | 78
Quick Start

2) Export from the Menu Item

The Export Binaries for Download menu item can also be used to export.

In the File menu, click Export, and then Export Binaries for Download.

WPS v2.5X | 79
Quick Start

3) Configuration Selection

A window of the export wizard will open, displaying the name and path of the configuration containing the
resource to be exported.

Click the ... button in order to modify those data.

Then click Next.

WPS v2.5X | 80
Quick Start

4) Resource Selection

Then the resource selection screen will pop up, containing the binaries to be selected for exportation.

Select the desired resource and click Next.

WPS v2.5X | 81
Quick Start

5) Error Exporting

If the exported resource has not been previously compiled, an error message will pop up.

WPS v2.5X | 82
Quick Start

Click Cancel to exit.

Compile the resource and return to the first step of this tutorial.

NOTE!
Always compile the desired resource before exporting its binary files.

6) Select Options

The next screen is similar to the resource download screen, enabling the configuration of several download
options.

Refer to the section Download for further information.

The last checkbox defines whether those settings can be changed at the moment of the download of the
binaries.

WPS v2.5X | 83
Quick Start

NOTE!
Download options change depending of the resource selected.

7) Location of the Exported File

Finally, one last screen allows defining the name of the file and its location. Click the ... button in order to
change those data.

This screen also allows entering a password to protect the file. If desired, check the checkbox and enter the
password.

Then click Finish.

WPS v2.5X | 84
Quick Start

Export Configuration

The WPS v2.5X allows the configurations to be exported to a backup file in the .bkp format.

That simplifies sending a configuration to another machine.

You should always use this procedure to prevent file corruption.

1) Export from the Configuration (Pop-up Menu)

Right-click the configuration to be exported, and then, in the pop-up menu, click Export Configuration.

WPS v2.5X | 85
Quick Start

2) Export from the Menu Item

The Export Configuration menu item can also be used to export.

In the File menu, click Export, and then Export Configuration.

WPS v2.5X | 86
Quick Start

3) Configuration Selection

The export wizard will open, displaying the name and path of the configuration to be exported.

Click the ... button to modify those data.

Then click Next.

WPS v2.5X | 87
Quick Start

4) Resource Selection

Then a screen to select the resources to be exported to the file will pop up.

Select the resources you wish to export and click Next.

WPS v2.5X | 88
Quick Start

5) Select Options

Finally, one last screen allows defining the name of the backup file and its location.

Click the ... button in order to modify those data.

This screen also allows entering a password to protect the file. If desired, check the checkbox and enter the
password.

Then click Finish.

WPS v2.5X | 89
Quick Start

6) Wait until Finish

In the exit window, you can view messages informing generation of the exported configuration.

Open in Explorer

Open Windows Explorer in the configuration folder.

The user can view the content of the folder in Windows Explorer.

WPS v2.5X | 90
Quick Start

Print

Select the option that you wish to print.

Click OK in order to print or


Click Cancel in order to cancel the operation.

Properties

Click the Properties item, and a window will pop up with the following items:

Name: configuration name;


Path: configuration path;
Size: configuration size.

6.9 Pop-up Menu - Resource


The pop-up menu of the resource provides some functions described below.

Click the link for quick access:

Define as Main Resource


New Resource
---
Save As...

WPS v2.5X | 91
Quick Start

Rename...
Delete
---
Print
---
Properties

Define as Main Resource

When a configuration has several resources, the resource in use must be defined as main resource.

In order to define a resource as main resource, click the Define as Main Resource item in the pop-up menu.

After clicking the menu item, the resource will show in bold.

NOTE!
Remember to always set a resource you wish to work as main resource, preventing download
and editing errors.

New Resource

See the section Creating New Resource for details on creating a new resource.

Save As...

In order to duplicate a resource, click Save As in the pop-up menu.

In the Name field, enter the new name of the resource and click OK.

WPS v2.5X | 92
Quick Start

The new resource can be viewed in Configurations.

Rename

In order to rename a resource, click Rename in the pop-up menu.

Enter the new name.

Click OK to accept or
Click Cancel in order to cancel the operation.

Delete

In order to delete a resource, click Delete in the pop-up menu.

A message requests confirmation to delete the resource.

Click OK to delete or
Click Cancel in order to cancel the operation.

WPS v2.5X | 93
Quick Start

Print

Select the option that you wish to print.

Click OK in order to print or


Click Cancel in order to cancel the operation.

Properties

In order to view/edit the resource properties, click the Properties menu item in the pop-up menu.

The properties window shows some categories:

Communication Configuration;
Program Copy;
Equipment;
Information;
Memory Areas.

1) Communication Configuration

In Communication Configuration, you can change different communication variables:

Name of the host and port of the communication manager;


Device (Equipment);
Physical layer;
Port settings;
Times;
Communication test (current connection);
Communication status.

WPS v2.5X | 94
Quick Start

2) Program Copy

NOTE!
This option is available only for CFW300.

In Program Copy, a checkbox allows selecting the copy type of the user program from the memory card to the
equipment:

Allow copying: allows the ladder program to be copied to a flash memory module (CFW300-MMF);
Allow only one copy: allows the ladder program to be copied to a flash memory module (CFW300-MMF),
which allows loading it to another equipment; however, it does not allow copying from that equipment to
another flash memory module, that is, it does not allow copy of the copy;
Do not allow copying: does not allow the ladder program to be copied to a flash memory module (CFW300-
MMF);

WPS v2.5X | 95
Quick Start

3) Device

In Device, you can:

Change the firmware version;


Select/remove accessories;
Read the equipment identification, viewing the model and firmware version.

WPS v2.5X | 96
Quick Start

4) Information

In Information, you can view/change configuration data:

Author;
Client;
Description.

WPS v2.5X | 97
Quick Start

5) Memory Areas

In Memory Areas, it is possible to change the amount of memory (in bytes) allocated to each resource
section.

Allocated memory: the editable text boxes show information of allocated memory, enabling the user to
change them;
Used memory: the non-editable text boxes show information on the memory currently used by the resource
loaded on the equipment;
Limits: next to these boxes, it is displayed the range of acceptable values of allocated memory for each
field.

One click on the Allocated button shows a chart of allocated memory.

One click on the Used button shows a chart of used memory.

WPS v2.5X | 98
Quick Start

WPS v2.5X | 99
Communication

7 Communication
7.1 Equipment Parameterization
The following parameters must be set so as to establish the communication with the equipments:

Equipm e Connection Param e Recom m ended or Factory


Necessary Accessories Driver Description
nt Type ter Setting
0308 Serial Address 1
0310 Serial Baud Rate 1 = 19200 bits/s
CFW300 w ith CFW300-
RS232 ---- Serial Byte
CRS232 module 0311 1 = 8 bits, even parity, 1 sb
Configuration
0312 Serial Protocol 2 = Modbus RTU
USB drive 0308 Serial Address 1
supplied by
the
0310 Serial Baud Rate 1 = 19200 bits/s
manufactur
CFW300 w ith CFW300- er of the
CFW300 RS485
CRS485 module Isolated Serial Byte
0311 1 = 8 bits, even parity, 1 sb
USB to 485 Configuration
Converter
(external
0312 Serial Protocol 2 = Modbus RTU
device)
0308 Serial Address 1
0310 Serial Baud Rate 1 = 19200 bits/s
CFW300 w ith CFW300- USB Serial
FTDI Serial Byte
CUSB module Port 0311 1 = 8 bits, even parity, 1 sb
Configuration
0312 Serial Protocol 2 = Modbus RTU
0308 Serial Address 1
0310 Serial Baud Rate 1 = 19200 bits/s
CVW500 ---- RS232 ---- Serial Byte 8 data bits, even parity, 1 stop
----
Configuration bit
---- Serial Protocol Modbus RTU
WEG USB
SCA06 ---- USB ---- ----- -----
Driver
WEG USB
PLC300 ---- USB ---- ----- -----
Driver
WEG USB
SSW900 ---- USB ---- ----- -----
Driver

7.2 Establishing Communication - USB Serial Port


The USB serial port is known as Virtual Com Port.

The equipment must be closer than three meters to the computer.

This connection is done by means of USB Cable.

USB Driver: it is necessary to install the USB FTDI drive available in the folder USB_Driver\FTDI.

WPS v2.5X | 100


Communication

CFW300

1) Connection of the Computer to the Equipment

The figure below shows how to connect a computer to the equipment via USB.

WPS v2.5X | 101


Communication

2) Windows Device Manager

WPS v2.5X | 102


Communication

The Windows device manager indicates the serial port connected to the equipment.
The computer name on the device manager is illegible on purpose.

3) Communication Configuration on the WPS

On the WPS, select the serial port correctly in the window Property > Communication Configuration as
follows.

WPS v2.5X | 103


Communication

NOTE!
Turn off the equipment before making the connections.

4) Connecting the Equipment

1. Insert the mini-B connector of the USB cable into the USB connector of the equipment;
2. Insert the A-type connector of the USB cable into the computer USB port;
3. In the device manager, check which serial port is connected;
4. Make sure that the serial connection is selected in the Communication Configuration category of the
resource Property window;
5. The serial port and its resource configuration on the WPS must be the same serial port that appears in the
Windows device manager where the USB cable is connected;
6. Never change the values in parameters P308, P310, P311 and P312 during a connection. Changing those
parameters causes the immediate loss of communication between the PC and the equipment.

7.3 Establishing Communication - RS232


The equipment must be at a certain distance from the computer according to the table below.

WPS v2.5X | 104


Communication

Baud Rate Maxim um Cable Size Maxim um Cable Size


(bps) (ft) (m )
9600 32.81 10
19200 24.93 7.6
38400 12.14 3.7

CFW300

1) Connection of the Computer to the Equipment

The figure below shows how to connect a computer to the equipment via RS232.

WPS v2.5X | 105


Communication

2) Computer - Plug-In Module Connection

WPS v2.5X | 106


Communication

The figure below shows details of the connection.

3) Windows Device Manager

The Windows device manager indicates the serial port connected to the equipment.
The computer name on the device manager is illegible on purpose.

WPS v2.5X | 107


Communication

4) Communication Configuration on the WPS

On the WPS, select the serial port correctly in the window Property > Communication Configuration as
follows.

WPS v2.5X | 108


Communication

NOTE!
Turn off the equipment before making the connections.

5) Connecting the Equipment

1. Make the connections of the serial DB9 female connector of the RS232 cable to the CFW300-RS232
accessory as shown in the previous figures;
2. Insert the DB9 female connector of the RS232 cable into the DB9 male connector of the computer;
3. In the device manager, check which serial port is connected;
4. Make sure that the serial connection is selected in the Communication Configuration category of the
resource Property window;
5. The serial port and its configuration of the resource in the WPS must be the same serial port that appears
in the Windows device manager where the RS232 cable is connected;
6. Never change the values in parameters P308, P310, P311 and P312 during a connection. Changing those
parameters causes the immediate loss of communication between the PC and the equipment.

7.4 Establishing Communication - RS485


The equipment must be at a certain distance from the computer according to the table below.

WPS v2.5X | 109


Communication

Baud Rate Maxim um Cable Size Maxim um Cable Size


(bps) (ft) (m )
9600 3280.84 1000
19200 3280.84 1000
38400 3280.84 1000

The connection of the computer to the isolated USB to RS485 converter is done by means of the USB Cable.

In this case, it is necessary to install the USB driver of the isolated converter, normally supplied by the
manufacturer of the converter.

CFW300

1) Connection of the Computer to the Equipment

The figure below shows how to connect a computer to the equipment via RS485.

WPS v2.5X | 110


Communication

2) Computer - Plug-In Module Connection

The figure below shows an example using the Novus USB-i485 converter.

WPS v2.5X | 111


Communication

3) Windows Device Manager

The Windows device manager indicates the serial port connected to the device.
The computer name on the device manager is illegible on purpose.

WPS v2.5X | 112


Communication

4) Communication Configuration on the WPS

On the WPS, select the serial port correctly in the window Property > Communication Configuration as
follows.

WPS v2.5X | 113


Communication

NOTE!
Turn off the equipment before making the connections.

5) Connecting the Equipment

1. Make the connections from the connector of the isolated USB RS485 converter to the CFW300-RS485
accessory as shown in the previous figures;
2. Insert the USB cable into the connector of the isolated USB RS85 converter and into the computer USB
port;
3. In the device manager, check which serial port is connected;
4. Make sure that the serial connection is selected in the Communication Configuration category of the
resource Property window;
5. The serial port and its resource configuration on the WPS must be the same serial port that appears in the
Windows device manager where the USB cable is connected;
6. Never change the values in parameters P308, P310, P311 and P312 during a connection. Changing those
parameters causes the immediate loss of communication between the PC and the equipment.

7.5 Cables
The figure below details the cable for the point-to-point USB connection.

WPS v2.5X | 114


Communication

Figure 1: USB Cables

The figure below shows the connectors.

Figure 2: USB Connectors

A = Type A Connector
B = Type B Connector

Maximum cable size: 3 meters.

NOTE!
Always use a USB shielded interconnection cable, standard host/device shielded USB cable.
Unshielded cables may generate communication errors.

NOTE!
The USB connection is galvanically isolated from the power grid and other elevated voltages
internal to the drive. The USB connection, though, is not isolated from the protection earthing
(PE). Use an isolated laptop to connect to the USB connector, or a desktop connected to the
same protection earthing (PE) as the drive.

Purchasing Suggestions

Manufacturer:
Samtec, Inc: http://www.samtec.com

If you wish to purchase a USB cable directly from Samtec, please see below:

WPS v2.5X | 115


Communication

Description Item
High speed shielded USB cable Revision 2.0, 1 m, Samtec USBC-AM-MB-B-B-S-1
High speed shielded USB cable Revision 2.0, 2 m, Samtec USBC-AM-MB-B-B-S-2
High speed shielded USB cable Revision 2.0, 3 m, Samtec USBC-AM-MB-B-B-S-3

At the time this manual has been written, the specification could be found at
http://www.samtec.com/ftppub/cpdf/USBC-AM-BM-B-B-S-X-MKT.pdf

7.6 USB/Serial Converter


USB/Serial Converters are the best solution for those who wish to connect a serial equipment (RS232) to USB
ports. It is a low cost solution that solves the need to install new serial ports in microcomputers with all busy
busbars, or in an equipment (laptop) that does not have RS232 ports.

The USB/SERIAL converter allows a plug & play connection with your microcomputer, leaving the existing
serial port free.

Purchase Suggestions in Brazil

Manufacturer: Comm5 Tecnologia


Product: USB Converter for 1 saída serial RS232
Model: 1S-USB - USB converter for 1 serial
Web Site: http://www.comm5.com.br/1S-USB--CONVERSOR-USB-PARA-1-SERIAL
Refer to the user manual for more information about installation.

Manufacturer: Tripp Lite


Product: USB High Speed Serial Adapter
Model: USA-19HS
Web Site: http://www.tripplite.com/en/products/model.cfm?txtSeriesID=849&txtModelID=3914
Refer to the user manual for more information about installation.

WPS v2.5X | 116


Communication

WPS v2.5X | 117


Ladder

8 Ladder
8.1 Concepts
8.1.1 Introduction
Ladder Programming is the graphical representation of boolean equations combining contacts (input
arguments) with coils (output results).

Ladder programming enables testing and modifying data by standard graphical symbols. These symbols are
positioned in the Ladder diagram in a way that is similar to a line of a logic diagram with relays. The Ladder
diagram is delimited on the left and on the right by busbar lines.

Graphical Components

The basic graphical components of a Ladder diagram are shown below.

Figure 1: Ladder Working Flow

1. Left busbar
2. Right busbar
3. Horizontal connection
4. Vertical connection
5. Contact
6. Coil
7. Power flow

Busbars

The editor is delimited on the left by a vertical line known as left busbar, and on the right by a vertical line
known as right busbar.

WPS v2.5X | 118


Ladder

Connection Elements and States

The connection elements may be horizontal or vertical. The state of the connection elements may be denoted
by 1 or 0, corresponding to the literal Boolean value 1 or 0, respectively. The term connection state must be
synonymous with the term power flow.

The state of the left busbar may always be considered 1. No states are defined on the right busbar.

The horizontal connection element must be indicated by a horizontal line. A horizontal connection element
transmits the state of the element immediately on the left to the element immediately on the right.

The vertical connection element must consist of vertical lines intersected by one or more horizontal
connections on each side.

The state of the vertical connection must represent the logical OR of states 1 of horizontal connections on the
left side, i.e. the state of the vertical connections must be:

0 if the state of all horizontal connections included on its left is 0,


1 if the state of one or more horizontal connections included on its left is 1.

The state of the vertical connections must be copied to all associated horizontal connections on its right.

The state of vertical connections must not be copied to associated horizontal connections on its left.

Execution Control

The following figure shows how the program in Ladder is executed. The card continually runs a Scanning
cycle. The cycle begins when the I/O System in the hardware compiles the last values of all input signals and
records those values in fixed areas of the memory.

Figure 2: Execution Control

A - Inputs read to the memory


B - Memory written in the Outputs
C - Scanning of Ladder lines

The lines in the Ladder program are then run in a fixed order, starting with the first line. During program
scanning, new values for physical outputs, as determined by the logic of several Ladder lines, are initially
written to an area of the output memory. Finally, when the Ladder program has finished running, all output
values retained in the memory are inscribed in the physical outputs by the hardware in a single operation.

WPS v2.5X | 119


Ladder

8.1.2 Legend

AT: Direct representation of a variable.

FUNCTION BLOCK: It is a function that needs an instance.

CONFIGURATION: It is the organization of a software application in a higher level. It may contain Resources
within a Configuration.

FUNCTION: It is a block responsible for executing a certain behavior or an action based on possible
parameters (VAR_IN, VAR_IN_OUT, VAR_OUT).

INSTANCE: Memory area taken according to the Functional Block.

LD (Ladder Diagram): Graphical language based on the electric diagrams (interconnected contacts and
coils), according to the power flow between the elements.

OVERFLOW: It occurs when the result of a mathematical calculation exceeds the limits permitted for the
result data type.

POU: Program Organization Unit. It may be: Program, Functional Block or Function.

PROGRAM: It is the logical grouping of all programming elements and constructions necessary for processing
the signals required to control a machine or process.

RESOURCE: They consist of any element with processing capacity responsible for executing the programs.

SCAN: Scan cycle of a program.

STACK: Stack of the Ladder program. It is the memory area used to perform the Program Logics.

TAG: Variable Name.

TASK: Responsible for the execution of programs, in a periodical or triggered way, with trigger by event.

DATATYPE: It informs the compiler the space taken by a variable and its respective format (to the Blocks).

VARIABLE: It consists of a memory position able to withhold and represent a value or expression. It may have
scope:
Location: whose automatic position is calculated by the compiler.
Global: located in a determined memory area with digital inputs and outputs, it may be accessed at any
point of the Configuration.
The variable may be:
Retentive: it stores the value after powering down the device;
Volatile: it begins with the value contained in the initial value field after the powering down of the device;
Constant: it does not allow the modification of its content.

VAR: Variables for internal use of a User’s Block (USERFB). Equivalent to a variable of Local scope.

VAR_IN: Input argument of a User’s Block (USERFB). Variables configured in this field will be only read on the
USERFB.

WPS v2.5X | 120


Ladder

VAR_IN_OUT: Input and output argument of a User’s Block (USERFB). It will not allow CONSTANT variables,
PHYSICAL INPUTS (%I_), NETWORK INPUTS (%I_) or READING SYSTEM MARKERS (%S_), because they
will be read at the beginning of the USERFB and will be updated with new values (written) at the end of the
USERFB.

VAR_OUT: Output argument of a User’s Block (USERFB). It will not allow CONSTANT variables, PHYSICAL
INPUTS (%I_), NETWORK INPUTS (%I_) or READING SYSTEM MARKERS (%S_), because they will be
updated with new values (written) at the end of the USERFB.

WATCHDOG: It is a way provided by the manufacturer to perform specific actions if the integrity of the system
is violated.

8.1.3 Contact Logic


AND LOGIC – Contact in Series

Figure 1: Contacts in Series

The figure above performs an AND Logic between the two last elements charged on the STACK, lowers a level
of the STACK, and places the result on top of the STACK. That means that the following Boolean operation is
performed: top of the STACK = BIT1.BIT2.

In IL (Instruction List) language it becomes like this:


LD BIT1 (* loads the value of variable BIT1 to the STACK *)
LD BIT2 (* loads the value of variable BIT2 to the STACK *)
AND (* Performs AND Logic between BIT1 and BIT2 through the STACK *)

Truth Table

BIT1 BIT2 STACK


0 0 0
0 1 0
1 0 0
1 1 1

WPS v2.5X | 121


Ladder

OR LOGIC – Contact in Parallel

Figure 2: Contacts
in Parallel

The figure above performs an OR Logic between the two last elements charged on the STACK, lowers a level
of the STACK, and places the result on top of the STACK. That means that the following Boolean operation is
performed: top of the STACK = BIT1 + BIT2.

In IL (Instruction List) language it becomes like this:


LD BIT1 (* loads the value of variable BIT1 to the STACK *)
LD BIT2 (* loads the value of variable BIT2 to the STACK *)
OR (* Performs OR logic between BIT1 and BIT2 through the STACK *)

Truth Table

BIT1 BIT2 STACK


0 0 0
0 1 1
1 0 1
1 1 1

WPS v2.5X | 122


Ladder

8.1.4 Data types


Data type Size Signal Range
BOOL 1 bit 0 or 1
BYTE 8 bits (1 byte) 0 to 255
USINT 8 bits (1 byte) 0 to 255
SINT 8 bits (1 byte) Yes -128 to 127
WORD 16 bits (2 bytes) 0 to 65535
UINT 16 bits (2 bytes) 0 to 65535
INT 16 bits (2 bytes) Yes -32768 to 32767
DWORD 32 bits (4 bytes) 0 to (232 - 1)
UDINT 32 bits (4 bytes) 0 to (232 - 1)
DINT 32 bits (4 bytes) Yes - 231 to (231 - 1)
LWORD 64 bits (8 bytes) 0 to (264 - 1)
ULINT 64 bits (8 bytes) 0 to (264 - 1)
LINT 64 bits (8 bytes) Yes - 263 to (263 - 1)
32 bits (4 bytes)
REAL Yes ±10±38; Precision = 2-23
Floating point - IEEE 559 standard
64 bits (8 bytes)
LREAL Yes ±10±308; Precision = 2-52
Floating point - IEEE 559 standard
8 bits (1 byte) for each position
STRING 1 to 254 ASCII characters
+ 8 bits (1 byte) for the null character

NOTE!
The data type STRING considers only the number of characters in the size of the variable. The
byte occupied by the null terminator is not added to the size.

8.1.5 Direct Representation


Used to define the memory position of a Global Variable.

Syntax: %<Format><Size>

First Letter:

At (Format) Description
Input: It receives the values from analog and
I
discrete variables, or input netw ork variables.
Output: It stores the values to be w ritten in the
Q analog and discrete outputs, or output netw ork
variables.
M RAM memory internal marker.
S System status marker
C System command marker

WPS v2.5X | 123


Ladder

Second Letter:

At (Format) Description
X Bit
B Byte (8 bits)
W Word (16 bits)
D Double Word (32 bits)
L Long Word (64 bits)

8.2 Editor
8.2.1 Desktop
Whenever a Ladder file is opened through its shortcut in the project tree, the variable/Ladder editor will show
as per the figure below.

Figure 1: WPS Ladder Editor Desktop

The variable/Ladder editor has the following components:

1. Toolbar to edit variables


2. Variable scope
3. Variable group
4. Variable list/editor
5. Program edition toolbar
6. Editor Ladder/rungs
7. Ladder component palette

WPS v2.5X | 124


Ladder

NOTE!
If any docker is not visible, activate through the Palette item in Window menu.

8.2.2 Ladder Menu


When editing a Ladder file of your resource, the Ladder menu will be active as per the figure below.

Through this menu, it is possible to execute all the operations regarding the Ladder as well as to know the
keyboard shortcuts for those operations.

WPS v2.5X | 125


Ladder

8.2.3 Rungs
8.2.3.1 Overview
The Ladder program is edited through a graphical editor that organizes it through the rungs. Every rung in the
Ladder program corresponds to an interlock that relates input elements to output elements. Said editor is
shown in the following figure.

Figure 1: Rung Elements

The main elements of a rung are:


1. Left busbar
2. Right busbar
3. Output busbar
4. Connection between the elements
5. Rung title and comment

NOTE!
Outputs will always be connected to the right of the output busbar.

For further details on Ladder programming click here.

Through the Ladder/rungs editor tool bar, it is possible to perform the following operations:

WPS v2.5X | 126


Ladder

- Add a new rung (end)


- Add a new rung (above)
- Add a new rung (below)
- Move rung up
- Move rung down
- Remove the selected rung

- Insert a contact in the rung


- Insert a functional block in the rung
- Insert an output coil in the rung
- Change Ladder element
- Delete an element in the rung (contact, functional block, or coil)
- Edit rung title

- Edit arguments

- Select element group

- Select all elements

- Select the rung for edition

8.2.3.2 Editing
In order to edit a rung, the rung must be selected. In order to select the rung, you may click on it with the
mouse or use the rung selection control in the Ladder Editor toolbar. Whenever the rung is selected, there
will be a grey bar on the left side of the rung as shown in the following figure.

8.2.3.3 Title and Comment


In order to edit the rung title and comment, just double click on the title and comment area with the mouse or
press the Shift+F2 keys. The following dialog will appear.

WPS v2.5X | 127


Ladder

Figure 1: Editing the Rung Title

After editing the title and comment, the editor will become as follows.

Figure 2: Rung with its Title

8.2.3.4 Inserting Elements


8.2.3.4.1 Overview
In order to insert an element in the rung, it is necessary that an already existing element is selected, as
shown in the following figure.

The selected element will be involved by a green, striped rectangle. There will also be a red dot indicating
where the new element will be inserted (insertion point).

The insertion of Ladder elements may be performed in three distinct ways.

1. With the keyboard through the following shortcuts

key: C - insert contact


key: F - insert functional block
key: O - insert output coil
key: X - change ladder element

2. With the Ladder/rungs editor tool bar

- Insert a contact in the rung

WPS v2.5X | 128


Ladder

- Insert a functional block in the rung


- Insert an output coil in the rung
- Change ladder element

3. With the palette of Ladder elements

A mouse drag and drop operation must be used in order to insert elements using the palette. For that purpose,
click on the palette element, keep the mouse pressed, move the mouse up to the insertion point in the Ladder,
and release the mouse button.

After inserting an element, e.g. a contact, the rung will become as follows.

8.2.3.4.2 In Series
Through the insertion point of elements, it is possible to insert an element in series. For that purpose, use the
following insertion points:

Figure 1 - Inserts an
element in series
before the selected
element

WPS v2.5X | 129


Ladder

Figure 2 - Inserts an
element in series
after the selected
element

8.2.3.4.3 In Parallel
Through the insertion point of elements, it is possible to insert an element in parallel. For that purpose, use the
following insertion points:

Figure 1 - Inserts an
element in parallel
above the selected
element

Figure 2 - Inserts an
element in parallel
under the selected
element

8.2.3.5 Browsing
8.2.3.5.1 With the Keyboard
Browsing with the keyboard in the rung is done by the keys , , , . Through these keys, it is possible to
select several elements inside the rung, and also define the insertion point of new elements.

As shown in the item previous to insert an element of the contact type in the rung, it will become as follows.

By pressing the browsing keys, we can modify the insertion point of a new element, as shown in the following
figures:

Key indicates that the new element will be inserted before the selected element

Key indicates that the new element will be inserted parallelly above the selected element

WPS v2.5X | 130


Ladder

Key indicates that the new element will be inserted parallelly below the selected element

Key indicates that the new element will be inserted after the selected element

As the insertion point has already been selected, and by pressing the same key as the corresponding
direction, the selection will move on to the next element, as shown in the following figure.

When inserting elements to the browser in parallel through the elements, we browse through each element
individually, conforming to the following example.

In this situation, when inserting an element, we are making this insertion related to this element. Should it be
necessary to insert an element related to the parallel that is a group of elements, we must use the G key,
which will select the group, and then we can define the insertion point, and make the insertion as shown in the
following figures.

Pressing G:

Inserting contact before the parallel:

Every time the G key is pressed, we select the group immediately above the selected element/group, and in
the end, we go back to the original element, so, in some situations, it is necessary to touch the G key more
than once. Through the G key it is possible to make many insertion operations conforming to the following
examples.

WPS v2.5X | 131


Ladder

Insert an element in parallel to the group of elements in the rung

Insert an element in series to the group formed by elements that are internal to a parallel

8.2.3.5.2 With the Mouse


All browsing functionalities with the keyboard in the rung are also available in the mouse. It is possible to
select an element and the respective insertion point directly with the click of the mouse.

Cursor Action Representation

Selects element and upper insertion point

Selects element and low er insertion point

Selects element and anterior insertion point

Selects element and posterior insertion point

During the element insertion operation with the mouse, by dragging and releasing the mouse in the palette, as
we drag the elements over the rung, the selection and the insertion point follow the mouse cursor so as to
determine the insertion point. The following figure exemplifies the insertion of elements via mouse.

WPS v2.5X | 132


Ladder

Figure 1: Operation of dragging component with the Mouse

Element insertion sequence via mouse:


1. Select the palette element you wish to insert by clicking on it with the mouse, and keeping the mouse
button pressed
2. Drag this element over the rung
3. Select the insertion point and release the mouse button on it

The insertion result in this example will be as follows.

Figure 2: Result after the dragging operation

During the insertion via mouse, it is also possible to select the group of elements. For that purpose, as the
previously selected element is dragged, press the Ctrl function key and keep it pressed; while the Ctrl key is
being pressed, the mouse will select insertion points related to groups.

8.2.3.6 Copy/Paste
Overview

All the copy, cut and paste functions are available in the Ladder editor through the edit menu or through the
corresponding keyboard shortcuts. In order to execute these operations it is necessary to have rung and/or
element selected.

Copy/paste an element

Below is an example of copying and pasting an element.

Figure 1: First, select the element and press Ctrl+C

WPS v2.5X | 133


Ladder

Figure 2: Then, select contact with insertion point after


and press Ctrl+V

Copy/paste multiple elements

It is also possible to copy, cut and paste multiple elements selected either by the mouse or by the G key as
previously mentioned. Below is an example of copying and pasting multiple elements.

Figure 3: First, select the group and press Ctrl+C

Figure 4: Then, select timer with insertion point before and press Ctrl+V

There might be cases in which it is not possible to paste and there will not be modification in the rung after the
command.

Copy/paste rungs

The selection of rungs for the operations of copy, cut and paste is only performed through the mouse as
shown in the figures below.

WPS v2.5X | 134


Ladder

Figure 5: Through the mouse from the right side out of the rung

Figure 6: Through the mouse from the left side out of the rung

It is also possible to select multiple rungs for these operations.

Below is an example of copying / pasting a rung.

Figure 8: Rung to be copied has been selected, then pressed Ctrl+C

WPS v2.5X | 135


Ladder

Figure 9: Rung above destination has been selected

Figure 10: After pressing Ctrl+V

WPS v2.5X | 136


Ladder

8.2.4 Variables
8.2.4.1 Overview
During the Ladder edition, it is necessary to define the variables used in the Ladder components. This
definition can be done directly in the Ladder and/or in the editor/list of variables.

The table of variables must be activated through the menu Window > Variables as shown in the following
figure.

In the variable edition window, the following commands are available:

- Add a new variable


- Edit the selected variable
- Remove the selected variable
- Move the selected variable one row up in the table
- Move the selected variable one row down in the table
- Rename the selected variable
- Export variables from this group to a file
- Import variables to this group from a file

The variables of the GLOBAL scope (1) present the groups (2) as shown in figure 1.

Figure 1: Variable Editor for the "GLOBAL" Scope

In this area of the global variables, the following groups are available:

Constant: variables that store constant values


Global: variables accessible by all the Ladder files
Global Retentive: similar to the global group, but with retentive memory

WPS v2.5X | 137


Ladder

System Global: variables previously defined with system functions


Global Parameter: variables from device accessible by Ladder and HMI
I/O Global: physical inputs and outputs of the equipment
Network Global: Variables previously defined for network communication

The variables of the LOCAL scope (1) present the groups (2) as per figure 2.

Figure 2: Variable Editor for the "LOCAL" Scope

In this area of local variables, the following groups are available:

Location: variables only accessible through the Ladder that is being edited
Local Retentive: similar to the local group, but with retentive memory

NOTE!
A retentive memory keeps its value even with the equipment off.

8.2.4.2 Fields
When defining a variable through the variable editor/list, some data must be defined for the variables. In the
following items, those data will be presented according to the group the variable belongs to.

Local and Local Retentive:

Tag: variable identification


Size: number of elements of the array* related to the variable
Data Type: variable numeric type
Initial Value: value that will be loaded for variable during the initialization of the equipment
Comment: comment of the variable in the selected language

Constant:

WPS v2.5X | 138


Ladder

Tag: variable identification


Data Type: variable numeric type
Value: constant value of the variable
Comment: comment of the variable in the selected language

Global and Global Retentive:

Tag: variable identification


Size: number of elements of the array* related to the variable
Data Type: variable numeric type
At: defines which global memory area the variable accesses
Address: address related to the global memory area. If not configured (empty), the compiler will
automatically define its address.
Bit: for Boolean data type, it is necessary to define the bit it accesses (0...7)
Initial Value: value that will be loaded for variable during the initialization of the equipment
Comment: comment of the variable in the selected language
Modbus: modbus address

System:

Tag: variable identification


Data Type: variable numeric type
At: defines which global memory area the variable accesses
Address: address related to the global memory area.
Bit: for Boolean data type, it is necessary to define the bit it accesses (0...7)
Comment: comment of the variable in the selected language
Modbus: modbus address

Global Parameter:

Tag: variable identification


Data Type: variable numeric type
At: defines which global memory area the variable accesses
Address: address related to the global memory area.
Initial Value: initial standard value
Comment: comment of the variable in the selected language
Modbus: modbus address

WPS v2.5X | 139


Ladder

I/O:

Tag: variable identification


Size: number of elements of the array* related to the variable
Data Type: variable numeric type
At: defines which global memory area the variable accesses
Address: address related to the global memory area.
Bit: for Boolean data type, it is necessary to define the bit it accesses (0...7)
Comment: comment of the variable in the selected language
Modbus: modbus address

NOTE!
When size is greater than zero, the variables are accessed in the Ladder through their array
index.

8.2.4.3 Editing in the Rung


The Ladder elements inserted in the rung require that variables be defined for each argument. See figure below.

Figure 1: Variables without declaration in the elements and blocks

In order to define a variable for the argument, it is necessary to enter the argument edition mode, which is
done in two ways.

ATTENTION!
As from the version 1.30 of the WPS the output arguments of the functional blocks can be
optional.
The arguments in question will not be initialized with the declaration ??? and may be omitted if
they do not have to be used in the Ladder logic.

1. By the mouse:
Double clicking the mouse directly on the argument

2. By the keyboard:
Pressing the F2 key.
For elements with one argument, it directly enters the argument edition mode.
In the other elements with more than one element, it is necessary to select the argument through the arrow
keys and then press the F2 key again.

When entering the edition mode, the element will appear similar to the following figure.

WPS v2.5X | 140


Ladder

Figure 2: Attributing the variables

At this moment, an edition box will be enabled for you to enter the variable name. When the Edit button is
pressed, a box to create the new variable will be enabled.

Figure 3: Creating the variable if its tag is not defined

In this box you should define the following options for the variable:

Scope: if it belongs to the Global or Local group


Tag: variable identification
Size: number of elements of the array* related to the variable
Data Type: variable numeric type
Group: Group to which the variable belongs

If there are already variables defined for the type compatible with the Ladder element, a selection box with
these variables will show together with the edition box. In order to select the desired variable, press the down
arrow key and after having the variable selected, press enter. The figure below shows this function.

WPS v2.5X | 141


Ladder

Figure 4: Selecting variables when


typing

8.2.4.4 Literals in the Rung


In the functional blocks, it is also possible to enter literal values as shown in the figure that follows.

Figure 1: Example of Program

In this example, the PT input of the TON block was configured with the value 1000, which is a literal.

In order to enter literals, the following conventions must be used:

Whole number has no decimal point.


o E.g.: 12, 1000, 1555
Real numbers with floating point must necessarily have point.
o E.g.: 1.5, 2.25, 3.0
Numbers represented in hexadecimal must necessarily define the data type.
o E.g.: BYTE#16#7F, WORD#16#3CF0, DWORD#16#00FF0088
Numbers represented in binary must necessarily define the data type.
o E.g.: BYTE#2#1010_0000, WORD#2#0111_0000_0000_0001

ATTENTION!
In some blocks, for data verification and consistency reasons, it will be necessary to define the data
type of the literal through specific notation that will contain the following options: BOOL#, BYTE#,
INT#, UINT#, DINT#, UDINT#, WORD#, DWORD# and REAL#. Example: WORD#17321

8.2.4.5 Arrays in the Rung


In the contacts, coils and functional blocks, it is also possible the access of variables of the array type as
shown in the following figures.

WPS v2.5X | 142


Ladder

Figure 1: Array access

Figure 2: Array in the Rung

In order to view the indices of a variable of the array type, expand the variable in the variable window as shown
in the following figure.

Figure 3: Displaying indices of a variable of the array type

8.2.4.6 Instances and Structures in the Rung


In the contacts, coils and functional blocks, it is also possible to access the internal variables of instances
and structures as shown in the following figures.

WPS v2.5X | 143


Ladder

Figure 1: Access of internal variable of instance or structure

Figure 2: Internal variable of instance or structure in the Rung

In order to view the internal variables of the instances and structures, expand the variable in the variable
window as shown in the following figure.

Figure 3: Displaying internal variables of instance or structure

8.2.4.7 Volatile and Retentive Instances


Function Blocks (FBs)

The FBs have internal variables that store their data during the consecutive execution cycles. According to the
application requirement, these FBs may have their instances configured as retentive (LOCAL_RETAIN or
GLOBAL_RETAIN) or volatile (LOCAL_RETAIN or GLOBAL_RETAIN). The input and output variable
associated to the FB can also be configured as retentive or volatile. The retentive variables retain their values

WPS v2.5X | 144


Ladder

after the device is shut down, whereas the volatile variables load their initial values after a reset.

When we want the FB to keep the values after the reset of the device, it is necessary that the FB instances
and the variables associated to its inputs be configured as retentive. That will make the FB internal variables
and the associated input variables keep the values previous to shutdown.
In the example below, we have the use of the TON block with retentive instances and variables:

Figure 1: TP block with retentive instance and variables before reset.

WPS v2.5X | 145


Ladder

Figure 2: TP block with retentive instance and variables one second after the setup.

When we want the FB to reset its values after the shutdown of the device, it is necessary that the FB instance
and the variables associated to its inputs be configured as volatile. That will make the FB internal variables and
the associated input variables reset the values previous to shutdown.
Below is an example of use of the CTU block with retentive instance and variables:

WPS v2.5X | 146


Ladder

Figure 3: CTU block with volatile instance and variables before reset.

WPS v2.5X | 147


Ladder

Figure 4: CTU block with volatile instance and variables after reset.

User’s Block (USERFB)

In the use of the USERFB, it is possible to define variables of LOCAL, LOCAL_RETAIN, VAR_IN, VAR_OUT
and VAR_IN_OUT type. The internal variables defined as LOCAL will always be volatile, and the
LOCAL_RETAIN ones will always be retentive. The internal variable defined as VAR_IN, VAR_OUT and
VAR_IN_OUT will be volatile in case the instance of the USERFB is associated to the LOCAL or GLOBAL
group and retentive in case it is associated to the LOCAL_RETAIN or GLOBAL_RETAIN group.

8.2.5 Compile
In order to compile a Program (POU), there are four options:

1. Through the menu Configuration > Build Main Resource.

WPS v2.5X | 148


Ladder

Figure 1: Compile from the Menu

2. Through the shortcut key F4.

3. Through the button on the Toolbar.

Figure 2: Compile
from the Toolbar

4. Clicking the right button of the mouse on the name of the resource.

Figure 3: Right button of the mouse on the resource

The results of the compilation, indicating errors and warnings, can be viewed through the Default Output
window.

Figure 4: Results of the compilation

8.2.6 Transfer
In order to download a resource, there are four options:

WPS v2.5X | 149


Ladder

1. Through the menu Communication > Download Main Resource.

Figure 1: Download from the Menu

2. Through the shortcut key F5.

3. Through the button on the Toolbar.

Figure 2: Download
from the Toolbar

4. Clicking the right button of the mouse on the name of the resource.

8.2.7 Online Monitoring


Overview

After the Ladder program is compiled and loaded on the device, it is possible to monitor the Ladder by

pressing the Connect Device button .


At this moment, the WPS v2.5X will try to establish communication with the device by testing the
communication with it.

The online monitoring will graphically represent the logical state of the Ladder program. An example of online
monitoring can be seen in the following figure.

WPS v2.5X | 150


Ladder

Figure 1: Example of online monitoring

For functional blocks, the values are presented as shown in the following figure:

Figure 2: Monitoring values of the functional blocks

The variables values are shown on their respective variables; the internal values of the instance are shown on
the name of the respective argument.

Writing of variables

In order to write variables, just double click the variable you wish to write and a value writing box will open as
shown in the following figure.

Figure 3: Writing of variables

In this box, you must enter the desired value and press the Write button in order to write the value. The
Toggle button is used to toggle the value written between zero and the current value.

Monitoring of instances

In order to monitor, just double click the instance variable and a box related to instance monitoring will open as
shown in the following figure.

WPS v2.5X | 151


Ladder

Figure 4: Monitoring of instances

In order to write on instance internal variables, just click on the corresponding line, use the value edition box
and the Write and Toggle buttons as already mentioned in the previous item.

Monitoring of structures

For the variables created from structures defined in the resource, just click on the corresponding variable and a
box similar to the instance monitoring one will open. See the following example.

Figure 5: Structure defined in the resource

WPS v2.5X | 152


Ladder

Figure 6: Variable created with data type of the structure


defined in the resource

Figure 7: Monitoring of the variable used in the SDCARD_ReadRecipe block

Monitoring of arrays

For variables created with size greater than zero, it is possible to monitor all the data of their array. In order to
do so, just click on the corresponding variable and a monitoring box will open. See the following example.

WPS v2.5X | 153


Ladder

Figure 8: Variable created with size greater than zero, array

Figure 9: Monitoring of the variable used in MB_ReadRegister block

8.3 Working with USERFBs


8.3.1 Creating USERFBs
USERFBs are cuser-customizable functional blocks. Its utilization is encouraged to make the Ladder program
less bulky and polluted, abstracting information with which one does not want to work often and systematizing
complex tasks.

In these blocks, the inputs and outputs are defined by the user, who handles them in the Ladder diagram
associated with the block. Here's how to create your USERFB.

1. In the Projects window, locate the resource in which you want to create the USERFB, right-click in User

WPS v2.5X | 154


Ladder

Function Block and click in New Folder.

2. In the wizard, insert a name for the library to which the USERFB will belong and click Next.

3. Insert a valid name for the USERFB and click Next.

4. If you want to insert a password to protect the block code, check the Encrypt binary checkbox and type a
password. Otherwise, uncheck it. Click Finish.

WPS v2.5X | 155


Ladder

That's it! The USERFB has been succesfully created. You should see the following in the Projects window.

8.3.2 Adding input/output


Now we'll cover how to create inputs and outputs for the USERFB.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

WPS v2.5X | 156


Ladder

2. In the Window menu, click Variables.

Analysing the following figure, we see that the USERFB Variables window is different from other Ladder files.
It has only volatile and retain variables in LOCAL scope, which are the internal variables of the block, used in
its subroutine. Besides these, it has three more groups: VAR_IN, VAR_OUT and VAR_IN_OUT.

VAR_IN: internal variables that repersent the input arguments for that block.
VAR_OUT: internal variables that repersent the output arguments for that block.
VAR_IN_OUT: internal variables that repersent the input/output arguments for that block.

3. In order to create an input, click in the VAR_IN tab and click in the symbol. In the window, set a name
and a datatype to this variable and click OK.

WPS v2.5X | 157


Ladder

4. In order to create an output, click in the VAR_OUT tab and click in the symbol. In the window, set a
name and a datatype to this variable and click OK.

5. In order to create an input/output, click in the VAR_IN_OUT tab and click in the symbol. In the window,
set a name and a datatype to this variable and click OK.

WPS v2.5X | 158


Ladder

8.3.3 Editing the Ladder


Now we'll cover how to edit the USERFB subroutine.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

The Ladder Editor will open, like any other Ladder diagram. Any block may be inserted in it, including other
USERFBs. Remember that only local variables may be used in it.

WPS v2.5X | 159


Ladder

8.3.4 Using USERFBs


Lastly we'll cover how to make use of the USERFB, inserting it in other Ladder diagrams.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

2. In the Pallete window, select the USERFB block from the Module category and drag it to the position
where you want to use it in the Ladder diagram.

3. Double click the question marks (???) above the block in order to insert a instance variable for the
USERFB. Type in the variable name and click Edit. In the confirmation dialog, click Yes to create the new
variable.

WPS v2.5X | 160


Ladder

4. In the Add dialog, type in a name for the variable and select its parameters. In the Datatype field, choose
the name of the desired USERFB (if there is only one, the field will not be enabled).
For example, if your USERFB name is MYUSERFB, the correct datatype to be selected is
$USERFB_MYUSERFB.

That's it! Your very own USERFB is inserted in the diagram and ready to work!

WPS v2.5X | 161


Diagnostic

9 Diagnostic
9.1 Monitoring Variable
Monitoring Variable allows creating sets of variables for monitoring in a Resource.

To do this, right-click on Variable Monitoring and select New File, following the on-screen instructions for
creating a new file.

After creating the file, use the button to add a variable.

Select the desired variable and click OK to confirm adding:

WPS v2.5X | 162


Diagnostic

9.2 Trend
9.2.1 Overview
Trend is a graph of the values of variables versus time.

The Trend function has ten monitoring channels, which means it is possible to monitor up to ten variables
and/or parameters at the same time.

Below is an overview of the trend function configuration screen.

WPS v2.5X | 163


Diagnostic

1. Channels, Start, Stop and Graphic Zoom: This bar contains the options to add, edit and remove
channels, and also the options to control the chart, such as zoom in, zoom out, set width, set height and
set all. There are buttons to start or stop data acquisition.
2. Time: This bar contains the options to configure the sampling periods and time range to be shown on the
graphic.
3. Chart: This screen shows graphically the monitored values of the channels. In the lower part is the time of
collection, and on the left is the range of values per unit of measurement of the channels.
4. Channel Table: This table shows the data of the chosen channels in the position where the cursor is,
besides the possibility to hide channels (Visible), change the channel color (Color) and set the chart limits
per unit of measurement (Maximum).

9.2.2 Configuration
Below is a list of the necessary steps to create a trend configuration.

1. Creation of a new trend file.

WPS v2.5X | 164


Diagnostic

2. Addition and configuration of the channels on the button on the upper left corner.

3. After adding the channel, just click on Connect Device and the trend will start automatically.

WPS v2.5X | 165


Diagnostic

WPS v2.5X | 166


Wizards

10 Wizards
10.1 Overview
Wizards allow the user to configure and monitor variables of the configured equipment in the resource through
predefined windows.

Below is an overview of the Wizards in WPS v2.5X.

1. Toolbar: displays the main commands of the software and contains the Connect Device button
required for writing and reading the equipment variables;
2. Configurations Window: displays the configurations, where each configuration contains resources, and
the resource contains the monitoring and configuration wizards;
3. Wizard Title: displays the title of the open wizard;

4. Wizard Toolbar: displays the commands for upload and monitoring , writing and printing
values of a configured wizard variables (Configuration Wizards only);
5. Equipment Status: displays the status of the connected equipment (Configuration Wizards only);
6. Message from an Equipment Status: displays the message of an alarm, failure or configuration status of
the connected equipment (Configuration Wizards only);
7. Equipment Variable Area: displays the writing and reading variables of the configured equipment and can
contain tabs for better division of the equipment's features.

10.2 Monitoring Wizard


A Monitoring Wizard basically allows the user to read the equipment variables that WPS v2.5X is connected

WPS v2.5X | 167


Wizards

to.

The Wizards folder in the Configurations Window contains the list of wizards implemented for the
equipment being a Monitoring Wizard identified by the icon .

When opening a Monitoring Wizard with communication with the equipment not established, a window will
be presented to the user as below.

To start monitoring the window variables, press the Connect Device button so that the communication
with the device is established.

WPS v2.5X | 168


Wizards

If the communication with the equipment is established the window background will change from light gray to
dark gray. When closing the window no questioning will be done to the user.

10.3 Configuration Wizard


A Configuration Wizard basically allows the user to configure the equipment's writing variables with WPS
v2.5X connected (online) or not connected (offline) to the device.

The Wizards folder in the Configurations Window contains the list of wizards implemented for the
equipment being a Configuration Wizard identified by the icon .

You can save the programmed values in a Configuration Wizard thus generating a new wizard file identified
by the icon .

When opening a Configuration Wizard with communication with the equipment not established, a window
will be presented to the user as below.

WPS v2.5X | 169


Wizards

The configuration with the equipment not connected (offline) is done with the Upload and Monitor Values

button not active.

When the configuration is finished, the user can save the values of the wizard by closing the wizard and
confirming the saving of the values.

A new wizard file with a generic name will then be saved, where the user can then manipulate this new file
according to the options shown by right-clicking the file as shown below.

WPS v2.5X | 170


Wizards

You can also create a new file based on the equipment wizard by right-clicking the wizard as shown below.

To print all the values of the Configuration Wizard you need to press the Print Values button in the
Wizard Toolbar. A print file will be generated in the format shown below.

WPS v2.5X | 171


Wizards

To send all the values of the Configuration Wizard to the equipment it is necessary to press the Connect

Device button so that the communication with the equipment is established and then press the Write

Values button in the Wizard Toolbar.

WPS v2.5X | 172


Wizards

To start a Configuration Wizard with the connected equipment (online) it is necessary to press the Monitor

Values button so that the monitoring of the equipment variables is activated in the wizard. At this point
the wizard variables are updated with the values that are on the connected equipment.

WPS v2.5X | 173


Wizards

If the communication with the equipment is established the window background will change from light gray to
dark gray. When closing the window will ask a question related to saving the values of the wizard.

WPS v2.5X | 174


Equipments (Devices)

11 Equipments (Devices)
11.1 CFW100
11.1.1 Description
The CFW100 frequency inverter is a high-performance product which allows speed control of three-phase
induction motors. This product provides the user with the options of vector (VVW) or scalar (V/f) control, both
programmable according to the application.

The scalar mode (V/f) is recommended for simpler applications, such as the activation of most pumps and
fans. In such cases it is possible to reduce the losses in the motor and the inverter using the "V/f Quadratic",
which results in energy savings. The V/f mode is used when more than a motor is activated by an inverter
simultaneously (multimotor applications). In the vector mode (VVW), the operation is optimized for the motor
in use, obtaining a better performance in terms of speed regulation.

The frequency inverter CFW100 also has functions of PLC (Programmable Logic Controller) by means of the
SoftPLC (integrated) feature. It has a slot for connection of the accessories for input and output (I/Os)
expansion, communication networks or remote HMI.

Refer to the user's manual of the CFW100 for further details about the product.

NOTE!

CFW100 versions below V3.00 do not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.1.2 System Markers


The following variables contained in the GLOBAL_SYSTEM group of the variables table, have the fixed tag.
The tag of system markers were divided into groups and subgroups, where:

Groups:
CFW: reading and writing variables of the CFW100 frequency inverter.

Subgroups:
STS: reading variable (status);
CMD: writing variable (command).

Reading System Markers (Status)

Reading - Function Modbus 02 "Read Discrete Inputs"

Address Bit Modbus Tag Description

Ladder

%SB6000 0 0 SYS_FREQ_2HZ Oscillator w ith frequency of 2 Hz

WPS v2.5X | 175


Equipments (Devices)

%SB6000 1 1 SYS_PULSE_1SCAN Pulse during the first scan cycle

%SB6000 2 2 SYS_FALSE Alw ays in 0

%SB6000 3 3 SYS_TRUE Alw ays in 1

Logical Status

The run motor command is active in the


%SB6002 1 17 CFW_STS_RUN_COMMAND
inverter
%SB6002 2 18 CFW_STS_FIRE_MODE_ACTIVE Fire Mode Function is active

The inverter is configured to use the first


%SB6002 5 21 CFW_STS_SEC_RAMP_ACTIVE or second ramp values (0-First, 1-
Second)
%SB6002 6 22 CFW_STS_CONFIG_MODE The inverter is in the configuration mode

%SB6002 7 23 CFW_STS_ALARM_ACTIVE The inverter is in alarm condition

The inverter is running the motor at the


%SB6003 0 24 CFW_STS_MOTOR_RUNNING speed reference, or executing either the
acceleration or the deceleration ramp
General Enable is active and the inverter
%SB6003 1 25 CFW_STS_GENERAL_ENABLED
is ready to run the motor
The motor is running in the reverse or
%SB6003 2 26 CFW_STS_FWD_REV_DIRECTION forw ard direction (0-Reverse, 1-
Forw ard)
%SB6003 3 27 CFW_STS_JOG_ACTIVE The JOG function is active

The inverter is in local or remote mode (0-


%SB6003 4 28 CFW_STS_LOC_REM_MODE
Local, 1-Remote)
%SB6003 5 29 CFW_STS_UNDERVOLTAGE The inverter is in undervoltage

%SB6003 7 31 CFW_STS_FAULT_ACTIVE The inverter has detected a fault

It indicates that the signal of analog input


%SB6004 0 32 CFW_STS_AI1_BROKEN_CABLE AI1 in 4 to 20 mA or 20 to 4 mA is below
2 mA
HMI keys

%SB6006 0 48 CFW_STS_KEY_START_STOP START/STOP key (I)/(0) pressed

%SB6006 2 50 CFW_STS_KEY_UP UP key pressed

%SB6006 3 51 CFW_STS_KEY_DOWN DOWN key pressed

Infrared Remote Control (IRC 1)

%SB6010 0 80 CFW_STS_IRC_1_KEY_ON Start/Stop Motor key pressed

%SB6010 1 81 CFW_STS_IRC_1_KEY_DOWN Brow se Dow nw ards key pressed

%SB6010 2 82 CFW_STS_IRC_1_KEY_UP Brow se Upw ards key pressed

Commute view key pressed. This key


allow s commute view betw een tw o
%SB6010 3 83 CFW_STS_IRC_1_KEY_CHANGE
parameters (values) defined by
parameters P842 and P843
%SB6010 4 84 CFW_STS_IRC_1_KEY_P Confirm/Program key pressed

WPS v2.5X | 176


Equipments (Devices)

%SB6010 5 85 CFW_STS_IRC_1_KEY_SFK1 Special Function key 1 pressed

%SB6010 6 86 CFW_STS_IRC_1_KEY_SFK2 Special Function key 2 pressed

%SB6010 7 87 CFW_STS_IRC_1_KEY_SFK3 Special Function key 3 pressed

Reading - Function Modbus 04 "Read Input Registers"

Speed

%
-- 3100 CFW_STS_MOTOR_SPEED_13BITS Motor speed in 13 bits (8192)
SW6200
%
-- 3101 CFW_STS_MOTOR_SYNC_SPEED Motor synchronous speed in rpm
SW6202
%
-- 3102 CFW_STS_MOTOR_SPEED_RPM Motor speed in rpm
SW6204
%
-- 3103 CFW_STS_SPEED_REFERENCE Speed reference after ramp in rpm
SW6206

Alarm and Fault

%
-- 3104 CFW_STS_PRES_ALARM Alarm number that may be present in the inverter
SW6208
%
-- 3105 CFW_STS_PRES_FAULT Fault number that may be present in the inverter
SW6210

Current and Torque

%
-- 3106 CFW_STS_RATED_CURRENT Inverter rated current (HD) in A (x10)
SW6212
%
-- 3107 CFW_STS_MOTOR_CURRENT Motor current w ithout filter in A (x10)
SW6214
%
-- 3108 CFW_STS_MOTOR_TORQUE Motor torque w ithout filter in % (x10)
SW6216

Writing / Reading System Markers (Command)

Reading - Function Modbus 01 "Read Coils"


Writing - Function Modbus 05 "Write Single Coil" and 15 "Write Multiple Coils"

WPS v2.5X | 177


Equipments (Devices)

Address Bit Modbus Tag Description

Logical Command

Run the motor according to the speed reference value (0-


%CB6008 0 16 CFW_CMD_RUN_STOP
Stop, 1-Run)
Enables the inverter allow ing the motor operation (0-Disable,
%CB6008 1 17 CFW_CMD_GENERAL_ENABLE
1-Enable)
The motor runs in the direction indicated by the speed
%CB6008 2 18 CFW_CMD_SPEED_DIRECTION
reference (0-Reverse, 1-Forw ard)

%CB6008 3 19 CFW_CMD_JOG Enables the JOG function (0-Disable, 1-Enable)

%CB6008 4 20 CFW_CMD_LOC_REM Selects the inverter operation mode (0-Local, 1-Remote)

Selects the ramp to accelerate and decelerate the motor (0-


%CB6008 5 21 CFW_CMD_SECOND_RAMP
First, 1-Second)
It allow s that the SoftPLC command CFW_CMD_RUN_STOP
CFW_CMD_FORCE_RUN_STOP_SPL
%CB6008 6 22 change the inverter command Run/Stop regardless of source
C
programmed for Start/Stop via P224 or P227

%CB6008 7 23 CFW_CMD_FAULT_RESET Executes the fault reset command

11.1.3 I/O's
Hardware information can be found in the Manual of the CFW100 at the website www.weg.net.

Digital Inputs

Address Bit Modbus Tag Description


%IB0 0 16000 DI1 Digital input 1
%IB0 1 16001 DI2 Digital input 2
%IB0 2 16002 DI3 Digital input 3
%IB0 3 16003 DI4 Digital input 4
%IB0 4 16004 DI5 Digital input 5 - I/O expansion module
%IB0 5 16005 DI6 Digital input 6 - I/O expansion module
%IB0 6 16006 DI7 Digital input 7 - I/O expansion module
%IB0 7 16007 DI8 Digital input 8 - I/O expansion module

Analog Inputs

Address Bit Modbus Tag Description


%IW2 -- 5001 AI1 Analog input 1 - I/O expansion module
%IW6 -- 5003 AIP Analog input (Potentiometer) - I/O expansion module
%IW8 -- 5004 FI1 Frequency Input 1

Digital Outputs

WPS v2.5X | 178


Equipments (Devices)

Address Bit Modbus Tag Description


%QB0 0 16000 DO1 Digital output 1 - I/O expansion module
%QB0 1 16001 DO2 Digital output 2 - I/O expansion module
%QB0 2 16002 DO3 Digital output 3 - I/O expansion module

Analog Outputs

Address Bit Modbus Tag Description


%QW2 -- 5001 AO1 Analog output 1 - I/O expansion module

11.1.4 Import from WLP


The function import from WLP is utilized to import Ladder developed on WLP software to equipment (device).

The import from WLP can be executed during the resource creation.

1. To execute the import WLP function click the Import from WLP button and select the WLP project folder or
the WLP BKP file.

WPS v2.5X | 179


Equipments (Devices)

WPS v2.5X | 180


Equipments (Devices)

2. After import from WLP completed successfully click the Finish button to copy the imported files to new
resource.

11.1.5 Parameters
11.1.5.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 181


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 182


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.1.5.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 183


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 184


Equipments (Devices)

11.1.5.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 185


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 186


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 187


Equipments (Devices)

11.1.5.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 188


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 189


Equipments (Devices)

WPS v2.5X | 190


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 191


Equipments (Devices)

WPS v2.5X | 192


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 193


Equipments (Devices)

WPS v2.5X | 194


Equipments (Devices)

WPS v2.5X | 195


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 196


Equipments (Devices)

WPS v2.5X | 197


Equipments (Devices)

11.1.5.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 198


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 199


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.1.6 Ladder
11.1.6.1 Coil
11.1.6.1.1 DIRECTCOIL
Logical block used to assign direct values of the output variables.

WPS v2.5X | 200


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example keeps the digital output DO9 permanently connected, because the value of A in
this case is the value of the left bus which is always considered high logic level (TRUE).

11.1.6.1.2 INVERTEDCOIL
Logical block used for assigning values denied to output variables.

Ladder Representation

WPS v2.5X | 201


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the denied value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example disables the digital output DO3 when some of the digital inputs DI1 and DI2 are
with FALSE value. When both inputs are with a TRUE value, DO3 activates.

WPS v2.5X | 202


Equipments (Devices)

11.1.6.1.3 RESETCOIL
Logical block used for indefinite disabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers a FALSE value to the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

Example

WPS v2.5X | 203


Equipments (Devices)

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI5.

11.1.6.1.4 SETCOIL
Logical block used for indefinite enabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers the value of A for the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

WPS v2.5X | 204


Equipments (Devices)

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI6.

11.1.6.1.5 TOGGLECOIL
Logical block used for output variables alternance.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output
VAR TOGGLECOIL_INST_0 TOGGLECOIL Instance of access to block structure

Operation

When identifying a transition from FALSE to TRUE (leading edge) on A, the block reverses the status
of O1.

Diagram

WPS v2.5X | 205


Equipments (Devices)

Block Flowchart

Example

The above example inverts the state of the digital output DO6 to each disabling the internal buzzer.

11.1.6.2 Communication Network


11.1.6.2.1 Modbus RTU
11.1.6.2.1.1 Modbus RTU Overview
Operation in the Modbus RTU Network - Master Mode

The CFW300 allows operation as a master for the Modbus RTU network. For this operation, it is necessary to
observe the following points:

Only interface RS485 allows operation as a network master.


It is necessary to program, in product configurations, the operation mode as "Master", besides the
communication rate, parity, and stop bits, which must be the same for the whole equipment in the network.
The Modbus RTU network master does not have an address, so the address configured in the CFW300 is
not used.
Sending and receiving telegrams via RS485 interface using the Modbus RTU is programmed by using blocks
in Ladder programming language. It is necessary to know the available blocks and the Ladder programming
software in order to be able to program the network master.

WPS v2.5X | 206


Equipments (Devices)

The following functions are available for the sending of requisitions by the Modbus master:
o Function 01: Read Coils
o Function 02: Read Discrete Inputs
o Function 03: Read Holding Registers
o Function 04: Read Input Registers
o Function 05: Write Single Coil
o Function 06: Write Single Register
o Function 15: Write Multiple Coils
o Function 16: Write Multiple Registers

Blocks to program the master

In order to control and monitor the Modbus RTU communication using the CFW300, the following blocks were
developed, and they must be used when programming in Ladder.

11.1.6.2.1.2 MB_MasterControlStatus
Block that allows monitoring various statuses of the Modbus RTU network master.

Ladder Representation

Block Structure

WPS v2.5X | 207


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
DisableComm BOOL Disables Modbus RTU communication
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
TxCounter WORD UINT Counter of requests sent
RxCounter WORD UINT Counter of telegrams received
NoAnswerCounter WORD UINT Counter of requests not answ ered
Counter of responses received w ith error
ErrorResponseCounter WORD UINT
information
VAR_OUTPUT
Slave address in w hich the last communication
LastErrorSlaveAddress BYTE USINT
error w as detected
Operation result of the last communication error
received
LastErrorResult BYTE USINT (0 = No error)
(4 – Response Timeout)
(5 = Slave returned error)
LastErrorCode BYTE USINT Code of the last communication error received

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the Modbus RTU communication and resets the status counters
and markers of the master. These markers and counters are displayed in the output block each
having some data corresponding to its description. Their values are also cleared at shutdown of the
master.

Block Flowchart

WPS v2.5X | 208


Equipments (Devices)

Example

The example above requests status data of the Modbus RTU network master, and allows disabling
communication through DISABLE. The block ends successfully, Done output is activated.

11.1.6.2.1.3 MB_ReadBinary
Block that performs a reading of up to 128 binary data (via Read Coils or Read Discrete Inputs) of a
slave on the Modbus RTU network.

Ladder Representation

WPS v2.5X | 209


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial bit address of the data to be read
VAR_INPUT
NumberOfData BYTE Number of bits to be read (1 to 128)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
VAR_OUTPUT another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
Value BOOL Variable that stores the received data
VAR MB_READBINARY_INST_0 MB_READBINARY Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus slave RTU in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

WPS v2.5X | 210


Equipments (Devices)

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 211


Equipments (Devices)

WPS v2.5X | 212


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT Modbus RTU slave of SLAVE address through the Read Discrete Input function.
These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.1.6.2.1.4 MB_ReadRegister
Block that performs a reading of up to 64 16-bit registers (via Read Holding Registers or Read Input
Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 213


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial register address to be read
VAR_INPUT
NumberOfData BYTE Number of registers to be read (1 to 64)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
another request

VAR_OUTPUT Error BOOL Error in the execution flag


ErrorID BYTE Identifier of the occurred error
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the received data
DWORD UDINT
DINT REAL
MB_READREGISTER
VAR MB_READREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of registers indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting them when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 214


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 215


Equipments (Devices)

WPS v2.5X | 216


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT in the Modbus RTU slave of SLAVE address through the Read Input Register
function. These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.1.6.2.1.5 MB_SlaveStatus
Block that allows monitoring the status of 4 slaves of the Modbus RTU network.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
Amount of errors that the master must identify until it
ErrorsToSetOffline# BYTE
considers communication w ith an offline slave

VAR_INPUT AddressSlave1# BYTE Slave address 1 to be monitored


AddressSlave2# BYTE Slave address 2 to be monitored
AddressSlave3# BYTE Slave address 3 to be monitored
AddressSlave4# BYTE Slave address 4 to be monitored
Done BOOL Output enabling
Flag indicating any one of the monitored
GeneralOffline BOOL
communication is offline

VAR_OUTPUT Slave1Offline BOOL Flag of offline status slave 1


Slave2Offline BOOL Flag of offline status slave 2
Slave3Offline BOOL Flag of offline status slave 3
Slave4Offline BOOL Flag of offline status slave 4

WPS v2.5X | 217


Equipments (Devices)

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
number of errors recorded for each slave. When Execute receives FALSE level, the inputs are ignored
and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE level and
block finished its execution.

The ErrorsToSetOffline # input allows registering the number of errors identified in a slave that will
feature an offline communication. AddressSlave inputs allow inserting four slave addresses to be
monitored. When this monitored slave reports the programmed number of errors, its corresponding
SlaveOffline output is set to TRUE level. If any of SlaveOffline outputs is at TRUE level, GeneralOffline
also receives TRUE level.

Block Flowchart

Example

WPS v2.5X | 218


Equipments (Devices)

The above example checks the number of error responses sent by the slaves 2, 4, 6 and 8 of the
Modbus RTU. If any of them is greater than 5, its SX_OFF status is led to TRUE level. The block ends
successfully, Done output is activated.

11.1.6.2.1.6 MB_WriteBinary
Block that performs a writing of up to 128 binary data (via Write Single Coil or Write Multiple Coils) in
a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 219


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial bit address w here the data w ill be w ritten
VAR_INPUT NumberOfData BYTE Number of bits to be w ritten (1 to 128)
Timeout# WORD Maximum w aiting time for the slave response [ms]
Offset Indication in InitialDataAddress, i.e., need to
Offset# BOOL
subtract 1 from this number
Value BOOL Variable that stores the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEBINARY
VAR MB_WRITEBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. If the slave is not free, the block waits Busy go to FALSE level to resubmit
the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 220


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 221


Equipments (Devices)

WPS v2.5X | 222


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Coil. The block ends successfully, Done output is activated.

11.1.6.2.1.7 MB_WriteRegister
Block that performs a reading of up to sixteen 16-bit registers (via Write Single Register or Write
Multiple Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 223


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial register address to be w ritten
NumberOfData BYTE Number of registers to be w ritten (1 to 16)

VAR_INPUT Maximum w aiting time for the slave response


Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the data to be w ritten
DWORD UDINT DINT
REAL
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy
VAR_OUTPUT Busy BOOL
w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEREGISTER
VAR MB_WRITEREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of Value values in a number of registers indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the slave. If the slave is not free, the block waits Busy go to FALSE
level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 224


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 225


Equipments (Devices)

WPS v2.5X | 226


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Register. The block ends successfully, Done output is activated.

11.1.6.3 Compare
11.1.6.3.1 COMP_EQ
Block that compares the values of Value1 and Value2, enabling the output Q if both are equal.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality

Operation

When this block has a TRUE value in EN, it sends to the output Q the TRUE value if Value1 and
Value2 are the same. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 227


Equipments (Devices)

Example

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated. Notice that the types of the input variables can be different
without causing execution problems.

WPS v2.5X | 228


Equipments (Devices)

The example above checks equality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is disabled.

11.1.6.3.2 COMP_GE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
or equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or majority of Value1

Operation

When this block has a TRUE value in EN it sends the Q output to the TRUE value if Value1 is higher
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 229


Equipments (Devices)

Example

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is disabled.

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 230


Equipments (Devices)

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is activated.

11.1.6.3.3 COMP_GT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of majority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is higher
than Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 231


Equipments (Devices)

Example

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is disabled.

The example above checks the majority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 232


Equipments (Devices)

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is activated.

11.1.6.3.4 COMP_LE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than or
equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 233


Equipments (Devices)

Example

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is activated.

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 234


Equipments (Devices)

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is disabled.

11.1.6.3.5 COMP_LT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 235


Equipments (Devices)

Example

The example above checks minority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is activated.

The example above checks the minority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 236


Equipments (Devices)

The example above checks the minority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is disabled.

11.1.6.3.6 COMP_NE
Block that compares the values of Value1 and Value2, enabling the Q output if Value1 is different from
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of inequality

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is
different from Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 237


Equipments (Devices)

Example

The example above checks inequality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is disabled.

11.1.6.4 Contact
11.1.6.4.1 NCCONTACT
Normally closed contact.

Ladder Representation

WPS v2.5X | 238


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with TRUE value, B receives FALSE.


When variable I1 is with FALSE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 239


Equipments (Devices)

Example

The above example performs the transfer of the opposite value of digital input DI1 to the digital output
DO2.

11.1.6.4.2 NOCONTACT
Normally open contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with FALSE value, B receives FALSE.


When variable I1 is with TRUE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 240


Equipments (Devices)

Example

The above example performs the transfer of the value of digital input DI1 to the digital output DO2.

11.1.6.4.3 NTSCONTACT
Falling edge transition contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR NTSCONTACT_INST_0 NTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from TRUE to FALSE (falling edge or negative edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

WPS v2.5X | 241


Equipments (Devices)

Block Flowchart

Example

The above example resets the digital output DO1 if the SHIFT key is pressed or a positive pulse on
the digital input DI2 is given.

11.1.6.4.4 PTSCONTACT

Leading edge transition contact.

Ladder Representation

WPS v2.5X | 242


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR PTSCONTACT_INST_0 PTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from FALSE to TRUE (leading edge or positive edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 243


Equipments (Devices)

Example

The above example resets the digital output DO1 if the SHIFT key is pressed and a positive pulse on
the digital input DI2 is given.

11.1.6.5 Control
11.1.6.5.1 PID
Block that performs the function of a discrete PID controller. From the input variables, it calculates the
corresponding controller output.

Ladder Representation

Block Structure

WPS v2.5X | 244


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SetPoint REAL Automatic reference (pre-control)
ManualSetPoint REAL Forced reference (post control)
SelectSetPoint BOOL Selects w hich reference to use
Feedback REAL Feedback loop variable
MinimumOutput REAL Minimum value of the controller output
MaximumOutput REAL Maximum value of the controller output
VAR_INPUT
Kp REAL Proportional gain
Ki REAL Integral gain
Kd REAL Derivative gain
TauSetPoint# REAL Time constant of the automatic reference in put filter
Type# BYTE Controller type
Action# BYTE Control action
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Controller output
VAR PID_INST_0 PID Instance of access to block structure

Operation

On the positive transition edge in EN, Output receives zero value, and the block executes its
functionality as EN is at TRUE level.

When enabled, this block performs a routine PID control with the Kp, Ki and Kd parameters chosen.
The PID topology used may be the Academic or Parallel, depending on what is chosen in Type#.

Academic Form:

Parallel Form:

WPS v2.5X | 245


Equipments (Devices)

The levels of the output signal of the controller are saturated at value MinimumOutput and
MaximumOutput. The SelectSetPoint input level FALSE causes the SetPoint reference be adopted,
allowing the controller maintains control over the process. When SelectSetPoint goes to TRUE level,
the controller has no more domain, and ManualSetPoint becomes to be considered the output signal
of the controller.

Action# will define the feedback operation. If Action# is DIRECT, the operation will be SetPoint –
Feedback. If Action# is REVERSE, the operation will be Feedback – SetPoint.

Feedback receives the process variable considered as the plant output. Ts# receives the sampling
time for the controller and # TauSetPoint receives the time constant for the input filter of the automatic
reference.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Effects of the alteration of gains on the process
If Kp decreases, the process becomes slower; generally more stable or less oscillating; it has
less overshoot.
If Kp increases, the process responds faster; it may become more unstable or more
oscillating; it has more overshoot.
If Ki decreases, the process becomes slower, lagging to reach the "SetPoint"; it becomes
more stable or less oscillating; it has less overshoot.
If Ki increases, the process becomes faster, quickly reaching the "SetPoint"; it becomes more
unstable or more oscillating; it has more overshoot.
If Kd decreases, the process becomes slower; it has less overshoot.
If Kd increases, it has more overshoot.

WPS v2.5X | 246


Equipments (Devices)

NOTE!
How to improve the performance of the process through the adjustment of gains (valid for the
Academic PID)
If the performance of the process is almost good, but the overshoot is a bit high, try to: (1)
decrease Kp 20%, (2) decrease Ki 20% and/or (3) decrease Kd 50%.
If the performance of the process is almost good, but it does not have overshoot and lags to
reach the "SetPoint", try to: (1) increase Kp 20%, (2) increase Ki 20% and/or (3) increase Kd
50%.
If the performance of the process is good, but the process output is varying too much, try to:
(1) increase Kd 50%, (2) decrease Kp 20%.
If the performance of the process is bad, i.e. after start up, the transitory lasts several periods
of oscillation that reduce very slowly or never reduce at all, try to: (1) decrease Kp 50%.
If the performance of the process is bad, i.e. after start up it slowly moves towards the
"SetPoint" without overshoot, but is still very far and the process output is less than the rated
value, try to: (1) increase Kp 50%, (2) increase Ki 50%, (3) increase Kd 70%.

Block Flowchart

WPS v2.5X | 247


Equipments (Devices)

WPS v2.5X | 248


Equipments (Devices)

Example

The above example creates a loop of a digital PID form with sampling time 50 ms, using the
constants KP, KI and KD for control. Automatic reference SETPOINT, filtered by a first order filter with
time constant of 0:01 is used. The error signal is calculated as the difference between the filtered
reference and variable SAIDA_PLANTA. The controller output is saturated between the values 0.1 and
2.5 and sent to the variable ENTRADA_PLANTA.

11.1.6.6 Conversion
11.1.6.6.1 BOOL
11.1.6.6.1.1 BYTE_TO_BOOL
Block that performs the conversion of a BYTE value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
BOOL, storing in Result.

WPS v2.5X | 249


Equipments (Devices)

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The examples above perform the conversion of VALUE variable, in BYTE, into a BOOL value storing

WPS v2.5X | 250


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.1.2 DWORD_TO_BOOL
Block that performs the conversion of a DWORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 251


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in DWORD, into a BOOL value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.1.3 REAL_TO_BOOL
Block that performs the conversion of a REAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

WPS v2.5X | 252


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 253


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice in the
last example that the values very close to the machine epsilon may result in an interpretation of the
FALSE value.

11.1.6.6.1.4 WORD_TO_BOOL
Block that performs the conversion of a WORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 254


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in WORD, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.2 BYTE
11.1.6.6.2.1 BOOL_TO_BYTE
Block that performs the conversion of a BOOL value into a BYTE value.

WPS v2.5X | 255


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 256


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BOOL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.2.2 DWORD_TO_BYTE
Block that performs the conversion of a DWORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 257


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.1.6.6.2.3 REAL_TO_BYTE
Block that performs the conversion of a REAL value into a BYTE value.

WPS v2.5X | 258


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 259


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in REAL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that the
results are truncated in decimal and only the eight least significant bits are taken into account.

11.1.6.6.2.4 WORD_TO_BYTE
Block that performs the conversion of a WORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

WPS v2.5X | 260


Equipments (Devices)

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 261


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.1.6.6.3 DWORD
11.1.6.6.3.1 BOOL_TO_DWORD
Block that performs the conversion of a BOOL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 262


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.3.2 BYTE_TO_DWORD
Block that performs the conversion of a BYTE value into a DWORD value.

Ladder Representation

Block Structure

WPS v2.5X | 263


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 264


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.3.3 REAL_TO_DWORD
Block that performs the conversion of a REAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 265


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in REAL, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated. Note that the
results are truncated in decimal and only the thirty-two least significant bits are taken into account.

11.1.6.6.3.4 WORD_TO_DWORD
Block that performs the conversion of a WORD value into a DWORD value.

WPS v2.5X | 266


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 267


Equipments (Devices)

The examples above convert the VALUE variable, in WORD, into a DWORD value storing the final
result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.4 REAL
11.1.6.6.4.1 BOOL_TO_REAL
Block that performs the conversion of a BOOL value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 268


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BOOL, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.4.2 BYTE_TO_REAL
Block that performs the conversion of a BYTE value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 269


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 270


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.4.3 DWORD_TO_REAL
Block that performs the conversion of a DWORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 271


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.4.4 WORD_TO_REAL
Block that performs the conversion of a WORD value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 272


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 273


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.5 WORD
11.1.6.6.5.1 BOOL_TO_WORD
Block that performs the conversion of a BOOL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 274


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.5.2 BYTE_TO_WORD
Block that performs the conversion of a BYTE value into a WORD value.

Ladder Representation

Block Structure

WPS v2.5X | 275


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 276


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.1.6.6.5.3 DWORD_TO_WORD
Block that performs the conversion of a DWORD value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 277


Equipments (Devices)

Example

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Notice that only the
sixteen least significant bits are taken into account.

11.1.6.6.5.4 REAL_TO_WORD
Block that performs the conversion of a REAL value into a WORD value.

WPS v2.5X | 278


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 279


Equipments (Devices)

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Note that the results
are truncated in decimal and only the sixteen least significant bits are taken into account.

11.1.6.7 Counter
11.1.6.7.1 CTD
Countdown block of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CD BOOL Pulse identifier
VAR_INPUT LD BOOL Loads the value of PV in CV
PV WORD UINT Value of initial configuration
Q BOOL Counter zeroed flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTD_INST_0 CTD Instance of access to block structure

Operation

WPS v2.5X | 280


Equipments (Devices)

When this block identifies a leading edge in CD, it decrements the CV variable until it is zero. While
CV equals zero, the output Q remains at TRUE level. By detecting high-level LD, the block loads the
PV value in CV.

Block Flowchart

Operation Diagram

WPS v2.5X | 281


Equipments (Devices)

Example

The above example shows the initial conditions of routine. As CV has a value of zero, the Q output is
enabled.

The value of the PV variable was changed to 20, but not yet loaded.

WPS v2.5X | 282


Equipments (Devices)

By identifying TRUE level in LD, the block loads the PV value to CV. Since this value is greater than
zero, the Q output is disabled.

At each leading edge identified in CD, the value of COUNT is decremented until it reaches zero, when
the Q output is enabled.

11.1.6.7.2 CTU
Block for gradual count of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CU BOOL Pulse identifier
VAR_INPUT R BOOL Loads the zero value in CV
PV WORD UINT Maximum count value
Q BOOL Counter overrun flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTU_INST_0 CTU Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it increments the CV variable until it is equal to PV.
While CV equals PV, the output Q remains at TRUE level. By detecting high-level R, the block loads
the zero value in CV.

Block Flowchart

WPS v2.5X | 283


Equipments (Devices)

Operation Diagram

WPS v2.5X | 284


Equipments (Devices)

Example

The above example shows the initial conditions of routine. Since CV has a lower value than of PV, the
Q output is disabled.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the Q output is enabled.

WPS v2.5X | 285


Equipments (Devices)

By identifying TRUE level in R, the block loads the zero value to CV. Since this value is lower than of
PV, the Q output is disabled.

11.1.6.7.3 CTUD
Block for gradual count and countdown of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
CU BOOL Pulse identifier for incremental
CD BOOL Pulse identifier for decremental
VAR_INPUT
R BOOL Loads the zero value in CV
LD BOOL Loads the value of PV in CV
PV WORD UINT Reference value
ENO BOOL Output enabling
QU BOOL Counter overrun flag
VAR_OUTPUT
QD BOOL Counter zeroed flag
CV WORD UINT Current count value
VAR CTUD_INST_0 CTUD Instance of access to block structure

Operation

When this block has a TRUE value in EN, it acts as a CTD block and block CTU at the same time
acting on the same CV counter. That is: increments CV until it reaches PV to the leading edges in
CU and decrements CV until it reaches zero to the leading edges in CD. A positive transition in R
carries zero in CV, while a leading edge in LD loads the PV value in CV. If CV has zero value, QD
receives TRUE, and if CV has value equal to PV, QU receives TRUE.

WPS v2.5X | 286


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value.

Block Flowchart

WPS v2.5X | 287


Equipments (Devices)

WPS v2.5X | 288


Equipments (Devices)

Operation Diagram

Example

WPS v2.5X | 289


Equipments (Devices)

The example above shows the disabled block, with all its internal variables zeroed. Although the
external controls are activated, these values are not forwarded to the instance of the block.

When activated, the block identifies the value of PRESET, loading it in PV, and identifies that the
output is at zero, enabling the QD output. When execution is completed, the ENO output is activated.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the QU output is enabled. When execution is completed, the ENO output is activated.

At each leading edge detected in CD, the CV value is decremented. When CV is a value between
zero and PV, both QD and QU outputs are deactivated. When execution is completed, the ENO
output is activated.

WPS v2.5X | 290


Equipments (Devices)

A TRUE value in R resets CV, while a TRUE value in LD loads the value of PV to CV. As we can see,
R prevails over LD, leaving CV and enabling the QD output. When execution is completed, the ENO
output is activated.

11.1.6.8 Data Transfer


11.1.6.8.1 DEMUX
Block that creates 16 new BOOL variables from the decomposition of a WORD variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Word WORD UINT INT Input variable of 15 bits
ENO BOOL End of operation
VAR_OUTPUT
Bit0 – Bit15 BOOL Bit of the corresponding position of Word

Operation

WPS v2.5X | 291


Equipments (Devices)

When this block has a TRUE value in EN, it decomposes the input variable in Word 15 Boolean
values stored in Bit0 to Bit15 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 292


Equipments (Devices)

The example above decomposes the value of MYWORD in Boolean values, which are stored in the
output variables BIT0 to Bit15. The block ends successfully and the ENO output is activated.

11.1.6.8.2 ILOAD
Block which indirectly loads the value of a variable and transfers it to Value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
DataType# BYTE Data type of the selected variable
Address DWORD UDINT DINT Address of the global variable, as its group
ENO BOOL End of operation
VAR_OUTPUT As selected in
Value Value of the selected variable
DataType#

Operation

When this block has a TRUE value in EN, it loads, in Value, the of the Address variable belonging to
the Group# group, as the selected DataType#.

WPS v2.5X | 293


Equipments (Devices)

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example loads the value of the address 40 of group 2 (GLOBAL_SYSTEM%S), which
represents the status of ESC key in UINT format for the VALUE variable. The block ends with
success and ENO output is activated.

11.1.6.8.3 ILOADBOOL
Block that indirectly loads the value of a bit in a global variable address.

Ladder Representation

WPS v2.5X | 294


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be checked
ENO BOOL End of operation
VAR_OUTPUT
Value BOOL Value of the bit selected by the input arguments

Operation

When this block has a TRUE value in EN, it loads, in Value, the Bit contents of the Address variable
belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 295


Equipments (Devices)

Example

The above example loads the value of bit 1 of the address 24 of group 2 (S GLOBAL_SYSTEM%),
which represents the status of ESC key for the VALUE variable. The block ends with success and
ENO output is activated.

11.1.6.8.4 ISTORE
Block that indirectly loads the Value value in a variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
DataType# BYTE Data type of the selected variable
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Depending on the
Value selection of the Value to be w ritten in the selected variable
DataType#
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the contents of the Address
variable belonging to the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 296


Equipments (Devices)

Block Flowchart

Example

The example above stores the VALUE value in WORD format in address 444 of group 3
(GLOBAL_SYSTEM% C), which represents the index of the communication port Modbus TCP. The
block ends with success and ENO output is activated.

11.1.6.8.5 ISTOREBOOL
Block that indirectly loads the Value value in a bit in a global variable address.

Ladder Representation

WPS v2.5X | 297


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be modified
Value BOOL New value of the selected bit
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the Bit contents of the Address
variable belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 298


Equipments (Devices)

Example

The example above stores the value of VALUE in bit 7 of the address 121 in group 3
(GLOBAL_SYSTEM% C), which represents the disable command of CANopen communication. The
block ends with success and ENO output is activated.

11.1.6.8.6 MUX
Block that creates a new WORD variable from the concatenation of 16 BOOL variables.

WPS v2.5X | 299


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit15 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
Word WORD UINT INT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable Word. Bit0 corresponds to LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 300


Equipments (Devices)

Example

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYWORD. The block ends with success and ENO output is activated.

WPS v2.5X | 301


Equipments (Devices)

11.1.6.8.7 SEL
Block that replicates to the output the value of an input variable (Value0 or Value1) according to the
Selector selection.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Selector BOOL Variable that selects the input

VAR_INPUT BYTE USINT SINT WORD UINT


Value0 Multiplexed input number 1
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value1 Multiplexed input number 2
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value selected
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it replicates to the Result variable the Value0 value if
selector is FALSE or the Value1 value if Selector is TRUE.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 302


Equipments (Devices)

Example

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated.

WPS v2.5X | 303


Equipments (Devices)

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
TRUE level, the RESULT output gets the value of VALUE1. The block ends successfully and the ENO
output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

11.1.6.8.8 STORE
Block that performs direct storage of data from a source to a destination.

Ladder Representation

Block Structure

WPS v2.5X | 304


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
SRC Data source
INT DWORD DINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
DST Data destination
INT DWORD DINT DINT REAL

Operation

When this block has a TRUE value in EN, it stores the contents from SRC into DST.

NOTE!
SRC and DST must have data types of the same size.

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 305


Equipments (Devices)

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated.

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated. Note that the binary pattern is maintained between variables of different
types.

11.1.6.8.9 USERERR
Block that generates an alarm or fault with the number programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Error code generated
CODE WORD UINT
(950 - 999)
VAR_INPUT
Error type generated
TYPE BYTE (0 - Alarm)
(1 - Fault)
VAR_OUTPUT ENO BOOL Success in the generation of error
VAR USERERR_INST_0 USERERR (*) Instance of access to block structure

NOTE!
(*) USERERR_INST_0 instance must be configurated to SCA06 and LDW900 .

Operation

When this block has a TRUE value in EN, it generates an alarm or equipment failure, depending on
the type defined in TYPE with CODE code.

The value of ENO informs if the generation of alarm or fault has been executed successfully.

Block Flowchart

WPS v2.5X | 306


Equipments (Devices)

Example

The above example, when identifying TRUE level in DI1, generates a fault with the code 974 and sets
the DO1 output.

USERERR table configuration

On devices that have text-based HMI, messages can be configured through an editor. To access the
editor, right click on the USERERR block and select the "Edit USERERR Table" option.

WPS v2.5X | 307


Equipments (Devices)

The texts configured in the table will be displayed on the HMI when the block USERERR is enabled.

After editing the table, select the argument CODE of the block equal to the CODE column of the
table.

11.1.6.9 Filter
11.1.6.9.1 LOWPASS
Block that filters the input using a low pass filter of first order and inserts the result in the output.

Ladder Representation

WPS v2.5X | 308


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Input REAL Input signal
VAR_INPUT
Tau REAL Filter time constant
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Filter output
VAR LOWPASS_INST_0 LOWPASS Instance of access to block structure

Operation

When this block has a TRUE value in EN, filters the input value of Input using a low pass first order
filter described by Tau and Ts#, inserting the result in Output. On the leading edge of EN, Output
receives zero.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 309


Equipments (Devices)

Example

The above example causes OUTPUT, by identifying a leading edge in EN, to display a behavior of first
order with time constant equal to Tau and the sampling time of 2 ms, in order to achieve the reference
set to INPUT. At each calculation completed successfully, the ENO output is activated.

WPS v2.5X | 310


Equipments (Devices)

11.1.6.10 Logic
11.1.6.10.1 Logic Bit
11.1.6.10.1.1 RESETBIT
Logical block used to perform reset of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, resets the bit indicated in Position in the Data variable
that is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the reset of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 311


Equipments (Devices)

Example

The example above resets the bit of AUX zero position, whose initial value is 200 (1100 1000, in
binary). Since this bit already had FALSE value, nothing has changed.

The example above resets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above resets the bit in position nine of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 312


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.1.6.10.1.2 SETBIT
Logical block used to perform the set of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, sets the bit indicated in Position in the Data variable that
is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the set of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 313


Equipments (Devices)

Example

The example above sets the bit of AUX zero position, whose initial value is 153 (1001 1001, in binary).
Since this bit already had TRUE value, nothing has changed.

The example above sets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above sets the bit in position fifteen of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 314


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.1.6.10.1.3 TESTBIT
Logical block that revolutions the value of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
Data WORD UINT INT Variable w hose bit w ill be tested
DWORD UDINT DINT
VAR_INPUT
EN BOOL Block enabling
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT Q BOOL Value of the tested bit

Operation

This block when it has a TRUE value in EN, sends to the output Q the bit value indicated in Position
in the Data variable.

When EN has FALSE value, Q also receives FALSE.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 315


Equipments (Devices)

Example

The example above sets the bit value of zero position of AUX, whose initial value is 74 (0100 1010 in
binary) to the output Q. Since this bit has value 0, the output is disabled.

The example above sets the value of the bit of position three of AUX to the output Q. Since this bit
has value 1, the output is enabled.

The example above sets the bit value of position ten of AUX to output Q. Since AUX is a variable of
BYTE type, it has only eight bits. Thus, the example above creates a runtime error in the block and
therefore the output is disabled.

WPS v2.5X | 316


Equipments (Devices)

11.1.6.10.2 Logic Boolean


11.1.6.10.2.1 AND
Logical block that performs an boolean "and" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “and” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 317


Equipments (Devices)

Example

The example above performs an "and" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.1.6.10.2.2 NOT
Block that performs a logical operation of boolean "not" in a variable, storing the result in another.

Ladder Representation

Block Structure

WPS v2.5X | 318


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling

VAR_INPUT BYTE USINT SINT


Value WORD UINT INT Reference variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the denied Boolean value of
the Value input variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The example above performs a boolean "not" operation in AUX, storing the result in AUX2.

WPS v2.5X | 319


Equipments (Devices)

11.1.6.10.2.3 OR
Logical block that performs an Boolean "or" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “or” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 320


Equipments (Devices)

Example

The example above performs an "or" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.1.6.10.2.4 XNOR
Logical block that performs an Boolean "not exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

WPS v2.5X | 321


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “denied exclusive or”
Boolean operation of input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 322


Equipments (Devices)

The example above performs a "denied exclusive or" Boolean operation between AUX and AUX2,
storing the result in AUX3.

11.1.6.10.2.5 XOR
Logical block that performs an Boolean "exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “xor” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 323


Equipments (Devices)

Example

The example above performs a "xor" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.1.6.10.3 Logic Rotate


11.1.6.10.3.1 ROL
Block that performs a logical left rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 324


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical left shifts, according to the Shift value. The most significant bits
that are being discarded are returned to the least significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 325


Equipments (Devices)

Example

The above example performs a logical left shift by one position in the VALUE variable whose initial
value is -100 (1001 1100 in binary). The discarded bits on the left are reinserted on the right. The final
result (0011 1001 in binary) is stored in RESULT.

The above example performs a logical left rotation by five positions in the VALUE variable whose initial
value is 21 (0001 0101 in binary). The discarded bits on the left are reinserted on the right. The final
result (1010 0010 in binary) is stored in RESULT.

11.1.6.10.3.2 ROR
Block that performs a logical right rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 326


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical right shifts, according to the Shift value. The least significant bits
that are being discarded are returned to the most significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 327


Equipments (Devices)

Example

The above example performs a logic right shift by one position in the VALUE variable whose initial
value is -128 (1000 0000 in binary). The discarded bits on the right are reinserted on the left. The final
result (0100 0000 in binary) is stored in RESULT. Notice that the sign is not preserved in this
operation.

The above example performs a logical right rotation by one position in the VALUE variable whose
initial value is -127 (1000 0001 in binary). The discarded bits on the right are reinserted on the left. The
final result (1100 0000 in binary) is stored in RESULT.

11.1.6.10.4 Logic Shift


11.1.6.10.4.1 ASHL
Block that performs a binary left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 328


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic left shifts, according to the Shift value.

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 329


Equipments (Devices)

Description of exemple.

Description of exemple.

11.1.6.10.4.2 ASHR
Block that performs arithmetic left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic right shifts, according to the Shift value.

WPS v2.5X | 330


Equipments (Devices)

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example performs an arithmetic right shift by three positions in the VALUE variable whose
initial value is 52 (0011 0100 in binary). The bits on the right are being discarded, and on the left new
zeros are inserted. The final result (0000 0110 in binary) is stored in RESULT.

WPS v2.5X | 331


Equipments (Devices)

The above example performs an arithmetic right shift by two positions in the VALUE variable whose
initial value is -79 (1011 0001 in binary). The bits on the right will be discarded and new ones on the
left are inserted, since the arithmetic right shifts preserve the sign of the variable. The final result
(1111 0110 in binary) is stored in RESULT.

The above example performs an arithmetic right shift by thirteen positions in the VALUE variable
whose initial value is -128 (1000 0000 in binary). The bits on the right are being discarded, and on the
left new ones are inserted. The final result (1111 1111 in binary) is stored in RESULT.

11.1.6.10.4.3 SHL
Block that performs a binary logical left shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 332


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts left, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 333


Equipments (Devices)

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is 56 (0011 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (0011 1000 0000 in binary) is stored in RESULT.

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is -56 (1100 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (1100 1000 0000 in binary) is stored in RESULT. Since RESULT is SINT
type, it only accepts the first eight bits (1000 0000).

11.1.6.10.4.4 SHR
Block that performs a binary logical right shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 334


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts right, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 335


Equipments (Devices)

The above example performs a logical right shift by two positions in the VALUE variable whose initial
value is 124 (0111 1100 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 1111 in binary) is stored in RESULT.

The above example performs a logical right shift by three positions in the VALUE variable whose initial
value is -98 (1001 1110 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 0011 in binary) is stored in RESULT.

11.1.6.11 Math
11.1.6.11.1 Math Basic
11.1.6.11.1.1 ABS
Block that calculates the Value module, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the absolute value of the

WPS v2.5X | 336


Equipments (Devices)

Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the absolute value of the VALUE variable whose initial value is -45,
storing the final result, 45, in RESULT.

The above example calculates the absolute value of the VALUE variable whose initial value is -45. The
final result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by
SINT type. Therefore, RESULT remains unchanged and the output is disabled.

WPS v2.5X | 337


Equipments (Devices)

11.1.6.11.1.2 ADD
Block that calculates the sum of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First addend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second addend of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sum of Value1 and Value2
variables. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 338


Equipments (Devices)

Example

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT.

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 339


Equipments (Devices)

The above example calculates the sum of VALUE1 and VALUE2 variables. The final result -170
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.1.6.11.1.3 DIV
Block that calculates the division of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the division of Value1 and
Value2 variables. The value stored will be the exact division if Result is REAL, or, in other cases, only
the quotient. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 340


Equipments (Devices)

Example

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is of REAL type, the exact value of the division is stored in it.

WPS v2.5X | 341


Equipments (Devices)

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it. Notice that the block
accepts arguments of both signs.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains unchanged
and the output is disabled.

11.1.6.11.1.4 MOD
Block that calculates the remainder of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT operation

Operation

WPS v2.5X | 342


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the remainder of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

WPS v2.5X | 343


Equipments (Devices)

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains
unchanged and the output is disabled.

11.1.6.11.1.5 MUL
Block that calculates the multiplication of the values of Value1 and Value2, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First factor of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second factor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

WPS v2.5X | 344


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the multiplication of Value1
and Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT.

WPS v2.5X | 345


Equipments (Devices)

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the product of VALUE1 and VALUE2 variables. The final result 224
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.1.6.11.1.6 NEG
Block that calculates the opposite (i.e., the product with -1) of a value passed by Value, storing the
result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the opposite of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 346


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the opposite of the VALUE variable whose initial value is 21, storing
the final result, -21, in RESULT.

The above example calculates the opposite of the VALUE variable whose initial value is -56, storing
the final result, 56, in RESULT.

WPS v2.5X | 347


Equipments (Devices)

The above example calculates the opposite of the VALUE variable whose initial value is -128. The final
result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by SINT
type. Therefore, RESULT remains unchanged and the output is disabled.

11.1.6.11.1.7 SUB
Block that calculates the subtraction between the Value1 and Value2 values, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Minuend of operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Subtrahend of operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the subtraction of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 348


Equipments (Devices)

Example

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 349


Equipments (Devices)

The above example calculates the subtraction of VALUE1 and VALUE2 variables. The final result 141
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.1.6.11.2 Math Extended


11.1.6.11.2.1 ALOG10
Block that calculates the antilogarithm (exponent with base 10) of the Value value, storing the result
in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the antilogarithm of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 350


Equipments (Devices)

Example

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the minimum input value for which the block revolutions a nonzero
result. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in

WPS v2.5X | 351


Equipments (Devices)

RESULT. Below the minimum values cause the block to return a null value. The block ends with
success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the maximum input value for which the block revolutions a valid result.
The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. Values higher than the maximum cause the block to generate an error, the RESULT output
remains unchanged and Done output is disabled.

11.1.6.11.2.2 EXP
Block that calculates the exponential of the Euler number "and" raised to the value of Value, storing
the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the exponent of the Euler
number "and" raised to the Value variable. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 352


Equipments (Devices)

Block Flowchart

Example

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the minimum input value for which the block revolutions a nonzero result. The
block ends with success and Done output is activated.

WPS v2.5X | 353


Equipments (Devices)

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values below the minimum cause the block to return to a null value. The block ends with success
and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the maximum input value for which the block revolutions a valid result. The
block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values higher than the maximum cause the block to generate an error, the RESULT output remains
unchanged and Done output is disabled.

11.1.6.11.2.3 LN
Block that calculates the natural logarithm of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the natural logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 354


Equipments (Devices)

Block Flowchart

Example

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has value zero, and Done output is
disabled.

WPS v2.5X | 355


Equipments (Devices)

11.1.6.11.2.4 LOG10
Block that calculates the common logarithm (base 10) of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the common logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 356


Equipments (Devices)

Example

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.1.6.11.2.5 POW
Block that calculates the value of Value raised to the exponent Power, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value REAL Base of the operation
Power REAL Exponent of the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to
the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 357


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

WPS v2.5X | 358


Equipments (Devices)

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. Since the result is higher than the maximum supported by REAL type, the block
generates an error and Done output is disabled.

11.1.6.11.2.6 ROUND
Block that rounds the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the rounded value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 359


Equipments (Devices)

Example

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals less than 0.5 are discarded. The block ends with success and Done output is activated.

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals greater than or equal to 0.5 promote unity value immediately above. The block ends with
success and Done output is activated.

11.1.6.11.2.7 SQRT
Block that calculates the square root value of Value, storing the result in Result.

Ladder Representation

WPS v2.5X | 360


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the square root value of
Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 361


Equipments (Devices)

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.1.6.11.2.8 TRUNC
Block that truncates the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the truncated value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

WPS v2.5X | 362


Equipments (Devices)

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

Example

The above example truncates the value of the VALUE variable, storing the final result in RESULT.
Decimals are discarded. The block ends with success and Done output is activated.

11.1.6.11.3 Math Trigonometry


11.1.6.11.3.1 ACOS
Block that calculates the arccosine of Value, storing the result in Angle.

Ladder Representation

Block Structure

WPS v2.5X | 363


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of cosine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose cosine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arccosine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 364


Equipments (Devices)

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block generates a runtime error, since VALUE has value inferior to 1, and
Done output is disabled.

11.1.6.11.3.2 ASIN
Block that calculates the arcsine of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of sine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose sine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arcsine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 365


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block generates a runtime error, since VALUE has value superior to 1, and
Done output is disabled.

WPS v2.5X | 366


Equipments (Devices)

11.1.6.11.3.3 ATAN
Block that calculates the arctangent of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of tangent
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 367


Equipments (Devices)

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for positive values, is always in the first quadrant. The block ends with
success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for negative values, is always in the fourth quadrant. The block ends
with success and Done output is activated.

11.1.6.11.3.4 ATAN2
Block that calculates the arctangent of Y/X, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT X REAL Parameter X of the function
Y REAL Parameter Y of the function
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to (Y/X) (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Y/X. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 368


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and Y, is always in the first quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final

WPS v2.5X | 369


Equipments (Devices)

result in RESULT. The arc, for negative values of X and positive values of Y, is always in the second
quadrant. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for negative values of X and Y, is always in the third quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and negative values of Y, is always in the fourth
quadrant. The block ends with success and Done output is activated.

11.1.6.11.3.5 COS
Block that calculates the cosine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the cosine of Angle. If no

WPS v2.5X | 370


Equipments (Devices)

errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 371


Equipments (Devices)

11.1.6.11.3.6 SIN
Block that calculates the sine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sine of Angle. If no errors,
the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE
status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 372


Equipments (Devices)

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts negative input values.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts values greater than one full turn.

11.1.6.11.3.7 TAN
Block that calculates the tangent of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

WPS v2.5X | 373


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the tangent of Angle. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 374


Equipments (Devices)

11.1.6.11.4 Math Util


11.1.6.11.4.1 MAX
Block that compares the values of Value1 and Value2 and stores the highest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Highest of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the highest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 375


Equipments (Devices)

Example

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 376


Equipments (Devices)

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is higher than the maximum supported by SINT type, the
block generates an error and Done output is disabled.

11.1.6.11.4.2 MIN
Block that compares the values of Value1 and Value2 and stores the lowest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Low est of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the lowest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 377


Equipments (Devices)

Example

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 378


Equipments (Devices)

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is lower than the minimum supported by SINT type, the
block generates an error and Done output is disabled.

11.1.6.11.4.3 SAT
Block that performs a routine for saturation of the value found in Value in accordance with the limits
for Minimum and Maximum, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Reference value
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
Minimum Inferior saturation value
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Maximum Superior saturation value
INT DWORD UDINT DINT REAL
Indicator that there w as saturation in the
Q BOOL
process
VAR_OUTPUT
BYTE USINT SINT WORD UINT
Result Result of operation
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and
Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of
Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q
receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If
there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with
its value unchanged.

WPS v2.5X | 379


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 380


Equipments (Devices)

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or
higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no
saturation.

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

WPS v2.5X | 381


Equipments (Devices)

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM.
The block ends successfully and the Q output is activated, since there was saturation.

11.1.6.12 Module
11.1.6.12.1 USERFB
Block that performs a subroutine programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT According to user
INPUT Block inputs
programming
ENO BOOL End of operation
VAR_OUTPUT According to user
OUTPUT Block outputs
programming
According to user
VAR_IN_OUT IN_OUT Block inputs/outputs
programming
VAR MYUSERFB_INST_0 MYUSERFB Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine programmed by the user and updates the values of the outputs
after completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 382


Equipments (Devices)

NOTE!
Refer to section Working with USERFBs for further information.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

11.1.6.13 Motion Control


11.1.6.13.1 MW_RefVelocity

This block sends speed reference to drive.

Ladder Representation

WPS v2.5X | 383


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT EN BOOL Block enabling
DINT INT
Velocity Sets speed reference to drive if block is enabled
REAL
Sets the speed unit:
0 = 13Bits
13 Bits – Sends the speed value in 13 bits;
VelocityUnit 1 = RPM
RPM – Sends the speed value in RPM;
2 = HZ(x10)
HZ – Sends the speed value in Hz (x10).
Define if block w ill run the Run/Stop (CFW_CMD_RUN_STOP)
w hen it is enabled:
FALSE – Do not send Run/Stop command w ith block enabling
0 = FALSE
RunAutomatic (it is necessary to use the marker CFW_CMD_RUN_STOP in
1 = TRUE
ladder's logic to send the Run/Stop command);
TRUE – Send Run command w ith block enabling and Stop
command w ith block disabling.
End of operation. Conditions for ENO = 1
Does not exist another active block
MW_RefVelocity;
VAR_OUTPUT ENO BOOL
Drive is enabled and stop mode set
“Stopping by inertia”.

Operation

When this block has a “0” value in EN, it does not execute and ENO output is zero.

RunAutomatic = TRUE

When this block has a “1” value in EN input, the drive is general enabled, no other motion block is
active, the Run/Stop command goes to "1", the speed reference value is send to drive and the ENO
output is set to “1”.
If EN input has a "0" value, and this block is active, the Run/Stop command is set to "0" and ENO
output goes to "0".

RunAutomatic = FALSE

When this block has a “1” value in EN input, the drive is general enabled, the Run/Stop command is
set to "1", no other motion block is active, the speed reference value is send to drive and the ENO
output is set to “1”.
If EN input has a "0" value and this block is active, ENO output is set to "0".

WPS v2.5X | 384


Equipments (Devices)

NOTE!
Check the source of speed reference and command Run/Stop for correct operation of this
block

Block Flowchart

Example

WPS v2.5X | 385


Equipments (Devices)

The above example shows the MW_RefVelocity block, set to Hz and the RunAutomatic command in
TRUE, if drive is general enabled and the block is enabled, the speed reference is changed.

The above example shows the MW_RefVelocity block, set to Hz and RunAutomatic command in
FALSE, if drive is general enabled, it is necessary the Run command. So, when the block be enabled,
the speed reference would be changed.

11.1.6.14 Timer
11.1.6.14.1 TON
Timer block that, when energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 386


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output drive
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TON_INST_0 TON Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is FALSE, the Q output is FALSE and ET also receives the value zero.
On the edge positive transition in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state TRUE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 387


Equipments (Devices)

Operation Diagram

WPS v2.5X | 388


Equipments (Devices)

Example

The above example shows the initial conditions of the block and of the routine variables.

When activated the IN input, counting is triggered. Since ET equals PT, the Q output is enabled.

Note that a change in PRESET variable is not forwarded to the PT field while the IN entry remains
enabled.

WPS v2.5X | 389


Equipments (Devices)

Disabling the IN input, the value of PT is updated and the Q output is disabled. When activating it
again, counting is triggered.

Disabling the IN input, the value of ET remains saved.

Enabling the IN input, the value of ET is reset and counting is triggered.

When ET reaches the value PT, the Q is output enabled and remains so while IN is at TRUE level.

11.1.6.14.2 TOF
Timer block that, when energized, disables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 390


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output deactivating
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TOF_INST_0 TOF Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is TRUE, the Q output is also TRUE and ET also receives the value zero.
On the negative transition edge in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state FALSE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 391


Equipments (Devices)

Operation Diagram

WPS v2.5X | 392


Equipments (Devices)

Example

The above example disables the DO1 output to identify a low level in DI1 for 12 seconds, remaining
disabled until DI1 again be TRUE.

11.1.6.14.3 TP
Timer block that, when identifies it is energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 393


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Time w hile the output is enabled
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TP_INST_0 TP Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

On the edge positive transition in IN, Q receives TRUE value, counting is triggered and ET is
incremented according to TIMEBASE. When ET equals PT, the Q output goes to state FALSE until
IN revolutions to FALSE. At that moment, if IN is at TRUE level, nothing happens. On the edge
positive transition in IN, ET is automatically reset.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 394


Equipments (Devices)

Operation Diagram

WPS v2.5X | 395


Equipments (Devices)

Example

The above example enables the DO1 output for six seconds at each DI1 positive transition.

11.1.6.15 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

WPS v2.5X | 396


Equipments (Devices)

Figure 1: Creating a structure

2. Define the file name and press the Next button.

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

WPS v2.5X | 397


Equipments (Devices)

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

Figure 4: Structure created in the project

WPS v2.5X | 398


Equipments (Devices)

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.1.7 Communication
11.1.7.1 Force I/O
Overview

The force inputs and outputs window is used for the values of the digital and analog inputs to be read by the
program, by values manipulated by the user, regardless their physical state. It also allows the manipulation of
the physical states of the digital and analog outputs by the user independently of the values calculated by the
program.
In order to force the device inputs and outputs, it is necessary that the online monitoring be active and the
option Run cyclically be enabled. The data are sent to the device every 2 seconds.
The values can be edited with the device disconnected. The configurations are stored in the resources and
recorded whenever the main resource selection is changed.
The data displayed on the force I/O window contain the values belonging to the resource (and configuration)
selected as main.

The force I/O window is open trough the menu Online > Force I/O:

Toolbar

The toolbar of the force window has the options to run cyclically, upload the device force configuration, enable

WPS v2.5X | 399


Equipments (Devices)

all and disable all:


Run cyclically: Sends the user's configurations to the device and updates the state of the inputs and
outputs in a cyclic way.
Upload configuration: Allows the current configuration of the device to be read. For this option to be
enabled, it is necessary that the online monitoring be active and the option run cyclically be disabled.
Enable all: Enables the force I/O of all of the inputs and outputs of the device.
Disable all: Disables the force I/O of all of the inputs and outputs of the device.

Input and Output commands

For each digital and analog input and output there is a selection box linked to enable the force, a status field
and an edition field.

Digital:

1. Number of the digital inputs/output


2. Enable/disable Force I/O
3. Current status of the I/O: It has three statuses: 1. light green LED: activated; 2. dark green LED:
deactivated; 3. gray LED: the value is not being read.
4. Enable/disable the input/output

Analog:

1. Number of the analog input/output


2. Enable/disable Force I/O
3. Current value of the input/output
4. Value of the input/output configured by the user

NOTE!
The analog signal scale has 15 bits plus 1 bit for signal, except for SSW900 which it has only 10
unsigned bits.

11.2 CFW300
11.2.1 Description
The CFW300 frequency inverter is a high-performance product which allows speed control of three-phase
induction motors. This product provides the user with the options of vector (VVW) or scalar (V/f) control, both

WPS v2.5X | 400


Equipments (Devices)

programmable according to the application.

The scalar mode (V/f) is recommended for simpler applications, such as the activation of most pumps and
fans. In such cases it is possible to reduce the losses in the motor and the inverter using the "V/f Quadratic",
which results in energy savings. The V/f mode is used when more than a motor is activated by an inverter
simultaneously (multimotor applications). In the vector mode (VVW), the operation is optimized for the motor
in use, obtaining a better performance in terms of speed regulation.

The frequency inverter CFW300 also has functions of PLC (Programmable Logic Controller) by means of the
SoftPLC (integrated) feature. It has two slots for simultaneous connection of the accessories: Slot 1 -
Communication accessory or external HMI and Slot 2 - Input and output (I/O) expansion accessory.

Refer to the user's manual of the CFW300 for further details about the product.

11.2.2 System Markers


The following variables contained in the GLOBAL_SYSTEM group of the variables table, have the fixed tag.
The tag of system markers were divided into groups and subgroups, where:

Groups:
CFW: reading and writing variables of the CFW300 frequency inverter.

Subgroups:
STS: reading variable (status);
CMD: writing variable (command).

Reading System Markers (Status)

Reading - Function Modbus 02 "Read Discrete Inputs"

Address Bit Modbus Tag Description

Ladder

%SB6000 0 0 SYS_FREQ_2HZ Oscillator w ith frequency of 2 Hz

%SB6000 1 1 SYS_PULSE_1SCAN Pulse during the first scan cycle

%SB6000 2 2 SYS_FALSE Alw ays in 0

%SB6000 3 3 SYS_TRUE Alw ays in 1

Logical Status

The run motor command is active in the


%SB6002 1 17 CFW_STS_RUN_COMMAND
inverter
%SB6002 2 18 CFW_STS_FIRE_MODE_ACTIVE Fire Mode Function is active

The inverter is configured to use the first


%SB6002 5 21 CFW_STS_SEC_RAMP_ACTIVE or second ramp values (0-First, 1-
Second)
%SB6002 6 22 CFW_STS_CONFIG_MODE The inverter is in the configuration mode

%SB6002 7 23 CFW_STS_ALARM_ACTIVE The inverter is in alarm condition

%SB6003 0 24 CFW_STS_MOTOR_RUNNING The inverter is running the motor at the

WPS v2.5X | 401


Equipments (Devices)

speed reference, or executing either the


acceleration or the deceleration ramp
General Enable is active and the inverter
%SB6003 1 25 CFW_STS_GENERAL_ENABLED
is ready to run the motor
The motor is running in the reverse or
%SB6003 2 26 CFW_STS_FWD_REV_DIRECTION forw ard direction (0-Reverse, 1-
Forw ard)
%SB6003 3 27 CFW_STS_JOG_ACTIVE The JOG function is active

The inverter is in local or remote mode (0-


%SB6003 4 28 CFW_STS_LOC_REM_MODE
Local, 1-Remote)

%SB6003 5 29 CFW_STS_UNDERVOLTAGE The inverter is in undervoltage

%SB6003 7 31 CFW_STS_FAULT_ACTIVE The inverter has detected a fault

It indicates that the signal of analog input


%SB6004 0 32 CFW_STS_AI1_BROKEN_CABLE AI1 in 4 to 20 mA or 20 to 4 mA is below
2 mA
It indicates that the signal of analog input
%SB6004 1 33 CFW_STS_AI2_BROKEN_CABLE AI2 in 4 to 20 mA or 20 to 4 mA is below
2 mA
HMI keys

%SB6006 0 48 CFW_STS_KEY_START_STOP START/STOP key (I)/(0) pressed

%SB6006 2 50 CFW_STS_KEY_UP UP key pressed

%SB6006 3 51 CFW_STS_KEY_DOWN DOWN key pressed

Infrared Remote Control (IRC 1)

%SB6010 0 80 CFW_STS_IRC_1_KEY_ON Start/Stop Motor key pressed

%SB6010 1 81 CFW_STS_IRC_1_KEY_DOWN Brow se Dow nw ards key pressed

%SB6010 2 82 CFW_STS_IRC_1_KEY_UP Brow se Upw ards key pressed

Commute view key pressed. This key


allow s commute view betw een tw o
%SB6010 3 83 CFW_STS_IRC_1_KEY_CHANGE
parameters (values) defined by
parameters P842 and P843

%SB6010 4 84 CFW_STS_IRC_1_KEY_P Confirm/Program key pressed

%SB6010 5 85 CFW_STS_IRC_1_KEY_SFK1 Special Function key 1 pressed

%SB6010 6 86 CFW_STS_IRC_1_KEY_SFK2 Special Function key 2 pressed

%SB6010 7 87 CFW_STS_IRC_1_KEY_SFK3 Special Function key 3 pressed

Infrared Remote Control (IRC 2)

%SB6012 0 96 CFW_STS_IRC_2_DRY Dry key pressed

%SB6012 1 97 CFW_STS_IRC_2_CLEAN Clean key pressed

%SB6012 2 98 CFW_STS_IRC_2_TIMER Timer key pressed

%SB6012 3 99 CFW_STS_IRC_2_FUNC Func function active

%SB6012 4 100 CFW_STS_IRC_2_SWING Sw ing function active

WPS v2.5X | 402


Equipments (Devices)

%SB6012 5 101 CFW_STS_IRC_2_COOL Cool key pressed

%SB6012 6 102 CFW_STS_IRC_2_MODE Mode key pressed

%SB6012 7 103 CFW_STS_IRC_2_POWER Pow er key pressed

%SB6013 0 104 CFW_STS_IRC_2_TEMP_UNIT Temp unit key pressed

%SB6013 1 105 CFW_STS_IRC_2_UVC UVC function active

Reading - Function Modbus 04 "Read Input Registers"

Speed

%
-- 3100 CFW_STS_MOTOR_SPEED_13BITS Motor speed in 13 bits (8192)
SW6200
%
-- 3101 CFW_STS_MOTOR_SYNC_SPEED Motor synchronous speed in rpm
SW6202
%
-- 3102 CFW_STS_MOTOR_SPEED_RPM Motor speed in rpm
SW6204
%
-- 3103 CFW_STS_SPEED_REFERENCE Speed reference after ramp in rpm
SW6206

Alarm and Fault

%
-- 3104 CFW_STS_PRES_ALARM Alarm number that may be present in the inverter
SW6208
%
-- 3105 CFW_STS_PRES_FAULT Fault number that may be present in the inverter
SW6210

Current and Torque

%
-- 3106 CFW_STS_RATED_CURRENT Inverter rated current (HD) in A (x10)
SW6212
%
-- 3107 CFW_STS_MOTOR_CURRENT Motor current w ithout filter in A (x10)
SW6214
%
-- 3108 CFW_STS_MOTOR_TORQUE Motor torque w ithout filter in % (x10)
SW6216

Infrared Remote Control

%
-- 3109 CFW_STS_IRC_2_INFO IRC_2 info
SW6218

Writing / Reading System Markers (Command)

Reading - Function Modbus 01 "Read Coils"


Writing - Function Modbus 05 "Write Single Coil" and 15 "Write Multiple Coils"

WPS v2.5X | 403


Equipments (Devices)

Address Bit Modbus Tag Description

Logical Command

Run the motor according to the speed reference value (0-


%CB6008 0 16 CFW_CMD_RUN_STOP
Stop, 1-Run)
Enables the inverter allow ing the motor operation (0-Disable,
%CB6008 1 17 CFW_CMD_GENERAL_ENABLE
1-Enable)
The motor runs in the direction indicated by the speed
%CB6008 2 18 CFW_CMD_SPEED_DIRECTION
reference (0-Reverse, 1-Forw ard)

%CB6008 3 19 CFW_CMD_JOG Enables the JOG function (0-Disable, 1-Enable)

%CB6008 4 20 CFW_CMD_LOC_REM Selects the inverter operation mode (0-Local, 1-Remote)

Selects the ramp to accelerate and decelerate the motor (0-


%CB6008 5 21 CFW_CMD_SECOND_RAMP
First, 1-Second)
It allow s that the SoftPLC command CFW_CMD_RUN_STOP
CFW_CMD_FORCE_RUN_STOP_SPL
%CB6008 6 22 change the inverter command Run/Stop regardless of source
C
programmed for Start/Stop via P224 or P227

%CB6008 7 23 CFW_CMD_FAULT_RESET Executes the fault reset command

11.2.3 I/O's
Hardware information can be found in the Manual of the CFW300 at the website www.weg.net.

Digital Inputs

Endereço Bit Modbus Tag Descrição


%IB0 0 16000 DI1 Digital input 1
%IB0 1 16001 DI2 Digital input 2
%IB0 2 16002 DI3 Digital input 3
%IB0 3 16003 DI4 Digital input 4
%IB0 4 16004 DI5 Digital input 5 - I/O expansion module
%IB0 5 16005 DI6 Digital input 6 - I/O expansion module
%IB0 6 16006 DI7 Digital input 7 - I/O expansion module
%IB0 7 16007 DI8 Digital input 8 - I/O expansion module

Analog Inputs

Endereço Bit Modbus Tag Descrição


%IW2 -- 5001 AI1 Analog input 1
%IW4 -- 5002 AI2 Analog input 2 - I/O expansion module

Added from firmware version V2.00

WPS v2.5X | 404


Equipments (Devices)

Endereço Bit Modbus Tag Descrição


%IW6 -- 5003 AIP Analog input (Potentiometer) - I/O expansion module
%IW8 -- 5004 FI1 Frequency input 1
%IW10 -- 5005 FI2 Frequency input 2 - I/O expansion module
%IW12 -- 5006 FI3 Frequency input 3 - I/O expansion module
%IW14 -- 5007 FI4 Frequency input 4 - I/O expansion module

Digital Outputs

Endereço Bit Modbus Tag Descrição


%QB0 0 16000 DO1 Digital output 1
%QB0 1 16001 DO2 Digital output 2 - I/O expansion module
%QB0 2 16002 DO3 Digital output 3 - I/O expansion module
%QB0 3 16003 DO4 Digital output 4 - I/O expansion module

Analog Outputs

Endereço Bit Modbus Tag Descrição


%QW2 -- 5001 AO1 Analog output 1
%QW4 -- 5002 AO2 Analog output 1 - I/O expansion module

Added from firmware version V2.00


Endereço Bit Modbus Tag Descrição
%QW6 -- 5003 FO1 Frequency output 1 - I/O expansion module
%QW8 -- 5004 FO2 Frequency output 2 - I/O expansion module
%QW10 -- 5005 FO3 Frequency output 3 - I/O expansion module

NOTE!
The addresses of the digital and analog outputs were changed from firmware version 1.20. To
convert the variables it is necessary to change the addresses:
%QB6 => %QB0
%QW8 => %QW2
%QW10 => %QW4

11.2.4 Import from WLP


The function import from WLP is utilized to import Ladder developed on WLP software to equipment (device).

The import from WLP can be executed during the resource creation.

WPS v2.5X | 405


Equipments (Devices)

1. To execute the import WLP function click the Import from WLP button and select the WLP project folder or
the WLP BKP file.

WPS v2.5X | 406


Equipments (Devices)

WPS v2.5X | 407


Equipments (Devices)

2. After import from WLP completed successfully click the Finish button to copy the imported files to new
resource.

11.2.5 Parameters
11.2.5.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 408


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 409


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.2.5.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 410


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 411


Equipments (Devices)

11.2.5.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 412


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 413


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 414


Equipments (Devices)

11.2.5.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 415


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 416


Equipments (Devices)

WPS v2.5X | 417


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 418


Equipments (Devices)

WPS v2.5X | 419


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 420


Equipments (Devices)

WPS v2.5X | 421


Equipments (Devices)

WPS v2.5X | 422


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 423


Equipments (Devices)

WPS v2.5X | 424


Equipments (Devices)

11.2.5.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 425


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 426


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.2.6 Ladder
11.2.6.1 Coil
11.2.6.1.1 DIRECTCOIL
Logical block used to assign direct values of the output variables.

WPS v2.5X | 427


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example keeps the digital output DO9 permanently connected, because the value of A in
this case is the value of the left bus which is always considered high logic level (TRUE).

11.2.6.1.2 INVERTEDCOIL
Logical block used for assigning values denied to output variables.

Ladder Representation

WPS v2.5X | 428


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the denied value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example disables the digital output DO3 when some of the digital inputs DI1 and DI2 are
with FALSE value. When both inputs are with a TRUE value, DO3 activates.

WPS v2.5X | 429


Equipments (Devices)

11.2.6.1.3 RESETCOIL
Logical block used for indefinite disabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers a FALSE value to the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

Example

WPS v2.5X | 430


Equipments (Devices)

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI5.

11.2.6.1.4 SETCOIL
Logical block used for indefinite enabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers the value of A for the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

WPS v2.5X | 431


Equipments (Devices)

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI6.

11.2.6.1.5 TOGGLECOIL
Logical block used for output variables alternance.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output
VAR TOGGLECOIL_INST_0 TOGGLECOIL Instance of access to block structure

Operation

When identifying a transition from FALSE to TRUE (leading edge) on A, the block reverses the status
of O1.

Diagram

WPS v2.5X | 432


Equipments (Devices)

Block Flowchart

Example

The above example inverts the state of the digital output DO6 to each disabling the internal buzzer.

11.2.6.2 Communication Network


11.2.6.2.1 Modbus RTU
11.2.6.2.1.1 Modbus RTU Overview
Operation in the Modbus RTU Network - Master Mode

The CFW300 allows operation as a master for the Modbus RTU network. For this operation, it is necessary to
observe the following points:

Only interface RS485 allows operation as a network master.


It is necessary to program, in product configurations, the operation mode as "Master", besides the
communication rate, parity, and stop bits, which must be the same for the whole equipment in the network.
The Modbus RTU network master does not have an address, so the address configured in the CFW300 is
not used.
Sending and receiving telegrams via RS485 interface using the Modbus RTU is programmed by using blocks
in Ladder programming language. It is necessary to know the available blocks and the Ladder programming
software in order to be able to program the network master.

WPS v2.5X | 433


Equipments (Devices)

The following functions are available for the sending of requisitions by the Modbus master:
o Function 01: Read Coils
o Function 02: Read Discrete Inputs
o Function 03: Read Holding Registers
o Function 04: Read Input Registers
o Function 05: Write Single Coil
o Function 06: Write Single Register
o Function 15: Write Multiple Coils
o Function 16: Write Multiple Registers

Blocks to program the master

In order to control and monitor the Modbus RTU communication using the CFW300, the following blocks were
developed, and they must be used when programming in Ladder.

11.2.6.2.1.2 MB_MasterControlStatus
Block that allows monitoring various statuses of the Modbus RTU network master.

Ladder Representation

Block Structure

WPS v2.5X | 434


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
DisableComm BOOL Disables Modbus RTU communication
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
TxCounter WORD UINT Counter of requests sent
RxCounter WORD UINT Counter of telegrams received
NoAnswerCounter WORD UINT Counter of requests not answ ered
Counter of responses received w ith error
ErrorResponseCounter WORD UINT
information
VAR_OUTPUT
Slave address in w hich the last communication
LastErrorSlaveAddress BYTE USINT
error w as detected
Operation result of the last communication error
received
LastErrorResult BYTE USINT (0 = No error)
(4 – Response Timeout)
(5 = Slave returned error)
LastErrorCode BYTE USINT Code of the last communication error received

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the Modbus RTU communication and resets the status counters
and markers of the master. These markers and counters are displayed in the output block each
having some data corresponding to its description. Their values are also cleared at shutdown of the
master.

Block Flowchart

WPS v2.5X | 435


Equipments (Devices)

Example

The example above requests status data of the Modbus RTU network master, and allows disabling
communication through DISABLE. The block ends successfully, Done output is activated.

11.2.6.2.1.3 MB_ReadBinary
Block that performs a reading of up to 128 binary data (via Read Coils or Read Discrete Inputs) of a
slave on the Modbus RTU network.

Ladder Representation

WPS v2.5X | 436


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial bit address of the data to be read
VAR_INPUT
NumberOfData BYTE Number of bits to be read (1 to 128)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
VAR_OUTPUT another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
Value BOOL Variable that stores the received data
VAR MB_READBINARY_INST_0 MB_READBINARY Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus slave RTU in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

WPS v2.5X | 437


Equipments (Devices)

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 438


Equipments (Devices)

WPS v2.5X | 439


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT Modbus RTU slave of SLAVE address through the Read Discrete Input function.
These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.2.6.2.1.4 MB_ReadRegister
Block that performs a reading of up to 64 16-bit registers (via Read Holding Registers or Read Input
Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 440


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial register address to be read
VAR_INPUT
NumberOfData BYTE Number of registers to be read (1 to 64)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
another request

VAR_OUTPUT Error BOOL Error in the execution flag


ErrorID BYTE Identifier of the occurred error
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the received data
DWORD UDINT
DINT REAL
MB_READREGISTER
VAR MB_READREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of registers indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting them when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 441


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 442


Equipments (Devices)

WPS v2.5X | 443


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT in the Modbus RTU slave of SLAVE address through the Read Input Register
function. These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.2.6.2.1.5 MB_SlaveStatus
Block that allows monitoring the status of 4 slaves of the Modbus RTU network.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
Amount of errors that the master must identify until it
ErrorsToSetOffline# BYTE
considers communication w ith an offline slave

VAR_INPUT AddressSlave1# BYTE Slave address 1 to be monitored


AddressSlave2# BYTE Slave address 2 to be monitored
AddressSlave3# BYTE Slave address 3 to be monitored
AddressSlave4# BYTE Slave address 4 to be monitored
Done BOOL Output enabling
Flag indicating any one of the monitored
GeneralOffline BOOL
communication is offline

VAR_OUTPUT Slave1Offline BOOL Flag of offline status slave 1


Slave2Offline BOOL Flag of offline status slave 2
Slave3Offline BOOL Flag of offline status slave 3
Slave4Offline BOOL Flag of offline status slave 4

WPS v2.5X | 444


Equipments (Devices)

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
number of errors recorded for each slave. When Execute receives FALSE level, the inputs are ignored
and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE level and
block finished its execution.

The ErrorsToSetOffline # input allows registering the number of errors identified in a slave that will
feature an offline communication. AddressSlave inputs allow inserting four slave addresses to be
monitored. When this monitored slave reports the programmed number of errors, its corresponding
SlaveOffline output is set to TRUE level. If any of SlaveOffline outputs is at TRUE level, GeneralOffline
also receives TRUE level.

Block Flowchart

Example

WPS v2.5X | 445


Equipments (Devices)

The above example checks the number of error responses sent by the slaves 2, 4, 6 and 8 of the
Modbus RTU. If any of them is greater than 5, its SX_OFF status is led to TRUE level. The block ends
successfully, Done output is activated.

11.2.6.2.1.6 MB_WriteBinary
Block that performs a writing of up to 128 binary data (via Write Single Coil or Write Multiple Coils) in
a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 446


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial bit address w here the data w ill be w ritten
VAR_INPUT NumberOfData BYTE Number of bits to be w ritten (1 to 128)
Timeout# WORD Maximum w aiting time for the slave response [ms]
Offset Indication in InitialDataAddress, i.e., need to
Offset# BOOL
subtract 1 from this number
Value BOOL Variable that stores the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEBINARY
VAR MB_WRITEBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. If the slave is not free, the block waits Busy go to FALSE level to resubmit
the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 447


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 448


Equipments (Devices)

WPS v2.5X | 449


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Coil. The block ends successfully, Done output is activated.

11.2.6.2.1.7 MB_WriteRegister
Block that performs a reading of up to sixteen 16-bit registers (via Write Single Register or Write
Multiple Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 450


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial register address to be w ritten
NumberOfData BYTE Number of registers to be w ritten (1 to 16)

VAR_INPUT Maximum w aiting time for the slave response


Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the data to be w ritten
DWORD UDINT DINT
REAL
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy
VAR_OUTPUT Busy BOOL
w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEREGISTER
VAR MB_WRITEREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of Value values in a number of registers indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the slave. If the slave is not free, the block waits Busy go to FALSE
level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 451


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 452


Equipments (Devices)

WPS v2.5X | 453


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Register. The block ends successfully, Done output is activated.

11.2.6.3 Compare
11.2.6.3.1 COMP_EQ
Block that compares the values of Value1 and Value2, enabling the output Q if both are equal.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality

Operation

When this block has a TRUE value in EN, it sends to the output Q the TRUE value if Value1 and
Value2 are the same. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 454


Equipments (Devices)

Example

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated. Notice that the types of the input variables can be different
without causing execution problems.

WPS v2.5X | 455


Equipments (Devices)

The example above checks equality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is disabled.

11.2.6.3.2 COMP_GE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
or equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or majority of Value1

Operation

When this block has a TRUE value in EN it sends the Q output to the TRUE value if Value1 is higher
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 456


Equipments (Devices)

Example

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is disabled.

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 457


Equipments (Devices)

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is activated.

11.2.6.3.3 COMP_GT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of majority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is higher
than Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 458


Equipments (Devices)

Example

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is disabled.

The example above checks the majority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 459


Equipments (Devices)

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is activated.

11.2.6.3.4 COMP_LE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than or
equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 460


Equipments (Devices)

Example

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is activated.

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 461


Equipments (Devices)

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is disabled.

11.2.6.3.5 COMP_LT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 462


Equipments (Devices)

Example

The example above checks minority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is activated.

The example above checks the minority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 463


Equipments (Devices)

The example above checks the minority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is disabled.

11.2.6.3.6 COMP_NE
Block that compares the values of Value1 and Value2, enabling the Q output if Value1 is different from
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of inequality

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is
different from Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 464


Equipments (Devices)

Example

The example above checks inequality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is disabled.

11.2.6.4 Contact
11.2.6.4.1 NCCONTACT
Normally closed contact.

Ladder Representation

WPS v2.5X | 465


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with TRUE value, B receives FALSE.


When variable I1 is with FALSE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 466


Equipments (Devices)

Example

The above example performs the transfer of the opposite value of digital input DI1 to the digital output
DO2.

11.2.6.4.2 NOCONTACT
Normally open contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with FALSE value, B receives FALSE.


When variable I1 is with TRUE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 467


Equipments (Devices)

Example

The above example performs the transfer of the value of digital input DI1 to the digital output DO2.

11.2.6.4.3 NTSCONTACT
Falling edge transition contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR NTSCONTACT_INST_0 NTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from TRUE to FALSE (falling edge or negative edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

WPS v2.5X | 468


Equipments (Devices)

Block Flowchart

Example

The above example resets the digital output DO1 if the SHIFT key is pressed or a positive pulse on
the digital input DI2 is given.

11.2.6.4.4 PTSCONTACT

Leading edge transition contact.

Ladder Representation

WPS v2.5X | 469


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR PTSCONTACT_INST_0 PTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from FALSE to TRUE (leading edge or positive edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 470


Equipments (Devices)

Example

The above example resets the digital output DO1 if the SHIFT key is pressed and a positive pulse on
the digital input DI2 is given.

11.2.6.5 Control
11.2.6.5.1 PID
Block that performs the function of a discrete PID controller. From the input variables, it calculates the
corresponding controller output.

Ladder Representation

Block Structure

WPS v2.5X | 471


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SetPoint REAL Automatic reference (pre-control)
ManualSetPoint REAL Forced reference (post control)
SelectSetPoint BOOL Selects w hich reference to use
Feedback REAL Feedback loop variable
MinimumOutput REAL Minimum value of the controller output
MaximumOutput REAL Maximum value of the controller output
VAR_INPUT
Kp REAL Proportional gain
Ki REAL Integral gain
Kd REAL Derivative gain
TauSetPoint# REAL Time constant of the automatic reference in put filter
Type# BYTE Controller type
Action# BYTE Control action
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Controller output
VAR PID_INST_0 PID Instance of access to block structure

Operation

On the positive transition edge in EN, Output receives zero value, and the block executes its
functionality as EN is at TRUE level.

When enabled, this block performs a routine PID control with the Kp, Ki and Kd parameters chosen.
The PID topology used may be the Academic or Parallel, depending on what is chosen in Type#.

Academic Form:

Parallel Form:

WPS v2.5X | 472


Equipments (Devices)

The levels of the output signal of the controller are saturated at value MinimumOutput and
MaximumOutput. The SelectSetPoint input level FALSE causes the SetPoint reference be adopted,
allowing the controller maintains control over the process. When SelectSetPoint goes to TRUE level,
the controller has no more domain, and ManualSetPoint becomes to be considered the output signal
of the controller.

Action# will define the feedback operation. If Action# is DIRECT, the operation will be SetPoint –
Feedback. If Action# is REVERSE, the operation will be Feedback – SetPoint.

Feedback receives the process variable considered as the plant output. Ts# receives the sampling
time for the controller and # TauSetPoint receives the time constant for the input filter of the automatic
reference.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Effects of the alteration of gains on the process
If Kp decreases, the process becomes slower; generally more stable or less oscillating; it has
less overshoot.
If Kp increases, the process responds faster; it may become more unstable or more
oscillating; it has more overshoot.
If Ki decreases, the process becomes slower, lagging to reach the "SetPoint"; it becomes
more stable or less oscillating; it has less overshoot.
If Ki increases, the process becomes faster, quickly reaching the "SetPoint"; it becomes more
unstable or more oscillating; it has more overshoot.
If Kd decreases, the process becomes slower; it has less overshoot.
If Kd increases, it has more overshoot.

WPS v2.5X | 473


Equipments (Devices)

NOTE!
How to improve the performance of the process through the adjustment of gains (valid for the
Academic PID)
If the performance of the process is almost good, but the overshoot is a bit high, try to: (1)
decrease Kp 20%, (2) decrease Ki 20% and/or (3) decrease Kd 50%.
If the performance of the process is almost good, but it does not have overshoot and lags to
reach the "SetPoint", try to: (1) increase Kp 20%, (2) increase Ki 20% and/or (3) increase Kd
50%.
If the performance of the process is good, but the process output is varying too much, try to:
(1) increase Kd 50%, (2) decrease Kp 20%.
If the performance of the process is bad, i.e. after start up, the transitory lasts several periods
of oscillation that reduce very slowly or never reduce at all, try to: (1) decrease Kp 50%.
If the performance of the process is bad, i.e. after start up it slowly moves towards the
"SetPoint" without overshoot, but is still very far and the process output is less than the rated
value, try to: (1) increase Kp 50%, (2) increase Ki 50%, (3) increase Kd 70%.

Block Flowchart

WPS v2.5X | 474


Equipments (Devices)

WPS v2.5X | 475


Equipments (Devices)

Example

The above example creates a loop of a digital PID form with sampling time 50 ms, using the
constants KP, KI and KD for control. Automatic reference SETPOINT, filtered by a first order filter with
time constant of 0:01 is used. The error signal is calculated as the difference between the filtered
reference and variable SAIDA_PLANTA. The controller output is saturated between the values 0.1 and
2.5 and sent to the variable ENTRADA_PLANTA.

11.2.6.6 Conversion
11.2.6.6.1 BOOL
11.2.6.6.1.1 BYTE_TO_BOOL
Block that performs the conversion of a BYTE value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
BOOL, storing in Result.

WPS v2.5X | 476


Equipments (Devices)

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The examples above perform the conversion of VALUE variable, in BYTE, into a BOOL value storing

WPS v2.5X | 477


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.1.2 DWORD_TO_BOOL
Block that performs the conversion of a DWORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 478


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in DWORD, into a BOOL value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.1.3 REAL_TO_BOOL
Block that performs the conversion of a REAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

WPS v2.5X | 479


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 480


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice in the
last example that the values very close to the machine epsilon may result in an interpretation of the
FALSE value.

11.2.6.6.1.4 WORD_TO_BOOL
Block that performs the conversion of a WORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 481


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in WORD, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.2 BYTE
11.2.6.6.2.1 BOOL_TO_BYTE
Block that performs the conversion of a BOOL value into a BYTE value.

WPS v2.5X | 482


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 483


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BOOL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.2.2 DWORD_TO_BYTE
Block that performs the conversion of a DWORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 484


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.2.6.6.2.3 REAL_TO_BYTE
Block that performs the conversion of a REAL value into a BYTE value.

WPS v2.5X | 485


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 486


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in REAL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that the
results are truncated in decimal and only the eight least significant bits are taken into account.

11.2.6.6.2.4 WORD_TO_BYTE
Block that performs the conversion of a WORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

WPS v2.5X | 487


Equipments (Devices)

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 488


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.2.6.6.3 DWORD
11.2.6.6.3.1 BOOL_TO_DWORD
Block that performs the conversion of a BOOL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 489


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.3.2 BYTE_TO_DWORD
Block that performs the conversion of a BYTE value into a DWORD value.

Ladder Representation

Block Structure

WPS v2.5X | 490


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 491


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.3.3 REAL_TO_DWORD
Block that performs the conversion of a REAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 492


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in REAL, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated. Note that the
results are truncated in decimal and only the thirty-two least significant bits are taken into account.

11.2.6.6.3.4 WORD_TO_DWORD
Block that performs the conversion of a WORD value into a DWORD value.

WPS v2.5X | 493


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 494


Equipments (Devices)

The examples above convert the VALUE variable, in WORD, into a DWORD value storing the final
result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.4 REAL
11.2.6.6.4.1 BOOL_TO_REAL
Block that performs the conversion of a BOOL value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 495


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BOOL, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.4.2 BYTE_TO_REAL
Block that performs the conversion of a BYTE value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 496


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 497


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.4.3 DWORD_TO_REAL
Block that performs the conversion of a DWORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 498


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.4.4 WORD_TO_REAL
Block that performs the conversion of a WORD value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 499


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 500


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.5 WORD
11.2.6.6.5.1 BOOL_TO_WORD
Block that performs the conversion of a BOOL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 501


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.5.2 BYTE_TO_WORD
Block that performs the conversion of a BYTE value into a WORD value.

Ladder Representation

Block Structure

WPS v2.5X | 502


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 503


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.2.6.6.5.3 DWORD_TO_WORD
Block that performs the conversion of a DWORD value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 504


Equipments (Devices)

Example

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Notice that only the
sixteen least significant bits are taken into account.

11.2.6.6.5.4 REAL_TO_WORD
Block that performs the conversion of a REAL value into a WORD value.

WPS v2.5X | 505


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 506


Equipments (Devices)

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Note that the results
are truncated in decimal and only the sixteen least significant bits are taken into account.

11.2.6.7 Counter
11.2.6.7.1 CTD
Countdown block of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CD BOOL Pulse identifier
VAR_INPUT LD BOOL Loads the value of PV in CV
PV WORD UINT Value of initial configuration
Q BOOL Counter zeroed flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTD_INST_0 CTD Instance of access to block structure

Operation

WPS v2.5X | 507


Equipments (Devices)

When this block identifies a leading edge in CD, it decrements the CV variable until it is zero. While
CV equals zero, the output Q remains at TRUE level. By detecting high-level LD, the block loads the
PV value in CV.

Block Flowchart

Operation Diagram

WPS v2.5X | 508


Equipments (Devices)

Example

The above example shows the initial conditions of routine. As CV has a value of zero, the Q output is
enabled.

The value of the PV variable was changed to 20, but not yet loaded.

WPS v2.5X | 509


Equipments (Devices)

By identifying TRUE level in LD, the block loads the PV value to CV. Since this value is greater than
zero, the Q output is disabled.

At each leading edge identified in CD, the value of COUNT is decremented until it reaches zero, when
the Q output is enabled.

11.2.6.7.2 CTU
Block for gradual count of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CU BOOL Pulse identifier
VAR_INPUT R BOOL Loads the zero value in CV
PV WORD UINT Maximum count value
Q BOOL Counter overrun flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTU_INST_0 CTU Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it increments the CV variable until it is equal to PV.
While CV equals PV, the output Q remains at TRUE level. By detecting high-level R, the block loads
the zero value in CV.

Block Flowchart

WPS v2.5X | 510


Equipments (Devices)

Operation Diagram

WPS v2.5X | 511


Equipments (Devices)

Example

The above example shows the initial conditions of routine. Since CV has a lower value than of PV, the
Q output is disabled.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the Q output is enabled.

WPS v2.5X | 512


Equipments (Devices)

By identifying TRUE level in R, the block loads the zero value to CV. Since this value is lower than of
PV, the Q output is disabled.

11.2.6.7.3 CTUD
Block for gradual count and countdown of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
CU BOOL Pulse identifier for incremental
CD BOOL Pulse identifier for decremental
VAR_INPUT
R BOOL Loads the zero value in CV
LD BOOL Loads the value of PV in CV
PV WORD UINT Reference value
ENO BOOL Output enabling
QU BOOL Counter overrun flag
VAR_OUTPUT
QD BOOL Counter zeroed flag
CV WORD UINT Current count value
VAR CTUD_INST_0 CTUD Instance of access to block structure

Operation

When this block has a TRUE value in EN, it acts as a CTD block and block CTU at the same time
acting on the same CV counter. That is: increments CV until it reaches PV to the leading edges in
CU and decrements CV until it reaches zero to the leading edges in CD. A positive transition in R
carries zero in CV, while a leading edge in LD loads the PV value in CV. If CV has zero value, QD
receives TRUE, and if CV has value equal to PV, QU receives TRUE.

WPS v2.5X | 513


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value.

Block Flowchart

WPS v2.5X | 514


Equipments (Devices)

WPS v2.5X | 515


Equipments (Devices)

Operation Diagram

Example

WPS v2.5X | 516


Equipments (Devices)

The example above shows the disabled block, with all its internal variables zeroed. Although the
external controls are activated, these values are not forwarded to the instance of the block.

When activated, the block identifies the value of PRESET, loading it in PV, and identifies that the
output is at zero, enabling the QD output. When execution is completed, the ENO output is activated.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the QU output is enabled. When execution is completed, the ENO output is activated.

At each leading edge detected in CD, the CV value is decremented. When CV is a value between
zero and PV, both QD and QU outputs are deactivated. When execution is completed, the ENO
output is activated.

WPS v2.5X | 517


Equipments (Devices)

A TRUE value in R resets CV, while a TRUE value in LD loads the value of PV to CV. As we can see,
R prevails over LD, leaving CV and enabling the QD output. When execution is completed, the ENO
output is activated.

11.2.6.8 Data Transfer


11.2.6.8.1 DEMUX
Block that creates 16 new BOOL variables from the decomposition of a WORD variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Word WORD UINT INT Input variable of 15 bits
ENO BOOL End of operation
VAR_OUTPUT
Bit0 – Bit15 BOOL Bit of the corresponding position of Word

Operation

WPS v2.5X | 518


Equipments (Devices)

When this block has a TRUE value in EN, it decomposes the input variable in Word 15 Boolean
values stored in Bit0 to Bit15 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 519


Equipments (Devices)

The example above decomposes the value of MYWORD in Boolean values, which are stored in the
output variables BIT0 to Bit15. The block ends successfully and the ENO output is activated.

11.2.6.8.2 ILOAD
Block which indirectly loads the value of a variable and transfers it to Value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
DataType# BYTE Data type of the selected variable
Address DWORD UDINT DINT Address of the global variable, as its group
ENO BOOL End of operation
VAR_OUTPUT As selected in
Value Value of the selected variable
DataType#

Operation

When this block has a TRUE value in EN, it loads, in Value, the of the Address variable belonging to
the Group# group, as the selected DataType#.

WPS v2.5X | 520


Equipments (Devices)

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example loads the value of the address 40 of group 2 (GLOBAL_SYSTEM%S), which
represents the status of ESC key in UINT format for the VALUE variable. The block ends with
success and ENO output is activated.

11.2.6.8.3 ILOADBOOL
Block that indirectly loads the value of a bit in a global variable address.

Ladder Representation

WPS v2.5X | 521


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be checked
ENO BOOL End of operation
VAR_OUTPUT
Value BOOL Value of the bit selected by the input arguments

Operation

When this block has a TRUE value in EN, it loads, in Value, the Bit contents of the Address variable
belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 522


Equipments (Devices)

Example

The above example loads the value of bit 1 of the address 24 of group 2 (S GLOBAL_SYSTEM%),
which represents the status of ESC key for the VALUE variable. The block ends with success and
ENO output is activated.

11.2.6.8.4 ISTORE
Block that indirectly loads the Value value in a variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
DataType# BYTE Data type of the selected variable
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Depending on the
Value selection of the Value to be w ritten in the selected variable
DataType#
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the contents of the Address
variable belonging to the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 523


Equipments (Devices)

Block Flowchart

Example

The example above stores the VALUE value in WORD format in address 444 of group 3
(GLOBAL_SYSTEM% C), which represents the index of the communication port Modbus TCP. The
block ends with success and ENO output is activated.

11.2.6.8.5 ISTOREBOOL
Block that indirectly loads the Value value in a bit in a global variable address.

Ladder Representation

WPS v2.5X | 524


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be modified
Value BOOL New value of the selected bit
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the Bit contents of the Address
variable belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 525


Equipments (Devices)

Example

The example above stores the value of VALUE in bit 7 of the address 121 in group 3
(GLOBAL_SYSTEM% C), which represents the disable command of CANopen communication. The
block ends with success and ENO output is activated.

11.2.6.8.6 MUX
Block that creates a new WORD variable from the concatenation of 16 BOOL variables.

WPS v2.5X | 526


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit15 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
Word WORD UINT INT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable Word. Bit0 corresponds to LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 527


Equipments (Devices)

Example

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYWORD. The block ends with success and ENO output is activated.

WPS v2.5X | 528


Equipments (Devices)

11.2.6.8.7 SEL
Block that replicates to the output the value of an input variable (Value0 or Value1) according to the
Selector selection.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Selector BOOL Variable that selects the input

VAR_INPUT BYTE USINT SINT WORD UINT


Value0 Multiplexed input number 1
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value1 Multiplexed input number 2
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value selected
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it replicates to the Result variable the Value0 value if
selector is FALSE or the Value1 value if Selector is TRUE.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 529


Equipments (Devices)

Example

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated.

WPS v2.5X | 530


Equipments (Devices)

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
TRUE level, the RESULT output gets the value of VALUE1. The block ends successfully and the ENO
output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

11.2.6.8.8 STORE
Block that performs direct storage of data from a source to a destination.

Ladder Representation

Block Structure

WPS v2.5X | 531


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
SRC Data source
INT DWORD DINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
DST Data destination
INT DWORD DINT DINT REAL

Operation

When this block has a TRUE value in EN, it stores the contents from SRC into DST.

NOTE!
SRC and DST must have data types of the same size.

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 532


Equipments (Devices)

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated.

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated. Note that the binary pattern is maintained between variables of different
types.

11.2.6.8.9 USERERR
Block that generates an alarm or fault with the number programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Error code generated
CODE WORD UINT
(950 - 999)
VAR_INPUT
Error type generated
TYPE BYTE (0 - Alarm)
(1 - Fault)
VAR_OUTPUT ENO BOOL Success in the generation of error
VAR USERERR_INST_0 USERERR (*) Instance of access to block structure

NOTE!
(*) USERERR_INST_0 instance must be configurated to SCA06 and LDW900 .

Operation

When this block has a TRUE value in EN, it generates an alarm or equipment failure, depending on
the type defined in TYPE with CODE code.

The value of ENO informs if the generation of alarm or fault has been executed successfully.

Block Flowchart

WPS v2.5X | 533


Equipments (Devices)

Example

The above example, when identifying TRUE level in DI1, generates a fault with the code 974 and sets
the DO1 output.

USERERR table configuration

On devices that have text-based HMI, messages can be configured through an editor. To access the
editor, right click on the USERERR block and select the "Edit USERERR Table" option.

WPS v2.5X | 534


Equipments (Devices)

The texts configured in the table will be displayed on the HMI when the block USERERR is enabled.

After editing the table, select the argument CODE of the block equal to the CODE column of the
table.

11.2.6.9 Filter
11.2.6.9.1 LOWPASS
Block that filters the input using a low pass filter of first order and inserts the result in the output.

Ladder Representation

WPS v2.5X | 535


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Input REAL Input signal
VAR_INPUT
Tau REAL Filter time constant
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Filter output
VAR LOWPASS_INST_0 LOWPASS Instance of access to block structure

Operation

When this block has a TRUE value in EN, filters the input value of Input using a low pass first order
filter described by Tau and Ts#, inserting the result in Output. On the leading edge of EN, Output
receives zero.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 536


Equipments (Devices)

Example

The above example causes OUTPUT, by identifying a leading edge in EN, to display a behavior of first
order with time constant equal to Tau and the sampling time of 2 ms, in order to achieve the reference
set to INPUT. At each calculation completed successfully, the ENO output is activated.

WPS v2.5X | 537


Equipments (Devices)

11.2.6.10 Logic
11.2.6.10.1 Logic Bit
11.2.6.10.1.1 RESETBIT
Logical block used to perform reset of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, resets the bit indicated in Position in the Data variable
that is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the reset of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 538


Equipments (Devices)

Example

The example above resets the bit of AUX zero position, whose initial value is 200 (1100 1000, in
binary). Since this bit already had FALSE value, nothing has changed.

The example above resets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above resets the bit in position nine of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 539


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.2.6.10.1.2 SETBIT
Logical block used to perform the set of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, sets the bit indicated in Position in the Data variable that
is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the set of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 540


Equipments (Devices)

Example

The example above sets the bit of AUX zero position, whose initial value is 153 (1001 1001, in binary).
Since this bit already had TRUE value, nothing has changed.

The example above sets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above sets the bit in position fifteen of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 541


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.2.6.10.1.3 TESTBIT
Logical block that revolutions the value of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
Data WORD UINT INT Variable w hose bit w ill be tested
DWORD UDINT DINT
VAR_INPUT
EN BOOL Block enabling
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT Q BOOL Value of the tested bit

Operation

This block when it has a TRUE value in EN, sends to the output Q the bit value indicated in Position
in the Data variable.

When EN has FALSE value, Q also receives FALSE.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 542


Equipments (Devices)

Example

The example above sets the bit value of zero position of AUX, whose initial value is 74 (0100 1010 in
binary) to the output Q. Since this bit has value 0, the output is disabled.

The example above sets the value of the bit of position three of AUX to the output Q. Since this bit
has value 1, the output is enabled.

The example above sets the bit value of position ten of AUX to output Q. Since AUX is a variable of
BYTE type, it has only eight bits. Thus, the example above creates a runtime error in the block and
therefore the output is disabled.

WPS v2.5X | 543


Equipments (Devices)

11.2.6.10.2 Logic Boolean


11.2.6.10.2.1 AND
Logical block that performs an boolean "and" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “and” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 544


Equipments (Devices)

Example

The example above performs an "and" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.2.6.10.2.2 NOT
Block that performs a logical operation of boolean "not" in a variable, storing the result in another.

Ladder Representation

Block Structure

WPS v2.5X | 545


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling

VAR_INPUT BYTE USINT SINT


Value WORD UINT INT Reference variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the denied Boolean value of
the Value input variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The example above performs a boolean "not" operation in AUX, storing the result in AUX2.

WPS v2.5X | 546


Equipments (Devices)

11.2.6.10.2.3 OR
Logical block that performs an Boolean "or" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “or” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 547


Equipments (Devices)

Example

The example above performs an "or" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.2.6.10.2.4 XNOR
Logical block that performs an Boolean "not exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

WPS v2.5X | 548


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “denied exclusive or”
Boolean operation of input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 549


Equipments (Devices)

The example above performs a "denied exclusive or" Boolean operation between AUX and AUX2,
storing the result in AUX3.

11.2.6.10.2.5 XOR
Logical block that performs an Boolean "exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “xor” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 550


Equipments (Devices)

Example

The example above performs a "xor" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.2.6.10.3 Logic Rotate


11.2.6.10.3.1 ROL
Block that performs a logical left rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 551


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical left shifts, according to the Shift value. The most significant bits
that are being discarded are returned to the least significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 552


Equipments (Devices)

Example

The above example performs a logical left shift by one position in the VALUE variable whose initial
value is -100 (1001 1100 in binary). The discarded bits on the left are reinserted on the right. The final
result (0011 1001 in binary) is stored in RESULT.

The above example performs a logical left rotation by five positions in the VALUE variable whose initial
value is 21 (0001 0101 in binary). The discarded bits on the left are reinserted on the right. The final
result (1010 0010 in binary) is stored in RESULT.

11.2.6.10.3.2 ROR
Block that performs a logical right rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 553


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical right shifts, according to the Shift value. The least significant bits
that are being discarded are returned to the most significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 554


Equipments (Devices)

Example

The above example performs a logic right shift by one position in the VALUE variable whose initial
value is -128 (1000 0000 in binary). The discarded bits on the right are reinserted on the left. The final
result (0100 0000 in binary) is stored in RESULT. Notice that the sign is not preserved in this
operation.

The above example performs a logical right rotation by one position in the VALUE variable whose
initial value is -127 (1000 0001 in binary). The discarded bits on the right are reinserted on the left. The
final result (1100 0000 in binary) is stored in RESULT.

11.2.6.10.4 Logic Shift


11.2.6.10.4.1 ASHL
Block that performs a binary left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 555


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic left shifts, according to the Shift value.

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 556


Equipments (Devices)

Description of exemple.

Description of exemple.

11.2.6.10.4.2 ASHR
Block that performs arithmetic left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic right shifts, according to the Shift value.

WPS v2.5X | 557


Equipments (Devices)

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example performs an arithmetic right shift by three positions in the VALUE variable whose
initial value is 52 (0011 0100 in binary). The bits on the right are being discarded, and on the left new
zeros are inserted. The final result (0000 0110 in binary) is stored in RESULT.

WPS v2.5X | 558


Equipments (Devices)

The above example performs an arithmetic right shift by two positions in the VALUE variable whose
initial value is -79 (1011 0001 in binary). The bits on the right will be discarded and new ones on the
left are inserted, since the arithmetic right shifts preserve the sign of the variable. The final result
(1111 0110 in binary) is stored in RESULT.

The above example performs an arithmetic right shift by thirteen positions in the VALUE variable
whose initial value is -128 (1000 0000 in binary). The bits on the right are being discarded, and on the
left new ones are inserted. The final result (1111 1111 in binary) is stored in RESULT.

11.2.6.10.4.3 SHL
Block that performs a binary logical left shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 559


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts left, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 560


Equipments (Devices)

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is 56 (0011 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (0011 1000 0000 in binary) is stored in RESULT.

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is -56 (1100 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (1100 1000 0000 in binary) is stored in RESULT. Since RESULT is SINT
type, it only accepts the first eight bits (1000 0000).

11.2.6.10.4.4 SHR
Block that performs a binary logical right shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 561


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts right, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 562


Equipments (Devices)

The above example performs a logical right shift by two positions in the VALUE variable whose initial
value is 124 (0111 1100 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 1111 in binary) is stored in RESULT.

The above example performs a logical right shift by three positions in the VALUE variable whose initial
value is -98 (1001 1110 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 0011 in binary) is stored in RESULT.

11.2.6.11 Math
11.2.6.11.1 Math Basic
11.2.6.11.1.1 ABS
Block that calculates the Value module, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the absolute value of the

WPS v2.5X | 563


Equipments (Devices)

Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the absolute value of the VALUE variable whose initial value is -45,
storing the final result, 45, in RESULT.

The above example calculates the absolute value of the VALUE variable whose initial value is -45. The
final result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by
SINT type. Therefore, RESULT remains unchanged and the output is disabled.

WPS v2.5X | 564


Equipments (Devices)

11.2.6.11.1.2 ADD
Block that calculates the sum of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First addend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second addend of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sum of Value1 and Value2
variables. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 565


Equipments (Devices)

Example

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT.

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 566


Equipments (Devices)

The above example calculates the sum of VALUE1 and VALUE2 variables. The final result -170
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.2.6.11.1.3 DIV
Block that calculates the division of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the division of Value1 and
Value2 variables. The value stored will be the exact division if Result is REAL, or, in other cases, only
the quotient. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 567


Equipments (Devices)

Example

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is of REAL type, the exact value of the division is stored in it.

WPS v2.5X | 568


Equipments (Devices)

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it. Notice that the block
accepts arguments of both signs.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains unchanged
and the output is disabled.

11.2.6.11.1.4 MOD
Block that calculates the remainder of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT operation

Operation

WPS v2.5X | 569


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the remainder of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

WPS v2.5X | 570


Equipments (Devices)

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains
unchanged and the output is disabled.

11.2.6.11.1.5 MUL
Block that calculates the multiplication of the values of Value1 and Value2, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First factor of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second factor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

WPS v2.5X | 571


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the multiplication of Value1
and Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT.

WPS v2.5X | 572


Equipments (Devices)

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the product of VALUE1 and VALUE2 variables. The final result 224
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.2.6.11.1.6 NEG
Block that calculates the opposite (i.e., the product with -1) of a value passed by Value, storing the
result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the opposite of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 573


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the opposite of the VALUE variable whose initial value is 21, storing
the final result, -21, in RESULT.

The above example calculates the opposite of the VALUE variable whose initial value is -56, storing
the final result, 56, in RESULT.

WPS v2.5X | 574


Equipments (Devices)

The above example calculates the opposite of the VALUE variable whose initial value is -128. The final
result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by SINT
type. Therefore, RESULT remains unchanged and the output is disabled.

11.2.6.11.1.7 SUB
Block that calculates the subtraction between the Value1 and Value2 values, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Minuend of operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Subtrahend of operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the subtraction of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 575


Equipments (Devices)

Example

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 576


Equipments (Devices)

The above example calculates the subtraction of VALUE1 and VALUE2 variables. The final result 141
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.2.6.11.2 Math Extended


11.2.6.11.2.1 ALOG10
Block that calculates the antilogarithm (exponent with base 10) of the Value value, storing the result
in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the antilogarithm of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 577


Equipments (Devices)

Example

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the minimum input value for which the block revolutions a nonzero
result. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in

WPS v2.5X | 578


Equipments (Devices)

RESULT. Below the minimum values cause the block to return a null value. The block ends with
success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the maximum input value for which the block revolutions a valid result.
The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. Values higher than the maximum cause the block to generate an error, the RESULT output
remains unchanged and Done output is disabled.

11.2.6.11.2.2 EXP
Block that calculates the exponential of the Euler number "and" raised to the value of Value, storing
the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the exponent of the Euler
number "and" raised to the Value variable. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 579


Equipments (Devices)

Block Flowchart

Example

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the minimum input value for which the block revolutions a nonzero result. The
block ends with success and Done output is activated.

WPS v2.5X | 580


Equipments (Devices)

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values below the minimum cause the block to return to a null value. The block ends with success
and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the maximum input value for which the block revolutions a valid result. The
block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values higher than the maximum cause the block to generate an error, the RESULT output remains
unchanged and Done output is disabled.

11.2.6.11.2.3 LN
Block that calculates the natural logarithm of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the natural logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 581


Equipments (Devices)

Block Flowchart

Example

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has value zero, and Done output is
disabled.

WPS v2.5X | 582


Equipments (Devices)

11.2.6.11.2.4 LOG10
Block that calculates the common logarithm (base 10) of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the common logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 583


Equipments (Devices)

Example

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.2.6.11.2.5 POW
Block that calculates the value of Value raised to the exponent Power, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value REAL Base of the operation
Power REAL Exponent of the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to
the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 584


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

WPS v2.5X | 585


Equipments (Devices)

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. Since the result is higher than the maximum supported by REAL type, the block
generates an error and Done output is disabled.

11.2.6.11.2.6 ROUND
Block that rounds the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the rounded value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 586


Equipments (Devices)

Example

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals less than 0.5 are discarded. The block ends with success and Done output is activated.

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals greater than or equal to 0.5 promote unity value immediately above. The block ends with
success and Done output is activated.

11.2.6.11.2.7 SQRT
Block that calculates the square root value of Value, storing the result in Result.

Ladder Representation

WPS v2.5X | 587


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the square root value of
Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 588


Equipments (Devices)

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.2.6.11.2.8 TRUNC
Block that truncates the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the truncated value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

WPS v2.5X | 589


Equipments (Devices)

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

Example

The above example truncates the value of the VALUE variable, storing the final result in RESULT.
Decimals are discarded. The block ends with success and Done output is activated.

11.2.6.11.3 Math Trigonometry


11.2.6.11.3.1 ACOS
Block that calculates the arccosine of Value, storing the result in Angle.

Ladder Representation

Block Structure

WPS v2.5X | 590


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of cosine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose cosine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arccosine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 591


Equipments (Devices)

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block generates a runtime error, since VALUE has value inferior to 1, and
Done output is disabled.

11.2.6.11.3.2 ASIN
Block that calculates the arcsine of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of sine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose sine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arcsine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 592


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block generates a runtime error, since VALUE has value superior to 1, and
Done output is disabled.

WPS v2.5X | 593


Equipments (Devices)

11.2.6.11.3.3 ATAN
Block that calculates the arctangent of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of tangent
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 594


Equipments (Devices)

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for positive values, is always in the first quadrant. The block ends with
success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for negative values, is always in the fourth quadrant. The block ends
with success and Done output is activated.

11.2.6.11.3.4 ATAN2
Block that calculates the arctangent of Y/X, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT X REAL Parameter X of the function
Y REAL Parameter Y of the function
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to (Y/X) (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Y/X. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 595


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and Y, is always in the first quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final

WPS v2.5X | 596


Equipments (Devices)

result in RESULT. The arc, for negative values of X and positive values of Y, is always in the second
quadrant. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for negative values of X and Y, is always in the third quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and negative values of Y, is always in the fourth
quadrant. The block ends with success and Done output is activated.

11.2.6.11.3.5 COS
Block that calculates the cosine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the cosine of Angle. If no

WPS v2.5X | 597


Equipments (Devices)

errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 598


Equipments (Devices)

11.2.6.11.3.6 SIN
Block that calculates the sine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sine of Angle. If no errors,
the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE
status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 599


Equipments (Devices)

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts negative input values.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts values greater than one full turn.

11.2.6.11.3.7 TAN
Block that calculates the tangent of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

WPS v2.5X | 600


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the tangent of Angle. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 601


Equipments (Devices)

11.2.6.11.4 Math Util


11.2.6.11.4.1 MAX
Block that compares the values of Value1 and Value2 and stores the highest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Highest of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the highest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 602


Equipments (Devices)

Example

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 603


Equipments (Devices)

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is higher than the maximum supported by SINT type, the
block generates an error and Done output is disabled.

11.2.6.11.4.2 MIN
Block that compares the values of Value1 and Value2 and stores the lowest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Low est of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the lowest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 604


Equipments (Devices)

Example

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 605


Equipments (Devices)

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is lower than the minimum supported by SINT type, the
block generates an error and Done output is disabled.

11.2.6.11.4.3 SAT
Block that performs a routine for saturation of the value found in Value in accordance with the limits
for Minimum and Maximum, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Reference value
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
Minimum Inferior saturation value
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Maximum Superior saturation value
INT DWORD UDINT DINT REAL
Indicator that there w as saturation in the
Q BOOL
process
VAR_OUTPUT
BYTE USINT SINT WORD UINT
Result Result of operation
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and
Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of
Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q
receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If
there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with
its value unchanged.

WPS v2.5X | 606


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 607


Equipments (Devices)

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or
higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no
saturation.

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

WPS v2.5X | 608


Equipments (Devices)

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM.
The block ends successfully and the Q output is activated, since there was saturation.

11.2.6.12 Module
11.2.6.12.1 USERFB
Block that performs a subroutine programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT According to user
INPUT Block inputs
programming
ENO BOOL End of operation
VAR_OUTPUT According to user
OUTPUT Block outputs
programming
According to user
VAR_IN_OUT IN_OUT Block inputs/outputs
programming
VAR MYUSERFB_INST_0 MYUSERFB Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine programmed by the user and updates the values of the outputs
after completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 609


Equipments (Devices)

NOTE!
Refer to section Working with USERFBs for further information.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

11.2.6.13 Motion Control


11.2.6.13.1 MW_RefVelocity

This block sends speed reference to drive.

Ladder Representation

WPS v2.5X | 610


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT EN BOOL Block enabling
DINT INT
Velocity Sets speed reference to drive if block is enabled
REAL
Sets the speed unit:
0 = 13Bits
13 Bits – Sends the speed value in 13 bits;
VelocityUnit 1 = RPM
RPM – Sends the speed value in RPM;
2 = HZ(x10)
HZ – Sends the speed value in Hz (x10).
Define if block w ill run the Run/Stop (CFW_CMD_RUN_STOP)
w hen it is enabled:
FALSE – Do not send Run/Stop command w ith block enabling
0 = FALSE
RunAutomatic (it is necessary to use the marker CFW_CMD_RUN_STOP in
1 = TRUE
ladder's logic to send the Run/Stop command);
TRUE – Send Run command w ith block enabling and Stop
command w ith block disabling.
End of operation. Conditions for ENO = 1
Does not exist another active block
MW_RefVelocity;
VAR_OUTPUT ENO BOOL
Drive is enabled and stop mode set
“Stopping by inertia”.

Operation

When this block has a “0” value in EN, it does not execute and ENO output is zero.

RunAutomatic = TRUE

When this block has a “1” value in EN input, the drive is general enabled, no other motion block is
active, the Run/Stop command goes to "1", the speed reference value is send to drive and the ENO
output is set to “1”.
If EN input has a "0" value, and this block is active, the Run/Stop command is set to "0" and ENO
output goes to "0".

RunAutomatic = FALSE

When this block has a “1” value in EN input, the drive is general enabled, the Run/Stop command is
set to "1", no other motion block is active, the speed reference value is send to drive and the ENO
output is set to “1”.
If EN input has a "0" value and this block is active, ENO output is set to "0".

WPS v2.5X | 611


Equipments (Devices)

NOTE!
Check the source of speed reference and command Run/Stop for correct operation of this
block

Block Flowchart

Example

WPS v2.5X | 612


Equipments (Devices)

The above example shows the MW_RefVelocity block, set to Hz and the RunAutomatic command in
TRUE, if drive is general enabled and the block is enabled, the speed reference is changed.

The above example shows the MW_RefVelocity block, set to Hz and RunAutomatic command in
FALSE, if drive is general enabled, it is necessary the Run command. So, when the block be enabled,
the speed reference would be changed.

11.2.6.14 Timer
11.2.6.14.1 TON
Timer block that, when energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 613


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output drive
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TON_INST_0 TON Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is FALSE, the Q output is FALSE and ET also receives the value zero.
On the edge positive transition in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state TRUE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 614


Equipments (Devices)

Operation Diagram

WPS v2.5X | 615


Equipments (Devices)

Example

The above example shows the initial conditions of the block and of the routine variables.

When activated the IN input, counting is triggered. Since ET equals PT, the Q output is enabled.

Note that a change in PRESET variable is not forwarded to the PT field while the IN entry remains
enabled.

WPS v2.5X | 616


Equipments (Devices)

Disabling the IN input, the value of PT is updated and the Q output is disabled. When activating it
again, counting is triggered.

Disabling the IN input, the value of ET remains saved.

Enabling the IN input, the value of ET is reset and counting is triggered.

When ET reaches the value PT, the Q is output enabled and remains so while IN is at TRUE level.

11.2.6.14.2 TOF
Timer block that, when energized, disables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 617


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output deactivating
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TOF_INST_0 TOF Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is TRUE, the Q output is also TRUE and ET also receives the value zero.
On the negative transition edge in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state FALSE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 618


Equipments (Devices)

Operation Diagram

WPS v2.5X | 619


Equipments (Devices)

Example

The above example disables the DO1 output to identify a low level in DI1 for 12 seconds, remaining
disabled until DI1 again be TRUE.

11.2.6.14.3 TP
Timer block that, when identifies it is energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 620


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Time w hile the output is enabled
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TP_INST_0 TP Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

On the edge positive transition in IN, Q receives TRUE value, counting is triggered and ET is
incremented according to TIMEBASE. When ET equals PT, the Q output goes to state FALSE until
IN revolutions to FALSE. At that moment, if IN is at TRUE level, nothing happens. On the edge
positive transition in IN, ET is automatically reset.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 621


Equipments (Devices)

Operation Diagram

WPS v2.5X | 622


Equipments (Devices)

Example

The above example enables the DO1 output for six seconds at each DI1 positive transition.

11.2.6.15 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

WPS v2.5X | 623


Equipments (Devices)

Figure 1: Creating a structure

2. Define the file name and press the Next button.

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

WPS v2.5X | 624


Equipments (Devices)

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

Figure 4: Structure created in the project

WPS v2.5X | 625


Equipments (Devices)

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.2.7 Communication
11.2.7.1 Force I/O
Overview

The force inputs and outputs window is used for the values of the digital and analog inputs to be read by the
program, by values manipulated by the user, regardless their physical state. It also allows the manipulation of
the physical states of the digital and analog outputs by the user independently of the values calculated by the
program.
In order to force the device inputs and outputs, it is necessary that the online monitoring be active and the
option Run cyclically be enabled. The data are sent to the device every 2 seconds.
The values can be edited with the device disconnected. The configurations are stored in the resources and
recorded whenever the main resource selection is changed.
The data displayed on the force I/O window contain the values belonging to the resource (and configuration)
selected as main.

The force I/O window is open trough the menu Online > Force I/O:

Toolbar

The toolbar of the force window has the options to run cyclically, upload the device force configuration, enable

WPS v2.5X | 626


Equipments (Devices)

all and disable all:


Run cyclically: Sends the user's configurations to the device and updates the state of the inputs and
outputs in a cyclic way.
Upload configuration: Allows the current configuration of the device to be read. For this option to be
enabled, it is necessary that the online monitoring be active and the option run cyclically be disabled.
Enable all: Enables the force I/O of all of the inputs and outputs of the device.
Disable all: Disables the force I/O of all of the inputs and outputs of the device.

Input and Output commands

For each digital and analog input and output there is a selection box linked to enable the force, a status field
and an edition field.

Digital:

1. Number of the digital inputs/output


2. Enable/disable Force I/O
3. Current status of the I/O: It has three statuses: 1. light green LED: activated; 2. dark green LED:
deactivated; 3. gray LED: the value is not being read.
4. Enable/disable the input/output

Analog:

1. Number of the analog input/output


2. Enable/disable Force I/O
3. Current value of the input/output
4. Value of the input/output configured by the user

NOTE!
The analog signal scale has 15 bits plus 1 bit for signal, except for SSW900 which it has only 10
unsigned bits.

11.3 CFW500
Enter topic text here.

WPS v2.5X | 627


Equipments (Devices)

11.3.1 Description

With a modern design and power range of 0.25 to 30 hp, the CFW500 is a high-performance variable speed
drive that assists in the speed and torque control of three-phase induction motors. The device also features
sensorless vector, vector encoder or scalar, SoftPLC, which adds functions of PLC (Programmable Logic
Controller), Pump Genius, which features dedicated functions for pumping and selectable plug-in modules,
which provide a flexible and optimized for any application.

Refer to the user's manual of the CFW500 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.3.2 Parameters
11.3.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 628


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 629


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.3.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 630


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 631


Equipments (Devices)

11.3.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 632


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 633


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 634


Equipments (Devices)

11.3.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 635


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 636


Equipments (Devices)

WPS v2.5X | 637


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 638


Equipments (Devices)

WPS v2.5X | 639


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 640


Equipments (Devices)

WPS v2.5X | 641


Equipments (Devices)

WPS v2.5X | 642


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 643


Equipments (Devices)

WPS v2.5X | 644


Equipments (Devices)

11.3.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 645


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 646


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.4 CFW501
Enter topic text here.

11.4.1 Description

WPS v2.5X | 647


Equipments (Devices)

With a modern design and power range of 0.25 to 30 hp, the CFW501 is a high-performance variable speed
drive that assists in the speed and torque control of three-phase induction motors. The device also features
sensorless vector, vector encoder or scalar, SoftPLC, which adds functions of PLC (Programmable Logic
Controller), Pump Genius, which features dedicated functions for pumping and selectable plug-in modules,
which provide a flexible and optimized for any application.

Refer to the user's manual of the CFW501 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.4.2 Parameters
11.4.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 648


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 649


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.4.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 650


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 651


Equipments (Devices)

11.4.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 652


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 653


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 654


Equipments (Devices)

11.4.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 655


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 656


Equipments (Devices)

WPS v2.5X | 657


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 658


Equipments (Devices)

WPS v2.5X | 659


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 660


Equipments (Devices)

WPS v2.5X | 661


Equipments (Devices)

WPS v2.5X | 662


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 663


Equipments (Devices)

WPS v2.5X | 664


Equipments (Devices)

11.4.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 665


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 666


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.5 CFW-11
Enter topic text here.

11.5.1 Description

WPS v2.5X | 667


Equipments (Devices)

Refer to the user's manual of the CFW-11 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.5.2 Parameters
11.5.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 668


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,
change the values and the modification will occur on-line.
5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.5.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

WPS v2.5X | 669


Equipments (Devices)

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 670


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 671


Equipments (Devices)

11.5.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 672


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 673


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 674


Equipments (Devices)

11.5.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 675


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 676


Equipments (Devices)

WPS v2.5X | 677


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 678


Equipments (Devices)

WPS v2.5X | 679


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 680


Equipments (Devices)

WPS v2.5X | 681


Equipments (Devices)

WPS v2.5X | 682


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 683


Equipments (Devices)

WPS v2.5X | 684


Equipments (Devices)

11.5.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 685


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 686


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.5.3 Diagnostic
11.5.3.1 Trace
11.5.3.1.1 Overview
The trace function is used to register variables* of interest of the device (such as current, voltage, speed, etc.)
when a certain event occurs in the system. Since it triggers the storage of the variables, in the system this

WPS v2.5X | 687


Equipments (Devices)

event is called trigger, and the user can define up to three trigger conditions and the logic to be used in them
(AND or OR logic).
The stored variables can be seen as graphics by using the WPS running on a PC connected via USB or via
serial to the device.

NOTE: Up to 6 (six) channels using SCA06; Up to 4 (four) channels using CFW-11.

Below is an overview of the configuration screen of the trace function (example using SCA06).

1. Graphic Zoom. This bar contains the options to control the graphic, such as export to image file, zoom in,
zoom out, set width, set height, se all and show or not show the graphic lettering.
2. Trace Status. This item shows the present status of the trace function: not started, trigger occurred and
concluded.
3. Parameters. In this part are all the parameters that can be configured in the trace routine, such as triggers,
conditions, channels to be monitored and sampling period.
4. Graphic. In this area is the graphic after the conclusion of trace. In the lower part is the time line and on the
right are the values separated by unit of measurement.
5. Markers. The markers are within the graphic area. After the graphic is set, just click on the black marker to
create red markers (fixed). It is possible to add two fixed markers. Those fixed markers are used to
calculate the average and effective values between the two points.
6. Trace command. Below is the description of the command functions:
6.1.Read configuration: It reads the trace configuration parameters and updates the parameters on the
screen (item 3).
6.2.Save configuration: It sends the trace configuration parameters (item 3) to the equipment.

WPS v2.5X | 688


Equipments (Devices)

6.3.Read Data: Command used only when the trace status is concluded, that is, there is already a
concluded trace on the equipment, and you just wish to download the data without starting a new trace.
6.4.Force Trigger: Forces the trigger regardless the conditions.
6.5.Start Trace: It starts the trace function.
7. Channel Table. This table shows the data of the chosen channels, besides the possibility to hide
channels (Visible), change the channel color (Color) and set the graphic limits per unit of measurement
(Maximum).

11.5.3.1.2 Configuration
Below is a list of the necessary steps to create a trace configuration:

1. Creation of a new trace file.

WPS v2.5X | 689


Equipments (Devices)

2. After the creation of the trace file, it is necessary to set the desired configurations in the part of parameters.

WPS v2.5X | 690


Equipments (Devices)

3. After making the desired configurations, just click on save configuration to send them to the equipment.
Notice that it is necessary to be connected to the equipment with the option Connect Device of the WPS.

WPS v2.5X | 691


Equipments (Devices)

4. After the configurations are saved, just click on Start Trace. Notice that the status of the trace function
changed to Waiting, that is, the tool is now waiting for the trigger execution to set the graphic and show the
trace values.

WPS v2.5X | 692


Equipments (Devices)

5. After trigger occurs, the graphic and the values will be shown in the table and the trace function status will
be Concluded.

WPS v2.5X | 693


Equipments (Devices)

6. If you wish, you can click on the black cursor of the graphic and add fixed cursors so that the calculation of
the average and effective values will be performed for the channels in the defined ranges.

WPS v2.5X | 694


Equipments (Devices)

11.6 LDW900
11.6.1 Description
The LDW900 is a high performance product directed to the lifts market for speed control, torque and PM motor
position of sinusoidal alternating current.

Its main feature is the energy regeneration option to the power grid at the time of engine braking, reducing the
consumption of electricity.

Another feature of the product is the high performance and precision control of motor shaft movement due to
operation in closed loop through position feedback provided by an encoder.

It has operator interface with six-digit LED's display for control, adjustment and display of all parameters,
connected to expansion accessories, PLC function, positioning blocks, free programming software and
CANopen communication included in the standard product.

Refer to the user manual and LDW900 programming manual for more information about the product.

WPS v2.5X | 695


Equipments (Devices)

11.6.2 System Markers


The following variables contained in the GLOBAL_SYSTEM group of the variables table, have the fixed tag.
The tag of system markers were divided into groups and subgroups, where:

Groups:
LDW: reading and writing variables of the LDW900 lift drive;
CO: reading and writing variables of the CANopen network.

Subgroups:
STS: reading variable (status);
CMD: writing variable (command).

Reading System Markers (Status)

WPS v2.5X | 696


Equipments (Devices)

Address Bit Modbus Tag Description

Ladder

%SB6000 0 0 FREQ_2HZ Oscillator w ith frequency of 2 Hz

%SB6000 1 1 PULSE_1SCAN Pulse during the first scan cycle

%SB6000 2 2 FALSE Alw ays in 0

%SB6000 3 3 TRUE Alw ays in 1

%SW6002 -- 3001 ELAPSED_SCAN_CYCLES Elapsed scan cycles

Real Axis

%SW6004 -- 3002 LDW_STS_REAL_AXIS_STATUS Real axis status (see note)

%SD6008 -- 3004 LDW_STS_REAL_AXIS_VELOCITY Real axis velocity

%SL6024 -- 3012 LDW_STS_REAL_AXIS_POSITION Real axis position

Virtual Axis

%SW6006 -- 3003 LDW_STS_VIRTUAL_AXIS_STATUS Virtual axis status (see note)

%SD6012 -- 3006 LDW_STS_VIRTUAL_AXIS_VELOCITY Virtual axis velocity

%SL6032 -- 3016 LDW_STS_VIRTUAL_AXIS_POSITION Virtual axis position

Current

%SD6016 -- 3008 LDW_STS_MOTOR_CURRENT Motor current

Position in the DI´s transition

%SD6040 -- 3020 LDW_STS_DI1_POSITION_STORED Position stored in the DI1 transition

%SD6048 -- 3024 LDW_STS_DI2_POSITION_STORED Position stored in the DI2 transition

%SD6056 -- 3028 LDW_STS_DI3_POSITION_STORED Position stored in the DI3 transition

Counters

%SD6064 -- 3032 LDW_STS_BUILT_IN_COUNTER Built-in counter value

%SD6068 -- 3034 LDW_STS_BUILT_IN_COUNTER_DI3 Built-in counter stored in the DI3 transition

%SD6072 -- 3036 LDW_STS_ENC1_COUNTER Encoder 1 counter value

%SD6076 -- 3038 LDW_STS_ENC2_COUNTER Encoder 2 counter value

Encoder counter stored in the Z1 transition as defined in


%SD6080 -- 3040 LDW_STS_ENC_COUNTER_Z1
P00511
Encoder counter stored in the Z2 transition as defined in
%SD6084 -- 3042 LDW_STS_ENC_COUNTER_Z2
P00521

CANopen

%SB6100 0 800 CO_STS_MASTER_CONTACTED The CANopen master contacted all the slaves

The CANopen master dow nloaded the configurations of


%SB6100 1 801 CO_STS_MASTER_CONFIG_OK
the slaves
Error control protocol (node guarding/heartbeat) initiated
%SB6100 2 802 CO_STS_MASTER_ERROR_CTRL_OK
w ith the slaves

%SB6100 3 803 CO_STS_MASTER_INIT_FINISHED The CANopen master initialized all the slaves

%SB6100 4 804 CO_STS_MASTER_INIT_ERROR A slave presented an initialization error

The CANopen master detected a fault in a slave through


%SB6100 5 805 CO_STS_MASTER_ERROR_CTRL
the error detection protocol

%SB6100 6 806 CO_STS_MASTER_EMCY A slave reported EMCY

%SB6101 0 808 CO_STS_MASTER_NMT_TOGGLE WPS v2.5X | 697


NMT command toggle bit feedback

%SB6101 5 813 CO_STS_MASTER_BUS_OFF The CANopen master is in bus off


Equipments (Devices)

Writing / Reading System Markers (Command)

Address Bit Modbus Tag Description

CANopen

NMT command transmission by the CANopen master:


%CB6000 -- 3000 CO_CMD_NMT_COMMAND
command code

%CB6001 0 8 CO_CMD_NMT_TOGGLE NMT command transmission by the CANopen master: toggle bit

%CB6001 7 15 CO_CMD_DISABLE Disables the CANopen communication

NMT command transmission by the CANopen master: slave


%CB6002 -- 3001 CO_CMD_NMT_SLAVE_ADDR
address

NOTE!
Below description of the real axis and virtual status:

0. Disabled.
1. Errorstop.
2. Standstill.
3. Stopping.
4. Homing.
5. Continuous Motion.
6. Discrete Motion.
7. Synchronized Motion.

WPS v2.5X | 698


Equipments (Devices)

Note 1: When the drive is in "Stopping" on "Errorstop" every block can be called, but only MC_Reset block is
executed;
Note 2: Attempt to enable the drive, but the drive is in fault;
Note 3: Enabling the drive and the drive is not in fault;
Note 4: MC_Stop.Done is true and MC_Stop.Execute is false;
Note 5: MC_StepDirect, MC_StepRefPulse or MC_FinishHoming.

11.6.3 Oriented Start-Up


The function Oriented Start-Up is utilized to realize the minimal required configuration to put SCA-06 into
operation.

WPS v2.5X | 699


Equipments (Devices)

The Oriented Start-Up can be executed during the resource creation, or throught the context menu off the
resource by selecting the option Oriented Start-Up.

1. On the Start-Up screen the main options that require configuration are the parameters P385 (Servomotor
Model) and P202 (Operation Mode).

WPS v2.5X | 700


Equipments (Devices)

2. According to the operation mode selected the configurator will be adjusted enabling or disabling other
options, below is a example of the options enabled when the operation mode is 5 - CANopen.

3. After the definition of the operation mode and other options, is only necessary to click on Execute Start-Up
, if it is executed properly a message informing success will be displayed otherwise a message informing

WPS v2.5X | 701


Equipments (Devices)

fail will be displayed.

4. After the successfull execution of the Start-Up during the resource creation, the system will enable a step

WPS v2.5X | 702


Equipments (Devices)

named Auto-Tuning in the wizard, this step is up to the user to perform or not.

11.6.4 Auto-Tuning
The function Auto-Tuning is utilized to realize automatic adjusts on SCA-06 to obtain a better performance of
the equipment.

The Auto-Tuning can be executed during the resource creation, or throught the resource context menu by
selecting the option Auto-Tuning.

WPS v2.5X | 703


Equipments (Devices)

1. On the Auto-Tuning screen the options that require configuration are P582 (Rotation Direction) and if the
user program should be stopped before execution and started again after the Auto-Tuning conclusion.

WPS v2.5X | 704


Equipments (Devices)

2. After choosing the options is only necessary to click on Execute Auto-Tuning to start the process that
takes less than a minute. if it is executed properly a message informing success will be displayed
otherwise a message informing fail will be displayed.

11.6.5 Import from WLP


The function import from WLP is utilized to import Ladder developed on WLP software to equipment (device).

The import from WLP can be executed during the resource creation.

WPS v2.5X | 705


Equipments (Devices)

1. To execute the import WLP function click the Import from WLP button and select the WLP project folder or
the WLP BKP file.

WPS v2.5X | 706


Equipments (Devices)

WPS v2.5X | 707


Equipments (Devices)

2. After import from WLP completed successfully click the Finish button to copy the imported files to new
resource.

11.6.8 Cam Profiles


It allows loading and editing the cam table of the CAM curves.
Accessed by the CAM Profile List command with the right button of the mouse in the CAM Profiles folder of
the resource.

WPS v2.5X | 708


Equipments (Devices)

Description

The cam tables from 1 to 10 are tables of fixed points, which are transmitted at the moment of the download of
the application. In order to use the tables 1 to 10, first the MC_CamTableSelect block must be executed with
the desired table and then the MC_CamIn block.
The cam tables 11 to 20 are tables of variable points. In order to use the tables 11 to 20, first the
MC_CamCalc block must be executed with the desired table and then the MC_CamIn block.

For the SCA06 equipment, it is allowed programming at most 200 fixed points and 100 variable points, seeing
that the maximum number of variable points of each table must be configured in the Max Points column, as
shown below:

WPS v2.5X | 709


Equipments (Devices)

In order to edit the cam table, click on the Edit button, and the cam profile editor will open, as in the figure
below:

WPS v2.5X | 710


Equipments (Devices)

This window has the following controls:

Cam table:

NOTE!
The CAM block is always relative, so the first point of the cam table will always be master= 0 and
slave = 0.

Graphic of the profile:

WPS v2.5X | 711


Equipments (Devices)

Graphic control tools:

Values of the cursor:


Values relative to the selected point of the cursor.

Master speed:
Speed used to calculate the speed, acceleration and jerk of the slave.

WPS v2.5X | 712


Equipments (Devices)

NOTE!
The speed, acceleration and jerk of the slave must be used as reference to develop the cam
profile, where they are calculated numerically, not taking into account load, inertia, torque and
dynamics of the drive.

Adding a new point to the cam profile

A point can be added by means of the add or insert point buttons or by double clicking the graphic in the
position where you wish to add the point. You can double click any region of the graphic. In case an
interpolation already exists in this region, the editor will insert this point between the two points of the
interpolation.
The point is always added as linear interpolation.
When a point is added or inserted by means of the respective buttons, the master and slave values come
zeroed. In case of point insertion, that may cause an interruption of the profile, because the master position
must always grow in relation to the origin; therefore, the value of the master and slave must be edited by
clicking on their cells in the cam table.
On the figure below, a point was inserted by double clicking:

In order to change the type of interpolation, click on the type cell in the line corresponding to the origin of the
interpolation and select the desired type.
In the figure below, the point was changed for cubic interpolation.

WPS v2.5X | 713


Equipments (Devices)

Now, in this curve, it is already possible to see other magnitudes besides the position, such as speed,
acceleration and jerk. For a better view of all magnitudes, we can use the Set Zoom All button according to
the figure below.

The same way, we can choose one of the magnitudes and use the Apply Selected Zoom button. In the
example below, a zoom was applied to the speed.

WPS v2.5X | 714


Equipments (Devices)

Another interesting tool is the cursor. In the example below, we will place the cursor in point of maximum
speed.

You must bear in mind that the speed, acceleration and jerk of the slave depend on the master speed;
therefore, it is interesting to change them so as to simulate something really close to the effective values. In
the figure below, the master speed will be changed to 1000 rpm and we will analyze the same position of the
cursor.

WPS v2.5X | 715


Equipments (Devices)

During the project of the cam profile, all those magnitudes must be observed, because they may be
accomplished or not due to mechanical, electrical and electronic limitations of the involved equipment.

Since the acceleration and jerk graphics are calculated taking into account the interpolation between two
points, the acceleration and jerk will be shown as equal to zero in the junctions between linear interpolations.
Although in theory we know that in a speed step the acceleration and jerk are infinite, in practice the
acceleration and jerk at this moment will also depend on the mechanical, electrical and electronic limitations
of the involved equipment. Those speed steps must be observed and considered in the project of the cam
profile. The figure below shows an example of this situation.

The CAM block offers two types of interpolation: linear and cubic. The following equations are used:

Linear:

WPS v2.5X | 716


Equipments (Devices)

Cubic:

where:
pe = slave position
ve = slave speed
ae = slave acceleration
je = slave jerk
pm = master position
vm = master speed
pim = master initial position
pfm = master final position
pie = slave initial position
pfe = slave final position
a = coefficient calculated by the CAM editor
b = coefficient calculated by the CAM editor
c = coefficient calculated by the CAM editor

Changing a point in the cam profile

A point can be changed by means of the cam table by using direct edition or moving the point in the graphic.
In order to move the point in the graphic, place the cursor on the point, which is marked with a red square,
click and hold it, and drag it to the new position.
When you click on the point, the cam table will move to this point, selecting the related cell.
The operation of moving the point in the graphic is interactive and calculates all the profile each time the point
is changed. The new point can be seen in the cam table.

Removing a point from the cam profile

The point is removed directly in the cam table. In order to do so, select one of the cells referring to the point
and click on the Remove Point button.

Zoom of a certain area of the graphic

Click on one of the corners of the region you wish to zoom and hold it, and move the mouse so as to mark a
region. Then a rectangle will show on the graphic; release the button. The figure below shows an example of
this zoom.

WPS v2.5X | 717


Equipments (Devices)

Graphic menu

In order to access the graphic menu, right click on the graphic area, and the following menu will show.

The figure below shows the graphic property box.

WPS v2.5X | 718


Equipments (Devices)

11.6.9 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

WPS v2.5X | 719


Equipments (Devices)

Figure 1: Creating a structure

2. Define the file name and press the Next button.

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

WPS v2.5X | 720


Equipments (Devices)

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

Figure 4: Structure created in the project

WPS v2.5X | 721


Equipments (Devices)

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.7 MW500
11.7.1 Description

The MW500 is a high-performance variable speed drive for controlling three-phase induction motors with
dedicated functions and high degree of protection IP66 / NEMA4X that allow their use in applications requiring
a high level of precision and robustness. In addition, the MW500 has excellent flexibility because it can be
installed directly on the wall or mounted on the motor, reducing costs of wiring and panels.

Refer to the user's manual of the MW500 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.7.2 Parameters
11.7.2.2 Configuration
11.7.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

WPS v2.5X | 722


Equipments (Devices)

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 723


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 724


Equipments (Devices)

11.7.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 725


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 726


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 727


Equipments (Devices)

11.7.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 728


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 729


Equipments (Devices)

WPS v2.5X | 730


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 731


Equipments (Devices)

WPS v2.5X | 732


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 733


Equipments (Devices)

WPS v2.5X | 734


Equipments (Devices)

WPS v2.5X | 735


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 736


Equipments (Devices)

WPS v2.5X | 737


Equipments (Devices)

11.7.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 738


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 739


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.8 PLC300
11.8.1 Description
PLC300 is a PLC with integrated HMI, developed to meet the need of interface with the user on panels and
machines and at the same time a complete expandable PLC, fast and with several communication ports,
enabling the product to be master of CANopen networks (CAN network) and/or Modbus RTU (RS-485 network)

WPS v2.5X | 740


Equipments (Devices)

as well as Modbus TCP (Ethernet network).

Description of the Models

PLC300 is available in six different models. With our without HMI; standard or plus, and a version with HMI,
though without membrane, in which the user can personalize the PLC appearance following specifications
present in the product CD.

The identification of PLC300 is done by a two or three letter suffix. The letters have the following meaning:
H: HMI
B: Blind (without HMI)
P: Plus
S: Standard
C: Custom (without membrane)

Specifications PLC300HP PLC300BP PLC300HS PLC300BS PLC300HPC PLC300HSC


Code WEG 12358193 12358194 12358192 12358195 12358196 12358197
IHM
Membrane
Ethernet
Encoder
Expansion
SD Card
CAN
RS 485
RS 232
USB
PWM Output
Digital I/O
Analog I/O

For further details on the product, refer to PLC300 equipment's user manual.

11.8.2 New Features and Corrections


PLC300 V4.11

New Functions:

ARRAY_COPY block;
SCALE block;
Conversion block MUX2;
Conversion block DEMUX2;
Conversion block BYTES_TO_DWORD;
Conversion block DWORD_TO_BYTES;
Conversion block BYTES_TO_WORD;
Conversion block WORD_TO_BYTES;

WPS v2.5X | 741


Equipments (Devices)

Conversion block WORDS_TO_DWORD;


Conversion block DWORD_TO_WORD;
CALL block;
System markers for accessing the function key LEDs F1...F6;
PID2 block;
IMMEDIATE_OUTPUT block also for the expansion modules;
SWAP2 block.

Corrections of functional deviation:

Status LED: In some undesired situation the Status LED was turning red, overwriting the green LED,
signaling PLC without application or stopped;
Numeric input fix: When using decimal places, it was truncating the value rather than rounding it at CAST
time, and it could change the value entered by the user.

PLC300 V3.41

New Functions:

ARRAY_COPY block;
SCALE block;
Conversion block MUX2;
Conversion block DEMUX2;
Conversion block BYTES_TO_DWORD;
Conversion block DWORD_TO_BYTES;
Conversion block BYTES_TO_WORD;
Conversion block WORD_TO_BYTES;
Conversion block WORDS_TO_DWORD;
Conversion block DWORD_TO_WORD;
CALL block;
System markers for accessing the function key LEDs F1...F6;
PID2 block;
IMMEDIATE_OUTPUT block also for the expansion modules;
SWAP2 block.

Corrections of functional deviation:

Status LED: In some undesired situation the Status LED was turning red, overwriting the green LED,
signaling PLC without application or stopped;
Numeric input fix: When using decimal places, it was truncating the value rather than rounding it at CAST
time, and it could change the value entered by the user.

PLC300 V3.30

New Functions:

Follow CANopen;
"Change of State" log event with variable list;
Ethernet function blocks with 128 bytes of data.

WPS v2.5X | 742


Equipments (Devices)

Corrections of functional deviation:

Inconsistent data on the component "Input text".

PLC300 V3.00

New Functions:

Internal memory increased to 1MB.

Corrections of functional deviation:

After the firmware download the watchdog alarm was activated.

NOTE!
It's strongly recommended to always upgrade the PLC300 firmware to the latest available version.
Hardware version 1 (H1): v1.76 or higher
Hardware version 2 (H2): v2.42 or higher
Hardware version 2 w/ 1MB (H2-1MB): v3.08 or higher

PLC300 V2.40

Corrections of functional deviation:

Locking of Modbus RTU blocks when utilized in USERFB. When disabling USERFB with a Modbus RTU
block activated (which reserves the modbus master resource) other Modbus RTU blocks couldn´t be
executed anymore;
General backup in version 2.3x was presenting problems during the backup of files in SD Card; and
The Watchdog was being activated in some devices during the initialization causing it to stop responding.

NOTE!
It's strongly recommended to always upgrade the PLC300 firmware to the latest available version.
Hardware version 1 (H1): v1.76 or higher
Hardware version 2 (H2): v2.42 or higher
Hardware version 2 w/ 1MB (H2-1MB): v3.08 or higher

PLC300 V2.30

New Functions:

Hot Download: Implementation that allows the realization of hot download on the resource, in other words,
its possible to change the ladder program, screens, alarms and logs with the actual program running and
after the download conclusion the new program is executed automatically;
Watchdog: Implementation of a configurable Watchdog with minimal time of 300ms. The outputs state can
be configure in case of Watchdog, as also one exit for exclusive use;

WPS v2.5X | 743


Equipments (Devices)

Markers for monitoring the maximum and minimum time of scan cycle;
Markers to disable the keys HOME, SETUP and ALARM.

Modification of existing functions:

Encoder default value changed from 12V to 5V.

PLC300 V2.10

New Functions:

Creation of blocks that support Strings:


o STR_COMPARE
o STR_COPY
o STR_COPY_LAST
o STR_DELETE
o STR_FIND
o STR_FIND_LAST
o STR_INSERT
o STR_LENGTH
o STR_REPLACE
o DWORD_TO_STRING
o REAL_TO_STRING
o STRING_TO_DWORD
o STRING_TO_REAL
Creation of block READENC4, reads encoder, calculating the positioning and velocity of the same, allows
use of filter;
External and counting tasks using DI1 to DI8;
Creation of block TRUNC, realizes variable truncation;
Creation of block ROUND, realizes variable rounding;
Increment and decrement of fields "Numeric Input" using direction keys (during field editing);
Log variables of type STRING;
Block STORE with variables of type STRING;
Block SEL with variables of type STRING;
Block ISTORE with variables of type STRING;
Block ILOAD with variables of type STRING;
Use of variables of type STRING in "Text Input" fields;
Creation of structures and recipes with variables of type STRING;

Modification of existing functions

Base address modified from 3000 to 0.

PLC300 V2.00

New Functions:

Creation of block P_RMAP that generates train pulses with frequency in form of "ramp";

WPS v2.5X | 744


Equipments (Devices)

Inputs DI9 and DI10 as encoder inputs;


DI10 can be used as rapid count, and DI9 determines the counting direction;
Change in the analog input 10bits to 12bits;
Automatic recovery (ASR) application, setup, firmware ... through FLASH memory, requiring no more SD
Card for this feature.

PLC300 V1.70

New Functions:

Creation of a "Text Input" component type;


Creation of one new memory area for preserving the variable values during download

NOTE!
It's strongly recommended to always upgrade the PLC300 firmware to the latest available version.
Hardware version 1 (H1): v1.76 or higher
Hardware version 2 (H2): v2.42 or higher
Hardware version 2 w/ 1MB (H2-1MB): v3.08 or higher

PLC300 V1.60

Modification of existing functions

Creation of new instructions for program size and scan cycle reduction

PLC300 V1.50

New Functions:

Status System Markers (%S_):


o STS_ASR_OCC
o STS_INPUT
Command System Markers (%C_):
o RS232_TIMEOUT_MS
o RS232_RX_END_CHARACTER
o RS232_TX_INITIAL_ADDRESS
o RS232_RX_INITIAL_ADDRESS
o RS232_TX_BUFFER_LENGTH
o RS232_MAX_RX_BUFFER_LENGTH
o RS232_ENABLE_END_CHARACTER
o RS232_START_TX
o RS485_TIMEOUT_MS
o RS485_RX_END_CHARACTER
o RS485_TX_INITIAL_ADDRESS
o RS485_RX_INITIAL_ADDRESS
o RS485_TX_BUFFER_LENGTH

WPS v2.5X | 745


Equipments (Devices)

o RS485_MAX_RX_BUFFER_LENGTH
o RS485_ENABLE_END_CHARACTER
o RS485_START_TX
Automatic Software Recovery (ASR) function

Modification of existing functions

Modbus RTU block modification to support reading and writing 16 registers


Modified timer blocks (TON, TOF and TP) with adjustable time base (milliseconds centisegundos, minutes
and seconds)
Increased capacity of the amount of user screens

PLC300 V1.40

New Functions:

Status System Markers (%S_):


o KEY_NUMERIC
o KEY_HOME
o KEY_ESC
o KEY_DEL
o KEY_ALARM
o KEY_SETUP
o KEY_SHIFT
o KEY_UP
o KEY_DOWN
o KEY_LEFT
o KEY_RIGHT
o KEY_ENTER
o KEY_F1 ... KEY_F12
Program upload
Force I/O
English language on the PLC300
Presentation of variables on alarm screens
Leading zeros in the "Numeric Input" and "Numeric Output" fields on the user’s screens
Download option:
o Initialize output and volatile variables
o Stop/Start the execution of the program automatically
Password-protected commands for recording and loading setup and firmware files on the SD card.

PLC300 V1.30

New Functions:

Status System Markers (%S_):


o BOOTLOADER
o INTERVAL_TASK9_WATCHDOG ... INTERVAL_TASK16_WATCHDOG
o SINGLE_TASK9_WATCHDOG ... SINGLE_TASK16_WATCHDOG

WPS v2.5X | 746


Equipments (Devices)

o COUNT_TASK9_WATCHDOG ... COUNT_TASK16_WATCHDOG


o STS_SD_INVALID
Command System Markers (%C_):
o INTERVAL_TASK9_DISABLE ... INTERVAL_TASK16_DISABLE
o SINGLE_TASK9_DISABLE ... SINGLE_TASK16_DISABLE
o COUNT_TASK9_DISABLE ... COUNT_TASK9_DISABLE
Modbus TCP Blocks
o MBTCP_ReadBinary
o MBTCP_WriteBinary
o MBTCP_ReadRegister
o MBTCP_WriteRegister
o MBTCP_ServerStatus
o MBTCP_ClientControlStatus
New Data Transfer Blocks (Recipes)
o ReadRecipe
o WriteRecipe
Log of
o Alarms
o Events
Backup in the SD Card of
o Firmware
o Resource
o Setup
Ethernet
o WPS gateway connection with the PLC300

PLC300 V1.20

New Functions:

Tasks
o INTERVAL
o SINGLE
o EXTERN EVENT (DI9, DI10 and Z pulse)
o COUNT (DI9, DI10, A, B, Z pulses and quadrature AB)
o SYSTEM (start and stop)
Status System Markers (%S_)
o TICK_100US
o INTERVAL_TASK1_WATCHDOG...INTERVAL_TASK8_WATCHDOG
o SINGLE_TASK1_WATCHDOG...SINGLE_TASK8_WATCHDOG
o EXT_EVENT_TASK1_WATCHDOG...EXT_EVENT_TASK3_WATCHDOG
o COUNT_TASK1_WATCHDOG...COUNT_TASK8_WATCHDOG
o MAIN_TASK_WATCHDOG
o START_TASK_WATCHDOG
o STOP_TASK_WATCHDOG
Command System Markers (%C_)
o INTERVAL_TASK1_DISABLE...INTERVAL_TASK8_DISABLE
o SINGLE_TASK1_DISABLE...SINGLE_TASK8_DISABLE
o EXT_EVENT_TASK1_WATCHDOG...EXT_EVENT_TASK3_WATCHDOG

WPS v2.5X | 747


Equipments (Devices)

o COUNT_TASK1_DISABLE...COUNT_TASK8_DISABLE
Hardware Blocks
o IMMEDIATEINPUT
o IMMEDIATEOUTPUT
o READENC3
Coil Block
o IMMEDIATECOIL

Modification of existing functions

Options to initialize or not the retentive variables and alarm history in the download.
PWM Block - frequency value of 0 Hz allowed
ReadEnc and ReadEnc2 Blocks - Value Data Type can be DINT when the counted pulses are
Quadrature_AB, allowing negative values according to the rotation direction of the encoder.

Corrections of functional deviation

MB_WriteBinary Block - in previous versions, the block always wrote the value 1.
Variable addresses modified for access via Modbus.

PLC300 Versions previous to V1.20

We recommend to update the firmware.

PLC300 V1.10

New Functions:

ASCII RS232 Protocol

PLC300 V1.00

Initial version.

11.8.3 I/O's
Hardware information can be found in the Manual of the PLC300 at the website www.weg.net.

Digital Inputs

Address Bit Modbus Tag Description


%IB0 0 16000 DI1 Digital input 1
%IB0 1 16001 DI2 Digital input 2
%IB0 2 16002 DI3 Digital input 3

WPS v2.5X | 748


Equipments (Devices)

%IB0 3 16003 DI4 Digital input 4


%IB0 4 16004 DI5 Digital input 5
%IB0 5 16005 DI6 Digital input 6
%IB0 6 16006 DI7 Digital input 7
%IB0 7 16007 DI8 Digital input 8
%IB1 0 16008 DI9 Digital input 9
%IB1 1 16009 DI10 Digital input 10
%IB2 0 16016 DI101 Digital input 1 - Slot 1
%IB2 1 16017 DI102 Digital input 2 - Slot 1
%IB2 2 16018 DI103 Digital input 3 - Slot 1
%IB2 3 16019 DI104 Digital input 4 - Slot 1
%IB2 4 16020 DI105 Digital input 5 - Slot 1
%IB2 5 16021 DI106 Digital input 6 - Slot 1
%IB2 6 16022 DI107 Digital input 7 - Slot 1
%IB2 7 16023 DI108 Digital input 8 - Slot 1
%IB3 0 16024 DI109 Digital input 9 - Slot 1
%IB3 1 16025 DI110 Digital input 10 - Slot 1
%IB3 2 16026 DI111 Digital input 11 - Slot 1
%IB3 3 16027 DI112 Digital input 12 - Slot 1
%IB3 4 16028 DI113 Digital input 13 - Slot 1
%IB3 5 16029 DI114 Digital input 14 - Slot 1
%IB3 6 16030 DI115 Digital input 15 - Slot 1
%IB3 7 16031 DI116 Digital input 16 - Slot 1
%IB4 0 16032 DI201 Digital input 1 - Slot 2
%IB4 1 16033 DI202 Digital input 2 - Slot 2
%IB4 2 16034 DI203 Digital input 3 - Slot 2
%IB4 3 16035 DI204 Digital input 4 - Slot 2
%IB4 4 16036 DI205 Digital input 5 - Slot 2
%IB4 5 16037 DI206 Digital input 6 - Slot 2
%IB4 6 16038 DI207 Digital input 7 - Slot 2
%IB4 7 16039 DI208 Digital input 8 - Slot 2
%IB5 0 16040 DI209 Digital input 9 - Slot 2
%IB5 1 16041 DI210 Digital input 10 - Slot 2
%IB5 2 16042 DI211 Digital input 11 - Slot 2
%IB5 3 16043 DI212 Digital input 12 - Slot 2
%IB5 4 16044 DI213 Digital input 13 - Slot 2
%IB5 5 16045 DI214 Digital input 14 - Slot 2
%IB5 6 16046 DI215 Digital input 15 - Slot 2
%IB5 7 16047 DI216 Digital input 16 - Slot 2

Analog Inputs

WPS v2.5X | 749


Equipments (Devices)

Address Bit Modbus Tag Description


%IW6 -- 5003 AI1 Analog input 1
%IW8 -- 5004 AI101 Analog input 1 - Slot 1
%IW10 -- 5005 AI102 Analog input 2 - Slot 1
%IW12 -- 5006 AI103 Analog input 3 - Slot 1
%IW14 -- 5007 AI104 Analog input 4 - Slot 1
%IW16 -- 5008 AI105 Analog input 5 - Slot 1
%IW18 -- 5009 AI201 Analog input 1 - Slot 2
%IW20 -- 5010 AI202 Analog input 2 - Slot 2
%IW22 -- 5011 AI203 Analog input 3 - Slot 2
%IW24 -- 5012 AI204 Analog input 4 - Slot 2
%IW26 -- 5013 AI205 Analog input 5 - Slot 2

Digital Outputs

WPS v2.5X | 750


Equipments (Devices)

Address Bit Modbus Tag Description


%QB0 0 16000 DO1 Digital output 1
%QB0 1 16001 DO2 Digital output 2
%QB0 2 16002 DO3 Digital output 3
%QB0 3 16003 DO4 Digital output 4
%QB0 4 16004 DO5 Digital output 5
%QB0 5 16005 DO6 Digital output 6
%QB0 6 16006 DO7 Digital output 7
%QB0 7 16007 DO8 Digital output 8
%QB1 0 16008 DO9 Digital output 9
%QB2 0 16016 DO101 Digital output 1 - Slot 1
%QB2 1 16017 DO102 Digital output 2 - Slot 1
%QB2 2 16018 DO103 Digital output 3 - Slot 1
%QB2 3 16019 DO104 Digital output 4 - Slot 1
%QB2 4 16020 DO105 Digital output 5 - Slot 1
%QB2 5 16021 DO106 Digital output 6 - Slot 1
%QB2 6 16022 DO107 Digital output 7 - Slot 1
%QB2 7 16023 DO108 Digital output 8 - Slot 1
%QB3 0 16024 DO109 Digital output 9 - Slot 1
%QB3 1 16025 DO110 Digital output 10 - Slot 1
%QB3 2 16026 DO111 Digital output 11 - Slot 1
%QB3 3 16027 DO112 Digital output 12 - Slot 1
%QB3 4 16028 DO113 Digital output 13 - Slot 1
%QB3 5 16029 DO114 Digital output 14 - Slot 1
%QB3 6 16030 DO115 Digital output 15 - Slot 1
%QB3 7 16031 DO116 Digital output 16 - Slot 1
%QB4 0 16032 DO201 Digital output 1 - Slot 2
%QB4 1 16033 DO202 Digital output 2 - Slot 2
%QB4 2 16034 DO203 Digital output 3 - Slot 2
%QB4 3 16035 DO204 Digital output 4 - Slot 2
%QB4 4 16036 DO205 Digital output 5 - Slot 2
%QB4 5 16037 DO206 Digital output 6 - Slot 2
%QB4 6 16038 DO207 Digital output 7 - Slot 2
%QB4 7 16039 DO208 Digital output 8 - Slot 2
%QB5 0 16040 DO209 Digital output 9 - Slot 2
%QB5 1 16041 DO210 Digital output 10 - Slot 2
%QB5 2 16042 DO211 Digital output 11 - Slot 2
%QB5 3 16043 DO212 Digital output 12 - Slot 2
%QB5 4 16044 DOI13 Digital output 13 - Slot 2
%QB5 5 16045 DO214 Digital output 14 - Slot 2
%QB5 6 16046 DO215 Digital output 15 - Slot 2
%QB5 7 16047 DO216 Digital output 16 - Slot 2

WPS v2.5X | 751


Equipments (Devices)

Analog Outputs

Address Bit Modbus Tag Description


%QW6 -- 5003 AO1 Analog output 1
%QW8 -- 5004 AO101 Analog output 1 - Slot 1
%QW10 -- 5005 AO102 Analog output 2 - Slot 1
%QW12 -- 5006 AO201 Analog output 1 - Slot 2
%QW14 -- 5007 AO202 Analog output 2 - Slot 2

11.8.4 System Markers


The following variables contained in the GLOBAL_SYSTEM group of the variables table, have the fixed tag.

Some markers of the BYTE type (%SB or %CB) are allocated in the same modbus address for registers. In
this case:
(L): indicates that it is the least significant byte of the WORD;
(H): indicates that it is the most significant byte of the WORD;

NOTE!
The base address was modified from 3000 to 0 in firmware version 2.10.

Reading System Markers (Status)

Address Bit Modbus Tag Description


Ladder
%SB0004 0 32 FALSE Alw ays in 0
%SB0004 1 33 TRUE Alw ays in 1
%SB0004 2 34 FREQ_2HZ Oscillator 2Hz
%SB0004 3 35 PULSE_1SCAN Pulse during the first scan cycle
%SB0004 4 36 ENC_DIR Encoder speed direction (0-Clockw ise, 1-Anticlockw ise)
PLC300 Status
%SW0000 -- 3000 FIRMWARE Firmw are version
%SW0002 -- 3001 SCAN_CICLE Scan cycle time
%SB0006 0 48 STS_BAT Low battery
%SB0006 1 49 STS_DOS Digital output fault
%SB0006 2 50 STS_ENC Encoder fault
%SB0006 3 51 STS_AI1 Analog input 1 break detected
%SB0006 4 52 STS_SD_INVALID SD card missing or invalid
%SB0006 4 53 STS_DOS_SLOT1 Digital output slot 1 error
%SB0006 5 54 STS_DOS_SLOT2 Digital output slot 2 error
%SB0006 6 55 STS_ASR_OCC Automatic Softw are Recovery (ASR) occurred
%SD0008 -- 3004 ENC_FREQ Encoder frequency

WPS v2.5X | 752


Equipments (Devices)

%SD0012 -- 3006 TICK_100US Marker increased every 100us


%SW0016 -- 3008 BOOTLOADER Module Version Upgrade Firmw are
%SB0540 0 3270 WATCHDOG_OCC Watchdog occured
%SW0542 -- 3271 WATCHDOG_DATE Watchdog date
%SD0556 -- 3278 WATCHDOG_CODE Watchdog code
HMI Keys and Screen
%SB0020 -- 3010 SCREEN Actual screen
%SB0022 -- 3011 KEY_NUMERIC ASCII code of numeric key
%SB0024 0 192 KEY_HOME HOME key pressed
%SB0024 1 193 KEY_ESC ESC key pressed
%SB0024 2 194 KEY_DEL DEL key pressed
%SB0024 3 195 KEY_ALARM ALARM key pressed
%SB0024 4 196 KEY_SETUP SETUP key pressed
%SB0024 5 197 KEY_SHIFT SHIFT key pressed
%SB0024 6 198 KEY_UP UP key pressed
%SB0024 7 199 KEY_DOWN DOWN key pressed
%SB0025 0 200 KEY_LEFT LEFT key pressed
%SB0025 1 201 KEY_RIGHT RIGHT key pressed
%SB0025 2 202 KEY_ENTER ENTER key pressed
%SB0025 3 203 STS_INPUT Editing element 'Numeric Input' on screen
%SB0026 0 208 KEY_F1 F1 key pressed
%SB0026 1 209 KEY_F2 F2 key pressed
%SB0026 2 210 KEY_F3 F3 key pressed
%SB0026 3 2011 KEY_F4 F4 key pressed
%SB0026 4 212 KEY_F5 F5 key pressed
%SB0026 5 213 KEY_F6 F6 key pressed
%SB0026 6 214 KEY_F7 F7 key pressed
%SB0026 7 215 KEY_F8 F8 key pressed
%SB0027 0 216 KEY_F9 F9 key pressed
%SB0027 1 217 KEY_F10 F10 key pressed
%SB0027 2 218 KEY_F11 F11 key pressed
%SB0027 3 219 KEY_F12 F12 key pressed
Real Time Clock (RTC)
%SW0030 -- 3015 HOUR Real time clock hour
%SW0032 -- 3016 MINUTE Real time clock minute
%SW0034 -- 3017 SECOND Real time clock second
%SW0036 -- 3018 DAY Real time clock day
%SW0038 -- 3019 MONTH Real time clock month
%SW0040 -- 3020 YEAR Real time clock year
%SW0042 -- 3021 WEEKDAY Weekday (0-Sunday, 1-Monday ... 6-Saturday)
Task Watchdog
%SB0050 0 400 INTERVAL_TASK1_WATCHDOG Time task 1 w atchdog

WPS v2.5X | 753


Equipments (Devices)

%SB0050 1 401 INTERVAL_TASK2_WATCHDOG Time task 2 w atchdog


%SB0050 2 402 INTERVAL_TASK3_WATCHDOG Time task 3 w atchdog
%SB0050 3 403 INTERVAL_TASK4_WATCHDOG Time task 4 w atchdog
%SB0050 4 404 INTERVAL_TASK5_WATCHDOG Time task 5 w atchdog
%SB0050 5 405 INTERVAL_TASK6_WATCHDOG Time task 6 w atchdog
%SB0050 6 406 INTERVAL_TASK7_WATCHDOG Time task 7 w atchdog
%SB0050 7 407 INTERVAL_TASK8_WATCHDOG Time task 8 w atchdog
%SB0051 0 408 INTERVAL_TASK9_WATCHDOG Time task 9 w atchdog
%SB0051 1 409 INTERVAL_TASK10_WATCHDOG Time task 10 w atchdog
%SB0051 2 410 INTERVAL_TASK11_WATCHDOG Time task 11 w atchdog
%SB0051 3 411 INTERVAL_TASK12_WATCHDOG Time task 12 w atchdog
%SB0051 4 412 INTERVAL_TASK13_WATCHDOG Time task 13 w atchdog
%SB0051 5 413 INTERVAL_TASK14_WATCHDOG Time task 14 w atchdog
%SB0051 6 414 INTERVAL_TASK15_WATCHDOG Time task 15 w atchdog
%SB0051 7 415 INTERVAL_TASK16_WATCHDOG Time task 16 w atchdog
%SB0052 0 416 SINGLE_TASK1_WATCHDOG Event task 1 w atchdog
%SB0052 1 417 SINGLE_TASK2_WATCHDOG Event task 2 w atchdog
%SB0052 2 418 SINGLE_TASK3_WATCHDOG Event task 3 w atchdog
%SB0052 3 419 SINGLE_TASK4_WATCHDOG Event task 4 w atchdog
%SB0052 4 420 SINGLE_TASK5_WATCHDOG Event task 5 w atchdog
%SB0052 5 421 SINGLE_TASK6_WATCHDOG Event task 6 w atchdog
%SB0052 6 422 SINGLE_TASK7_WATCHDOG Event task 7 w atchdog
%SB0052 7 423 SINGLE_TASK8_WATCHDOG Event task 8 w atchdog
%SB0053 0 424 SINGLE_TASK9_WATCHDOG Event task 9 w atchdog
%SB0053 1 425 SINGLE_TASK10_WATCHDOG Event task 10 w atchdog
%SB0053 2 426 SINGLE_TASK11_WATCHDOG Event task 11 w atchdog
%SB0053 3 427 SINGLE_TASK12_WATCHDOG Event task 12 w atchdog
%SB0053 4 428 SINGLE_TASK13_WATCHDOG Event task 13 w atchdog
%SB0053 5 429 SINGLE_TASK14_WATCHDOG Event task 14 w atchdog
%SB0053 6 430 SINGLE_TASK15_WATCHDOG Event task 15 w atchdog
%SB0053 7 431 SINGLE_TASK16_WATCHDOG Event task 16 w atchdog
%SB0054 0 3027 EXT_EVENT_TASK1_WATCHDOG External event 1 task w atchdog
%SB0054 1 3027 EXT_EVENT_TASK2_WATCHDOG External event 2 task w atchdog
%SB0054 2 3027 EXT_EVENT_TASK3_WATCHDOG External event 3 task w atchdog
%SB0056 0 3028 COUNT_TASK1_WATCHDOG Count task 1 w atchdog
%SB0056 1 3028 COUNT_TASK2_WATCHDOG Count task 2 w atchdog
%SB0056 2 3028 COUNT_TASK3_WATCHDOG Count task 3 w atchdog
%SB0056 3 3028 COUNT_TASK4_WATCHDOG Count task 4 w atchdog
%SB0056 4 3028 COUNT_TASK5_WATCHDOG Count task 5 w atchdog
%SB0056 5 3028 COUNT_TASK6_WATCHDOG Count task 6 w atchdog
%SB0056 6 3028 COUNT_TASK7_WATCHDOG Count task 7 w atchdog
%SB0056 7 3028 COUNT_TASK8_WATCHDOG Count task 8 w atchdog

WPS v2.5X | 754


Equipments (Devices)

%SB0057 0 3028 COUNT_TASK9_WATCHDOG Count task 9 w atchdog


%SB0057 1 3028 COUNT_TASK10_WATCHDOG Count task 10 w atchdog
%SB0057 2 3028 COUNT_TASK11_WATCHDOG Count task 11 w atchdog
%SB0057 3 3028 COUNT_TASK12_WATCHDOG Count task 12 w atchdog
%SB0057 4 3028 COUNT_TASK13_WATCHDOG Count task 13 w atchdog
%SB0057 5 3028 COUNT_TASK14_WATCHDOG Count task 14 w atchdog
%SB0057 6 3028 COUNT_TASK15_WATCHDOG Count task 15 w atchdog
%SB0057 7 3028 COUNT_TASK16_WATCHDOG Count task 16 w atchdog
%SB0058 0 3029 MAIN_TASK_WATCHDOG Main task w atchdog
%SB0058 1 3029 START_TASK_WATCHDOG System start task w atchdog
%SB0058 2 3029 STOP_TASK_WATCHDOG System stop task w atchdog
RS232
%SW0068 -- 3034 RS232_TX_TELEGRAM_COUNTER Sent telegrams counter
%SW0070 -- 3035 RS232_RX_TELEGRAM_COUNTER Received telegrams counter
%SW0072 -- 3036 RS232_RX_BYTE_COUNTER Counter of received bytes for each telegram
%SB0078 0 624 RS232_TIMEOUT Response timeout
%SB0078 1 625 RS232_RX_TELEGRAM_FINISHED Telegram received
%SB0078 2 626 RS232_TX_TELEGRAM_FINISHED Telegram sent
%SB0114 0 912 RS232_RX_FINISHED ASCII reception finished
RS485
%SW0084 -- 3042 RS485_TX_TELEGRAM_COUNTER Sent telegrams counter
%SW0086 -- 3043 RS485_RX_TELEGRAM_COUNTER Received telegrams counter
%SW0088 -- 3044 RS485_RX_BYTE_COUNTER Counter of received bytes for each telegram
%SB0094 0 752 RS485_TIMEOUT Response timeout
%SB0094 1 753 RS485_RX_TELEGRAM_FINISHED Telegram received
%SB0094 2 754 RS485_TX_TELEGRAM_FINISHED Telegram transmitted
Modbus RTU
%SB0100 -- 3050 MBUS_INTERFACE_DISABLED Interface Modbus RTU Master disabled.
%SW0102 -- 3051 MBUS_REQUEST_COUNT Counter requests made by the Master Modbus RTU
Counter of successful responses received by the
%SW0104 -- 3052 MBUS_RESPONSE_COUNT
Modbus master
Counter of requests w ithout answ er received by the
%SW0106 -- 3053 MBUS_NO_ANSWER_COUNT
master (timeout)
Counter error responses received by the Modbus RTU
%SW0108 -- 3054 MBUS_RESP_ERROR_COUNT
Master
%SB0110 -- 3055 (L) MBUS_LAST_ERROR_ADDR Last error detected: Modbus RTU slave address
%SB0111 -- 3055 (H) MBUS_LAST_ERROR_TYPE Last detected error: error type
%SB0112 -- 3056 MBUS_LAST_ERROR_CODE Last detected error: error code
Counter telegrams received successfully by PLC300 as
%SW0120 -- 3060 MBUS_SLAVE_REQUEST_COUNT
Modbus RTU slave
Response Counter transmitted successfully by PLC300
%SW0122 -- 3061 MBUS_SLAVE_RESPONSE_COUNT
as Modbus RTU slave
CAN
%SB0150 -- 3075 CAN_STATUS CAN interface status

WPS v2.5X | 755


Equipments (Devices)

%SB0151 0 1208 CAN_BUS_POWER CAN bus pow er supply


%SW0152 -- 3076 CAN_RX_COUNTER Received CAN telegram counter
%SW0154 -- 3077 CAN_TX_COUNTER Transmitted CAN telegram counter
%SW0156 -- 3078 CAN_BUS_OFF_COUNTER Detected buss off error counter
%SW0158 -- 3079 CAN_OVERRUN_COUNTER Lost (overrun) CAN telegram counter
CANopen
%SB0180 -- 3090 (L) CO_STATUS CANopen communication status
CANopen node status (pre-operational, operational,
%SB0181 -- 3090 (H) CO_NODE_STATE
stopped)
%SB0200 0 1600 CO_STS_MASTER_CONTACTED The CANopen master contacted all the slaves
The CANopen master dow nloaded the configurations of
%SB0200 1 1601 CO_STS_MASTER_CONFIG_OK
the slaves
Error control protocol (node guarding/heartbeat) initiated
%SB0200 2 1602 CO_STS_MASTER_ERROR_CTRL_OK
w ith the slaves
%SB0200 3 1603 CO_STS_MASTER_INIT_FINISHED The CANopen master initialized all the slaves
%SB0200 4 1604 CO_STS_MASTER_INIT_ERROR A slave presented an initialization error
The CANopen master detected a fault in a slave through
%SB0200 5 1605 CO_STS_MASTER_ERROR_CTRL
the error detection protocol
%SB0200 6 1606 CO_STS_MASTER_EMCY A slave reported EMCY
%SB0201 0 1608 CO_STS_MASTER_NMT_TOGGLE NMT command toggle bit feedback
%SB0206 5 1613 CO_STS_MASTER_BUS_OFF The CANopen master is in bus off
The CANopen master has no pow er supply at the CAN
%SB0201 6 1614 CO_STS_MASTER_POWER_OFF
interface
%SB0201 7 1615 CO_STS_MASTER_COMM_DISABLED Disabled CANopen master communication
The CANopen master successfully contacted the slave
%SB0202 0 1616 CO_STS_SLAVE1_CONTACTED
in the indicated address
%SB0202 1 1617 CO_STS_SLAVE1_CONFIG_OK The CANopen master successfully configured the slave
Error control protocol (node guarding/heartbeat) initiated
%SB0202 2 1618 CO_STS_SLAVE1_ERROR_CTRL_OK
w ith the slave
%SB0202 3 1619 CO_STS_SLAVE1_INIT_FINISHED Concluded slave initialization
%SB0202 4 1620 CO_STS_SLAVE1_INIT_ERROR Initialization error in the indicated address slave
Fault detected in some slave from the CANopen master
%SB0202 5 1621 CO_STS_SLAVE1_ERROR_CTRL_FAIL
error detection protocol
%SB0202 6 1632 CO_STS_SLAVE1_EMCY The slave in the indicated address reported EMCY error
The CANopen master successfully contacted the slave
%SB0204 0 1633 CO_STS_SLAVE2_CONTACTED
in the indicated address
%SB0204 1 1634 CO_STS_SLAVE2_CONFIG_OK The CANopen master successfully configured the slave
Error control protocol (node guarding/heartbeat) initiated
%SB0204 2 1635 CO_STS_SLAVE2_ERROR_CTRL_OK
w ith the slave
%SB0204 3 1636 CO_STS_SLAVE2_INIT_FINISHED Concluded slave initialization
%SB0204 4 1637 CO_STS_SLAVE2_INIT_ERROR Initialization error in the indicated address slave
Fault detected in some slave from the CANopen master
%SB0204 5 1638 CO_STS_SLAVE2_ERROR_CTRL_FAIL
error detection protocol
%SB0204 6 1639 CO_STS_SLAVE2_EMCY The slave in the indicated address reported EMCY error
... ... ... ...
%SB0454 0 3632 CO_STS_SLAVE127_CONTACTED The CANopen master successfully contacted the slave

WPS v2.5X | 756


Equipments (Devices)

in the indicated address


%SB0454 1 3633 CO_STS_SLAVE127_CONFIG_OK The CANopen master successfully configured the slave
Error control protocol (node guarding/heartbeat) initiated
%SB0454 2 3634 CO_STS_SLAVE127_ERROR_CTRL_OK
w ith the slave
%SB0454 3 3635 CO_STS_SLAVE127_INIT_FINISHED Concluded slave initialization
%SB0454 4 3636 CO_STS_SLAVE127_INIT_ERROR Initialization error in the indicated address slave
Fault detected in some slave from the CANopen master
%SB0454 5 3637 CO_STS_SLAVE127_ERROR_CTRL_FAIL
error detection protocol
%SB0454 6 3638 CO_STS_SLAVE127_EMCY The slave in the indicated address reported EMCY error
SDO error: address of the slave w ith the last detected
%SW0460 -- 3230 CO_SDO_ERROR_NODE_ID
SDO error
%SW0462 -- 3231 CO_SDO_ERROR_OBJECT_INDEX SDO error: object index
%SW0464 -- 3232 CO_SDO_ERROR_OBJECT_SUBINDEX SDO error: object sub-index
%SW0466 -- 3233 CO_SDO_ERROR_FUNCTION SDO error: function (w riting/reading)
%SW0468 -- 3234 CO_SDO_ERROR_VALUE SDO error: value
%SW0472 -- 3236 CO_SDO_ERROR_CODE SDO error: error code
%SW0480 -- 3240 CO_EMCY_SLAVE_ID Last reported EMCY: slave address
%SW0482 -- 3241 CO_EMCY_DATA Last reported EMCY: object data
Ethernet
%SB0492 -- 3246 ETH_MAC[6] Physical Address
%SB0498 -- 3249 ETH_STS_SPD_DUP Ethernet Communication Mode
%SD0500 -- 3250 ETH_STS_IP IP address
%SD0504 -- 3252 ETH_STS_MASK Subnet Mask
%SD0508 -- 3254 ETH_STS_GW Default gatew ay
Modbus TCP
Counter of successful telegrams received by the
%SW0512 -- 3256 MBTCP_SERVER_REQUEST_COUNT
PLC300 as Modbus TCP server
Counter of successful telegrams received by the
%SW0514 -- 3257 MBTCP_SERVER_RESPONSE_COUNT
PLC300 as Modbus TCP server
%SW0516 -- 3258 MBTCP_SERVER_CNXNS Number of Modbus TCP server connections active
%SB0520 -- 3260 MBTCP_CLIENT_DISABLED Disabled Modbus TCP client
%SW0522 -- 3261 MBTCP_REQUEST_COUNT Counter of the requests done by the Modbus TCP client
Counter of successful responses received by the
%SW0524 -- 3262 MBTCP_RESPONSE_COUNT
Modbus TCP client
Counter of requests w ithout answ er received by the
%SW0526 -- 3263 MBTCP_NO_ANSWER_COUNT
client (timeout)
Counter of error responses received by the Modbus
%SW0528 -- 3264 MBTCP_RESP_ERROR_COUNT
TCP client
%SW0530 -- 3265 MBTCP_LAST_ERROR_TCP_PORT Last detected error: Modbus TCP server TCP port
%SD0532 -- 3266 MBTCP_LAST_ERROR_IP Last detected error: Modbus TCP server IP address
%SB0536 -- 3268 (L) MBTCP_LAST_ERROR_UNITID Last detected error: Modbus TCP server Unit ID
%SB0537 -- 3268 (H) MBTCP_LAST_ERROR_TYPE Last detected error: error type
%SB0538 -- 3269 MBTCP_LAST_ERROR_CODE Last detected error: error code

WPS v2.5X | 757


Equipments (Devices)

Writing / Reading System Markers (Command)

WPS v2.5X | 758


Equipments (Devices)

Address Bit Modbus Tag Description


PLC300
%CB0000 0 0 ERASE_RET Erase retain markers
%CB0000 1 2 CLEAR_ENC_ALARM Clear encoder fault alarm
%CB0000 2 3 BUZZER_ACTIVE Buzzer active
Real Time Clock (RTC)
%CW0030 -- 3015 WR_HOUR Write real time clock hour
%CW0032 -- 3016 WR_MINUTE Write real time clock minute
%CW0034 -- 3017 WR_SECOND Write real time clock seconds
%CW0036 -- 3018 WR_DAY Write real time clock day
%CW0038 -- 3019 WR_MONTH Write real time clock month
%CW0040 -- 3020 WR_YEAR Write real time clock year
CAN
%CB0052 -- 3026 CAN_ADDRESS PLC300 address for CAN interface
%CB0055 -- 3027 CAN_BAUDRATE CAN interface baud rate
RS232
%CB0061 -- 3030 RS232_MODE RS232 interface operation mode: 0=Modbus RTU 2=ASCII
%CB0062 -- 3031 (L) RS232_BYTE_FORMAT RS232 interface parity and stop bits
%CB0063 -- 3031 (H) RS232_BAUDRATE RS232 interface baud rate
%CB0114 0 912 RS232_RX_CLEAR Start new ASCII reception
%CB0124 -- 3062 RS232_ASCII_STRING ASCII reception buffer
%CB0124 -- 3062 RS232_ASCII_BYTEBUFFER ASCII reception buffer
RS485
%CB0068 -- 3034 (L) RS485_ADDRESS PLC300 address for RS485 interface
%CB0069 -- 3034 (H) RS485_MODE RS485 interface operation mode (master or slave)
%CB0070 -- 3035 (L) RS485_BYTE_FORMAT RS485 interface parity and stop bits
%CB0071 -- 3035 (H) RS485_BAUDRATE RS485 interface baud rate
Modbus RTU
%CW0100 -- 3050 MBUS_DISABLE_COMM Disable Interface Modbus RTU Master
CANopen
NMT command transmission by the CANopen master: command
%CB0120 -- 3060 CO_NMT_COMMAND
code
%CB0121 0 968 CO_NMT_TOGGLE NMT command transmission by the CANopen master: toggle bit
%CB0121 7 975 CO_DISABLE Disables the CANopen communication
NMT command transmission by the CANopen master: slave
%CB0122 -- 3061 CO_NMT_SLAVE_ADDR
address
Time, event and count task
%CB0400 0 3200 INTERVAL_TASK1_DISABLE Disable time task 1
%CB0400 1 3201 INTERVAL_TASK2_DISABLE Disable time task 2
%CB0400 2 3202 INTERVAL_TASK3_DISABLE Disable time task 3
%CB0400 3 3203 INTERVAL_TASK4_DISABLE Disable time task 4
%CB0400 4 3204 INTERVAL_TASK5_DISABLE Disable time task 5
%CB0400 5 3205 INTERVAL_TASK6_DISABLE Disable time task 6
%CB0400 6 3206 INTERVAL_TASK7_DISABLE Disable time task 7
%CB0400 7 3207 INTERVAL_TASK8_DISABLE Disable time task 8
%CB0401 0 3208 INTERVAL_TASK9_DISABLE Disable time task 9
%CB0401 1 3209 INTERVAL_TASK10_DISABLE Disable time task 10
%CB0401 2 3210 INTERVAL_TASK11_DISABLE Disable time task 11 WPS v2.5X | 759
%CB0401 3 3211 INTERVAL_TASK12_DISABLE Disable time task 12
Equipments (Devices)

11.8.5 Ladder
11.8.5.1 Coil
11.8.5.1.1 DIRECTCOIL
Logical block used to assign direct values of the output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

WPS v2.5X | 760


Equipments (Devices)

The above example keeps the digital output DO9 permanently connected, because the value of A in
this case is the value of the left bus which is always considered high logic level (TRUE).

11.8.5.1.2 IMMEDIATECOIL
Logical block used for assigning values to standard digital outputs instantly.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the digital output corresponding to O1.
Unlike the direct coil, this block does not wait until the end of the scan cycle so that the output value
is updated; this is done at the same time the block is activated.

NOTE!
This block only works with standard digital outputs of the product.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Diagram

Block Flowchart

WPS v2.5X | 761


Equipments (Devices)

Example

The above example immediately activates the internal buzzer when it detects that the power of the
CANopen bus was stopped and remains on until the power is restored.

11.8.5.1.3 INVERTEDCOIL
Logical block used for assigning values denied to output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the denied value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

WPS v2.5X | 762


Equipments (Devices)

Example

The above example disables the digital output DO3 when some of the digital inputs DI1 and DI2 are
with FALSE value. When both inputs are with a TRUE value, DO3 activates.

11.8.5.1.4 RESETCOIL
Logical block used for indefinite disabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers a FALSE value to the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

WPS v2.5X | 763


Equipments (Devices)

Block Flowchart

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI5.

11.8.5.1.5 SETCOIL
Logical block used for indefinite enabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

WPS v2.5X | 764


Equipments (Devices)

When identifying a TRUE value in A, this block transfers the value of A for the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI6.

11.8.5.1.6 TOGGLECOIL
Logical block used for output variables alternance.

Ladder Representation

Block Structure

WPS v2.5X | 765


Equipments (Devices)

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output
VAR TOGGLECOIL_INST_0 TOGGLECOIL Instance of access to block structure

Operation

When identifying a transition from FALSE to TRUE (leading edge) on A, the block reverses the status
of O1.

Diagram

Block Flowchart

Example

The above example inverts the state of the digital output DO6 to each disabling the internal buzzer.

11.8.5.2 Communication Network


11.8.5.2.1 CANopen
11.8.5.2.1.1 CANopen Overview
Operation in the CANopen Network - Master Mode

WPS v2.5X | 766


Equipments (Devices)

Besides the operation as a slave, the PLC300 programmable controller also allows operation as a master for
the CANopen network. PLC300 characteristics and functions as a master for the CANopen network will be
described as follows.

Enabling Function CANopen Master

By default, PLC300 programmable controller is programmed to operate as a slave for the CANopen network.
Programming the equipment as a master for the network must be done by using the WSCAN software that
also allows the configuration of the whole CANopen network. A detailed description of the WSCAN software
windows and functions must be obtained in the menu "Help" in the software itself.

After the master configuration has been created, it is necessary to download the configurations by using one
of the product's programming interfaces - refer to the user manual for further information. Once programmed as
a master for the network, in case it is necessary to delete said configurations, the function to delete the user
program - available in the Setup menu - also deletes the CANopen master configurations.

NOTE!
CANopen network is a flexible network that allows several different ways of configuring and
operating. Nonetheless, such a flexibility requires the user to have a good knowledge of the
communication functions and objects used to configure the network, as well as knowledge of the
WSCAN programming software.

CANopen Master Characteristics

PLC300 programmable controller allows the control of a group of up to 63 slaves, using the following
communication tasks and resources:

Network management task (NMT)


63 transmission PDOs
63 reception PDOs
63 Heartbeat Consumers
Heartbeat Producer
SDO Client
SYNC producer/consumer
512 bytes of input network markers
512 bytes of output network markers

Physical characteristics - installation, connector, cable, etc. - are the same for PLC300 operating both as a
master and a slave. Address configurations and communication rate are also necessary for the operation as a
master, but these configurations are programmed by the WSCAN software according to the properties defined
for the master in the software itself.

NOTE!
Input network markers are used to map data in RPDOs, while output network markers are used
to map data in TPDOs. They can be accessed in Byte (%IB or %QB), Word (%IW or %QW), or
Double Word (%ID or %QD). Nonetheless, their function is not pre-defined and depends on the
Ladder application developed for the PLC300 controller.

WPS v2.5X | 767


Equipments (Devices)

Master Operation

Once programmed to operate as a master, the PLC300 programmable controller will perform the following
steps in order to perform the sequential initialization for each one of the slaves.

1. By sending the communication reset command to the whole network, so that the slaves initialize with
values known for the communication objects.
2. Equipment identification in the network, through the reading via SDO of the 1000h/00h object - Object
Identification.
3. Writing via SDO of all objects programmed for the slave, which usually include the configuration and
mapping of TPDOs and RPDOs, node guarding, heartbeat, besides the manufacturer's specific objects, in
case they are programmed.
4. Error control task initialized - node guarding or heartbeat - in case they are programmed.
5. Sending of the slave to the operating mode.

If one of these steps fails, communication error with the slave will be indicated. Depending on the
configurations, the initialization of slaves will be aborted, and the master will initialize the following slave,
returning to the slave presenting error, after trying to initialize all other slaves in the network.

Similarly, if during the operation of a slave, an error in the error control task is identified, depending on the
configurations made for the master, the slave will be automatically reset and the initialization procedure will be
performed over.

NOTE!
The communication state and the state of each slave can be observed in input system markers.

Blocks for the CANopen Master

Besides the communication and configuration objects made in the WSCAN software, blocks for the monitoring
and sending of commands, which can be used during the creation of the application in Ladder for the PLC300
programmable controller, are also available. It is not necessary to use said blocks during the equipment
operation, but its use provides more flexibility and facilitates the diagnosis of communication problems during
the PLC300 programmable controller operation.

11.8.5.2.1.2 CO_MasterControlStatus
Block that allows monitoring various statuses of the CANopen network master.

Ladder Representation

WPS v2.5X | 768


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
DisableComm BOOL Disables CANopen communication
VAR_INPUT SendNMT BOOL Triggers management command sending
NMTCommand BYTE Management command code to be sent
NodeID BYTE USINT Slave address for sending the NMT
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
BusPowerOff BOOL Flag of a pow er failure of CAN interface
BusOff BOOL Flag indicating BusOff error at the CAN interface
NMTCmdFeedback BOOL Flag of NMT command sent by the master
VAR_OUTPUT
Flag indicating error of nodeguarding or heartbeat in a
ErrorCtrlFailure BOOL
slave netw ork
Flag indicating error in the initialization of the slavee
InitFailure BOOL
netw ork
Flag indicating the initialization of the slaves w as
InitFinished BOOL
completed

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the CANopen communication and resets the status counters
and markers of the master.

A leading edge on SendNMT sends a command management (NMT) indicated at NMTCommand to


the slave of NodeID address.

Outputs receive TRUE level when the status of the CANopen master matches description (disabled
communication, power failure, etc.).

Block Flowchart

WPS v2.5X | 769


Equipments (Devices)

Example

The example above requests status data of the CANopen network master, and allows disabling
communication through DISABLE and to send commands NMT to NODEID through SEND_COMM.
The block ends successfully, Done output is activated.

WPS v2.5X | 770


Equipments (Devices)

11.8.5.2.1.3 CO_SDORead
Block that performs a reading of data via SDO from a remote slave in CANopen network.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
NodeID# BYTE Slave address
Index# WORD Index of the object to be accessed in slave
VAR_INPUT SubIndex# BYTE Sub-index of the object
Size# BYTE Size of data accessed, in bytes
Maximum w aiting time for arrival of data, from the
Timeout# WORD
beginning of the request [ms]
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Busy BOOL Flag of the SDO client is busy w ith another request
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID BYTE USINT Identifier of the occurred error
Value BYTE USINT Variable that stores the received data
VAR CO_SDOREAD_INST_0 CO_SDOREAD Instance of access to block structure

Operation

When this block detects a leading edge on Execute it checks whether the SDO client in the specified
NodeID # address is free to send data (Busy variable at FALSE level). If so, it sends the reading
request to the object of Size# size located in Index# and SubIndex# and sets the Active output,
resetting it when receiving the response from the slave. The received data is stored in the Value
variable. If the slave is not free, the block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to Size#. It is important to check this compatibility not to generate
errors in the block.

WPS v2.5X | 771


Equipments (Devices)

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Card cannot execute the function
2 Timeout in slave response
3 Slave returned error

Block Flowchart

WPS v2.5X | 772


Equipments (Devices)

WPS v2.5X | 773


Equipments (Devices)

Example

The example above requests reading of the data size SIZE, located in INDEX - SUBINDEX, of the
NODEID device. This data is forwarded to VALUE. The block ends successfully, Done output is
activated.

11.8.5.2.1.4 CO_SDOWrite
Block that performs a writing of data via SDO from a remote slave in CANopen network.

Ladder Representation

Block Structure

WPS v2.5X | 774


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
NodeID# BYTE Slave address
Index# WORD Index of the object to be accessed in slave
SubIndex# BYTE Sub-index of the object
VAR_INPUT
Size# BYTE Size of data accessed, in bytes
Maximum w aiting time for arrival of data, from the
Timeout# WORD
beginning of the request [ms]
Value BYTE USINT Variable that has the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
VAR_OUTPUT Busy BOOL Flag of the SDO client is busy w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE USINT Identifier of the occurred error
VAR CO_SDOWRITE_INST_0 CO_SDOWRITE Instance of access to block structure

Operation

When this block detects a leading edge on Execute it checks whether the SDO client in the specified
NodeID # address is free to send data (Busy variable at FALSE level). If so, it sends the writing
request to the object of Size# size located in Index# and SubIndex# and sets the Active output,
resetting it when receiving the response from the slave. If the slave is not free, the block waits Busy
go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to Size#. It is important to check this compatibility not to generate
errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Card cannot execute the function
2 Timeout in slave response
3 Slave returned error

Block Flowchart

WPS v2.5X | 775


Equipments (Devices)

WPS v2.5X | 776


Equipments (Devices)

Example

The example above requests writing of the data size VALUE, located in INDEX - SUBINDEX, of the
NODEID device. The block ends successfully, Done output is activated.

11.8.5.2.1.5 CO_SlaveStatus
Block that allows monitoring various statuses of the CANopen network master.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
NodeID BYTE USINT Slave address for monitoring
Done BOOL Output enabling
Flag indicating error of nodeguarding or heartbeat in a
ErrorCtrlFailure BOOL
slave netw ork
Flag indicating error in the initialization of the slavee
InitFailure BOOL
netw ork
VAR_OUTPUT Flag indicating the initialization of the slaves w as
InitFinished BOOL
completed
ErrorCtrlStarted BOOL Flag of start of the error control service
Flag of success in the dow nload of SDO settings in the
ConfigDownloaded BOOL
slave
SlaveDetected BOOL Flag of success in reading slave ID via SDO

Operation

WPS v2.5X | 777


Equipments (Devices)

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the slave. When Execute receives FALSE level, the inputs are ignored and the outputs
are zeroed. The Done output receives TRUE level when Execute has TRUE level and block finished its
execution.

Outputs receive TRUE level when the status of the CANopen slave indicated by address NodeID
matches description (boot error, download success, etc.).

Block Flowchart

Example

The example above requests data from the slave 20 of the CANopen network. The block ends
successfully, Done output is activated.

11.8.5.2.2 Modbus RTU


11.8.5.2.2.1 Modbus RTU Overview
Operation in the Modbus RTU Network - Master Mode

Besides the operation as a slave, the PLC300 programmable controller also allows operation as a master for
the Modbus RTU network. For this operation, it is necessary to observe the following points:

WPS v2.5X | 778


Equipments (Devices)

Only interface RS485 allows operation as a network master.


It is necessary to program, in product configurations, the operation mode as "Master", besides the
communication rate, parity, and stop bits, which must be the same for the whole equipment in the network.
The Modbus RTU network master does not have an address, so the address configured in the PLC300 is not
used.
Sending and receiving telegrams via RS485 interface using the Modbus RTU is programmed by using blocks
in Ladder programming language. It is necessary to know the available blocks and the Ladder programming
software in order to be able to program the network master.
The following functions are available for the sending of requisitions by the Modbus master:
o Function 01: Read Coils
o Function 02: Read Discrete Inputs
o Function 03: Read Holding Registers
o Function 04: Read Input Registers
o Function 05: Write Single Coil
o Function 06: Write Single Register
o Function 15: Write Multiple Coils
o Function 16: Write Multiple Registers

Blocks to program the master

In order to control and monitor the Modbus RTU communication using the PLC300 programmable controller,
the following blocks were developed, and they must be used when programming in Ladder.

11.8.5.2.2.2 MB_MasterControlStatus
Block that allows monitoring various statuses of the Modbus RTU network master.

Ladder Representation

Block Structure

WPS v2.5X | 779


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
DisableComm BOOL Disables Modbus RTU communication
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
TxCounter WORD UINT Counter of requests sent
RxCounter WORD UINT Counter of telegrams received
NoAnswerCounter WORD UINT Counter of requests not answ ered
Counter of responses received w ith error
ErrorResponseCounter WORD UINT
information
VAR_OUTPUT
Slave address in w hich the last communication
LastErrorSlaveAddress BYTE USINT
error w as detected
Operation result of the last communication error
received
LastErrorResult BYTE USINT (0 = No error)
(4 – Response Timeout)
(5 = Slave returned error)
LastErrorCode BYTE USINT Code of the last communication error received

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the Modbus RTU communication and resets the status counters
and markers of the master. These markers and counters are displayed in the output block each
having some data corresponding to its description. Their values are also cleared at shutdown of the
master.

Block Flowchart

WPS v2.5X | 780


Equipments (Devices)

Example

The example above requests status data of the Modbus RTU network master, and allows disabling
communication through DISABLE. The block ends successfully, Done output is activated.

11.8.5.2.2.3 MB_ReadBinary
Block that performs a reading of up to 128 binary data (via Read Coils or Read Discrete Inputs) of a
slave on the Modbus RTU network.

Ladder Representation

WPS v2.5X | 781


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial bit address of the data to be read
VAR_INPUT
NumberOfData BYTE Number of bits to be read (1 to 128)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
VAR_OUTPUT another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
Value BOOL Variable that stores the received data
VAR MB_READBINARY_INST_0 MB_READBINARY Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus slave RTU in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

WPS v2.5X | 782


Equipments (Devices)

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 783


Equipments (Devices)

WPS v2.5X | 784


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT Modbus RTU slave of SLAVE address through the Read Discrete Input function.
These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.8.5.2.2.4 MB_ReadRegister
Block that performs a reading of up to 64 16-bit registers (via Read Holding Registers or Read Input
Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 785


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial register address to be read
VAR_INPUT
NumberOfData BYTE Number of registers to be read (1 to 64)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
another request

VAR_OUTPUT Error BOOL Error in the execution flag


ErrorID BYTE Identifier of the occurred error
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the received data
DWORD UDINT
DINT REAL
MB_READREGISTER
VAR MB_READREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of registers indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting them when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 786


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 787


Equipments (Devices)

WPS v2.5X | 788


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT in the Modbus RTU slave of SLAVE address through the Read Input Register
function. These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.8.5.2.2.5 MB_SlaveStatus
Block that allows monitoring the status of 4 slaves of the Modbus RTU network.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
Amount of errors that the master must identify until it
ErrorsToSetOffline# BYTE
considers communication w ith an offline slave

VAR_INPUT AddressSlave1# BYTE Slave address 1 to be monitored


AddressSlave2# BYTE Slave address 2 to be monitored
AddressSlave3# BYTE Slave address 3 to be monitored
AddressSlave4# BYTE Slave address 4 to be monitored
Done BOOL Output enabling
Flag indicating any one of the monitored
GeneralOffline BOOL
communication is offline

VAR_OUTPUT Slave1Offline BOOL Flag of offline status slave 1


Slave2Offline BOOL Flag of offline status slave 2
Slave3Offline BOOL Flag of offline status slave 3
Slave4Offline BOOL Flag of offline status slave 4

WPS v2.5X | 789


Equipments (Devices)

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
number of errors recorded for each slave. When Execute receives FALSE level, the inputs are ignored
and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE level and
block finished its execution.

The ErrorsToSetOffline # input allows registering the number of errors identified in a slave that will
feature an offline communication. AddressSlave inputs allow inserting four slave addresses to be
monitored. When this monitored slave reports the programmed number of errors, its corresponding
SlaveOffline output is set to TRUE level. If any of SlaveOffline outputs is at TRUE level, GeneralOffline
also receives TRUE level.

Block Flowchart

Example

WPS v2.5X | 790


Equipments (Devices)

The above example checks the number of error responses sent by the slaves 2, 4, 6 and 8 of the
Modbus RTU. If any of them is greater than 5, its SX_OFF status is led to TRUE level. The block ends
successfully, Done output is activated.

11.8.5.2.2.6 MB_WriteBinary
Block that performs a writing of up to 128 binary data (via Write Single Coil or Write Multiple Coils) in
a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 791


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial bit address w here the data w ill be w ritten
VAR_INPUT NumberOfData BYTE Number of bits to be w ritten (1 to 128)
Timeout# WORD Maximum w aiting time for the slave response [ms]
Offset Indication in InitialDataAddress, i.e., need to
Offset# BOOL
subtract 1 from this number
Value BOOL Variable that stores the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEBINARY
VAR MB_WRITEBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. If the slave is not free, the block waits Busy go to FALSE level to resubmit
the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 792


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 793


Equipments (Devices)

WPS v2.5X | 794


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Coil. The block ends successfully, Done output is activated.

11.8.5.2.2.7 MB_WriteRegister
Block that performs a reading of up to sixteen 16-bit registers (via Write Single Register or Write
Multiple Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 795


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial register address to be w ritten
NumberOfData BYTE Number of registers to be w ritten (1 to 16)

VAR_INPUT Maximum w aiting time for the slave response


Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the data to be w ritten
DWORD UDINT DINT
REAL
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy
VAR_OUTPUT Busy BOOL
w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEREGISTER
VAR MB_WRITEREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of Value values in a number of registers indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the slave. If the slave is not free, the block waits Busy go to FALSE
level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 796


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 797


Equipments (Devices)

WPS v2.5X | 798


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Register. The block ends successfully, Done output is activated.

11.8.5.2.3 Modbus TCP


11.8.5.2.3.1 Modbus TCP Overview
Operation in Modbus TCP Network – Client Mode

Besides the operation as server, the programmable controller PLC300 also allows the operation as client of the
Modbus TCP network. For this operation, it is necessary to observe the following points:

The sending and receiving of telegrams via Ethernet interface using the Modbus TCP protocol is
programmed by using blocks in Ladder programming language. It is necessary to know the available blocks
and the Ladder programming software in order to program the network client.
The following functions are available to send requests by the Modbus TCP client:
o Function 01: Read Coils
o Function 02: Read Discrete Inputs
o Function 03: Read Holding Registers
o Function 04: Read Input Registers
o Function 05: Write Single Coil
o Function 06: Write Single Register
o Function 15: Write Multiple Coil
o Function 16: Write Multiple Registers

Blocks for Programming of the Client

In order to control and monitor Modbus TCP communication using the programmable controller PLC300, the
following blocks were developed, which must be used during Ladder programming.

11.8.5.2.3.2 MBTCP_ClientControlStatus
Block that allows monitoring various statuses of the Modbus TCP network client.

Ladder Representation

WPS v2.5X | 799


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
DisableComm BOOL Disables Modbus TCP communication
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
TxCounter WORD UINT Counter of requests sent
RxCounter WORD UINT Counter of telegrams received
NoAnswerCounter WORD UINT Counter of requests not answ ered
Counter of responses received w ith error
ErrorResponseCounter WORD UINT
information
Server address in w hich the last communication
LastErrorServerAddress DWORD
error w as detected
VAR_OUTPUT Server port in w hich the last communication error
LastErrorServerPort WORD UINT
w as detected
Server UnitID in w hich the last communication
LastErrorUnitID BYTE USINT
error w as detected
Operation result of the last communication error
received
(0 - No error)
LastErrorResult BYTE USINT (4 - Server response timeout)
(5 - Server returned error)
(6 - Connection to server has failed)
(7 - TCP/IP Connection ended prematurely)
LastErrorCode BYTE USINT Code of the last communication error received

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the Modbus TCP communication and resets the status counters

WPS v2.5X | 800


Equipments (Devices)

and markers of the client. These markers and counters are displayed in the output block each having
some data corresponding to its description. Their values are also cleared at shutdown of the client.

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

Example

WPS v2.5X | 801


Equipments (Devices)

The example above requests status data of the Modbus RTU network client, and allows disabling
communication through DISABLE. The block ends successfully, Done output is activated.

11.8.5.2.3.3 MBTCP_ReadBinary
Block that performs a reading of up to 128 binary data (via Read Coils or Read Discrete Inputs) of a
server on the Modbus TCP network.

Ladder Representation

Block Structure

WPS v2.5X | 802


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
Server IP address
ServerAddress DWORD
(Ex: 192.168.0.1)
Modbus TCP Port of the server
ServerPort WORD
(Standard: 502)
UnitID do servidor
UnitID BYTE
(Standard: 255)
VAR_INPUT
Function# BYTE Reading function code
InitialDataAddress WORD Initial bit address of the data to be read
NumberOfData BYTE Number of bits to be read (1 to 128)
Maximum w aiting time for the server response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the connection is busy w ith
Busy BOOL
VAR_OUTPUT another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
Value BOOL Variable that stores the received data
MBTCP_READBINARY
VAR MBTCP_READBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus TCP server in
specified address in ServerAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the server. The received data is stored in the Value variable. If the server is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 803


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Client not enabled
4 Timeout in server response
5 Server returned error
6 Failed to connect to server
7 TCP/IP connection terminated prematurely

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

WPS v2.5X | 804


Equipments (Devices)

WPS v2.5X | 805


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT – 1 in Modbus TCP server of SERVER:PORT address through the Read
Discrete Input function. These data are forwarded to VALUE. The block ends successfully, Done
output is activated.

11.8.5.2.3.4 MBTCP_ReadRegister
Block that performs a reading of up to 64 16-bit registers (via Read Holding Registers or Read Input
Registers) of a server on the Modbus TCP network.

Ladder Representation

Block Structure

WPS v2.5X | 806


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
Server IP address
ServerAddress DWORD
(Ex: 192.168.0.1)
Modbus TCP Port of the server
ServerPort WORD
(Standard: 502)
UnitID do servidor
UnitID BYTE
(Standard: 255)
VAR_INPUT
Function# BYTE Reading function code
InitialDataAddress WORD Initial register address to be read
NumberOfData BYTE Number of registers to be read (1 to 64)
Maximum w aiting time for the server
Timeout# WORD
response [ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the connection is busy w ith
Busy BOOL
another request

VAR_OUTPUT Error BOOL Error in the execution flag


ErrorID BYTE Identifier of the occurred error
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the received data
DWORD UDINT DINT
REAL
MBTCP_READREGISTER
VAR MBTCP_READREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus TCP server in
specified address in ServerAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of registers indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the server. The received data is stored in the Value variable. If the server is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

WPS v2.5X | 807


Equipments (Devices)

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Client not enabled
4 Timeout in server response
5 Server returned error
6 Failed to connect to server
7 TCP/IP connection terminated prematurely

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

WPS v2.5X | 808


Equipments (Devices)

WPS v2.5X | 809


Equipments (Devices)

Example

The above example requests reading of a number of register data described by DATA_COUNT
positioned in the INIT1 in Modbus TCP server of SERVER:PORT address through the Read Holding
Register function. These data are forwarded to VALUE. The block ends successfully, Done output is
activated.

11.8.5.2.3.5 MBTCP_ServerStatus
Block that allows monitoring the status of 4 servers of the Modbus TCP network.

Ladder Representation

Block Structure

WPS v2.5X | 810


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
Amount of errors that the must be identified until it
ErrorsToSetOffline# BYTE
considers communication w ith an offline server
Server 1 address to be monitored
ServerAddress1# DWORD
(Ex: 192.168.0.1)
Server 1 port to be monitored
PortAddress1# WORD
(Standard: 502)
Server 1 UnitID to be monitored
UnitID1# BYTE
(Standard: 255)
Server 2 address to be monitored
ServerAddress2# DWORD
(Ex: 192.168.0.1)
Server 2 port to be monitored
PortAddress2# WORD
(Standard: 502)
VAR_INPUT Server 2 UnitID to be monitored
UnitID2# BYTE
(Standard: 255)
Server 3 address to be monitored
ServerAddress3# DWORD
(Ex: 192.168.0.1)
Server 3 port to be monitored
PortAddress3# WORD
(Standard: 502)
Server 3 UnitID to be monitored
UnitID3# BYTE
(Standard: 255)
Server 4 address to be monitored
ServerAddress4# DWORD
(Ex: 192.168.0.1)
Server 4 port to be monitored
PortAddress4# WORD
(Standard: 502)
Server 4 UnitID to be monitored
UnitID4# BYTE
(Standard: 255)
Done BOOL Output enabling
Flag indicating any one of the monitored
GeneralOffline BOOL
communication is offline

VAR_OUTPUT Server1Offline BOOL Flag of offline status for server 1


Server2Offline BOOL Flag of offline status for server 2
Server3Offline BOOL Flag of offline status for server 3
Server4Offline BOOL Flag of offline status for server 4

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the number of errors recorded for each server. When Execute receives FALSE level, the
inputs are ignored and the outputs are zeroed. The Done output receives TRUE level when Execute
has TRUE level and block finished its execution.

The ErrorsToSetOffline # input allows registering the number of errors identified in a server that will
feature an offline communication. AddressServer inputs allow inserting four server addresses to be
monitored. If you want to leave a channel ignored, enter the value 0 in the server address. When this
monitored server reports the programmed number of errors, its corresponding SlaveOffline output is
set to TRUE level. If any of SlaveOffline outputs is at TRUE level, GeneralOffline also receives TRUE

WPS v2.5X | 811


Equipments (Devices)

level.

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

Example

WPS v2.5X | 812


Equipments (Devices)

The above example checks the number of error responses sent by the servers 192.168.10.100:502
and 192.168.10.102:502 of the Modbus TCP network. If any of them is greater than 40, its SX_OFF
status is led to TRUE level. The block ends successfully, Done output is activated.

11.8.5.2.3.6 MBTCP_WriteBinary
Block that performs a writing of up to 128 binary data (via Write Single Coil or Write Multiple Coils) in
a server on the Modbus TCP network.

Ladder Representation

Block Structure

WPS v2.5X | 813


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
Server IP address
ServerAddress DWORD
(Ex: 192.168.0.1)
Modbus TCP Port of the server
ServerPort WORD
(Standard: 502)
UnitID do servidor
UnitID BYTE
(Standard: 255)

VAR_INPUT Function# BYTE Writing function code


InitialDataAddress WORD Initial bit address w here the data w ill be w ritten
NumberOfData BYTE Number of bits to be w ritten (1 to 128)
Maximum w aiting time for the server response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
Value BOOL Variable that stores the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the connection is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MBTCP_WRITEBINARY
VAR MBTCP_WRITEBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus TCP server in
specified address in ServerAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of the Value values in a number of bits indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the server. If the server is not free, the block waits Busy go to
FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 814


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Client not enabled
4 Timeout in server response
5 Server returned error
6 Failed to connect to server
7 TCP/IP connection terminated prematurely

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

WPS v2.5X | 815


Equipments (Devices)

WPS v2.5X | 816


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus TCP server at SERVER:PORT address using the
function Write Single Coil. The block ends successfully, Done output is activated.

11.8.5.2.3.7 MBTCP_WriteRegister
Block that performs a writing of up to sixteen 16-bit registers (via Write Single Register or Write
Multiple Registers) of a server on the Modbus TCP network.

Ladder Representation

Block Structure

WPS v2.5X | 817


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
Server IP address
ServerAddress DWORD
(Ex: 192.168.0.1)
Modbus TCP Port of the server
ServerPort WORD
(Standard: 502)
UnitID do servidor
UnitID BYTE
(Standard: 255)
Function# BYTE Writing function code

VAR_INPUT InitialDataAddress WORD Initial register address to be w ritten


NumberOfData BYTE Number of registers to be w ritten (1 to 16)
Maximum w aiting time for the server
Timeout# WORD
response [ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the data to be w ritten
DWORD UDINT DINT
REAL
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the connection is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_TCPWRITEREGISTER
VAR MB_TCPWRITEREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus TCP server in
specified address in ServerAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of Value values in a number of registers indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the server. If the server is not free, the block waits Busy go to
FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

WPS v2.5X | 818


Equipments (Devices)

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Client not enabled
4 Timeout in server response
5 Server returned error
6 Failed to connect to server
7 TCP/IP connection terminated prematurely

Compatibility

Device Version
PLC300 1.30 or higher

Block Flowchart

WPS v2.5X | 819


Equipments (Devices)

WPS v2.5X | 820


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus TCP server at SERVER:PORT address using the
function Write Multiple Registers. The block ends successfully, Done output is activated.

11.8.5.3 Compare
11.8.5.3.1 COMP_EQ
Block that compares the values of Value1 and Value2, enabling the output Q if both are equal.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality

Operation

When this block has a TRUE value in EN, it sends to the output Q the TRUE value if Value1 and
Value2 are the same. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 821


Equipments (Devices)

Example

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated. Notice that the types of the input variables can be different
without causing execution problems.

WPS v2.5X | 822


Equipments (Devices)

The example above checks equality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is disabled.

11.8.5.3.2 COMP_GE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
or equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or majority of Value1

Operation

When this block has a TRUE value in EN it sends the Q output to the TRUE value if Value1 is higher
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 823


Equipments (Devices)

Example

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is disabled.

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 824


Equipments (Devices)

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is activated.

11.8.5.3.3 COMP_GT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of majority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is higher
than Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 825


Equipments (Devices)

Example

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is disabled.

The example above checks the majority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 826


Equipments (Devices)

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is activated.

11.8.5.3.4 COMP_LE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than or
equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 827


Equipments (Devices)

Example

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is activated.

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 828


Equipments (Devices)

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is disabled.

11.8.5.3.5 COMP_LT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 829


Equipments (Devices)

Example

The example above checks minority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is activated.

The example above checks the minority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 830


Equipments (Devices)

The example above checks the minority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is disabled.

11.8.5.3.6 COMP_NE
Block that compares the values of Value1 and Value2, enabling the Q output if Value1 is different from
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of inequality

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is
different from Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 831


Equipments (Devices)

Example

The example above checks inequality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is disabled.

11.8.5.4 Contact
11.8.5.4.1 NCCONTACT
Normally closed contact.

Ladder Representation

WPS v2.5X | 832


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with TRUE value, B receives FALSE.


When variable I1 is with FALSE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 833


Equipments (Devices)

Example

The above example performs the transfer of the opposite value of digital input DI1 to the digital output
DO2.

11.8.5.4.2 NOCONTACT
Normally open contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with FALSE value, B receives FALSE.


When variable I1 is with TRUE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 834


Equipments (Devices)

Example

The above example performs the transfer of the value of digital input DI1 to the digital output DO2.

11.8.5.4.3 NTSCONTACT
Falling edge transition contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR NTSCONTACT_INST_0 NTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from TRUE to FALSE (falling edge or negative edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

WPS v2.5X | 835


Equipments (Devices)

Block Flowchart

Example

The above example resets the digital output DO1 if the SHIFT key is pressed or a positive pulse on
the digital input DI2 is given.

11.8.5.4.4 PTSCONTACT
Leading edge transition contact.

Ladder Representation

Block Structure

WPS v2.5X | 836


Equipments (Devices)

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR PTSCONTACT_INST_0 PTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from FALSE to TRUE (leading edge or positive edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

Example

WPS v2.5X | 837


Equipments (Devices)

The above example resets the digital output DO1 if the SHIFT key is pressed and a positive pulse on
the digital input DI2 is given.

11.8.5.5 Control
11.8.5.5.1 PID
Block that performs the function of a discrete PID controller. From the input variables, it calculates the
corresponding controller output.

Ladder Representation

Block Structure

WPS v2.5X | 838


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SetPoint REAL Automatic reference (pre-control)
ManualSetPoint REAL Forced reference (post control)
SelectSetPoint BOOL Selects w hich reference to use
Feedback REAL Feedback loop variable
MinimumOutput REAL Minimum value of the controller output
MaximumOutput REAL Maximum value of the controller output
VAR_INPUT
Kp REAL Proportional gain
Ki REAL Integral gain
Kd REAL Derivative gain
TauSetPoint# REAL Time constant of the automatic reference in put filter
Type# BYTE Controller type
Action# BYTE Control action
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Controller output
VAR PID_INST_0 PID Instance of access to block structure

Operation

On the positive transition edge in EN, Output receives zero value, and the block executes its
functionality as EN is at TRUE level.

When enabled, this block performs a routine PID control with the Kp, Ki and Kd parameters chosen.
The PID topology used may be the Academic or Parallel, depending on what is chosen in Type#.

Academic Form:

Parallel Form:

WPS v2.5X | 839


Equipments (Devices)

The levels of the output signal of the controller are saturated at value MinimumOutput and
MaximumOutput. The SelectSetPoint input level FALSE causes the SetPoint reference be adopted,
allowing the controller maintains control over the process. When SelectSetPoint goes to TRUE level,
the controller has no more domain, and ManualSetPoint becomes to be considered the output signal
of the controller.

Action# will define the feedback operation. If Action# is DIRECT, the operation will be SetPoint –
Feedback. If Action# is REVERSE, the operation will be Feedback – SetPoint.

Feedback receives the process variable considered as the plant output. Ts# receives the sampling
time for the controller and # TauSetPoint receives the time constant for the input filter of the automatic
reference.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Effects of the alteration of gains on the process
If Kp decreases, the process becomes slower; generally more stable or less oscillating; it has
less overshoot.
If Kp increases, the process responds faster; it may become more unstable or more
oscillating; it has more overshoot.
If Ki decreases, the process becomes slower, lagging to reach the "SetPoint"; it becomes
more stable or less oscillating; it has less overshoot.
If Ki increases, the process becomes faster, quickly reaching the "SetPoint"; it becomes more
unstable or more oscillating; it has more overshoot.
If Kd decreases, the process becomes slower; it has less overshoot.
If Kd increases, it has more overshoot.

WPS v2.5X | 840


Equipments (Devices)

NOTE!
How to improve the performance of the process through the adjustment of gains (valid for the
Academic PID)
If the performance of the process is almost good, but the overshoot is a bit high, try to: (1)
decrease Kp 20%, (2) decrease Ki 20% and/or (3) decrease Kd 50%.
If the performance of the process is almost good, but it does not have overshoot and lags to
reach the "SetPoint", try to: (1) increase Kp 20%, (2) increase Ki 20% and/or (3) increase Kd
50%.
If the performance of the process is good, but the process output is varying too much, try to:
(1) increase Kd 50%, (2) decrease Kp 20%.
If the performance of the process is bad, i.e. after start up, the transitory lasts several periods
of oscillation that reduce very slowly or never reduce at all, try to: (1) decrease Kp 50%.
If the performance of the process is bad, i.e. after start up it slowly moves towards the
"SetPoint" without overshoot, but is still very far and the process output is less than the rated
value, try to: (1) increase Kp 50%, (2) increase Ki 50%, (3) increase Kd 70%.

Block Flowchart

WPS v2.5X | 841


Equipments (Devices)

WPS v2.5X | 842


Equipments (Devices)

Example

The above example creates a loop of a digital PID form with sampling time 50 ms, using the
constants KP, KI and KD for control. Automatic reference SETPOINT, filtered by a first order filter with
time constant of 0:01 is used. The error signal is calculated as the difference between the filtered
reference and variable SAIDA_PLANTA. The controller output is saturated between the values 0.1 and
2.5 and sent to the variable ENTRADA_PLANTA.

11.8.5.5.2 PID2
Block that performs auto tuning of a discrete PID controller. From the input variables, it calculates the
corresponding controller output PID or PI throw relay method. This block also implements the
obtained controller or another that the user wishes.

Ladder Representation

WPS v2.5X | 843


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enable
SetPoint REAL Automatic reference (pre-control)
ManualSetPoin
REAL Forced reference (post-control)
t
SelectSetPoin
BOOL Select w hich reference to use
t
Feedback REAL Mesh Feedback Variable
MinimumOutput REAL Minimum value of controller output
MaximumOutput REAL Maximum value of controller output
Kp REAL Proportional gain
VAR_INPUT
Ki REAL Integral gain
Kd REAL Derivative Gain
TauSetPoint# REAL Auto reference input filter time constant
Type# BYTE Controller Type
Action# BYTE Control action
Ts# UINT Sampling period [ms]
Tune BYTE It starts the tuning process according to Table 2

Parameter of the method of the relays that represents the


Delta REAL
variation of the manipulated variable w ith respect to the value that

WPS v2.5X | 844


Equipments (Devices)

reached the reference.


Hysteresis REAL Determines the hysteresis in the sw itching of the Relay
TuneTimeOut DWORD Maximum w ait time until tuning is complete [ms]
ENO BOOL Output enable
Output REAL Controller Output
TuneStatus BYTE Automatic tuning status as per Table 3
VAR_OUTPUT
KpOut REAL Proportional gain obtained in tuning
KiOut REAL Full gain achieved in tuning

KdOut REAL Derivative gain obtained in tuning


VAR PID2_INST_0 PID2 Block Structure Access Instance
Table1

Operation

The operation of the PID2 block is divided into two parts: Control and Automatic Tuning.
The Tune variable defines which mode of operation. Whenever Tune = 0, the system operates in control mode,
with values of the user defined gains, in the same way as the PID block.
The control part is exactly the same as the PID block, see the PID Help.

When Tune receives a value other than 0, the automatic tuning process starts. Some rules need to be obeyed
so that tuning can occur. They will be displayed in the sequence.

The Auto-Tuning

For the Automatic Tuning, the Relay Method is used, which is based on obtaining the critical gain and
critical period , which can be used to obtain PID controller gains through several tuning rules: Ziegler-
Nichols, Ciancone-Marlin, Tyreus- Luyben, ITAE, among others.

During the tuning process, the control is switched off and a "relay" determines the output of the controller
(Output), as shown below.

At start, the relay (Output) goes to the value and after a period the output (Feedback) starts to
increase. When the output becomes higher than the value of the setpoint + hysteresis, the relay switches to
, and so on, as shown below.

WPS v2.5X | 845


Equipments (Devices)

Since the value of the manipulated variable (Output) stabilized at the point of operation, we have:

In the case of image above,

From the obtained subtraction curve, the necessary parameters are obtained to obtain the controller.

Criteria for tuning to be performed

In order for automatic tuning to be performed properly, two criteria must be obeyed:

1) place the system at the operating point to be calibrated (the difference must be less than 20%);

2) variable , which is the manipulated variable, may not be showing oscillation greater than 20%;

OBS: you can use the Manual mode of the block to reach the operating point without large oscillations (via the
variable ).

Step by step to perform tuning (portuguese only)

1) must start with the value zero;

2) Set a value for . An initial value of 10% of the manipulated variable value is recommended ( )

WPS v2.5X | 846


Equipments (Devices)

which reached the system setpoint;

Ex: Assuming that to stabilize at the point of operation = 12.3. In this case, use

3) Set an initial value for . This value should be slightly larger than the noise present in the system.
An initial value of 2% of the Setpoint value can be used if no noise is known;

Ex: for = 60.0, use

4) Set a value in milliseconds ( ) to . This value depends on the system being applied to the
block. Slower systems will require a longer time. It should be sufficient for at least 10 cycles of the relay to be
complete, although with 5 cycles the system generally already stabilizes;

5) Place the system in the operating point. If a pre-control has already been done, it can be applied. Another
option is to use the manual mode and vary input until the system stabilizes at the point of
operation, that is, as close as possible to ;

6) Enable tuning by choosing the type of control (PI or PID and the rule used) through the variable , as
shown in Table 2;

7) The output will inform you the status of the automatic tuning process, as shown in Table 9. At
the end of the process, the output value will be received if the calibration is performed
successfully and the outputs , and will be updated with the values obtained in the tuning
process.

Tune Controller
0 Disabled
1 Automatic PID Controller
2 Automatic PI Controller
3 Tyreus-Luyben PID Controller
4 Tyreus-Luyben PI Controller
5 PID ITAE Controller
6 PI ITAE Controller
7 Ciancone-Marlin PID Controller
8 Ciancone-Marlin PI Controller
9 Ziegler-Nichols PID Controller
10 Ziegler-Nichols PI Controller
Table 2

Tune Status Meaning


0 Disabled

WPS v2.5X | 847


Equipments (Devices)

1 High level relay


2 Low level relay
4 Stabilized system
5 Stable and Relay at high level
6 Stable and Relay at low level
8 Tuning completed
16 Reserved
32 Timeout
64 Method nonexistent
128 Busy: another block in tune

Table 3

The Tyreus-Luyben methods are recommended for systems with the dominant time constant in relation to the
transport delay. Ciancone-Marlin methods are recommended for systems with a long transport delay. The
minimum ITAE method is for intermediary situations.

It is recommended for initial tuning or for users without some practice with the method of the relays, the use of
automatic 1 or 2 for , leaving the system to choose the most appropriate way.

After tuning, the method can be changed causing a new controller to be calculated without re-tuning, since the
required data is stored internally. This allows other methods to be easily experienced.

For a new tuning to be made, need to receive the value zero.

Block Flowchart
N/A

Example

WPS v2.5X | 848


Equipments (Devices)

WPS v2.5X | 849


Equipments (Devices)

11.8.5.6 Conversion
11.8.5.6.1 BCD
11.8.5.6.1.1 BCD_TO_WORD
Block that performs the conversion of a BCD code into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in BCD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BCD and converts it to
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 850


Equipments (Devices)

Example

The above example converts the VALUE variable, in BCD, into a WORD value storing the final result
in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.1.2 WORD_TO_BCD
Block that performs the conversion of a WORD value into a BCD code.

Ladder Representation

Block Structure

WPS v2.5X | 851


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in BCD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BCD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 852


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in WORD, into a BCD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.2 BOOL
11.8.5.6.2.1 BYTE_TO_BOOL
Block that performs the conversion of a BYTE value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 853


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BYTE, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.2.2 DWORD_TO_BOOL
Block that performs the conversion of a DWORD value into a BOOL value.

Ladder Representation

WPS v2.5X | 854


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 855


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in DWORD, into a BOOL value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.2.3 REAL_TO_BOOL
Block that performs the conversion of a REAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 856


Equipments (Devices)

Block Flowchart

Example

WPS v2.5X | 857


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice in the
last example that the values very close to the machine epsilon may result in an interpretation of the
FALSE value.

11.8.5.6.2.4 WORD_TO_BOOL
Block that performs the conversion of a WORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 858


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in WORD, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.3 BYTE
11.8.5.6.3.1 BOOL_TO_BYTE
Block that performs the conversion of a BOOL value into a BYTE value.

WPS v2.5X | 859


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 860


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BOOL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.3.2 DWORD_TO_BYTE
Block that performs the conversion of a DWORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 861


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.8.5.6.3.3 DWORD_TO_BYTES
Block that performs the conversion of a 32 bits (DWORD) value into four 8 bits (4 BYTES) value.

WPS v2.5X | 862


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
Result1 BYTE USINT SINT Value in BYTE (LSB)
VAR_OUTPUT Result2 BYTE USINT SINT Value in BYTE
Result3 BYTE USINT SINT Value in BYTE
Result4 BYTE USINT SINT Value in BYTE (MSB)

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
four BYTE values (from Result1 to Result4, where Result 1 is LSB), storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 863


Equipments (Devices)

Example

WPS v2.5X | 864


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in DWORD, into four BYTE value
storing the final result in RESULT1, RESULT2, RESULT3 and RESULT4. The block ends with
success and ENO output is activated.

11.8.5.6.3.4 REAL_TO_BYTE
Block that performs the conversion of a REAL value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 865


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in REAL, into a BYTE value storing

WPS v2.5X | 866


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated. Notice that the
results are truncated in decimal and only the eight least significant bits are taken into account.

11.8.5.6.3.5 WORD_TO_BYTE
Block that performs the conversion of a WORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 867


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in WORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.8.5.6.3.6 WORD_TO_BYTES
Block that performs the conversion of a 16 bits (WORD) value in two 8 bits (2 BYTES) value.

WPS v2.5X | 868


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT Result1 BYTE USINT SINT Value in BYTE (LSB)
Result2 BYTE USINT SINT Value in BYTE (MSB)

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it in
two BYTE variables, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 869


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE "VAL_IN", in WORD, in two BYTE
values storing the final result in RESULT1 and RESULT2. The block ends with success and ENO
output is activated.

WPS v2.5X | 870


Equipments (Devices)

11.8.5.6.4 DWORD
11.8.5.6.4.1 BOOL_TO_DWORD
Block that performs the conversion of a BOOL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 871


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.4.2 BYTE_TO_DWORD
Block that performs the conversion of a BYTE value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 872


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BYTE, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.4.3 BYTES_TO_DWORD
Block that performs the conversion of four 8 bits (BYTE) values into a 32 bits (DWORD) value.

Ladder Representation

WPS v2.5X | 873


Equipments (Devices)

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
Value1 BYTE USINT SINT Value in BYTE (1st byte - LSB)
VAR_INPUT Value2 BYTE USINT SINT Value in BYTE
Value3 BYTE USINT SINT Value in BYTE
Value4 BYTE USINT SINT Value in BYTE (4th byte - MSB)
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value1, Value2, Value3 and Value4 values
as BYTE and converts it into a DWORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 874


Equipments (Devices)

Example

The examples above perform the conversion of four variables VALUE1..4, in BYTE, into a DWORD
value storing the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.4.4 REAL_TO_DWORD
Block that performs the conversion of a REAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

WPS v2.5X | 875


Equipments (Devices)

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 876


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in REAL, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated. Note that the
results are truncated in decimal and only the thirty-two least significant bits are taken into account.

11.8.5.6.4.5 STRING_TO_DWORD
Block that performs the conversion of a STRING value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
STR STRING Value in STRING
DONE BOOL End of operation
VAR_OUTPUT
OUT DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it reads the value of STR as STRING character by
character, performing the conversion to REAL and storing in OUT. If the first character is not
mathematically valid, the OUT output receives zero. If there are valid characters, these characters will
be converted to the end of STRING, or until it finds an invalid character.

NOTE!
If the number represented in the string is higher than the maximum supported by a DWORD, the
Result value saturates in this maximum value.

When EN has FALSE value, OUT remains unchanged and DONE remains FALSE.

The DONE value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 877


Equipments (Devices)

Example

The following examples show various conversions of STRING into values of DWORD type. All
conversions enable the DONE output to the end of the operation.

The conversion above was successfully completed.

The conversion above was successfully completed. The underscore is a valid mathematical character.

The conversion above was successfully completed. The decimal point is not mathematically valid for

WPS v2.5X | 878


Equipments (Devices)

decimals and ends the conversion, truncating the result to what had already been converted.

The conversion above was not successfully completed. The first character was not identified as
mathematically valid, and the output was zeroed.

11.8.5.6.4.6 WORD_TO_DWORD
Block that performs the conversion of a WORD value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 879


Equipments (Devices)

Example

The examples above convert the VALUE variable, in WORD, into a DWORD value storing the final
result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.4.7 WORDS_TO_DWORD
Block that performs the conversion of two 16 bits (WORD) values into a 32 bits (DWORD) value.

Ladder Representation

Block Structure

WPS v2.5X | 880


Equipments (Devices)

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Value1 WORD UINT INT 1st WORD (Less Significant Word)
Value2 WORD UINT INT 2nd WORD (More Significant Word)
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value1 and Value2 values as WORD and
converts it into a DWORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 881


Equipments (Devices)

The examples above perform the conversion of two variable VALUE1 and VALUE2, in WORD, into a
DWORD value storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.8.5.6.5 Rad-Deg
11.8.5.6.5.1 DEG_TO_RAD
Block that performs the conversion of a value in degrees into a value in radians.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in degrees
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in radians

Operation

When this block has a TRUE value in EN, it interprets the Value value as in degrees and converts it
into radians, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 882


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in degrees, into a corresponding value
in radians storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.8.5.6.5.2 RAD_TO_DEG
Block that performs the conversion of a value in radians into a value in degrees.

Ladder Representation

Block Structure

WPS v2.5X | 883


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in radianos
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in graus

Operation

When this block has a TRUE value in EN, it interprets the Value value as in radians and converts it
into degrees, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 884


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in radians, into a corresponding value
in degrees storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.8.5.6.6 REAL
11.8.5.6.6.1 BOOL_TO_REAL
Block that performs the conversion of a BOOL value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 885


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BOOL, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.6.2 BYTE_TO_REAL
Block that performs the conversion of a BYTE value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 886


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 887


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.6.3 DWORD_TO_REAL
Block that performs the conversion of a DWORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 888


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.6.4 STRING_TO_REAL
Block that performs the conversion of a STRING value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 889


Equipments (Devices)

Tipo Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
STR STRING Value in STRING
DONE BOOL End of operation
VAR_OUTPUT
OUT REAL Value in REAL

Operation

When this block has a TRUE value in EN, it reads the value of STR as STRING character by
character, performing the conversion to REAL and storing in DONE. If the first character is not
mathematically valid, the OUT output receives zero. If there are valid characters, these characters will
be converted to the end of STRING, or until it finds an invalid character.

NOTE!
The block interprets the dot (.) as a decimal tab, and not the comma (,).

When EN has FALSE value, OUT remains unchanged and DONE remains FALSE.

The DONE value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

Example

WPS v2.5X | 890


Equipments (Devices)

The following examples show various conversions of STRING into values of REAL type. All
conversions enable the DONE output to the end of the operation.

The conversion above was successfully completed. The decimal point is a valid mathematical
character.

The conversion above was successfully completed. The dash and decimal point are valid
mathematical characters.

The conversion above was successfully completed. The dash and the power indicator of 10 "and" are
valid mathematical characters.

The conversion above was not successfully completed. The first character was not identified as
mathematically valid, and the output was zeroed.

The conversion above was successfully completed. The "p" character is not mathematically valid and
ends the conversion, truncating the result to what had already been converted.

WPS v2.5X | 891


Equipments (Devices)

11.8.5.6.6.5 WORD_TO_REAL
Block that performs the conversion of a WORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 892


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in WORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.7 STRING
11.8.5.6.7.1 DWORD_TO_STRING
Block that performs the conversion of a DWORD value into a STRING value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
IN DWORD UDINT DINT Value in DWORD
DONE BOOL End of operation
VAR_OUTPUT
OUT STRING Value in STRING

Operation

When this block has a TRUE value in EN, it interprets the IN value as DWORD and converts it into
STRING, storing in Result.

NOTE!
If the number represented has more digits than the capacity of the STRING, the value will be
truncated.

When EN has FALSE value, OUT remains unchanged and DONE remains FALSE.

Compatibility

WPS v2.5X | 893


Equipments (Devices)

Device Version
PLC300 2.10 or higher

Block Flowchart

Example

The following examples show various conversions of DWORD type values into STRING. All
conversions enable the DONE output to the end of the operation.

The conversion above was successfully completed.

The conversion above was successfully completed.

WPS v2.5X | 894


Equipments (Devices)

The above conversion was successful, but the size of the result of the conversion is greater than the
OUT size, and this has been truncated.

The above conversion was successful, but the size of the result of the conversion is greater than the
OUT size, and this has been truncated.

11.8.5.6.7.2 REAL_TO_STRING
Block that performs the conversion of a REAL value into a STRING value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
IN REAL Value in REAL
DONE BOOL End of operation
VAR_OUTPUT
OUT STRING Value in STRING

Operation

When this block has a TRUE value in EN, it interprets the IN value as REAL and converts it into
STRING, storing in OUT and sending TRUE to the DONE output.

NOTE!
If the number represented has more digits than the capacity of the STRING, the value will be
truncated.

When EN has FALSE value, OUT remains unchanged and DONE remains FALSE.

Compatibility

WPS v2.5X | 895


Equipments (Devices)

Device Version
PLC300 2.10 or higher

Block Flowchart

Example

The following examples show various conversions of REAL type values into STRING. All conversions
enable the DONE output to the end of the operation.

The conversion above was successfully completed.

The conversion above was successfully completed.

WPS v2.5X | 896


Equipments (Devices)

The above conversion was successful, but the size of the result of the conversion is greater than the
OUT size, and this has been truncated.

11.8.5.6.8 WORD
11.8.5.6.8.1 BOOL_TO_WORD
Block that performs the conversion of a BOOL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 897


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.8.2 BYTE_TO_WORD
Block that performs the conversion of a BYTE value into a WORD value.

Ladder Representation

Block Structure

WPS v2.5X | 898


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 899


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.8.5.6.8.3 BYTES_TO_WORD
Block that performs the conversion of two 8 bits (BYTE) values into a 16 bits (WORD) value.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Value1 BYTE USINT SINT 1st BYTE (LSB)
Value2 BYTE USINT SINT 2nd BYTE (MSB)
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value1 and Value2 values as BYTE and
converts it into a WORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 900


Equipments (Devices)

Example

The examples above perform the conversion of two variable VALUE1 and VALUE2, in BYTE, into a
WORD value storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.8.5.6.8.4 DWORD_TO_WORD
Block that performs the conversion of a DWORD value into a WORD value.

Ladder Representation

WPS v2.5X | 901


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 902


Equipments (Devices)

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Notice that only the
sixteen least significant bits are taken into account.

11.8.5.6.8.5 DWORD_TO_WORDS
Block that performs the conversion of a 32 bits (DWORD) value in two 16 bits (2 WORD) value.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT Result1 WORD UINT INT Value in WORD (Less Significant Word)
Result2 WORD UINT INT Value in WORD (More Significant Word)

Operation

When this block has a TRUE value in EN, it interprets the value as DWORD and converts it in two
WORD variables (Result1 and Result2), storing in Result.

When EN has FALSE value, Result remains unchanged.

WPS v2.5X | 903


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 904


Equipments (Devices)

The examples above perform the conversion of a variable VALUE, in DWORD, in two WORD values
storing the final result in RESULT1 and RESULT2. The block ends with success and ENO output is
activated.

11.8.5.6.8.6 REAL_TO_WORD
Block that performs the conversion of a REAL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 905


Equipments (Devices)

Example

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Note that the results
are truncated in decimal and only the sixteen least significant bits are taken into account.

WPS v2.5X | 906


Equipments (Devices)

11.8.5.7 Counter
11.8.5.7.1 CTD
Countdown block of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CD BOOL Pulse identifier
VAR_INPUT LD BOOL Loads the value of PV in CV
PV WORD UINT Value of initial configuration
Q BOOL Counter zeroed flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTD_INST_0 CTD Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it decrements the CV variable until it is zero. While
CV equals zero, the output Q remains at TRUE level. By detecting high-level LD, the block loads the
PV value in CV.

Block Flowchart

WPS v2.5X | 907


Equipments (Devices)

Operation Diagram

WPS v2.5X | 908


Equipments (Devices)

Example

The above example shows the initial conditions of routine. As CV has a value of zero, the Q output is
enabled.

The value of the PV variable was changed to 20, but not yet loaded.

WPS v2.5X | 909


Equipments (Devices)

By identifying TRUE level in LD, the block loads the PV value to CV. Since this value is greater than
zero, the Q output is disabled.

At each leading edge identified in CD, the value of COUNT is decremented until it reaches zero, when
the Q output is enabled.

11.8.5.7.2 CTU
Block for gradual count of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CU BOOL Pulse identifier
VAR_INPUT R BOOL Loads the zero value in CV
PV WORD UINT Maximum count value
Q BOOL Counter overrun flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTU_INST_0 CTU Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it increments the CV variable until it is equal to PV.
While CV equals PV, the output Q remains at TRUE level. By detecting high-level R, the block loads
the zero value in CV.

Block Flowchart

WPS v2.5X | 910


Equipments (Devices)

Operation Diagram

WPS v2.5X | 911


Equipments (Devices)

Example

The above example shows the initial conditions of routine. Since CV has a lower value than of PV, the
Q output is disabled.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the Q output is enabled.

WPS v2.5X | 912


Equipments (Devices)

By identifying TRUE level in R, the block loads the zero value to CV. Since this value is lower than of
PV, the Q output is disabled.

11.8.5.7.3 CTUD
Block for gradual count and countdown of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
CU BOOL Pulse identifier for incremental
CD BOOL Pulse identifier for decremental
VAR_INPUT
R BOOL Loads the zero value in CV
LD BOOL Loads the value of PV in CV
PV WORD UINT Reference value
ENO BOOL Output enabling
QU BOOL Counter overrun flag
VAR_OUTPUT
QD BOOL Counter zeroed flag
CV WORD UINT Current count value
VAR CTUD_INST_0 CTUD Instance of access to block structure

Operation

When this block has a TRUE value in EN, it acts as a CTD block and block CTU at the same time
acting on the same CV counter. That is: increments CV until it reaches PV to the leading edges in
CU and decrements CV until it reaches zero to the leading edges in CD. A positive transition in R
carries zero in CV, while a leading edge in LD loads the PV value in CV. If CV has zero value, QD
receives TRUE, and if CV has value equal to PV, QU receives TRUE.

WPS v2.5X | 913


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value.

Block Flowchart

WPS v2.5X | 914


Equipments (Devices)

WPS v2.5X | 915


Equipments (Devices)

Operation Diagram

Example

WPS v2.5X | 916


Equipments (Devices)

The example above shows the disabled block, with all its internal variables zeroed. Although the
external controls are activated, these values are not forwarded to the instance of the block.

When activated, the block identifies the value of PRESET, loading it in PV, and identifies that the
output is at zero, enabling the QD output. When execution is completed, the ENO output is activated.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the QU output is enabled. When execution is completed, the ENO output is activated.

At each leading edge detected in CD, the CV value is decremented. When CV is a value between
zero and PV, both QD and QU outputs are deactivated. When execution is completed, the ENO
output is activated.

WPS v2.5X | 917


Equipments (Devices)

A TRUE value in R resets CV, while a TRUE value in LD loads the value of PV to CV. As we can see,
R prevails over LD, leaving CV and enabling the QD output. When execution is completed, the ENO
output is activated.

11.8.5.8 Data Transfer


11.8.5.8.1 ARRAYCOPY
Block that copies an array from a certain position to another array or to itself.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
Array: BYTE USINT
SINT WORD UINT
VAR_SRC Input Array
INT DWORD UDINT
DINT REAL
VAR_INPUT BYTE USINT WORD Position of the input array from w hich the copy w ill be
POS_SRC
UINT made
BYTE USINT WORD Position of the output array from w hich it w ill be
POS_DST
UINT replaced
BYTE USINT WORD
LEN Number of array positions to be copied
UINT
ENO BOOL End of operation
Array: BYTE USINT
VAR_OUTPUT SINT WORD UINT
Result Output Array
INT DWORD UDINT
DINT REAL

WPS v2.5X | 918


Equipments (Devices)

Operation

This block, when it has a value of TRUE in EN, copies LEN values from the POS_SRC position from
the input array (VAR_SRC) to the position POS_DST into the destination array (Result).

Comments:
- POS_SRC, POS_DST and LEN input variables only accept positive integers. If a negative value is
assigned to any of them, the value zero will be considered.
- The Input Array can be repeated on the output without worrying about data being overwritten.
- If the amount of data to be copied defined by LEN exceeds the last position of the input array, only
valid data will be copied to the last position of the input array, thus avoiding any garbage being
assigned to the output array.
- If the amount of data to be copied defined by LEN exceeds the last position of the output array, only
the data required to complete it will be copied, preventing subsequent memory from receiving
unwanted values.
- The block will not execute if LEN has a value greater than the size of the input array.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!

It is important to notice that not only LEN but also POS_SRC will not exceed the
VAR_SRC array's size. The same must be noticed when setting values to POS_DST,
related to the output array Result.

To learn how to create arrays please go to: Ladder > Editor > Variables > Editing in
the Rung

Block Flowchart

Example

WPS v2.5X | 919


Equipments (Devices)

WPS v2.5X | 920


Equipments (Devices)

In the examples above the value of the variable SRC is copied to DST array, according to source
position (POS_SRC), destination (POS_DST) and the lenght to be copied (LEN). The block ends with
success and ENO output is activated.

11.8.5.8.2 DEMUX
Block that creates 16 new BOOL variables from the decomposition of a WORD variable.

Ladder Representation

WPS v2.5X | 921


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Word WORD UINT INT Input variable of 15 bits
ENO BOOL End of operation
VAR_OUTPUT
Bit0 – Bit15 BOOL Bit of the corresponding position of Word

Operation

When this block has a TRUE value in EN, it decomposes the input variable in Word 15 Boolean
values stored in Bit0 to Bit15 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 922


Equipments (Devices)

Example

The example above decomposes the value of MYWORD in Boolean values, which are stored in the
output variables BIT0 to Bit15. The block ends successfully and the ENO output is activated.

WPS v2.5X | 923


Equipments (Devices)

11.8.5.8.3 DEMUX2
Block that creates 32 new BOOL variables from the decomposition of a DWORD variable.

Ladder Representation

Block Structure

WPS v2.5X | 924


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
DWord DWORD UDINT DINT Input variable of 15 bits
VAR_OUTPUT ENO BOOL End of operation
Bit0 – Bit31 BOOL Bit of the corresponding position of Word

Operation

When this block has a TRUE value in EN, it decomposes the input variable in DWord 32 Boolean
values stored in Bit0 to Bit31 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 925


Equipments (Devices)

The example above decomposes the value of MYDWORD in Boolean values, which are stored in the
output variables BIT0 to Bit31. The block ends successfully and the ENO output is activated

11.8.5.8.4 ILOAD
Block which indirectly loads the value of a variable and transfers it to Value.

Ladder Representation

WPS v2.5X | 926


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
DataType# BYTE Data type of the selected variable
Address DWORD UDINT DINT Address of the global variable, as its group
ENO BOOL End of operation
VAR_OUTPUT As selected in
Value Value of the selected variable
DataType#

Operation

When this block has a TRUE value in EN, it loads, in Value, the of the Address variable belonging to
the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 927


Equipments (Devices)

Example

The above example loads the value of the address 40 of group 2 (GLOBAL_SYSTEM%S), which
represents the status of ESC key in UINT format for the VALUE variable. The block ends with
success and ENO output is activated.

11.8.5.8.5 ILOADBOOL
Block that indirectly loads the value of a bit in a global variable address.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be checked
ENO BOOL End of operation
VAR_OUTPUT
Value BOOL Value of the bit selected by the input arguments

Operation

When this block has a TRUE value in EN, it loads, in Value, the Bit contents of the Address variable
belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 928


Equipments (Devices)

Example

The above example loads the value of bit 1 of the address 24 of group 2 (S GLOBAL_SYSTEM%),
which represents the status of ESC key for the VALUE variable. The block ends with success and
ENO output is activated.

11.8.5.8.6 ISTORE
Block that indirectly loads the Value value in a variable.

Ladder Representation

WPS v2.5X | 929


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
DataType# BYTE Data type of the selected variable
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Depending on the
Value selection of the Value to be w ritten in the selected variable
DataType#
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the contents of the Address
variable belonging to the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 930


Equipments (Devices)

Example

The example above stores the VALUE value in WORD format in address 444 of group 3
(GLOBAL_SYSTEM% C), which represents the index of the communication port Modbus TCP. The
block ends with success and ENO output is activated.

11.8.5.8.7 ISTOREBOOL
Block that indirectly loads the Value value in a bit in a global variable address.

Ladder Representation

WPS v2.5X | 931


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be modified
Value BOOL New value of the selected bit
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the Bit contents of the Address
variable belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 932


Equipments (Devices)

Example

The example above stores the value of VALUE in bit 7 of the address 121 in group 3
(GLOBAL_SYSTEM% C), which represents the disable command of CANopen communication. The
block ends with success and ENO output is activated.

11.8.5.8.8 MUX
Block that creates a new WORD variable from the concatenation of 16 BOOL variables.

WPS v2.5X | 933


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit15 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
Word WORD UINT INT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable Word. Bit0 corresponds to LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 934


Equipments (Devices)

Example

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYWORD. The block ends with success and ENO output is activated.

WPS v2.5X | 935


Equipments (Devices)

11.8.5.8.9 MUX2
Block that creates a new DWORD variable from the concatenation of 32 BOOL variables.

Ladder Representation

Block Structure

WPS v2.5X | 936


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit31 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
DWord DWORD UDINT DINT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable DWord. Bit0 corresponds to LSB (least significant bit) and Bit31
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 937


Equipments (Devices)

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYDWORD. The block ends with success and ENO output is activated.

11.8.5.8.10 ReadRecipe
Block that gets the recipe from a recipe file and sends it to a variable.

Ladder Representation

WPS v2.5X | 938


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT FILENAME# STRING Name of the recipe file
INDEX WORD UINT Recipe index to be read
Q BOOL End of operation
ERROR BOOL Error occurrence flag
VAR_OUTPUT
ERRORID BYTE USINT Identifier of the occurred error
DST STRUCT Variable w here the data read w ill be saved
VAR READRECIPE_INST_0 READRECIPE Instance of access to block structure

Operation

When this block identifies a leading edge in Execute, it gets the data from the selected recipe by the
INDEX index in the # FILENAME file and sends them to the DST. If everything goes successfully, Q
receives TRUE and remains so while Execute is TRUE.

NOTE!
Recipes stored in RAM is identified by 'RECIPE_NAME'. Recipes stored on the SD card are
identified by 'RECIPE_NAME.CSV'.

When Execute has FALSE value, DST remains unchanged.

If there is any error in the execution, the Error output is activated and ErrorID displays an error code
according to the table below.

Code Description
1 Incomplete recipe
2 Invalid structure
3 Nonexistent recipe
4 Invalid file
5 Invalid file or nonexistent SD card
6 SD card blocked for w riting
7 SD card busy (log or other use)

Block Flowchart

WPS v2.5X | 939


Equipments (Devices)

Example

WPS v2.5X | 940


Equipments (Devices)

The above example searches the index 3 of the recipe file stored in RAM 'RECIPE_RAM'. The block
does not find the specified file, enabling the ERROR output with ERRORID with value 5 and disabling
the Q output.

The above example searches the index 3 of the recipe file stored in RAM 'RECIPE_RAM'. The block
finds the specified file, but does not find the index 3, enabling the ERROR output with ERRORID with
value 3 and disabling the Q output.

The above example searches the index 3 of the recipe file stored in RAM 'RECIPE_RAM'. The block
finds the file and the specified index, stores values in DST, disables the ERROR output and enables
Q output.

11.8.5.8.11 SCALE
Block that converts a value from a scale to another one.

WPS v2.5X | 941


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Input value to be converted
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MAX_IN Maximum value of input scale
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
MIN_IN Minimum value of input scale
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MAX_OUT Maximum value of output scale
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MIN_OUT Minimum value of output scale
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value on new scale
INT DWORD UDINT DINT REAL

Operation

This block, when it has a TRUE value in EN, by setting the minimum and maximum values of the
variable to be converted and the minimum and maximum values of the new scale variable, defined by
the user, performs the Scale function for the conversion of the variable according to equation:

Where:

and

The graph below represents the straight linearized:

WPS v2.5X | 942


Equipments (Devices)

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
- The value in MAXin must be greater than value in MINin;
- The value in MAXout must be greater than value in MINout ;
- Value in Value according to: MINin = Value = MAXin.

Block Flowchart

Example

The example above stores the value of the variable VALUE in Result. The block considers the
equation described above and ends with success and ENO output is activated.

WPS v2.5X | 943


Equipments (Devices)

11.8.5.8.12 SEL
Block that replicates to the output the value of an input variable (Value0 or Value1) according to the
Selector selection.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Selector BOOL Variable that selects the input

VAR_INPUT BYTE USINT SINT WORD UINT


Value0 Multiplexed input number 1
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value1 Multiplexed input number 2
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value selected
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it replicates to the Result variable the Value0 value if
selector is FALSE or the Value1 value if Selector is TRUE.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 944


Equipments (Devices)

Example

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated.

WPS v2.5X | 945


Equipments (Devices)

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
TRUE level, the RESULT output gets the value of VALUE1. The block ends successfully and the ENO
output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

11.8.5.8.13 STORE
Block that performs direct storage of data from a source to a destination.

Ladder Representation

Block Structure

WPS v2.5X | 946


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
SRC Data source
INT DWORD DINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
DST Data destination
INT DWORD DINT DINT REAL

Operation

When this block has a TRUE value in EN, it stores the contents from SRC into DST.

NOTE!
SRC and DST must have data types of the same size.

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 947


Equipments (Devices)

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated.

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated. Note that the binary pattern is maintained between variables of different
types.

11.8.5.8.14 SWAP
Block that performs a swap between the odd bytes and consecutive even bytes into Value and sends
the value to Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT WORD UINT INT
Value Input variable to be sw apped
DWORD UDINT DINT
ENO BOOL End of operation
VAR_OUTPUT WORD UINT INT DWORD UDINT
Result Output value
DINT REAL (*)

Operation

When this block has a TRUE value in EN, it changes the values of the odd bytes (1, 3, 5 and 7) and
the consecutive even bytes (2, 4, 6 and 8, respectively) of the Value variable, storing the result in
Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTA!
Caution when using in Result a variable of REAL type, because the block does not
perform type conversion, that is, it only reverses the bytes in memory.

Block Flowchart

WPS v2.5X | 948


Equipments (Devices)

Example

The example changes the position of byte 1 value of VALUE (0x44) with byte 2 of VALUE (0x3D),
storing the final result (0x44_3D) in RESULT. The block ends with success and ENO output is
activated.

The example changes the position of byte 1 value of VALUE (0x96) with byte 2 of VALUE (0xA8) and
byte 3 of VALUE (0x0D) with byte 4 of VALUE (0x00), storing the final result (0x0D_00_96_A8) in
RESULT. The block ends with success and ENO output is activated.

11.8.5.8.15 SWAP2
Block that rearranges the bytes of a variable.

WPS v2.5X | 949


Equipments (Devices)

Ladder Representation

Block Structure

Variable type Name Data type Description


EN BOOL Block enabling
WORD UINT INT
Value Input variable to be rearranged
VAR_INPUT DWORD UDINT DINT
Variable that defines the conversion type
Type BYTE
according to Table 2
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT WORD UINT


Result INT DWORD UDINT DINT Output value
REAL (*)
Table 1. Block variables.

Type WORD UINT INT ENO DWORD UDINT DINT ENO


0 AB->AB* TRUE ABCD->ABCD TRUE
1 AB->BA TRUE ABCD->DCBA TRUE
2 - FALSE ABCD->CDAB TRUE
3 - FALSE ABCD->BADC TRUE
4 ... - FALSE - FALSE
Table 2. Conversion type (*characters A, B, C and D represents BYTES).

Operation

When this block has a TRUE value in EN, it rearranges the bytes from Value variable, storing the
result in Result.
Type defines how the bytes will be rearranged, as shown in Table 2.
Note that for 16-bit variables, only options 0 and 1 are valid.
For 32-bit variables the options 0, 1, 2, and 3 are valid.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.
Invalid TYPE options assigns FALSE to ENO, and Result value is not changed.

NOTA!
Caution when using in Result a variable of REAL type, because the block does not
perform type conversion, that is, it only reverses the bytes in memory.

Block Flowchart

WPS v2.5X | 950


Equipments (Devices)

Example

The example rearranges the position of value VALUE_IN according to the type set in TYPE_IN = 1
(AB->BA), storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.8.5.8.16 WriteRecipe
Block that writes a recipe into a recipe file from a variable.

Ladder Representation

WPS v2.5X | 951


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
FILENAME# STRING Name of the recipe file
VAR_INPUT
INDEX WORD UINT Recipe index to be w ritten
SRC STRUCT Variable w here the data is read
Q BOOL End of operation
VAR_OUTPUT ERROR BOOL Error occurrence flag
ERRORID BYTE USINT Identifier of the occurred error
VAR WRITERECIPE_INST_0 WRITERECIPE Instance of access to block structure

Operation

When this block identifies a leading edge in Execute, it gets the data from SRC file and sends them
to the recipe file selected by the INDEX index in the FILENAME#. If everything goes successfully, Q
receives TRUE and remains so while Execute is TRUE.

NOTE!
Recipes stored in RAM is identified by 'RECIPE_NAME'. Recipes stored on the SD card are
identified by 'RECIPE_NAME.CSV'.

If there is any error in the execution, the Error output is activated and ErrorID displays an error code
according to the table below.

Code Description
1 Incomplete recipe
2 Invalid structure
3 Nonexistent recipe
4 Invalid file
5 Invalid file or nonexistent SD card
6 SD card blocked for w riting

Block Flowchart

WPS v2.5X | 952


Equipments (Devices)

Example

WPS v2.5X | 953


Equipments (Devices)

The above example attempts to write the contents of SRC in the index 4 of the recipes file stored in
SD card 'RECIPE_SD.CSV'. The block does not find the specified file, enabling the ERROR output
with ERRORID with value 5 and disabling the Q output.

The above example attempts to write the contents of SRC in the index 4 of the recipes file stored in
SD card 'RECIPE_SD.CSV'. The block finds the specified file, but does not find the index 4, enabling
the ERROR output with ERRORID with value 3 and disabling the Q output.

The above example attempts to write the contents of SRC in the index 4 of the recipes file stored in
SD card 'RECIPE_SD.CSV'. The block finds the file and the specified index, stores values in the
recipe, disables the ERROR output and enables Q output.

WPS v2.5X | 954


Equipments (Devices)

11.8.5.9 Filter
11.8.5.9.1 LOWPASS
Block that filters the input using a low pass filter of first order and inserts the result in the output.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Input REAL Input signal
VAR_INPUT
Tau REAL Filter time constant
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Filter output
VAR LOWPASS_INST_0 LOWPASS Instance of access to block structure

Operation

When this block has a TRUE value in EN, filters the input value of Input using a low pass first order
filter described by Tau and Ts#, inserting the result in Output. On the leading edge of EN, Output
receives zero.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 955


Equipments (Devices)

Example

The above example causes OUTPUT, by identifying a leading edge in EN, to display a behavior of first
order with time constant equal to Tau and the sampling time of 2 ms, in order to achieve the reference
set to INPUT. At each calculation completed successfully, the ENO output is activated.

WPS v2.5X | 956


Equipments (Devices)

11.8.5.10 Hardware
11.8.5.10.1 IMMEDIATE_INPUT
Block that performs an instantaneous reading of the selected input value, without changing the value
of images (GLOBAL_IO variables).

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Source# BYTE Inputs to be read (digital or analog)
ENO BOOL Output enabling
VAR_OUTPUT
Destination WORD INT UINT Variable mapped w ith the values of the inputs selected

Operation

When this block has a TRUE value in EN, it gets the immediate value of the selected input in
Source#. If selected the analog input AI1, its value is passed on to Destination. If the digital input is
selected, its bits are concatenated so that DI1 be the least significant bit and DI10 be the most
significant bit and the result is sent to Destination.

When EN has FALSE value, Destination remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 957


Equipments (Devices)

Example

The example above is an immediate reading of the signs of the digital inputs DI1 to DI10 of the
PLC300. This reading is then interpreted as a binary sequence with DI1 being the least significant bit
and the result is sent to the DESTINATION variable. The block ends with success, ENO output is
activated.

WPS v2.5X | 958


Equipments (Devices)

11.8.5.10.2 IMMEDIATE_OUTPUT
Block that performs an instantaneous reading of the selected output port, without changing the value
of images (GLOBAL_IO variables).

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Variable mapped w ith the values to be sent to the
Source WORD INT UINT
selected outputs
ENO BOOL Output enabling
VAR_OUTPUT
Destination# BYTE Outputs to be w ritten (digital or analog)

Operation

When this block has a TRUE value in EN, it writes immediately in the selected output the value of
Source. If selected analog output AO1, the Source value is passed on to it. If the digital outputs are
selected, DO1 will receive the zero bit of Source, DO2 bit one, DO3 bit two, and so on.

When EN has FALSE value, Destination# remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 959


Equipments (Devices)

Example

WPS v2.5X | 960


Equipments (Devices)

The above example is for immediate SOURCE written value, interpreted as a binary sequence, the
digital outputs DO1 to DO9 of the PLC300 and DO1 receives the value of the least significant bit. The
block ends with success, ENO output is activated. Note that the immediate writing does not prevail
over direct coil DO1 or over enabling coils in DO2, DO3 and DO4.

11.8.5.10.3 P_RAMP
Block that generates a PWM signal with a certain numer of pulses at the digital output DO9,
respecting a ramp of rise and fall in frequency..

Ladder Representation

Block Structure

WPS v2.5X | 961


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
Pulses DWORD UDINT Total number of pulses of the block execution
VAR_INPUT Frequency DWORD UDINT Maximum frequency to be reached
Time DWORD UDINT Ramp time [ms]
Steps BYTE USINT Steps to increase frequency
VAR_OUTPUT DONE BOOL Output enabling
VAR P_RAMP_INST_0 P_RAMP Instance of access to block structure

Operation

When the EN input is TRUE, the block generates a PWM signal at output DO9. Initially, it generates
a rise ramp, ranging from zero frequency to Frquency value (between 0 and 200 KHz), based on the
Time and Steps settings. At the appropriate time, the block generates a descent ramp, with the same
profile as the rise ramp, until the frequency is zero and the Pulses value is reached.

When the Pulses value is reached, the DONE output goes to TRUE.

If the EN input goes to FALSE before reaching the Pulses number, the PWM generation stops
immediately.

WPS v2.5X | 962


Equipments (Devices)

The duty cycle of the signal remains constant at 0.5 throught the block execution.

For wich the frequency ramp is generated, it is necessary thet the number of Steps is less or equal
than to a quarter of the Frequency value, that is:
Steps = (1/4) . Frequency

If this limitation is not respected, the frequency ramp will not be generated. It means that PWM signal
goes directly to the Frequency value.

Example: If the Frequency value is 100 Hz, for the frequency ramp to be generated, the number of
Steps must be less or equal than 25.

NOTE!
Having other PWM blocks running, whichever is called first will have priority.

NOTE!
This block has priority over any coil that is writing data in DO9.

Compatibility

Device Version
PLC300 2.00 or higher

Block Flowchart

WPS v2.5X | 963


Equipments (Devices)

WPS v2.5X | 964


Equipments (Devices)

Example

The above example enables a PWM signal in DO9 output with initial frequency 0 Hz and duty cycle of
50%. The rise time of the ramp frequency is 500 ms, and the ramp has 5 frequency steps (0, 50, 100,
150 and 200 Hz). In total executing the block, 1000 pulses will be sent to the output. The block ends
with success, Q output is activated.

11.8.5.10.4 PWM
Block that inserts a PWM signal on digital output DO9.

Ladder Representation

Block Structure

WPS v2.5X | 965


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Frequency DWORD UDINT Frequency of the PWM
Width WORD Pulse Width
VAR_OUTPUT Q BOOL Output enabling
VAR PWM_INST_0 PWM Instance of access to block structure

Operation

When this block has a TRUE value in EN, it inserts into DO9 a PWM signal with a given frequency in
Frequency (between 0 and 300 kHz) and pulse width determined by Width (between 0 and 1000,
where 1000 would be 100% active cycle).

NOTE!
This block has priority over any coil that is writing data in DO9.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 966


Equipments (Devices)

The above example enables a PWM signal in DO9 output with frequency 500 Hz and duty cycle of
20%. The block ends with success, Q output is activated.

11.8.5.10.5 READENC
Block that continuously reads the pulse value of an encoder according to a type of reading chosen.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Source# BYTE Counting source
ENO BOOL Output enabling
VAR_OUTPUT
Value DINT DWORD UDINT Counting value
VAR READENC_INST_0 READENC Instance of access to block structure

Operation

When this block has a TRUE value in EN, it gets the number of pulses counted in the encoder, as
selected in Source #, and transfers them to Value. At each leading edge, Value is reset to zero.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 967


Equipments (Devices)

Example

The above example, when identifying a leading edge on DI1, starts counting the number of pulses in
the encoder connected in quadrature conformation AB, storing the value in VALUE. The block ends
with success, ENO output is activated.

11.8.5.10.6 READENC2
Block that reads the pulse value of an encoder according to a type of reading chosen, interpreting it
as a fraction of revolutions.

Ladder Representation

Block Structure

WPS v2.5X | 968


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Source# BYTE Counting source
Pulses DWORD UDINT Maximum number of pulses in a turn
ENO BOOL Output enabling
VAR_OUTPUT
Value DINT DWORD UDINT Counting value
VAR READENC2_INST_0 READENC2 Instance of access to block structure

Operation

When this block has a TRUE value in EN, it gets the number of pulses counted in the encoder, as
selected in Source #, and transfers them to Value. At each leading edge, Value is reset to zero.
When Value increases and reaches the value of Pulses, Value receives zero. When Value
decrements and tends to reach a value of -1, Value receives the value in Pulses. This way, Value
always displays the result in fraction of revolutions.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 969


Equipments (Devices)

Example

The above example, when identifying a leading edge on DI1, starts counting the number of pulses in
the encoder connected in quadrature conformation AB. PULSES_IN_TURN is the value of pulses to
complete a turn. If the value read is higher, the counting restarts from zero. If the value read is

WPS v2.5X | 970


Equipments (Devices)

negative, counting restarts from PULSES_IN_TURN. The resulting value is stored in VALUE. The
block ends with success, ENO output is activated.

11.8.5.10.7 READENC3
Block that reads the value of pulses from an encoder according to a chosen type of reading,
calculating differentials between calls to the block.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Source# BYTE Counting source
ENO BOOL Output enabling
Value DINT DWORD UDINT Counting value
VAR_OUTPUT
Difference betw een the previous counting and current
Delta DINT DWORD UDINT
counting

Operation

When this block has a TRUE value in EN, it gets the number of pulses counted in the encoder since
energizing of the PLC300, as selected in Source#, and transfers them to Value. The value of Delta is
the difference between the pulses counted in this run and the previous run.

When EN has FALSE value, Value and Delta remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 971


Equipments (Devices)

Example

The example above when identifying a leading edge on DI1, gets the number of pulses on input A
since the energizing of the equipment, storing the value in VALUE. The difference between the current
value and the value previously read is stored in DIFFERENCE. The block ends with success, ENO
output is activated.

11.8.5.10.8 READENC4
Block that reads the value of pulses from an encoder according to a chosen type of reading,
displaying to the user his current position in revolutions and the speed in RPM.

Ladder Representation

Block Structure

WPS v2.5X | 972


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SOURCE# BYTE Counting source
VAR_INPUT
PPR WORD Number of pulses corresponding to a turn
FILTER REAL Time constant of the input filter
ENO BOOL Output enabling
VAR_OUTPUT SPEED REAL Speed in RPM
POSITION REAL Current position of the encoder, in revolutions
VAR READENC4_INST_0 READENC4 Instance of access to block structure

Operation

When this block has a TRUE value in EN, it gets the number of encoder pulses counted since
energization of the PLC300 as selected on SOURCE #, and calculates the number of absolute
revolutions through the PPR argument, inserting the result in POSITION. The value of SPEED is
calculated by means of an internal time base of the block. Further, the block allows filtering of the
signal with an output filter determined by FILTER.

When EN has FALSE value, POSITION and SPEED remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 973


Equipments (Devices)

Example

The example above when identifying a leading edge on DI1, gets the number of pulses of the encoder
connected in quadrature conformation in the fast inputs since energization equipment.
PULSES_IN_TURN is the value of pulses to complete a turn. TURNS stores the value of the pulses
interpreted as revolutions, according PULSES_IN_TURN, and SPEED stores the current speed of the
encoder. The block ends with success, ENO output is activated.

11.8.5.11 Logic
11.8.5.11.1 Logic Bit
11.8.5.11.1.1 RESETBIT
Logical block used to perform reset of a specific bit in a field.

WPS v2.5X | 974


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, resets the bit indicated in Position in the Data variable
that is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the reset of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 975


Equipments (Devices)

Example

The example above resets the bit of AUX zero position, whose initial value is 200 (1100 1000, in
binary). Since this bit already had FALSE value, nothing has changed.

The example above resets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above resets the bit in position nine of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 976


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.8.5.11.1.2 SETBIT
Logical block used to perform the set of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, sets the bit indicated in Position in the Data variable that
is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the set of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 977


Equipments (Devices)

Example

The example above sets the bit of AUX zero position, whose initial value is 153 (1001 1001, in binary).
Since this bit already had TRUE value, nothing has changed.

The example above sets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above sets the bit in position fifteen of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 978


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.8.5.11.1.3 TESTBIT
Logical block that revolutions the value of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
Data WORD UINT INT Variable w hose bit w ill be tested
DWORD UDINT DINT
VAR_INPUT
EN BOOL Block enabling
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT Q BOOL Value of the tested bit

Operation

This block when it has a TRUE value in EN, sends to the output Q the bit value indicated in Position
in the Data variable.

When EN has FALSE value, Q also receives FALSE.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 979


Equipments (Devices)

Example

The example above sets the bit value of zero position of AUX, whose initial value is 74 (0100 1010 in
binary) to the output Q. Since this bit has value 0, the output is disabled.

The example above sets the value of the bit of position three of AUX to the output Q. Since this bit
has value 1, the output is enabled.

The example above sets the bit value of position ten of AUX to output Q. Since AUX is a variable of
BYTE type, it has only eight bits. Thus, the example above creates a runtime error in the block and
therefore the output is disabled.

WPS v2.5X | 980


Equipments (Devices)

11.8.5.11.2 Logic Boolean


11.8.5.11.2.1 AND
Logical block that performs an boolean "and" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “and” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 981


Equipments (Devices)

Example

The example above performs an "and" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.8.5.11.2.2 NOT
Block that performs a logical operation of boolean "not" in a variable, storing the result in another.

Ladder Representation

Block Structure

WPS v2.5X | 982


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling

VAR_INPUT BYTE USINT SINT


Value WORD UINT INT Reference variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the denied Boolean value of
the Value input variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The example above performs a boolean "not" operation in AUX, storing the result in AUX2.

WPS v2.5X | 983


Equipments (Devices)

11.8.5.11.2.3 OR
Logical block that performs an Boolean "or" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “or” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 984


Equipments (Devices)

Example

The example above performs an "or" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.8.5.11.2.4 XNOR
Logical block that performs an Boolean "not exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

WPS v2.5X | 985


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “denied exclusive or”
Boolean operation of input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 986


Equipments (Devices)

The example above performs a "denied exclusive or" Boolean operation between AUX and AUX2,
storing the result in AUX3.

11.8.5.11.2.5 XOR
Logical block that performs an Boolean "exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “xor” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 987


Equipments (Devices)

Example

The example above performs a "xor" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.8.5.11.3 Logic Rotate


11.8.5.11.3.1 ROL
Block that performs a logical left rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 988


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical left shifts, according to the Shift value. The most significant bits
that are being discarded are returned to the least significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 989


Equipments (Devices)

Example

The above example performs a logical left shift by one position in the VALUE variable whose initial
value is -100 (1001 1100 in binary). The discarded bits on the left are reinserted on the right. The final
result (0011 1001 in binary) is stored in RESULT.

The above example performs a logical left rotation by five positions in the VALUE variable whose initial
value is 21 (0001 0101 in binary). The discarded bits on the left are reinserted on the right. The final
result (1010 0010 in binary) is stored in RESULT.

11.8.5.11.3.2 ROR
Block that performs a logical right rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 990


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical right shifts, according to the Shift value. The least significant bits
that are being discarded are returned to the most significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 991


Equipments (Devices)

Example

The above example performs a logic right shift by one position in the VALUE variable whose initial
value is -128 (1000 0000 in binary). The discarded bits on the right are reinserted on the left. The final
result (0100 0000 in binary) is stored in RESULT. Notice that the sign is not preserved in this
operation.

The above example performs a logical right rotation by one position in the VALUE variable whose
initial value is -127 (1000 0001 in binary). The discarded bits on the right are reinserted on the left. The
final result (1100 0000 in binary) is stored in RESULT.

11.8.5.11.4 Logic Shift


11.8.5.11.4.1 ASHL
Block that performs a binary left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 992


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic left shifts, according to the Shift value.

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 993


Equipments (Devices)

Description of exemple.

Description of exemple.

11.8.5.11.4.2 ASHR
Block that performs arithmetic left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic right shifts, according to the Shift value.

WPS v2.5X | 994


Equipments (Devices)

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example performs an arithmetic right shift by three positions in the VALUE variable whose
initial value is 52 (0011 0100 in binary). The bits on the right are being discarded, and on the left new
zeros are inserted. The final result (0000 0110 in binary) is stored in RESULT.

WPS v2.5X | 995


Equipments (Devices)

The above example performs an arithmetic right shift by two positions in the VALUE variable whose
initial value is -79 (1011 0001 in binary). The bits on the right will be discarded and new ones on the
left are inserted, since the arithmetic right shifts preserve the sign of the variable. The final result
(1111 0110 in binary) is stored in RESULT.

The above example performs an arithmetic right shift by thirteen positions in the VALUE variable
whose initial value is -128 (1000 0000 in binary). The bits on the right are being discarded, and on the
left new ones are inserted. The final result (1111 1111 in binary) is stored in RESULT.

11.8.5.11.4.3 SHL
Block that performs a binary logical left shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 996


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts left, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 997


Equipments (Devices)

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is 56 (0011 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (0011 1000 0000 in binary) is stored in RESULT.

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is -56 (1100 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (1100 1000 0000 in binary) is stored in RESULT. Since RESULT is SINT
type, it only accepts the first eight bits (1000 0000).

11.8.5.11.4.4 SHR
Block that performs a binary logical right shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 998


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts right, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 999


Equipments (Devices)

The above example performs a logical right shift by two positions in the VALUE variable whose initial
value is 124 (0111 1100 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 1111 in binary) is stored in RESULT.

The above example performs a logical right shift by three positions in the VALUE variable whose initial
value is -98 (1001 1110 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 0011 in binary) is stored in RESULT.

11.8.5.12 Math
11.8.5.12.1 Math Basic
11.8.5.12.1.1 ABS
Block that calculates the Value module, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the absolute value of the

WPS v2.5X | 1000


Equipments (Devices)

Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the absolute value of the VALUE variable whose initial value is -45,
storing the final result, 45, in RESULT.

The above example calculates the absolute value of the VALUE variable whose initial value is -45. The
final result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by
SINT type. Therefore, RESULT remains unchanged and the output is disabled.

WPS v2.5X | 1001


Equipments (Devices)

11.8.5.12.1.2 ADD
Block that calculates the sum of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First addend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second addend of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sum of Value1 and Value2
variables. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1002


Equipments (Devices)

Example

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT.

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1003


Equipments (Devices)

The above example calculates the sum of VALUE1 and VALUE2 variables. The final result -170
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.8.5.12.1.3 DIV
Block that calculates the division of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the division of Value1 and
Value2 variables. The value stored will be the exact division if Result is REAL, or, in other cases, only
the quotient. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1004


Equipments (Devices)

Example

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is of REAL type, the exact value of the division is stored in it.

WPS v2.5X | 1005


Equipments (Devices)

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it. Notice that the block
accepts arguments of both signs.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains unchanged
and the output is disabled.

11.8.5.12.1.4 MOD
Block that calculates the remainder of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT operation

Operation

WPS v2.5X | 1006


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the remainder of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

WPS v2.5X | 1007


Equipments (Devices)

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains
unchanged and the output is disabled.

11.8.5.12.1.5 MUL
Block that calculates the multiplication of the values of Value1 and Value2, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First factor of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second factor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

WPS v2.5X | 1008


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the multiplication of Value1
and Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT.

WPS v2.5X | 1009


Equipments (Devices)

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the product of VALUE1 and VALUE2 variables. The final result 224
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.8.5.12.1.6 NEG
Block that calculates the opposite (i.e., the product with -1) of a value passed by Value, storing the
result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the opposite of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1010


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the opposite of the VALUE variable whose initial value is 21, storing
the final result, -21, in RESULT.

The above example calculates the opposite of the VALUE variable whose initial value is -56, storing
the final result, 56, in RESULT.

WPS v2.5X | 1011


Equipments (Devices)

The above example calculates the opposite of the VALUE variable whose initial value is -128. The final
result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by SINT
type. Therefore, RESULT remains unchanged and the output is disabled.

11.8.5.12.1.7 SUB
Block that calculates the subtraction between the Value1 and Value2 values, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Minuend of operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Subtrahend of operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the subtraction of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1012


Equipments (Devices)

Example

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1013


Equipments (Devices)

The above example calculates the subtraction of VALUE1 and VALUE2 variables. The final result 141
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.8.5.12.2 Math Extended


11.8.5.12.2.1 ALOG10
Block that calculates the antilogarithm (exponent with base 10) of the Value value, storing the result
in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the antilogarithm of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1014


Equipments (Devices)

Example

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the minimum input value for which the block revolutions a nonzero
result. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in

WPS v2.5X | 1015


Equipments (Devices)

RESULT. Below the minimum values cause the block to return a null value. The block ends with
success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the maximum input value for which the block revolutions a valid result.
The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. Values higher than the maximum cause the block to generate an error, the RESULT output
remains unchanged and Done output is disabled.

11.8.5.12.2.2 EXP
Block that calculates the exponential of the Euler number "and" raised to the value of Value, storing
the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the exponent of the Euler
number "and" raised to the Value variable. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1016


Equipments (Devices)

Block Flowchart

Example

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the minimum input value for which the block revolutions a nonzero result. The
block ends with success and Done output is activated.

WPS v2.5X | 1017


Equipments (Devices)

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values below the minimum cause the block to return to a null value. The block ends with success
and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the maximum input value for which the block revolutions a valid result. The
block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values higher than the maximum cause the block to generate an error, the RESULT output remains
unchanged and Done output is disabled.

11.8.5.12.2.3 LN
Block that calculates the natural logarithm of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the natural logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1018


Equipments (Devices)

Block Flowchart

Example

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has value zero, and Done output is
disabled.

WPS v2.5X | 1019


Equipments (Devices)

11.8.5.12.2.4 LOG10
Block that calculates the common logarithm (base 10) of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the common logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1020


Equipments (Devices)

Example

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.8.5.12.2.5 POW
Block that calculates the value of Value raised to the exponent Power, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value REAL Base of the operation
Power REAL Exponent of the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to
the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1021


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

WPS v2.5X | 1022


Equipments (Devices)

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. Since the result is higher than the maximum supported by REAL type, the block
generates an error and Done output is disabled.

11.8.5.12.2.6 ROUND
Block that rounds the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the rounded value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1023


Equipments (Devices)

Example

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals less than 0.5 are discarded. The block ends with success and Done output is activated.

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals greater than or equal to 0.5 promote unity value immediately above. The block ends with
success and Done output is activated.

11.8.5.12.2.7 SQRT
Block that calculates the square root value of Value, storing the result in Result.

Ladder Representation

WPS v2.5X | 1024


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the square root value of
Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1025


Equipments (Devices)

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.8.5.12.2.8 TRUNC
Block that truncates the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the truncated value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

WPS v2.5X | 1026


Equipments (Devices)

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

Example

The above example truncates the value of the VALUE variable, storing the final result in RESULT.
Decimals are discarded. The block ends with success and Done output is activated.

11.8.5.12.3 Math Trigonometry


11.8.5.12.3.1 ACOS
Block that calculates the arccosine of Value, storing the result in Angle.

Ladder Representation

Block Structure

WPS v2.5X | 1027


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of cosine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose cosine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arccosine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1028


Equipments (Devices)

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block generates a runtime error, since VALUE has value inferior to 1, and
Done output is disabled.

11.8.5.12.3.2 ASIN
Block that calculates the arcsine of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of sine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose sine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arcsine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1029


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block generates a runtime error, since VALUE has value superior to 1, and
Done output is disabled.

WPS v2.5X | 1030


Equipments (Devices)

11.8.5.12.3.3 ATAN
Block that calculates the arctangent of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of tangent
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1031


Equipments (Devices)

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for positive values, is always in the first quadrant. The block ends with
success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for negative values, is always in the fourth quadrant. The block ends
with success and Done output is activated.

11.8.5.12.3.4 ATAN2
Block that calculates the arctangent of Y/X, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT X REAL Parameter X of the function
Y REAL Parameter Y of the function
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to (Y/X) (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Y/X. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1032


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and Y, is always in the first quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final

WPS v2.5X | 1033


Equipments (Devices)

result in RESULT. The arc, for negative values of X and positive values of Y, is always in the second
quadrant. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for negative values of X and Y, is always in the third quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and negative values of Y, is always in the fourth
quadrant. The block ends with success and Done output is activated.

11.8.5.12.3.5 COS
Block that calculates the cosine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the cosine of Angle. If no

WPS v2.5X | 1034


Equipments (Devices)

errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1035


Equipments (Devices)

11.8.5.12.3.6 SIN
Block that calculates the sine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sine of Angle. If no errors,
the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE
status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1036


Equipments (Devices)

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts negative input values.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts values greater than one full turn.

11.8.5.12.3.7 TAN
Block that calculates the tangent of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

WPS v2.5X | 1037


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the tangent of Angle. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1038


Equipments (Devices)

11.8.5.12.4 Math Util


11.8.5.12.4.1 MAX
Block that compares the values of Value1 and Value2 and stores the highest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Highest of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the highest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1039


Equipments (Devices)

Example

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1040


Equipments (Devices)

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is higher than the maximum supported by SINT type, the
block generates an error and Done output is disabled.

11.8.5.12.4.2 MIN
Block that compares the values of Value1 and Value2 and stores the lowest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Low est of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the lowest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1041


Equipments (Devices)

Example

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1042


Equipments (Devices)

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is lower than the minimum supported by SINT type, the
block generates an error and Done output is disabled.

11.8.5.12.4.3 SAT
Block that performs a routine for saturation of the value found in Value in accordance with the limits
for Minimum and Maximum, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Reference value
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
Minimum Inferior saturation value
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Maximum Superior saturation value
INT DWORD UDINT DINT REAL
Indicator that there w as saturation in the
Q BOOL
process
VAR_OUTPUT
BYTE USINT SINT WORD UINT
Result Result of operation
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and
Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of
Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q
receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If
there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with
its value unchanged.

WPS v2.5X | 1043


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1044


Equipments (Devices)

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or
higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no
saturation.

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

WPS v2.5X | 1045


Equipments (Devices)

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM.
The block ends successfully and the Q output is activated, since there was saturation.

11.8.5.13 Module
11.8.5.13.1 CALL
Block that loads a file and do a ladder call.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Ladder file name (POU) enclosed in gingle
FILENAME# STRING
quotation marks
VAR_OUTPUT ENO BOOL End of operation
VAR CALL_INST_0 CALL Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine loading the file and updates the values of the outputs after
completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

WPS v2.5X | 1046


Equipments (Devices)

Device Version
PLC300 4.03 or higher

Block Flowchart

Example

In the example below, the POU 'Program2' will be executed through the 'Main Ladder'.

11.8.5.13.2 USERFB
Block that performs a subroutine programmed by the user.

Ladder Representation

Block Structure

WPS v2.5X | 1047


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT According to user
INPUT Block inputs
programming
ENO BOOL End of operation
VAR_OUTPUT According to user
OUTPUT Block outputs
programming
According to user
VAR_IN_OUT IN_OUT Block inputs/outputs
programming
VAR MYUSERFB_INST_0 MYUSERFB Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine programmed by the user and updates the values of the outputs
after completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Refer to section Working with USERFBs for further information.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1048


Equipments (Devices)

11.8.5.14 RTC
11.8.5.14.1 INTIME
Block that performs a programmed enabling for a time based on RTC (Real Time Clock).

Ladder Representation

Block Structure

WPS v2.5X | 1049


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
TIMEON_HOUR WORD UINT Enabling hour
TIMEON_MINUTE WORD UINT Enabling minute
TIMEON_SECOND WORD UINT Enabling second
VAR_INPUT
TIMEOFF_HOUR WORD UINT Disabling hour
TIMEOFF_MINUTE WORD UINT Disabling minute
TIMEOFF_SECOND WORD UINT Disabling second
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled when the internal clock's time is equal to that defined by the parameters TIMEON and
disabled when the internal clock's time is equal to the parameters set by TIMEOFF. If Q_OPTION# is
Inverted, Q is disabled when the internal clock's time is equal to that defined by the parameters
TIMEON and enabled when the internal clock's time is equal to the parameters set by TIMEOFF.

When EN has FALSE value, Q remains FALSE.

Block Flowchart

WPS v2.5X | 1050


Equipments (Devices)

Example

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is lower than the registered enabling
inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is disabled.

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
enabling inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is
disabled.

WPS v2.5X | 1051


Equipments (Devices)

In the above example, the INTIME block is disabled. This way, regardless of the input, the Q output is
disabled.

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). This way, the Q
output is enabled.

WPS v2.5X | 1052


Equipments (Devices)

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is superior to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). Thus, the Q output is
disabled.

11.8.5.14.2 INWEEKDAY
Block that performs a programmed enabling for weekdays based on RTC (Real Time Clock).

Ladder Representation

Block Structure

WPS v2.5X | 1053


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SUNDAY# BOOL Enabled on Sundays
MONDAY# BOOL Enabled on Mondays
TUESDAY# BOOL Enabled on Tuesdays
VAR_INPUT WEDNESDAY# BOOL Enabled on Wednesdays
THURSDAY# BOOL Enabled on Thursdays
FRIDAY# BOOL Enabled on Fridays
SATURDAY# BOOL Enabled on Saturdays
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled if the day of week of the internal clock has Enabled parameter in the block. If Q_OPTION#
is Inverted, Q is disabled if the day of week of the internal clock has Enabled parameter in the block.

When EN has FALSE value, Q remains FALSE.

NOTE!
The weekdays are identified by numbers, with Sunday being day 0 and Saturday day 6.

Block Flowchart

WPS v2.5X | 1054


Equipments (Devices)

Example

WPS v2.5X | 1055


Equipments (Devices)

In the above example, the INWEEKDAY block is disabled. This way, regardless of the input, the Q
output is disabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Wednesday (value
3), which has ENABLED status in the programming. This way, the Q output is enabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. Thus, the Q output is disabled.

WPS v2.5X | 1056


Equipments (Devices)

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
INVERTED operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. This way, the Q output is enabled.

11.8.5.15 Screen
11.8.5.15.1 SETSCREEN
Block that displays a particular screen in the HMI.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE UINT
NUMBER Screen number to be displayed
USINT WORD
VAR_OUTPUT Q BOOL Block output
VAR SETSCREEN_INST_0 SETSCREEN Instance of access to block structure

Operation

When this block detects a leading edge on EN, it displays the screen represented by the HMI
NUMBER.
Q receives TRUE for one scan cycle if the screen number is valid.

When EN has FALSE value, Q remains FALSE.

Block Flowchart

WPS v2.5X | 1057


Equipments (Devices)

Example

The following example enables screen 3 by 4 seconds at each pulse in DI1.

In the beginning, it is considered TELA_3 with FALSE value, activating the input
SETSCREEN_INST_0 block that displays the HOME.

WPS v2.5X | 1058


Equipments (Devices)

By identifying a pulse in DI1, TELA_3 receives TRUE value, activating the input SETSCREEN_INST_1
block that displays screen 3.

Even with the signal DI1 removed, TELA_3 continues with the TRUE value, that is, the screen 3
remains displayed.

After the four seconds if DI1 is still TRUE, the HOME screen is still displayed. Screen 3 will only be
displayed when there is a new leading edge in DI1.

11.8.5.16 String
11.8.5.16.1 STR_COMPARE
Block that performs the comparison between STRINGs.

Ladder Representation

WPS v2.5X | 1059


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
STR1 STRING First STRING of the comparison
VAR_INPUT
STR2 STRING Second STRING of the comparison
SENSITIVE BOOL Selects w hether the comparison w ill be case insensitive or not
DONE BOOL Output enabling
VAR_OUTPUT
COMP BYTE Value of comparison

Operation

This block remains active as long as EN is at TRUE level by updating the value of COMP according to
the input STRINGs. The SENSITIVE input with value TRUE forces the comparison to consider
uppercase and lowercase letters, while a FALSE value ignores this differentiation. The values that
COMP can take are:
0, if both are the same;
-1, if STR1 comes first in alphabetical order;
1, if STR1 comes after in alphabetical order.
The comparison takes into account the values of the ASCII table for the characters.

The DONE value forwards to the next Ladder block the EN value when the operation is completed.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1060


Equipments (Devices)

Example

In the above example, the ASCII code for 'a', first character of STR1, is smaller than that of 'c', first

WPS v2.5X | 1061


Equipments (Devices)

character of STR2. Thus, COMP receives the value -1. When the block is finished successfully, the
DONE output is activated.

In the above example, the ASCII code for 'a', first character of STR1, is greater than that of '.', first
character of STR2. Thus, COMP receives the value 1. When the block is ended successfully, the
DONE output is activated.

In the example above, STR1 and STR2 are the same. Therefore, COMP receives the value of 0. When
the block ends successfully, Done output is activated.

In the example above, STR1 and STR2 are the same, disregarding uppercase and lowercase
(SENSITIVE with FALSE value). Therefore, COMP receives the value of 0. When the block ends
successfully, Done output is activated.

WPS v2.5X | 1062


Equipments (Devices)

In the example above, STR1 and STR2 are the different, considering uppercase and lowercase
(SENSITIVE with FALSE value). The ASCII code for 'a', first character of STR1, is greater than that of
'A', first character of STR2. Thus, COMP receives the value 1. When the block is ended successfully,
the DONE output is activated.

11.8.5.16.2 STR_CONCAT
Block that performs concatenation of STR1 and STR2, storing the result in DST.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT STR1 STRING First STRING
STR2 STRING Second STRING
DONE BOOL Output enabling
VAR_OUTPUT Variable that receives the new STRING formed from the junction
DST BYTE
of STR1 and STR2

Operation

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input STRINGs. DST receives STR1 value concatenated with STR2 value at its end.

The DONE value forwards to the next Ladder block the EN value when the operation is completed.

NOTE!
If the size of DST is less than the sum of the number of characters STR1 and STR2, the resulting
value will be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1063


Equipments (Devices)

Example

In the above example, STR1 and STR2 are concatenated, and the result is sent to DST_10. When the
block is ended successfully, the DONE output is activated.

In the above example, STR1 and STR2 are concatenated, and the result is sent to DST_6. Since the
size of DST_6 is 6, the last two characters of the concatenation are discarded. The block ends
successfully, Done output is activated.

11.8.5.16.3 STR_COPY
Block that performs a copy of a section of STR, storing the result in DST.

Ladder Representation

Block Structure

WPS v2.5X | 1064


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
STR STRING Original STRING
VAR_INPUT
POS BYTE Position from w hich the copy w ill begin
LEN BYTE Number of characters to be copied from POS
DONE BOOL Output enabling
VAR_OUTPUT
DST BYTE Variable that receives the new STRING

Operation

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input parameters. DST receives a number of characters from STR1 defined by LEN from the inserted
position in POS.

If POS is outside the allowable range of values (between 1 and the size of STR), DONE receives
FALSE and DST remains unchanged.

If successful, the DONE value forwards to the next Ladder block the EN value when the operation is
completed.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

NOTE!
If the size of DST is less than the number of characters copied from STR, the resulting value will
be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1065


Equipments (Devices)

Example

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

WPS v2.5X | 1066


Equipments (Devices)

In the example above, two characters are copied from position 1 of STR1, and the result is sent to
DST_2. When the block is ended successfully, the DONE output is activated.

In the example above, zero characters are copied from position 1 of STR1, and the result is sent to
DST_2. When the block is ended successfully, the DONE output is activated. Note that, when LEN is
zero, the output is always built as a null STRING.

In the example above, two characters are copied from position 4 of STR1, and the result is sent to
DST_2. When the block is ended successfully, the DONE output is activated. Note that if POS + LEN
is greater than the size of STR1, only the remaining characters from STR1 are copied, without
generating an error.

In the example above, three characters are copied from position 2 of STR1, and the result is sent to
DST_2. Since the size of DST_2 is 2, the last character copied is discarded. The block ends
successfully, Done output is activated.

11.8.5.16.4 STR_COPY_LAST
Block that performs a copy of a final section of STR, storing the result in DST.

Ladder Representation

WPS v2.5X | 1067


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT STR STRING Original STRING
LEN BYTE Number of characters to be copied from the end of STR
DONE BOOL Output enabling
VAR_OUTPUT
DST BYTE Variable that receives the new STRING

Operation

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input parameters. DST receives a number of characters from STR1 defined by LEN from the final
position of STR, returning toward the beginning.

The DONE value forwards to the next Ladder block the EN value when the operation is completed.

NOTE!
If the size of DST is less than the number of characters copied from STR, the resulting value will
be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1068


Equipments (Devices)

Example

In the example above, zero characters are copied from final position STR1, and the result is sent to
DST_6. When the block is ended successfully, the DONE output is activated. Note that, when LEN is
zero, the output is always built as a null STRING.

In the example above, two characters are copied from final position STR1, and the result is sent to
DST_6. When the block is ended successfully, the DONE output is activated.

WPS v2.5X | 1069


Equipments (Devices)

In the example above, four characters are copied from final position of STR1, and the result is sent to
DST_6. When the block is ended successfully, the DONE output is activated.

In the example above, eight characters are copied from final position STR1, and the result is sent to
DST_6. When the block is ended successfully, the DONE output is activated. Note that if LEN is
greater than the size of STR1, STR1 is copied in full, without generating an error.

In the example above, four characters are copied from final position of STR1, and the result is sent to
DST_2. Since the size of DST_2 is 2, the last two characters copied are discarded. The block ends
successfully, Done output is activated.

11.8.5.16.5 STR_DELETE
Block that deletes part of a section of STR, storing the remainder in DST.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
STR STRING Original STRING
VAR_INPUT
POS BYTE Position from w hich the removal w ill begin
LEN BYTE Number of characters to be removed from POS
DONE BOOL Output enabling
VAR_OUTPUT
DST BYTE Variable that receives the new STRING

Operation

WPS v2.5X | 1070


Equipments (Devices)

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input parameters. A section defined by the POS initial position is removed from STR and a LEN size,
and the final result is stored in DST.

If POS is outside the allowable range of values (between 1 and the size of STR), DONE receives
FALSE and DST remains unchanged.

If successful, the DONE value forwards to the next Ladder block the EN value when the operation is
completed.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

NOTE!
If the size of DST is less than the sum of the number of remaining characters in STR, the
resulting value will be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1071


Equipments (Devices)

Example

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

WPS v2.5X | 1072


Equipments (Devices)

In the example above, two characters are deleted from position 2 of STR1, and the remaining
characters are sent to DST_6. When the block is ended successfully, the DONE output is activated.

In the example above, two characters are deleted from position 4 of STR1, and the remaining
characters are sent to DST_6. When the block is ended successfully, the DONE output is activated.
Note that if POS + LEN is greater than the size of STR1, only the remaining characters are deleted
from STR1, without generating an error.

In the example above, five characters are deleted from position 3 of STR1, and the remaining
characters are sent to DST_6. When the block is ended successfully, the DONE output is activated.
Note that if POS + LEN is greater than the size of STR1, only the remaining characters are deleted
from STR1, without generating an error.

In the example above, one character is deleted from position 1 of STR1, and the remaining characters
are sent to DST_2. Since the size of DST_2 is 2, the last character copied is discarded. The block
ends successfully, Done output is activated.

11.8.5.16.6 STR_FIND
Block that searches for the first occurrence of one STRING in another, returning the position of this
occurrence.

Ladder Representation

WPS v2.5X | 1073


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
STR1 STRING STRING w here the search w ill be performed
VAR_INPUT
STR2 STRING STRING to be searched
START BYTE Initial search position
DONE BOOL Output enabling
VAR_OUTPUT
POS BYTE Position w here STR2 w as found

Operation

This block remains active as long as EN is at TRUE level, updating the value of POS according to the
input parameters.
A search in STR1 is performed, from the START position, by an occurrence of STR2.

If it is found, it inserts into the POS the occurrence of this position, while DONE forwards to the next
Ladder block the value of EN when ending the operation.

If it is not found or START receives value zero, DONE remains FALSE and POS remains unchanged.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1074


Equipments (Devices)

Example

WPS v2.5X | 1075


Equipments (Devices)

In the above example, a search for STR2 in STR1 from position 1 is done. Since STR2 is found in
position 1, POS receives 1. The block ends successfully, the DONE output is activated.

In the above example, as the value of START is invalid, the block is not completed successfully, and
the DONE output is deactivated.

In the above example, a search for STR2 in STR1 from position 2 is done. Since STR2 is found in
position 3, POS receives 3. The block ends successfully, the DONE output is activated.

In the above example, a search for STR2 in STR1 from position 2 is done. Since STR2 is found in
position 3, POS receives 3. The block ends successfully, the DONE output is activated.

In the above example, a search for STR2 in STR1 from position 2 is done. Since STR2 is not found,
POS remains unchanged and the DONE output is activated.

11.8.5.16.7 STR_FIND_LAST
Block that searches for the last occurrence of one STRING in another, returning the position of this
occurrence.

Ladder Representation

WPS v2.5X | 1076


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT STR1 STRING STRING w here the search w ill be performed
STR2 STRING STRING to be searched
DONE BOOL Output enabling
VAR_OUTPUT
POS BYTE Position w here STR2 w as found

Operation

This block remains active as long as EN is at TRUE level, updating the value of POS according to the
input parameters.
A search in STR1 is performed, from its last position, by an occurrence of STR2.

If it is found, it inserts into the POS the occurrence of this position, while DONE forwards to the next
Ladder block the value of EN when ending the operation.

If it is not found, DONE remains FALSE and POS remains unchanged.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1077


Equipments (Devices)

Example

WPS v2.5X | 1078


Equipments (Devices)

In the example above, a search is done by STR2 in STR1 from its final position. Since STR2 is found
in position 4, POS receives 4. The block ends successfully, the DONE output is activated.

In the example above, a search is done by STR2 in STR1 from its final position. Since STR2 is found
in position 2, POS receives 4. The block ends successfully, the DONE output is activated.

In the example above, a search is done by STR2 in STR1 from its final position. Since STR2 is not
found, POS remains unchanged and the DONE output is disabled.

11.8.5.16.8 STR_INSERT
Block that inserts a STRING in certain position of another, returning the resulting STRING.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
STR1 STRING STRING w here the insertion w ill be performed
VAR_INPUT
STR2 STRING STRING to be inserted
POS BYTE Position w here STR2 w ill be inserted
DONE BOOL Output enabling
VAR_OUTPUT
DST STRING Resulting STRING

Operation

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input parameters.
An insertion in STR1 from the defined position POS of the STR2 content is performed.

If POS is outside the allowable range of values (between 1 and the size of STR plus one), DONE
receives FALSE and DST remains unchanged.

WPS v2.5X | 1079


Equipments (Devices)

If successful, the DONE value forwards to the next Ladder block the EN value when the operation is
completed.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

NOTE!
If the size of DST is less than the sum of the number of characters STR1 and STR2, the resulting
value will be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

WPS v2.5X | 1080


Equipments (Devices)

Example

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

WPS v2.5X | 1081


Equipments (Devices)

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

In the example above, an insertion of STR2 into STR1 from position 2 is done, and the result is sent
to DST_10. When the block is ended successfully, the DONE output is activated.

In the example above, is done of an insertion of STR2 into STR1 from position 4, and the result is sent
to DST_6. Since the size of DST_6 is 6, the last two characters copied are discarded. The block ends
successfully, Done output is activated.

11.8.5.16.9 STR_LENGTH
Block that calculates the size of a STRING.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
STR1 STRING Input STRING
DONE BOOL Output enabling
VAR_OUTPUT
LEN BYTE STRING size

Operation

WPS v2.5X | 1082


Equipments (Devices)

This block remains active as long as EN is at TRUE level, updating the value of LEN according to the
identified size of STR.

The DONE value forwards to the next Ladder block the EN value when the operation is completed.

Compatibility

Device Version
PLC300 2.10 or higher

Block Flowchart

Example

In the above example, the length of STRING in STR is calculated and the result is sent to LEN. The
block ends successfully, Done output is activated.

In the above example, the length of STRING in STR is calculated and the result is sent to LEN. The
block ends successfully, Done output is activated. Note that null STRINGS have length zero.

WPS v2.5X | 1083


Equipments (Devices)

11.8.5.16.10 STR_REPLACE
Block that replaced a section of a STRING by another STRING, returning the resulting STRING.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
STR1 STRING STRING w here the replacement w ill take place
VAR_INPUT STR2 STRING STRING to be inserted
POS BYTE Position w here STR2 w ill be inserted
LEN BYTE Number of characters to be replaced by STR2 in STR1
DONE BOOL Output enabling
VAR_OUTPUT
DST STRING Resulting STRING

Operation

This block remains active as long as EN is at TRUE level, updating the value of DST according to the
input parameters.
From the position defined in POS a number of characters defined by LEN are deleted. After that, in
this position, the content of STR2 is inserted.

If POS is outside the allowable range of values (between 1 and the size of STR plus one), DONE
receives FALSE and DST remains unchanged.

If successful, the DONE value forwards to the next Ladder block the EN value when the operation is
completed.

NOTE!
POS is treated with index "based one". That is, POS = 1 references the first position of STR.

NOTE!
If the size of DST is less than the sum of the number of remaining characters of STR1 and STR2,
the resulting value will be truncated.

Compatibility

Device Version
PLC300 2.10 or higher

WPS v2.5X | 1084


Equipments (Devices)

Block Flowchart

Example

WPS v2.5X | 1085


Equipments (Devices)

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

In the above example, as the value of POS is invalid, the block is not completed successfully, and the
DONE output is disabled.

In the example above, a replacement of zero characters from the position 5 of STR1 is done by the
contents of STR2, and the result is sent to DST_10. When the block is ended successfully, the
DONE output is activated. Note that this block acted as a STR_INSERT.

In the example above, a replacement of zero characters from the position 2 of STR1 is done by the
contents of STR2, and the result is sent to DST_10. When the block is ended successfully, the
DONE output is activated. Note that this block acted as a STR_INSERT.

In the example above, a replacement of one character from the position 3 of STR1 is done by the
contents of STR2, and the result is sent to DST_10. When the block is ended successfully, the
DONE output is activated.

WPS v2.5X | 1086


Equipments (Devices)

In the example above, a replacement of eight characters from the position 2 of STR1 is done by the
contents of STR2, and the result is sent to DST_10. When the block is ended successfully, the
DONE output is activated. Note that if POS + LEN is greater than the size of STR1, only the
remaining characters from STR1 are replaced, without generating an error.

11.8.5.17 Timer
11.8.5.17.1 TOF
Timer block that, when energized, disables the output after a delay set by PT.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output deactivating
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TOF_INST_0 TOF Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is TRUE, the Q output is also TRUE and ET also receives the value zero.
On the negative transition edge in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state FALSE until IN revolutions to FALSE.

Compatibility

WPS v2.5X | 1087


Equipments (Devices)

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

Operation Diagram

WPS v2.5X | 1088


Equipments (Devices)

Example

The above example disables the DO1 output to identify a low level in DI1 for 12 seconds, remaining
disabled until DI1 again be TRUE.

11.8.5.17.2 TON
Timer block that, when energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 1089


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output drive
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TON_INST_0 TON Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is FALSE, the Q output is FALSE and ET also receives the value zero.
On the edge positive transition in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state TRUE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1090


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1091


Equipments (Devices)

Example

The above example shows the initial conditions of the block and of the routine variables.

When activated the IN input, counting is triggered. Since ET equals PT, the Q output is enabled.

Note that a change in PRESET variable is not forwarded to the PT field while the IN entry remains
enabled.

WPS v2.5X | 1092


Equipments (Devices)

Disabling the IN input, the value of PT is updated and the Q output is disabled. When activating it
again, counting is triggered.

Disabling the IN input, the value of ET remains saved.

Enabling the IN input, the value of ET is reset and counting is triggered.

When ET reaches the value PT, the Q is output enabled and remains so while IN is at TRUE level.

11.8.5.17.3 TP
Timer block that, when identifies it is energized, enables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 1093


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Time w hile the output is enabled
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TP_INST_0 TP Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

On the edge positive transition in IN, Q receives TRUE value, counting is triggered and ET is
incremented according to TIMEBASE. When ET equals PT, the Q output goes to state FALSE until
IN revolutions to FALSE. At that moment, if IN is at TRUE level, nothing happens. On the edge
positive transition in IN, ET is automatically reset.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1094


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1095


Equipments (Devices)

Example

The above example enables the DO1 output for six seconds at each DI1 positive transition.

11.8.5.18 Tasks
Overview

A task is a scheduling mechanism very useful in real time systems to periodically control the performance of
programs, or whenever triggered by events.

Task configuration is carried out by adding task files to the Task folders, inside the resource. When the task
becomes enabled, programs that perform the logic of these task files are associated to them. A watchdog
(see Watchdog section) may be configured for every task. Every task has an associated system marker that
can be enabled or disabled through the program.

Inside a resource, there is a single task called Main that cannot be deleted, in which the main program (Main
Ladder) is run.

In the task folder option menu, it is possible to perform the following actions:

WPS v2.5X | 1096


Equipments (Devices)

Add a new task: in order to add a new task, it is necessary to select the New file option in the Task
folder.
Configuring the transition edge of digital inputs (DIs): digital inputs DI9 and DI10 have the option of
triggering events through a rising, falling, or rising and falling transition edge. The configuration of these
transition edges is made through the DI configuration window, which is accessed by selecting the DI Edge
Configuration option in the Task folder.

These DIs are used in tasks of the external event and count types.

Through the task folder option menu, it is possible to perform the following actions:

WPS v2.5X | 1097


Equipments (Devices)

Configuring tasks: in order to configure the task, it is necessary to select the Open option in the task file
to be configured. For further information on how to configure the tasks, see the Task configuration section.
Add, remove, or order task programs: in order to add, remove, or order programs of a certain task, it is
necessary to select the Select programs option in the task file to be configured. For further information on
how to select the programs, see Task configuration section in item List of programs.

Task Configuration

The following items are configured in the task configuration window:


Priority,
Sequence of programs,
Type of task, and
Task watchdog options.

WPS v2.5X | 1098


Equipments (Devices)

Priority: configured with a number between 0 and 30 (0 - higher priority, 30 - lower priority) which defines the
priority in which the task will be performed. In case a task with a higher priority than that of the running task
is activated, it will immediately start running. Otherwise, in case a task with a lower priority than that of the
current one is activated, it waits for the current task to stop running before it starts running.
List of programs: the selection window in the sequence of programs serves to add, remove, or change the
sequence of programs associated to a certain task. All programs available in the resource are included in
the left side list, and the programs selected for this task are on the right side. The order in which the
programs will start running will be the same order as the one defined in this list.

WPS v2.5X | 1099


Equipments (Devices)

Types of Tasks: The tasks are divided in: system, interval, single, external event, count, and freewheeling.

o System: This task may be of the Initialization or Stop type. When the Initialization option is selected,
the task will start running as soon as the user program runs for the first time. In case the Stop option is
selected, programs associated to this task will start running right after the user program stops.

WPS v2.5X | 1100


Equipments (Devices)

o Interval: Programs associated to this task run repeatedly within the time interval defined in the Time
interval field, being the delay time for the first performance defined in the Initial delay field. This task is
associated to a system variable that allows the task to be disabled through the program.

o Single: Programs associated to this task run one single time whenever the selected variable undergoes a
positive transition, i.e. from zero to some other value. This task is associated to a system variable that
allows the task to be disabled through the program.

WPS v2.5X | 1101


Equipments (Devices)

o External Event: Programs associated to this task run one single time whenever event DI9, DI10, or Pulse
Z is enabled. Events DI9 and DI10 have the option to select the transition that enables the task (see item
Configuring the transition edge of digital inputs in the Overview section). This task is associated to a
system variable that allows the task to be disabled through the program.

NOTE!
The options DI1 a DI8 are available from version 2.10.

o Count: The programs associated to this task are executed every time the pulse count on the selected
input (DI9, DI10, Pulse A, Pulse B, Pulse Z, Quadrature AB, Quadrature DI9/DI10, Dir/Pulse DI9/DI10) is
greater than the value of the variable defined in the Predefined field. The pulse count value is stored in
the Count variable. The pulse count value is reset when this value exceeds the value defined in the
Restart field. The variables configured in these fields can be of the DWORD and UDINT type for inputs
DI9, DI10, Pulse A, Pulse B and Pulse Z, and DINT for inputs quadrature AB. A system variable is
associated to this task which allows the task to be disabled through the program. The Dir/Pulse_DI9/DI10
option can be used as fast count up to 100 KHz.

WPS v2.5X | 1102


Equipments (Devices)

Important:
The Quadrature_DI9/DI10 and Dir/Pulse_DI9/DI10 functions cannot be used simultaneously in tasks or in
tasks and blocks;
The Quadrature_DI9/DI10 and Dir/Pulse_DI9/DI10 functions can be used in different blocks, provided that they
are not used in tasks.

NOTE!
Those options, after selected, will not cause error in case the others (DI9, DI10, Pulse A...) are
also selected.

Examples that do not generate compilation error:


two blocks in Quadrature_DI9/DI10;
two blocks one block Quadrature_DI9/DI10 and another Dir/Pulse_DI9/DI10;
two tasks Quadrature_DI9/DI10 or two tasks Dir/Pulse_DI9/DI10;

Examples that generate compilation error:


two tasks, one Quadrature_DI9/DI10 and another Dir/Pulse_DI9/DI10;
task Quadrature_DI9/DI10 and block Dir/Pulse_DI9/DI10;
task Dir/Pulse_DI9/DI10 and block Quadrature_DI9/DI10.

NOTE!
The Quadrature_DI9/DI10 and Dir/Pulse_DI9/DI10 options are available from version 2.0 up.

NOTE!
The options DI1 a DI8 are available from version 2.10.

o Freewheeling: Programs associated to this task run in a cyclic form. When the list of programs stops
running, the list of programs is reinitialized until the user program stops. The main program (Main Ladder)
is associated to this task, and it is not possible to remove it or associate it with another task.

Watchdog: When the watchdog option is activated, the user program stops with an error alarm in case the
task running time is longer than the time defined in the Time field for a higher number of times than that
defined in the Sensitivity field.

WPS v2.5X | 1103


Equipments (Devices)

o Time: Maximum time to run the task without watchdog error.


o Sensitivity: Number of watchdog errors allowed before generating the error alarm and stopping the user
program.

Compatibility

Device Version
PLC300 1.20 or higher

11.8.5.19 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

Figure 1: Creating a structure

2. Define the file name and press the Next button.

WPS v2.5X | 1104


Equipments (Devices)

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

WPS v2.5X | 1105


Equipments (Devices)

Figure 4: Structure created in the project

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.8.5.20 Recipes
A recipe is a data set organized in the memory which define certain configurations for a process, such as:
time of each step, minimum and maximum values, setpoint, number of repetitions, etc.
In order to create a recipe table, first it is necessary to define the data that will compose it through a data
structure. To create a data structure, see the content Structures.

Creating a recipe

1. With the right button of the mouse on the folder Recipe, click on New file.

WPS v2.5X | 1106


Equipments (Devices)

Figure 1: Creating a Recipe

2. Define the file name and press the Next button.

Figure 2: Defining the Recipe name

3. Configure the recipe by configuring the fields as shown in the figure below.

WPS v2.5X | 1107


Equipments (Devices)

Figure 3: Editing the recipe

Storage
o RAM Memory: the recipe data are stored in the RAM memory, making its handling faster, but with
storage capacity limited to the memory of the PLC300.
o SD card: the recipe data are stored in files in the memory card, making its handling much slower, but
with storage capacity according to the capacity of the SD card.
Type
o It allows to select all the structures that were defined by the user in the project.
Data Table
o The columns represent the structure elements. Note that besides the member name, the respective data
type is also presented after the ‘:’;
o The lines represent each recipe.

4. After finishing the edition of the structure, click on the Finish button.

WPS v2.5X | 1108


Equipments (Devices)

Figure 4: Recipe created in the Project

Editing a recipe

Just double click on the desired structure, as shown in figure 4, and a window will open, as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

Using Recipes

To use de recipe data, you must create a variable of the desired structure type:

Figure 5: Setting the variable

WPS v2.5X | 1109


Equipments (Devices)

Figure 6: Table containing the variable

After creating the variable, the block ReadRecipe should be used to load the recipe data for the variable or
WriteRecipe to record the data contained in the variable.

Figure 7: Block ReadRecipe configured

11.8.6 Screen
11.8.6.1 Alarms
Overview

Alarms are important tools in the automation of processes, allowing the user to monitor their plant by checking
critical points and signaling to the operator.
Configurable alarms in PLC300 are programmed by the user, being activated by a bit marker that can be
enabled by the Ladder program.
Internal alarms are relative to some hardware components that occupy the internal memory.
The alarms are configured through the Alarm Config screen accessed by the project folders:

WPS v2.5X | 1110


Equipments (Devices)

Alarm Configuration

In the alarm configuration window, it is configured:


Internal alarms: Alarms generated by the device that can be enabled or disabled by the user;
Limits: Maximum area taken by the user’s alarms and by the alarm history;
SD card: Alarm storage configurations in the SD card;
User’s alarm table: Table for configuration of the alarms activated through the variables of the device.

Internal alarms

The internal alarms are alarms generated by the device that can be enabled or disabled by the user. In order to

WPS v2.5X | 1111


Equipments (Devices)

access the internal alarm configuration window it is necessary to press the button in the alarm window.

The PLC 300 has six internal alarms, five o which can be enabled by the user:

Digital Output Fault: Indicates that some problem is occurring in some of the outputs DO1 and DO8.
Broken Wire: Current below 2 mA, when the AI1 analog input is in current mode 4 to 20mA.
Encoder Fault: One of the signals of the encoder is missing.
Supply of CAN: Power supply missing in the CAN interface.
SD card: This alarm occurs when there is a problem in the writing or reading of the SD card. The most
common problems are: SD card missing, card protected against writing and formatting of the file system
different from FAT32 .

Limits

In the field limits, the maximum area taken by the user’s alarms and by the alarm history is configured. The
button , in the limit field, opens the memory area configuration window. In this window you can configure
the size of the memory area that the user’s alarms and the user’s history must take.

The size that the user’s alarm takes in the memory is calculated through the formula:

Alarm size (bytes) = 32 + (80 x number of alarms)

The size that the alarm history takes in the memory is calculated through the formula:

WPS v2.5X | 1112


Equipments (Devices)

History size (bytes) = 32 x number of histories

SD Card

The SD card option, when enabled, configures the storage characteristics of the alarms in the SD card. The
storage of alarm files has the following options:

File extension: Format in which the alarms will be stored in the SD card. The options are:

o txt: text with formatting of easy comprehension for the users.

WPS v2.5X | 1113


Equipments (Devices)

o csv (comma separated value): comma separated values, generally used in spreadsheets.

The values stored are date, time, alarm (0 – internal, 1 – user’s alarm), action (A – actuated and N –
standardized) and description.

Interval: In the interval field, it is configured the duration time of the recording of the data in a single file. The
options of this field are the following:
o Single: The data will be recorded in a single file.
o Daily: The data are recorded in a file a day. The recording of a new file begins whenever the day on the
clock of the device changes. The file is recorded with a suffix containing the day, month and year on
which its recording began.
o Monthly: The data are recorded in a file a month. The recording of a new file begins whenever the month
on the clock of the device changes. The file is recorded with a suffix containing the month and year in
which its recording began.
o Annual: The data are recorded in a file a year. The recording of a new file begins whenever the year on
the clock of the device changes. The file is recorded with a suffix containing the year in which its recording
began.
Alarm type: Alarm values that will be stored in the SD card. They can be of the User type to store only the
alarms configured by the user or User+Internal to store the alarms configured by the user and the internal
alarms.
Remove: When this option is selected, the dialog box Number of files is enabled, allowing to input a
whole number. This number represents the number of files that will be maintained in the SD card. Whenever
a file is created daily, monthly or annually, the number of files created for this alarm is checked and then the
older files are removed.

User’s alarm table

In the user’s alarm table, the alarms activated are configured through variables of the devices with texts edited
by the user. The alarm table has four fields to be filled out:
Marker: Bit marker that activates the alarm. Global variable of the Boolean type.
Enable: Enable/Disable alarm option.

WPS v2.5X | 1114


Equipments (Devices)

Edge: Transition edge in which the alarm will be activated. The possible values are positive (from 0 to 1) or
negative (from 1 to 0).
Text 1: Text for the alarm message. This field can contain at most 15 characters. This text will be viewed in
the active alarm list and alarm history.
Text 2: Text for alarm message description. This field can contain at most 20 characters. This text will be
viewed in the detailed description of the active alarms and alarm history.

The view and configuration fields of text 2 are the followings:


Available space: Number of available characters for editing text. The maximum number of characters is
twenty (if the option show variable is selected, the space taken by the variable is added to the characters
taken by the text).
Show variable: It enables the option to show variable in text 2 of the alarm. If the text does not have the
variable location marking {0}, it is automatically added.
Variable: Variable that will be displayed in the text, in the position and format defined in the fields: position,
decimal digits, length and filling with zeros.
Decimal digits: Number of decimal digits for displaying the variable.
Position: Position in which the variable will be inserted. This is a read-only field and it is updated at each
position change.
Length: Space that will be reserved for displaying the variable. The user must take care to reserve enough
space for displaying signal and decimal point, if necessary.
Leading zeros: it fills the spaces that are empty between the configured length and the variable size with
zeros.

11.8.6.2 Screen Editor


Overview

The screen editor allows the user configuring the screens by adding and removing components, so that values
will be read and written in the program or showed on the display of the device.
The editor has function keys that allow browsing the screens or manipulating bits. A level of access can be
configured for each screen, so that only authorized users will see the content.

WPS v2.5X | 1115


Equipments (Devices)

NOTE!
The PLC300 allows editing at most 512 screens.

The components used to edit the screens are the following:


Bargraph: Shows the value of a variable graphically;
Text: Shows the text on the screen;
Numeric Input: Enters numeric values in a variable;
Numeric Output: Shows the numeric value of a variable;
Message: Shows configured texts on a table, selected by means of an index;
Text Input: Enters variables values in ASCII code;
Text Output: Shows variable values in ASCII code.

Function Keys

WPS v2.5X | 1116


Equipments (Devices)

The browsing of screens and the manipulation of bits are done by means of the configuration of the function
keys.

The options available to configure the keys are the following:


None: This function key will not execute any actions;
Bit: Selects one of the functions of bit manipulation;
Screen: Selects one key for browsing.

Bit Manipulation

The bit manipulation function allows turning a Boolean variable on, off, inverting its status or turning it off
temporarily.
The options available for selection are the following:

MomentaryOn: Turns on a selected Boolean variable (writes value 1) while the key is pressed. When you
release the key, the marker returns to zero.
Toggle: Inverts the status of the selected Boolean variable;
On: Turns on a selected Boolean variable (writes value 1);
Off: Turns off a selected Boolean variable (writes value 0).

Browsing of the Screens

WPS v2.5X | 1117


Equipments (Devices)

The browsing through the screens is done by means of the edition of the Screen option.
In the example below, screen 2 will be accessed when F1 key is pressed.

Passwords and levels of access

The PLC300 has ten password levels (0 - 9). Level zero (default value) is chosen when you wish free access to
the screen. Except for the zero screen (Home), which always has zero access level, the other screens can be
set with an access level. The password configuration window is opened when the options of the Screen editor
folder are selected.

WPS v2.5X | 1118


Equipments (Devices)

The configured passwords must have six decimal characters.

In order to configure the screen access level, it is necessary to configure this option in the screen options.

Screen options

In the screen options, you can configure the current screen number and the properties of the screen password.
In order to open those options, it is necessary to select the options of the screen file in the resource.

The screen options are the following:


Auto Logoff: When a screen with access level is viewed, if the access level of the screen is higher than the

WPS v2.5X | 1119


Equipments (Devices)

current level, the device access level becomes the same as the current screen level. If the auto logoff option
is enabled, after the access to the screen, the device access level will not change.
Level: Selects the screen access level. The higher the level of access, the greater the privilege. Up to nine
access levels can be programmed to allow different kinds of users accessing certain screens. Zero access
level means that the screen will not require a password in order to be accessed.

Screen edition

The screens are composed of components, such as Bargraph, Numeric Input, Numeric Output, Text, Message
and Text Output. For the setting of the screens, the components are entered in the display by dragging the
components from the pallete to the display or by right clicking the mouse on the display.
The components used to edit the screens are the following:

Bargraph

The Bargraph component shows a bargraph on the display with block-type characters proportional to the value
of the selected variable.

The properties of this component are:

WPS v2.5X | 1120


Equipments (Devices)

Variable: Variable used to display the bargraph.


Maximum: Maximum value shown by the graph. In case the value of the variable is equal to or above the
maximum value, the graph is displayed with the all bars completely filled.
Minimum: Minimum value shown by the graph. In case the value of the variable is equal to or below the
minimum value, the graph will not show any bars filled.

Numeric Input

The Numeric Input component allows the user entering a numeric value within a certain range. The entered
content is stored in a variable.

The properties of this component are:

WPS v2.5X | 1121


Equipments (Devices)

Variable: Variable used to enter data in the display;


Maximum: Maximum value accepted as input for this field. In case the entered value is higher than this
value, the maximum value will be assigned;
Minimum: Minimum value accepted as input for this field. In case the entered value is higher than this
value, the minimum value will be assigned;
Decimal digits: Number of decimal places in the presentation of the variable on the display;
Leading zeros: Fills with zeros the spaces that are empty between the configured component length and
the variable size.

Numeric Output

The Numeric Output component presents the formatted value (decimal places, leading zeros or flashing) of the
variable selected on the display.

The properties of this component are:

WPS v2.5X | 1122


Equipments (Devices)

Variable: Variable used to present the data on the display;


Decimal digits: Number of decimal places in the presentation of the variable on the display;
Update: Time (in milliseconds) used for the update of the field on the display. This value is only an
approximated value, since is depends on the scan of the device;
Leading zeros: Fills with zeros the spaces that are empty between the configured component length and
the variable size;
Blink: Enables the option of blinking text.

Text

The Text component is used to insert fixed texts in the screen.

The properties of this component are:

WPS v2.5X | 1123


Equipments (Devices)

Text: Text displayed on the screen;


Blink: Enables the option of blinking text.

Message

The Message component shows configured texts on a table, selected by means of an index.

The properties of this component are:

WPS v2.5X | 1124


Equipments (Devices)

Variable: Variable used as index to display the text on the screen;


Update: Time (in milliseconds) used for the update of the field on the display. This value is only an
approximated value, since is depends on the scan of the device;
Table
o Value: Table index;
o Text: Text displayed when the variable value is equivalent to the table index;
o Default text: Text displayed when the variable assumes a value not set in column value. When this
option is disabled the displayed text is the variable value.

Text Output

The Text component displays configurable texts for values of a variable.

WPS v2.5X | 1125


Equipments (Devices)

The properties of this component are:

Variable: STRING type variable containing the text;


Update: Time (in milliseconds) used for the update of the field on the display. This value is only an
approximated value, since is depends on the scan of the device;
Blink: Enables the option of blinking text.

NOTE!
A BYTE variable was used instead of STRING in firmware versions below 2.10. The array size
was defined by the component size.

Text Input

The Text Input component allows the user to enter text;

WPS v2.5X | 1126


Equipments (Devices)

The properties of this component are:

Variable: STRING type variable used as storage for the text entered.

NOTE!
A BYTE variable was used instead of STRING in firmware versions below 2.10. The array size
was defined by the component size.

11.8.7 Event Log


Overview

The event log is a set of variable values that are stored, with date and time, in the SD card of the device in the
csv (comma separated value) format. Those values are recorded after the occurrence of events that may be of
the following types: time, change of state or trigger. For each event log file, the file recording interval is
configured and a Boolean variable, which is responsible for enabling or disabling the log through the program,
is associated to it.

A text may be associated to each log configuration file, which will be presented together with the variables as
soon as the upload of the event log is performed (see Text Field Configuration section).

In the option menu of the event log, it is possible to carry out the following actions:

WPS v2.5X | 1127


Equipments (Devices)

Add a new event log: in order to add a new event log, it is necessary to select the New file option from
the folder Event log. For further information on how to configure the event log, see Event log configuration
section.
Upload SD card files: after the download of the event log files configured for the equipment, it is possible to
upload these files to view the events occurred. For more details, see Upload SD card files section.
Create log file: This functionality allows the user to create a log file within a defined period with the log files
loaded in the project. For more details see Creation of log files section.

Event Log Configuration

In the event log configuration window, you configure: the recording interval of the event log file, the type of event
log, the Boolean variable that enables the event log and the text to be displayed in the event log.

File interval: In the file interval field , the duration time of the recording of the data in a single file is
configured. The options of this field are the following:
o Single: The data will be recorded in a single file.
o Daily: The data will be recorded in a file a day. The recording of a new file begins whenever the day on the
clock of the device changes. The file is recorded with a suffix containing the day, month and year on
which its recording began.
o Monthly: The data will be recorded in a file a month. The recording of a new file begins whenever the
month on the clock of the device changes. The file is recorded with a suffix containing the month and year
in which its recording began.
o Annual: The data will be recorded in a file a year. The recording of a new file begins whenever the year on
the clock of the device changes. The file is recorded with a suffix containing the year in which its recording
began.

WPS v2.5X | 1128


Equipments (Devices)

Event log type

The event log can be of time, change of state and trigger type.

Time

WPS v2.5X | 1129


Equipments (Devices)

The event log is recorded in time intervals defined in the field Period. The value configured in the field Period
must be a whole value greater than zero and smaller than 4294967295 s. The time unit can be selected from
seconds, minutes or hours.

In the field Variables you select the variables that will be sampled in the configured period.

Change of State

The event log is recorded after a change in the value of the selected variable. Only the value of the selected
variable is recorded in the event log.

In the field Variables you select the variables that will be sampled after the change of state.

NOTE!
The list of variables is possible only in firmware versions higher than 3.30. For these versions, the
variable that triggers the event log is not written in the event log, unless the variable is added to
the list.

WPS v2.5X | 1130


Equipments (Devices)

Trigger

As in the Time event, the event log is recorded in time intervals defined in the field Period, but only when the
value of the configured variable in the field Trigger is within the limits selected in the variables of the Upper
limit and Lower limit fields. The value configured in the Period field must be a whole value greater than zero
and smaller than 4294967295 s. The time unit can be selected from seconds, minutes or hours.

In the field Variables you select the variables that will be sampled in the configured period.

Text field configuration

In the Text field, it is possible to add a text to be shown together with the variables. This text will be added as
soon as the event log file is loaded (through the upload of log files) to the WPS.
For the variable values to be inserted in any position of the text, markers will be added to the text which will be
replaced by the variables.
According to the type of event log selected, the markers must be added the following way:

Time: the first variable of the list is represented by the marker {0}, the second by the marker {1} and thus
successively.
Change of State: the only variable selected will be represented by the marker {0}.
Trigger: the Trigger variable is represented by the marker {0}, the Upper limit by the marker {1}, the
Lower limit by the marker {2}, the first variable of the list by the marker {3}, the second by the marker {4}
and thus successively. As an example, below is the configuration of an event log of the Trigger type and its
log file.

WPS v2.5X | 1131


Equipments (Devices)

WPS v2.5X | 1132


Equipments (Devices)

Upload of log files

There are two ways to upload the log files: upload all the project files or upload the files individually.

WPS v2.5X | 1133


Equipments (Devices)

In order to upload all the log files configured in the project, it is necessary to select the folder Event log with
the right button and select the option Upload SD card files.

In order to upload the files associated to only one event log configuration file, it is necessary to click the right
button on the event log configuration file and select the option Upload SD card files.

ATTENTION!
When uploading files, the previous files (with the same name) will be overwritten.

WPS v2.5X | 1134


Equipments (Devices)

Creation of log files

Through the log file creation tool, it is possible to create new event log files using the log files previously loaded
on the project. Thus, it is possible to define the initial and final log interval and which log files must be used. In
order to begin the creation of a new log file, it is necessary to click the right button of the mouse on the folder
Event log and select the option Create log file. The configuration options for the new file are the following:

File name: Name that will be used in the log file created. If the name already exists, the data will be
overwritten.
Initial interval: It determines the initial day and time of the file logs. If the Unlimited option is selected,
there will not be a minimum value for the date.
Final interval: It determines the final day and time of the file logs. If the option Unlimited is selected, there
will not be a maximum value for the date.
Files: It selects the log files that will be used to generate the new log file.

WPS v2.5X | 1135


Equipments (Devices)

11.8.8 Setup
11.8.8.1 Configuration
Overview

The setup configuration of the PLC300 is accessed by double clicking the shortcut available in the resource as
shown in the following figure.

ATTENTION!
When creating a new resource in the WPS, the setup configuration values will be the standard
values of the PLC300. We recommend to review these values according to the requirements of
the application and to send these adjustments according to the following explanation.

The setup configuration window is divided into tabs and has two buttons to access the PLC300 as shown in
the following figure.

The Write Configuration and Read Configuration buttons are only active when the WPS is connected to

the PLC300 through the command Connect Device .

WPS v2.5X | 1136


Equipments (Devices)

Write Configuration: It sends all configurations adjusted in the setup configuration screens to the
equipment.
Read Configuration: It receives all the configurations adjusted in the equipment and configures the
screens according to the received values.

11.8.8.2 Configuration Windows


11.8.8.2.1 Display

Password: It allows to change the password of the setup function of the PLC300. The standard password is
‘0000’. The new password must be a number with four digits.
LCD Contrast: It adjusts the LCD contrast of the PLC300.
Keyboard Beep: It enables the beep of the keys of the PLC300.

11.8.8.2.2 Analog

Analog Inputs: It selects one of the three operation modes of the AI1 analog input of the PLC300: ‘Voltage
0 to 10 V’, ‘Current 0 to 20 mA’ or ‘Current 4 to 20 mA’.

WPS v2.5X | 1137


Equipments (Devices)

NOTE!
In the option 4 to 20 mA, the value that the Ladder sees is a proportional, standardized value,
that is, 4 to 20 mA - 0 to 32767.

Analog Outputs: It selects one of the four operation modes of the analog outputs (AOs) of the IOA
accessories installed in the PLC300, seeing that the AOs 101 and 102 are the AOs 1 and 2 of the IOA card
installed in the slot 1 of the PLC300, and the AOs 201 and 202 are the AOs 1 and 2 of the IOA card
installed in slot 2.

11.8.8.2.3 Encoder

It selects the power supply of the encoder of the PLC300 between 5 or 12V.

11.8.8.2.4 RS232

It is possible to configure the baud rate, parity and number of stop bits of the serial interface of the RS232 of

WPS v2.5X | 1138


Equipments (Devices)

the PLC300.

11.8.8.2.5 RS485

It is possible to configure the baud rate, the parity and the number of stop bits, the mode (master/slave) and
the address of the PLC300 in a Modbus RTU network by means of the serial interface RS485 of the PLC300.

11.8.8.2.6 CAN

It is possible to configure the baud rate and the address of the PLC300 in a CANopen network by means of the
CAN interface of the PLC300.

WPS v2.5X | 1139


Equipments (Devices)

11.8.8.2.7 LAN

It is possible to configure the IP address, subnet mask, default gateway, DHCP, speed and duplex mode of
the PLC300 in an Ethernet network.

IP Address: Four bytes of address that identify the PLC300 in the IP network;
Subnet Mask: Four bytes that identify the subnet to which the PLC300 belong in the IP network;
Gateway: Four address bytes that identify the default gateway to access other subnets in the IP network;
DHCP: Disabled, Enabled;
Speed/Duplex: Auto, 10MBps Full Duplex, 10MBps Half Duplex, 100MBps Full Duplex, 100MBps Half
Duplex.

11.8.8.2.8 Modbus TCP

It is possible to configure the TCP, Unit ID, IP authentication and timeout of the Gateway Modbus TCP/RTU of
the PLC300 in an Ethernet network by using the ModbusTCP protocol.

IP Authentication: Four bytes of the address that identify the single remote IP address that can connect to

WPS v2.5X | 1140


Equipments (Devices)

the PLC300. All the fields in zero disable the IP authentication and any remote address can connect to the
PLC300;
TCP Port: 0 to 65535,
Unit ID: 1 to 255,
Gateway Timeout: 20 to 5000 ms

11.8.8.2.9 Clock Settings

The clock settings are only active when the WPS is connected to the PLC300 through the command Connect
Device.

It allows to set the RTC clock of the PLC300.

11.8.8.2.10 Language

WPS v2.5X | 1141


Equipments (Devices)

Allows to change the configured language in PLC300.

11.8.8.2.11 Watchdog

Allows configuring custom watchdog in the PLC300.

1. Time of Watchdog (ms): waiting time of the watchdog. Minimum value: 200ms.
2. Reset the PLC in case of Watchdog: if checked, this option resets the PLC300 in case of watchdog and
runs the user application again after restart. By checking this option, options 3 and 4 are disabled
automatically;
3. Watchdog Output: allows selecting an output for the exclusive use as a flag from the watchdog.
3.1.The selected output (DO8 or DO9) cannot be written via Ladder. It will remain at a high level after
configured for this option and, in the event of watchdog, it will turn off.
4. Output Status: allows selecting if the digital outputs maintain their status in case of activation of the
watchdog or if they will be turned off.
4.1.This option will have no action on the selected output in option 3. For example: if in option 2 DO9 is
selected, even if in option 3 ‘Keeping the status’ is checked, at the moment of watchdog it will be
switched off.

Compatibility

Device Version
PLC300 2.30 or higher

11.8.9 Communication
11.8.9.1 Online Commands
Overview

The online commands are commands performed when the device is communicating with the application (online
monitoring active).

With the online commands it is possible:

WPS v2.5X | 1142


Equipments (Devices)

To perform the commands for recording and loading the resource, setup and firmware files.
To configure the device number.
To stop and run the program and delete the resource.

Saving and loading configuration

The commands for recording the resource, setup and firmware files make a copy of the device binary files to
the SD card. The loading of the files make the copy of the binary files from the SD card to the device.
For the security of the files, it is possible to configure a protection password. It is also possible to configure
the number of devices so that backup files will be copied to different folders.

Saving and loading command

To perform the commands for recording and loading the resource, setup and firmware, it is necessary to select
the menu Communication > Online commands > choose one of the options listed Save/Load and then
Resource/Setup/Firmware.

If a password has been configured for the resource, a dialog window prompting the password will show. The
password has one to eight decimal digits.

Password configuration

The password configuration for the online commands is done trough the configuration of the resource
properties, in the password option.

WPS v2.5X | 1143


Equipments (Devices)

After entering the password (with one to eight decimal digits), it is necessary to build the resource and send it
to the device. The password will be stored on the equipment and, when one of the online commands is
performed, the password is requested. The password will not be requested again until that the online
monitoring is completed.

Device number

The device number is configured to record the backup of different devices on the same SD card. When
selecting the functions for recording resource, setup or firmware, the files will be recorded on the following
folders, according to the device number (1 in the example).

\PLC300\0001\Resource
\PLC300\0001\Setup
\PLC300\0001\Firmware

ATTENTION!
Existing files in the destination folder will be overwritten when you perform recording functions.

WPS v2.5X | 1144


Equipments (Devices)

Run program

It runs the user’s program.


In order to perform the run program command, it is necessary to select the menu Communication > Online
commands > Run program.

Stop program

Stop the user’s program.


In order to perform the stop program command, it is necessary to select the menu Communication > Online
commands > Stop program.

Erase resource

It erases the resource recorded on the device.


In order to perform the delete program command, it is necessary to select the menu Communication >
Online commands > Delete program.

11.8.9.2 Force I/O


Overview

The force inputs and outputs window is used for the values of the digital and analog inputs to be read by the
program, by values manipulated by the user, regardless their physical state. It also allows the manipulation of
the physical states of the digital and analog outputs by the user independently of the values calculated by the
program.
In order to force the device inputs and outputs, it is necessary that the online monitoring be active and the
option Run cyclically be enabled. The data are sent to the device every 2 seconds.
The values can be edited with the device disconnected. The configurations are stored in the resources and
recorded whenever the main resource selection is changed.
The data displayed on the force I/O window contain the values belonging to the resource (and configuration)
selected as main.

The force I/O window is open trough the menu Online > Force I/O:

WPS v2.5X | 1145


Equipments (Devices)

Toolbar

The toolbar of the force window has the options to run cyclically, upload the device force configuration, enable
all and disable all:
Run cyclically: Sends the user's configurations to the device and updates the state of the inputs and
outputs in a cyclic way.
Upload configuration: Allows the current configuration of the device to be read. For this option to be
enabled, it is necessary that the online monitoring be active and the option run cyclically be disabled.
Enable all: Enables the force I/O of all of the inputs and outputs of the device.
Disable all: Disables the force I/O of all of the inputs and outputs of the device.

Input and Output commands

For each digital and analog input and output there is a selection box linked to enable the force, a status field
and an edition field.

Digital:

1. Number of the digital inputs/output


2. Enable/disable Force I/O

WPS v2.5X | 1146


Equipments (Devices)

3. Current status of the I/O: It has three statuses: 1. light green LED: activated; 2. dark green LED:
deactivated; 3. gray LED: the value is not being read.
4. Enable/disable the input/output

Analog:

1. Number of the analog input/output


2. Enable/disable Force I/O
3. Current value of the input/output
4. Value of the input/output configured by the user

NOTE!
The analog signal scale has 15 bits plus 1 bit for signal, except for SSW900 which it has only 10
unsigned bits.

11.8.9.3 Download
Overview

The resource download downloads the memory area configuration files, volatile data, retentive data, programs,
screens, alarms, source code (optionally) and recipes (optionally) to the device internal memory.

WPS v2.5X | 1147


Equipments (Devices)

Figure 1: Resource download window

It is also possible to perform the following operations during the download of the resource:

Initialize variables: Initializes the variables with the values configured in the initial values.
Clean alarm history: Excludes alarm history data stored. It is recommended to clean this area whenever
the memory areas or the alarm configuration are changed.
Source code download: Downloads the resource source code.
Download recipe in internal memory: Downloads the file containing the recipe data configured with the
storage option in the RAM.
Disable CANopen master during download: Disables the CANopen master during the download:
Stop/Run the program automatically: Disables the warning windows informing that the program will be
stopped (Figure 2) and the prompting window asking if you wish to execute the program (Figure 3).
Setup configuration: Performs setup configuration data download.
CANopen configuration: Performs CANopen network configuration download.

WPS v2.5X | 1148


Equipments (Devices)

Figure 2: Warning window informing that the program will be stopped

Figure 3: Prompting window asking if you wish to run the


program

Download of the SD card files

If the user configured one or more recipes with the option of storage in the SD card, the confirmation window of
download of files in the SD card will show (Figure 4). For the window to show, it is necessary that the SD card
be connected to the equipment.

WPS v2.5X | 1149


Equipments (Devices)

Figure 4: Confirmation window of download in the


SD card

11.8.9.4 Hot Download


11.8.9.4.1 Overview
The Hot Download is a functionality that allows the loading of logic changes and configurations of a resource in
a equipment without having to stop the routine of execution. The variables actual values are retained.

On the Hot Download, the logic changes and configurations must be realized off-line, in other words, with the
monitoring disabled, being transfer to the equipment in one single step. This requires that every and any
modification realized needs to be sent to the equipment through a command realized by the user itself,
avoiding then that incomplete changes can cause a different operation than expected.

ATTENTION!
Take care during Hot Download realization: mistakes can result in damage to the people involved
and to the equipment. Before realizing Hot Download, evaluate the consequences of your
changes and notify the involved.

Compatibility

Equipment Version
PLC300 2.30 or superior

11.8.9.4.2 Enable/Disable Hot Download


The Hot Download feature comes disabled on the resource by default, to enable it just follow the steps below:

1. Open the context menu of the resource and select the option Resource Options.

WPS v2.5X | 1150


Equipments (Devices)

2. Select the option Hot Download on the sidebar menu, it will open a window with the Hot Download
configurations.

WPS v2.5X | 1151


Equipments (Devices)

3. On the Hot Download configuration window just select the option Enable Hot Download Features and
confirm.

WPS v2.5X | 1152


Equipments (Devices)

4. The option Force Hot Download is used when it's wished that the system re-enables the Hot Download to
the resource, after the user having realized one operation that disables it.
Example: The user create a local variable after the system having informed him that the creation of the same
will disable Hot Download, in case the user regrets and excludes this variable he can then use the option
Force Hot Download so the system will keep allowing Hot Download in the same way it was allowing before
the creation of this variable.

11.8.9.4.3 Restrictions
For being possible to realize the Hot Download on the equipment, it's necessary that after the full resource
download, some restrictions don't be violated.

Restrictions are limitations imposed to the operations that the user can execute in a resource, because such
operations unfeasible the Hot Download routine.

The list below provides the restrictions to the user:

Memory areas
o Any memory area can't be changed;
Programs
o Can't be removed;
o Can't be added to the execution list of tasks;
Tasks
o Can't be edited;

WPS v2.5X | 1153


Equipments (Devices)

o Can't be removed;
o Can't have their execution list changed. Also the execution order of the programs can't be changed.
Variables
o Variables with LOCAL scope can't be created, excluded or edited.
o Variables with GLOBAL scope without address and from the group GLOBAL_RETAIN without address
can't be created, excluded or edited.
o Variables with GLOBAL scope with address and CONSTANT can be created, excluded or edited.
o Variables from USERFB from types VAR_IN, VAR_OUT, VAR_IN_OUT, LOCAL, LOCAL_RETAIN can't
be created, excluded or edited.
USERFB's
o Can't be added and removed from programs.
Structures
o Can't be edited or removed.
Recipes
o Can't be transferred to the equipment.
Screens
o No restrictions.
o During the loading of the changes to the equipment will be displayed a screen indicating this operation. In
cases where the current screen changes, will be called the HOME screen.
Alarm
o No restrictions.
o Case any alarm stored in the alarm history be removed, the alarm history become than invalid.
Event Log
o No restrictions.

Case any restrictions be violated, a alert message will be displayed.

Figure 1 - Alert on the edition screen

WPS v2.5X | 1154


Equipments (Devices)

Figure 2 - Alert on the dialog box

NOTE!
The alerts displayed during the edition aren't guaranty that the Hot Download will be disabled
when the user call it. Those alerts serve only as a parameter in order that the user have the
consciousness that the change he is realizing will disable the Hot Download in case that its don´t
be reverted.

11.8.9.4.4 Operation
The Hot Donwload function is enabled when:
1. A complete download of the compiled resource has been done previously;
2. Have sufficient resource memory space.

After compiling, the output window indicates a warning (W4002) if the Hot Download function is disabled due to
lack of memory.

Figure 1 - Warnings of insufficient memory for Hot Download displayed on the compilation window

After realizing the desired changes on the resource, the beginning of the download routine will verify if the
resource edited is the same as the resource executing on the equipment.
Case both be equal, is then displayed a dialog window for selection between Full Download or Hot Download.

WPS v2.5X | 1155


Equipments (Devices)

Figura 2 - Dialog window to choose


between Full Download and Hot
Download

Case the option Hot Download be selected, then is realized a verification to know if any restriction has been
violated. Case it was, a message of error will be displayed informing the cause.
Validated the verification, is then realized a comparison of the memory areas, the files that were changed are
displayed in red.

NOTE!
The variables map is presented on the gray color, since its download is obligatory in case of
changes.

Figure 3 - Files selection window for Hot Download

Case any file be sent to the equipment without the source code, this will become invalid, thus disabling your

WPS v2.5X | 1156


Equipments (Devices)

upload.
This procedure is realized because the source code don't represent anymore the files presented in the
memory areas.

NOTE!
The source code becomes invalid even that it be equal to the previously saved on the equipment.

11.8.9.5 Upload
Overview

Uploads the resource source code. For this, it is necessary that the source code be previously recorded
(during the download) in device memory. In order to initialize the upload, it is necessary to access the menu
Communication > Upload resource.

If the upload was performed successfully, the window to select the configuration name will open.

WPS v2.5X | 1157


Equipments (Devices)

If a password to protect the source code was configured, it will be requested:

11.8.9.6 Comparison of resource and device


Overview

NOTE!
The comparison of resource and device works only as from firmware version 1.50.

The comparison of resource and device (binary files) allows the user compare the main resource of the
application with the resource that is running on the device. To begin the comparison, it is necessary to access
the menu Communication > Compare resource device.

WPS v2.5X | 1158


Equipments (Devices)

After selected the comparison option, it is checked whether the resource is compiled to read the information of
size and CRC of the binary files. Then, the comparison of all memory areas is performed.

If the memory areas have changed, cannot be possible to perform the comparison and a file system
comparison error is shown:

WPS v2.5X | 1159


Equipments (Devices)

Observations:
- The information and source code files are updated every build.
- The volatile, retain, source code and recipe are download options. If the download of these files were not
done, the comparison will be flagged as false.

11.8.9.7 Modbus File Manager


Overview

The modbus file manager of the PLC300 is accessed through the communication menu as shown in the
following figure.

The window of the modbus file manager is composed of the following parts as shown in the following figure.

1. Toolbar with all the tools of the file manager.

WPS v2.5X | 1160


Equipments (Devices)

2. Folder list of the SD Card.


3. File list of the selected folder.

It is only possible to view the files and folders of the SD Card when the WPS is connected to the PLC300

through the command Connect Device .

Toolbar

Creates a new folder


Erases the selected folder
Renames the selected folder
Erases the selected file
Displays the properties of the selected file (path, size and date)
Renames the selected file
Sends the file to the PLC300
Receives the selected file from the PLC300

Popup menu

In order to access the popup menu, just click the right button on a folder or on a file and it will be displayed as
shown in the following figure.

Popup menu for folders:

WPS v2.5X | 1161


Equipments (Devices)

Popup menu for files:

11.8.9.8 Communication RS232


Overview

In a serial interface, the data bits are sent in sequence through a communication channel or link. Several
technologies use the serial communication for data transfer, including interfaces RS232.

WPS v2.5X | 1162


Equipments (Devices)

Configuration

Some parameters need to be configured to perform the RS232 communication; to do so, check the item
RS232.

There are three operating modes of the RS232 communication.


Mode 0: Modbus Slave;
Mode 2: ASCII Protocol;
Mode 4: Generic telegrams.

NOTE!
Modes 1 and 3 are reserved.

Mode 0: Modbus Slave

Refer to manual PLC300 - Modbus RTU Communication, available at http://www.weg.net/br.

Mode 2: ASCII Protocol

The ASCII protocol, via RS232, was developed for bar code reading.

Involved Variables:

RS232_MODE: BYTE system marker which defines the operating mode of the RS232:
o 2: ASCII protocol;
RS232_RX_CLEAR: BIT marker; clears the data buffer (RS232_ ASCII_ BYTEBUFFER) and the
RS232_RX_FINISHED flag;
RS232_RX_FINISHED: BIT marker; indicates that a data package is available in the
RS232_ASCII_BYTEBUFFER buffer;
RS232_ASCII_BYTEBUFFER: 256-byte buffer which stores the received characters;
RS232_ASCII_STRING: STRING buffer, which can be shown on the screen of the PLC300 by the ‘Text
Output’ component.

How to use the RS232 in the ASCII mode:

1. Select the ASCII protocol by setting: RS232_MODE = 2 in the Ladder;


2. Give a pulse in the RS232_RX_CLEAR marker to clear the RS232_ASCII_ BYTEBUFFER buffer, and the
RS232_RX_FINISHED flag;
3. When receiving a package, the flag: RS232_RX_FINISHED goes to TRUE;
4. The data are available for the Ladder by means of the array: RS232_ASCII_BYTEBUFFER, of 256 bytes;
5. To use with the ‘Text Output’ function of the HMI, use the RS232_ASCII_STRING STRING marker.

NOTE!
Even without turning on RS232_RX_CLEAR, the system can receive another reading, placing the
data over the previous reading.

WPS v2.5X | 1163


Equipments (Devices)

NOTE!
The end of the package is executed when the CR/LF characters (0x0d/0x0a) are received.

NOTE!
The CR/LF characters are not stored in the buffer.

NOTE!
The buffer is terminated with NULL character (0x00).

The configuration of the RS232 must be done according to the default configuration of the PLC300;
On the screens, the 'Text Output' component, which only accepts the STRING type, was added to show
RS232_ASCII_STRING, which is the string that shows the value read by the protocol, limited to 20 characters
(limit of the output function = 1 line).

Mode 4: Generic telegrams

Functionality developed to send and receive telegrams by means of serial communication RS232.

Involved command variables:

RS232_MODE: BYTE marker; defines the operating mode of the RS232:


o 4: telegrams via RS232.
RS232_TIMEOUT: WORD marker; indicates the maximum waiting time (in ms) for a response, preventing
new telegrams to be sent before this time has elapsed.
RS232_END_CHARACTER: defines a character that can end a telegram, for example, ETX (03H). Upon the
receipt of this character, the PLC300 considers that the bytes received up to it are the ones necessary; the
others are ignored.
RS232_ENABLE_END_CHARACTER: BIT marker; system marker that enables the use of telegram end
character specified in RS232_END_CHARACTER;
o 0: disabled;
o 1: enabled.
RS232_START_TX: BIT marker; the telegram is sent on the leading edge of this marker;
RS232_TX_ADDRESS: WORD marker; indicates the initial address of the data to be transferred;
RS232_TX_LENGTH: BYTE marker; indicates the number of bytes of the information to be sent;
RS232_RX_ADDRESS: WORD marker; indicates the initial address of the received data;
RS232_MAX_RX_BUFFER_LENGTH: BYTE marker; indicates the maximum number of bytes that can be
received;

Involved status variables:

RS232_TX_TELEGRAM_COUNTER: WORD marker; counts the number of sent telegrams;


RS232_RX_TELEGRAM_FINISHED: BIT marker; indicates that a data package is available in the memory
from the address indicated in RS232_RX_ADDRESS.
RS232_TX_FINISHED: BIT marker; indicates that a data package was completely sent.
RS232_TIMEOUT_INDICATOR: BIT marker; indicates if the time specified in RS232_TIMEOUT has elapsed.
o 0: there was no overflow;
o 1: there was time overflow.
RS232_RX_TELEGRAM_COUNTER (status): WORD marker; counts the number of received telegrams;
RS232_RX_BYTE_COUNTER (status): WORD marker; counts the number of received bytes;

WPS v2.5X | 1164


Equipments (Devices)

How to use the RS232 to send and receive telegrams:

1. Select Send and receive telegrams via RS232 by setting RS232_MODE = 4 in the Ladder;
2. Configure the initial address of the telegrams to be sent and received in, respectively,
RS232_TX_ADDRESS and RS232_RX_ADDRESS;
3. Specify the size (in bytes) of the telegram to be sent by means of marker RS232_TX_LENGTH;
4. Specify the maximum size (in bytes) of the telegram that can be received by means of RS232_RX_LENGTH
marker;
5. Specify the timeout in RS232_TIMEOUT;
6. If applicable, configure the telegram end characters of the markers respectively in: RS232_ENABLE
END_CHARACTER and RS232_END_CHARACTER;
7. Reset the RS232_RX_TELEGRAM_FINISHED flag to be ready to receive a telegram;
8. Give a pulse in RS232_START_TX to send a telegram.

NOTE!
It will be considered the end of receipt of telegram, the receipt of the special character when
configured in RS232_END_CHARACTER with the RS232_ENABLE_END_CHARACTER flag
enabled or, also, when the timeout is equal to twice the transmission time of a byte.

Compatibility

Device Version
Mode 0: 1.00 or higher
PLC300 Mode 2: 1.11 or higher
Mode 4: 1.50 or higher

11.8.9.9 Communication RS485


Overview

In a serial interface, the data bits are sent in sequence through a communication channel or link. Several
technologies use the serial communication for data transfer, including interfaces RS485.

Configuration

Some parameters need to be configured to perform the RS485 communication; to do so, check the item
RS485.

There are three operating modes of the RS485 communication.


Mode 0: Modbus Slave;
Mode 1: Modbus Master;
Mode 4: Generic telegrams.

NOTE!
Modes 2 and 3 are reserved.

WPS v2.5X | 1165


Equipments (Devices)

Mode 0: Modbus Slave

Refer to manual PLC300 - Modbus RTU Communication, available at http://www.weg.net/br.

Mode 1: Modbus Master

Refer to manual PLC300 - Modbus RTU Communication, available at http://www.weg.net/br.

Mode 4: Generic telegrams

Functionality developed to send and receive telegrams by means of serial communication RS485.

Involved command variables:

RS485_MODE: BYTE marker; defines the operating mode of the RS485:


o 4: telegrams via RS485.
RS485_TIMEOUT: WORD marker; indicates the maximum waiting time (in ms) for a response, preventing
new telegrams to be sent before this time has elapsed.
RS485_END_CHARACTER: defines a character that can end a telegram, for example, ETX (03H). Upon the
receipt of this character, the PLC300 considers that the bytes received up to it are the ones necessary; the
others are ignored.
RS485_ENABLE_END_CHARACTER: BIT marker; system marker that enables the use of telegram end
character specified in RS485_END_CHARACTER;
o 0: disabled;
o 1: enabled.
RS485_START_TX: BIT marker; the telegram is sent on the leading edge of this marker;
RS485_TX_ADDRESS: WORD marker; indicates the initial address of the data to be transferred;
RS485_TX_LENGTH: BYTE marker; indicates the number of bytes of the information to be sent;
RS485_RX_ADDRESS: WORD marker; indicates the initial address of the received data;
RS485_MAX_RX_BUFFER_LENGTH: BYTE marker; indicates the maximum number of bytes that can be
received;

Involved status variables:

RS485_TX_TELEGRAM_COUNTER: WORD marker; counts the number of sent telegrams;


RS485_RX_TELEGRAM_FINISHED: BIT marker; indicates that a data package is available in the memory
from the address indicated in RS485_RX_ADDRESS.
RS485_TX_FINISHED: BIT marker; indicates that a data package was completely sent.
RS485_TIMEOUT_INDICATOR: BIT marker; indicates if the time specified in RS485_TIMEOUT has elapsed.
o 0: there was no overflow;
o 1: there was time overflow.
RS485_RX_TELEGRAM_COUNTER (status): WORD marker; counts the number of received telegrams;
RS485_RX_BYTE_COUNTER (status): WORD marker; counts the number of received bytes;

How to use the RS485 to send and receive telegrams:

1. Select Send and receive telegrams via RS485 by setting RS485_MODE = 4 in the Ladder;
2. Configure the initial address of the telegrams to be sent and received in, respectively,
RS485_TX_ADDRESS and RS485_RX_ADDRESS;
3. Specify the size (in bytes) of the telegram to be sent by means of marker RS485_TX_LENGTH;
4. Specify the maximum size (in bytes) of the telegram that can be received by means of RS485_RX_LENGTH

WPS v2.5X | 1166


Equipments (Devices)

marker;
5. Specify the timeout in RS485_TIMEOUT;
6. If applicable, configure the telegram end characters of the markers respectively in: RS485_ENABLE
END_CHARACTER and RS485_END_CHARACTER;
7. Reset the RS485_RX_TELEGRAM_FINISHED flag to be ready to receive a telegram;
8. Give a pulse in RS485_START_TX to send a telegram.

NOTE!
It will be considered the end of receipt of telegram, the receipt of the special character when
configured in RS485_END_CHARACTER with the RS485_ENABLE_END_CHARACTER flag
enabled or, also, when the timeout is equal to twice the transmission time of a byte.

Compatibility

Device Version
Mode 0: 1.00 or higher
PLC300 Mode 1: 1.00 or higher
Mode 4: 1.50 or higher

11.9 PSRW
11.9.1 Description

PSRW is a configurable safety relay which can be configured using the WPS graphic interface, it has 4 (four)
double channel safety inputs and 2 (two) OSSDs (Safety double channel safety outputs).

PSRW is capable of monitoring the following safety sensors and components:


Safety Light curtain;
Two hands control;
Emergency stops;
Magnetic sensors;
Mechanical switches;
Safety sensors.

Refer to the user's manual of the PSRW for further details about the product.

11.10SCA06
11.10.1Description

The SCA06 servo drive is a high-performance product which allows controlling the speed, torque and position
of three-phase, alternate-current servomotors. The main characteristic of this product is the high performance
and high precision of movement control of the servomotor due to the operation in closed loop by means of the
position feedback given by a sensor inside the servomotor.

The SCA06 features independent control supply and power supply, allowing, for instance, that the product
communication networks keep on working normally even if the power circuit must be turned off for some

WPS v2.5X | 1167


Equipments (Devices)

reason.

The use of braking resistors provides greatly reduced braking times, optimizing the processes that require high
performance. Several special functions are available, such as programming in Ladder with positioning blocks
which provides extreme flexibility and integration to the drive.

The SCA06 can be used in different applications with many options of cables, both for simple applications and
complex applications like handling, environments with oil, etc.

NOTE!

SCA06 versions below V2.00 do not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.10.2System Markers
The following variables contained in the GLOBAL_SYSTEM group of the variables table, have the fixed tag.
The tag of system markers were divided into groups and subgroups, where:

Groups:
SCA: reading and writing variables of the SCA06 servo drive;
CO: reading and writing variables of the CANopen network.

Subgroups:
STS: reading variable (status);
CMD: writing variable (command).

Reading System Markers (Status)

Address Bit Modbus Tag Description

Ladder

%SB6000 0 0 FREQ_2HZ Oscillator w ith frequency of 2 Hz

%SB6000 1 1 PULSE_1SCAN Pulse during the first scan cycle

%SB6000 2 2 FALSE Alw ays in 0

%SB6000 3 3 TRUE Alw ays in 1

%SW6002 -- 3001 ELAPSED_SCAN_CYCLES Elapsed scan cycles

Real Axis

%SW6004 -- 3002 SCA_STS_REAL_AXIS_STATUS Real axis status (see note)

%SD6008 -- 3004 SCA_STS_REAL_AXIS_VELOCITY Real axis velocity

%SL6024 -- 3012 SCA_STS_REAL_AXIS_POSITION Real axis position

Virtual Axis

WPS v2.5X | 1168


Equipments (Devices)

%SW6006 -- 3003 SCA_STS_VIRTUAL_AXIS_STATUS Virtual axis status (see note)

%SD6012 -- 3006 SCA_STS_VIRTUAL_AXIS_VELOCITY Virtual axis velocity

%SL6032 -- 3016 SCA_STS_VIRTUAL_AXIS_POSITION Virtual axis position

Current

%SD6016 -- 3008 SCA_STS_MOTOR_CURRENT Motor current

Position in the DI´s transition

%SD6040 -- 3020 SCA_STS_DI1_POSITION_STORED Position stored in the DI1 transition

%SD6048 -- 3024 SCA_STS_DI2_POSITION_STORED Position stored in the DI2 transition

%SD6056 -- 3028 SCA_STS_DI3_POSITION_STORED Position stored in the DI3 transition

Counters

%SD6064 -- 3032 SCA_STS_BUILT_IN_COUNTER Built-in counter value

%SD6068 -- 3034 SCA_STS_BUILT_IN_COUNTER_DI3 Built-in counter stored in the DI3 transition

%SD6072 -- 3036 SCA_STS_ENC1_COUNTER Encoder 1 counter value

%SD6076 -- 3038 SCA_STS_ENC2_COUNTER Encoder 2 counter value

Encoder counter stored in the Z1 transition as defined in


%SD6080 -- 3040 SCA_STS_ENC_COUNTER_Z1
P00511
Encoder counter stored in the Z2 transition as defined in
%SD6084 -- 3042 SCA_STS_ENC_COUNTER_Z2
P00521
CANopen

%SB6100 0 800 CO_STS_MASTER_CONTACTED The CANopen master contacted all the slaves

The CANopen master dow nloaded the configurations of


%SB6100 1 801 CO_STS_MASTER_CONFIG_OK
the slaves
Error control protocol (node guarding/heartbeat) initiated
%SB6100 2 802 CO_STS_MASTER_ERROR_CTRL_OK
w ith the slaves
%SB6100 3 803 CO_STS_MASTER_INIT_FINISHED The CANopen master initialized all the slaves

%SB6100 4 804 CO_STS_MASTER_INIT_ERROR A slave presented an initialization error

The CANopen master detected a fault in a slave through


%SB6100 5 805 CO_STS_MASTER_ERROR_CTRL
the error detection protocol
%SB6100 6 806 CO_STS_MASTER_EMCY A slave reported EMCY

%SB6101 0 808 CO_STS_MASTER_NMT_TOGGLE NMT command toggle bit feedback

%SB6101 5 813 CO_STS_MASTER_BUS_OFF The CANopen master is in bus off

The CANopen master has no pow er supply at the CAN


%SB6101 6 814 CO_STS_MASTER_POWER_OFF
interface
%SB6101 7 815 CO_STS_MASTER_COMM_DISABLED Disabled CANopen master communication

The CANopen master successfully contacted the slave in


%SB6102 0 816 CO_STS_SLAVE1_CONTACTED
the indicated address
%SB6102 1 817 CO_STS_SLAVE1_CONFIG_OK The CANopen master successfully configured the slave

Error control protocol (node guarding/heartbeat) initiated


%SB6102 2 818 CO_STS_SLAVE1_ERROR_CTRL_OK
w ith the slave

WPS v2.5X | 1169


Equipments (Devices)

%SB6102 3 819 CO_STS_SLAVE1_INIT_FINISHED Concluded slave initialization

%SB6102 4 820 CO_STS_SLAVE1_INIT_ERROR Initialization error in the indicated address slave

Fault detected in some slave from the CANopen master


%SB6102 5 821 CO_STS_SLAVE1_ERROR_CTRL_FAIL
error detection protocol
%SB6102 6 822 CO_STS_SLAVE1_EMCY The slave in the indicated address reported EMCY error

The CANopen master successfully contacted the slave in


%SB6104 0 832 CO_STS_SLAVE2_CONTACTED
the indicated address
%SB6104 1 833 CO_STS_SLAVE2_CONFIG_OK The CANopen master successfully configured the slave

Error control protocol (node guarding/heartbeat) initiated


%SB6104 2 834 CO_STS_SLAVE2_ERROR_CTRL_OK
w ith the slave
%SB6104 3 835 CO_STS_SLAVE2_INIT_FINISHED Concluded slave initialization

%SB6104 4 836 CO_STS_SLAVE2_INIT_ERROR Initialization error in the indicated address slave

Fault detected in some slave from the CANopen master


%SB6104 5 837 CO_STS_SLAVE2_ERROR_CTRL_FAIL
error detection protocol
%SB6104 6 838 CO_STS_SLAVE2_EMCY The slave in the indicated address reported EMCY error

... ... ... ... ...

The CANopen master successfully contacted the slave in


%SB6354 0 2832 CO_STS_SLAVE127_CONTACTED
the indicated address
%SB6354 1 2833 CO_STS_SLAVE127_CONFIG_OK The CANopen master successfully configured the slave

Error control protocol (node guarding/heartbeat) initiated


%SB6354 2 2834 CO_STS_SLAVE127_ERROR_CTRL_OK
w ith the slave
%SB6354 3 8235 CO_STS_SLAVE127_INIT_FINISHED Concluded slave initialization

%SB6354 4 2836 CO_STS_SLAVE127_INIT_ERROR Initialization error in the indicated address slave

Fault detected in some slave from the CANopen master


%SB6354 5 2837 CO_STS_SLAVE127_ERROR_CTRL_FAIL
error detection protocol
%SB6354 6 2838 CO_STS_SLAVE127_EMCY The slave in the indicated address reported EMCY error

SDO error: address of the slave w ith the last detected


%SW6360 -- 3180 CO_SDO_ERROR_NODE_ID
SDO error

%SW6362 -- 3181 CO_SDO_ERROR_OBJECT_INDEX SDO error: object index

%SW6364 -- 3182 CO_SDO_ERROR_OBJECT_SUBINDEX SDO error: object sub-index

%SW6366 -- 3183 CO_SDO_ERROR_FUNCTION SDO error: function (w riting/reading)

%SD6368 -- 3184 CO_SDO_ERROR_VALUE SDO error: value

%SD6372 -- 3186 CO_SDO_ERROR_CODE SDO error: error code

%SB6380 -- 3190 CO_EMCY_SLAVE_ID Last reported EMCY: slave address

%SB6382 -- 3191 CO_EMCY_DATA Last reported EMCY: object data

Writing / Reading System Markers (Command)

WPS v2.5X | 1170


Equipments (Devices)

Address Bit Modbus Tag Description

CANopen

NMT command transmission by the CANopen master:


%CB6000 -- 3000 CO_CMD_NMT_COMMAND
command code

%CB6001 0 8 CO_CMD_NMT_TOGGLE NMT command transmission by the CANopen master: toggle bit

%CB6001 7 15 CO_CMD_DISABLE Disables the CANopen communication

NMT command transmission by the CANopen master: slave


%CB6002 -- 3001 CO_CMD_NMT_SLAVE_ADDR
address

NOTE!
Below description of the real axis and virtual status:

0. Disabled.
1. Errorstop.
2. Standstill.
3. Stopping.
4. Homing.
5. Continuous Motion.
6. Discrete Motion.
7. Synchronized Motion.

WPS v2.5X | 1171


Equipments (Devices)

Note 1: When the drive is in "Stopping" on "Errorstop" every block can be called, but only MC_Reset block is
executed;
Note 2: Attempt to enable the drive, but the drive is in fault;
Note 3: Enabling the drive and the drive is not in fault;
Note 4: MC_Stop.Done is true and MC_Stop.Execute is false;
Note 5: MC_StepDirect, MC_StepRefPulse or MC_FinishHoming.

11.10.3Oriented Start-Up
The function Oriented Start-Up is utilized to realize the minimal required configuration to put SCA-06 into
operation.

WPS v2.5X | 1172


Equipments (Devices)

The Oriented Start-Up can be executed during the resource creation, or throught the context menu off the
resource by selecting the option Oriented Start-Up.

1. On the Start-Up screen the main options that require configuration are the parameters P385 (Servomotor
Model) and P202 (Operation Mode).

WPS v2.5X | 1173


Equipments (Devices)

2. According to the operation mode selected the configurator will be adjusted enabling or disabling other
options, below is a example of the options enabled when the operation mode is 5 - CANopen.

3. After the definition of the operation mode and other options, is only necessary to click on Execute Start-Up
, if it is executed properly a message informing success will be displayed otherwise a message informing

WPS v2.5X | 1174


Equipments (Devices)

fail will be displayed.

4. After the successfull execution of the Start-Up during the resource creation, the system will enable a step

WPS v2.5X | 1175


Equipments (Devices)

named Auto-Tuning in the wizard, this step is up to the user to perform or not.

11.10.4Auto-Tuning
The function Auto-Tuning is utilized to realize automatic adjusts on SCA-06 to obtain a better performance of
the equipment.

The Auto-Tuning can be executed during the resource creation, or throught the resource context menu by
selecting the option Auto-Tuning.

WPS v2.5X | 1176


Equipments (Devices)

1. On the Auto-Tuning screen the options that require configuration are P582 (Rotation Direction) and if the
user program should be stopped before execution and started again after the Auto-Tuning conclusion.

WPS v2.5X | 1177


Equipments (Devices)

2. After choosing the options is only necessary to click on Execute Auto-Tuning to start the process that
takes less than a minute. if it is executed properly a message informing success will be displayed
otherwise a message informing fail will be displayed.

11.10.5Import from WLP


The function import from WLP is utilized to import Ladder developed on WLP software to equipment (device).

The import from WLP can be executed during the resource creation.

WPS v2.5X | 1178


Equipments (Devices)

1. To execute the import WLP function click the Import from WLP button and select the WLP project folder or
the WLP BKP file.

WPS v2.5X | 1179


Equipments (Devices)

WPS v2.5X | 1180


Equipments (Devices)

2. After import from WLP completed successfully click the Finish button to copy the imported files to new
resource.

11.10.6Parameters
11.10.6.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 1181


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 1182


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.10.6.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 1183


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 1184


Equipments (Devices)

11.10.6.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 1185


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 1186


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 1187


Equipments (Devices)

11.10.6.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 1188


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 1189


Equipments (Devices)

WPS v2.5X | 1190


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 1191


Equipments (Devices)

WPS v2.5X | 1192


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 1193


Equipments (Devices)

WPS v2.5X | 1194


Equipments (Devices)

WPS v2.5X | 1195


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 1196


Equipments (Devices)

WPS v2.5X | 1197


Equipments (Devices)

11.10.6.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 1198


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 1199


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.10.7Ladder
11.10.7.1 Coil
11.10.7.1.1 DIRECTCOIL
Logical block used to assign direct values of the output variables.

WPS v2.5X | 1200


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example keeps the digital output DO9 permanently connected, because the value of A in
this case is the value of the left bus which is always considered high logic level (TRUE).

11.10.7.1.2 IMMEDIATECOIL
Logical block used for assigning values to standard digital outputs instantly.

Ladder Representation

WPS v2.5X | 1201


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the digital output corresponding to O1.
Unlike the direct coil, this block does not wait until the end of the scan cycle so that the output value
is updated; this is done at the same time the block is activated.

NOTE!
This block only works with standard digital outputs of the product.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Diagram

Block Flowchart

WPS v2.5X | 1202


Equipments (Devices)

Example

The above example immediately activates the internal buzzer when it detects that the power of the
CANopen bus was stopped and remains on until the power is restored.

11.10.7.1.3 INVERTEDCOIL
Logical block used for assigning values denied to output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the denied value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

WPS v2.5X | 1203


Equipments (Devices)

Example

The above example disables the digital output DO3 when some of the digital inputs DI1 and DI2 are
with FALSE value. When both inputs are with a TRUE value, DO3 activates.

11.10.7.1.4 RESETCOIL
Logical block used for indefinite disabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers a FALSE value to the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

WPS v2.5X | 1204


Equipments (Devices)

Block Flowchart

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI5.

11.10.7.1.5 SETCOIL
Logical block used for indefinite enabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

WPS v2.5X | 1205


Equipments (Devices)

When identifying a TRUE value in A, this block transfers the value of A for the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI6.

11.10.7.1.6 TOGGLECOIL
Logical block used for output variables alternance.

Ladder Representation

WPS v2.5X | 1206


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output
VAR TOGGLECOIL_INST_0 TOGGLECOIL Instance of access to block structure

Operation

When identifying a transition from FALSE to TRUE (leading edge) on A, the block reverses the status
of O1.

Diagram

Block Flowchart

Example

The above example inverts the state of the digital output DO6 to each disabling the internal buzzer.

WPS v2.5X | 1207


Equipments (Devices)

11.10.7.2 Communication Network


11.10.7.2.1 CANopen
11.10.7.2.1.1 CANopen Overview
Operation in the CANopen Network - Master Mode

Besides the operation as a slave, the PLC300 programmable controller also allows operation as a master for
the CANopen network. PLC300 characteristics and functions as a master for the CANopen network will be
described as follows.

Enabling Function CANopen Master

By default, PLC300 programmable controller is programmed to operate as a slave for the CANopen network.
Programming the equipment as a master for the network must be done by using the WSCAN software that
also allows the configuration of the whole CANopen network. A detailed description of the WSCAN software
windows and functions must be obtained in the menu "Help" in the software itself.

After the master configuration has been created, it is necessary to download the configurations by using one
of the product's programming interfaces - refer to the user manual for further information. Once programmed as
a master for the network, in case it is necessary to delete said configurations, the function to delete the user
program - available in the Setup menu - also deletes the CANopen master configurations.

NOTE!
CANopen network is a flexible network that allows several different ways of configuring and
operating. Nonetheless, such a flexibility requires the user to have a good knowledge of the
communication functions and objects used to configure the network, as well as knowledge of the
WSCAN programming software.

CANopen Master Characteristics

PLC300 programmable controller allows the control of a group of up to 63 slaves, using the following
communication tasks and resources:

Network management task (NMT)


63 transmission PDOs
63 reception PDOs
63 Heartbeat Consumers
Heartbeat Producer
SDO Client
SYNC producer/consumer
512 bytes of input network markers
512 bytes of output network markers

Physical characteristics - installation, connector, cable, etc. - are the same for PLC300 operating both as a
master and a slave. Address configurations and communication rate are also necessary for the operation as a
master, but these configurations are programmed by the WSCAN software according to the properties defined
for the master in the software itself.

WPS v2.5X | 1208


Equipments (Devices)

NOTE!
Input network markers are used to map data in RPDOs, while output network markers are used
to map data in TPDOs. They can be accessed in Byte (%IB or %QB), Word (%IW or %QW), or
Double Word (%ID or %QD). Nonetheless, their function is not pre-defined and depends on the
Ladder application developed for the PLC300 controller.

Master Operation

Once programmed to operate as a master, the PLC300 programmable controller will perform the following
steps in order to perform the sequential initialization for each one of the slaves.

1. By sending the communication reset command to the whole network, so that the slaves initialize with
values known for the communication objects.
2. Equipment identification in the network, through the reading via SDO of the 1000h/00h object - Object
Identification.
3. Writing via SDO of all objects programmed for the slave, which usually include the configuration and
mapping of TPDOs and RPDOs, node guarding, heartbeat, besides the manufacturer's specific objects, in
case they are programmed.
4. Error control task initialized - node guarding or heartbeat - in case they are programmed.
5. Sending of the slave to the operating mode.

If one of these steps fails, communication error with the slave will be indicated. Depending on the
configurations, the initialization of slaves will be aborted, and the master will initialize the following slave,
returning to the slave presenting error, after trying to initialize all other slaves in the network.

Similarly, if during the operation of a slave, an error in the error control task is identified, depending on the
configurations made for the master, the slave will be automatically reset and the initialization procedure will be
performed over.

NOTE!
The communication state and the state of each slave can be observed in input system markers.

Blocks for the CANopen Master

Besides the communication and configuration objects made in the WSCAN software, blocks for the monitoring
and sending of commands, which can be used during the creation of the application in Ladder for the PLC300
programmable controller, are also available. It is not necessary to use said blocks during the equipment
operation, but its use provides more flexibility and facilitates the diagnosis of communication problems during
the PLC300 programmable controller operation.

11.10.7.2.1.2 CO_SDORead
Block that performs a reading of data via SDO from a remote slave in CANopen network.

Ladder Representation

WPS v2.5X | 1209


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
NodeID# BYTE Slave address
Index# WORD Index of the object to be accessed in slave
VAR_INPUT SubIndex# BYTE Sub-index of the object
Size# BYTE Size of data accessed, in bytes
Maximum w aiting time for arrival of data, from the
Timeout# WORD
beginning of the request [ms]
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Busy BOOL Flag of the SDO client is busy w ith another request
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID BYTE USINT Identifier of the occurred error
Value BYTE USINT Variable that stores the received data
VAR CO_SDOREAD_INST_0 CO_SDOREAD Instance of access to block structure

Operation

When this block detects a leading edge on Execute it checks whether the SDO client in the specified
NodeID # address is free to send data (Busy variable at FALSE level). If so, it sends the reading
request to the object of Size# size located in Index# and SubIndex# and sets the Active output,
resetting it when receiving the response from the slave. The received data is stored in the Value
variable. If the slave is not free, the block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to Size#. It is important to check this compatibility not to generate
errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1210


Equipments (Devices)

Code Description
0 Executed successfully
1 Card cannot execute the function
2 Timeout in slave response
3 Slave returned error

Block Flowchart

WPS v2.5X | 1211


Equipments (Devices)

WPS v2.5X | 1212


Equipments (Devices)

Example

The example above requests reading of the data size SIZE, located in INDEX - SUBINDEX, of the
NODEID device. This data is forwarded to VALUE. The block ends successfully, Done output is
activated.

11.10.7.2.1.3 CO_SDOWrite
Block that performs a writing of data via SDO from a remote slave in CANopen network.

Ladder Representation

Block Structure

WPS v2.5X | 1213


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
NodeID# BYTE Slave address
Index# WORD Index of the object to be accessed in slave
SubIndex# BYTE Sub-index of the object
VAR_INPUT
Size# BYTE Size of data accessed, in bytes
Maximum w aiting time for arrival of data, from the
Timeout# WORD
beginning of the request [ms]
Value BYTE USINT Variable that has the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
VAR_OUTPUT Busy BOOL Flag of the SDO client is busy w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE USINT Identifier of the occurred error
VAR CO_SDOWRITE_INST_0 CO_SDOWRITE Instance of access to block structure

Operation

When this block detects a leading edge on Execute it checks whether the SDO client in the specified
NodeID # address is free to send data (Busy variable at FALSE level). If so, it sends the writing
request to the object of Size# size located in Index# and SubIndex# and sets the Active output,
resetting it when receiving the response from the slave. If the slave is not free, the block waits Busy
go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to Size#. It is important to check this compatibility not to generate
errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Card cannot execute the function
2 Timeout in slave response
3 Slave returned error

Block Flowchart

WPS v2.5X | 1214


Equipments (Devices)

WPS v2.5X | 1215


Equipments (Devices)

Example

The example above requests writing of the data size VALUE, located in INDEX - SUBINDEX, of the
NODEID device. The block ends successfully, Done output is activated.

11.10.7.3 Compare
11.10.7.3.1 COMPEQ
Block that compares the values of Value1 and Value2, enabling the output Q if both are equal.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality

Operation

When this block has a TRUE value in EN, it sends to the output Q the TRUE value if Value1 and
Value2 are the same. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1216


Equipments (Devices)

Example

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated. Notice that the types of the input variables can be different
without causing execution problems.

WPS v2.5X | 1217


Equipments (Devices)

The example above checks equality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is disabled.

11.10.7.3.2 COMPGE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
or equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or majority of Value1

Operation

When this block has a TRUE value in EN it sends the Q output to the TRUE value if Value1 is higher
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1218


Equipments (Devices)

Example

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is disabled.

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 1219


Equipments (Devices)

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is activated.

11.10.7.3.3 COMPGT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of majority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is higher
than Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1220


Equipments (Devices)

Example

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is disabled.

The example above checks the majority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 1221


Equipments (Devices)

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is activated.

11.10.7.3.4 COMPLE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than or
equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1222


Equipments (Devices)

Example

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is activated.

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 1223


Equipments (Devices)

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is disabled.

11.10.7.3.5 COMPLT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1224


Equipments (Devices)

Example

The example above checks minority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is activated.

The example above checks the minority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 1225


Equipments (Devices)

The example above checks the minority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is disabled.

11.10.7.3.6 COMPNE
Block that compares the values of Value1 and Value2, enabling the Q output if Value1 is different from
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of inequality

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is
different from Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1226


Equipments (Devices)

Example

The example above checks inequality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is disabled.

11.10.7.4 Contact
11.10.7.4.1 NCCONTACT
Normally closed contact.

Ladder Representation

WPS v2.5X | 1227


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with TRUE value, B receives FALSE.


When variable I1 is with FALSE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1228


Equipments (Devices)

Example

The above example performs the transfer of the opposite value of digital input DI1 to the digital output
DO2.

11.10.7.4.2 NOCONTACT
Normally open contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with FALSE value, B receives FALSE.


When variable I1 is with TRUE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1229


Equipments (Devices)

Example

The above example performs the transfer of the value of digital input DI1 to the digital output DO2.

11.10.7.4.3 NTSCONTACT
Falling edge transition contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR NTSCONTACT_INST_0 NTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from TRUE to FALSE (falling edge or negative edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

WPS v2.5X | 1230


Equipments (Devices)

Block Flowchart

Example

The above example resets the digital output DO1 if the SHIFT key is pressed or a positive pulse on
the digital input DI2 is given.

11.10.7.4.4 PTSCONTACT

Leading edge transition contact.

Ladder Representation

WPS v2.5X | 1231


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR PTSCONTACT_INST_0 PTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from FALSE to TRUE (leading edge or positive edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1232


Equipments (Devices)

Example

The above example resets the digital output DO1 if the SHIFT key is pressed and a positive pulse on
the digital input DI2 is given.

11.10.7.5 Control
11.10.7.5.1 PID
Block that performs the function of a discrete PID controller. From the input variables, it calculates the
corresponding controller output.

Ladder Representation

Block Structure

WPS v2.5X | 1233


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SetPoint REAL Automatic reference (pre-control)
ManualSetPoint REAL Forced reference (post control)
SelectSetPoint BOOL Selects w hich reference to use
Feedback REAL Feedback loop variable
MinimumOutput REAL Minimum value of the controller output
MaximumOutput REAL Maximum value of the controller output
VAR_INPUT
Kp REAL Proportional gain
Ki REAL Integral gain
Kd REAL Derivative gain
TauSetPoint# REAL Time constant of the automatic reference in put filter
Type# BYTE Controller type
Action# BYTE Control action
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Controller output
VAR PID_INST_0 PID Instance of access to block structure

Operation

On the positive transition edge in EN, Output receives zero value, and the block executes its
functionality as EN is at TRUE level.

When enabled, this block performs a routine PID control with the Kp, Ki and Kd parameters chosen.
The PID topology used may be the Academic or Parallel, depending on what is chosen in Type#.

Academic Form:

Parallel Form:

WPS v2.5X | 1234


Equipments (Devices)

The levels of the output signal of the controller are saturated at value MinimumOutput and
MaximumOutput. The SelectSetPoint input level FALSE causes the SetPoint reference be adopted,
allowing the controller maintains control over the process. When SelectSetPoint goes to TRUE level,
the controller has no more domain, and ManualSetPoint becomes to be considered the output signal
of the controller.

Action# will define the feedback operation. If Action# is DIRECT, the operation will be SetPoint –
Feedback. If Action# is REVERSE, the operation will be Feedback – SetPoint.

Feedback receives the process variable considered as the plant output. Ts# receives the sampling
time for the controller and # TauSetPoint receives the time constant for the input filter of the automatic
reference.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Effects of the alteration of gains on the process
If Kp decreases, the process becomes slower; generally more stable or less oscillating; it has
less overshoot.
If Kp increases, the process responds faster; it may become more unstable or more
oscillating; it has more overshoot.
If Ki decreases, the process becomes slower, lagging to reach the "SetPoint"; it becomes
more stable or less oscillating; it has less overshoot.
If Ki increases, the process becomes faster, quickly reaching the "SetPoint"; it becomes more
unstable or more oscillating; it has more overshoot.
If Kd decreases, the process becomes slower; it has less overshoot.
If Kd increases, it has more overshoot.

WPS v2.5X | 1235


Equipments (Devices)

NOTE!
How to improve the performance of the process through the adjustment of gains (valid for the
Academic PID)
If the performance of the process is almost good, but the overshoot is a bit high, try to: (1)
decrease Kp 20%, (2) decrease Ki 20% and/or (3) decrease Kd 50%.
If the performance of the process is almost good, but it does not have overshoot and lags to
reach the "SetPoint", try to: (1) increase Kp 20%, (2) increase Ki 20% and/or (3) increase Kd
50%.
If the performance of the process is good, but the process output is varying too much, try to:
(1) increase Kd 50%, (2) decrease Kp 20%.
If the performance of the process is bad, i.e. after start up, the transitory lasts several periods
of oscillation that reduce very slowly or never reduce at all, try to: (1) decrease Kp 50%.
If the performance of the process is bad, i.e. after start up it slowly moves towards the
"SetPoint" without overshoot, but is still very far and the process output is less than the rated
value, try to: (1) increase Kp 50%, (2) increase Ki 50%, (3) increase Kd 70%.

Block Flowchart

WPS v2.5X | 1236


Equipments (Devices)

WPS v2.5X | 1237


Equipments (Devices)

Example

The above example creates a loop of a digital PID form with sampling time 50 ms, using the
constants KP, KI and KD for control. Automatic reference SETPOINT, filtered by a first order filter with
time constant of 0:01 is used. The error signal is calculated as the difference between the filtered
reference and variable SAIDA_PLANTA. The controller output is saturated between the values 0.1 and
2.5 and sent to the variable ENTRADA_PLANTA.

11.10.7.6 Conversion
11.10.7.6.1 BCD
11.10.7.6.1.1 BCD_TO_WORD
Block that performs the conversion of a BCD code into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in BCD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BCD and converts it to
WORD, storing in Result.

WPS v2.5X | 1238


Equipments (Devices)

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example converts the VALUE variable, in BCD, into a WORD value storing the final result
in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.1.2 WORD_TO_BCD
Block that performs the conversion of a WORD value into a BCD code.

Ladder Representation

WPS v2.5X | 1239


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in BCD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BCD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1240


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in WORD, into a BCD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.2 BOOL
11.10.7.6.2.1 BYTE_TO_BOOL
Block that performs the conversion of a BYTE value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1241


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BYTE, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.2.2 DWORD_TO_BOOL
Block that performs the conversion of a DWORD value into a BOOL value.

Ladder Representation

WPS v2.5X | 1242


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1243


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in DWORD, into a BOOL value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.2.3 LREAL_TO_BOOL
Block that performs the conversion of a LREAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value LREAL Value in LREAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as LREAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 1244


Equipments (Devices)

Block Flowchart

11.10.7.6.2.4 REAL_TO_BOOL
Block that performs the conversion of a REAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1245


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing

WPS v2.5X | 1246


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated. Notice in the
last example that the values very close to the machine epsilon may result in an interpretation of the
FALSE value.

11.10.7.6.2.5 WORD_TO_BOOL
Block that performs the conversion of a WORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1247


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in WORD, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.3 BYTE
11.10.7.6.3.1 BOOL_TO_BYTE
Block that performs the conversion of a BOOL value into a BYTE value.

WPS v2.5X | 1248


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1249


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BOOL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.3.2 DWORD_TO_BYTE
Block that performs the conversion of a DWORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1250


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.10.7.6.3.3 DWORD_TO_BYTES
Block that performs the conversion of a 32 bits (DWORD) value into four 8 bits (4 BYTES) value.

WPS v2.5X | 1251


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
Result1 BYTE USINT SINT Value in BYTE (LSB)
VAR_OUTPUT Result2 BYTE USINT SINT Value in BYTE
Result3 BYTE USINT SINT Value in BYTE
Result4 BYTE USINT SINT Value in BYTE (MSB)

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
four BYTE values (from Result1 to Result4, where Result 1 is LSB), storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1252


Equipments (Devices)

Example

WPS v2.5X | 1253


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in DWORD, into four BYTE value
storing the final result in RESULT1, RESULT2, RESULT3 and RESULT4. The block ends with
success and ENO output is activated.

11.10.7.6.3.4 LREAL_TO_BYTE
Block that performs the conversion of a LREAL value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value LREAL Value in LREAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as LREAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1254


Equipments (Devices)

11.10.7.6.3.5 REAL_TO_BYTE
Block that performs the conversion of a REAL value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1255


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in REAL, into a BYTE value storing

WPS v2.5X | 1256


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated. Notice that the
results are truncated in decimal and only the eight least significant bits are taken into account.

11.10.7.6.3.6 WORD_TO_BYTE
Block that performs the conversion of a WORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1257


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in WORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.10.7.6.3.7 WORD_TO_BYTES
Block that performs the conversion of a 16 bits (WORD) value in two 8 bits (2 BYTES) value.

WPS v2.5X | 1258


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT Result1 BYTE USINT SINT Value in BYTE (LSB)
Result2 BYTE USINT SINT Value in BYTE (MSB)

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it in
two BYTE variables, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1259


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE "VAL_IN", in WORD, in two BYTE
values storing the final result in RESULT1 and RESULT2. The block ends with success and ENO
output is activated.

WPS v2.5X | 1260


Equipments (Devices)

11.10.7.6.4 DWORD
11.10.7.6.4.1 BOOL_TO_DWORD
Block that performs the conversion of a BOOL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1261


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.4.2 BYTE_TO_DWORD
Block that performs the conversion of a BYTE value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1262


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BYTE, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.4.3 BYTES_TO_DWORD
Block that performs the conversion of four 8 bits (BYTE) values into a 32 bits (DWORD) value.

Ladder Representation

WPS v2.5X | 1263


Equipments (Devices)

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
Value1 BYTE USINT SINT Value in BYTE (1st byte - LSB)
VAR_INPUT Value2 BYTE USINT SINT Value in BYTE
Value3 BYTE USINT SINT Value in BYTE
Value4 BYTE USINT SINT Value in BYTE (4th byte - MSB)
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value1, Value2, Value3 and Value4 values
as BYTE and converts it into a DWORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1264


Equipments (Devices)

Example

The examples above perform the conversion of four variables VALUE1..4, in BYTE, into a DWORD
value storing the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.4.4 LREAL_TO_DWORD
Block that performs the conversion of a LREAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value LREAL Value in LREAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

WPS v2.5X | 1265


Equipments (Devices)

Operation

When this block has a TRUE value in EN, it interprets the Value value as LREAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

11.10.7.6.4.5 REAL_TO_DWORD
Block that performs the conversion of a REAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

WPS v2.5X | 1266


Equipments (Devices)

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1267


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in REAL, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated. Note that the
results are truncated in decimal and only the thirty-two least significant bits are taken into account.

11.10.7.6.4.6 WORD_TO_DWORD
Block that performs the conversion of a WORD value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1268


Equipments (Devices)

Example

The examples above convert the VALUE variable, in WORD, into a DWORD value storing the final
result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.4.7 WORDS_TO_DWORD
Block that performs the conversion of two 16 bits (WORD) values into a 32 bits (DWORD) value.

Ladder Representation

Block Structure

WPS v2.5X | 1269


Equipments (Devices)

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Value1 WORD UINT INT 1st WORD (Less Significant Word)
Value2 WORD UINT INT 2nd WORD (More Significant Word)
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value1 and Value2 values as WORD and
converts it into a DWORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1270


Equipments (Devices)

The examples above perform the conversion of two variable VALUE1 and VALUE2, in WORD, into a
DWORD value storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.10.7.6.5 LREAL
11.10.7.6.5.1 BOOL_TO_LREAL
Block that performs the conversion of a BOOL value into a LREAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result LREAL Value in LREAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
LREAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1271


Equipments (Devices)

11.10.7.6.5.2 BYTE_TO_LREAL
Block that performs the conversion of a BYTE value into a LREAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result LREAL Value in LREAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
LREAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1272


Equipments (Devices)

11.10.7.6.5.3 DWORD_TO_LREAL
Block that performs the conversion of a DWORD value into a LREAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result LREAL Value in LREAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
LREAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1273


Equipments (Devices)

11.10.7.6.5.4 REAL_TO_LREAL
Block that performs the conversion of a REAL value into a LREAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL USINT SINT Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result LREAL Value in LREAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
LREAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1274


Equipments (Devices)

11.10.7.6.5.5 WORD_TO_LREAL
Block that performs the conversion of a WORD value into a LREAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result LREAL Value in LREAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
LREAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1275


Equipments (Devices)

11.10.7.6.6 Rad-Deg
11.10.7.6.6.1 DEG_TO_RAD
Block that performs the conversion of a value in degrees into a value in radians.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in degrees
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in radians

Operation

When this block has a TRUE value in EN, it interprets the Value value as in degrees and converts it
into radians, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1276


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in degrees, into a corresponding value
in radians storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.10.7.6.6.2 RAD_TO_DEG
Block that performs the conversion of a value in radians into a value in degrees.

Ladder Representation

Block Structure

WPS v2.5X | 1277


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in radianos
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in graus

Operation

When this block has a TRUE value in EN, it interprets the Value value as in radians and converts it
into degrees, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1278


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in radians, into a corresponding value
in degrees storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.10.7.6.7 REAL
11.10.7.6.7.1 BOOL_TO_REAL
Block that performs the conversion of a BOOL value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1279


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BOOL, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.7.2 BYTE_TO_REAL
Block that performs the conversion of a BYTE value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 1280


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1281


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.7.3 DWORD_TO_REAL
Block that performs the conversion of a DWORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1282


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.7.4 LREAL_TO_REAL
Block that performs the conversion of a LREAL value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 1283


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value LREAL USINT SINT Value in LREAL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as LREAL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

11.10.7.6.7.5 WORD_TO_REAL
Block that performs the conversion of a WORD value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 1284


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1285


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.8 WORD
11.10.7.6.8.1 BOOL_TO_WORD
Block that performs the conversion of a BOOL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1286


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.8.2 BYTE_TO_WORD
Block that performs the conversion of a BYTE value into a WORD value.

Ladder Representation

Block Structure

WPS v2.5X | 1287


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1288


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.10.7.6.8.3 BYTES_TO_WORD
Block that performs the conversion of two 8 bits (BYTE) values into a 16 bits (WORD) value.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Value1 BYTE USINT SINT 1st BYTE (LSB)
Value2 BYTE USINT SINT 2nd BYTE (MSB)
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value1 and Value2 values as BYTE and
converts it into a WORD variable, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1289


Equipments (Devices)

Example

The examples above perform the conversion of two variable VALUE1 and VALUE2, in BYTE, into a
WORD value storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.10.7.6.8.4 DWORD_TO_WORD
Block that performs the conversion of a DWORD value into a WORD value.

Ladder Representation

WPS v2.5X | 1290


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1291


Equipments (Devices)

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Notice that only the
sixteen least significant bits are taken into account.

11.10.7.6.8.5 DWORD_TO_WORDS
Block that performs the conversion of a 32 bits (DWORD) value in two 16 bits (2 WORD) value.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT Result1 WORD UINT INT Value in WORD (Less Significant Word)
Result2 WORD UINT INT Value in WORD (More Significant Word)

Operation

When this block has a TRUE value in EN, it interprets the value as DWORD and converts it in two
WORD variables (Result1 and Result2), storing in Result.

When EN has FALSE value, Result remains unchanged.

WPS v2.5X | 1292


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1293


Equipments (Devices)

The examples above perform the conversion of a variable VALUE, in DWORD, in two WORD values
storing the final result in RESULT1 and RESULT2. The block ends with success and ENO output is
activated.

11.10.7.6.8.6 LREAL_TO_WORD
Block that performs the conversion of a LREAL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value LREAL Value in LREAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as LREAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1294


Equipments (Devices)

11.10.7.6.8.7 REAL_TO_WORD
Block that performs the conversion of a REAL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1295


Equipments (Devices)

Example

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Note that the results
are truncated in decimal and only the sixteen least significant bits are taken into account.

WPS v2.5X | 1296


Equipments (Devices)

11.10.7.7 Counter
11.10.7.7.1 CTD
Countdown block of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CD BOOL Pulse identifier
VAR_INPUT LD BOOL Loads the value of PV in CV
PV WORD UINT Value of initial configuration
Q BOOL Counter zeroed flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTD_INST_0 CTD Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it decrements the CV variable until it is zero. While
CV equals zero, the output Q remains at TRUE level. By detecting high-level LD, the block loads the
PV value in CV.

Block Flowchart

WPS v2.5X | 1297


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1298


Equipments (Devices)

Example

The above example shows the initial conditions of routine. As CV has a value of zero, the Q output is
enabled.

The value of the PV variable was changed to 20, but not yet loaded.

WPS v2.5X | 1299


Equipments (Devices)

By identifying TRUE level in LD, the block loads the PV value to CV. Since this value is greater than
zero, the Q output is disabled.

At each leading edge identified in CD, the value of COUNT is decremented until it reaches zero, when
the Q output is enabled.

11.10.7.7.2 CTU
Block for gradual count of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CU BOOL Pulse identifier
VAR_INPUT R BOOL Loads the zero value in CV
PV WORD UINT Maximum count value
Q BOOL Counter overrun flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTU_INST_0 CTU Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it increments the CV variable until it is equal to PV.
While CV equals PV, the output Q remains at TRUE level. By detecting high-level R, the block loads
the zero value in CV.

Block Flowchart

WPS v2.5X | 1300


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1301


Equipments (Devices)

Example

The above example shows the initial conditions of routine. Since CV has a lower value than of PV, the
Q output is disabled.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the Q output is enabled.

WPS v2.5X | 1302


Equipments (Devices)

By identifying TRUE level in R, the block loads the zero value to CV. Since this value is lower than of
PV, the Q output is disabled.

11.10.7.7.3 CTUD
Block for gradual count and countdown of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
CU BOOL Pulse identifier for incremental
CD BOOL Pulse identifier for decremental
VAR_INPUT
R BOOL Loads the zero value in CV
LD BOOL Loads the value of PV in CV
PV WORD UINT Reference value
ENO BOOL Output enabling
QU BOOL Counter overrun flag
VAR_OUTPUT
QD BOOL Counter zeroed flag
CV WORD UINT Current count value
VAR CTUD_INST_0 CTUD Instance of access to block structure

Operation

When this block has a TRUE value in EN, it acts as a CTD block and block CTU at the same time
acting on the same CV counter. That is: increments CV until it reaches PV to the leading edges in
CU and decrements CV until it reaches zero to the leading edges in CD. A positive transition in R
carries zero in CV, while a leading edge in LD loads the PV value in CV. If CV has zero value, QD
receives TRUE, and if CV has value equal to PV, QU receives TRUE.

WPS v2.5X | 1303


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value.

Block Flowchart

WPS v2.5X | 1304


Equipments (Devices)

WPS v2.5X | 1305


Equipments (Devices)

Operation Diagram

Example

WPS v2.5X | 1306


Equipments (Devices)

The example above shows the disabled block, with all its internal variables zeroed. Although the
external controls are activated, these values are not forwarded to the instance of the block.

When activated, the block identifies the value of PRESET, loading it in PV, and identifies that the
output is at zero, enabling the QD output. When execution is completed, the ENO output is activated.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the QU output is enabled. When execution is completed, the ENO output is activated.

At each leading edge detected in CD, the CV value is decremented. When CV is a value between
zero and PV, both QD and QU outputs are deactivated. When execution is completed, the ENO
output is activated.

WPS v2.5X | 1307


Equipments (Devices)

A TRUE value in R resets CV, while a TRUE value in LD loads the value of PV to CV. As we can see,
R prevails over LD, leaving CV and enabling the QD output. When execution is completed, the ENO
output is activated.

11.10.7.8 Data Transfer


11.10.7.8.1 ARRAYCOPY
Block that copies an array from a certain position to another array or to itself.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
Array: BYTE USINT
SINT WORD UINT
VAR_SRC Input Array
INT DWORD UDINT
DINT REAL
VAR_INPUT BYTE USINT WORD Position of the input array from w hich the copy w ill be
POS_SRC
UINT made
BYTE USINT WORD Position of the output array from w hich it w ill be
POS_DST
UINT replaced
BYTE USINT WORD
LEN Number of array positions to be copied
UINT
ENO BOOL End of operation
Array: BYTE USINT
VAR_OUTPUT SINT WORD UINT
Result Output Array
INT DWORD UDINT
DINT REAL

WPS v2.5X | 1308


Equipments (Devices)

Operation

This block, when it has a value of TRUE in EN, copies LEN values from the POS_SRC position from
the input array (VAR_SRC) to the position POS_DST into the destination array (Result).

Comments:
- POS_SRC, POS_DST and LEN input variables only accept positive integers. If a negative value is
assigned to any of them, the value zero will be considered.
- The Input Array can be repeated on the output without worrying about data being overwritten.
- If the amount of data to be copied defined by LEN exceeds the last position of the input array, only
valid data will be copied to the last position of the input array, thus avoiding any garbage being
assigned to the output array.
- If the amount of data to be copied defined by LEN exceeds the last position of the output array, only
the data required to complete it will be copied, preventing subsequent memory from receiving
unwanted values.
- The block will not execute if LEN has a value greater than the size of the input array.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!

It is important to notice that not only LEN but also POS_SRC will not exceed the
VAR_SRC array's size. The same must be noticed when setting values to POS_DST,
related to the output array Result.

To learn how to create arrays please go to: Ladder > Editor > Variables > Editing in
the Rung

Block Flowchart

Example

WPS v2.5X | 1309


Equipments (Devices)

WPS v2.5X | 1310


Equipments (Devices)

In the examples above the value of the variable SRC is copied to DST array, according to source
position (POS_SRC), destination (POS_DST) and the lenght to be copied (LEN). The block ends with
success and ENO output is activated.

11.10.7.8.2 DEMUX
Block that creates 16 new BOOL variables from the decomposition of a WORD variable.

Ladder Representation

WPS v2.5X | 1311


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Word WORD UINT INT Input variable of 15 bits
ENO BOOL End of operation
VAR_OUTPUT
Bit0 – Bit15 BOOL Bit of the corresponding position of Word

Operation

When this block has a TRUE value in EN, it decomposes the input variable in Word 15 Boolean
values stored in Bit0 to Bit15 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1312


Equipments (Devices)

Example

The example above decomposes the value of MYWORD in Boolean values, which are stored in the
output variables BIT0 to Bit15. The block ends successfully and the ENO output is activated.

WPS v2.5X | 1313


Equipments (Devices)

11.10.7.8.3 DEMUX2
Block that creates 32 new BOOL variables from the decomposition of a DWORD variable.

Ladder Representation

Block Structure

WPS v2.5X | 1314


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
DWord DWORD UDINT DINT Input variable of 15 bits
VAR_OUTPUT ENO BOOL End of operation
Bit0 – Bit31 BOOL Bit of the corresponding position of Word

Operation

When this block has a TRUE value in EN, it decomposes the input variable in DWord 32 Boolean
values stored in Bit0 to Bit31 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1315


Equipments (Devices)

The example above decomposes the value of MYDWORD in Boolean values, which are stored in the
output variables BIT0 to Bit31. The block ends successfully and the ENO output is activated

11.10.7.8.4 ILOAD
Block which indirectly loads the value of a variable and transfers it to Value.

Ladder Representation

WPS v2.5X | 1316


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
DataType# BYTE Data type of the selected variable
Address DWORD UDINT DINT Address of the global variable, as its group
ENO BOOL End of operation
VAR_OUTPUT As selected in
Value Value of the selected variable
DataType#

Operation

When this block has a TRUE value in EN, it loads, in Value, the of the Address variable belonging to
the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1317


Equipments (Devices)

Example

The above example loads the value of the address 40 of group 2 (GLOBAL_SYSTEM%S), which
represents the status of ESC key in UINT format for the VALUE variable. The block ends with
success and ENO output is activated.

11.10.7.8.5 ILOADBOOL
Block that indirectly loads the value of a bit in a global variable address.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be checked
ENO BOOL End of operation
VAR_OUTPUT
Value BOOL Value of the bit selected by the input arguments

Operation

When this block has a TRUE value in EN, it loads, in Value, the Bit contents of the Address variable
belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1318


Equipments (Devices)

Example

The above example loads the value of bit 1 of the address 24 of group 2 (S GLOBAL_SYSTEM%),
which represents the status of ESC key for the VALUE variable. The block ends with success and
ENO output is activated.

11.10.7.8.6 ISTORE
Block that indirectly loads the Value value in a variable.

Ladder Representation

WPS v2.5X | 1319


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
DataType# BYTE Data type of the selected variable
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Depending on the
Value selection of the Value to be w ritten in the selected variable
DataType#
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the contents of the Address
variable belonging to the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1320


Equipments (Devices)

Example

The example above stores the VALUE value in WORD format in address 444 of group 3
(GLOBAL_SYSTEM% C), which represents the index of the communication port Modbus TCP. The
block ends with success and ENO output is activated.

11.10.7.8.7 ISTOREBOOL
Block that indirectly loads the Value value in a bit in a global variable address.

Ladder Representation

WPS v2.5X | 1321


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be modified
Value BOOL New value of the selected bit
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the Bit contents of the Address
variable belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1322


Equipments (Devices)

Example

The example above stores the value of VALUE in bit 7 of the address 121 in group 3
(GLOBAL_SYSTEM% C), which represents the disable command of CANopen communication. The
block ends with success and ENO output is activated.

11.10.7.8.8 MUX
Block that creates a new WORD variable from the concatenation of 16 BOOL variables.

WPS v2.5X | 1323


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit15 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
Word WORD UINT INT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable Word. Bit0 corresponds to LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1324


Equipments (Devices)

Example

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYWORD. The block ends with success and ENO output is activated.

WPS v2.5X | 1325


Equipments (Devices)

11.10.7.8.9 MUX2
Block that creates a new DWORD variable from the concatenation of 32 BOOL variables.

Ladder Representation

Block Structure

WPS v2.5X | 1326


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit31 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
DWord DWORD UDINT DINT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable DWord. Bit0 corresponds to LSB (least significant bit) and Bit31
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1327


Equipments (Devices)

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYDWORD. The block ends with success and ENO output is activated.

11.10.7.8.10 SCALE
Block that converts a value from a scale to another one.

Ladder Representation

WPS v2.5X | 1328


Equipments (Devices)

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Input value to be converted
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MAX_IN Maximum value of input scale
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
MIN_IN Minimum value of input scale
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MAX_OUT Maximum value of output scale
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
MIN_OUT Minimum value of output scale
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value on new scale
INT DWORD UDINT DINT REAL

Operation

This block, when it has a TRUE value in EN, by setting the minimum and maximum values of the
variable to be converted and the minimum and maximum values of the new scale variable, defined by
the user, performs the Scale function for the conversion of the variable according to equation:

Where:

and

The graph below represents the straight linearized:

WPS v2.5X | 1329


Equipments (Devices)

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
- The value in MAXin must be greater than value in MINin;
- The value in MAXout must be greater than value in MINout ;
- Value in Value according to: MINin = Value = MAXin.

Block Flowchart

Example

The example above stores the value of the variable VALUE in Result. The block considers the
equation described above and ends with success and ENO output is activated.

WPS v2.5X | 1330


Equipments (Devices)

11.10.7.8.11 SEL
Block that replicates to the output the value of an input variable (Value0 or Value1) according to the
Selector selection.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Selector BOOL Variable that selects the input

VAR_INPUT BYTE USINT SINT WORD UINT


Value0 Multiplexed input number 1
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value1 Multiplexed input number 2
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value selected
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it replicates to the Result variable the Value0 value if
selector is FALSE or the Value1 value if Selector is TRUE.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1331


Equipments (Devices)

Example

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated.

WPS v2.5X | 1332


Equipments (Devices)

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
TRUE level, the RESULT output gets the value of VALUE1. The block ends successfully and the ENO
output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

11.10.7.8.12 STORE
Block that performs direct storage of data from a source to a destination.

Ladder Representation

Block Structure

WPS v2.5X | 1333


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
SRC Data source
INT DWORD DINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
DST Data destination
INT DWORD DINT DINT REAL

Operation

When this block has a TRUE value in EN, it stores the contents from SRC into DST.

NOTE!
SRC and DST must have data types of the same size.

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1334


Equipments (Devices)

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated.

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated. Note that the binary pattern is maintained between variables of different
types.

11.10.7.8.13 SWAP
Block that performs a swap between the odd bytes and consecutive even bytes into Value and sends
the value to Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT WORD UINT INT
Value Input variable to be sw apped
DWORD UDINT DINT
ENO BOOL End of operation
VAR_OUTPUT WORD UINT INT DWORD UDINT
Result Output value
DINT REAL (*)

Operation

When this block has a TRUE value in EN, it changes the values of the odd bytes (1, 3, 5 and 7) and
the consecutive even bytes (2, 4, 6 and 8, respectively) of the Value variable, storing the result in
Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTA!
Caution when using in Result a variable of REAL type, because the block does not
perform type conversion, that is, it only reverses the bytes in memory.

Block Flowchart

WPS v2.5X | 1335


Equipments (Devices)

Example

The example changes the position of byte 1 value of VALUE (0x44) with byte 2 of VALUE (0x3D),
storing the final result (0x44_3D) in RESULT. The block ends with success and ENO output is
activated.

The example changes the position of byte 1 value of VALUE (0x96) with byte 2 of VALUE (0xA8) and
byte 3 of VALUE (0x0D) with byte 4 of VALUE (0x00), storing the final result (0x0D_00_96_A8) in
RESULT. The block ends with success and ENO output is activated.

11.10.7.8.14 SWAP2
Block that rearranges the bytes of a variable.

WPS v2.5X | 1336


Equipments (Devices)

Ladder Representation

Block Structure

Variable type Name Data type Description


EN BOOL Block enabling
WORD UINT INT
Value Input variable to be rearranged
VAR_INPUT DWORD UDINT DINT
Variable that defines the conversion type
Type BYTE
according to Table 2
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT WORD UINT


Result INT DWORD UDINT DINT Output value
REAL (*)
Table 1. Block variables.

Type WORD UINT INT ENO DWORD UDINT DINT ENO


0 AB->AB* TRUE ABCD->ABCD TRUE
1 AB->BA TRUE ABCD->DCBA TRUE
2 - FALSE ABCD->CDAB TRUE
3 - FALSE ABCD->BADC TRUE
4 ... - FALSE - FALSE
Table 2. Conversion type (*characters A, B, C and D represents BYTES).

Operation

When this block has a TRUE value in EN, it rearranges the bytes from Value variable, storing the
result in Result.
Type defines how the bytes will be rearranged, as shown in Table 2.
Note that for 16-bit variables, only options 0 and 1 are valid.
For 32-bit variables the options 0, 1, 2, and 3 are valid.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.
Invalid TYPE options assigns FALSE to ENO, and Result value is not changed.

NOTA!
Caution when using in Result a variable of REAL type, because the block does not
perform type conversion, that is, it only reverses the bytes in memory.

Block Flowchart

WPS v2.5X | 1337


Equipments (Devices)

Example

The example rearranges the position of value VALUE_IN according to the type set in TYPE_IN = 1
(AB->BA), storing the final result in RESULT. The block ends with success and ENO output is
activated.

11.10.7.8.15 USERERR
Block that generates an alarm or fault with the number programmed by the user.

Ladder Representation

WPS v2.5X | 1338


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Error code generated
CODE WORD UINT
(950 - 999)
VAR_INPUT
Error type generated
TYPE BYTE (0 - Alarm)
(1 - Fault)
VAR_OUTPUT ENO BOOL Success in the generation of error
VAR USERERR_INST_0 USERERR (*) Instance of access to block structure

NOTE!
(*) USERERR_INST_0 instance must be configurated to SCA06 and LDW900 .

Operation

When this block has a TRUE value in EN, it generates an alarm or equipment failure, depending on
the type defined in TYPE with CODE code.

The value of ENO informs if the generation of alarm or fault has been executed successfully.

Block Flowchart

WPS v2.5X | 1339


Equipments (Devices)

Example

The above example, when identifying TRUE level in DI1, generates a fault with the code 974 and sets
the DO1 output.

USERERR table configuration

On devices that have text-based HMI, messages can be configured through an editor. To access the
editor, right click on the USERERR block and select the "Edit USERERR Table" option.

WPS v2.5X | 1340


Equipments (Devices)

The texts configured in the table will be displayed on the HMI when the block USERERR is enabled.

After editing the table, select the argument CODE of the block equal to the CODE column of the
table.

11.10.7.9 Filter
11.10.7.9.1 LOWPASS
Block that filters the input using a low pass filter of first order and inserts the result in the output.

Ladder Representation

WPS v2.5X | 1341


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Input REAL Input signal
VAR_INPUT
Tau REAL Filter time constant
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Filter output
VAR LOWPASS_INST_0 LOWPASS Instance of access to block structure

Operation

When this block has a TRUE value in EN, filters the input value of Input using a low pass first order
filter described by Tau and Ts#, inserting the result in Output. On the leading edge of EN, Output
receives zero.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1342


Equipments (Devices)

Example

The above example causes OUTPUT, by identifying a leading edge in EN, to display a behavior of first
order with time constant equal to Tau and the sampling time of 2 ms, in order to achieve the reference
set to INPUT. At each calculation completed successfully, the ENO output is activated.

WPS v2.5X | 1343


Equipments (Devices)

11.10.7.10 Hardware
11.10.7.10.1 IMMEDIATE_INPUT
Block that performs an instantaneous reading of the selected input value, without changing the value
of images (GLOBAL_IO variables).

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Source# BYTE Inputs to be read (digital or analog)
ENO BOOL Output enabling
VAR_OUTPUT
Destination WORD INT UINT Variable mapped w ith the values of the inputs selected

Operation

When this block has a TRUE value in EN, it gets the immediate value of the selected input in
Source#. If selected the analog input AI1, its value is passed on to Destination. If the digital input is
selected, its bits are concatenated so that DI1 be the least significant bit and DI10 be the most
significant bit and the result is sent to Destination.

When EN has FALSE value, Destination remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1344


Equipments (Devices)

Example

The example above is an immediate reading of the signs of the digital inputs DI1 to DI10 of the
PLC300. This reading is then interpreted as a binary sequence with DI1 being the least significant bit
and the result is sent to the DESTINATION variable. The block ends with success, ENO output is
activated.

WPS v2.5X | 1345


Equipments (Devices)

11.10.7.10.2 IMMEDIATE_OUTPUT
Block that performs an instantaneous reading of the selected output port, without changing the value
of images (GLOBAL_IO variables).

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Variable mapped w ith the values to be sent to the
Source WORD INT UINT
selected outputs
ENO BOOL Output enabling
VAR_OUTPUT
Destination# BYTE Outputs to be w ritten (digital or analog)

Operation

When this block has a TRUE value in EN, it writes immediately in the selected output the value of
Source. If selected analog output AO1, the Source value is passed on to it. If the digital outputs are
selected, DO1 will receive the zero bit of Source, DO2 bit one, DO3 bit two, and so on.

When EN has FALSE value, Destination# remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

Device Version
PLC300 1.20 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1346


Equipments (Devices)

Example

WPS v2.5X | 1347


Equipments (Devices)

The above example is for immediate SOURCE written value, interpreted as a binary sequence, the
digital outputs DO1 to DO9 of the PLC300 and DO1 receives the value of the least significant bit. The
block ends with success, ENO output is activated. Note that the immediate writing does not prevail
over direct coil DO1 or over enabling coils in DO2, DO3 and DO4.

11.10.7.10.3 READENC5
Block that performs counting of encoder pulses.

Ladder Representation

Block Structure

WPS v2.5X | 1348


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
It determines w hich encoder w ill be used in counting of
COUNT_SRC BYTE
pulses
PRESET BOOL Attributes value from PV to CV
RESET# BYTE Chooses the CV reset control
If the choice of RESET # is by variable, it performs the reset
RESET_VAR BOOL
VAR_INPUT of CV w hen in TRUE value
SAVE# BYTE Chooses the saving control of the counter
If the choice of SAVE# is by variable, it performs the saving
SAVE_VAR BOOL
of CV in SV w hen in TRUE value
REF_CNT LREAL Value of the reference pulse for output enabling
PV LREAL Value of initial configuration
RESTART LREAL Reference value for automatic reset of CV
Q BOOL Output enabling
RESET_OCC BOOL Reset flag
VAR_OUTPUT SAVE_OCC BOOL Saving flag

CV LREAL Value of pulse counter


SV LREAL Last saved counter value
VAR READENC5_INST_0 READENC5 Instance of access to block structure

Operation

When this block identifies a leading edge in EN, it resets its outputs and counts the pulses from the
encoder specified in COUNT_SRC while enabled. This count value is stored in CV.

The specified control in RESET# resets the counter when enabled, while the specified control in
SAVE#, when activated, stores the value of CV in SV. Each of these controls sets its respective flag
(RESET_OCC or SAVE_OCC) for one scan cycle.

The block also allows you to configure an automatic reset when CV reaches the RESTART value.

The value of Q is activated by one scan cycle when CV reaches the value of REF_CNT.

Block Flowchart

WPS v2.5X | 1349


Equipments (Devices)

Example

WPS v2.5X | 1350


Equipments (Devices)

The above example reads the encoder 1 and stores its value in COUNTER, with count reference set in
REF and RESET and SAVE control done by the variables LOAD_ZERO and SAVE_COUNT,
respectively. When COUNTER is equals to REF, the output Q is set for one scan cycle.

11.10.7.11 Logic
11.10.7.11.1 Logic Bit
11.10.7.11.1.1 RESETBIT
Logical block used to perform reset of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, resets the bit indicated in Position in the Data variable
that is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the reset of the bit,
then getting a FALSE value.

WPS v2.5X | 1351


Equipments (Devices)

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

Example

The example above resets the bit of AUX zero position, whose initial value is 200 (1100 1000, in
binary). Since this bit already had FALSE value, nothing has changed.

The example above resets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

WPS v2.5X | 1352


Equipments (Devices)

The example above resets the bit in position nine of AUX. Since AUX is a variable BYTE type, it has
only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.10.7.11.1.2 SETBIT
Logical block used to perform the set of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, sets the bit indicated in Position in the Data variable that
is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the set of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 1353


Equipments (Devices)

Example

The example above sets the bit of AUX zero position, whose initial value is 153 (1001 1001, in binary).
Since this bit already had TRUE value, nothing has changed.

The example above sets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above sets the bit in position fifteen of AUX. Since AUX is a variable BYTE type, it has

WPS v2.5X | 1354


Equipments (Devices)

only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.10.7.11.1.3 TESTBIT
Logical block that revolutions the value of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
Data WORD UINT INT Variable w hose bit w ill be tested
DWORD UDINT DINT
VAR_INPUT
EN BOOL Block enabling
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT Q BOOL Value of the tested bit

Operation

This block when it has a TRUE value in EN, sends to the output Q the bit value indicated in Position
in the Data variable.

When EN has FALSE value, Q also receives FALSE.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 1355


Equipments (Devices)

Example

The example above sets the bit value of zero position of AUX, whose initial value is 74 (0100 1010 in
binary) to the output Q. Since this bit has value 0, the output is disabled.

The example above sets the value of the bit of position three of AUX to the output Q. Since this bit
has value 1, the output is enabled.

The example above sets the bit value of position ten of AUX to output Q. Since AUX is a variable of
BYTE type, it has only eight bits. Thus, the example above creates a runtime error in the block and
therefore the output is disabled.

WPS v2.5X | 1356


Equipments (Devices)

11.10.7.11.2 Logic Boolean


11.10.7.11.2.1 AND
Logical block that performs an boolean "and" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “and” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1357


Equipments (Devices)

Example

The example above performs an "and" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.10.7.11.2.2 NOT
Block that performs a logical operation of boolean "not" in a variable, storing the result in another.

Ladder Representation

Block Structure

WPS v2.5X | 1358


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling

VAR_INPUT BYTE USINT SINT


Value WORD UINT INT Reference variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the denied Boolean value of
the Value input variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The example above performs a boolean "not" operation in AUX, storing the result in AUX2.

WPS v2.5X | 1359


Equipments (Devices)

11.10.7.11.2.3 OR
Logical block that performs an Boolean "or" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “or” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1360


Equipments (Devices)

Example

The example above performs an "or" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.10.7.11.2.4 XNOR
Logical block that performs an Boolean "not exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

WPS v2.5X | 1361


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “denied exclusive or”
Boolean operation of input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1362


Equipments (Devices)

The example above performs a "denied exclusive or" Boolean operation between AUX and AUX2,
storing the result in AUX3.

11.10.7.11.2.5 XOR
Logical block that performs an Boolean "exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “xor” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1363


Equipments (Devices)

Example

The example above performs a "xor" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.10.7.11.3 Logic Rotate


11.10.7.11.3.1 ROL
Block that performs a logical left rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1364


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical left shifts, according to the Shift value. The most significant bits
that are being discarded are returned to the least significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1365


Equipments (Devices)

Example

The above example performs a logical left shift by one position in the VALUE variable whose initial
value is -100 (1001 1100 in binary). The discarded bits on the left are reinserted on the right. The final
result (0011 1001 in binary) is stored in RESULT.

The above example performs a logical left rotation by five positions in the VALUE variable whose initial
value is 21 (0001 0101 in binary). The discarded bits on the left are reinserted on the right. The final
result (1010 0010 in binary) is stored in RESULT.

11.10.7.11.3.2 ROR
Block that performs a logical right rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1366


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical right shifts, according to the Shift value. The least significant bits
that are being discarded are returned to the most significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1367


Equipments (Devices)

Example

The above example performs a logic right shift by one position in the VALUE variable whose initial
value is -128 (1000 0000 in binary). The discarded bits on the right are reinserted on the left. The final
result (0100 0000 in binary) is stored in RESULT. Notice that the sign is not preserved in this
operation.

The above example performs a logical right rotation by one position in the VALUE variable whose
initial value is -127 (1000 0001 in binary). The discarded bits on the right are reinserted on the left. The
final result (1100 0000 in binary) is stored in RESULT.

11.10.7.11.4 Logic Shift


11.10.7.11.4.1 ASHL
Block that performs a binary left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1368


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic left shifts, according to the Shift value.

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1369


Equipments (Devices)

Description of exemple.

Description of exemple.

11.10.7.11.4.2 ASHR
Block that performs arithmetic left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic right shifts, according to the Shift value.

WPS v2.5X | 1370


Equipments (Devices)

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example performs an arithmetic right shift by three positions in the VALUE variable whose
initial value is 52 (0011 0100 in binary). The bits on the right are being discarded, and on the left new
zeros are inserted. The final result (0000 0110 in binary) is stored in RESULT.

WPS v2.5X | 1371


Equipments (Devices)

The above example performs an arithmetic right shift by two positions in the VALUE variable whose
initial value is -79 (1011 0001 in binary). The bits on the right will be discarded and new ones on the
left are inserted, since the arithmetic right shifts preserve the sign of the variable. The final result
(1111 0110 in binary) is stored in RESULT.

The above example performs an arithmetic right shift by thirteen positions in the VALUE variable
whose initial value is -128 (1000 0000 in binary). The bits on the right are being discarded, and on the
left new ones are inserted. The final result (1111 1111 in binary) is stored in RESULT.

11.10.7.11.4.3 SHL
Block that performs a binary logical left shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 1372


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts left, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1373


Equipments (Devices)

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is 56 (0011 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (0011 1000 0000 in binary) is stored in RESULT.

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is -56 (1100 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (1100 1000 0000 in binary) is stored in RESULT. Since RESULT is SINT
type, it only accepts the first eight bits (1000 0000).

11.10.7.11.4.4 SHR
Block that performs a binary logical right shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 1374


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts right, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1375


Equipments (Devices)

The above example performs a logical right shift by two positions in the VALUE variable whose initial
value is 124 (0111 1100 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 1111 in binary) is stored in RESULT.

The above example performs a logical right shift by three positions in the VALUE variable whose initial
value is -98 (1001 1110 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 0011 in binary) is stored in RESULT.

11.10.7.12 Math
11.10.7.12.1 Math Basic
11.10.7.12.1.1 ABS
Block that calculates the Value module, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the absolute value of the

WPS v2.5X | 1376


Equipments (Devices)

Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the absolute value of the VALUE variable whose initial value is -45,
storing the final result, 45, in RESULT.

The above example calculates the absolute value of the VALUE variable whose initial value is -45. The
final result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by
SINT type. Therefore, RESULT remains unchanged and the output is disabled.

WPS v2.5X | 1377


Equipments (Devices)

11.10.7.12.1.2 ADD
Block that calculates the sum of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First addend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second addend of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sum of Value1 and Value2
variables. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1378


Equipments (Devices)

Example

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT.

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1379


Equipments (Devices)

The above example calculates the sum of VALUE1 and VALUE2 variables. The final result -170
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.10.7.12.1.3 DIV
Block that calculates the division of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the division of Value1 and
Value2 variables. The value stored will be the exact division if Result is REAL, or, in other cases, only
the quotient. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1380


Equipments (Devices)

Example

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is of REAL type, the exact value of the division is stored in it.

WPS v2.5X | 1381


Equipments (Devices)

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it. Notice that the block
accepts arguments of both signs.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains unchanged
and the output is disabled.

11.10.7.12.1.4 MOD
Block that calculates the remainder of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT operation

Operation

WPS v2.5X | 1382


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the remainder of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

WPS v2.5X | 1383


Equipments (Devices)

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains
unchanged and the output is disabled.

11.10.7.12.1.5 MUL
Block that calculates the multiplication of the values of Value1 and Value2, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First factor of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second factor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

WPS v2.5X | 1384


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the multiplication of Value1
and Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT.

WPS v2.5X | 1385


Equipments (Devices)

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the product of VALUE1 and VALUE2 variables. The final result 224
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.10.7.12.1.6 NEG
Block that calculates the opposite (i.e., the product with -1) of a value passed by Value, storing the
result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the opposite of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1386


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the opposite of the VALUE variable whose initial value is 21, storing
the final result, -21, in RESULT.

The above example calculates the opposite of the VALUE variable whose initial value is -56, storing
the final result, 56, in RESULT.

WPS v2.5X | 1387


Equipments (Devices)

The above example calculates the opposite of the VALUE variable whose initial value is -128. The final
result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by SINT
type. Therefore, RESULT remains unchanged and the output is disabled.

11.10.7.12.1.7 SUB
Block that calculates the subtraction between the Value1 and Value2 values, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Minuend of operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Subtrahend of operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the subtraction of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1388


Equipments (Devices)

Example

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1389


Equipments (Devices)

The above example calculates the subtraction of VALUE1 and VALUE2 variables. The final result 141
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.10.7.12.2 Math Extended


11.10.7.12.2.1 ALOG10
Block that calculates the antilogarithm (exponent with base 10) of the Value value, storing the result
in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the antilogarithm of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1390


Equipments (Devices)

Example

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the minimum input value for which the block revolutions a nonzero
result. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in

WPS v2.5X | 1391


Equipments (Devices)

RESULT. Below the minimum values cause the block to return a null value. The block ends with
success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the maximum input value for which the block revolutions a valid result.
The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. Values higher than the maximum cause the block to generate an error, the RESULT output
remains unchanged and Done output is disabled.

11.10.7.12.2.2 EXP
Block that calculates the exponential of the Euler number "and" raised to the value of Value, storing
the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the exponent of the Euler
number "and" raised to the Value variable. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1392


Equipments (Devices)

Block Flowchart

Example

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the minimum input value for which the block revolutions a nonzero result. The
block ends with success and Done output is activated.

WPS v2.5X | 1393


Equipments (Devices)

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values below the minimum cause the block to return to a null value. The block ends with success
and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the maximum input value for which the block revolutions a valid result. The
block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values higher than the maximum cause the block to generate an error, the RESULT output remains
unchanged and Done output is disabled.

11.10.7.12.2.3 LN
Block that calculates the natural logarithm of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the natural logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1394


Equipments (Devices)

Block Flowchart

Example

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has value zero, and Done output is
disabled.

WPS v2.5X | 1395


Equipments (Devices)

11.10.7.12.2.4 LOG10
Block that calculates the common logarithm (base 10) of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the common logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1396


Equipments (Devices)

Example

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.10.7.12.2.5 POW
Block that calculates the value of Value raised to the exponent Power, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value REAL Base of the operation
Power REAL Exponent of the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to
the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1397


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

WPS v2.5X | 1398


Equipments (Devices)

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. Since the result is higher than the maximum supported by REAL type, the block
generates an error and Done output is disabled.

11.10.7.12.2.6 ROUND
Block that rounds the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the rounded value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1399


Equipments (Devices)

Example

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals less than 0.5 are discarded. The block ends with success and Done output is activated.

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals greater than or equal to 0.5 promote unity value immediately above. The block ends with
success and Done output is activated.

11.10.7.12.2.7 SQRT
Block that calculates the square root value of Value, storing the result in Result.

Ladder Representation

WPS v2.5X | 1400


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the square root value of
Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1401


Equipments (Devices)

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.10.7.12.2.8 TRUNC
Block that truncates the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the truncated value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

WPS v2.5X | 1402


Equipments (Devices)

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

Example

The above example truncates the value of the VALUE variable, storing the final result in RESULT.
Decimals are discarded. The block ends with success and Done output is activated.

11.10.7.12.3 Math Trigonometry


11.10.7.12.3.1 ACOS
Block that calculates the arccosine of Value, storing the result in Angle.

Ladder Representation

Block Structure

WPS v2.5X | 1403


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of cosine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose cosine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arccosine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1404


Equipments (Devices)

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block generates a runtime error, since VALUE has value inferior to 1, and
Done output is disabled.

11.10.7.12.3.2 ASIN
Block that calculates the arcsine of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of sine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose sine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arcsine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1405


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block generates a runtime error, since VALUE has value superior to 1, and
Done output is disabled.

WPS v2.5X | 1406


Equipments (Devices)

11.10.7.12.3.3 ATAN
Block that calculates the arctangent of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of tangent
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1407


Equipments (Devices)

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for positive values, is always in the first quadrant. The block ends with
success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for negative values, is always in the fourth quadrant. The block ends
with success and Done output is activated.

11.10.7.12.3.4 ATAN2
Block that calculates the arctangent of Y/X, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT X REAL Parameter X of the function
Y REAL Parameter Y of the function
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to (Y/X) (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Y/X. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1408


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and Y, is always in the first quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final

WPS v2.5X | 1409


Equipments (Devices)

result in RESULT. The arc, for negative values of X and positive values of Y, is always in the second
quadrant. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for negative values of X and Y, is always in the third quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and negative values of Y, is always in the fourth
quadrant. The block ends with success and Done output is activated.

11.10.7.12.3.5 COS
Block that calculates the cosine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the cosine of Angle. If no

WPS v2.5X | 1410


Equipments (Devices)

errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1411


Equipments (Devices)

11.10.7.12.3.6 SIN
Block that calculates the sine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sine of Angle. If no errors,
the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE
status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1412


Equipments (Devices)

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts negative input values.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts values greater than one full turn.

11.10.7.12.3.7 TAN
Block that calculates the tangent of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

WPS v2.5X | 1413


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the tangent of Angle. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1414


Equipments (Devices)

11.10.7.12.4 Math Util


11.10.7.12.4.1 MAX
Block that compares the values of Value1 and Value2 and stores the highest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Highest of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the highest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1415


Equipments (Devices)

Example

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1416


Equipments (Devices)

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is higher than the maximum supported by SINT type, the
block generates an error and Done output is disabled.

11.10.7.12.4.2 MIN
Block that compares the values of Value1 and Value2 and stores the lowest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Low est of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the lowest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1417


Equipments (Devices)

Example

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1418


Equipments (Devices)

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is lower than the minimum supported by SINT type, the
block generates an error and Done output is disabled.

11.10.7.12.4.3 SAT
Block that performs a routine for saturation of the value found in Value in accordance with the limits
for Minimum and Maximum, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Reference value
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
Minimum Inferior saturation value
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Maximum Superior saturation value
INT DWORD UDINT DINT REAL
Indicator that there w as saturation in the
Q BOOL
process
VAR_OUTPUT
BYTE USINT SINT WORD UINT
Result Result of operation
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and
Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of
Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q
receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If
there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with
its value unchanged.

WPS v2.5X | 1419


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1420


Equipments (Devices)

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or
higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no
saturation.

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

WPS v2.5X | 1421


Equipments (Devices)

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM.
The block ends successfully and the Q output is activated, since there was saturation.

11.10.7.13 Module
11.10.7.13.1 CALL
Block that loads a file and do a ladder call.

Ladder Representation

Block Structure

Variable Type Name Data type Description


EN BOOL Block enabling
VAR_INPUT Ladder file name (POU) enclosed in gingle
FILENAME# STRING
quotation marks
VAR_OUTPUT ENO BOOL End of operation
VAR CALL_INST_0 CALL Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine loading the file and updates the values of the outputs after
completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Compatibility

WPS v2.5X | 1422


Equipments (Devices)

Device Version
PLC300 4.03 or higher

Block Flowchart

Example

In the example below, the POU 'Program2' will be executed through the 'Main Ladder'.

11.10.7.13.2 USERFB
Block that performs a subroutine programmed by the user.

Ladder Representation

Block Structure

WPS v2.5X | 1423


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Conforme programação
INPUT Block inputs
do usuário
ENO BOOL End of operation
VAR_OUTPUT Conforme programação
OUTPUT Block outputs
do usuário
Conforme programação
VAR_IN_OUT IN_OUT Block inputs/outputs
do usuário
VAR MYUSERFB_INST_0 MYUSERFB Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine programmed by the user and updates the values of the outputs
after completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Refer to section Working with USERFBs for further information.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1424


Equipments (Devices)

11.10.7.13.3 Working with USERFBs


11.10.7.13.3.1 Creating USERFBs
USERFBs are cuser-customizable functional blocks. Its utilization is encouraged to make the Ladder program
less bulky and polluted, abstracting information with which one does not want to work often and systematizing
complex tasks.

In these blocks, the inputs and outputs are defined by the user, who handles them in the Ladder diagram
associated with the block. Here's how to create your USERFB.

1. In the Projects window, locate the resource in which you want to create the USERFB, right-click in User
Function Block and click in New Folder.

WPS v2.5X | 1425


Equipments (Devices)

2. In the wizard, insert a name for the library to which the USERFB will belong and click Next.

3. Insert a valid name for the USERFB and click Next.

4. If you want to insert a password to protect the block code, check the Encrypt binary checkbox and type a
password. Otherwise, uncheck it. Click Finish.

WPS v2.5X | 1426


Equipments (Devices)

That's it! The USERFB has been succesfully created. You should see the following in the Projects window.

11.10.7.13.3.2 Adding input/output


Now we'll cover how to create inputs and outputs for the USERFB.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

WPS v2.5X | 1427


Equipments (Devices)

2. In the Window menu, click Variables.

Analysing the following figure, we see that the USERFB Variables window is different from other Ladder files.
It has only volatile and retain variables in LOCAL scope, which are the internal variables of the block, used in
its subroutine. Besides these, it has three more groups: VAR_IN, VAR_OUT and VAR_IN_OUT.

VAR_IN: internal variables that repersent the input arguments for that block.
VAR_OUT: internal variables that repersent the output arguments for that block.
VAR_IN_OUT: internal variables that repersent the input/output arguments for that block.

3. In order to create an input, click in the VAR_IN tab and click in the symbol. In the window, set a name
and a datatype to this variable and click OK.

WPS v2.5X | 1428


Equipments (Devices)

4. In order to create an output, click in the VAR_OUT tab and click in the symbol. In the window, set a
name and a datatype to this variable and click OK.

5. In order to create an input/output, click in the VAR_IN_OUT tab and click in the symbol. In the window,
set a name and a datatype to this variable and click OK.

WPS v2.5X | 1429


Equipments (Devices)

11.10.7.13.3.3 Editing the Ladder


Now we'll cover how to edit the USERFB subroutine.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

The Ladder Editor will open, like any other Ladder diagram. Any block may be inserted in it, including other
USERFBs. Remember that only local variables may be used in it.

WPS v2.5X | 1430


Equipments (Devices)

11.10.7.13.3.4 Using USERFBs


Lastly we'll cover how to make use of the USERFB, inserting it in other Ladder diagrams.

1. In the Projects window, double click the USERFB file in order to open its Ladder editor.

2. In the Pallete window, select the USERFB block from the Module category and drag it to the position
where you want to use it in the Ladder diagram.

3. Double click the question marks (???) above the block in order to insert a instance variable for the
USERFB. Type in the variable name and click Edit. In the confirmation dialog, click Yes to create the new
variable.

WPS v2.5X | 1431


Equipments (Devices)

4. In the Add dialog, type in a name for the variable and select its parameters. In the Datatype field, choose
the name of the desired USERFB (if there is only one, the field will not be enabled).
For example, if your USERFB name is MYUSERFB, the correct datatype to be selected is
$USERFB_MYUSERFB.

That's it! Your very own USERFB is inserted in the diagram and ready to work!

11.10.7.14 Motion Control


11.10.7.14.1 Motion Control Cam
11.10.7.14.1.1 MC_CamIn
Block responsible for the execution of a defined positioning a cam table of a curve CAM.

Ladder Representation

WPS v2.5X | 1432


Equipments (Devices)

Execution Features

Program Memory Size 92 Bytes


Data Memory Size 52 Bytes

Block Structure

WPS v2.5X | 1433


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
VAR_IN_OUT (3 - Virtual Axis)
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
Execute BOOL Block enabling
MasterScaling REAL Gain in the position values of the master axis.
SlaveScaling REAL Gain in the position values of the slave axis.
Position of the master axis w here the slave w ill start the
MasterSyncPosition LREAL
CAM curve.
CamTableID WORD Selected CAM table
VAR_INPUT Execution start mode
(0 - Starts block immediately, if there is another block in
the execution it w ill be aborted)
(1 - When another block is in execution, the block in
BufferMode BYTE execution w ill continue its motion until the end and this
new block w ill w ait to be executed.)
(6 – If another block is in execution, this block w ill go
into error 52 and w ill not be executed. The HMI w ill
show the alarm A00052.)
InSync BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
EndOfProfile BOOL End of the CAM profile flag
VAR MC_CAMIN_INST_0 MC_CAMIN Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it sends a command for the drive to execute a
defined positioning by CamTableID.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1434


Equipments (Devices)

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.
85 CamTableID not valid.

Example

WPS v2.5X | 1435


Equipments (Devices)

WPS v2.5X | 1436


Equipments (Devices)

In the up transition of CAMCALC_EXECUTE, the MW_CamCalc block is executed and the cam table
of NUM_OF_TABLE will be calculated according to the block arguments.

When the calculation of cam table 11 is finished, the InSync output is set while the Execute input
remains set.

With the CAMCALC_DONE set, the MC_CamIn block can be executed.

In the up transition of CAMIN1_EXECUTE, the first MC_CamIn block is executed.

If it is necessary to adjust the cam table of the CAM curve, just make the adjustment in MASTER_PT
[0], MASTER_PT[1], SLAVE_PT[0] and SLAVE_PT[1], change the content of NUM_OF_TABLE to 12
and execute the MW_CamCalc block again.

In the transition of CAMIN2_EXECUTE, the second MC_CamIn block will be executed (without losing
the position of the master axis) as soon as the first MC_CamIn block finishes executing the curve in
execution.

11.10.7.14.1.2 MC_CamOut
Block responsible for the completion of a synchronization established by a block MC_CamIn.

Ladder Representation

WPS v2.5X | 1437


Equipments (Devices)

Execution Features

Program Memory Size 28 Bytes


Data Memory Size 4 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation slave
VAR_IN_OUT Slave BYTE
(0 - Real axis)
Execute BOOL Block enabling
CamTableID WORD Selected CAM table
Execution start mode
(0 - Starts block immediately, if there is another block in
the execution it w ill be aborted)
VAR_INPUT
(1 - When another block is in execution, the block in
BufferMode BYTE execution w ill continue its motion until the end and this
new block w ill w ait to be executed.)
(6 – If another block is in execution, this block w ill go into
error 52 and w ill not be executed. The HMI w ill show the
alarm A00052.)
Done BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_CAMOUT_INST_0 MC_CAMOUT Instance of access to block structure

Operation

When this block detects a leading edge in Execute it concludes the existing synchronism for the last
execution of a block MC_CamIn. The axis will keep the speed of the moment in which the block is
executed.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
67 Drive in the "Disabled" or “Errorstop” status.
71 P202 different from 4.
73 Drive is not in the “Synchronized Motion” status
78 MC block not executed – Internal fault.

Example

WPS v2.5X | 1438


Equipments (Devices)

In the up transition of CAMOUT_EXECUTE, the MC_CamOut block is executed. With this, the Busy
and Active signals of this block are set and synchronism started by other CAM blocks ends. When
the process finishes, the Done output of the block is set and remains TRUE while the Execute input
is set.

11.10.7.14.1.3 MC_CamTableSelect
Block that selects a cam table of a CAM curve previously programmed through the tool CAM Profiles.

Ladder Representation

Execution Features

Program Memory Size 44 Bytes


Data Memory Size 16 Bytes

Block Structure

WPS v2.5X | 1439


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
(3 - Virtual Axis)
VAR_IN_OUT
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
CamTable WORD CAM table code
Execute BOOL Block enabling

VAR_INPUT Control of the request execution


Periodic BOOL (0 - Single execution)
(1 - Periodic execution)
Done BOOL Output enabling
Flag indicating the block has not yet been
Busy BOOL
ended
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
CamTableID WORD Selected CAM table
MC_CAMTABLESELECT
VAR MC_CAMTABLESELECT Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge in Execute, it searches the specified table in CamTable so
that it can be used by the MC_CamIn block.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
83 Invalid file of the CAM curve cam table.
84 Invalid Cam Table. Cam Table must be from 1 to 10.

Example

WPS v2.5X | 1440


Equipments (Devices)

In the up transition of CAMSEL_EXECUTE the MC_CamTableSelect block is executed and, thus, the
cam table selected in CAM_INDEX can be used by the MC_CamIn block.
To execute the block, the Done output and CAMSEL_DONE are set and remain at TRUE level while
the Execute input is set.
In this example, CAMSEL_DONE ensures that the MC_CamIn block will not be activated before the
MC_CamTableSelect block is executed successfully.

11.10.7.14.1.4 MW_CamCalc
This block calculates a cam table of the CAM curve.

Ladder Representation

WPS v2.5X | 1441


Equipments (Devices)

Execution Features

Program Memory Size 66 Bytes


Data Memory Size 24 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
(3 - Virtual Axis)
VAR_IN_OUT
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
CamTable WORD CAM table code
Execute BOOL Block enabling
NumberOfPoints WORD Number of points of the table
MasterPoints LREAL Points of the master

VAR_INPUT SlavePoints LREAL Points of the slave


CurveType WORD Type of curve
Control of the request execution
Periodic BOOL (0 - Single execution)
(1 - Periodic execution)
InSync BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
VAR_OUTPUT Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
CamTableID WORD Selected CAM table
VAR MW_CAMCALC_INST_0 MW_CAMCALC Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it builds the specified table in CamTable with the

WPS v2.5X | 1442


Equipments (Devices)

programmed data so that it can be used by the MC_CamIn block.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
83 Invalid file of the CAM curve cam table.
84 Invalid Cam Table. Cam Table must be from 11 to 20.
Number of points above the programmed in the CAM
86
PROFILES configurator.
Invalid position of the master axis. The position of the
87 master axis must be greater than the position of the
previous point.
MW_CamCalc block in execution. Is only allow ed the
88
execution of an MW_CamCalc block at a time.
89 Cam table in use by the MC_CamIn block.
Double marker w ith position of the nonexistent
90
master axis.
Double marker w ith position of the nonexistent slave
91
axis.
92 Word marker w ith nonexistent curve type.

Example

WPS v2.5X | 1443


Equipments (Devices)

WPS v2.5X | 1444


Equipments (Devices)

WPS v2.5X | 1445


Equipments (Devices)

In the transition from 0 to 1 of bit marker CAMCALC_EXECUTE, the MW_CamCalc block is executed
and the cam table of TABLE will be calculated according to the block arguments.

In this example, the number of points of the curve will be contents of the NUM_POINTS, the position
of the master axis will be in accordance with the contents of MASTER_POINTS [0] and
MASTER_POINTS [1], the position of the slave axis will be in accordance with the contents of
SLAVE_POINTS [0] and SLAVE_POINTS [1] and the type of curve will be in accordance with the
contents of CURVE_TYPE [0] and CURVE_TYPE[1].

Entering the same values in the tool, we can observe the curve below:

When the calculation of the cam table 11 is finished, the InSync output is set while the Execute input
remains set.
With the CAMCALC_DONE set, the MC_CamIn block can be executed.

11.10.7.14.2 Motion Control Command


11.10.7.14.2.1 MC_Power
Block responsible for enabling/disabling the drive axis.

Ladder Representation

WPS v2.5X | 1446


Equipments (Devices)

Execution Features

Program Memory Size 40 Bytes


Data Memory Size 4 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
VAR_INPUT Enable BOOL Block enabling
Status BOOL Output enabling
Valid BOOL Flag indicating validity of the output signals
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_POWER_INST_0 MC_POWER Instance of access to block structure

Operation

This block performs an Enable/Disable command of the Axis axis according to the Enable input,
disabling it Enable is FALSE and enabling if Enable is TRUE.

NOTE!
When the MC_Power block is used to enable/disable the real axis, no digital inputs must be
programmed for the Enable function (option 1), or an Alarm A0120 may occur.

When enabling the real axis for the first time, the drive may operate in grid position, depending on the
value of parameter P0773. The position proportional gain (P0159) must be set to obtain a better drive
performance.

When the real axis is disabled, the axis status will be Disabled. When enabling the real axis, the axis
status will change to Standstill.

When EN has FALSE value, Status remains FALSE. The Status output is activated when the block
finishes the execution successfully, remaining at TRUE level until Enable receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1447


Equipments (Devices)

Code Description
66 Drive in the "ErrorStop" status.
71 P202 different from 4.

Example

WPS v2.5X | 1448


Equipments (Devices)

On the leading edge of POWER_COMMAND, the real axis is enabled and its status, the system
marker REAL_AXIS_STATUS (%SW6004), is changed to Standstill (%SW6004 = 2). The Status
output is set.

After the transition from 0 to 1 of MOTION_COMMAND, the MC_MotionAbsolut block is executed and
the positioning for the position 10 revolutions starts. The axis status is changed to “Discrete
Motion” (%SW3406 = 6).

While positioning is executed, POWER_COMMAND is reset. Since the BufferMode of the MC_Power
is set to Buffered, the axis will be disabled only in the positioning completion.

When the positioning is finished, the Done output of the MC_MotionAbsolut block is set for 1 scan
cycle and the axis is disabled (MC_Power.Enable = 0). The axis status changes to “Disable” (%
SW6004 = 0).

11.10.7.14.2.2 MC_Reset
Block responsible for cleaning up the failure status of drive.

Ladder Representation

Execution Features

WPS v2.5X | 1449


Equipments (Devices)

Program Memory Size 28 Bytes


Data Memory Size 4 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
VAR_INPUT Execute BOOL Block enabling
Done BOOL Output enabling
VAR_OUTPUT Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_RESET_INST_0 MC_RESET Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it performs cleanliness in the drive status,
changing it from Errorstop to Disabled.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
71 P202 different from 4.

Example

WPS v2.5X | 1450


Equipments (Devices)

If a fault occurs on the drive, the axis status will change to “Errorstop” (%SW6004 = 1).
When an up transition of RESET_COMMAND occurs, the MC_Reset block will be executed and axis
status will change to Disabled (SW6004 = 0%). The Done output will remain set while the Execute
input is TRUE level.

11.10.7.14.2.3 MC_Stop
Block responsible for executing a controlled stop.

Ladder Representation

Execution Features

Program Memory Size 52 Bytes


Data Memory Size 12 Bytes

Block Structure

WPS v2.5X | 1451


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
VAR_INPUT Deceleration REAL Deceleration of the stop
Jerk REAL Jerk
Done BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_STOP_INST_0 MC_STOP Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it sends a command for a controlled stop of the
axis. While Execute has TRUE level, no other MC block is executed.

When the MC_Stop block is executed, the drive will star operating in grid position and remain this
way even after the conclusion of the block. The position proportional gain must be set (P0159) so as
to obtain a better drive performance.

In the execution of the block, the axis status will change to Stopping. When the stop is ended and
the block is no longer active, the axis status will change to Standstill.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
71 P202 different from 4.
78 MC block not executed – Internal fault.
93 Jerk programmed below the minimum allow ed.
94 Jerk programmed above the maximum allow ed.

Example

WPS v2.5X | 1452


Equipments (Devices)

WPS v2.5X | 1453


Equipments (Devices)

In the up transition of MOTION_COMMAND, the MC_MotionVelocity block is executed. With this, the
Busy and Active signals of this block are set and the motion to reach the speed of 200 RPM starts.
The axis status (%SW6004) changes from Standstill (2) to Continuous Motion (5).
At the moment the speed reaches 200 rpm, MOTION_RESULT is set.

With the up transition of STOP_COMMAND, the MC_Stop block is instantly executed; thus, the
Busy and Active signals of this block are set and the stop starts. At the same time, the Busy, Active
and InVelocity signals of the MC_MotionVelocity block are reset and the CommandAborted signal is
set for 1 scan. The axis status (%SW6004) changes from Continuous Motion (5) to Stopping (3).

WPS v2.5X | 1454


Equipments (Devices)

At the end of the stop, the Done output MC_Stop block is set and remains until Execute input is
reset. The axis status (%SW6004) remains equal to Stopping (3) and no other MC block will be
executed.

With the transition of rising of MOTION_COMMAND, the MC_MotionVelocity block is started, but as
the MC_Stop block is active, an error occurs and the Error signal will be set by entering the value 69
in ErrorID.

When the Execute input of the MC_Stop block is reset, the Busy, Active and Done signal are reset.
The axis status (%SW6004) changes from Stopping (3) to Standstill (2) and other MCs blocks can be
executed.

11.10.7.14.2.4 MW_IqControl
Block conducting the Iq control programmed.

Ladder Representation

Execution Features

Program Memory Size 78 Bytes


Data Memory Size 32 Bytes

Block Structure

WPS v2.5X | 1455


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling

Automatic update mode


ContinuousUpdate BYTE (0 – Leading edge)
(1 – Real time)
Iq REAL lq Value
IqRamp REAL Iq ramp value
VAR_INPUT Execution start mode
(0 - Starts block immediately, if there is another
block in the execution it w ill be aborted)
(1 - When another block is in execution, the block in
BufferMode BYTE execution w ill continue its motion until the end and
this new block w ill w ait to be executed.)
(6 – If another block is in execution, this block w ill
go into error 52 and w ill not be executed. The HMI
w ill show the alarm A00052.)
InIq BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MW_IQCONTROL_INST_0 MW_IQCONTROL Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it sends an execution command of the lq control
according to the programmed parameters.

In the execution of the block the axis status will change to Continuous Motion. It order to finish the
block, it is necessary to execute another block or the changing of the drive to the Disable or Errorstop
status.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1456


Equipments (Devices)

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.
80 Iq programmed above the maximum allow ed.
81 IqRamp programmed below the minimum allow ed.
82 IqRamp programmed above the maximum allow ed.

Example

In the up transition of IQCONTROL_EXECUTE, the MW_IqControl block is executed. With this, the
Busy and Active signals of this block are set and starts the execution of Iq control according to
parameters set. When the process finishes, the Done output of the block is set and remains TRUE
while the Execute input is set.

11.10.7.14.3 Motion Control Gear


11.10.7.14.3.1 MC_GearIn
Block responsible for execution of the synchronism in speed between the programmed axes.

Ladder Representation

WPS v2.5X | 1457


Equipments (Devices)

Execution Features

Program Memory Size 74 Bytes


Data Memory Size 28 Bytes

Block Structure

WPS v2.5X | 1458


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
VAR_IN_OUT (3 - Virtual Axis)
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
Execute BOOL Block enabling
RatioNumerator INT Numerator of the synchronism ratio
RatioDenominator WORD Denominator of the synchronism ratio
Acceleration REAL Acceleration
Deceleration REAL Deceleration

VAR_INPUT Execution start mode


(0 - Starts block immediately, if there is another block in
the execution it w ill be aborted)
(1 - When another block is in execution, the block in
BufferMode BYTE execution w ill continue its motion until the end and this
new block w ill w ait to be executed.)
(6 – If another block is in execution, this block w ill go into
error 52 and w ill not be executed. The HMI w ill show the
alarm A00052.)
InGear BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_GEARIN_INST_0 MC_GEARIN Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it sends a command for synchronism in speed
between the programmed axes.

For the slave axis to reach the speed of the master axis, a motion will be performed with an
acceleration/deceleration configured in the “Acceleration” and “Deceleration” arguments. The motion
direction will depend on the signal of the RatioNumerator. If RatioNumerator is greater than zero, the
motion will be in the same direction as the master axis, and if the RatioNumerator is smaller than
zero, the motion will be in the opposite the direction of the master axis.

The InGear output is activated when the sync is achieved. It order to finish the block, it is necessary
to execute another block or the changing of the drive to the Disabled or Errorstop status.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1459


Equipments (Devices)

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
Acceleration programmed below the minimum
62
allow ed.
Acceleration programmed above the maximum
63
allow ed.
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
72 Invalid synchronism ratio.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.

Example

WPS v2.5X | 1460


Equipments (Devices)

In the up transition of GEARIN1_EXECUTE, the first MC_GearIn block is executed. With this the
Busy Active and this block signals are set and the search of synchronization with the configured

WPS v2.5X | 1461


Equipments (Devices)

acceleration begins. As the ratio configured is 1:2 and the master axis is at 200 RPM, the slave axis
must reach 100 RPM to establish the synchronism.
At the moment in which the speed reaches 100 RPM, the InGear output is set.

With the transition of rising GEARIN2_EXECUTE, the second MC_GearIn block is instantly executed.
With this the Busy Active signals of this block are set and the search of synchronization with the
configured acceleration begins. As the ratio configured is 1:4 and the master axis is at 200 RPM, the
slave axis must reach 50 RPM to establish the synchronism. At the same time, the Busy, Active
and InGear signals of the first block are reset and the CommandAborted signal is set for 1 scan.

When the speed of 50 RPM is reached, the InGear output of the second block is set and remains
until the execution of other block.

11.10.7.14.3.2 MC_GearInPos
Block responsible for execution of the synchronism in position between the programmed axes.

Ladder Representation

Execution Features

Program Memory Size 104 Bytes


Data Memory Size 56 Bytes

Block Structure

WPS v2.5X | 1462


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
VAR_IN_OUT (3 - Virtual Axis)
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
Execute BOOL Block enabling
RatioNumerator INT Numerator of the synchronism ratio
RatioDenominator WORD Denominator of the synchronism ratio
Acceleration REAL Acceleration
Deceleration REAL Deceleration

VAR_INPUT Execution start mode


(0 - Starts block immediately, if there is another
block in the execution it w ill be aborted)
(1 - When another block is in execution, the block in
BufferMode BYTE execution w ill continue its motion until the end and
this new block w ill w ait to be executed.)
(6 – If another block is in execution, this block w ill go
into error 52 and w ill not be executed. The HMI w ill
show the alarm A00052.)
InSync BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_GEARINPOS_INST_0 MC_GEARINPOS Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it sends a command for synchronism in position
between the programmed axes.

For the slave axis to reach the speed of the master axis, a motion will be performed with an
acceleration/deceleration configured in the “Acceleration” and “Deceleration” arguments. The motion
direction will depend on the signal of the RatioNumerator. If RatioNumerator is greater than zero, the
motion will be in the same direction as the master axis, and if the RatioNumerator is smaller than
zero, the motion will be in the opposite the direction of the master axis.

When the MC_GearInPos block is executed, the drive will start operating in grid position and remain
this way even after the conclusion of the block. The position proportional gain must be set (P0159) so
as to obtain a better drive performance.

In the execution of the block, the axis status will change to Synchronized Motion.

The InSync output is activated when the sync is achieved. It order to finish the block, it is necessary

WPS v2.5X | 1463


Equipments (Devices)

to execute another block or the changing of the drive to the Disabled or Errorstop status.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
Acceleration programmed below the minimum
62
allow ed.
Acceleration programmed above the maximum
63
allow ed.
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
72 Invalid synchronism ratio.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.

Example

In the up transition of GEARINPOS_EXECUTE, the MC_GearInPos block is executed. With this the
Busy Active and this block signals are set and the search of synchronization with the configured
acceleration begins. As the ratio configured is 79:121 and the master axis is at 200 RPM, the slave
axis must reach 131 RPM to establish the synchronism.

WPS v2.5X | 1464


Equipments (Devices)

At the moment in which the speed reaches 131 RPM, the InSync output is set.

11.10.7.14.3.3 MC_GearOut
Block responsible for finalizing of the synchronism in position between the programmed axes.

Ladder Representation

Execution Features

Program Memory Size 28 Bytes


Data Memory Size 4 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation slave
VAR_IN_OUT Slave BYTE
(0 - Real axis)
VAR_INPUT Execute BOOL Block enabling
Done BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
VAR_OUTPUT
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_GEAROUT_INST_0 MC_GEAROUT Instance of access to block structure

Operation

When this block detects a leading edge on Execute it concludes the synchronism of MC_GearIn
MC_GearInPos or blocks the programmed axis. The axis will keep the speed of the moment in which
the block is executed.

When the MC_GearOut block is executed, the drive does not operate in grid position. In the execution
of the block the axis status will change to ContinuousMotion.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1465


Equipments (Devices)

Code Description
67 Drive in the "Disabled" or “Errorstop” status.
71 P202 different from 4.
73 Drive is not in the “Synchronized Motion” status.
78 MC block not executed – Internal fault.

Example

In the up transition of GEAROUT_EXECUTE, the MC_GearOut block is executed. With this, the Busy
and Active signals of this block are set and synchronism concluded by other blocks of synchronism
between master and slave. When the process finishes, the Done output of the block is set and
remains TRUE while the Execute input is set.

11.10.7.14.3.4 MC_PhasingRelative
Block responsible for execution of a phase difference in position between the programmed axes.

Ladder Representation

Execution Features

Program Memory Size 78 Bytes


Data Memory Size 32 Bytes

Block Structure

WPS v2.5X | 1466


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation master
(0 - Fast digital inputs)
(1 - CANopen)
Master BYTE
(2 - Encoder 1)
VAR_IN_OUT (3 - Virtual Axis)
(4 - Encoder 2)
Selection of operation slave
Slave BYTE
(0 - Real axis)
Execute BOOL Block enabling
PhaseShift REAL Phase shift betw een master and slave
VAR_INPUT Velocity REAL Speed
Acceleration REAL Acceleration
Deceleration REAL Deceleration
Done BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_GEARIN_INST_0 MC_GEARIN Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it checks the synchronism between master and
slave and sends a command to motion the master axis in order to let it out-of-phase of the slave axis
in the magnitude of PhaseShift.

When the MC_PhasingRelative block is executed, the drive does not change the current operating
mode. In the execution of the block, the axis status will not change.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
67 Drive in the "Disabled" or “Errorstop” status.
71 P202 different from 4.
73 Drive is not in the “Synchronized Motion” status.
78 MC block not executed – Internal fault.
79 Master axis is not in synchronism.
96 MC_PhasingRelative block in execution.

Example

WPS v2.5X | 1467


Equipments (Devices)

WPS v2.5X | 1468


Equipments (Devices)

With the position synchronism of the Real Axis with the Quick Counter through the MC_GearInPos
block, and with the occurrence of an up transition in PHASING_EXECUTE, the MC_PhasingRelative
block is executed and a shift of 0.05 turn is applied to the master axis, resulting in a pulse in the
speed. The Done output is set while the Execute input is set.

11.10.7.14.4 Motion Control Homing


11.10.7.14.4.1 MC_FinishHoming
Block responsible for changing the axis status from Homing to Standstill.

Ladder Representation

Execution Features

Program Memory Size 70 Bytes


Data Memory Size 8 Bytes

Block Structure

WPS v2.5X | 1469


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
VAR_INPUT Execute BOOL Block enabling
Done BOOL Output enabling
VAR_OUTPUT Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_HOMEDIRECT_INST_0 MC_HOMEDIRECT Instance of access to block structure

Operation

When this block detects a leading edge in Execute, if the axis status is Homing, the axis status
changes to the Standstill.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
71 P202 different from 4.
75 Status of the Drive different from “Homing”.

Example

In the up transition of FINISH_EXECUTE, the MC_FinishHoming block is executed. With this, the
Busy and Active signals of this block are set and the status of the selected axis changes to
Standstill. When the process finishes, the Done output of the block is set and remains TRUE while
the Execute input is set.

11.10.7.14.4.2 MC_HomeDirect
Block responsible for changing the reference position of the user.

Ladder Representation

WPS v2.5X | 1470


Equipments (Devices)

Execution Features

Program Memory Size 46 Bytes


Data Memory Size 16 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
VAR_INPUT
SetPosition LREAL New reference position for user
Done BOOL Output enabling
Busy BOOL Flag indicating the block has not yet been ended
Active BOOL Block flag w ith control on the axis
VAR_OUTPUT
CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_HOMEDIRECT_INST_0 MC_HOMEDIRECT Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it makes the reference position of the user
(P0051, P0052 and P0053) to be changed to the value of the SetPosition argument.

In the execution of the block, if the axis status is Homing, the axis status changes to the Standstill.
Otherwise, it will remain in its current status.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
71 P202 different from 4.
Status of the Drive different from “Standstill” or
76
“Homing”.

WPS v2.5X | 1471


Equipments (Devices)

Example

In the up transition of STEPABSSW_EXECUTE, the MC_StepAbsoluteSwitch block is executed and


the search for the AbsoluteSwitch starts. The axis status is changed to Homing.

In case 1, when executing the block, the AbsoluteSwitch is not activated. Since the Direction
argument is set to MC_SwitchNegative, the motion is in the negative direction. When a leading edge
occurs in AbsoluteSwitch (SwitchMode = MC_EdgeOn), the motor stops and revolutions to the
position in which the edge occurred.

WPS v2.5X | 1472


Equipments (Devices)

In case 2, when executing the block, the AbsoluteSwitch is activated. Since the argument Direction
is set to MC_SwitchPositive, the motion is in the positive direction, when exiting the AbsoluteSwitch,
the motor stops and changes to motion in the negative direction. When a leading edge occurs in
AbsoluteSwitch (SwitchMode = MC_EdgeOn), the motor stops and revolutions to the position in
which the edge occurred.

All the motions are performed with an acceleration/deceleration programmed in P0100 and P0101.

When returning to the leading edge position of AbsoluteSwitch, the Done output of the block is set
and remains TRUE while the Execute input is set.

In the up transition of STEPABSSW_DONE, the MC_StepDirect block is executed and the user’s
reference position (P0051, P0052 and P0053) is changed to 3.5 revolutions (P0051 = 8192, P0052 =
3 and P0053 = 0). The axis status is changed to Standstill.

When STEPABSSW_EXECUTE is reset, STEPABSSW_DONE and STEPDIR_DONE are also reset.

11.10.7.14.4.3 MC_StepAbsoluteSwitch
Block responsible for searching the position of AbsoluteSwitch.

Ladder Representation

Execution Features

Program Memory Size 74 Bytes


Data Memory Size 40 Bytes

Block Structure

WPS v2.5X | 1473


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Search direction
(0 – Positive direction)
(1 – Negative direction)
(5 - MC_Sw itchPositive: Positive
Direction BYTE direction, if AbsoluteSw itch not
activated )
VAR_INPUT (6 - MC_Sw itchNegative: Negative
direction, if AbsoluteSw itch not
activated )
Search mode
SwitchMode BYTE (3 - MC_EdgeOn)
(4 - MC_EdgeOff)
Velocity REAL Speed
Done BOOL Output enabling
Flag indicating the block has not yet
Busy BOOL
been ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
MC_STEPABSOLUTESWITCH Instance of access to block
VAR MC_STEPABSOLUTESWITCH
_INST_0 structure

Operation

When this block detects a leading edge in Execute, it sends a command to search the position of
AbsoluteSwitch.

The AbsoluteSwitch can only be connected to digital inputs 1, 2 or 3, seeing that the programmed
function of the digital input must be in accordance with the SwitchMode argument. If SwitchMode is
configured as MC_EdgeOn (leading edge), the function of the digital input (P0300, P0301 or P0302)
must be “store position - leading edge" (option 8). If the SwitchMode is configured as MC_EdgeOff
(falling edge), the function of the digital input (P0300, P0301 or P0302) must be “store position - falling
edge” (option 9). AbsoluteSwitch will be considered the first digital input configured according to
SwitchMode from digital input 1. If no digital inputs are configured according to SwitchMode, error 77
will occur in the block and it will not be executed.

If when searching the AbsoluteSwitch position, the LimitSwitch position is reached, the motion will
change direction up to the AbsoluteSwitch position.

The search will be executed with the speed configured in the “Velocity” argument and an acceleration/
deceleration configured in the General Profile.

With the execution of the MC_StepAbsoluteSwitch block, the user’s reference position (P0051,
P0052 and P0053) is not changed. The drive will start operating in grid position and remain this way
even after the conclusion of the block. The position proportional gain must be set (P0159) so as to
obtain a better drive performance.

WPS v2.5X | 1474


Equipments (Devices)

In the execution of the block, the will change to Homing and will remain this way until the execution of
the MC_StepRefPulse, MC_StepDirect or MC_FinishHoming blocks.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
71 P202 different from 4.
Status of the Drive different from “Standstill” or
76
“Homing”.
Digital inputs 1, 2 and 3 not configured according to
77
“Siw itchMode”.

Example

WPS v2.5X | 1475


Equipments (Devices)

In the up transition of HOME_EXECUTE the MC_StepAbsoluteSwitch block is executed. With this,


the Busy and Active signals of this block are set and the search for AbsoluteSwitch begins.

In case 1, when executing the block, the AbsoluteSwitch is not activated. Since the Direction
argument is set to MC_SwitchNegative, the motion is in the negative direction. When a falling edge in
AbsoluteSwitch (SwitchMode = MC_EdgeOff) occurs, the motor stops and revolutions to the position
in which the edge occurred.

In case 2, when executing the block, the AbsoluteSwitch is activated. Since the argument Direction
is set to MC_SwitchPositive, the motion is in the positive direction, when exiting the AbsoluteSwitch,
the motor stops and changes to motion in the negative direction. When a falling edge in
AbsoluteSwitch (SwitchMode = MC_EdgeOff) occurs, the motor stops and revolutions to the position
in which the edge occurred.

In case 3, when executing the block the AbsoluteSwitch is not activated. Since the Direction
argument is set to MC_SwitchNegative, the motion is in the negative direction. But when the
LimitSwitch is found, the motor stops and changes the motion to the positive direction. When leaving
the AbsoluteSwitch, the motor stops again and changes the motion to the negative direction. When a
falling edge in AbsoluteSwitch (SwitchMode = MC_EdgeOff) occurs, the motor stops and revolutions
to the position in which the edge occurred.

All the motions are performed with an acceleration/deceleration programmed in P0100 e P0101,
except when the LimitSwitch is found, case in which the motor stops instantly.

When returning to the falling edge position of the AbsoluteSwitch, the Done output of the block is set
and the Busy and Active signals of this block are reset. The Done output remains TRUE while the
Execute input is set.

WPS v2.5X | 1476


Equipments (Devices)

11.10.7.14.4.4 MC_StepLimitSwitch
Block responsible for searching the position of LimitSwitch.

Ladder Representation

Execution Features

Program Memory Size 72 Bytes


Data Memory Size 40 Bytes

Block Structure

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Search direction
Direction BYTE (0 – Positive direction)
(1 – Negative direction)
VAR_INPUT
Search mode
LimitSwitchMode BYTE (3 - MC_EdgeOn)
(4 - MC_EdgeOff)
Velocity REAL Speed
Done BOOL Output enabling
Flag indicating the block has not yet been
Busy BOOL
ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
MC_STEPLIMITSWITCH
VAR MC_STEPLIMITSWITCH Instance of access to block structure
_INST_0

Operation

WPS v2.5X | 1477


Equipments (Devices)

When this block detects a rising edge in Execute, it sends a command to search the position of
LimitSwitch.

The LimitSwitch can only be connected to digital inputs 1, 2 or 3, seeing that the programmed
function of the digital input must be in accordance with the "LimitSwitchMode" argument and the
“Direction” argument. It will be considered LimitSwitch the first digital input configured according to the
table, from digital input 1. If no digital inputs are configured according to LimitSwitchMode and
Direction, error 77 in the block will occur and it will not be executed:

Direction Limit Sw itch Mode Digital Input Function


MC_Positive MC_EdgeOn Limit switch clockwise active high (option 12)
MC_Positive MC_EdgeOff Limit switch clockwise active low (option 13)
Limit switch counterclockwise active high
MC_Negative MC_EdgeOn
(option 14)
Limit switch counterclockwise active low (option
MC_Negative MC_EdgeOff
15)

The search will be executed with the speed configured in the “Velocity” argument and an acceleration/
deceleration configured in the General Profile.

With the execution of the MC_StepLimitSwitch block, the user’s reference position (P0051, P0052
and P0053) is not changed. The drive will start operating in grid position and remain this way even
after the conclusion of the block. The position proportional gain must be set (P0159) so as to obtain a
better drive performance.

In the execution of the block, the will change to Homing and will remain this way until the execution of
the MC_StepRefPulse, MC_StepDirect or MC_FinishHoming blocks.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
71 P202 different from 4.
76 Status of the Drive different from “Standstill” or “Homing”.
Digital inputs 1, 2 and 3 not configured according to
77
“Siw itchMode”.
97 Position feedback not allow ed. Please check P290 and P360.

Example

WPS v2.5X | 1478


Equipments (Devices)

In the up transition of HOME_EXECUTE the MC_StepLimitSwitch block is executed. With this, the
Busy and Active signals of this block are set and the search for LimitSwitch begins.

In case 1, when executing the block, the LimitSwitch is not activated. Since the Direction argument is
set to MC_Negative, the motion is in the negative direction. When the leading edge in LimitSwitch
(LimitSwitchMode = MC_EdgeOn) occurs, the motor stops and revolutions to the position in which
the edge occurred.

In case 2, when executing the block, the LimitSwitch is activated. Even with the "Direction” argument
configured as MC_Negative, the motion will be in the positive direction and, when leaving the
LimitSwitch, the motor stops and changes the motion to the negative direction. When the leading
edge in LimitSwitch (SwitchMode = MC_EdgeOn) occurs, the motor stops and revolutions to the
position in which the edge occurred.

All the motions are performed with an acceleration/deceleration programmed in P0100 e P0101,
except when the LimitSwitch is found, case in which the motor stops instantly.

WPS v2.5X | 1479


Equipments (Devices)

When returning to the leading edge position of the LimitSwitch, the Done output of the block is set
and the Busy and Active signals of this block are reset. The Done output remains TRUE while the
Execute input is set.

11.10.7.14.4.5 MC_StepReferencePulse
Block responsible for searching the position of the zero pulse.

Ladder Representation

Execution Features

Program Memory Size 72 Bytes


Data Memory Size 40 Bytes

Block Structure

WPS v2.5X | 1480


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Search direction
(0 – Positive direction)
(1 – Negative direction)
(5 - MC_Sw itchPositive: Positive
Direction BYTE direction, if AbsoluteSw itch not
VAR_INPUT activated )
(6 - MC_Sw itchNegative: Negative
direction, if AbsoluteSw itch not
activated )
Velocity REAL Speed
SetPosition LREAL New reference position for user
Done BOOL Output enabling
Flag indicating the block has not yet
Busy BOOL
been ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
MC_STEPREFERENCEPULSE Instance of access to block
VAR MC_STEPREFERENCEPULSE
_INST_0 structure

Operation

When this block detects a rising edge in Execute, it sends a command to search the position of zero
pulse.

The search will be executed with the speed configured in the “Velocity” argument and an acceleration/
deceleration configured in the General Profile.

With the execution of MC_StepReferencePulse block, the reference position of the user (P0051,
P0052 and P0053) is changed to the value of the SetPosition argument. The drive will start operating
in grid position and remain this way even after the conclusion of the block. The position proportional
gain must be set (P0159) so as to obtain a better drive performance.

In the execution of the block, the axis status will change to Homing. When concluding the search, the
axis status will change to Standstill.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1481


Equipments (Devices)

Code Description
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
71 P202 different from 4.
Status of the Drive different from “Standstill” or
76
“Homing”.

Example

WPS v2.5X | 1482


Equipments (Devices)

In the up transition of STEPLIMSW_EXECUTE the MC_StepLimitSwitch block is executed. With this,


the Busy and Active signals of this block are set and the search for LimitSwitch begins.

In case 1, when executing the block, the LimitSwitch is not activated. Since the Direction argument is
set to MC_Negative, the motion is in the negative direction. When the leading edge in LimitSwitch
(LimitSwitchMode = MC_EdgeOn) occurs, the motor stops and revolutions to the position in which
the edge occurred.

In case 2, when executing the block, the LimitSwitch is activated. Even with the "Direction” argument
configured as MC_Negative, the motion will be in the positive direction and, when leaving the
LimitSwitch, the motor stops and changes the motion to the negative direction. When the leading
edge in LimitSwitch (SwitchMode = MC_EdgeOn) occurs, the motor stops and revolutions to the
position in which the edge occurred.

All the motions are performed with an acceleration/deceleration programmed in P0100 e P0101,
except when the LimitSwitch is found, case in which the motor stops instantly.

When returning to the leading edge position of the LimitSwitch, the Done output of the block is set
and the Busy and Active signals of this block are reset. The Done output remains TRUE while the
Execute input is set.

In the up transition of STEPLIMSW_DONE, the MC_SteoRefPulse block is executed and the search
of the null pulse starts.

The motion will be in the positive direction and when the null pulse is found, the motor stops and
revolutions to the null pulse position.

All the motions are performed with an acceleration/deceleration programmed in P0100 and P0101.

When returning to the null pulse position, the Done output of the block is set and remains in TRUE
while the Execute input is set. The user’s reference position (P0051, P0052 and P0053) is changed to
10.5 revolutions (P0051 = 8192, P0052 = 10 and P0053 = 10).

When STEPLIMSW_EXECUTE is reset, STEPLIMSW_DONE and STEPREFPUL_DONE are also


reset.

11.10.7.14.5 Motion Control Move


11.10.7.14.5.1 MC_MoveAbsolute
Block responsible for performing one positioning to the absolute position programmed.

WPS v2.5X | 1483


Equipments (Devices)

Ladder Representation

Execution Features

Program Memory Size 72 Bytes


Data Memory Size 32 Bytes

Block Structure

WPS v2.5X | 1484


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Automatic update mode
ContinuousUpdate BYTE (0 - Rising edge)
(1 - Real time)
Position LREAL Position
Velocity REAL Speed
Acceleration REAL Acceleration
Deceleration REAL Deceleration
Jerk REAL Jerk
VAR_INPUT
Execution start mode
(0 - Starts block immediately, if there is
another block in the execution it w ill be
aborted)
(1 - When another block is in execution, the
block in execution w ill continue its motion
BufferMode REAL
until the end and this new block w ill w ait to
be executed.)
(6 – If another block is in execution, this
block w ill go into error 52 and w ill not be
executed. The HMI w ill show the alarm
A00052.)
Done BOOL Output enabling
Flag indicating the block has not yet been
Busy BOOL
ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_MOVEABSOLUTE_INST_0 MC_MOVEABSOLUTE Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it will perform a positioning into the absolute
position configured in the Position argument with a maximum speed configured in the Velocity
argument and acceleration/deceleration set in Acceleration and Deceleration arguments. Depending
on the distance of the positioning and the acceleration and deceleration values, the motor speed will
not reach the maximum configured speed.

NOTE!
If the Jerk argument value is not zero:
1) the value of the deceleration will be the same as the configured value in the acceleration;
2) the ContinuousUpdate On-line argument will have no effect and the argument values are
considered at the time of positive transition Execute;
3) it is not allowed to perform positioning with another active block, occurring ErrorID 95.

When the MC_MotionAbsolute block is executed, the drive will start operating in grid position and

WPS v2.5X | 1485


Equipments (Devices)

remain this way even after the conclusion of the block. The position proportional gain must be set
(P0159) so as to obtain a better drive performance.

In the execution of the positioning, the axis status will change to Discrete Motion. When the
positioning is concluded, the axis status will change to Standstill.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
Acceleration programmed below the minimum
62
allow ed.
Acceleration programmed above the maximum
63
allow ed.
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.
93 Jerk programmed below the minimum allow ed.
94 Jerk programmed above the maximum allow ed.
It is not allow ed to execute positioning w ith Jerk
95
w hen another block is active.

Example

WPS v2.5X | 1486


Equipments (Devices)

WPS v2.5X | 1487


Equipments (Devices)

In the up transition of MOTIONABS1_EXECUTE, the first MC_MotionAbsolute block is executed.


With this, the Busy and Active signals of this block are set and positioning to absolute position
"revolutions 10" starts.

With the up transition of MOTIONABS2_EXECUTE, the second MC_GearAbsolute block is instantly


executed (BufferMode - Aborting). With this, the Busy and Active signals of this block are set and
positioning to absolute position 15 revolutions starts. At the same time the Busy and Active signals
of the first block are reset and the CommandAborted signal is set for 1 scan cycle.

When the position 15 revolutions is reached, the Done output of the second block is set and the Busy
and Active signals of this block are reset. The Done output remains TRUE while the Execute input is
set.

WPS v2.5X | 1488


Equipments (Devices)

11.10.7.14.5.2 MC_MoveRelative
Block responsible for performing one positioning to the relative position programmed.

Ladder Representation

Execution Features

Program Memory Size 72 Bytes


Data Memory Size 32 Bytes

Block Structure

WPS v2.5X | 1489


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Automatic update mode
ContinuousUpdate BYTE (0 - Rising edge)
(1 - Real time)
Distance LREAL Shift distance
Velocity REAL Speed
Acceleration REAL Acceleration
Deceleration REAL Deceleration
Jerk REAL Jerk
VAR_INPUT
Execution start mode
(0 - Starts block immediately, if there is
another block in the execution it w ill be
aborted)
(1 - When another block is in execution, the
block in execution w ill continue its motion
BufferMode REAL
until the end and this new block w ill w ait to
be executed.)
(6 – If another block is in execution, this
block w ill go into error 52 and w ill not be
executed. The HMI w ill show the alarm
A00052.)
Done BOOL Output enabling
Flag indicating the block has not yet been
Busy BOOL
ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_MOVERELATIVE_INST_0 MC_MOVERELATIVE Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it will perform a positioning according to the
relative distance to the current position, configured in the Distance argument, with a maximum speed
configured in the Velocity argument and acceleration/deceleration configured in Acceleration and
Deceleration arguments. Depending on the distance of the positioning and the acceleration and
deceleration values, the motor speed will not reach the maximum configured speed.

NOTE!
If the Jerk argument value is not zero:
1) the value of the deceleration will be the same as the configured value in the acceleration;
2) the ContinuousUpdate On-line argument will have no effect and the argument values are
considered at the time of positive transition Execute;
3) it is not allowed to perform positioning with another active block, occurring ErrorID 95.

When the MC_MotionRelative block is executed, the drive will start operating in grid position and

WPS v2.5X | 1490


Equipments (Devices)

remains this way after the conclusion of the block. The position proportional gain must be set (P0159)
so as to obtain a better drive performance.

In the execution of the positioning, the axis status will change to Discrete Motion. When the
positioning is concluded, the axis status will change to Standstill.

When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block
finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
Acceleration programmed below the minimum
62
allow ed.
Acceleration programmed above the maximum
63
allow ed.
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.
93 Jerk programmed below the minimum allow ed.
94 Jerk programmed above the maximum allow ed.
It is not allow ed to execute positioning w ith Jerk
95
w hen another block is active.

Example

WPS v2.5X | 1491


Equipments (Devices)

WPS v2.5X | 1492


Equipments (Devices)

In the up transition of MOTIONREL1_EXECUTE, the first MC_MotionRelative block is executed. With


this, the Busy and Active signals of this block are set and positioning of 10 positive revolutions from
the current position starts.

When the positioning is finished, the first block is completed. With this, the Busy and Active signals
of this block are reset and Done output is set for 1 scan cycle.

In the up transition of MOTIONREL2_EXECUTE, the second MC_MotionRelative block is executed.


With this, the Busy and Active signals of this block are set and positioning of 5 positive revolutions
from the current position starts.

When the positioning of 5 revolutions finishes, the Done output of the second block is set and the
Busy and Active signals of this block are reset. The Done output remains TRUE while the Execute
input is set.

WPS v2.5X | 1493


Equipments (Devices)

In the up transition of MOTIONREL1_EXECUTE, the first MC_MotionRelative block is executed. With


this, the Busy and Active signals of this block are set and positioning of 10 positive revolutions from
the current position starts.

With the up transition of MOTIONREL2_EXECUTE, the second MC_MotionRelative block is instantly


executed (BufferMode - Aborting). With this, the Busy and Active signals of this block are set and
positioning of 5 positive revolutions from the current position starts. At the same time, the Busy and
Active signals of the first block are reset and the CommandAborted signal is set for 1 scan cycle.

When the positioning of 5 revolutions finishes, the Done output of the second block is set and the
Busy and Active signals of this block are reset. The Done output remains TRUE while the Execute
input is set.

WPS v2.5X | 1494


Equipments (Devices)

11.10.7.14.5.3 MC_MoveVelocity
Block responsible for making a motion to the programmed speed.

Ladder Representation

Execution Features

Program Memory Size 66 Bytes


Data Memory Size 24 Bytes

Block Structure

WPS v2.5X | 1495


Equipments (Devices)

Variable Type Name Data Type Description


Selection of operation axis
VAR_IN_OUT Axis BYTE
(0 - Real axis)
Execute BOOL Block enabling
Automatic update mode
ContinuousUpdate BYTE (0 - Rising edge)
(1 - Real time)
Velocity REAL Speed
Acceleration REAL Acceleration
Deceleration REAL Deceleration
Jerk REAL Jerk
VAR_INPUT Execution start mode
(0 - Starts block immediately, if there is
another block in the execution it w ill be
aborted)
(1 - When another block is in execution, the
block in execution w ill continue its motion
BufferMode REAL
until the end and this new block w ill w ait to
be executed.)
(6 – If another block is in execution, this
block w ill go into error 52 and w ill not be
executed. The HMI w ill show the alarm
A00052.)
InVelocity BOOL Output enabling
Flag indicating the block has not yet been
Busy BOOL
ended

VAR_OUTPUT Active BOOL Block flag w ith control on the axis


CommandAborted BOOL Flag of aborted command
Error BOOL Error in the execution flag
ErrorID WORD Identifier of the occurred error
VAR MC_MOVEVELOCITY_INST_0 MC_MOVEVELOCITY Instance of access to block structure

Operation

When this block detects a leading edge in Execute, it will perform a motion into the configured speed
in the Velocity argument with acceleration/deceleration configured in Acceleration and Deceleration
arguments. The motion direction will depend on the speed signal: If the speed is greater than zero,
the motion will be in the positive direction (clockwise) and if the speed is less than zero, the motion
will be in the negative direction (counterclockwise).

NOTE!
If the Jerk argument is different from zero, the ContinuousUpdate On-line argument will have no
effect and the argument values are considered at the time of positive transition Execute.

When the MC_MotionVelocity block is executed, the drive does not operate in grid position.

In the execution of the motion the axis status will change to Continuous Motion.

When Execute has FALSE value, InVelocity remains FALSE. The InVelocity output is activated when

WPS v2.5X | 1496


Equipments (Devices)

the programmed speed is achieved successfully, remaining TRUE level while the block is active. It
order to conclude the block, it is necessary the execution of another block or the changing of the drive
to the Disable or Errorstop status.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
Attempt to execute block w ith BufferMode in Single
52
w hen another block is active.
60 Speed programmed below the minimum allow ed.
61 Speed programmed above the maximum allow ed.
Acceleration programmed below the minimum
62
allow ed.
Acceleration programmed above the maximum
63
allow ed.
Deceleration programmed below the minimum
64
allow ed.
Deceleration programmed above the maximum
65
allow ed.
67 Drive in the "Disabled" or “Errorstop” status.
69 Drive in the "Stopping" status.
Attempt to execute block w ith BufferMode in
70 Buffered w hen another block is active and another
block is w aiting.
71 P202 different from 4.
74 Drive in the "Homing" status.
78 MC block not executed – Internal fault.
93 Jerk programmed below the minimum allow ed.
94 Jerk programmed above the maximum allow ed.
It is not allow ed to execute positioning w ith Jerk
95
w hen another block is active.

Example

WPS v2.5X | 1497


Equipments (Devices)

WPS v2.5X | 1498


Equipments (Devices)

In the up transition of MOTION1_EXECUTE, the first MC_MotionVelocity block is executed. With this,
the Busy and Active signals of this block are set and the motion to reach the speed of 200 RPM
starts.
At the moment in which the speed reaches 200 RPM, the InVelocity output is set.

With the up transition of MOTION2_EXECUTE, the second MC_MotionVelocity block is instantly


executed (BufferMode - Aborting). With this, the Busy e Active signals of this block are set and the
motion to the speed of 100 RPM (MOTION2_VELOCITY this time contains the value 100) starts. At
the same time the Busy, Active and InVelocity signals of the first block are reset and the signal
CommandAborted is set for 1 scan cycle.

When the speed of 100 RPM is reached, the InVelocity output of the second block is set and remains
until the execution of another block.

WPS v2.5X | 1499


Equipments (Devices)

Since the ContinuousUpdate argument is configured as Online, with the change of the
MOTION2_VELOCITY value to 80, the speed immediately changes to 80 RPM, without executing an
acceleration/deceleration ramp.

11.10.7.15 RTC
11.10.7.15.1 INTIME
Block that performs a programmed enabling for a time based on RTC (Real Time Clock).

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
TIMEON_HOUR WORD UINT Enabling hour
TIMEON_MINUTE WORD UINT Enabling minute
TIMEON_SECOND WORD UINT Enabling second
VAR_INPUT
TIMEOFF_HOUR WORD UINT Disabling hour
TIMEOFF_MINUTE WORD UINT Disabling minute
TIMEOFF_SECOND WORD UINT Disabling second
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled when the internal clock's time is equal to that defined by the parameters TIMEON and
disabled when the internal clock's time is equal to the parameters set by TIMEOFF. If Q_OPTION# is
Inverted, Q is disabled when the internal clock's time is equal to that defined by the parameters
TIMEON and enabled when the internal clock's time is equal to the parameters set by TIMEOFF.

When EN has FALSE value, Q remains FALSE.

Block Flowchart

WPS v2.5X | 1500


Equipments (Devices)

Example

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is lower than the registered enabling
inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is disabled.

WPS v2.5X | 1501


Equipments (Devices)

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
enabling inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is
disabled.

In the above example, the INTIME block is disabled. This way, regardless of the input, the Q output is
disabled.

WPS v2.5X | 1502


Equipments (Devices)

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). This way, the Q
output is enabled.

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is superior to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). Thus, the Q output is
disabled.

11.10.7.15.2 INWEEKDAY
Block that performs a programmed enabling for weekdays based on RTC (Real Time Clock).

Ladder Representation

WPS v2.5X | 1503


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
SUNDAY# BOOL Enabled on Sundays
MONDAY# BOOL Enabled on Mondays
TUESDAY# BOOL Enabled on Tuesdays
VAR_INPUT WEDNESDAY# BOOL Enabled on Wednesdays
THURSDAY# BOOL Enabled on Thursdays
FRIDAY# BOOL Enabled on Fridays
SATURDAY# BOOL Enabled on Saturdays
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled if the day of week of the internal clock has Enabled parameter in the block. If Q_OPTION#
is Inverted, Q is disabled if the day of week of the internal clock has Enabled parameter in the block.

When EN has FALSE value, Q remains FALSE.

NOTE!
The weekdays are identified by numbers, with Sunday being day 0 and Saturday day 6.

Block Flowchart

WPS v2.5X | 1504


Equipments (Devices)

Example

WPS v2.5X | 1505


Equipments (Devices)

In the above example, the INWEEKDAY block is disabled. This way, regardless of the input, the Q
output is disabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Wednesday (value
3), which has ENABLED status in the programming. This way, the Q output is enabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. Thus, the Q output is disabled.

WPS v2.5X | 1506


Equipments (Devices)

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
INVERTED operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. This way, the Q output is enabled.

11.10.7.16 Timer
11.10.7.16.1 TOF
Timer block that, when energized, disables the output after a delay set by PT.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output deactivating
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TOF_INST_0 TOF Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is TRUE, the Q output is also TRUE and ET also receives the value zero.
On the negative transition edge in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state FALSE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1507


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1508


Equipments (Devices)

Example

The above example disables the DO1 output to identify a low level in DI1 for 12 seconds, remaining
disabled until DI1 again be TRUE.

11.10.7.16.2 TON
Timer block that, when energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 1509


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output drive
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TON_INST_0 TON Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is FALSE, the Q output is FALSE and ET also receives the value zero.
On the edge positive transition in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state TRUE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1510


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1511


Equipments (Devices)

Example

The above example shows the initial conditions of the block and of the routine variables.

When activated the IN input, counting is triggered. Since ET equals PT, the Q output is enabled.

Note that a change in PRESET variable is not forwarded to the PT field while the IN entry remains
enabled.

WPS v2.5X | 1512


Equipments (Devices)

Disabling the IN input, the value of PT is updated and the Q output is disabled. When activating it
again, counting is triggered.

Disabling the IN input, the value of ET remains saved.

Enabling the IN input, the value of ET is reset and counting is triggered.

When ET reaches the value PT, the Q is output enabled and remains so while IN is at TRUE level.

11.10.7.16.3 TP
Timer block that, when identifies it is energized, enables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 1513


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Time w hile the output is enabled
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TP_INST_0 TP Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

On the edge positive transition in IN, Q receives TRUE value, counting is triggered and ET is
incremented according to TIMEBASE. When ET equals PT, the Q output goes to state FALSE until
IN revolutions to FALSE. At that moment, if IN is at TRUE level, nothing happens. On the edge
positive transition in IN, ET is automatically reset.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1514


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1515


Equipments (Devices)

Example

The above example enables the DO1 output for six seconds at each DI1 positive transition.

11.10.7.17 Cam Profiles


It allows loading and editing the cam table of the CAM curves.
Accessed by the CAM Profile List command with the right button of the mouse in the CAM Profiles folder of
the resource.

WPS v2.5X | 1516


Equipments (Devices)

Description

The cam tables from 1 to 10 are tables of fixed points, which are transmitted at the moment of the download of
the application. In order to use the tables 1 to 10, first the MC_CamTableSelect block must be executed with
the desired table and then the MC_CamIn block.
The cam tables 11 to 20 are tables of variable points. In order to use the tables 11 to 20, first the
MC_CamCalc block must be executed with the desired table and then the MC_CamIn block.

For the SCA06 equipment, it is allowed programming at most 200 fixed points and 100 variable points, seeing
that the maximum number of variable points of each table must be configured in the Max Points column, as
shown below:

WPS v2.5X | 1517


Equipments (Devices)

In order to edit the cam table, click on the Edit button, and the cam profile editor will open, as in the figure
below:

WPS v2.5X | 1518


Equipments (Devices)

This window has the following controls:

Cam table:

NOTE!
The CAM block is always relative, so the first point of the cam table will always be master= 0 and
slave = 0.

Graphic of the profile:

WPS v2.5X | 1519


Equipments (Devices)

Graphic control tools:

Values of the cursor:


Values relative to the selected point of the cursor.

Master speed:
Speed used to calculate the speed, acceleration and jerk of the slave.

WPS v2.5X | 1520


Equipments (Devices)

NOTE!
The speed, acceleration and jerk of the slave must be used as reference to develop the cam
profile, where they are calculated numerically, not taking into account load, inertia, torque and
dynamics of the drive.

Adding a new point to the cam profile

A point can be added by means of the add or insert point buttons or by double clicking the graphic in the
position where you wish to add the point. You can double click any region of the graphic. In case an
interpolation already exists in this region, the editor will insert this point between the two points of the
interpolation.
The point is always added as linear interpolation.
When a point is added or inserted by means of the respective buttons, the master and slave values come
zeroed. In case of point insertion, that may cause an interruption of the profile, because the master position
must always grow in relation to the origin; therefore, the value of the master and slave must be edited by
clicking on their cells in the cam table.
On the figure below, a point was inserted by double clicking:

In order to change the type of interpolation, click on the type cell in the line corresponding to the origin of the
interpolation and select the desired type.
In the figure below, the point was changed for cubic interpolation.

WPS v2.5X | 1521


Equipments (Devices)

Now, in this curve, it is already possible to see other magnitudes besides the position, such as speed,
acceleration and jerk. For a better view of all magnitudes, we can use the Set Zoom All button according to
the figure below.

The same way, we can choose one of the magnitudes and use the Apply Selected Zoom button. In the
example below, a zoom was applied to the speed.

WPS v2.5X | 1522


Equipments (Devices)

Another interesting tool is the cursor. In the example below, we will place the cursor in point of maximum
speed.

You must bear in mind that the speed, acceleration and jerk of the slave depend on the master speed;
therefore, it is interesting to change them so as to simulate something really close to the effective values. In
the figure below, the master speed will be changed to 1000 rpm and we will analyze the same position of the
cursor.

WPS v2.5X | 1523


Equipments (Devices)

During the project of the cam profile, all those magnitudes must be observed, because they may be
accomplished or not due to mechanical, electrical and electronic limitations of the involved equipment.

Since the acceleration and jerk graphics are calculated taking into account the interpolation between two
points, the acceleration and jerk will be shown as equal to zero in the junctions between linear interpolations.
Although in theory we know that in a speed step the acceleration and jerk are infinite, in practice the
acceleration and jerk at this moment will also depend on the mechanical, electrical and electronic limitations
of the involved equipment. Those speed steps must be observed and considered in the project of the cam
profile. The figure below shows an example of this situation.

The CAM block offers two types of interpolation: linear and cubic. The following equations are used:

Linear:

WPS v2.5X | 1524


Equipments (Devices)

Cubic:

where:
pe = slave position
ve = slave speed
ae = slave acceleration
je = slave jerk
pm = master position
vm = master speed
pim = master initial position
pfm = master final position
pie = slave initial position
pfe = slave final position
a = coefficient calculated by the CAM editor
b = coefficient calculated by the CAM editor
c = coefficient calculated by the CAM editor

Changing a point in the cam profile

A point can be changed by means of the cam table by using direct edition or moving the point in the graphic.
In order to move the point in the graphic, place the cursor on the point, which is marked with a red square,
click and hold it, and drag it to the new position.
When you click on the point, the cam table will move to this point, selecting the related cell.
The operation of moving the point in the graphic is interactive and calculates all the profile each time the point
is changed. The new point can be seen in the cam table.

Removing a point from the cam profile

The point is removed directly in the cam table. In order to do so, select one of the cells referring to the point
and click on the Remove Point button.

Zoom of a certain area of the graphic

Click on one of the corners of the region you wish to zoom and hold it, and move the mouse so as to mark a
region. Then a rectangle will show on the graphic; release the button. The figure below shows an example of
this zoom.

WPS v2.5X | 1525


Equipments (Devices)

Graphic menu

In order to access the graphic menu, right click on the graphic area, and the following menu will show.

The figure below shows the graphic property box.

WPS v2.5X | 1526


Equipments (Devices)

11.10.7.18 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

WPS v2.5X | 1527


Equipments (Devices)

Figure 1: Creating a structure

2. Define the file name and press the Next button.

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

WPS v2.5X | 1528


Equipments (Devices)

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

Figure 4: Structure created in the project

WPS v2.5X | 1529


Equipments (Devices)

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.10.8Diagnostic
11.10.8.1 Monitoring Panel

Main Signals

11.10.8.1.1 Main Signals


The Main Signals window provides a general view of the main signals of the equipment:

Drive status (P00006),


General indications (P00202, P00002, P00003 and P00004),
Alarm (P00030) and fault (P00035),
Temperatures (P00021 and P00022),
Network status (P00070, P00075 and P00076), and
PLC information (P01000 and P01001).

The main signals are detailed below.

Parameter Function Description


P00006 Servodrive Status It indicates the current status of the servodrive
It defines the operation mode of the servodrive, that is, w hich variable w ill be controlled:
P00202 Operation Mode
Torque, Speed or if the control w ill be done via Ladder, CANopen or Profibus
It indicates the effective speed value in rpm, except w hen programmed to receive
P00002 Motor Speed
external position / speed feedback
P00003 Motor Current It indicates the output Iq current, in amperes rms, of the servodrive
P00004 DC Link voltage It indicates the present voltage on the DC Link in volts (V)
P00030 Present Alarm It indicates the number of the alarm w hich may be present on the servodrive
P00035 Present Fault It indicates number of the fault w hich may be present on the servodrive.
P00021 Internal Air Temperature This parameter presents, in Celsius degrees, the internal air temperature
P00022 Heatsink Temperature This parameter presents, in Celsius degrees, the heatsink temperature
It indicates the CAN controller status, responsible for sending and receiving CAN
P00070 CAN Controller Status
telegrams
It indicates the CANopen communication status, informing if the protocol w as initialized
P00075 CANopen Netw ork Status
correctly and the status of the slave guarding service
Each device in the CANopen netw ork has an associated status. It is possible to see the
P00076 CANopen Node Status
present status of the servodrive through this parameter
P01000 PLC Status It allow s the user to view the program status
P01001 Scan Time It allow s the user to monitor the scan cycle time of the program in milliseconds

WPS v2.5X | 1530


Equipments (Devices)

The window may be viewed below.

11.10.8.2 Log

Overview

Configuration

11.10.8.2.1 Overview
The log function allows viewing the present alarms/faults and also the last alarms/faults in a more friendly and
centralized way than on the equipment HMI, showing the data in tabular form.

All downloaded alarms/faults are saved in a file in order to keep a record for future reference; it is also possible
to export the saved data as a csv file.

Below is an overview of the SCA06 log table.

WPS v2.5X | 1531


Equipments (Devices)

1. Actions. Below is the sequential description of each action:


1.1.On-Line Reading: This action constantly searches for new faults/alarms on the equipment; in case
any occurs, the table is automatically updated.
1.2.Read Logs: This action reads all faults/alarms only once and updates the table.
1.3.Export: Export of data shown in the table as a CSV file.
2. Present Fault and Alarm. This field shows the present fault and alarm of the equipment if present;
otherwise, the OK message is shown.
3. Fault and Alarm Table. This table shows all the faults and alarms, as well as the date when they
occurred, code and description.

11.10.8.2.2 Configuration
In order to create a new log file, just execute the operation below:

1. Create a new log file by selecting the Read Logs option; it is necessary to be connected to the device to
execute this operation.

2. After the read logs step is completed, the log file will be automatically created with a name composed of the
present data and time and with all the alarms and faults present on the equipment read.

WPS v2.5X | 1532


Equipments (Devices)

11.10.8.3 Trace
11.10.8.3.1 Overview
The trace function is used to register variables* of interest of the device (such as current, voltage, speed, etc.)
when a certain event occurs in the system. Since it triggers the storage of the variables, in the system this
event is called trigger, and the user can define up to three trigger conditions and the logic to be used in them
(AND or OR logic).
The stored variables can be seen as graphics by using the WPS running on a PC connected via USB or via
serial to the device.

NOTE: Up to 6 (six) channels using SCA06; Up to 4 (four) channels using CFW-11.

Below is an overview of the configuration screen of the trace function (example using SCA06).

WPS v2.5X | 1533


Equipments (Devices)

1. Graphic Zoom. This bar contains the options to control the graphic, such as export to image file, zoom in,
zoom out, set width, set height, se all and show or not show the graphic lettering.
2. Trace Status. This item shows the present status of the trace function: not started, trigger occurred and
concluded.
3. Parameters. In this part are all the parameters that can be configured in the trace routine, such as triggers,
conditions, channels to be monitored and sampling period.
4. Graphic. In this area is the graphic after the conclusion of trace. In the lower part is the time line and on the
right are the values separated by unit of measurement.
5. Markers. The markers are within the graphic area. After the graphic is set, just click on the black marker to
create red markers (fixed). It is possible to add two fixed markers. Those fixed markers are used to
calculate the average and effective values between the two points.
6. Trace command. Below is the description of the command functions:
6.1.Read configuration: It reads the trace configuration parameters and updates the parameters on the
screen (item 3).
6.2.Save configuration: It sends the trace configuration parameters (item 3) to the equipment.
6.3.Read Data: Command used only when the trace status is concluded, that is, there is already a
concluded trace on the equipment, and you just wish to download the data without starting a new trace.
6.4.Force Trigger: Forces the trigger regardless the conditions.
6.5.Start Trace: It starts the trace function.
7. Channel Table. This table shows the data of the chosen channels, besides the possibility to hide
channels (Visible), change the channel color (Color) and set the graphic limits per unit of measurement
(Maximum).

11.10.8.3.2 Configuration
Below is a list of the necessary steps to create a trace configuration:

1. Creation of a new trace file.

WPS v2.5X | 1534


Equipments (Devices)

WPS v2.5X | 1535


Equipments (Devices)

2. After the creation of the trace file, it is necessary to set the desired configurations in the part of parameters.

3. After making the desired configurations, just click on save configuration to send them to the equipment.

WPS v2.5X | 1536


Equipments (Devices)

Notice that it is necessary to be connected to the equipment with the option Connect Device of the WPS.

4. After the configurations are saved, just click on Start Trace. Notice that the status of the trace function
changed to Waiting, that is, the tool is now waiting for the trigger execution to set the graphic and show the
trace values.

WPS v2.5X | 1537


Equipments (Devices)

5. After trigger occurs, the graphic and the values will be shown in the table and the trace function status will
be Concluded.

WPS v2.5X | 1538


Equipments (Devices)

6. If you wish, you can click on the black cursor of the graphic and add fixed cursors so that the calculation of
the average and effective values will be performed for the channels in the defined ranges.

WPS v2.5X | 1539


Equipments (Devices)

11.11SSW-06
Enter topic text here.

11.11.1Description

Soft-Starters are static starters that accelerate, decelerate and protect three-phase induction motors. The
control of the voltage applied to the motor by means of adjustments to the firing angle of thyristors allows the
soft-starter to start and stop an electric motor smoothly.

The SSW-06, with DSP (Digital Signal Processor) control was designed for high performance on motor starts
and stops with an excellent cost-benefit ratio. Easy to set up, it simplifies start-up activities and daily
operation.

The SSW-06 is compact optimizing space in electric panels. It already incorporates electric motor protection.
It adapts to customer needs through its easy-to-install optional accessories.

The SSW-06 adapts to customer needs through its easy-to-install optional accessories. Thus, a keypad, a
communication interface or a motor PTC input can be added to the product.

WPS v2.5X | 1540


Equipments (Devices)

Refer to the user's manual of the SSW-06 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.11.2Parameters
11.11.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 1541


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,
change the values and the modification will occur on-line.
5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.11.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

WPS v2.5X | 1542


Equipments (Devices)

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 1543


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 1544


Equipments (Devices)

11.11.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 1545


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 1546


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 1547


Equipments (Devices)

11.11.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 1548


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 1549


Equipments (Devices)

WPS v2.5X | 1550


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 1551


Equipments (Devices)

WPS v2.5X | 1552


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 1553


Equipments (Devices)

WPS v2.5X | 1554


Equipments (Devices)

WPS v2.5X | 1555


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 1556


Equipments (Devices)

WPS v2.5X | 1557


Equipments (Devices)

11.11.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 1558


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 1559


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.12SSW-07
Enter topic text here.

11.12.1Description

WPS v2.5X | 1560


Equipments (Devices)

Soft-Starters are static starters that accelerate, decelerate and protect three-phase induction motors. The
control of the voltage applied to the motor by means of adjustments to the firing angle of thyristors allows the
soft-starter to start and stop an electric motor smoothly.

The SSW-07, with DSP (Digital Signal Processor) control was designed for high performance on motor starts
and stops with an excellent cost-benefit ratio. Easy to set up, it simplifies start-up activities and daily
operation.

The SSW-07 is compact optimizing space in electric panels. It already incorporates electric motor protection.
It adapts to customer needs through its easy-to-install optional accessories.

The SSW-07 adapts to customer needs through its easy-to-install optional accessories. Thus, a keypad, a
communication interface or a motor PTC input can be added to the product.

Refer to the user's manual of the SSW-07 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.12.2Parameters
11.12.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 1561


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 1562


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.12.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 1563


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 1564


Equipments (Devices)

11.12.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 1565


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 1566


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 1567


Equipments (Devices)

11.12.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 1568


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 1569


Equipments (Devices)

WPS v2.5X | 1570


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 1571


Equipments (Devices)

WPS v2.5X | 1572


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 1573


Equipments (Devices)

WPS v2.5X | 1574


Equipments (Devices)

WPS v2.5X | 1575


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 1576


Equipments (Devices)

WPS v2.5X | 1577


Equipments (Devices)

11.12.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 1578


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 1579


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.13SSW-08
Enter topic text here.

11.13.1Description

WPS v2.5X | 1580


Equipments (Devices)

WEG soft starters are fitted with micro processors. They are high-tech and were designed to ensure the
highest performance during starts and stops of induction motors. WEG Soft-Starters are static starting
switches, intended for the acceleration, deceleration and protection of three-phase, induction motors. The
voltage control applied to the motor, by setting the thyristor firing angle, allows smooth starts and stops.

With proper variable settings, the torque produced is set to the requirement of the load, ensuring that the
demanded current of the start is the lowest actually required.

Refer to the user's manual of the SSW-08 for further details about the product.

NOTE!

This product does not have the Ladder tool available in WPS.
You can use the WLP application if this feature is required.

11.13.2Parameters
11.13.2.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 1581


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 1582


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.13.2.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 1583


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 1584


Equipments (Devices)

11.13.2.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 1585


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 1586


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 1587


Equipments (Devices)

11.13.2.4 Hide/Unhide Parameters and Group of Parameters


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 1588


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 1589


Equipments (Devices)

WPS v2.5X | 1590


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 1591


Equipments (Devices)

WPS v2.5X | 1592


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 1593


Equipments (Devices)

WPS v2.5X | 1594


Equipments (Devices)

WPS v2.5X | 1595


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 1596


Equipments (Devices)

WPS v2.5X | 1597


Equipments (Devices)

11.13.2.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 1598


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 1599


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.14SSW900
11.14.1Description
The "Soft-Starter WEG 900" is a high-performance product that allows the starting/stopping control and
protection of three-phase induction motors. Thus it prevents mechanical shocks on the load, current peaks in
the supply line and damage to the motor.

WPS v2.5X | 1600


Equipments (Devices)

Refer to the user's manual of the SSW900 for further details about the product.

11.14.2I/O's
Hardware information can be found in the Manual of the SSW900 at the website www.weg.net.

Digital Inputs

Address Bit Modbus Tag Description


%IB0 0 16000 DI1 Digital Input 1
%IB0 1 16001 DI2 Digital Input 2
%IB0 2 16002 DI3 Digital Input 3
%IB0 3 16003 DI4 Digital Input 4
%IB0 4 16004 DI5 Digital Input 5
%IB0 5 16005 DI6 Digital Input 6

Digital Outputs

Address Bit Modbus Tag Description


%QB0 0 16000 DO1 Digital Output 1
%QB0 1 16001 DO2 Digital Output 2
%QB0 2 16002 DO3 Digital Output 3

Analog Outputs

Address Bit Modbus Tag Description


%QW1 -- 5001 AO1 Analog Output 1

11.14.3System Markers
The following variables contained in teh GLOBAL_SYSTEM group of the variables table, have the fixed tag.
The tag of system markers were divided into groups and subgroups, wher:do:

Grupos:
SSW: reading and writing variables of the SSW900 soft-starter.

Subgroups:
STS: reading variable (status);
CMD: writing variable (command).

Reading System Markers (Status)

WPS v2.5X | 1601


Equipments (Devices)

Rading - Modbus Function 02 "Read Discrete Inputs"

Addres
Bit Modbus Tag Description
s

Ladder

%
0 0 SYS_FREQ_2HZ Oscilator w ith frequency of 2 Hz
SB6000
%
1 1 SYS_PULSE_1SCAN Pulse during the first scan cycle
SB6000
%
2 2 SYS_FALSE Alw ays in 0
SB6000
%
3 3 SYS_TRUE Alw ays in 1
SB6000

WPS v2.5X | 1602


Equipments (Devices)

Addres
Bit Modbus Tag Description
s

Logical Status

% SSW_STS_MOTOR_RUNN
0 16 The soft-starter is turning the motor
SB6002 ING
% SSW_STS_GENERAL_EN
1 17 The soft-starter is general enabled and ready to run motor
SB6002 ABLED
%
2 18 SSW_STS_JOG_ACTIVE The JOG function is active
SB6002
%
3 19 SSW_STS_INITIAL_TEST Executing initial tests before starting the engine
SB6002
%
4 20 SSW_STS_ACCEL_RAMP Motor in acceleration ramp
SB6002
% SSW_STS_FULL_VOLTA
5 21 Full voltage is being applied to the motor
SB6002 GE
%
6 22 SSW_STS_BYPASS The bypass contactor is closed
SB6002
%
7 23 SSW_STS_DECEL_RAMP Motor in deceleration ramp
SB6002
% SSW_STS_LOC_REM_MO
0 24 Soft-starter is in local or remote mode (0-Local, 1-Remote)
SB6003 DE
%
1 25 SSW_STS_BRAKING Braking is active
SB6003
% SSW_STS_REVERSING_D
2 26 The motor is reversing the direction of rotation
SB6003 IRECTION
% SSW_STS_FWD_REV_DIR
3 27 Motor running in reverse or direct direction (0-Reverse, 1-Direct)
SB6003 ECTION
% SSW_STS_START_DELA
4 28 Time before startin the motor
SB6003 Y
% SSW_STS_RESTART_DEL
5 29 Time after motor stop
SB6003 AY
% SSW_STS_ALARM_ACTI
6 30 Soft-starter has an active alarm
SB6003 VE
% SSW_STS_FAULT_ACTIV
7 31 Soft-starter is in fault state
SB6003 E

WPS v2.5X | 1603


Equipments (Devices)

Addres
Bit Modbus Tag Description
s

HMI keys

%
0 32 SSW_STS_KEY_BACK BACK key pressed
SB6004
%
1 33 SSW_STS_KEY_UP UP key pressed
SB6004
%
2 34 SSW_STS_KEY_HELP HELP key pressed
SB6004
% SSW_STS_KEY_DIRECTIO
3 35 DIRECTION key pressed
SB6004 N
%
4 36 SSW_STS_KEY_DOWN DOWN key pressed
SB6004
% SSW_STS_KEY_LOC_RE
5 37 LOC/REM key pressed
SB6004 M
%
6 38 SSW_STS_KEY_START START (I) key pressed
SB6004
%
7 39 SSW_STS_KEY_JOG JOG key pressed
SB6004
%
0 40 SSW_STS_KEY_STOP STOP (0) key pressed
SB6005
%
1 41 SSW_STS_KEY_RIGHT RIGHT key pressed
SB6005
%
2 42 SSW_STS_KEY_ENTER ENTER key pressed
SB6005
%
3 43 SSW_STS_KEY_LEFT LEFT key pressed
SB6005

Writing / Reading System Markers (Command)

Reading - Modbus Function 01 "Read Coils"


Writing - Modbus Function 05 "Write Single Coil" and 15 "Write Multiple Coils"

WPS v2.5X | 1604


Equipments (Devices)

Addres
Bit Modbus Tag Description
s

Logical Command

%
0 0 SSW_CMD_RUN_STOP Run the motor (0-Stop, 1-Run)
CB6006
% SSW_CMD_GENERAL_EN
1 1 Enables the soft-starter allow ing the motor operation (0-Disable, 1-Enable)
CB6006 ABLE
%
2 2 SSW_CMD_JOG Enables the JOG function (0-Disable, 1-Enable)
CB6006
%
3 3 SSW_CMD_DIRECTION Reverses the direction of rotation of motor
CB6006
%
4 4 SSW_CMD_LOC_REM Selects the soft-starter operation mode (0-Local, 1-Remote)
CB6006
% SSW_CMD_FAULT_RESE
7 7 Executes the fault reset command
CB6006 T

11.14.4Volatile Markers
Only the variables created in the GLOBAL group of the variables table, called Global Volatile Markers, and
that have a user-specified address, will be accessible by modbus protocol, when their are within the following
range:

Address
TYPE Modbus Map Description
Range
40000 - 49999 Each modbus address represents 1 bit of the address content.
%MB: BOOL
(Coil) After address 1250, the bit is not accessible via modbus.
%MB: BYTE, SINT, USINT 0 - 7343
8000 - 11671 Each modbus address represents 2 bytes of the address content.
%MW: WORD, INT, DINT
(Register) After address 7344, the data is not accessible via modbus.
%MD: DWORD, DINT, UDINT, REAL

Modbus functions with access to volatile global markers with address defined:
1. Read - Modbus Function 01 "Read Coils"
2. Read - Modbus Function 03 "Read Holding Registers"
3. Write - Modbus Function 05 "Write Single Coil"
4. Write - Modbus Function 06 "Write Single Register"
5. Write - Modbus Function 15 "Write Multiple Coils"
6. Write - Modbus Function 16 "Write Multiple Registers"

Example of volatile global markers declaration with address defined in variables table of the ladder editor:

WPS v2.5X | 1605


Equipments (Devices)

11.14.5Import from WLP


The function import from WLP is utilized to import Ladder developed on WLP software to equipment (device).

The import from WLP can be executed during the resource creation.

WPS v2.5X | 1606


Equipments (Devices)

1. To execute the import WLP function click the Import from WLP button and select the WLP project folder or
the WLP BKP file.

WPS v2.5X | 1607


Equipments (Devices)

WPS v2.5X | 1608


Equipments (Devices)

2. After import from WLP completed successfully click the Finish button to copy the imported files to new
resource.

11.14.6Parameters
11.14.6.1 Overview
The parameter configuration screen is used to configure and monitor all the parameters of the equipment,
including the user parameters.

NOTE!
The reading and writing of such parameters is done on this screen; only the user parameter
configuration must be sent the first time or whenever modified by means of the resource
download routine.

Below is an overview of the parameter configuration screen.

WPS v2.5X | 1609


Equipments (Devices)

1. Parameter files. In this part are all the parameter configuration files created by the user. Notice that when
the file features a person figure on the table, it means this parameter table contains hidden parameters/
group of parameters.
2. Group of parameters. This tree shows all the group of parameters. Notice that the same parameter can be
in more than one group, and when its value is modified, it will be modified in all the groups to which it
belongs.
3. Modified group of parameters. Group of parameters which contain the figure of a person on the table
means they have hidden parameters.
4. Commands. The commands are described below in the order they appear:
4.1.Unhide parameter: In case some parameter has been hidden, this button allows making it visible
again.
4.2.Hide parameter: Just select one or more parameters on the table and trigger this command to hide
them.
4.3.Save table: It saves the values of the parameters shown on the equipment screen; the sent values are
the ones in the User column. The flow is User -> Monitored (equipment)
4.4.Read table: It reads the parameters of the equipment shown in the Monitored column and saves them
in the parameter file in the User column. The flow is Monitored (equipment) -> User
4.5.User parameters: It opens a screen to edit the user parameters.
4.6.Filter: It opens a parameter filter option, and it can filter by parameter number or description.
4.7.User Parameters and Monitored Parameters. These two columns show the off-line and on-line
parameters, so to speak. The User column shows the values contained in the file located on the
computer and the Monitored column shows the values that are effectively saved on the equipment.
Whenever you use the Save Parameter option, the sent values will be from the User column to the
Monitored column, that is, File -> Equipment. In case of reading, the flow is the opposite, from the
Monitored column to the User column, that is, Equipment -> File. In case you wish to change the
values directly on the equipment without changing it in the file, just click on the monitored column,

WPS v2.5X | 1610


Equipments (Devices)

change the values and the modification will occur on-line.


5. Modified parameters: Whenever a parameter value in the User column is different from the Monitored
column, it will be shown in red.
6. Output. This screen shows error information in case they occur during the writing or reading of the
parameters.

11.14.6.2 Configuration
Below is the list of the required steps to create a parameter file.

1. Create a new parameter file.

2. Define a name for the parameter file

3. Configure which parameters you wish to view in your parameter table

WPS v2.5X | 1611


Equipments (Devices)

4. After performing the steps above, the parameter file will be created and the equipment can be
parameterized.

WPS v2.5X | 1612


Equipments (Devices)

11.14.6.3 Read and Write of Parameters


There are 3 (three) ways to do the reading and writing of the parameters: by means of table, selection and
group.

1. Table writing. The table writing command will send all visible parameters on the equipment screen. If and
error occurs during the sending of some specific parameter, a message will be shown on the output window
informing the error. It is important to notice that only visible parameters will be sent; therefore, it is necessary
attention to which node of the group of parameters tree you are viewing. Example: If you wish to write all of
them without filtering per group, just select the tree root.

WPS v2.5X | 1613


Equipments (Devices)

2. Table reading. The table reading command will read all the parameters of the equipment. If a error occurs
during the reading of some specific parameter, a message will be shown on the output window informing the
error. It is important to notice that only visible parameters will be read; therefore, it is necessary attention to
which node of the group of parameters tree you are viewing. Example: If you wish to read all of them without
filtering per group, just select the tree root.

WPS v2.5X | 1614


Equipments (Devices)

3. Reading/writing of specific parameters. In order to read/write one or more specific parameters, just
select them on the table, right click and choose the desired option: read or write parameter.

4. Reading/writing of group of parameters. In order to read/write only one group of parameters, just select
it on the group tree, right click and choose the desired option: read or write group.

WPS v2.5X | 1615


Equipments (Devices)

11.14.6.4 Hide/Unhide Parameters and Group of Parameters_2


The parameter can be hidden/unhidden in two ways: individually or in group.

1. Hide parameters. In order to hide a parameter individually, just right click on the desired parameters and
select the Hide Parameter option. You can also press the Delete key.

2. Unhide Parameters. In order to show hidden parameters, right click and choose the Unhide Parameters

WPS v2.5X | 1616


Equipments (Devices)

or press the Insert key. Then, a window will open and show the hidden parameters. Now, you just have to
select the desired parameters and confirm.
Note: The parameters shown on this new window are only those which belong to the current filter according to
the selection on the parameter group tree. In the figures below, the CAN group is selected; that means that
only the hidden parameters of this group will be shown.

WPS v2.5X | 1617


Equipments (Devices)

WPS v2.5X | 1618


Equipments (Devices)

3. Hide Group of Parameters. In order to hide a group of parameters, just select the group on the tree and
use the Hide Group option.

WPS v2.5X | 1619


Equipments (Devices)

WPS v2.5X | 1620


Equipments (Devices)

4. Unhide Group of Parameters. In order to show a hidden group of parameters, just select the root of the
group tree and select the Unhide Group option. A window will open showing the groups that are hidden; then
just select the group you wish to unhide.

WPS v2.5X | 1621


Equipments (Devices)

WPS v2.5X | 1622


Equipments (Devices)

WPS v2.5X | 1623


Equipments (Devices)

5. Hide and Show Parameters and Groups of Parameters. By means of this option, you have full control
of the parameters and groups of parameters. It is possible to hide and unhide individual parameters, multiple
parameters, individual groups and multiple groups in the same action.

WPS v2.5X | 1624


Equipments (Devices)

WPS v2.5X | 1625


Equipments (Devices)

11.14.6.5 User Parameters


In order to open the configuration screen of the user parameters, just click on the User Parameters option on
the Parameter node of the project tree or click on the icon indicated on the tool bar of the parameter file.

Configuration Table.

On the user parameter configuration table, it is possible to define several attributes to the parameters, such as
description, minimum and maximum values, unit, digits, data type, etc.

NOTE!
These settings will be automatically displayed in the parameter table. However, to be sent to the
device, you need to download the resource.

WPS v2.5X | 1626


Equipments (Devices)

Table fields:

Parameter: User parameter identification.

Description: Description of the user parameter in the parameter table. On devices that have text-based
HMIs, the description is sent to the machine and displayed on the HMI.

Minimum: Minimum input value for parameter.

Maximum: Maximum input value for parameter.

Unit: Unit displayed on the device's HMI.

Default: Value loaded when restore factory default is selected.

Retentive: Retain value after rebooting devices.

Hexadecimal: Displays the value in hexadecimal.

Digits: Number of decimal digits for displaying value.

Datatype: Parameter datatype used by the ladder application.

Password: Enables password request by changing parameter value.

WPS v2.5X | 1627


Equipments (Devices)

Read only: It does not allow the writing of values in the parameter by the communication network or the HMI.
Writing is done only by the ladder application.

Display HMI: Displays the parameter in the HMI.

Performs modification: Confirmation options when changing the parameter:


o No confirmation: Does not prompt for confirmation when changing parameter.
o With confirmation and engine stopped: Request confirmation and allow change only with engine stopped.
o With confirmation: Prompt for confirmation when changing parameter.

Stopped motor: Perform change only with motor stopped.

Help: On devices that have text-based HMI, you can edit a help text for the parameter.

View the user parameter

In the parameter table, the user parameters will be shown as they are configured on the configuration screen.

11.14.7Ladder
11.14.7.1 Coil
11.14.7.1.1 DIRECTCOIL
Logical block used to assign direct values of the output variables.

WPS v2.5X | 1628


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example keeps the digital output DO9 permanently connected, because the value of A in
this case is the value of the left bus which is always considered high logic level (TRUE).

11.14.7.1.2 INVERTEDCOIL
Logical block used for assigning values denied to output variables.

Ladder Representation

WPS v2.5X | 1629


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

The block transfers the denied value of A for the memory address corresponding to O1.

Diagram

Block Flowchart

Example

The above example disables the digital output DO3 when some of the digital inputs DI1 and DI2 are
with FALSE value. When both inputs are with a TRUE value, DO3 activates.

WPS v2.5X | 1630


Equipments (Devices)

11.14.7.1.3 RESETCOIL
Logical block used for indefinite disabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers a FALSE value to the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

Example

WPS v2.5X | 1631


Equipments (Devices)

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI5.

11.14.7.1.4 SETCOIL
Logical block used for indefinite enabling of output variables.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output

Operation

When identifying a TRUE value in A, this block transfers the value of A for the memory address
corresponding to O1.
When identifying a FALSE value in A, this block performs no operation.

Diagram

Block Flowchart

WPS v2.5X | 1632


Equipments (Devices)

Example

The example above activates permanently the system control marker that enables end-of-message
character in RS232 communication to identify a TRUE level at the digital input DI6.

11.14.7.1.5 TOGGLECOIL
Logical block used for output variables alternance.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT O1 BOOL Block log output
VAR TOGGLECOIL_INST_0 TOGGLECOIL Instance of access to block structure

Operation

When identifying a transition from FALSE to TRUE (leading edge) on A, the block reverses the status
of O1.

Diagram

WPS v2.5X | 1633


Equipments (Devices)

Block Flowchart

Example

The above example inverts the state of the digital output DO6 to each disabling the internal buzzer.

11.14.7.2 Communication Network


11.14.7.2.1 Modbus RTU
11.14.7.2.1.1 Modbus RTU Overview
Operation in the Modbus RTU Network - Master Mode

The CFW300 allows operation as a master for the Modbus RTU network. For this operation, it is necessary to
observe the following points:

Only interface RS485 allows operation as a network master.


It is necessary to program, in product configurations, the operation mode as "Master", besides the
communication rate, parity, and stop bits, which must be the same for the whole equipment in the network.
The Modbus RTU network master does not have an address, so the address configured in the CFW300 is
not used.
Sending and receiving telegrams via RS485 interface using the Modbus RTU is programmed by using blocks
in Ladder programming language. It is necessary to know the available blocks and the Ladder programming
software in order to be able to program the network master.

WPS v2.5X | 1634


Equipments (Devices)

The following functions are available for the sending of requisitions by the Modbus master:
o Function 01: Read Coils
o Function 02: Read Discrete Inputs
o Function 03: Read Holding Registers
o Function 04: Read Input Registers
o Function 05: Write Single Coil
o Function 06: Write Single Register
o Function 15: Write Multiple Coils
o Function 16: Write Multiple Registers

Blocks to program the master

In order to control and monitor the Modbus RTU communication using the CFW300, the following blocks were
developed, and they must be used when programming in Ladder.

11.14.7.2.1.2 MB_MasterControlStatus
Block that allows monitoring various statuses of the Modbus RTU network master.

Ladder Representation

Block Structure

WPS v2.5X | 1635


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
VAR_INPUT
DisableComm BOOL Disables Modbus RTU communication
Done BOOL Output enabling
CommDisabled BOOL Disabled communication flag
TxCounter WORD UINT Counter of requests sent
RxCounter WORD UINT Counter of telegrams received
NoAnswerCounter WORD UINT Counter of requests not answ ered
Counter of responses received w ith error
ErrorResponseCounter WORD UINT
information
VAR_OUTPUT
Slave address in w hich the last communication
LastErrorSlaveAddress BYTE USINT
error w as detected
Operation result of the last communication error
received
LastErrorResult BYTE USINT (0 = No error)
(4 – Response Timeout)
(5 = Slave returned error)
LastErrorCode BYTE USINT Code of the last communication error received

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
monitoring of the master and input requests. When Execute receives FALSE level, the inputs are
ignored and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE
level and block finished its execution.

A TRUE level DisableComm disables the Modbus RTU communication and resets the status counters
and markers of the master. These markers and counters are displayed in the output block each
having some data corresponding to its description. Their values are also cleared at shutdown of the
master.

Block Flowchart

WPS v2.5X | 1636


Equipments (Devices)

Example

The example above requests status data of the Modbus RTU network master, and allows disabling
communication through DISABLE. The block ends successfully, Done output is activated.

11.14.7.2.1.3 MB_ReadBinary
Block that performs a reading of up to 128 binary data (via Read Coils or Read Discrete Inputs) of a
slave on the Modbus RTU network.

Ladder Representation

WPS v2.5X | 1637


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial bit address of the data to be read
VAR_INPUT
NumberOfData BYTE Number of bits to be read (1 to 128)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
VAR_OUTPUT another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
Value BOOL Variable that stores the received data
VAR MB_READBINARY_INST_0 MB_READBINARY Instance of access to block structure

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus slave RTU in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

WPS v2.5X | 1638


Equipments (Devices)

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 1639


Equipments (Devices)

WPS v2.5X | 1640


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT Modbus RTU slave of SLAVE address through the Read Discrete Input function.
These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.14.7.2.1.4 MB_ReadRegister
Block that performs a reading of up to 64 16-bit registers (via Read Holding Registers or Read Input
Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 1641


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Reading function code
InitialDataAddress WORD Initial register address to be read
VAR_INPUT
NumberOfData BYTE Number of registers to be read (1 to 64)
Maximum w aiting time for the slave response
Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e., need
Offset# BOOL
to subtract 1 from this number
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
Busy BOOL
another request

VAR_OUTPUT Error BOOL Error in the execution flag


ErrorID BYTE Identifier of the occurred error
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the received data
DWORD UDINT
DINT REAL
MB_READREGISTER
VAR MB_READREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the reading request of a number of registers indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting them when receiving the
response from the slave. The received data is stored in the Value variable. If the slave is not free, the
block waits Busy go to FALSE level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1642


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 1643


Equipments (Devices)

WPS v2.5X | 1644


Equipments (Devices)

Example

The above example requests reading of a number of binary data described by DATA_COUNT
positioned in the INIT in the Modbus RTU slave of SLAVE address through the Read Input Register
function. These data are forwarded to VALUE. The block ends successfully, Done output is activated.

11.14.7.2.1.5 MB_SlaveStatus
Block that allows monitoring the status of 4 slaves of the Modbus RTU network.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


Execute BOOL Block enabling
Amount of errors that the master must identify until it
ErrorsToSetOffline# BYTE
considers communication w ith an offline slave

VAR_INPUT AddressSlave1# BYTE Slave address 1 to be monitored


AddressSlave2# BYTE Slave address 2 to be monitored
AddressSlave3# BYTE Slave address 3 to be monitored
AddressSlave4# BYTE Slave address 4 to be monitored
Done BOOL Output enabling
Flag indicating any one of the monitored
GeneralOffline BOOL
communication is offline

VAR_OUTPUT Slave1Offline BOOL Flag of offline status slave 1


Slave2Offline BOOL Flag of offline status slave 2
Slave3Offline BOOL Flag of offline status slave 3
Slave4Offline BOOL Flag of offline status slave 4

WPS v2.5X | 1645


Equipments (Devices)

Operation

This block remains active while Execute is at TRUE level, updating its outputs according to the
number of errors recorded for each slave. When Execute receives FALSE level, the inputs are ignored
and the outputs are zeroed. The Done output receives TRUE level when Execute has TRUE level and
block finished its execution.

The ErrorsToSetOffline # input allows registering the number of errors identified in a slave that will
feature an offline communication. AddressSlave inputs allow inserting four slave addresses to be
monitored. When this monitored slave reports the programmed number of errors, its corresponding
SlaveOffline output is set to TRUE level. If any of SlaveOffline outputs is at TRUE level, GeneralOffline
also receives TRUE level.

Block Flowchart

Example

WPS v2.5X | 1646


Equipments (Devices)

The above example checks the number of error responses sent by the slaves 2, 4, 6 and 8 of the
Modbus RTU. If any of them is greater than 5, its SX_OFF status is led to TRUE level. The block ends
successfully, Done output is activated.

11.14.7.2.1.6 MB_WriteBinary
Block that performs a writing of up to 128 binary data (via Write Single Coil or Write Multiple Coils) in
a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 1647


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial bit address w here the data w ill be w ritten
VAR_INPUT NumberOfData BYTE Number of bits to be w ritten (1 to 128)
Timeout# WORD Maximum w aiting time for the slave response [ms]
Offset Indication in InitialDataAddress, i.e., need to
Offset# BOOL
subtract 1 from this number
Value BOOL Variable that stores the data to be w ritten
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy w ith
VAR_OUTPUT Busy BOOL
another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEBINARY
VAR MB_WRITEBINARY Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of a number of bits indicated by NumberOfData in InitialDataAddress address
using chosen function in Function# and sets the Active output, resetting it when receiving the
response from the slave. If the slave is not free, the block waits Busy go to FALSE level to resubmit
the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of size equal to NumberOfData. It is important to check this compatibility not to
generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1648


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 1649


Equipments (Devices)

WPS v2.5X | 1650


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Coil. The block ends successfully, Done output is activated.

11.14.7.2.1.7 MB_WriteRegister
Block that performs a reading of up to sixteen 16-bit registers (via Write Single Register or Write
Multiple Registers) of a slave on the Modbus RTU network.

Ladder Representation

Block Structure

WPS v2.5X | 1651


Equipments (Devices)

Variable Type Name Data Type Description


Execute BOOL Block enabling
SlaveAddress BYTE Slave address
Function# BYTE Writing function code
InitialDataAddress WORD Initial register address to be w ritten
NumberOfData BYTE Number of registers to be w ritten (1 to 16)

VAR_INPUT Maximum w aiting time for the slave response


Timeout# WORD
[ms]
Offset Indication in InitialDataAddress, i.e.,
Offset# BOOL
need to subtract 1 from this number
BYTE SINT USINT
WORD UINT INT
Value Variable that stores the data to be w ritten
DWORD UDINT DINT
REAL
Done BOOL Output enabling
Active BOOL Aw aiting response flag
Flag indicating the RS485 interface is busy
VAR_OUTPUT Busy BOOL
w ith another request
Error BOOL Error in the execution flag
ErrorID BYTE Identifier of the occurred error
MB_WRITEREGISTER
VAR MB_WRITEREGISTER Instance of access to block structure
_INST_0

Operation

When this block detects a leading edge on Execute, it checks whether the Modbus RTU slave in
specified address in SlaveAddress is free to send data (Busy variable at FALSE level). If so, it sends
the writing request of Value values in a number of registers indicated by NumberOfData in
InitialDataAddress address using chosen function in Function# and sets the Active output, resetting it
when receiving the response from the slave. If the slave is not free, the block waits Busy go to FALSE
level to resubmit the request.

NOTE!
If Execute goes to FALSE level and Busy is still at TRUE level, the request is canceled.

NOTE!
Value is an array of number of bits NumberOfData multiplied by 16. That is, if NumberOfData is
16, Value can be an array of 32 BYTE positions, 16 WORD positions or 8 DWORD positions. It
is important to check this compatibility not to generate errors in the block.

When Execute has FALSE value, Done remains FALSE. The Done output is only activated when the
block finishes executing successfully, remaining at TRUE level until Execute receives FALSE.

If there is any error in the execution, the Error output is enabled and ErrorID displays an error code
according to the table below.

WPS v2.5X | 1652


Equipments (Devices)

Code Description
0 Executed successfully
1 Invalid input data
2 Master not enabled
4 Timeout in slave response
5 Slave returned error

Block Flowchart

WPS v2.5X | 1653


Equipments (Devices)

WPS v2.5X | 1654


Equipments (Devices)

Example

The example above requests written data contained in VALUE, with size described by DATA_COUNT,
at addresses positioned from INIT on Modbus RTU slave at address SLAVE using the function Write
Single Register. The block ends successfully, Done output is activated.

11.14.7.3 Compare
11.14.7.3.1 COMP_EQ
Block that compares the values of Value1 and Value2, enabling the output Q if both are equal.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality

Operation

When this block has a TRUE value in EN, it sends to the output Q the TRUE value if Value1 and
Value2 are the same. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1655


Equipments (Devices)

Example

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is activated. Notice that the types of the input variables can be different
without causing execution problems.

WPS v2.5X | 1656


Equipments (Devices)

The example above checks equality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is disabled.

11.14.7.3.2 COMP_GE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
or equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or majority of Value1

Operation

When this block has a TRUE value in EN it sends the Q output to the TRUE value if Value1 is higher
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1657


Equipments (Devices)

Example

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is disabled.

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 1658


Equipments (Devices)

The example above checks equality or majority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is activated.

11.14.7.3.3 COMP_GT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is higher than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of majority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is higher
than Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1659


Equipments (Devices)

Example

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is disabled.

The example above checks the majority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 1660


Equipments (Devices)

The example above checks the majority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is activated.

11.14.7.3.4 COMP_LE
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than or
equal to Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of equality or minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1661


Equipments (Devices)

Example

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has lower value than VALUE2, the Q output is activated.

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since both
variables have the same value, the Q output is activated.

WPS v2.5X | 1662


Equipments (Devices)

The example above checks equality or minority of VALUE1 in relation to VALUE2. Since VALUE1
has higher value than VALUE2, the Q output is disabled.

11.14.7.3.5 COMP_LT
Block that compares the values of Value1 and Value2, enabling the output Q if Value1 is lower than
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of minority of Value1

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is lower
than or equal to Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1663


Equipments (Devices)

Example

The example above checks minority of VALUE1 in relation to VALUE2. Since VALUE1 has lower
value than VALUE2, the Q output is activated.

The example above checks the minority of VALUE1 in relation to VALUE2. Since both variables have
the same value, the Q output is disabled.

WPS v2.5X | 1664


Equipments (Devices)

The example above checks the minority of VALUE1 in relation to VALUE2. Since VALUE1 has higher
value than VALUE2, the Q output is disabled.

11.14.7.3.6 COMP_NE
Block that compares the values of Value1 and Value2, enabling the Q output if Value1 is different from
Value2.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
VAR_OUTPUT Q BOOL Indicator of inequality

Operation

When this block has a TRUE value in EN, it sends to the Q output the TRUE value if Value1 is
different from Value2. Otherwise, Q receives FALSE.

When EN has FALSE value, Q remains in FALSE.

Block Flowchart

WPS v2.5X | 1665


Equipments (Devices)

Example

The example above checks inequality between VALUE1 and VALUE2. Since both variables have
different values, the Q output is activated.

The example above checks equality between VALUE1 and VALUE2. Since both variables have the
same value, the Q output is disabled.

11.14.7.4 Contact
11.14.7.4.1 NCCONTACT
Normally closed contact.

Ladder Representation

WPS v2.5X | 1666


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with TRUE value, B receives FALSE.


When variable I1 is with FALSE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1667


Equipments (Devices)

Example

The above example performs the transfer of the opposite value of digital input DI1 to the digital output
DO2.

11.14.7.4.2 NOCONTACT
Normally open contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_OUTPUT I1 BOOL Block control input

Operation

When variable I1 is with FALSE value, B receives FALSE.


When variable I1 is with TRUE value, B receives the value of A.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1668


Equipments (Devices)

Example

The above example performs the transfer of the value of digital input DI1 to the digital output DO2.

11.14.7.4.3 NTSCONTACT
Falling edge transition contact.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR NTSCONTACT_INST_0 NTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from TRUE to FALSE (falling edge or negative edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

WPS v2.5X | 1669


Equipments (Devices)

Block Flowchart

Example

The above example resets the digital output DO1 if the SHIFT key is pressed or a positive pulse on
the digital input DI2 is given.

11.14.7.4.4 PTSCONTACT

Leading edge transition contact.

Ladder Representation

WPS v2.5X | 1670


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


VAR_INPUT I1 BOOL Block control input
VAR PTSCONTACT_INST_0 PTSCONTACT Instance of access to block structure

Operation

At the instant the variable I1 transitions from FALSE to TRUE (leading edge or positive edge
transition), B receives the value of A for a scan cycle.
At all other times, B receives the FALSE value.

NOTE!
Watch out for series and parallel associations of contacts. Refer to section Contact Logic for
further information.

Diagram

Block Flowchart

WPS v2.5X | 1671


Equipments (Devices)

Example

The above example resets the digital output DO1 if the SHIFT key is pressed and a positive pulse on
the digital input DI2 is given.

11.14.7.5 Control
11.14.7.5.1 PID
Block that performs the function of a discrete PID controller. From the input variables, it calculates the
corresponding controller output.

Ladder Representation

Block Structure

WPS v2.5X | 1672


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
SetPoint REAL Automatic reference (pre-control)
ManualSetPoint REAL Forced reference (post control)
SelectSetPoint BOOL Selects w hich reference to use
Feedback REAL Feedback loop variable
MinimumOutput REAL Minimum value of the controller output
MaximumOutput REAL Maximum value of the controller output
VAR_INPUT
Kp REAL Proportional gain
Ki REAL Integral gain
Kd REAL Derivative gain
TauSetPoint# REAL Time constant of the automatic reference in put filter
Type# BYTE Controller type
Action# BYTE Control action
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Controller output
VAR PID_INST_0 PID Instance of access to block structure

Operation

On the positive transition edge in EN, Output receives zero value, and the block executes its
functionality as EN is at TRUE level.

When enabled, this block performs a routine PID control with the Kp, Ki and Kd parameters chosen.
The PID topology used may be the Academic or Parallel, depending on what is chosen in Type#.

Academic Form:

Parallel Form:

WPS v2.5X | 1673


Equipments (Devices)

The levels of the output signal of the controller are saturated at value MinimumOutput and
MaximumOutput. The SelectSetPoint input level FALSE causes the SetPoint reference be adopted,
allowing the controller maintains control over the process. When SelectSetPoint goes to TRUE level,
the controller has no more domain, and ManualSetPoint becomes to be considered the output signal
of the controller.

Action# will define the feedback operation. If Action# is DIRECT, the operation will be SetPoint –
Feedback. If Action# is REVERSE, the operation will be Feedback – SetPoint.

Feedback receives the process variable considered as the plant output. Ts# receives the sampling
time for the controller and # TauSetPoint receives the time constant for the input filter of the automatic
reference.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

NOTE!
Effects of the alteration of gains on the process
If Kp decreases, the process becomes slower; generally more stable or less oscillating; it has
less overshoot.
If Kp increases, the process responds faster; it may become more unstable or more
oscillating; it has more overshoot.
If Ki decreases, the process becomes slower, lagging to reach the "SetPoint"; it becomes
more stable or less oscillating; it has less overshoot.
If Ki increases, the process becomes faster, quickly reaching the "SetPoint"; it becomes more
unstable or more oscillating; it has more overshoot.
If Kd decreases, the process becomes slower; it has less overshoot.
If Kd increases, it has more overshoot.

WPS v2.5X | 1674


Equipments (Devices)

NOTE!
How to improve the performance of the process through the adjustment of gains (valid for the
Academic PID)
If the performance of the process is almost good, but the overshoot is a bit high, try to: (1)
decrease Kp 20%, (2) decrease Ki 20% and/or (3) decrease Kd 50%.
If the performance of the process is almost good, but it does not have overshoot and lags to
reach the "SetPoint", try to: (1) increase Kp 20%, (2) increase Ki 20% and/or (3) increase Kd
50%.
If the performance of the process is good, but the process output is varying too much, try to:
(1) increase Kd 50%, (2) decrease Kp 20%.
If the performance of the process is bad, i.e. after start up, the transitory lasts several periods
of oscillation that reduce very slowly or never reduce at all, try to: (1) decrease Kp 50%.
If the performance of the process is bad, i.e. after start up it slowly moves towards the
"SetPoint" without overshoot, but is still very far and the process output is less than the rated
value, try to: (1) increase Kp 50%, (2) increase Ki 50%, (3) increase Kd 70%.

Block Flowchart

WPS v2.5X | 1675


Equipments (Devices)

WPS v2.5X | 1676


Equipments (Devices)

Example

The above example creates a loop of a digital PID form with sampling time 50 ms, using the
constants KP, KI and KD for control. Automatic reference SETPOINT, filtered by a first order filter with
time constant of 0:01 is used. The error signal is calculated as the difference between the filtered
reference and variable SAIDA_PLANTA. The controller output is saturated between the values 0.1 and
2.5 and sent to the variable ENTRADA_PLANTA.

11.14.7.6 Conversion
11.14.7.6.1 BOOL
11.14.7.6.1.1 BYTE_TO_BOOL
Block that performs the conversion of a BYTE value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
BOOL, storing in Result.

WPS v2.5X | 1677


Equipments (Devices)

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The examples above perform the conversion of VALUE variable, in BYTE, into a BOOL value storing

WPS v2.5X | 1678


Equipments (Devices)

the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.1.2 DWORD_TO_BOOL
Block that performs the conversion of a DWORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1679


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in DWORD, into a BOOL value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.1.3 REAL_TO_BOOL
Block that performs the conversion of a REAL value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

WPS v2.5X | 1680


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1681


Equipments (Devices)

The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice in the
last example that the values very close to the machine epsilon may result in an interpretation of the
FALSE value.

11.14.7.6.1.4 WORD_TO_BOOL
Block that performs the conversion of a WORD value into a BOOL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BOOL Value in BOOL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BOOL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1682


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in WORD, into a BOOL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.2 BYTE
11.14.7.6.2.1 BOOL_TO_BYTE
Block that performs the conversion of a BOOL value into a BYTE value.

WPS v2.5X | 1683


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1684


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BOOL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.2.2 DWORD_TO_BYTE
Block that performs the conversion of a DWORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1685


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.14.7.6.2.3 REAL_TO_BYTE
Block that performs the conversion of a REAL value into a BYTE value.

WPS v2.5X | 1686


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1687


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in REAL, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that the
results are truncated in decimal and only the eight least significant bits are taken into account.

11.14.7.6.2.4 WORD_TO_BYTE
Block that performs the conversion of a WORD value into a BYTE value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result BYTE USINT SINT Value in BYTE

Operation

WPS v2.5X | 1688


Equipments (Devices)

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
BYTE, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1689


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a BYTE value storing
the final result in RESULT. The block ends with success and ENO output is activated. Notice that
only the eight least significant bits are taken into account.

11.14.7.6.3 DWORD
11.14.7.6.3.1 BOOL_TO_DWORD
Block that performs the conversion of a BOOL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1690


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD value
storing the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.3.2 BYTE_TO_DWORD
Block that performs the conversion of a BYTE value into a DWORD value.

Ladder Representation

Block Structure

WPS v2.5X | 1691


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1692


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.3.3 REAL_TO_DWORD
Block that performs the conversion of a REAL value into a DWORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1693


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in REAL, into a DWORD value storing
the final result in RESULT. The block ends with success and ENO output is activated. Note that the
results are truncated in decimal and only the thirty-two least significant bits are taken into account.

11.14.7.6.3.4 WORD_TO_DWORD
Block that performs the conversion of a WORD value into a DWORD value.

WPS v2.5X | 1694


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result DWORD UDINT DINT Value in DWORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
DWORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1695


Equipments (Devices)

The examples above convert the VALUE variable, in WORD, into a DWORD value storing the final
result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.4 REAL
11.14.7.6.4.1 BOOL_TO_REAL
Block that performs the conversion of a BOOL value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1696


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in BOOL, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.4.2 BYTE_TO_REAL
Block that performs the conversion of a BYTE value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 1697


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1698


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.4.3 DWORD_TO_REAL
Block that performs the conversion of a DWORD value into a REAL value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1699


Equipments (Devices)

Example

The examples above perform the conversion of variable VALUE, in DWORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.4.4 WORD_TO_REAL
Block that performs the conversion of a WORD value into a REAL value.

Ladder Representation

Block Structure

WPS v2.5X | 1700


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value WORD UINT INT Value in WORD
ENO BOOL End of operation
VAR_OUTPUT
Result REAL Value in REAL

Operation

When this block has a TRUE value in EN, it interprets the Value value as WORD and converts it into
REAL, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1701


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in WORD, into a REAL value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.5 WORD
11.14.7.6.5.1 BOOL_TO_WORD
Block that performs the conversion of a BOOL value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BOOL Value in BOOL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BOOL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1702


Equipments (Devices)

Example

The examples above perform the conversion of VALUE variable, in BOOL, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.5.2 BYTE_TO_WORD
Block that performs the conversion of a BYTE value into a WORD value.

Ladder Representation

Block Structure

WPS v2.5X | 1703


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value BYTE USINT SINT Value in BYTE
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1704


Equipments (Devices)

The examples above perform the conversion of variable VALUE, in BYTE, into a WORD value storing
the final result in RESULT. The block ends with success and ENO output is activated.

11.14.7.6.5.3 DWORD_TO_WORD
Block that performs the conversion of a DWORD value into a WORD value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value DWORD UDINT DINT Value in DWORD
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as DWORD and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1705


Equipments (Devices)

Example

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Notice that only the
sixteen least significant bits are taken into account.

11.14.7.6.5.4 REAL_TO_WORD
Block that performs the conversion of a REAL value into a WORD value.

WPS v2.5X | 1706


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value in REAL
ENO BOOL End of operation
VAR_OUTPUT
Result WORD UINT INT Value in WORD

Operation

When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into
WORD, storing in Result.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1707


Equipments (Devices)

The examples above convert the VALUE variable, in DWORD, into a WORD value storing the final
result in RESULT. The block ends with success and ENO output is activated. Note that the results
are truncated in decimal and only the sixteen least significant bits are taken into account.

11.14.7.7 Counter
11.14.7.7.1 CTD
Countdown block of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CD BOOL Pulse identifier
VAR_INPUT LD BOOL Loads the value of PV in CV
PV WORD UINT Value of initial configuration
Q BOOL Counter zeroed flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTD_INST_0 CTD Instance of access to block structure

Operation

WPS v2.5X | 1708


Equipments (Devices)

When this block identifies a leading edge in CD, it decrements the CV variable until it is zero. While
CV equals zero, the output Q remains at TRUE level. By detecting high-level LD, the block loads the
PV value in CV.

Block Flowchart

Operation Diagram

WPS v2.5X | 1709


Equipments (Devices)

Example

The above example shows the initial conditions of routine. As CV has a value of zero, the Q output is
enabled.

The value of the PV variable was changed to 20, but not yet loaded.

WPS v2.5X | 1710


Equipments (Devices)

By identifying TRUE level in LD, the block loads the PV value to CV. Since this value is greater than
zero, the Q output is disabled.

At each leading edge identified in CD, the value of COUNT is decremented until it reaches zero, when
the Q output is enabled.

11.14.7.7.2 CTU
Block for gradual count of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


CU BOOL Pulse identifier
VAR_INPUT R BOOL Loads the zero value in CV
PV WORD UINT Maximum count value
Q BOOL Counter overrun flag
VAR_OUTPUT
CV WORD UINT Current count value
VAR CTU_INST_0 CTU Instance of access to block structure

Operation

When this block identifies a leading edge in CD, it increments the CV variable until it is equal to PV.
While CV equals PV, the output Q remains at TRUE level. By detecting high-level R, the block loads
the zero value in CV.

Block Flowchart

WPS v2.5X | 1711


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1712


Equipments (Devices)

Example

The above example shows the initial conditions of routine. Since CV has a lower value than of PV, the
Q output is disabled.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the Q output is enabled.

WPS v2.5X | 1713


Equipments (Devices)

By identifying TRUE level in R, the block loads the zero value to CV. Since this value is lower than of
PV, the Q output is disabled.

11.14.7.7.3 CTUD
Block for gradual count and countdown of input pulses.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
CU BOOL Pulse identifier for incremental
CD BOOL Pulse identifier for decremental
VAR_INPUT
R BOOL Loads the zero value in CV
LD BOOL Loads the value of PV in CV
PV WORD UINT Reference value
ENO BOOL Output enabling
QU BOOL Counter overrun flag
VAR_OUTPUT
QD BOOL Counter zeroed flag
CV WORD UINT Current count value
VAR CTUD_INST_0 CTUD Instance of access to block structure

Operation

When this block has a TRUE value in EN, it acts as a CTD block and block CTU at the same time
acting on the same CV counter. That is: increments CV until it reaches PV to the leading edges in
CU and decrements CV until it reaches zero to the leading edges in CD. A positive transition in R
carries zero in CV, while a leading edge in LD loads the PV value in CV. If CV has zero value, QD
receives TRUE, and if CV has value equal to PV, QU receives TRUE.

WPS v2.5X | 1714


Equipments (Devices)

The ENO value forwards to the next Ladder block the EN value.

Block Flowchart

WPS v2.5X | 1715


Equipments (Devices)

WPS v2.5X | 1716


Equipments (Devices)

Operation Diagram

Example

WPS v2.5X | 1717


Equipments (Devices)

The example above shows the disabled block, with all its internal variables zeroed. Although the
external controls are activated, these values are not forwarded to the instance of the block.

When activated, the block identifies the value of PRESET, loading it in PV, and identifies that the
output is at zero, enabling the QD output. When execution is completed, the ENO output is activated.

At each leading edge identified in CU, the value of CV is incremented until it reaches the PV value,
when the QU output is enabled. When execution is completed, the ENO output is activated.

At each leading edge detected in CD, the CV value is decremented. When CV is a value between
zero and PV, both QD and QU outputs are deactivated. When execution is completed, the ENO
output is activated.

WPS v2.5X | 1718


Equipments (Devices)

A TRUE value in R resets CV, while a TRUE value in LD loads the value of PV to CV. As we can see,
R prevails over LD, leaving CV and enabling the QD output. When execution is completed, the ENO
output is activated.

11.14.7.8 Data Transfer


11.14.7.8.1 DEMUX
Block that creates 16 new BOOL variables from the decomposition of a WORD variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Word WORD UINT INT Input variable of 15 bits
ENO BOOL End of operation
VAR_OUTPUT
Bit0 – Bit15 BOOL Bit of the corresponding position of Word

Operation

WPS v2.5X | 1719


Equipments (Devices)

When this block has a TRUE value in EN, it decomposes the input variable in Word 15 Boolean
values stored in Bit0 to Bit15 variables. Bit0 corresponds to the LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, output variables remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1720


Equipments (Devices)

The example above decomposes the value of MYWORD in Boolean values, which are stored in the
output variables BIT0 to Bit15. The block ends successfully and the ENO output is activated.

11.14.7.8.2 ILOAD
Block which indirectly loads the value of a variable and transfers it to Value.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
DataType# BYTE Data type of the selected variable
Address DWORD UDINT DINT Address of the global variable, as its group
ENO BOOL End of operation
VAR_OUTPUT As selected in
Value Value of the selected variable
DataType#

Operation

When this block has a TRUE value in EN, it loads, in Value, the of the Address variable belonging to
the Group# group, as the selected DataType#.

WPS v2.5X | 1721


Equipments (Devices)

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example loads the value of the address 40 of group 2 (GLOBAL_SYSTEM%S), which
represents the status of ESC key in UINT format for the VALUE variable. The block ends with
success and ENO output is activated.

11.14.7.8.3 ILOADBOOL
Block that indirectly loads the value of a bit in a global variable address.

Ladder Representation

WPS v2.5X | 1722


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be checked
ENO BOOL End of operation
VAR_OUTPUT
Value BOOL Value of the bit selected by the input arguments

Operation

When this block has a TRUE value in EN, it loads, in Value, the Bit contents of the Address variable
belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1723


Equipments (Devices)

Example

The above example loads the value of bit 1 of the address 24 of group 2 (S GLOBAL_SYSTEM%),
which represents the status of ESC key for the VALUE variable. The block ends with success and
ENO output is activated.

11.14.7.8.4 ISTORE
Block that indirectly loads the Value value in a variable.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
DataType# BYTE Data type of the selected variable
VAR_INPUT
Address DWORD UDINT DINT Address of the global variable, as its group
Depending on the
Value selection of the Value to be w ritten in the selected variable
DataType#
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the contents of the Address
variable belonging to the Group# group, as the selected DataType#.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 1724


Equipments (Devices)

Block Flowchart

Example

The example above stores the VALUE value in WORD format in address 444 of group 3
(GLOBAL_SYSTEM% C), which represents the index of the communication port Modbus TCP. The
block ends with success and ENO output is activated.

11.14.7.8.5 ISTOREBOOL
Block that indirectly loads the Value value in a bit in a global variable address.

Ladder Representation

WPS v2.5X | 1725


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Group# BYTE Group w here the variable is stored
VAR_INPUT Address DWORD UDINT DINT Address of the global variable, as its group
Bit BYTE USINT SINT Position of the bit to be modified
Value BOOL New value of the selected bit
VAR_OUTPUT ENO BOOL End of operation

Operation

When this block has a TRUE value in EN, it loads the Value value in the Bit contents of the Address
variable belonging to the Group# group.

When EN has FALSE value, Value remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1726


Equipments (Devices)

Example

The example above stores the value of VALUE in bit 7 of the address 121 in group 3
(GLOBAL_SYSTEM% C), which represents the disable command of CANopen communication. The
block ends with success and ENO output is activated.

11.14.7.8.6 MUX
Block that creates a new WORD variable from the concatenation of 16 BOOL variables.

WPS v2.5X | 1727


Equipments (Devices)

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Bit0 – Bit15 BOOL Bit of the corresponding position in the new w ord
ENO BOOL End of operation
VAR_OUTPUT
Word WORD UINT INT New w ord formed from the input bits

Operation

When this block has a TRUE value in EN, it concatenates Boolean values of the input variables and
stores this value in the variable Word. Bit0 corresponds to LSB (least significant bit) and Bit15
corresponds to the MSB (most significant bit).

When EN has FALSE value, Word remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1728


Equipments (Devices)

Example

The above example concatenates the Boolean values of the input bits of the block to form the output
word stored in MYWORD. The block ends with success and ENO output is activated.

WPS v2.5X | 1729


Equipments (Devices)

11.14.7.8.7 SEL
Block that replicates to the output the value of an input variable (Value0 or Value1) according to the
Selector selection.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Selector BOOL Variable that selects the input

VAR_INPUT BYTE USINT SINT WORD UINT


Value0 Multiplexed input number 1
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value1 Multiplexed input number 2
INT DWORD UDINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Output value selected
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it replicates to the Result variable the Value0 value if
selector is FALSE or the Value1 value if Selector is TRUE.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1730


Equipments (Devices)

Example

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated.

WPS v2.5X | 1731


Equipments (Devices)

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
FALSE level, the RESULT output gets the value of VALUE0. The block ends successfully and the
ENO output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

The above example uses the SELECTOR variable as multiplexing channel selector. When it is at
TRUE level, the RESULT output gets the value of VALUE1. The block ends successfully and the ENO
output is activated. Note that the binary pattern has been maintained even though the decimal
representation is corrupted, since DWORD does not accept negative values.

11.14.7.8.8 STORE
Block that performs direct storage of data from a source to a destination.

Ladder Representation

Block Structure

WPS v2.5X | 1732


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
SRC Data source
INT DWORD DINT DINT REAL
ENO BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
DST Data destination
INT DWORD DINT DINT REAL

Operation

When this block has a TRUE value in EN, it stores the contents from SRC into DST.

NOTE!
SRC and DST must have data types of the same size.

When EN has FALSE value, DST remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1733


Equipments (Devices)

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated.

The example above stores the value of the variable SRC in DST. The block ends with success and
ENO output is activated. Note that the binary pattern is maintained between variables of different
types.

11.14.7.8.9 USERERR
Block that generates an alarm or fault with the number programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
Error code generated
CODE WORD UINT
(750 - 799)
VAR_INPUT
Error type generated
TYPE BYTE (0 - Alarm)
(1 - Fault)
VAR_OUTPUT ENO BOOL Success in the generation of error
VAR USERERR_INST_0 USERERR Instance of access to block structure

Operation

When this block has a TRUE value in EN, it generates an alarm or equipment failure, depending on
the type defined in TYPE with CODE code.

The value of ENO informs if the generation of alarm or fault has been executed successfully.

Block Flowchart

WPS v2.5X | 1734


Equipments (Devices)

Example

The above example, when identifying TRUE level in DI1, generates a fault with the code 774 and sets
the DO1 output.

11.14.7.9 Filter
11.14.7.9.1 LOWPASS
Block that filters the input using a low pass filter of first order and inserts the result in the output.

Ladder Representation

Block Structure

WPS v2.5X | 1735


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
Input REAL Input signal
VAR_INPUT
Tau REAL Filter time constant
Ts# UINT Sampling time [ms]
ENO BOOL Output enabling
VAR_OUTPUT
Output REAL Filter output
VAR LOWPASS_INST_0 LOWPASS Instance of access to block structure

Operation

When this block has a TRUE value in EN, filters the input value of Input using a low pass first order
filter described by Tau and Ts#, inserting the result in Output. On the leading edge of EN, Output
receives zero.

When EN has FALSE value, Output remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1736


Equipments (Devices)

The above example causes OUTPUT, by identifying a leading edge in EN, to display a behavior of first
order with time constant equal to Tau and the sampling time of 2 ms, in order to achieve the reference
set to INPUT. At each calculation completed successfully, the ENO output is activated.

11.14.7.10 Logic
11.14.7.10.1 Logic Bit
11.14.7.10.1.1 RESETBIT
Logical block used to perform reset of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, resets the bit indicated in Position in the Data variable
that is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

WPS v2.5X | 1737


Equipments (Devices)

The DONE variable receives the same EN value, except when there is an error in the reset of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

Example

The example above resets the bit of AUX zero position, whose initial value is 200 (1100 1000, in
binary). Since this bit already had FALSE value, nothing has changed.

WPS v2.5X | 1738


Equipments (Devices)

The example above resets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

The example above resets the bit in position nine of AUX. Since AUX is a variable BYTE type, it has
only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.14.7.10.1.2 SETBIT
Logical block used to perform the set of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
VAR_IN_OUT Data WORD UINT INT Variable w hose bit w ill be changed
DWORD UDINT DINT
EN BOOL Block enabling
VAR_INPUT
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT DONE BOOL Operation successful

Operation

This block when it has a TRUE value in EN, sets the bit indicated in Position in the Data variable that
is forwarded to the output already with its updated value.

When EN has FALSE value, Data remains unchanged.

The DONE variable receives the same EN value, except when there is an error in the set of the bit,
then getting a FALSE value.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

WPS v2.5X | 1739


Equipments (Devices)

Block Flowchart

Example

The example above sets the bit of AUX zero position, whose initial value is 153 (1001 1001, in binary).
Since this bit already had TRUE value, nothing has changed.

The example above sets the bit in position three of AUX by changing its binary value and, therefore,
its decimal representation.

WPS v2.5X | 1740


Equipments (Devices)

The example above sets the bit in position fifteen of AUX. Since AUX is a variable BYTE type, it has
only eight bits. Thus, the example above creates a runtime error in the block and therefore the output
is not enabled.

11.14.7.10.1.3 TESTBIT
Logical block that revolutions the value of a specific bit in a field.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


BYTE USINT SINT
Data WORD UINT INT Variable w hose bit w ill be tested
DWORD UDINT DINT
VAR_INPUT
EN BOOL Block enabling
Position BYTE USINT Position of the bit that w ill be changed
VAR_OUTPUT Q BOOL Value of the tested bit

Operation

This block when it has a TRUE value in EN, sends to the output Q the bit value indicated in Position
in the Data variable.

When EN has FALSE value, Q also receives FALSE.

NOTE!
It is important to notice that Position is within the range of values of bits corresponding to variable
type in Data. For example: if Data is a BYTE, it has 8 bits, and Position must contain a value
between 0 and 7.

Block Flowchart

WPS v2.5X | 1741


Equipments (Devices)

Example

The example above sets the bit value of zero position of AUX, whose initial value is 74 (0100 1010 in
binary) to the output Q. Since this bit has value 0, the output is disabled.

The example above sets the value of the bit of position three of AUX to the output Q. Since this bit
has value 1, the output is enabled.

The example above sets the bit value of position ten of AUX to output Q. Since AUX is a variable of
BYTE type, it has only eight bits. Thus, the example above creates a runtime error in the block and
therefore the output is disabled.

WPS v2.5X | 1742


Equipments (Devices)

11.14.7.10.2 Logic Boolean


11.14.7.10.2.1 AND
Logical block that performs an boolean "and" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “and” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1743


Equipments (Devices)

Example

The example above performs an "and" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.14.7.10.2.2 NOT
Block that performs a logical operation of boolean "not" in a variable, storing the result in another.

Ladder Representation

Block Structure

WPS v2.5X | 1744


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling

VAR_INPUT BYTE USINT SINT


Value WORD UINT INT Reference variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the denied Boolean value of
the Value input variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The example above performs a boolean "not" operation in AUX, storing the result in AUX2.

WPS v2.5X | 1745


Equipments (Devices)

11.14.7.10.2.3 OR
Logical block that performs an Boolean "or" operation between two variables, storing the result in a
third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “or” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1746


Equipments (Devices)

Example

The example above performs an "or" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.14.7.10.2.4 XNOR
Logical block that performs an Boolean "not exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

WPS v2.5X | 1747


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “denied exclusive or”
Boolean operation of input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1748


Equipments (Devices)

The example above performs a "denied exclusive or" Boolean operation between AUX and AUX2,
storing the result in AUX3.

11.14.7.10.2.5 XOR
Logical block that performs an Boolean "exclusive or" operation between two variables, storing the
result in a third one.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
Value1 WORD UINT INT Variable for the operation
VAR_INPUT DWORD UDINT DINT
BYTE USINT SINT
Value2 WORD UINT INT Variable for the operation
DWORD UDINT DINT
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the “xor” Boolean operation of
input variables Value1 and Value2.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1749


Equipments (Devices)

Example

The example above performs a "xor" Boolean operation between AUX and AUX2, storing the result in
AUX3.

11.14.7.10.3 Logic Rotate


11.14.7.10.3.1 ROL
Block that performs a logical left rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1750


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical left shifts, according to the Shift value. The most significant bits
that are being discarded are returned to the least significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1751


Equipments (Devices)

Example

The above example performs a logical left shift by one position in the VALUE variable whose initial
value is -100 (1001 1100 in binary). The discarded bits on the left are reinserted on the right. The final
result (0011 1001 in binary) is stored in RESULT.

The above example performs a logical left rotation by five positions in the VALUE variable whose initial
value is 21 (0001 0101 in binary). The discarded bits on the left are reinserted on the right. The final
result (1010 0010 in binary) is stored in RESULT.

11.14.7.10.3.2 ROR
Block that performs a logical right rotation operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1752


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo rotation
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical right shifts, according to the Shift value. The least significant bits
that are being discarded are returned to the most significant bits, characterizing the rotation.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

WPS v2.5X | 1753


Equipments (Devices)

Example

The above example performs a logic right shift by one position in the VALUE variable whose initial
value is -128 (1000 0000 in binary). The discarded bits on the right are reinserted on the left. The final
result (0100 0000 in binary) is stored in RESULT. Notice that the sign is not preserved in this
operation.

The above example performs a logical right rotation by one position in the VALUE variable whose
initial value is -127 (1000 0001 in binary). The discarded bits on the right are reinserted on the left. The
final result (1100 0000 in binary) is stored in RESULT.

11.14.7.10.4 Logic Shift


11.14.7.10.4.1 ASHL
Block that performs a binary left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

WPS v2.5X | 1754


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic left shifts, according to the Shift value.

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1755


Equipments (Devices)

Description of exemple.

Description of exemple.

11.14.7.10.4.2 ASHR
Block that performs arithmetic left shift operation in a value passed by Value, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value SINT INT DINT Variable to undergo shift
Shift BYTE USINT Shift index
ENO BOOL End of operation
VAR_OUTPUT
Result SINT INT DINT Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of arithmetic right shifts, according to the Shift value.

WPS v2.5X | 1756


Equipments (Devices)

NOTE!
All arithmetic shifts implemented maintain the sign of the variable.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

The above example performs an arithmetic right shift by three positions in the VALUE variable whose
initial value is 52 (0011 0100 in binary). The bits on the right are being discarded, and on the left new
zeros are inserted. The final result (0000 0110 in binary) is stored in RESULT.

WPS v2.5X | 1757


Equipments (Devices)

The above example performs an arithmetic right shift by two positions in the VALUE variable whose
initial value is -79 (1011 0001 in binary). The bits on the right will be discarded and new ones on the
left are inserted, since the arithmetic right shifts preserve the sign of the variable. The final result
(1111 0110 in binary) is stored in RESULT.

The above example performs an arithmetic right shift by thirteen positions in the VALUE variable
whose initial value is -128 (1000 0000 in binary). The bits on the right are being discarded, and on the
left new ones are inserted. The final result (1111 1111 in binary) is stored in RESULT.

11.14.7.10.4.3 SHL
Block that performs a binary logical left shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 1758


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts left, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1759


Equipments (Devices)

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is 56 (0011 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (0011 1000 0000 in binary) is stored in RESULT.

The above example performs a logical right shift by four positions in the VALUE variable whose initial
value is -56 (1100 1000 in binary). The bits on the left are being discarded, and on the left new zeros
are inserted. The final result (1100 1000 0000 in binary) is stored in RESULT. Since RESULT is SINT
type, it only accepts the first eight bits (1000 0000).

11.14.7.10.4.4 SHR
Block that performs a binary logical right shift operation in a value passed by Value, storing the result
in Result.

Ladder Representation

Block Structure

WPS v2.5X | 1760


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT
VAR_INPUT Value WORD UINT INT Variable to undergo shift
DWORD UDINT DINT
Shift BYTE USINT Shift index
ENO BOOL End of operation

VAR_OUTPUT BYTE USINT SINT


Result WORD UINT INT Variable that stores the result of the operation
DWORD UDINT DINT

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of the Value variable
after performing a number of logical shifts right, according to the Shift value.

When EN has FALSE value, Result remains unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

Block Flowchart

Example

WPS v2.5X | 1761


Equipments (Devices)

The above example performs a logical right shift by two positions in the VALUE variable whose initial
value is 124 (0111 1100 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 1111 in binary) is stored in RESULT.

The above example performs a logical right shift by three positions in the VALUE variable whose initial
value is -98 (1001 1110 in binary). The bits on the right are being discarded, and on the left new zeros
are inserted. The final result (0001 0011 in binary) is stored in RESULT.

11.14.7.11 Math
11.14.7.11.1 Math Basic
11.14.7.11.1.1 ABS
Block that calculates the Value module, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the absolute value of the

WPS v2.5X | 1762


Equipments (Devices)

Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the absolute value of the VALUE variable whose initial value is -45,
storing the final result, 45, in RESULT.

The above example calculates the absolute value of the VALUE variable whose initial value is -45. The
final result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by
SINT type. Therefore, RESULT remains unchanged and the output is disabled.

WPS v2.5X | 1763


Equipments (Devices)

11.14.7.11.1.2 ADD
Block that calculates the sum of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First addend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second addend of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sum of Value1 and Value2
variables. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1764


Equipments (Devices)

Example

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT.

The above example calculates the sum of VALUE 1 and VALUE2 variables, storing the final result in
RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1765


Equipments (Devices)

The above example calculates the sum of VALUE1 and VALUE2 variables. The final result -170
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.14.7.11.1.3 DIV
Block that calculates the division of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the division of Value1 and
Value2 variables. The value stored will be the exact division if Result is REAL, or, in other cases, only
the quotient. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1766


Equipments (Devices)

Example

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is of REAL type, the exact value of the division is stored in it.

WPS v2.5X | 1767


Equipments (Devices)

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since RESULT is SINT type, only the quotient is stored in it. Notice that the block
accepts arguments of both signs.

The above example calculates the division of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains unchanged
and the output is disabled.

11.14.7.11.1.4 MOD
Block that calculates the remainder of the values of Value1 and Value2, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Dividend of the operation
VAR_INPUT INT DWORD UDINT DINT
BYTE USINT SINT WORD UINT
Value2 Divisor of the operation
INT DWORD UDINT DINT
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT operation

Operation

WPS v2.5X | 1768


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the remainder of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

WPS v2.5X | 1769


Equipments (Devices)

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the remainder of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Since VALUE2 is zero, the block generates a runtime error, RESULT remains
unchanged and the output is disabled.

11.14.7.11.1.5 MUL
Block that calculates the multiplication of the values of Value1 and Value2, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First factor of the operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second factor of the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

WPS v2.5X | 1770


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the multiplication of Value1
and Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT.

WPS v2.5X | 1771


Equipments (Devices)

The above example calculates the product of VALUE 1 and VALUE2 variables, storing the final result
in RESULT. Notice that the block accepts arguments of both signs.

The above example calculates the product of VALUE1 and VALUE2 variables. The final result 224
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.14.7.11.1.6 NEG
Block that calculates the opposite (i.e., the product with -1) of a value passed by Value, storing the
result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT BYTE USINT SINT WORD UINT
Value Reference variable for the operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the opposite of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1772


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the opposite of the VALUE variable whose initial value is 21, storing
the final result, -21, in RESULT.

The above example calculates the opposite of the VALUE variable whose initial value is -56, storing
the final result, 56, in RESULT.

WPS v2.5X | 1773


Equipments (Devices)

The above example calculates the opposite of the VALUE variable whose initial value is -128. The final
result, 128, cannot be stored in RESULT, because it is outside the limits of accepted values by SINT
type. Therefore, RESULT remains unchanged and the output is disabled.

11.14.7.11.1.7 SUB
Block that calculates the subtraction between the Value1 and Value2 values, storing the result in
Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 Minuend of operation
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Subtrahend of operation
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT Variable that stores the result of the
Result
INT DWORD UDINT DINT REAL operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the subtraction of Value1 and
Value2 variables. If no errors, the Done variable is set. If there is any error in the operation, Done is
not set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1774


Equipments (Devices)

Example

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT.

The above example calculates the subtraction of VALUE 1 and VALUE2 variables, storing the final
result in RESULT. Notice that the block accepts arguments of both signs.

WPS v2.5X | 1775


Equipments (Devices)

The above example calculates the subtraction of VALUE1 and VALUE2 variables. The final result 141
cannot be stored in RESULT, because it is outside the limits of accepted values by SINT type.
Therefore, RESULT remains unchanged and the output is disabled.

11.14.7.11.2 Math Extended


11.14.7.11.2.1 ALOG10
Block that calculates the antilogarithm (exponent with base 10) of the Value value, storing the result
in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the antilogarithm of the Value
variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1776


Equipments (Devices)

Example

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the minimum input value for which the block revolutions a nonzero
result. The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in

WPS v2.5X | 1777


Equipments (Devices)

RESULT. Below the minimum values cause the block to return a null value. The block ends with
success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. The indicated value is the maximum input value for which the block revolutions a valid result.
The block ends with success and Done output is activated.

The above example calculates the antilogarithm of the VALUE variable, storing the final result in
RESULT. Values higher than the maximum cause the block to generate an error, the RESULT output
remains unchanged and Done output is disabled.

11.14.7.11.2.2 EXP
Block that calculates the exponential of the Euler number "and" raised to the value of Value, storing
the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the exponent of the Euler
number "and" raised to the Value variable. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1778


Equipments (Devices)

Block Flowchart

Example

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the minimum input value for which the block revolutions a nonzero result. The
block ends with success and Done output is activated.

WPS v2.5X | 1779


Equipments (Devices)

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values below the minimum cause the block to return to a null value. The block ends with success
and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
The indicated value is the maximum input value for which the block revolutions a valid result. The
block ends with success and Done output is activated.

The above example calculates the exponent of the VALUE variable, storing the final result in RESULT.
Values higher than the maximum cause the block to generate an error, the RESULT output remains
unchanged and Done output is disabled.

11.14.7.11.2.3 LN
Block that calculates the natural logarithm of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the natural logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

WPS v2.5X | 1780


Equipments (Devices)

Block Flowchart

Example

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the natural logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has value zero, and Done output is
disabled.

WPS v2.5X | 1781


Equipments (Devices)

11.14.7.11.2.4 LOG10
Block that calculates the common logarithm (base 10) of the Value value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the common logarithm of the
Value variable. If no errors, the Done variable is set. If there is any error in the operation, Done is not
set, staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1782


Equipments (Devices)

Example

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the common logarithm of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.14.7.11.2.5 POW
Block that calculates the value of Value raised to the exponent Power, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT Value REAL Base of the operation
Power REAL Exponent of the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to
the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done
is not set, staying in FALSE status, while Result remains with its value unchanged.

WPS v2.5X | 1783


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

WPS v2.5X | 1784


Equipments (Devices)

The above example calculates the value of VALUE raised to the POWER variable, storing the final
result in RESULT. Since the result is higher than the maximum supported by REAL type, the block
generates an error and Done output is disabled.

11.14.7.11.2.6 ROUND
Block that rounds the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the rounded value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1785


Equipments (Devices)

Example

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals less than 0.5 are discarded. The block ends with success and Done output is activated.

The above example rounds the value of the VALUE variable, storing the final result in RESULT.
Decimals greater than or equal to 0.5 promote unity value immediately above. The block ends with
success and Done output is activated.

11.14.7.11.2.7 SQRT
Block that calculates the square root value of Value, storing the result in Result.

Ladder Representation

WPS v2.5X | 1786


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the square root value of
Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set,
staying in FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1787


Equipments (Devices)

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block ends with success and Done output is activated.

The above example calculates the square root value of the VALUE variable, storing the final result in
RESULT. The block generates a runtime error, since VALUE has negative value, and Done output is
disabled.

11.14.7.11.2.8 TRUNC
Block that truncates the value of Value, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Reference variable for the operation
Done BOOL End of operation
VAR_OUTPUT Variable that stores the result of the
Result REAL
operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the truncated value of Value. If
no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Compatibility

WPS v2.5X | 1788


Equipments (Devices)

Device Version
PLC300 2.10 or higher
SCA06 2.00 or higher

Block Flowchart

Example

The above example truncates the value of the VALUE variable, storing the final result in RESULT.
Decimals are discarded. The block ends with success and Done output is activated.

11.14.7.11.3 Math Trigonometry


11.14.7.11.3.1 ACOS
Block that calculates the arccosine of Value, storing the result in Angle.

Ladder Representation

Block Structure

WPS v2.5X | 1789


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of cosine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose cosine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arccosine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1790


Equipments (Devices)

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the
final result in RESULT. The block generates a runtime error, since VALUE has value inferior to 1, and
Done output is disabled.

11.14.7.11.3.2 ASIN
Block that calculates the arcsine of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of sine
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose sine is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arcsine of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1791


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose sine is the VALUE variable, storing the final
result in RESULT. The block generates a runtime error, since VALUE has value superior to 1, and
Done output is disabled.

WPS v2.5X | 1792


Equipments (Devices)

11.14.7.11.3.3 ATAN
Block that calculates the arctangent of Value, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Value REAL Value of tangent
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to Value (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1793


Equipments (Devices)

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for positive values, is always in the first quadrant. The block ends with
success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the
final result in RESULT. The arc, for negative values, is always in the fourth quadrant. The block ends
with success and Done output is activated.

11.14.7.11.3.4 ATAN2
Block that calculates the arctangent of Y/X, storing the result in Angle.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT X REAL Parameter X of the function
Y REAL Parameter Y of the function
Done BOOL End of operation
VAR_OUTPUT
Angle REAL Value of the angle w hose tangent is equal to (Y/X) (in radians)

Operation

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Y/X. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Angle remains with its value unchanged.

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1794


Equipments (Devices)

Example

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and Y, is always in the first quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final

WPS v2.5X | 1795


Equipments (Devices)

result in RESULT. The arc, for negative values of X and positive values of Y, is always in the second
quadrant. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for negative values of X and Y, is always in the third quadrant. The block
ends with success and Done output is activated.

The above example calculates the arc, in radians, whose tangent is the Y/X variable, storing the final
result in RESULT. The arc, for positive values of X and negative values of Y, is always in the fourth
quadrant. The block ends with success and Done output is activated.

11.14.7.11.3.5 COS
Block that calculates the cosine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the cosine of Angle. If no

WPS v2.5X | 1796


Equipments (Devices)

errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the cosine of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1797


Equipments (Devices)

11.14.7.11.3.6 SIN
Block that calculates the sine of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

When this block has a TRUE value in EN, it sends to the Result output the sine of Angle. If no errors,
the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE
status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1798


Equipments (Devices)

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts negative input values.

The above example calculates the sine of the VALUE variable, interpreted in radians, storing the final
result in RESULT. The block ends with success and Done output is activated. Notice that the block
accepts values greater than one full turn.

11.14.7.11.3.7 TAN
Block that calculates the tangent of Angle, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT
Angle REAL Angle (in radians)
Done BOOL End of operation
VAR_OUTPUT
Result REAL Variable that stores the result of the operation

Operation

WPS v2.5X | 1799


Equipments (Devices)

When this block has a TRUE value in EN, it sends to the Result output the tangent of Angle. If no
errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in
FALSE status, while Result remains with its value unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

Example

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the tangent of the VALUE variable, interpreted in radians, storing the
final result in RESULT. The block ends with success and Done output is activated. Notice that the
block accepts negative input values and greater than one turn.

WPS v2.5X | 1800


Equipments (Devices)

11.14.7.11.4 Math Util


11.14.7.11.4.1 MAX
Block that compares the values of Value1 and Value2 and stores the highest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Highest of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the highest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1801


Equipments (Devices)

Example

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1802


Equipments (Devices)

The above example calculates the maximum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is higher than the maximum supported by SINT type, the
block generates an error and Done output is disabled.

11.14.7.11.4.2 MIN
Block that compares the values of Value1 and Value2 and stores the lowest of them in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value1 First value of comparison
VAR_INPUT INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Value2 Second value of comparison
INT DWORD UDINT DINT REAL
Done BOOL End of operation
VAR_OUTPUT BYTE USINT SINT WORD UINT
Result Low est of the values compared
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it sends to the Result output the lowest value in the
comparison between Value1 and Value2. If no errors, the Done variable is set. If there is any error in
the operation, Done is not set, staying in FALSE status, while Result remains with its value
unchanged.

When EN has FALSE value, Result remains unchanged and Done remains in FALSE.

Block Flowchart

WPS v2.5X | 1803


Equipments (Devices)

Example

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. The block ends with success and Done output is activated. Notice that the
types of the input variables can be different without causing execution problems.

WPS v2.5X | 1804


Equipments (Devices)

The above example calculates the minimum value between VALUE 1 and VALUE2 variables, storing
the final result in RESULT. Since the result is lower than the minimum supported by SINT type, the
block generates an error and Done output is disabled.

11.14.7.11.4.3 SAT
Block that performs a routine for saturation of the value found in Value in accordance with the limits
for Minimum and Maximum, storing the result in Result.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
BYTE USINT SINT WORD UINT
Value Reference value
INT DWORD UDINT DINT REAL
VAR_INPUT BYTE USINT SINT WORD UINT
Minimum Inferior saturation value
INT DWORD UDINT DINT REAL
BYTE USINT SINT WORD UINT
Maximum Superior saturation value
INT DWORD UDINT DINT REAL
Indicator that there w as saturation in the
Q BOOL
process
VAR_OUTPUT
BYTE USINT SINT WORD UINT
Result Result of operation
INT DWORD UDINT DINT REAL

Operation

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and
Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of
Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q
receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If
there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with
its value unchanged.

WPS v2.5X | 1805


Equipments (Devices)

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

Block Flowchart

Example

WPS v2.5X | 1806


Equipments (Devices)

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or
higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no
saturation.

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The
block ends successfully and the Q output is activated, since there was saturation.

WPS v2.5X | 1807


Equipments (Devices)

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM.
The block ends successfully and the Q output is activated, since there was saturation.

11.14.7.12 Module
11.14.7.12.1 USERFB
Block that performs a subroutine programmed by the user.

Ladder Representation

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
VAR_INPUT According to user
INPUT Block inputs
programming
ENO BOOL End of operation
VAR_OUTPUT According to user
OUTPUT Block outputs
programming
According to user
VAR_IN_OUT IN_OUT Block inputs/outputs
programming
VAR MYUSERFB_INST_0 MYUSERFB Instance of access to block structure

Operation

When this block has a TRUE value in EN, it updates the values of internal fields with the input
variables, performs the Ladder routine programmed by the user and updates the values of the outputs
after completing routine.

When EN has FALSE value, outputs remain unchanged.

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

WPS v2.5X | 1808


Equipments (Devices)

NOTE!
Refer to section Working with USERFBs for further information.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

11.14.7.13 Timer
11.14.7.13.1 TOF
Timer block that, when energized, disables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 1809


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output deactivating
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TOF_INST_0 TOF Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is TRUE, the Q output is also TRUE and ET also receives the value zero.
On the negative transition edge in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state FALSE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1810


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1811


Equipments (Devices)

Example

The above example disables the DO1 output to identify a low level in DI1 for 12 seconds, remaining
disabled until DI1 again be TRUE.

11.14.7.13.2 TON
Timer block that, when energized, enables the output after a delay set by PT.

Ladder Representation

Block Structure

WPS v2.5X | 1812


Equipments (Devices)

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Delay of output drive
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TON_INST_0 TON Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

While the IN input is FALSE, the Q output is FALSE and ET also receives the value zero.
On the edge positive transition in IN, counting is triggered and ET is incremented according to
TIMEBASE. When ET equals PT, the Q output goes to state TRUE until IN revolutions to FALSE.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1813


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1814


Equipments (Devices)

Example

The above example shows the initial conditions of the block and of the routine variables.

When activated the IN input, counting is triggered. Since ET equals PT, the Q output is enabled.

Note that a change in PRESET variable is not forwarded to the PT field while the IN entry remains
enabled.

WPS v2.5X | 1815


Equipments (Devices)

Disabling the IN input, the value of PT is updated and the Q output is disabled. When activating it
again, counting is triggered.

Disabling the IN input, the value of ET remains saved.

Enabling the IN input, the value of ET is reset and counting is triggered.

When ET reaches the value PT, the Q is output enabled and remains so while IN is at TRUE level.

11.14.7.13.3 TP
Timer block that, when identifies it is energized, enables the output after a delay set by PT.

Ladder Representation

WPS v2.5X | 1816


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


IN BOOL Block enabling
WORD UINT
VAR_INPUT PT Time w hile the output is enabled
DWORD UDINT
TIMEBASE WORD Time base for PT and ET
Q BOOL Block output
VAR_OUTPUT WORD UINT
ET Counter elapsed time
DWORD UDINT
VAR TP_INST_0 TP Instance of access to block structure

NOTE!
In CFW300, the PT e ET fields can only be WORD ou UINT type.

Operation

On the edge positive transition in IN, Q receives TRUE value, counting is triggered and ET is
incremented according to TIMEBASE. When ET equals PT, the Q output goes to state FALSE until
IN revolutions to FALSE. At that moment, if IN is at TRUE level, nothing happens. On the edge
positive transition in IN, ET is automatically reset.

Compatibility

Device Version
PLC300 1.50 or higher
SCA06 2.00 or higher

Block Flowchart

WPS v2.5X | 1817


Equipments (Devices)

Operation Diagram

WPS v2.5X | 1818


Equipments (Devices)

Example

The above example enables the DO1 output for six seconds at each DI1 positive transition.

11.14.7.14 RTC
11.14.7.14.1 INTIME
Block that performs a programmed enabling for a time based on RTC (Real Time Clock).

Ladder Representation

Block Structure

WPS v2.5X | 1819


Equipments (Devices)

Variable Type Name Data Type Description


EN BOOL Block enabling
TIMEON_HOUR WORD UINT Enabling hour
TIMEON_MINUTE WORD UINT Enabling minute
TIMEON_SECOND WORD UINT Enabling second
VAR_INPUT
TIMEOFF_HOUR WORD UINT Disabling hour
TIMEOFF_MINUTE WORD UINT Disabling minute
TIMEOFF_SECOND WORD UINT Disabling second
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled when the internal clock's time is equal to that defined by the parameters TIMEON and
disabled when the internal clock's time is equal to the parameters set by TIMEOFF. If Q_OPTION# is
Inverted, Q is disabled when the internal clock's time is equal to that defined by the parameters
TIMEON and enabled when the internal clock's time is equal to the parameters set by TIMEOFF.

When EN has FALSE value, Q remains FALSE.

Block Flowchart

WPS v2.5X | 1820


Equipments (Devices)

Example

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is lower than the registered enabling
inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is disabled.

WPS v2.5X | 1821


Equipments (Devices)

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
enabling inputs of the block (HOUR_ON, MINUTE_ON and SECOND_ON). This way, the Q output is
disabled.

In the above example, the INTIME block is disabled. This way, regardless of the input, the Q output is
disabled.

WPS v2.5X | 1822


Equipments (Devices)

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is equal to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). This way, the Q
output is enabled.

In the example above, the INTIME block is enabled, the Q_OPTION# input is enabled for NORMAL
operation and the current time of the internal clock of the device is superior to the registered in the
disabling inputs of the block (HOUR_OFF, MINUTE_OFF and SECOND_OFF). Thus, the Q output is
disabled.

11.14.7.14.2 INWEEKDAY
Block that performs a programmed enabling for weekdays based on RTC (Real Time Clock).

Ladder Representation

WPS v2.5X | 1823


Equipments (Devices)

Block Structure

Variable Type Name Data Type Description


EN BOOL Block enabling
SUNDAY# BOOL Enabled on Sundays
MONDAY# BOOL Enabled on Mondays
TUESDAY# BOOL Enabled on Tuesdays
VAR_INPUT WEDNESDAY# BOOL Enabled on Wednesdays
THURSDAY# BOOL Enabled on Thursdays
FRIDAY# BOOL Enabled on Fridays
SATURDAY# BOOL Enabled on Saturdays
Q_OPTION# BYTE Output operation
VAR_OUTPUT Q BOOL Block output

Operation

When this block has a TRUE value in EN, it has two modes of operation. If Q_OPTION# is Normal, Q
is enabled if the day of week of the internal clock has Enabled parameter in the block. If Q_OPTION#
is Inverted, Q is disabled if the day of week of the internal clock has Enabled parameter in the block.

When EN has FALSE value, Q remains FALSE.

NOTE!
The weekdays are identified by numbers, with Sunday being day 0 and Saturday day 6.

Block Flowchart

WPS v2.5X | 1824


Equipments (Devices)

Example

WPS v2.5X | 1825


Equipments (Devices)

In the above example, the INWEEKDAY block is disabled. This way, regardless of the input, the Q
output is disabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Wednesday (value
3), which has ENABLED status in the programming. This way, the Q output is enabled.

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
NORMAL operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. Thus, the Q output is disabled.

WPS v2.5X | 1826


Equipments (Devices)

In the example above, the INWEEKDAY block is enabled and Q_OPTION# input is enabled for
INVERTED operation. The current day of the week of the device's internal clock is Thursday (value 4),
which has DISABLED status in the programming. This way, the Q output is enabled.

11.14.7.15 Structures
Structure is a data grouping used to define a recipe or an object.

In the Ladder program, it is possible to create variables of the structure type and use them in the blocks. To
access the internal members of the structure, the '.' is used followed by its respective member.

Creating a structure

1. With the right button of the mouse on the folder Structure, click on New file.

Figure 1: Creating a structure

2. Define the file name and press the Next button.

WPS v2.5X | 1827


Equipments (Devices)

Figure 2: Defining the structure name

3. Configure the structure using the buttons presented in the figure below.

Figure 3: Editing the Structure

4. After finishing the edition of the structure, click on the button Finish.

WPS v2.5X | 1828


Equipments (Devices)

Figure 4: Structure created in the project

Editing a structure

Just double click on the desired structure, as shown in figure 4, and a window will open as shown in figure 3,
allowing to insert new data, erase or move the position of the data.

11.14.8Communication
11.14.8.1 Force I/O
Overview

The force inputs and outputs window is used for the values of the digital and analog inputs to be read by the
program, by values manipulated by the user, regardless their physical state. It also allows the manipulation of
the physical states of the digital and analog outputs by the user independently of the values calculated by the
program.
In order to force the device inputs and outputs, it is necessary that the online monitoring be active and the
option Run cyclically be enabled. The data are sent to the device every 2 seconds.
The values can be edited with the device disconnected. The configurations are stored in the resources and
recorded whenever the main resource selection is changed.
The data displayed on the force I/O window contain the values belonging to the resource (and configuration)
selected as main.

The force I/O window is open trough the menu Online > Force I/O:

WPS v2.5X | 1829


Equipments (Devices)

Toolbar

The toolbar of the force window has the options to run cyclically, upload the device force configuration, enable
all and disable all:
Run cyclically: Sends the user's configurations to the device and updates the state of the inputs and
outputs in a cyclic way.
Upload configuration: Allows the current configuration of the device to be read. For this option to be
enabled, it is necessary that the online monitoring be active and the option run cyclically be disabled.
Enable all: Enables the force I/O of all of the inputs and outputs of the device.
Disable all: Disables the force I/O of all of the inputs and outputs of the device.

Input and Output commands

For each digital and analog input and output there is a selection box linked to enable the force, a status field
and an edition field.

Digital:

1. Number of the digital inputs/output


2. Enable/disable Force I/O

WPS v2.5X | 1830


Equipments (Devices)

3. Current status of the I/O: It has three statuses: 1. light green LED: activated; 2. dark green LED:
deactivated; 3. gray LED: the value is not being read.
4. Enable/disable the input/output

Analog:

1. Number of the analog input/output


2. Enable/disable Force I/O
3. Current value of the input/output
4. Value of the input/output configured by the user

NOTE!
The analog signal scale has 15 bits plus 1 bit for signal, except for SSW900 which it has only 10
unsigned bits.

WPS v2.5X | 1831


WComm

12 WComm
12.1 Introduction

The WComm (Communication Manager) configures the communication channels of the USB interfaces,

communication ports (COM) and Ethernet, providing such connections via Modbus TCP protocol and data

access via FTP for access through other applications.

WPS v2.5X | 1832


WComm

WPS v2.5X | 1833


WComm

12.2 Configuration
12.2.1 Menus
The WComm offers the configuration options available in this menu:

Menu File:
Option to activate or deactivate the communication with the applications (standard: active);
Configuration… presents a dialogue box with options.

The dialogue box has the options: Communication, Miscellaneous and FTP Config.

Communication
- Checkbox: when checked, it enables the WComm for remote connection via TCP/IP;
- Port Number: number of the TCP/IP communication port the WComm uses for communication with
applications that communicate with the devices through it;
- IP Authentication: list of the IP addresses that can access the WComm . An empty list indicates that any IP
address can access the WComm .

WPS v2.5X | 1834


WComm

Miscellaneous
- Language: allows selecting the language of the WComm from the options available in the menu.

WPS v2.5X | 1835


WComm

FTP Config
The FTP server (File Transfer Protocol) allows the files contained in the PLC300 SD card to be handled by
an FTP client. In order to start the FTP server, see the information below:
- Host: presents the hostname to access the FTP service;
- Button to enable or disable the FTP service (default: disabled);
- Button to modify the administrator's password.

- FTP Status:
The image below presents the FTP service enabled (Enable button pressed):

WPS v2.5X | 1836


WComm

- Modify the administrator's password:


This function will be only available when the FTP service is enabled, after clicking on the button to change the
password.
Enter: current password, new password, retype the new password.

WPS v2.5X | 1837


WComm

NOTE: The FTP service will be available using any FTP client.
- Hostname: indicated in the window above as "BR08080808".
- Port: 2221.
- Username: admin.
- Password: default: weg, or defined by the user.

Other configurations of the FTP service will be available in the Configuration File.

12.2.2 Quickstart Guide for FTP


The first step is to install the WPS, using the installer file available at http://www.weg.net.
Copy the folder name where WPS was installed (usually C:\WEG\WPS 2.50\ )

WComm is a WPS's module and its standard configuration allows to access PLC300 device through USB
port, giving access since root folder /PLC300/ on SD Card (connected to PLC300).

The FTP service starts enabled, because of that is necessary to activate it at first use: the instructions are
available in session Configuration.

Once enabled, the WComm's FTP service uses the standard configuration.
To change the configuration, please follow the steps below.

If the WComm's configuration file was damaged/corrupted during edition, it may be necessary to uninstall and
reinstall WPS.
Thus, if necessary to change configuration file, it is recommended to only change the connection type line.
Leave another changes to a next file edition.

WPS v2.5X | 1838


WComm

Changing the connection type.

- Using an regular text editor (Notepad), edit the configuration file located in folder where WPS is installed,
usually C:\WEG\WPS 2.50\wps\modules\gateway\conf\users.properties.

- In WComm, click the button to check communication, making sure that PLC300 is accessible:

- Select and copy the connection type line as shown in image above (text in blue highlight).

- In users.properties file, change the connection´s variable, changing by text copied in previous step:
From: ftpserver.user.admin.connection=USB/@0
To: ftpserver.user.admin.connection=Ethernet/Modbus-TCP/192.168.0.10\:502/@1
This instruction sets the communication type will be used to access the FTP service when logged as
administrator (admin).
There are samples in configuration file for all possibilities of connections: USB, Serial and Ethernet.
These samples starts with character #, therefore changing it does not affects the software operation (since
the # character being kept at line start).

- Save changes in users.properties file.

- Close * the WPS.

- After that, open * WPS. It will load the WComm new configuration.

Accessing data.

WPS v2.5X | 1839


WComm

- WComm module has two user profiles:


admin - permission to read and write on SD Card. Can create, read and delete files and folders.
anonymous - read only permission on files at SD Card.
- Restrictions:
It is not possible to execute (open) files directly from SD Card: it is necessary to copy file to a local folder
an then is possible to execute it from local folder.
It is not possible to multi select files and folders: to transfer files and folders, please copy one at a time.

- Be sure that PLC300 is communicating with WComm (check corresponding connection).

- Access the FTP service as admin user:


Access file explorer ("My Computer") from Operational System.
Click on address bar, changing the selection "This Computer" for ftp://admin@localhost:2221. Press
Enter.
Type user: admin and password: weg when requested in a login window.
The SD Card content will be shown. If there is no SD Card in PLC300 the system shows an error.

Also is possible to login as anonymous user. To do that, please follow steps above, using the folder ftp://
anonymous@localhost:2221.

Disabling and Enabling users.

- Using an regular text editor (Notepad), edit the configuration file located in folder where WPS is installed,
usually C:\WEG\WPS 2.50\wps\modules\gateway\conf\users.properties.

- In users.properties file, change the variable ftpserver.user.anonymous.enableflag, changing the value as


shown:
From: ftpserver.user.anonymous.enableflag=true
To: ftpserver.user.anonymous.enableflag=false
This instruction enables (true) or disables (false) the user anonymous.
Not only anonymous, but also admin can be changed, though it is not recommended.

- Save changes in users.properties file.

- Close * the WPS.

- After that, open * WPS. It will load the WComm new configuration.

Changing root folder.

- Using an regular text editor (Notepad), edit the configuration file located in folder where WPS is installed,
usually C:\WEG\WPS 2.50\wps\modules\gateway\conf\users.properties.

- In users.properties file, change the variable ftpserver.user.admin.homedirectory, changing the value by


the new path, as follows:
From: ftpserver.user.admin.homedirectory=/PLC300/
To: ftpserver.user.admin.homedirectory=/PLC300/0001/
This instruction ftpserver.user.admin.homedirectory changes the root folder available by FTP service
when logged as admin user.

- It is also possible to change this configuration for anonymous user. To use the same path as shown in

WPS v2.5X | 1840


WComm

sample above, the configuration should be:


From: ftpserver.user.anonymous.homedirectory=/PLC300/
To: ftpserver.user.anonymous.homedirectory=/PLC300/0001/

- Save changes in users.properties file.

- Close * the WPS.

- After that, open * WPS. It will load the WComm new configuration.

Changing the password.

- Informations about the procedure to change password (and another configurations) are available in chapter
Configuration.

NOTE!
* It is possible to execute just the WComm module, which is available at the WPS's install folder,
usually at C:\WEG\WPS 2.50\wps\modules\gateway\CommunicationGateway.exe.
At this condition, when necessary to close the WComm, click the right mouse button over icon

in systray and select the option to close.

12.2.3 Configuration File

The FTP service configuration file allows customizing the following data:

Read-only or read and write permission for administrator user;


FTP default path: the initial path that will be displayed on the FTP client after the access;
Type of communication with the resource: indicate the communication form between the WComm and the
resource. Such information is available in the communication port selection, which must be selected and
copied, as shown in the following images:

WPS v2.5X | 1841


WComm

Serial

USB

WPS v2.5X | 1842


WComm

Ethernet

The configuration file name is users.properties, available in folder (...)/wps/modules/gateway/conf/ of the


WPS.

Configuration file structure with example information (setting up anonymous and admin profiles):

WPS v2.5X | 1843


WComm

#Generated file - don't edit (please)


#Fri May 12 15:35:59 BRT 2017
ftpserver.user.anonymous.idletime=0 Time (in s) for automatic disconnection of
the FTP.
Default: 0 (without automatic disconnection -
recommended)
ftpserver.user.anonymous.enableflag=true Enable anonymous user?
Default: true (enabled), false (disabled).
ftpserver.user.anonymous.homedirectory=/PLC300/0001/ Path to the SD Card files that will be the root
folder in the FTP server. Default: /
ftpserver.user.anonymous.connection=USB/@0 Connection to the resource when accessing
an FTP with an anonymous user.
ftpserver.user.admin.writepermission=true Read/write permission for admin user, where:
true: read and write to the SD Card; false: read-
only.
ftpserver.user.admin.idletime=0 Time (in s) for automatic disconnection of
the FTP.
Default: 0 (without automatic disconnection -
recommended)
ftpserver.user.admin.enableflag=true Enable admin user?
Default: true (enabled), false (disabled).
ftpserver.user.admin. Password in encrypted format.
userpassword=XXXXXXXXXXXXXXXXXXXXXXXXXX Do not change *
ftpserver.user.admin.homedirectory=/PLC300/ Path to the SD Card files that will be the root
folder in the FTP server. Default: /
ftpserver.user.admin.connection=USB/@0 Connection to the resource when accessing
an FTP with an admin user.
#ftpserver.user.admin.connection=USB/@0 Example of USB connection to the resource
through the admin FTP user.
#ftpserver.user.admin.connection=Serial/COM1/Modbus- Example of RS232 Serial connection to the
RTU/@1 resource, via COM1, (admin FTP user).
#ftpserver.user.admin.connection=Ethernet/Modbus- Example of Ethernet connection to the
TCP/192.168.0.10\:502/@1 resource, via IP 192.168.0.10, port 502 and Unit
Id 1, (admin FTP user).

NOTE: Additional information to configure WComm, in a first utilization to read SD Card data, is
available in Quickstart Guide for FTP.

NOTE: Any change in this file requires the reset of the WPS in order to implement the new
configuration of WComm module.
* Changing the password in the users.properties file compromises the access of the user to
the application FTP service.

WPS v2.5X | 1844


WComm

12.3 Add/Remove Connections

In order to add a new connection, select one of the available connections: Communication Ports (COM),
USB and Ethernet.

Communication Port (COM):

Expand the “Communication Ports (COM)” item.

In case the COM port is not listed, select “Manage Serial Ports” in the “Communication Port” item, and
choose the used port.

Change the baud rate, data bits, stop bits and parity settings according to the equipment configuration.

Select the communication protocol (Modbus-RTU);


Configure the Modbus-RTU protocol:

WPS v2.5X | 1845


WComm

Transmission delay(ms): waits for this time before sending the next telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Response delay (ms): waits for this time before trying to receive the response from the sent
telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Timeout (ms): waits for this time before indicating that the response was not
received.
- Adjustable range: 100 ... 20000;
- Default: 5000.

Click on the New connection… button:


- Select the slave address for the new connection according to the equipment configuration.

USB Interface

Expand the USB item.


Configure the USB interface:
Transmission delay(ms): waits for this time before sending the next telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Response delay (ms): waits for this time before trying to receive the response from the sent
telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Timeout (ms): waits for this time before indicating that the response was not
received.
- Adjustable range: 100 ... 20000;
- Default: 1000.

Click on the New connection… button.

Ethernet

WPS v2.5X | 1846


WComm

Expand the Ethernet item.


Select the communication protocol (Modbus-TCP).
In case the IP address is not listed, select the port with the New Connection option in the “Modbus-TCP”
item, and configure the connection.

Description: Connection description to be displayed.


IP Address: Address configured in the Modbus-TCP slave device.
TCP Port: Number of the port used for the communication with the Modbus-TCP slave (Default 502).
Unit ID: Modbus-TCP slave address.

Configure the connection times:


Transmission delay(ms): waits for this time before sending the next telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Response delay (ms): waits for this time before trying to receive the response from the sent
telegram.
- Adjustable range: 0 ... 20000;
- Default: 0.

Timeout (ms): waits for this time before indicating that the response was not received.
- Adjustable range: 100 ... 20000;
- Default: 5000.

Click on the New connection… button.


Select the slave address for the new connection according to the equipment configuration.

WPS v2.5X | 1847


Index -R-
Resource; Equipament 120

-A- -S-
At; Direct Representation 120 SD Card 1160
setup 1136, 1137, 1138, 1139, 1140, 1141
-C-
-T-
Cam Table Select 1432, 1437, 1439, 1441
Config; Configuration 120 Task 120
configuration 1136, 1137, 1138, 1139, 1140, 1141
-U-
-D-
upload 1157
Data Type 120
download 1147 -V-
-F- Variable 120

files 1160 -W-


force I/O 399, 626, 1145, 1829
Function; Function Block 120 Watchdog 121
Functional Block 120

-M-
MC_CamTableSelect 1432, 1437, 1439, 1441
MC_Power 1446
MC_Reset 1449, 1451, 1455, 1457, 1462, 1465,
1466, 1469, 1470, 1473, 1477, 1480, 1483, 1489, 1495
modbus 1160

-O-
----OLD_KEYWORDS----files 1160
online commands 1142

-P-
Program; Application 120

WPS v2.5X | 1848

You might also like