Вы находитесь на странице: 1из 545

VisiLogic Software Manual V330

V230-21-G23 Rev: 3.30, 8/03


Table Of Contents
Welcome to VisiLogic ................................................................................................................ 1
Program Editors ..................................................................................................................... 1
Ladder Modules and Subroutines .......................................................................................... 1
Hardware Configuration ......................................................................................................... 1
Project Explorer...................................................................................................................... 1
Operand View and Watch Folders ......................................................................................... 2
Help ........................................................................................................................................ 2
Getting Started........................................................................................................................... 3
Hardware Configuration ......................................................................................................... 3
Selecting Hardware Elements ........................................................................................ 3
Ladder Editor.......................................................................................................................... 3
HMI Display Editor ................................................................................................................. 4
Quick Navigation .................................................................................................................... 5
Variables ................................................................................................................................ 7
Variable Editor .................................................................................................................... 7
Downloading/Uploading a Project.......................................................................................... 8
On-Line Test Mode (Debug) ................................................................................................. 9
Watch Folders ........................................................................................................................ 9
Information Mode ................................................................................................................. 11
Using Information Mode ................................................................................................... 11
COM Ports ........................................................................................................................... 14
Modems ............................................................................................................................... 14
Getting Started with Ladder ................................................................................................. 17
Ladder Net........................................................................................................................ 17
Placing a Ladder Element in a Net................................................................................... 17
Placing a Function in a Net .............................................................................................. 18
Connecting Ladder Elements and Functions ................................................................... 19
Linking Operands to Elements ......................................................................................... 19
Nets: Sizing and Resizing ................................................................................................ 20
Adding and Inserting Nets ................................................................................................ 21
Move, Copy, & Paste Nets ............................................................................................... 21
Move, Copy & Paste Elements......................................................................................... 23
Move, Copy, & Paste between Projects........................................................................... 24
Deleting Nets .................................................................................................................... 26
Comments Tool ................................................................................................................ 28
Insert a comment: ......................................................................................................... 28
Move, Copy, and Paste Comments:............................................................................. 29
Delete a Comment........................................................................................................ 29
Undo ................................................................................................................................. 30
Changing an Element's Operand ..................................................................................... 30
Power-up Values .............................................................................................................. 31
Program Sequencing: Modules, Subroutines, Labels & Jumps....................................... 31
PLC Program Scan....................................................................................................... 32
Call Subroutine & Subroutine: Return .......................................................................... 33
Within Subroutines: Labels & Jumps............................................................................ 34
Ladder Logic..................................................................................................................... 35
Toggling between PLC and HMI Editors .......................................................................... 35
Getting Started with Displays............................................................................................... 35
Text in HMI Displays ........................................................................................................ 35
Graphic Images in Displays.............................................................................................. 36
Copy & Paste Displays..................................................................................................... 36
Undo ................................................................................................................................. 37
Getting Started with Variables ............................................................................................. 38
Variables........................................................................................................................... 38
Variable Editor .............................................................................................................. 38
Inserting a Variable into a Display.................................................................................... 39
Hardware Configuration........................................................................................................... 43

i
Table Of Contents

Hardware Configuration ....................................................................................................... 43


Selecting Hardware Elements ...................................................................................... 43
I/O Expansion Modules ........................................................................................................ 43
Configuring a PT100 Input ............................................................................................... 43
Configuring I/O Expansion Modules................................................................................. 44
High-Speed Counters: I/O Expansion Modules ............................................................... 45
Configuring a High-Speed Counter .............................................................................. 45
Snap-in I/O Expansion Modules .......................................................................................... 46
Configuring Snap-in I/O Modules ..................................................................................... 46
High-Speed Counters: Snap-in IO Modules..................................................................... 46
Configuring a High-Speed Counter .............................................................................. 46
High-Speed Counter: Reload........................................................................................ 47
Configuring a High-Speed Counter...................................................................................... 48
Configuring a High-speed Output (PWM) ............................................................................ 48
Configuring the HSO ........................................................................................................ 49
Configuring an Analog Input ................................................................................................ 50
Configuring an Analog Output.............................................................................................. 51
Analog I/O Ranges............................................................................................................... 52
Working with Analog I/O Values .......................................................................................... 53
Configuring Digital Inputs ..................................................................................................... 55
Configuring Digital Outputs .................................................................................................. 56
Assign a Description to Multiple Operands .......................................................................... 57
Controller Settings ................................................................................................................... 59
Communication and OS-Controller Menu ............................................................................ 59
Vision Communication PC Settings ..................................................................................... 59
Run, Reset, Initialize ............................................................................................................ 60
Get COM Parameters and PLC status ................................................................................ 60
Downloading an OS ............................................................................................................. 61
Check Network Status ......................................................................................................... 62
Displays: HMI........................................................................................................................... 63
HMI Display Editor ............................................................................................................... 63
Variables .............................................................................................................................. 63
Variable Editor .................................................................................................................. 63
Inserting a Variable into a Display ....................................................................................... 64
Align, Space & Center Display Elements............................................................................. 66
Integer Variables (MI, SI, ML, SL, DW, SDW) ..................................................................... 66
Changing Displays (Jumps) ................................................................................................. 66
Setting Jumps................................................................................................................... 66
Calling a Subroutine via Display .......................................................................................... 67
HMI Information.................................................................................................................... 67
Load HMI Display: Functions ............................................................................................... 68
Load HMI Display ............................................................................................................. 68
HMI Display Loaded ......................................................................................................... 68
Load Last Display............................................................................................................. 68
Resizing HMI Elements........................................................................................................ 69
HMI SB and SIs.................................................................................................................... 70
Images ................................................................................................................................. 72
Graphic Images in Displays.............................................................................................. 72
Images: Fixed ................................................................................................................... 72
Variable Images ............................................................................................................... 73
Image Library ................................................................................................................... 73
Display Variable Types ........................................................................................................ 74
Variable Types: Table ...................................................................................................... 74
Bar Graphs: Displaying Values ........................................................................................ 75
Bit (Binary) Text Variable ................................................................................................. 76
Inserting and Defining the Variable........................................................................... 77
Bit (Binary) Image Variable .............................................................................................. 78
Inserting and Defining the Variable........................................................................... 79
Clock Variables ................................................................................................................ 80
Inserting and Defining a Keypad Entry Clock Variable ............................................. 80

ii
Table Of Contents

Clock Variable: View RTC ................................................................................................ 81


Inserting and Defining the Variable........................................................................... 81
List of Texts: by Pointer.................................................................................................... 82
Inserting and Defining the Variable........................................................................... 83
List of Images: by Pointer................................................................................................. 84
Inserting and Defining the Variable........................................................................... 85
List of Images: by Range.................................................................................................. 86
Inserting and Defining the Variable........................................................................... 87
List of Texts: by Range..................................................................................................... 88
Inserting and Defining the Variable........................................................................... 89
Display ASCII String......................................................................................................... 90
Number Variable .............................................................................................................. 92
Password: Keypad Entry .................................................................................................. 93
Inserting and Defining the Variable........................................................................... 93
Timers: Displaying Values................................................................................................ 95
Display/Preset Counter Values ........................................................................................ 96
'Touch' Property ( V280 only) ........................................................................................... 97
Text ...................................................................................................................................... 98
Fonts................................................................................................................................. 98
Text: Fixed........................................................................................................................ 98
Ladder.................................................................................................................................... 101
Calls: Program Control....................................................................................................... 101
Calls, Jumps, and Labels ............................................................................................... 101
Program Sequencing: Modules, Subroutines, Labels & Jumps..................................... 101
PLC Program Scan..................................................................................................... 102
Call Subroutine & Subroutine: Return ........................................................................ 103
Within Subroutines: Labels & Jumps.......................................................................... 104
Labels & Jumps .............................................................................................................. 105
Call Subroutine ............................................................................................................... 107
Subroutine: Return ......................................................................................................... 108
Load HMI Display: Functions ......................................................................................... 110
Load HMI Display ....................................................................................................... 110
HMI Display Loaded ................................................................................................... 110
Load Last Display ....................................................................................................... 111
Open a Subroutine ......................................................................................................... 111
Name-Rename Modules and Subroutines ................................................................. 111
Ladder Nets with Feedbacks.......................................................................................... 112
Elements ............................................................................................................................ 112
Ladder Elements and Functions List.............................................................................. 112
Contacts .................................................................................................................. 112
Coils ........................................................................................................................ 113
Compare.................................................................................................................. 113
Math ........................................................................................................................ 113
Logic........................................................................................................................ 113
Clock ....................................................................................................................... 114
Store........................................................................................................................ 114
Vector ...................................................................................................................... 114
Calls ........................................................................................................................ 115
Data Tables ............................................................................................................. 115
Placing a Ladder Element in a Net................................................................................. 115
Delete Elements ............................................................................................................. 116
Change Element Type.................................................................................................... 116
Contacts ......................................................................................................................... 117
Coils................................................................................................................................ 117
Direct Coil ....................................................................................................................... 118
Direct Contacts ............................................................................................................... 118
Inverted Coil ................................................................................................................... 118
Inverted Contacts ........................................................................................................... 118
Negative Transition Contact ........................................................................................... 119
Positive Transition Contact............................................................................................. 119

iii
Table Of Contents

Reset Coil ....................................................................................................................... 120


Set Coil ........................................................................................................................... 120
Operands ........................................................................................................................... 121
Operands........................................................................................................................ 121
To View Operand Lists............................................................................................ 121
Operand Types and Symbols ..................................................................................... 121
System Operands ....................................................................................................... 121
Network Operand Types and Symbols ....................................................................... 121
Linking Operands to Elements ....................................................................................... 121
Power-up Values ............................................................................................................ 122
Constant Values # ........................................................................................................ 122
Constant Value Operands .......................................................................................... 123
Double Word (DW) ....................................................................................................... 123
Inputs (I) ........................................................................................................................ 123
Memory Bits (MB).......................................................................................................... 123
Memory Integers (MI) ................................................................................................... 123
Memory Long Integer (ML)............................................................................................ 124
Memory Floating Point Integer (MF) ............................................................................. 124
Network Operands ......................................................................................................... 124
Network Operands .................................................................................................. 124
Operand Addressing ...................................................................................................... 124
Outputs (O).................................................................................................................... 125
System Operands (SI) (SL) (SB) (SDW)........................................................................ 125
Timers (T) ....................................................................................................................... 129
Viewing and Setting Timers ........................................................................................ 132
Counters (C) ................................................................................................................... 132
Viewing and Setting Counters .................................................................................... 133
Functions............................................................................................................................ 133
Placing a Function in a Net ............................................................................................ 133
Ladder Elements and Functions List.............................................................................. 134
Contacts .................................................................................................................. 134
Coils ........................................................................................................................ 134
Compare.................................................................................................................. 134
Math ........................................................................................................................ 135
Logic........................................................................................................................ 135
Clock ....................................................................................................................... 135
Store........................................................................................................................ 136
Vector ...................................................................................................................... 136
Calls ........................................................................................................................ 136
Data Tables ............................................................................................................. 136
FBs Library ..................................................................................................................... 137
Compare Functions ........................................................................................................ 138
Compare Functions .................................................................................................... 138
Equal .................................................................................................................. 139
Greater or Equal to ................................................................................................ 139
Greater Than ........................................................................................................ 140
Less or Equal to ................................................................................................... 141
Less Than ............................................................................................................ 141
Not Equal .............................................................................................................. 142
Logic Functions .............................................................................................................. 143
Logic Functions........................................................................................................... 143
AND ............................................................................................................................ 143
OR............................................................................................................................... 144
XOR ............................................................................................................................ 145
Shift............................................................................................................................. 146
Rotate ......................................................................................................................... 147
Vector: Bit to Numeric, Numeric to Bit ........................................................................ 147

iv
Table Of Contents

Bit to Numeric.......................................................................................................... 148


Numeric to Bit.......................................................................................................... 148
Bit Test........................................................................................................................ 149
Set/Reset Bit ............................................................................................................... 149
Store Bit Status ........................................................................................................... 150
Load Bit Status ........................................................................................................... 150
Binary Numbers .......................................................................................................... 150
Math Functions ............................................................................................................... 153
Math Functions ........................................................................................................... 153
Multiple Input Values in Math Functions..................................................................... 155
Add .................................................................................................................... 156
Divide ................................................................................................................. 156
Multiply ................................................................................................................. 157
Subtract ................................................................................................................ 158
Linearization ........................................................................................................ 158
Factor ................................................................................................................. 162
Power.......................................................................................................................... 163
Square Root................................................................................................................ 163
Vector: Get Max .......................................................................................................... 164
Vector: Get Min ........................................................................................................... 165
Increment/Decrement ................................................................................................. 166
Store & Load Functions.................................................................................................. 167
Store and Load Functions........................................................................................... 167
Store Direct Function .................................................................................................. 167
Store Indirect Function................................................................................................ 168
Store Timer/Counter Preset........................................................................................ 169
Store Timer/Counter: Current Value........................................................................... 169
Load Indirect Functions .............................................................................................. 170
Load Timer/Counter Preset ........................................................................................ 170
Load Timer/Counter: Current Value ........................................................................... 171
Fill Direct ..................................................................................................................... 171
Vector Copy ................................................................................................................ 171
Time Functions ............................................................................................................... 172
Clock Functions .......................................................................................................... 172
Setting a Clock Function's Time or Date................................................................. 172
Direct Clock Function: Example ................................................................................ 173
Indirect Clock Function example ................................................................................ 174
Building the Ladder ................................................................................................. 175
Building the HMI Displays ....................................................................................... 178
Start & End Time Variables..................................................................................... 178
Day of Week & Day of Month Variables.................................................................. 181
Month Variable ........................................................................................................ 182
Setting Jumps ......................................................................................................... 182
Day of the Month-Direct and Indirect.......................................................................... 183
Direct Day of the Month: ......................................................................................... 183
Indirect Day of the Month ........................................................................................ 183
Day of the Week-Direct and Indirect........................................................................... 184
Direct Day of the Week: .......................................................................................... 184
Indirect Day of the Week......................................................................................... 185
Month-Direct and Indirect ........................................................................................... 186
Direct Month Function: ............................................................................................ 186
Indirect Month Function........................................................................................... 186
Time-Direct and Indirect ............................................................................................. 187
Direct Time Function: .............................................................................................. 187
Indirect Time Function............................................................................................. 188
Year ............................................................................................................................ 189
Direct Year Function: .............................................................................................. 189

v
Table Of Contents

Indirect Year Function: ............................................................................................ 189


Vector Functions ............................................................................................................ 190
Vector Operations ....................................................................................................... 190
Vector: Load ............................................................................................................... 190
Vector: Store ............................................................................................................... 192
Vector: Find................................................................................................................. 193
Vector: Fill ................................................................................................................... 195
Vector Fill ................................................................................................................ 195
Vector: Fill (Offset) .................................................................................................. 196
Vector: Copy ............................................................................................................... 197
Copy ........................................................................................................................ 197
Copy (Offset) ........................................................................................................... 198
Vector: Transpose ...................................................................................................... 199
Vector: Compare......................................................................................................... 200
Compare.................................................................................................................. 201
Compare (Offset) .................................................................................................... 202
Vector: Bit to Numeric, Numeric to Bit ........................................................................ 203
Bit to Numeric.......................................................................................................... 203
Numeric to Bit.......................................................................................................... 204
Vector: Get Max .......................................................................................................... 204
Vector: Get Min ........................................................................................................... 205
Vector: Move Memory................................................................................................. 206
Floating Math Functions..................................................................................................... 207
Float Functions ............................................................................................................... 207
Float Functions: Basic .................................................................................................... 207
Float Functions: Extended.............................................................................................. 208
Float: Trig Functions....................................................................................................... 209
Float: Convert ................................................................................................................. 209
Float: Compare Functions .............................................................................................. 210
Float Errors..................................................................................................................... 211
Timers & Counters ............................................................................................................. 211
Counters (C) ................................................................................................................... 211
Viewing and Setting Counters .................................................................................... 212
Timers (T) ....................................................................................................................... 212
Viewing and Setting Timers ........................................................................................ 215
FB Library........................................................................................................................... 215
FBs Library ..................................................................................................................... 215
Communication FBs ....................................................................................................... 217
COM Port: Init ............................................................................................................. 217
Using Ethernet ............................................................................................................ 219
Default Socket Configuration .................................................................................. 220
General.................................................................................................................... 221
Examples................................................................................................................. 221
PLC to external device: MODBUS Master over TCP/IP ......................................... 221
PLC networks, PLC to PLC..................................................................................... 223
PC to PLC: Accessing PLC via SCADA.................................................................. 228
Dial & Hang-up ........................................................................................................... 230
Dial .......................................................................................................................... 230
Hang-up................................................................................................................... 230
PID Function................................................................................................................... 231
PID Function ............................................................................................................... 231
About PID and Process Control .............................................................................. 231
Inside the PID Function........................................................................................... 232
AutoTune---Note: This feature is not included in the current product release. ....... 234
Placing a PID function............................................................................................. 234
PID Function Parameters........................................................................................ 235
Linearizing a PID Analog Output Value .................................................................. 237
PID Function ............................................................................................................... 238
About PID and Process Control .............................................................................. 238
Inside the PID Function........................................................................................... 239

vi
Table Of Contents

AutoTune---Note: This feature is not included in the current product release. ....... 241
Placing a PID function............................................................................................. 242
PID Function Parameters........................................................................................ 242
Linearizing a PID Analog Output Value .................................................................. 244
Linearization ................................................................................................................... 245
Linearization ........................................................................................................ 245
Communications .................................................................................................................... 251
COM Port: Init .................................................................................................................... 251
RS485 Options................................................................................................................... 252
About RS485 .................................................................................................................. 252
Network Topology & Wiring............................................................................................ 253
RS485 Network Wiring ............................................................................................... 253
RS485 wiring considerations ...................................................................................... 253
RS485, by controller type................................................................................................... 254
Vision 230/260/280......................................................................................................... 254
Vision 120/ M91.............................................................................................................. 255
Vision 120 series ........................................................................................................ 255
M91 series .................................................................................................................. 255
Vision 120/ M91 RS232/RS485 COM ports ............................................................... 256
RS232/RS485 Jumper Settings.................................................................................. 256
RS485 Network Termination Settings ........................................................................ 256
Opening the Controller................................................................................................ 257
M90................................................................................................................................. 258
Vision / M91 RS485 Port Specifications......................................................................... 258
User safety and equipment protection guidelines .......................................................... 258
Modems ............................................................................................................................. 259
PLC Programming via Modem: Remote Access ............................................................... 262
Controller Setup ............................................................................................................. 262
PC Modem Setup ........................................................................................................... 264
About Ethernet ................................................................................................................... 265
About Networks .............................................................................................................. 266
What is an IP address? .................................................................................................. 266
IP Addresses and Networks ........................................................................................... 266
Subnet ............................................................................................................................ 267
Subnet Mask................................................................................................................... 268
Gateway ......................................................................................................................... 268
Socket............................................................................................................................. 269
Protocols: UDP and TCP................................................................................................ 269
Local Port ....................................................................................................................... 270
Glossary ......................................................................................................................... 271
Ethernet ................................................................................................................................. 275
About Ethernet ................................................................................................................... 275
About Networks .............................................................................................................. 275
What is an IP address? .................................................................................................. 275
IP Addresses and Networks ........................................................................................... 276
Subnet ............................................................................................................................ 276
Subnet Mask................................................................................................................... 277
Gateway ......................................................................................................................... 277
Socket............................................................................................................................. 278
Protocols: UDP and TCP................................................................................................ 278
Local Port ....................................................................................................................... 279
Glossary ......................................................................................................................... 280
Using Ethernet ................................................................................................................... 283
Default Socket Configuration.......................................................................................... 284
General........................................................................................................................... 285
Examples........................................................................................................................ 285
PLC to external device: MODBUS Master over TCP/IP ................................................ 285
PLC networks, PLC to PLC ............................................................................................ 287
Using UDP to implement controller-to-controller communication............................... 287
Using TCP to implement controller-to-controller communication ............................... 289

vii
Table Of Contents

PC to PLC: Accessing PLC via SCADA......................................................................... 292


Ethernet: Card Init .............................................................................................................. 294
Ethernet: Socket Init........................................................................................................... 295
Ethernet: TCP Connect \ TCP Close ................................................................................. 296
Networks................................................................................................................................ 297
About Networks.................................................................................................................. 297
COM Ports ......................................................................................................................... 298
Assigning a Unit ID number ............................................................................................... 298
Accessing a Networked PLC via PC.................................................................................. 299
Accessing a Networked Controller ................................................................................. 300
Accessing a Networked Controller via Modem .............................................................. 301
Modems: Setting Up....................................................................................................... 301
Online Test Mode & Remote Access.......................................................................... 303
Network Operands ............................................................................................................. 304
Network Operands ...................................................................................................... 304
CANbus Networking........................................................................................................... 305
Check Network Status ....................................................................................................... 305
CANbus Network Problems ............................................................................................... 306
RS485 Options................................................................................................................... 307
About RS485 .................................................................................................................. 307
Network Topology & Wiring............................................................................................ 307
RS485 Network Wiring ............................................................................................... 307
RS485 wiring considerations ...................................................................................... 308
RS485, by controller type................................................................................................... 308
Vision 230/260/280......................................................................................................... 308
Vision 120/ M91.............................................................................................................. 310
Vision 120 series ........................................................................................................ 310
M91 series .................................................................................................................. 310
Vision 120/ M91 RS232/RS485 COM ports ............................................................... 310
RS232/RS485 Jumper Settings.................................................................................. 311
RS485 Network Termination Settings ........................................................................ 311
Opening the Controller................................................................................................ 311
M90................................................................................................................................. 312
Vision / M91 RS485 Port Specifications......................................................................... 313
User safety and equipment protection guidelines .......................................................... 313
Data Tables ........................................................................................................................... 315
About Data Tables ............................................................................................................. 315
Creating a Data Table .................................................................................................... 315
Data Table Options ........................................................................................................ 316
Column Parameters ....................................................................................................... 317
Database-Read/Write ........................................................................................................ 317
Read ............................................................................................................................... 318
Write ............................................................................................................................... 318
Read/Write Direct ........................................................................................................... 319
Database: Read Direct ............................................................................................... 319
Database: Write Direct................................................................................................ 320
Program Recipes ............................................................................................................... 321
Data Tables: Synchronizing Data ...................................................................................... 322
Data Tables and Excel ....................................................................................................... 323
FAQs...................................................................................................................................... 327
General .............................................................................................................................. 327
What are... ...................................................................................................................... 327
Operands .................................................................................................................... 327
Operand Types and Symbols.................................................................................. 327
System Operands ................................................................................................... 327
Network Operand Types and Symbols ................................................................... 327
System Operands (SI) (SL) (SB) (SDW) .................................................................... 327
Watch Folders............................................................................................................. 332
Memory Backup.......................................................................................................... 334
How do I... ...................................................................................................................... 334

viii
Table Of Contents

Opening a New Project............................................................................................... 334


Opening an Existing Project ....................................................................................... 334
Saving a Project.......................................................................................................... 335
Saving a Project.......................................................................................................... 335
Downloading/Uploading a Project .............................................................................. 335
Output Window, Operand View .................................................................................. 336
Watch Folders............................................................................................................. 336
Watch Folders............................................................................................................. 338
Find ............................................................................................................................. 339
Power-up Values ........................................................................................................ 343
Assign a Description to Multiple Operands................................................................. 344
On-Line Test Mode (Debug) ...................................................................................... 344
Show STL ................................................................................................................... 345
Verify Project .............................................................................................................. 346
Information Mode........................................................................................................ 347
Using Information Mode .......................................................................................... 347
PLC Programming via Modem: Remote Access ........................................................ 349
Controller Setup ...................................................................................................... 350
PC Modem Setup.................................................................................................... 352
Ladder ................................................................................................................................ 352
What are....? ................................................................................................................... 353
Timers (T) ................................................................................................................... 353
Viewing and Setting Timers .................................................................................... 355
Counters (C) ............................................................................................................... 356
Viewing and Setting Counters................................................................................. 356
Network Operands ...................................................................................................... 357
PID Function ............................................................................................................... 357
About PID and Process Control .............................................................................. 357
Inside the PID Function........................................................................................... 358
AutoTune---Note: This feature is not included in the current product release. ....... 360
Placing a PID function............................................................................................. 361
PID Function Parameters........................................................................................ 361
Linearizing a PID Analog Output Value .................................................................. 363
How do I.... ..................................................................................................................... 364
Adding and Inserting Nets .......................................................................................... 364
Adding and Inserting Nets .......................................................................................... 364
Deleting Nets .............................................................................................................. 364
Nets: Sizing and Resizing........................................................................................... 366
Move, Copy, & Paste Nets.......................................................................................... 367
Move, Copy, & Paste Nets.......................................................................................... 370
Comments Tool .......................................................................................................... 373
Insert a comment: ................................................................................................... 373
Move, Copy, and Paste Comments: ....................................................................... 374
Delete a Comment .................................................................................................. 374
Connecting Ladder Elements and Functions.............................................................. 375
Placing a Ladder Element in a Net ............................................................................. 375
Timers (T) ................................................................................................................... 376
Viewing and Setting Timers .................................................................................... 379
Counters (C) ............................................................................................................... 379
Viewing and Setting Counters................................................................................. 380
Oscillating pulse.......................................................................................................... 380
Change Element Type ................................................................................................ 381
Delete Elements ......................................................................................................... 381
Change Element Type ................................................................................................ 382
Change Element Type ................................................................................................ 382
Placing a Function in a Net......................................................................................... 383
Placing a Function in a Net......................................................................................... 384
Output Window, Operand View .................................................................................. 384
Output Window, Operand View .................................................................................. 385
Operand Descriptions ................................................................................................. 385

ix
Table Of Contents

Get Next Address ....................................................................................................... 385


Power-up Values ........................................................................................................ 385
Power-up Values ........................................................................................................ 386
Search: Symbolic Name ............................................................................................. 387
Setting Hexadecimal--Decimal Values ....................................................................... 387
Program Sequencing: Modules, Subroutines, Labels & Jumps ................................. 387
PLC Program Scan ................................................................................................. 388
Call Subroutine & Subroutine: Return..................................................................... 389
Within Subroutines: Labels & Jumps ...................................................................... 390
Calls, Jumps, and Labels............................................................................................ 391
Load HMI Display: Functions...................................................................................... 391
Load HMI Display .................................................................................................... 391
HMI Display Loaded................................................................................................ 392
Load Last Display.................................................................................................... 392
Call Subroutine ........................................................................................................... 392
Open a Subroutine...................................................................................................... 394
Name-Rename Modules and Subroutines.............................................................. 395
Subroutine: Return...................................................................................................... 395
Network Operands ...................................................................................................... 397
FBs Library.................................................................................................................. 398
Use Functions to... ......................................................................................................... 399
Store and Load Functions........................................................................................... 399
Store Direct Function .................................................................................................. 400
Float Functions ........................................................................................................... 401
Indirect Clock Function example ................................................................................ 401
Building the Ladder ................................................................................................. 401
Building the HMI Displays ....................................................................................... 405
Start & End Time Variables..................................................................................... 405
Day of Week & Day of Month Variables.................................................................. 408
Month Variable ........................................................................................................ 409
Setting Jumps ......................................................................................................... 409
Direct Clock Function: Example ................................................................................ 410
Store Indirect Function................................................................................................ 411
Compare Functions .................................................................................................... 412
Multiple Input Values in Math Functions..................................................................... 413
PID Function ............................................................................................................... 413
About PID and Process Control .............................................................................. 414
Inside the PID Function........................................................................................... 415
AutoTune---Note: This feature is not included in the current product release. ....... 417
Placing a PID function............................................................................................. 417
PID Function Parameters........................................................................................ 418
Linearizing a PID Analog Output Value .................................................................. 420
Shift............................................................................................................................. 421
Rotate ......................................................................................................................... 422
Displays.............................................................................................................................. 422
What are... ...................................................................................................................... 422
About Displays ............................................................................................................ 422
Changing Displays (Jumps)........................................................................................ 423
Setting Jumps ......................................................................................................... 423
Graphic Images in Displays ........................................................................................ 423
Grid ............................................................................................................................. 423
How do I.... ..................................................................................................................... 423
Add and Name a Display ............................................................................................ 424
Open a Display ........................................................................................................... 424
Delete/Clear a Display ................................................................................................ 424
HMI Display Editor ...................................................................................................... 425
Changing Displays (Jumps)........................................................................................ 425
Setting Jumps ......................................................................................................... 425
Clear/Edit Display Jumps & Destinations ................................................................... 426
Calling a Subroutine via Display................................................................................. 426

x
Table Of Contents

Timers: Displaying Values .......................................................................................... 426


Name/Rename Displays & Variables ......................................................................... 428
Graphic Images in Displays ........................................................................................ 428
Images: Fixed ............................................................................................................. 428
Text in HMI Displays ................................................................................................... 429
Display ASCII String ................................................................................................... 429
Group/Ungroup ........................................................................................................... 431
Text: Fixed .................................................................................................................. 431
Fonts ........................................................................................................................... 432
Font Handler ............................................................................................................... 432
Using Font Handler ................................................................................................. 432
Deleting Fonts............................................................................................................. 434
Fonts: Edit and Replace ............................................................................................. 435
Grid ............................................................................................................................. 436
Creating Images with Microsoft Paint ......................................................................... 436
Variables ............................................................................................................................ 438
What are... ...................................................................................................................... 438
Variables ..................................................................................................................... 438
Variable Editor......................................................................................................... 439
Variable Images .......................................................................................................... 439
Text Variables ............................................................................................................. 440
Number Variable ......................................................................................................... 441
Variable Types: Table................................................................................................. 443
Bar Graphs: Displaying Values................................................................................... 443
How do I... ...................................................................................................................... 444
Inserting a Variable into a Display .............................................................................. 444
Delete a Variable ........................................................................................................ 446
Resizing a Field .......................................................................................................... 446
Bit (Binary) Text Variable............................................................................................ 446
Bit (Binary) Image Variable......................................................................................... 448
Fonts in Binary Text Variables.................................................................................... 449
Naming a Variable ...................................................................................................... 449
Integer Variables (MI, SI, ML, SL, DW, SDW)............................................................ 450
Show Display Variables .............................................................................................. 450
Text in HMI Displays ................................................................................................... 450
Graphic Images in Displays ........................................................................................ 450
Clock Variables ........................................................................................................... 450
Timers: Displaying Values .......................................................................................... 452
Presetting Timer via Keyboard ................................................................................... 453
Number Variable ......................................................................................................... 453
Display Number Format.............................................................................................. 455
Linearization for Display ............................................................................................. 455
Number Variable ......................................................................................................... 457
Bar Graphs: Displaying Values................................................................................... 458
Limit Keypad Entry...................................................................................................... 460
Linearization for Display ............................................................................................. 461
Display Number Format.............................................................................................. 463
Clock Variable: View RTC .......................................................................................... 463
Resizing a Field .............................................................................................................. 464
Fonts............................................................................................................................... 464
Hardware Configuration ..................................................................................................... 464
How do I... ...................................................................................................................... 464
Hardware Configuration.............................................................................................. 465
Configuring I/O Expansion Modules ........................................................................... 465
Configuring Snap-in I/O Modules ............................................................................... 466
High-Speed Counters: Snap-in IO Modules ............................................................... 466
Configuring a High-Speed Counter ......................................................................... 467
High-Speed Counter: Reload .................................................................................. 467
High-Speed Counters: I/O Expansion Modules.......................................................... 468
Configuring a High-Speed Counter ......................................................................... 468

xi
Table Of Contents

Configuring Digital Inputs............................................................................................ 469


Configuring Digital Outputs......................................................................................... 469
Configuring Digital Inputs............................................................................................ 470
Configuring an Analog Input ....................................................................................... 471
Configuring a PT100 Input.......................................................................................... 472
Configuring an Analog Output .................................................................................... 472
Communications ................................................................................................................ 473
How do I... ...................................................................................................................... 473
COM Ports .................................................................................................................. 473
RS485 Options ........................................................................................................... 474
About RS485 ........................................................................................................... 474
Network Topology & Wiring..................................................................................... 474
RS485, by controller type ........................................................................................... 475
Vision 230/260/280 ................................................................................................. 475
Vision 120/ M91 ...................................................................................................... 477
M90 ......................................................................................................................... 479
Vision / M91 RS485 Port Specifications ................................................................. 480
User safety and equipment protection guidelines ................................................... 480
Modems ...................................................................................................................... 481
PLC Programming via Modem: Remote Access ........................................................ 483
Controller Setup ...................................................................................................... 484
PC Modem Setup.................................................................................................... 486
Exceed the SMS phone book 8 number limit? ........................................................... 486
Dialing from the Controller's Keypad .......................................................................... 487
About the Application .............................................................................................. 487
Ladder ..................................................................................................................... 487
HMI Display ............................................................................................................. 490
Using Hyperterminal for COM Troubleshooting.......................................................... 492
Modem Connections ............................................................................................... 492
Using Hyperterminal................................................................................................ 493
Modem Commands ................................................................................................. 496
Initializing the modem to SMS mode via Hyperterminal ......................................... 497
When a controller sends an SMS text message ..................................................... 497
'The Sniffer'--Viewing communication strings ......................................................... 498
Troubleshooting ..................................................................................................................... 501
Detecting Short-circuited End Devices .............................................................................. 501
Why does the Controller display the 'Restart' message? .................................................. 501
On-Line Test Mode (Debug) ............................................................................................. 501
Power-up Modes: Trouble-shooting................................................................................... 502
I/O Expansion Module Errors............................................................................................. 503
Compile .............................................................................................................................. 503
HMI Element Resizing Limitations ..................................................................................... 503
Float Errors ........................................................................................................................ 504
Changing Panel Types: Conflicts....................................................................................... 505
Insufficient Flash Memory .................................................................................................. 505
Communications ................................................................................................................ 505
CANbus Network Problems............................................................................................ 505
MODBUS Error Table..................................................................................................... 506
Modem Troubleshooting................................................................................................. 507
Data Flow Direction................................................................................................. 509
RS-232 signal information....................................................................................... 509
Cable Pin-out .......................................................................................................... 509
Modem Status & Error Messages .................................................................................. 510
Using Hyperterminal for COM Troubleshooting ............................................................. 513
Modem Connections................................................................................................... 513
Data Flow Direction................................................................................................. 513
RS-232 signal information....................................................................................... 513
Cable Pin-out .......................................................................................................... 514
Using Hyperterminal ................................................................................................... 514
Modem Commands .................................................................................................... 517

xii
Table Of Contents

Initializing the modem to SMS mode via Hyperterminal............................................. 518


When a controller sends an SMS text message ........................................................ 519
'The Sniffer'--Viewing communication strings............................................................. 519
Using Hyperterminal to check PC-PLC direct communications ..................................... 522
Index ...................................................................................................................................... 525

xiii
Welcome to VisiLogic
VisiLogic is the software tool you use to create control projects for Vision controllers.
After you plan the control task, use VisiLogic to write, debug, and download the PLC
control and HMI applications into the controller.

The PLC application is your control, or automation application. You write the PLC
application using the Ladder Editor.

The HMI application configures the operating panel's function. You use the HMI Editor to
create the Displays that are shown on the controller's screen.

Displays tell your operators what to do. You can have your operators log in with a
password, enter setpoints and other data, and instruct the operator what to do in case of a
system problem or alarm. A Display can contain both text and images. Text and images
can be both fixed and/or variable.

Variables are inserted into a Display to:

Show run-time values as integers


Represent run-time values with either text, images, or bar graphs
Show text messages that vary according to runtime conditions.
Here are some of VisiLogics major features.

Program Editors
You use 3 editors to create your application:

Ladder
HMI Display
Variable
Each editor is operated through a different window. You switch between the editors via the
Toolbar buttons or by clicking elements in the Project Tree.

Ladder Modules and Subroutines


VisiLogic is a modular program you build using Modules and Subroutines.

Hardware Configuration
VisiLogic's easy Hardware Configuration allows you to configure the I/Os you add to the
system.

Project Explorer
The Project Explorer tree allows you to navigate easily between program components.

1
VisiLogic Software Manual V330

Operand View and Watch Folders


VisiLogic allows you to view operands and their contents according to type and whether or
not they are in use. You can also group related operands according to functions in Watch
Folders.

Help
Use this Help System to learn how to use the software and answer your questions. Browse
sequences present help topics in an order to aid you in learning. The browse sequence
shown below is Configuring hardware.

2
Getting Started

Hardware Configuration
The foundation of a Vision control system is the controller. The Snap-in I/O Module
provides an on-board I/O configuration. You add I/Os by integrating I/O Expansion
Modules.

VisiLogic's Hardware Configuration allows you to configure inputs: analog, digital, and high-
speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital,
and PWM high-speed outputs.

Open Hardware Configuration by clicking the button on the toolbar, or selecting it from
the View menu.

Selecting Hardware Elements

Ladder Editor
Use the Ladder Editor to create the Ladder diagram that comprises your control application.
Ladder diagrams are composed of contacts, coils, and function block elements arranged in
nets.

In a Ladder diagram, the contacts represent input conditions. They lead power from the left
Ladder rail to the right rail. This is why the first element in a net must always touch the left
rail. Coils represent output instructions. In order for output coils to be activated, the logical
state of the contacts must allow the power to flow through the net to the coil. This is why
the elements in a net must be connected. Each net must contain only one rung.

Use the Ladder Editor to:

Place and connect Ladder Elements.


Apply Compare, Math, Logic, Clock, Store, and Vector functions.
Insert Function Blocks (FBs) into your program.
Build program Modules and Subroutines, and use internal Subroutine Jumps and
Labels.
Place Comments on Ladder nets.

3
VisiLogic Software Manual V330

To start the Ladder Editor


Click the Ladder button on the toolbar.
Click the elements outlined in blue for more information.

HMI Display Editor


Use the HMI Display Editor to create the Displays that are shown on the controller screen
after the program is downloaded. When you select HMI from the Project Explorer tree, a
Display replica opens. The size of this replica reflects the type of Vision controller you have
selected in your project's Hardware Configuration.

Displays tell your operators what to do. You can have your operators log in with a
password, enter setpoints and other data, and instruct the operator what to do in case of a
system problem or alarm. A Display can contain both text and images. Text and images
can be both fixed and/or variable.

Variables are inserted into a Display to:

Show run-time values as integers


Represent run-time values with either text, images, or bar graphs
Show text messages that vary according to runtime conditions.
Below, click the elements outlined in blue to learn more about a specific
feature.

4
Getting Started

Quick Navigation
VisiLogic offers different tools for program navigation.

Program Tree

Note Within the program tree, elements are presented alphabetically. This does not
affect the order in which the program runs.
Note Ladder Modules and subroutines can be moved via drag-and-drop, as can HMI
Modules and Displays. Again, moving elements does not affect the order in

5
VisiLogic Software Manual V330

which they run.


The Main Ladder Module, Main Subroutine, Start-up HMI Module and the Start-
up HMI Display cannot be moved via drag-and-drop or erased. For easy
identification, they are always marked in orange.

Accessing a Load Display Target

Accessing a Call Subroutine Target

Go To Label

Use labels as bookmarks to mark program sections, and then locate them using the Go To
Label<Alt> + <Right/Left arrow> and List of Labels <Ctrl> + <L> utility.

6
Getting Started

The Find utility also enables you to easily locate, directly open, and edit most program
elements.

In addition, shortcut menus that are relevant can be opened

Variables
Variables enable you to show run-time values, text, images, and bar graphs on the
controller's screen in response to run-time conditions. Bit, or binary text variables, for
example, display text messages on the controller's LCD screen according to the status of a
bit operand.

A Display may contain up to 16 variables.

You can also use Keypad Entry Variables to enable an operator to enter a password, or
data such as setpoints from the controller's keyboard.

Variable Editor
When you insert a variable into a display, the Variable Editor opens, showing you the
options that are relevant for that type of Variable.

7
VisiLogic Software Manual V330

After you have inserted Variables into a display, they are shown with that display in the
Project tree.

Downloading/Uploading a Project
The Download process transfers your project from the PC to the controller.

To download a project to a controller:

1. Connect the controller to the PC with the programming cable.

2. Click the Download icon on the Standard toolbar.

8
Getting Started

3. The downloading process begins.

To upload a project from a controller:

1. Connect the controller to the PC with the programming cable.


2. Click the Upload icon on the Standard toolbar.
3. The uploading process begins.
Upload copies the complete project from the controller into the PC.

Via Project Properties, you can apply upload and download options:

Assign a project password. Password protection requires users to enter a password


before uploading a project to a PC.
Prevent project upload.

On-Line Test Mode (Debug)


To test a project, first connect the controller to your PC using the program download cable
provided with the software package, then download the project and click the On-Line Test
button.

Note The controller can send and receive SMS messages when the controller is in Test
mode.

Watch Folders
Watch Folders enable you to:

Arrange related groups of operands in folders.


Name the folders.

9
VisiLogic Software Manual V330

View these operands in the tabbed Output Window at the bottom of the screen.
To view a Watch folder, click the Watches tab at the bottom of the screen, then select the
desired folder. Edit the folder by right-clicking a line, then selecting the appropriate function.

Adding Operands to a Watch Folder from a net

To add a single operand to a Watch folder, right-click it in the Ladder or in the


Operand Output Window.

To add all of the operands within a net to a Watch folder, right-click the right-hand rail
of the desired net..

10
Getting Started

Information Mode
Information Mode is a utility that is embedded in the operating system of the controller. Via
Information Mode, you can view data on the LCD screen, use the controllers keyboard to
directly edit data, and perform certain actions such as resetting the controller. You can
enter Information Mode at any time without regard to what is currently displayed on the
LCD screen.

Enter Information Mode by pressing the <i> key for a few seconds. The default password is
1111.

Viewing data does not


affect the controllers
program. Performing
actions, such as
initializing the
controller, can
influence the program.

Note When you


use Information Mode,
the keyboard is
dedicated to that
purpose. The keys
return to normal
application functions
when you exit
Information Mode.
Using Information Mode
1. To enter Information mode, press the <i>button on the Visions keyboard.

11
VisiLogic Software Manual V330

2. Enter your password. The default password is 1111. This password remains in
effect until you change it via the Information Mode screen described in the table
below.
3. The controller enters Information Mode, showing the first category, Data Types.

The controller will block


entry into Information
mode until the correct
password has been
entered. This is why you
must record any password
you set for your controller.

The data in Information


Mode is arranged in
Categories. Each
Category contains several
Subjects. You navigate
Information Mode by using
the keyboard buttons.

To exit Information mode,


press the <ESC>button on
the Visions keyboard.
Each press returns one
level up. Press the
number of times
necessary to exit.

Note When you reenter Information Mode, the controller will return to the last Category
viewed.

The table below shows the categories of information that can be accessed in this mode.

Category Subject Possible Actions

Data Types Memory Bits View bit status

System Bits Change bit status (Set/Reset)

Memory Integers View integer/long integer/double word value.


System Integers
Change values
Memory Longs
Toggle Base: view the value in decimal or
System Longs hexadecimal form.

Memory Double
Words

System Double
Words

Inputs View input status.


Force input status to 1 (FR1) or 0 (FR0).
Forced values stay in effect until Normal mode
(NRM) is selected, or until the controller is
initialized or reset.
Note Forced values do influence your
program. This can be useful in testing the
effect of an input condition on an output
status.

12
Getting Started

Outputs View output status.


Force output status to 1 (FR1) or 0 (FR0).
Note that forced output values do not affect
your program.
Set/Reset output status.

Timers Enter a Preset Timer value.


View the current timer value and status by
selecting the R.T. option.

System Model & O/S Ver Check the controllers model number and
operating system version.
C h e c k wh e t h e r t h e c o n t r o l l e r i s i n R u n o r S t o p
mode.

W orking Mode C h e c k wh e t h e r t h e c o n t r o l l e r i s i n R u n o r S t o p
mode.
Reset the controller. This restarts your
program; restoring power-up values to all data
types except for those protected by the battery
backup. The battery protects Real Time Clock
(RTC), all operand, and Data Table values.
Initialize the controller. This restarts your
program and initializes all values, restoring 0
values to all data types.

Time & Date View the Real Time Clock (RTC) settings.
Note that the RTC settings control all time-
based functions.
Change the RTC settings via the controllers
keyboard.

Unit ID The Unit ID number identifies a networked controller.


You can:
Change the ID number. The new ID number
will remain in effect until the controller is
reset.
Burn the ID number into the controllers FLASH
m em ory. This is a perm anent change.

Serial Port 1 View and edit communication settings.


Serial Port 2
Select to Change or Burn the new settings.

CANbus Baud Rate Change the CANbus baud rate.

Function Reserved for


Block future use

P a s s wo r d New Set a New Password

Hardware C h e c k i f I / O E xp a n s i o n M o d u l e s a r e i n s t a l l e d .
Configuration N o t e t h a t I / O E xp a n s i o n M o d u l e s a r e
represented by letters. Identical module types
are represented by identical letters as shown
below.
S h o ws i f a n I / O m o d u l e i s s h o r t - c i r c u i t e d .

13
VisiLogic Software Manual V330

COM Ports
All Vision controllers comprise RS232 serial communication ports. RS232/RS485 adaptors
are available by separate order. Certain models, such as the Vision120, support both
RS232 and RS485. For details on communications hardware settings, refer to the User
Guides and documentation supplied with relevant models.

Separate CANbus ports are also provided with specific controller models.

Note All ports can be used simultaneously. For example, a single controller may use one
serial port to send messages to a modem via RS232, another port to communicate with a
frequency converter, while the controller engages in communications via its CANbus port.

Communication ports must be initialized in your control program using the COM Init FB,
located on the FB's menu.

Modems
To enable a Vision controller to communicate via standard or GSM modem:

1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally performed once in a program. It is usually a power-
up task, however a one-shot transitional contact may also be used.
Communications cannot flow through the port during initialization.

14
Getting Started

2. Place the conditions and elements in your Ladder program.


Note Communications cannot flow through the port during initialization. To
avoid conflicts in your program, use the Modem Initialization Status SBs.

Modem status can be checked via the System Bits listed below.

SB Description

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

85 Modem Initialized Failed: COM 3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

15
VisiLogic Software Manual V330

3. Connect the modem.

16
Getting Started

Note If call are routed via a switchboard, note that the switchboard settings may interfere
with communications. Consult with your switchboard provider.
PC/PLC modem communications: Both PC and controller must use the same type
of modem: either landline or GSM. Internal PC modems must be used in conjunction with
the driver provided by the modem's manufacturer.
Examples

To locate application examples, select Examples from the Help menu.

SMS messaging.vlp

Getting Started with Ladder


Ladder Net
The Ladder diagram contains a left and right rail. Between these rails, the control
application is arranged in nets. A net contains a row of Ladder elements that drive a coil.
Power flows through the ladder elements in a net from left to right. Each net must contain
only one rung.

This is why the first ladder element in the net must touch the left Ladder rail. All of the
elements in a net must be connected to allow power flow. You do not need to connect the
last element on the right to the right side of the ladder in each net.

If the elements in a net are not connected, the software will display an error message when
you compile your project.

Placing a Ladder Element in a Net

1. Select any type of Ladder element by:


Clicking its icon on the Ladder toolbar, -or-

Selecting it from the Ladder menu, -or-


Right-clicking on the Ladder to display the Ladder menu and then selecting the
element.

2. Move the element to the desired net location, then click.

17
VisiLogic Software Manual V330

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

Placing a Function in a Net

1. Select any type of Ladder function by:


Selecting it from the Ladder toolbar, -or-
Selecting it from the Ladder menu, -or-
Right-clicking on the Ladder to display the Ladder menu and then selecting the
function.

2. Move the function to the desired net location, then click.

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

18
Getting Started

Connecting Ladder Elements and Functions


Use the Connect Elements tool to connect two or more elements or functions in a net. All
net elements must be connected in order to allow power to flow through the net. If they are
not connected you will not be able to compile your application.

Connecting Elements

Linking Operands to Elements


When you place a Ladder element or function on a net, the Select Operand and Address
dialog box opens. All of the operands and operand types that are displayed in the Select
Operand and Address dialog box are applicable to the element or function that you have
selected. To edit an operand attached to an element, you can also double-click on the
yellow Description field of an element after it has been placed in the Ladder.

You can search for a particular operand by using the Search: Symbolic Name function at
the bottom of the dialog box.

Click on the elements in the dialog box to learn their function.

19
VisiLogic Software Manual V330

Nets: Sizing and Resizing


To shrink a net to its minimum height, double-click the net's left-hand rail.

Nets can be also manually resized.

The Ladder menu contains two options that enable you to resize nets throughout a project.

20
Getting Started

Adding and Inserting Nets


To add a net to the bottom of your Ladder:

Click the Append Ladder icon .


To insert a Ladder net:

1. Click on the Insert Net icon ; your cursor changes into a cross-hairs.
2. Click on a net; the new net is inserted above the net you clicked on.

Move, Copy, & Paste Nets

1. Select the desired net(s).

2. Select the desired operation.

-or-
Select Cut or Copy from the Edit menu.

3. Place the elements in the net.

21
VisiLogic Software Manual V330

-or-
Select Paste from the Edit menu.

You can also cut, copy and paste nets between projects, subject to the information listed
below:

Once you have cut or copied your selection from the source project, open a target
project without closing VisiLogic, either by using the New Project or Open project
buttons or via these options on the Project menu. If you close VisiLogic, the selection
will be lost.

If the source project contains Call Subroutine or Load HMI operations, note that the
referenced elements will be marked as missing, even if the target project contains
elements of the same name. Note that you can reassign the references.

If the selection contains FBs, and no FBs of that type currently exist in the target
project, the pasted FBs will be the version currently in VisiLogic FB library--in other
words, if the source selection contains older FB versions, they are automatically
updated during the Paste operation.
If the selection contains FBs, and FBs of that type currently exist in the target project
in a different version, Paste cannot be completed.
If your selection contains only Labels, without the attendant Jump to Label, they will
be marked as missing, even if the target project contains Jumps of the same name.
Note that you can reassign the references.

22
Getting Started

If the selection contains Labels or Jumps with the same name as those in the target
project, these will be automatically renamed by the program when they are pasted.

If you copy both Labels and Jump to Label, the Jumps will be marked as missing.
Note that you can reassign the references.

Move, Copy & Paste Elements

1. Select the desired element(s).

23
VisiLogic Software Manual V330

2. Select the desired function.

-or-
Select Cut or Copy from the Edit menu.

3. Place the elements in the net.

-or-
Select Paste from the Edit menu.

Note that when you paste elements into a net, the elements paste into the same relative
area in the new net. The elements 'remember' their original net location. Therefore, before
you paste elements into a net that already contains elements, move any elements that
occupy the same position as the paste selection.

Move, Copy, & Paste between Projects


You can cut, copy and paste both HMI Displays and Ladder nets between projects,
subject to the information listed below.

Once you have cut or copied your selection from the source project, open a target project
without closing VisiLogic, either by using the New Project or Open project buttons or via
these options on the Project menu. If you close VisiLogic, the selection will be lost.

24
Getting Started

Ladder

If the source project contains Call Subroutine or Load HMI operations, note that the
referenced elements will be marked as missing, even if the target project contains
elements of the same name. Note that you can reassign the references.

If the selection contains FBs, and no FBs of that type currently exist in the target
project, the pasted FBs will be the version currently in VisiLogic FB library--in other
words, if the source selection contains older FB versions, they are automatically
updated during the Paste operation.
If the selection contains FBs, and FBs of that type currently exist in the target project
in a different version, Paste cannot be completed.
If your selection contains only Jumps, without the attendant Labels, they will be
marked as missing, even if the target project contains Labels of the same name.
Note that you can reassign the references.

25
VisiLogic Software Manual V330

If the selection contains Jumps and Labels with the same name as those in the target
project, the Jump, Label and link between them will be automatically recreated by
VisiLogic when they are pasted.

In this way, VisiLogic maintains the integrity of the links between Jumps and their
corresponding Labels.

Display elements

When you paste elements into a Display, the elements paste into the same relative
area in the new net. The elements 'remember' their original location. Therefore,
before you paste elements into a Display that already contains elements, move any
elements that occupy the same position as the Paste selection.
If you paste variables that are linked to named constant values, note that the
constant's description is lost during the paste operation.
Variables do not retain their descriptions; they are renamed as Variable 1, Variable 2,
etc..

Deleting Nets
First, select the desired nets.

To select one net


Click on the left rail of a net to select it; the rail in that net turns grey.

To select more than one net:


1. Select the first net by clicking on the left net bar.

26
Getting Started

2. Hold the Shift button and click on the last net in the range that you want to
copy.

27
VisiLogic Software Manual V330

To move the selected nets,

Press the Delete button on your computer keyboard; the net is deleted and all of the
nets in your project move up.

Comments Tool
Ladder Editor Comments enable you to place remarks program nets. Comments can be
written directly into the Comment pane, or written in Notepad and pasted.

Comments are not downloaded to the controller. To toggle Comments in and out of view,
press <Alt> + <C>, or select the option from the View menu.

Insert a comment:

1. Click on the Comment icon ; your cursor changes into a cross-hairs .


-or-
Select Insert Comment from either the Insert or Ladder menu.
-or-
Right-click on the Ladder, and then select Insert Comment.
2. Click on a net; a Comment field opens in the net you clicked.
3. Type text in the field.

28
Getting Started

Move, Copy, and Paste Comments:

1. Select the Comment.

2. Place the Comment in the net.

-or-
Select Paste from the Edit menu.

Delete a Comment

1. Select the Comment.

29
VisiLogic Software Manual V330

2. Select Delete.
-or-
Press the Delete button on your PC's keyboard.

Undo
VisiLogic supports up to 10 Undo actions.

The list of supported actions is shown below.

Ladder HMI Project


Delete ladder Delet e HMI Display Compile
element
Delete ladder net Delet e HMI Build All
Elements
Delete Comments Clear HMI Display
Cut Ladder Elements Cut HMI Element
Cut Ladder Net Paste HMI Elements
Paste Ladder
Element
Paste Ladder Net
Clear Sub
Import Sub

Changing an Element's Operand


To edit an element's operand:

30
Getting Started

The element appears on the net with the new Operand, Address and symbol.

Power-up Values
Power-up values can be assigned to most operands. These values are written into the
operands when the controller is turned on.

Bit operands can be SET or RESET. Integers, Long Integers, and Double Words can be
assigned values that are written into the operand at power-up.

You can assign Power-up Values in the:

Select Operand and Address Dialog Box


Check the box next to the plug-shaped icon. This enables you to enter a value in
the Power-up value fill-in field.

Operand View Window


1. Select the Operand tab at the bottom of the screen.
2. Click on the Operand type to display the list of operands.
3. Enter Power-up values in the column headed by the Power-up icon.

Program Sequencing: Modules, Subroutines, Labels & Jumps


A module is a container of subroutines. Use modules and subroutines to divide your
application into program blocks. You can then run these program blocks conditionally, from
any point in your control application.

31
VisiLogic Software Manual V330

Note Within the program tree, elements are presented alphabetically. This does not
affect the order in which the program runs.
Note Ladder Modules and subroutines can be moved via drag-and-drop, as can HMI
Modules and Displays. Again, moving elements does not affect the order in
which they run.
The Main Ladder Module, Main Subroutine, Start-up HMI Module and the Start-
up HMI Display cannot be moved via drag-and-drop or erased. For easy
identification, they are always marked in orange.
To control the Ladder program flow sequence, use the Call Subroutine function to
conditionally call subroutines. Within a subroutine, you control the sequence by
conditionally skipping over nets using Labels and Jump to Label functions. This enables
you to shorten the program scan time.

A new VisiLogic project contains the main module and subroutine for the program. Each
new subroutine contains a default number of nets and a Subroutine Return function.

Subroutines do not run if they are not called by Call Subroutine. If no Call Subroutine
commands are included in the first subroutine of the main module, the program runs until it
reaches the Subroutine Return function, and then jumps back to the beginning of the first
subroutine.

Note If a subroutine does not run, the coils in that subroutine will not be updated. For
example, Subroutine 4 contains . If MB0 is turned ON in Subroutine 1, but
Subroutine 4 is not called, O0 is not updated. The order in which I/Os are updated depend
on the PLC program scan.
Some FBs require Configuration, such as SMS. The FB Configuration should be placed
in the first subroutine of the main program module. If a Configuration is in a subroutine that
is not called into the program, linked FBs will not be processed even if the activating
condition for that FB has been turned ON.

Subroutines can be reused as many times as required. Subroutines can also be exported
and imported between projects.

PLC Program Scan

32
Getting Started

The scan cycle is performed continuously.

Note Power-up tasks, relating to the status of SB2 Power-up bit, are performed when
the controller is turned on. These tasks are performed before the program scan.

Call Subroutine & Subroutine: Return

33
VisiLogic Software Manual V330

Within Subroutines: Labels & Jumps

34
Getting Started

Ladder Logic
You use Ladder Logic to write your project application. Ladder is based on Boolean
principals and follows IEC 1131-3 conventions.

Ladder Diagrams are composed of different types of contact, coil and function block
elements. These elements are placed in nets.

In any Ladder Diagram, the contacts represent input conditions. They lead power from the
left rail to the right rail. Coils represent output instructions. In order for output coils to be
activated, the logical state of the contacts must allow the power to flow through the net to
the coil.

Toggling between PLC and HMI Editors

Getting Started with Displays


Text in HMI Displays
Displays can contain both fixed and Variable text. Fixed (constant) text does not change
according to run-time conditions. Variable text can show run-time values, such as timer
values, or display operating instructions according to system status.

35
VisiLogic Software Manual V330

Graphic Images in Displays


Simple geometric shapes can be drawn on a Display.
Graphic images can be imported from the Image Library, or created with a program such as
Microsoft Paint and then imported.

Fixed graphic images


This type of image stays on the screen and does not change until a different Display
is loaded by the program.

Variable graphic images


Variable images change according to the value of a linked operand. Binary Image
Variables are linked to bit operand status (MB, SB, I, T, O). List Image
Variables are linked to integers (MI, SI, ML, SL)
You can draw graphic images directly on a Display, or import images.

Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.

Copy & Paste Displays


You can copy and paste Display elements.

1. Copy the Display element(s) or select all of the elements in a Display.

2. Paste the elements into the Display.

36
Getting Started

-or-
Select Paste from the Edit menu.

Note When you paste elements into a Display, the elements paste into the same
relative area in the new net. The elements 'remember' their original
location. Therefore, before you paste elements into a Display that already
contains elements, move any elements that occupy the same position as
the paste selection.
If you paste variables that are linked to named constant values, note that
the constant's description is lost during the paste operation.
Variables do not retain their descriptions; they are renamed as Variable 1,
Variable 2, etc..
To copy elements between projects, copy your selection from the source
project, then open a target project without closing VisiLogic, either by
using the New Project or Open project buttons or via these options on the
Project menu.
If you close VisiLogic, the selection will be lost.

Undo

37
VisiLogic Software Manual V330

VisiLogic supports up to 10 Undo actions.

The list of supported actions is shown below.

Ladder HMI Project


Delete ladder Delet e HMI Display Compile
element
Delete ladder net Delet e HMI Build All
Elements
Delete Comments Clear HMI Display
Cut Ladder Elements Cut HMI Element
Cut Ladder Net Paste HMI Elements
Paste Ladder
Element
Paste Ladder Net
Clear Sub
Import Sub

Getting Started with Variables


Variables
Variables enable you to show run-time values, text, images, and bar graphs on the
controller's screen in response to run-time conditions. Bit, or binary text variables, for
example, display text messages on the controller's LCD screen according to the status of a
bit operand.

A Display may contain up to 16 variables.

You can also use Keypad Entry Variables to enable an operator to enter a password, or
data such as setpoints from the controller's keyboard.

Variable Editor

When you insert a variable into a display, the Variable Editor opens, showing you the
options that are relevant for that type of Variable.

38
Getting Started

After you have inserted Variables into a display, they are shown with that display in the
Project tree.

Inserting a Variable into a Display


To show variable data, you first create a field in the Display. The field is a container that
holds the data.

39
VisiLogic Software Manual V330

40
Getting Started

A field that is not big enough to contain its data is red. To resize a field, click it and drag the
edges.

41
Hardware Configuration

Hardware Configuration
The foundation of a Vision control system is the controller. The Snap-in I/O Module
provides an on-board I/O configuration. You add I/Os by integrating I/O Expansion
Modules.

VisiLogic's Hardware Configuration allows you to configure inputs: analog, digital, and high-
speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital,
and PWM high-speed outputs.

Open Hardware Configuration by clicking the button on the toolbar, or selecting it from
the View menu.

Selecting Hardware Elements

I/O Expansion Modules


Configuring a PT100 Input

43
VisiLogic Software Manual V330

Configuring I/O Expansion Modules


Note I/O Expansion Modules may require an adapter. Check with your distributor for
additional details.

44
Hardware Configuration

High-Speed Counters: I/O Expansion Modules


Certain digital inputs on certain I/O Expansion Modules are high-speed inputs that can be
used as a 16-bit high-speed counter of the following types:

High-Speed Counter
High-Speed Counter with Reset
Frequency Measurer

Configuring a High-Speed Counter

45
VisiLogic Software Manual V330

The linked operand contains the counter value which is current at the last program scan.
Use this operand in your program like any other.

Snap-in I/O Expansion Modules


Configuring Snap-in I/O Modules

High-Speed Counters: Snap-in IO Modules


Certain digital inputs on Snap-in I/O Modules are high-speed inputs that can be used as a
32-bit high-speed counter of the following types:

High-Speed Counter
High-Speed Counter with Reset
Frequency Measurer
Shaft Encoder

Configuring a High-Speed Counter

46
Hardware Configuration

The linked operand contains the counter value which is current at the last program scan.

To measure frequency, click the second input field and select the sample rate.

High-Speed Counter: Reload

Reload enables you to immediately load 0 into a high-speed counter when the counter
value reaches a target value.

47
VisiLogic Software Manual V330

Configuring a High-Speed Counter


Certain digital inputs on both Snap-in I/O and I/O Expansion modules can be used as high-
speed counters in the following modes:

High-Speed counter
High-Speed counter with Reset
Shaft encoder
Frequency Measurer
Note When you select High-Speed Counter with Reset, the controller uses an additional
input for reset; shaft encoders also require the use of two inputs.

High-speed counters are built into the hardware, you define them as part of the controller's
hardware configuration by first selecting the counter type and then linking it to an operand
that contains the counter value.

Compare Functions and Counter Values

The high-speed counter value is read once during every program scan. For this reason, do
not use the Equal (=) function together with high-speed counter values. If the counter does
not reach the value required by the Equal function during the actual program scan, the
function cannot register that the value has been reached. Use functions Greater Than Or
Equal To () and Lesser Than Or Equal To ().

Configuring a High-speed Output (PWM)


You can use certain outputs as High-speed Outputs (HSO) via PWM (Pulse Width
Modulation). When you select a High Speed Output in the Hardware, the Select Operand
and Address dialog box appears three successive times, allowing you to link operands for
the following values:

Duty Cycle
The ratio of the "on" period of a cycle to the total cycle period. This value may be from
0-1000, and is expressed as a percentage.
If, for example, the constant 750 is stored into the Duty Cycle operand, the duty cycle
is equal to 75.0% This means that the pulse will hold a positive state during 75.0% of
the total cycle.
Frequency (F)
Note that F=1/T, where T is the duration time of a complete cycle. Frequency
settings differ from pnp to npn output type.
pnp: You can use a value of 0, or a value from 8-50000Hz ( 50kHz).
npn: You can use a value of 0, or a value from 8-1500HZ.
Other frequency values are not supported.

48
Hardware Configuration

Run
Changes the operating mode of the output from normal output mode to HSO mode:
0 (SET)=Normal Mode, 1 (RESET): HSO Mode.
In the figure below, MI 22 Duty Cycle Value is equal to 250. This results in the duty cycle
being 25% of the total cycle time.

Note If values out of range enter the Duty Cycle and Frequency operands, their values
remain unchangedthe operands retain the last legal values stored.

Configuring the HSO

49
VisiLogic Software Manual V330

Configuring an Analog Input


Before you can use an analog input in your program, you must link it to an operand. An
analog input value can be contained in an MI, ML, or DW.

50
Hardware Configuration

Configuring an Analog Output

51
VisiLogic Software Manual V330

Analog I/O Ranges


Note that devices used in conjunction with the controller must be calibrated according to the
available range. Below, Range refers to the value contained by the register that is linked to
the I/O in Hardware Configuration.

Model number Resolution Range

V200-18-E1 (Snap-in I/O 10 bit (0-10V, 0-20mA, 0 - 1 0 2 3 , 1 0 2 4 u n i t s ( e xc e p t a t 4 -


module) 4-20mA) 20mA)
V120-12-R1, V120-12-R2C 204 to 1024, 820 units (at 4-
20mA)
M90 controllers (analog input)
M91-19-R1, M91-19-R2, R2C

V120-12-UN2 14 bit (0-10V, 4-20mA) 0 - 1 6 3 8 3 , 1 6 3 8 4 u n i t s ( e xc e p t a t


M90-19-UN2 4-20mA)
M91-19-TC2 Temperature ranges 3277-16383, 13107 units (at 4-
appear in the 20mA)
following table

IO-AI4-AO2 Input 12 bit (0-10V, 0- 0 - 4 0 9 5 , 4 0 9 6 u n i t s ( e xc e p t a t 4 -

52
Hardware Configuration

20mA, 20mA)
4-20mA) 819 to 4095, 3277 units (at 4-
Output 20mA)
12 bit +sign (10V, 0-
20mA, 0 - + 4 0 9 5 ( e xc e p t a t 4 - 2 0 m A )
4-20mA) 819 to 4095, 3277 units (at 4-
20mA)

Model Type Input ranges Analog Value


number

V120-12- mV -5 to 56mV -500 to 5600


UN2
M90-19-
UN2 Thermocouple
M91-19- type
TC2
B 200 to 1820C (300 to 2000 to 18200 (3000 to 32760)
3276F)

E -200 to 750C (-328 to -2000 to 7500 (-3280 to 13820)


1382F)

J -200 to 760C (-328 to -2000 to 7600 (-3280 to 14000)


1400F)

K -200 to 1250C (-328 to -2000 to 12500 (-3280 to 22820)


2282F)

N -200 to 1300C (-328 to -2000 to 13000 (-3280 to 23720)


2372F)

R -0 to 1768C (-32 to -0 to 17680 (-32 to 32140)


3214F)

S -0 to 1768C (-32 to -0 to 17680 (-32 to 32140)


3214F)

T -200 to 400C (-328 to -200 to 4000 (-3280 to 7520)


752F)

IO-PT4 -50 to 460C -500 to 4600C

Working with Analog I/O Values


Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog I/O values are contained in the register that you link to the I/O in Hardware
Configuration.

Linearizing an Analog Input Value

53
VisiLogic Software Manual V330

Linearizing an Analog Output Value

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly. In the examples below, the analog device is a pressure transducer; values are
therefore translated to millibars.

10-bit Analog Input, V200-18-E1

54
Hardware Configuration

12-bit Analog Input, IO-A14-AO2

12-bit Analog Output, IO-A14-AO2

14-bit Analog Input, V120-12-UN2

Configuring Digital Inputs


Note PNP/NPN must be set within the hardware, as explained in the technical
specifications supplied with the I/O module. The program settings do not influence the
actual hardware input setting.

55
VisiLogic Software Manual V330

You can also assign a single description to a several lines.

Configuring Digital Outputs


Digital Outputs may be Relay or Transistor type.
Note PNP/NPN must be set within the hardware, as explained in the technical
specifications supplied with the I/O module. The program settings do not influence the
actual hardware input setting.

56
Hardware Configuration

You can also assign a single description to a several lines.

Assign a Description to Multiple Operands


To assign a Description to multiple operands, select a range of operands by dragging your
cursor across them, then type a description and click OK.

You can also copy and paste text to and from other Windows applications.

57
Controller Settings

Communication and OS-Controller Menu


Via this menu, you can

Set PC communication parameters (non-modem) to enable PC-PLC communication.


Reset and initialize a PLC, enter Stop and Run modes, get RTC values as well as
reset the RTC.
Get COM Parameters and PLC status.
Install an Operating System (O/S) in a PLC
Check Network Status

Vision Communication PC Settings

Display the
current
communicati
on settings
by selecting
Communicati
on & OS
from the
Connection
menu.

The default
settings are
shown here.

You can
cause the
Unit ID# to
be
permanently
assigned to
the project
via Project
Properties.

PC COM Port, Retries and Time-Out are the communication settings between
Parameters V i s i L o g i c a n d t h e c o n t r o l l e r . N o t e t h a t i f y o u a r e w o r k i n g wi t h a
network, the TimeOut should be greater than 1 second.

Communicate Use these options to communicate with networked controllers.


with OPLC D i r e c t C o n n e c t i o n : s e l e c t t h i s t o c o m m u n i c a t e wi t h a n y c o n t r o l l e r t h a t
is connected to your PC via the download cable, including a network
bridge.
Within Network:select this to communicate with a controller that is
i n t e g r a t e d i n t o a n e t wo r k , t h e n s e l e c t t h e c o n t r o l l e r ' s I D n u m b e r
Note ID numbers 1-63 are reserved for controllers linked via
CANbus; ID numbers 64-127 are reserved for controllers networked via
RS485. Using this range of ID numbers prevents a polled controller
from attempting to act as a CANbus bridge, preventing it from
attempting to locate the requested controller.

Vision OPLC Click Get OPLC Information to display information about the controller
Information you have selected in Communicate with OPLC.

59
VisiLogic Software Manual V330

Run, Reset, Initialize

Note When
you click a
button, your
PC will access
the controller
selected in
Communicate
with OPLC.

Set RTC These are the values of your PC's clock. Click Set RTC to import
these values into the RTC of the controller.

Get Vision Click to view the current PLC settings


RTC Current
Values

Run Click to run the current program in the PLC.

Stop Click to stop the current PLC program.

Reset Click to reset the PLC, and reinstall any values preset in the
program, such as Timers.

Reset & Click to reset, reinstall any preset values, and initialize all
Initialize m em ory operands

Get COM Parameters and PLC status

60
Controller Settings

Select Get to view


communication
parameters and
PLC status in the
controller you are
currently
communicating with.

This is the controller


selected in
Communicate with
OPLC.

Downloading an OS

Selecting an OS
version via the drop-
down arrow and
clicking Download
installs a new
Operating System (OS)
into the controller.

Note that System Fonts


are used to by the
controller to show
system messages that
are not part of your
program, such as a
message that the
controller is in Stop
Mode. These fonts are
part of the OS, and do
not need to be
downloaded separately.

The OS cannot be
downloaded via a
network connection.
The controller must be
directly connected to
the PC via the
programming cable,
and Direct Connection
must be selected in
Communicate with
OPLC.

In addition, only COM

61
VisiLogic Software Manual V330

Port 1 can be used to


download an OS.

When the controller is


connected to the PC,
clicking Check displays
the currently installed
OS.

To obtain the most


recently released OS
versions, run Live
Update. Note that Live
update does not install
the new operating
system, which must be
installed as described
above.

O\S

Check Network Status


The network status is checked via the bridge. Access Check Network Status by opening
the Connection menu, selecting Communication & OS, then clicking the network tab.

62
Displays: HMI

HMI Display Editor


Use the HMI Display Editor to create the Displays that are shown on the controller screen
after the program is downloaded. When you select HMI from the Project Explorer tree, a
Display replica opens. The size of this replica reflects the type of Vision controller you have
selected in your project's Hardware Configuration.

Displays tell your operators what to do. You can have your operators log in with a
password, enter setpoints and other data, and instruct the operator what to do in case of a
system problem or alarm. A Display can contain both text and images. Text and images
can be both fixed and/or variable.

Variables are inserted into a Display to:

Show run-time values as integers


Represent run-time values with either text, images, or bar graphs
Show text messages that vary according to runtime conditions.
Below, click the elements outlined in blue to learn more about a specific
feature.

Variables
Variables enable you to show run-time values, text, images, and bar graphs on the
controller's screen in response to run-time conditions. Bit, or binary text variables, for
example, display text messages on the controller's LCD screen according to the status of a
bit operand.

A Display may contain up to 16 variables.

You can also use Keypad Entry Variables to enable an operator to enter a password, or
data such as setpoints from the controller's keyboard.

Variable Editor
When you insert a variable into a display, the Variable Editor opens, showing you the
options that are relevant for that type of Variable.

63
VisiLogic Software Manual V330

After you have inserted Variables into a display, they are shown with that display in the
Project tree.

Inserting a Variable into a Display


To show variable data, you first create a field in the Display. The field is a container that
holds the data.

64
Displays: HMI

65
VisiLogic Software Manual V330

A field that is not big enough to contain its data is red. To resize a field, click it and drag the
edges.

Align, Space & Center Display Elements


When you align, space, and center elements, be careful not to make them the same size
and align them one on top of the other. If elements are 'fused' together in this way, they
cannot be separated.

Integer Variables (MI, SI, ML, SL, DW, SDW)


You can represent integer values by showing a numeric value on screen, or by showing
text messages, images, or bar graphs. You can also enable data and passwords to be
entered into the system via the controller keyboard.

Changing Displays (Jumps)


To change between Displays, set Jumps. A Jump contains a Jump condition, which is
linked to a bit operand, and a destination Display. You can also load a Display by placing a
function in a Ladder net.

Setting Jumps
1. Open a Display.
2. Click on a Jump Condition field, and select an operand.

66
Displays: HMI

3. Click on Display field, and select a destination Display.

To edit a Jump, click the desired field and make a new selection.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.
Note To see a list of Displays in a project together with their Display numbers, select
HMI Information from the View menu.

Calling a Subroutine via Display


You can use a specific Display to call a specific Subroutine. This Subroutine will run during
the time that the Display is shown on the controller's LCD.

HMI Information
To see a list of Displays in a project together with their Display numbers, select HMI
Information from the View menu.

67
VisiLogic Software Manual V330

Load HMI Display: Functions


There are three Ladder functions connected to HMI Displays.

Load HMI Display


Causes a Display to be shown on the controller's LCD as a response to a Ladder
Condition.

HMI Display Loaded


This turns a linked MB ON when a specific Display begins loading. HMI Display Loaded is
located on the Calls menu.

]
Load Last Display
Loads the last Display loaded by the application. This function is located on the Calls menu.

68
Displays: HMI

To see a list of HMI Displays in a project, together with the Display number, select HMI
Information from the View menu.

Resizing HMI Elements


Resize an element by selecting it, then:

Dragging the image handles.

Clicking the Fit to Original Size button.

Clicking the Element Resizer, then selecting the desired size.

69
VisiLogic Software Manual V330

Selecting more than one element, then make them of uniform size via the Resize
buttons.

HMI Element Resizing Limitations

Elements 'grow' down, and to the right. If resizing will cause Variable elements to collide, or
any element to extend beyond the boundaries of the Display, the element cannot be
returned to its original size, or resized to a larger size.

Note 'Original size' is the actual size of the element as it appears in the element's
ToolTip.
'Original size' cannot be used to resize Variable elements if the elements have
differing original sizes.

.
Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.
Resizing text elements changes the size of the text field, but does not affect font size.
Fit to Original Size does not affect geometric shapes that are drawn on the Display.
Shapes that are imported are resized in proportion to their original size.

HMI SB and SIs


SB 6 Keyboard is active

70
Displays: HMI

SB Touchscreen Active ( has been touched), V280 only


SB 17 Enable/Disable Touch-screen indication (Message Board function), enables a
m e s s a g e t o b e h a n d w r i t t e n o n t h e t o u c h - s c r e e n wi t h a s t y l u s
SB 30 HMI keypad entries completed
SB 31 Refresh current LCD screen display variables
SB 32 HMI keypad entry in progress
SB 33 Display, Call Sub: Turns ON for a single scan cycle, when a DS containing a
Call Sub starts loading. Note that the positive status of SB33 is only visible
within t he specific subroutine when it runs. May be used to initialize operands
in the HMI subroutine
SB 34 D i s p l a y E xi t : T u r n s O N f o r a s i n g l e s c a n c y c l e w h e n a d i s p l a y i s e xi t e d .
SB 40 Key: # 0
SB 41 Key: # 1
SB 42 Key: # 2
SB 43 Key: # 3
SB 44 Key: # 4
SB 45 Key: # 5
SB 46 Key: # 6
SB 47 Key: # 7
SB 48 Key: # 8
SB 49 Key: # 9
SB 50 Plus/Minus
SB 51 Left Arrow
SB 52 Right Arrow
SB 53 ENTER
SB 55 Up
SB 56 Down
SB 57 ESC
SB 58 F1
SB 59 F2
SB 60 F3
SB 61 F4
SB 62 F5
SB 63 F6
SB 64 F7
SB 65 F8
SB 66 F9
SB 67 F10
SB 68 F11
SB 69 F12
SB 70 F13
SB 71 F14
SB 72 F15
SB 250 K e y p a d e n t r y wi t h i n l i m i t s
SB 251 K e y p a d e n t r y e xc e e d s l i m i t s
SI 6 Current key pressed
SI 7 LCD Contrast Control: 0=Minimal Contrast, 50=Medium Contrast, 100=Maximal
Contrast
SI 9 LCD Backlight intensity
SI 249 Last Active Keypad Entry Variable
SI 250 C u r r e n t l y a c t i v e k e y p a d e n t r y , r e a d / wr i t e . W h e n e i t h e r S B 2 5 0 ' K e y p a d E n t r y
W i t h i n L i m i t s ' o r S B 2 5 1 ' K e y p a d E n t r y E xc e e d s L i m i t s ' t u r n O N , t h e i n d e x
number of the variable is stored here.
SI 251 Previous HMI Display Number
SI 252 Current HMI Display Number.
T o s e e a l i s t o f D i s p l a y s i n a p r o j e c t t o g e t h e r wi t h t h e i r D i s p l a y n u m b e r s , s e l e c t
HMI Inf ormation f rom the View menu.

71
VisiLogic Software Manual V330

Images
Graphic Images in Displays
Simple geometric shapes can be drawn on a Display.
Graphic images can be imported from the Image Library, or created with a program such as
Microsoft Paint and then imported.

Fixed graphic images


This type of image stays on the screen and does not change until a different Display
is loaded by the program.

Variable graphic images


Variable images change according to the value of a linked operand. Binary Image
Variables are linked to bit operand status (MB, SB, I, T, O). List Image
Variables are linked to integers (MI, SI, ML, SL)
You can draw graphic images directly on a Display, or import images.

Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.

Images: Fixed
This type of image stays on the screen until a different Display is loaded by the program.

72
Displays: HMI

Variable Images
Variable images change according to the value of a linked integer.

Image Library
A library containing hundreds of images can be found in the Unitronics folder on your hard
drive (Unitronics\VisiLogic\Data\Images).

73
VisiLogic Software Manual V330

This makes it easy to locate and import images into your displays.

Note An imported image cannot exceed the size of the controller's display screen listed
in the model's technical specifications. For example, the V230's Display screen is 128x64
pixels, therefore an image of 100x100 pixels cannot be used unless it is resized in a third-
party utility such as Paint.

For tips on how to edit images to best suit the controller's Display screen, first read the Help
Topic Creating Images with Microsoft Paint, and then view two .avi files located on the
VisiLogic setup CD: Edit Image Collections with Paint Step 1.avi and Edit Image
Collections with Paint Step 2.avi.

Display Variable Types


Variable Types: Table
Text Image Numeric Clock Timer
Variable Variable Variable Variable /Counter
Variable

74
Displays: HMI

Binary(bit) Binary Image Number Real Time Timer


T e xt Clock
List of List of Images: P a s s wo r d Clock Counter
T e xt s : b y by Pointer Variables
Pointer
List of List of Images: Bar Graph
T e xt s : b y by Range
Range
Display
ASCII

Bar Graphs: Displaying Values


Bar graphs can be used to show how values progress. You can use them together with
other Display elements to help operators track system progress and status.

This is a sample of a Display and how its elements can look on the controller's LCD.

Inserting and Defining the Variable

1. Create a Variable field, and then select Bar Graph.

75
VisiLogic Software Manual V330

2. Select from the features and formats shown below.

Bit (Binary) Text Variable


This type of variable displays a different text message on the controller's LCD screen
according to the status of a bit operand.

76
Displays: HMI

Inserting and Defining the Variable

1. Create a Variable field, and then select Binary Text from the Text menu.

77
VisiLogic Software Manual V330

2. Link a bit operand, and enter text for both bit states.

Bit (Binary) Image Variable


This type of variable displays a different image on the controller's LCD screen according to
the status of a bit operand.

78
Displays: HMI

Inserting and Defining the Variable

1. Create a Variable field, and then select Binary Image from the Image menu.

79
VisiLogic Software Manual V330

2. Link a bit operand, and select images for both bit states.

Clock Variables
Place Clock Variables in Displays to show times and dates. In addition to showing RTC
values, use Clock Variables in conjunction with Indirect time functions to enable an operator
to set times via the controller keypad.

A keypad-enabled Clock Variable accepts a number entered via the controller keyboard,
and stores the number in the operand linked to the Variable.

Inserting and Defining a Keypad Entry Clock Variable

Create a Variable field and select Time Function, then select the format and display
font.

80
Displays: HMI

Note Step-by-step instructions on how to use Keypad Entry Clock Variable values are
provided in the Indirect Clock function example.

Clock Variable: View RTC


The Real-Time-Clock value in the controller can be shown in a Display.

Inserting and Defining the Variable

Create a Variable field and select Real Time Clock, then define the Variable by
selecting the time format and display font. You do not link an operand because this
variable is already linked to the RTC.

81
VisiLogic Software Manual V330

List of Texts: by Pointer


This type of Variable contains numbered lines of text. You link the Variable to an operand.
The value within that operand 'points' to the number of a line within the list. When the
operand value is equal to a particular line number, the text of that line is shown in the
Display.

82
Displays: HMI

Inserting and Defining the Variable

1. Create a Variable field, and then select List of Texts: by Pointer.

83
VisiLogic Software Manual V330

2. Define the Variable by entering lines of text and linking an operand.

List of Images: by Pointer


This type of Variable contains a list of numbered images. You link the Variable to an
operand. The value within that operand 'points' to the number of an image within the list.

84
Displays: HMI

When the operand value is equal to a particular image's number, that image is shown in
the Display.

Inserting and Defining the Variable

1. Create a Variable field, and then select List of Images: by Pointer.

2. Define the Variable by adding images to the List of Images and linking an operand.

85
VisiLogic Software Manual V330

Locating Images

List of Images: by Range


This type of Variable contains a list of images. You define a range of values for each image
and link the Variable to an operand. The value within this operand is compared to the
range you have defined for each image. When the operand value falls within a specified
range, the image assigned to that range is shown in the Display.

86
Displays: HMI

Note that you can define the beginning and end of a range using either a Constant value or
an MI.

Inserting and Defining the Variable

1. Create a Variable field, and then select Range of Images: by Pointer.

87
VisiLogic Software Manual V330

2. For each line: define the beginning of the range, the end of the range, and assign an
image.

List of Texts: by Range

88
Displays: HMI

This type of Variable contains lines. You define a range and enter text for each line, and
link the Variable to an operand. The value within this operand is compared to the ranges
you have defined for each line. When the operand value falls within a specified range, the
text assigned to that range is shown in the Display.

Note that you can define the beginning and end of a range using either a Constant value, or
an MI.

Inserting and Defining the Variable

1. Create a Variable field, and then select Range of Texts: by Pointer.

89
VisiLogic Software Manual V330

2. For each line: define the beginning of the range, the end of the range, and assign
text.

3. Use the Add Line button and Delete Line button as needed.

Display ASCII String


You can display a vector of MI, ML, or DW values as an ASCII string. The value of each
byte in the vector is displayed as an ASCII character.

Display ASCII String is located on the Text Variable menu.

90
Displays: HMI

The Display String 'trigger' MB is automatically reset.

Note String Pattern defines the size of the text field. The default string 'Text To Display'
will provide a field long enough to contain most strings.

To create a field that contains enough bytes to provide for the width of the ASCII characters
in a variable string, enter a line of text in String Pattern that contains characters of the
necessary width.

The character ' W ' is generally the widest character in a font set.

91
VisiLogic Software Manual V330

Note A vector is read either until the end of the defined vector length, or until a 'null'
character is encountered. By adding a null character to the end of the stream, you can mark
the end of a data string. This can prevent other data, that might be present in a vector, from
being added to the data string when the vector is read.

Number Variable
A Number Variable enables you to:

Show any numeric value within a Display.


Control the format in which that value is shown, including the placement of a decimal
point and leading zeros.
Use Linearization to show a converted value, such as an analog temperature
converted to degrees Celsius.
Allow the operator to use the controller keypad to enter a number, such as a setpoint,
via a Keypad Entry Variable.
Inserting and Defining the Variable

1. Create a Variable field, and then select Number.

2. Select from the features and formats shown below.

92
Displays: HMI

To see how to use Keypad Entry Variables, refer to the Indirect Clock example.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

Note SB 250, Keypad Entry within Limits, turns ON when a legal value is entered; SB
251, Keypad entry exceeds limits, turns ON when a value is out of range. You can use the
status of these bits, for example, to provide a jump condition to another Display. When
either of these SBs turns ON, the index number of the active variable is stored in SI 249.

Password: Keypad Entry


You can insert a Password Variable that requires operators to enter a password via the
controller's keyboard.

Note SB 250, Keypad Entry within Limits, turns ON when a password is correctly
entered; SB 251, Keypad entry exceeds limits, turns ON when a password is incorrect. You
can use the status of these bits, for example, to provide a jump condition to another
Display. When either of these SBs turns ON, the index number of the active variable is
stored in SI 249.

Inserting and Defining the Variable

1. Create a Variable field, and then select Password from the Numeric menu.

93
VisiLogic Software Manual V330

2. Enter a password as shown below.

94
Displays: HMI

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

Timers: Displaying Values


A Timer Variable shows a timer's value in a Display.

1. Create a Variable field, and then select Timer.

2. Select from the features and formats shown below.

95
VisiLogic Software Manual V330

Display/Preset Counter Values


A Counter Variable shows a counter's value in a Display. You can also use this variable to
enter a

1. Create a Variable field, and then select Counter.

96
Displays: HMI

2. Select from the features and formats shown below.

'Touch' Property ( V280 only)


When the V280 is selected in Hardware Configuration, you can assign Touch properties to
any screen element.

97
VisiLogic Software Manual V330

To edit the MB that is already linked to the Touch element, select the element and then
click the Assign 'Touch" Property icon; the Select Operand box opens.

Text
Fonts
Fonts are used in text boxes and to display Variable data.

Note Fonts are not standardized. For example, two different PCs may both contain a
font called Arial. Displays created on one PC using that font may look different or distorted
when opened on the other PC. This can be fixed by opening the application and replacing
the font; you may replace the font with a font of the same name to solve this problem.

Text: Fixed
Fixed (constant) text does not change according to run-time conditions.

To place fixed text messages in a Display:

98
Displays: HMI

99
Ladder

Calls: Program Control


Calls, Jumps, and Labels
The Call menu's functions enable you to set the sequence in which your program runs.

Program Sequencing: Modules, Subroutines, Labels & Jumps


A module is a container of subroutines. Use modules and subroutines to divide your
application into program blocks. You can then run these program blocks conditionally, from
any point in your control application.

Note Within the program tree, elements are presented alphabetically. This does not
affect the order in which the program runs.
Note Ladder Modules and subroutines can be moved via drag-and-drop, as can HMI
Modules and Displays. Again, moving elements does not affect the order in
which they run.
The Main Ladder Module, Main Subroutine, Start-up HMI Module and the Start-
up HMI Display cannot be moved via drag-and-drop or erased. For easy
identification, they are always marked in orange.
To control the Ladder program flow sequence, use the Call Subroutine function to
conditionally call subroutines. Within a subroutine, you control the sequence by

101
VisiLogic Software Manual V330

conditionally skipping over nets using Labels and Jump to Label functions. This enables
you to shorten the program scan time.

A new VisiLogic project contains the main module and subroutine for the program. Each
new subroutine contains a default number of nets and a Subroutine Return function.

Subroutines do not run if they are not called by Call Subroutine. If no Call Subroutine
commands are included in the first subroutine of the main module, the program runs until it
reaches the Subroutine Return function, and then jumps back to the beginning of the first
subroutine.

Note If a subroutine does not run, the coils in that subroutine will not be updated. For
example, Subroutine 4 contains . If MB0 is turned ON in Subroutine 1, but
Subroutine 4 is not called, O0 is not updated. The order in which I/Os are updated depend
on the PLC program scan.
Some FBs require Configuration, such as SMS. The FB Configuration should be placed
in the first subroutine of the main program module. If a Configuration is in a subroutine that
is not called into the program, linked FBs will not be processed even if the activating
condition for that FB has been turned ON.

Subroutines can be reused as many times as required. Subroutines can also be exported
and imported between projects.

PLC Program Scan

The scan cycle is performed continuously.

Note Power-up tasks, relating to the status of SB2 Power-up bit, are performed when
the controller is turned on. These tasks are performed before the program scan.

102
Ladder

Call Subroutine & Subroutine: Return

103
VisiLogic Software Manual V330

Within Subroutines: Labels & Jumps

104
Ladder

Labels & Jumps


Labels enable you to jump over Ladder nets within a subroutine.

Using Labels

1. Place a Label in a net.

2. Create the condition that will cause the jump condition.


3. Place a Jump after the condition

105
VisiLogic Software Manual V330

Renaming Labels

1. To rename a Label, double click it, enter the new name and click Apply.

106
Ladder

You can also use labels as bookmarks, by using them to mark program sections and then
locating them using the Go To Label <Alt> + <Right/Left arrow> and List of Labels <Ctrl> +
<L> utility.

Call Subroutine
This function causes a subroutine to run in response to a Ladder Condition.

Using Call Subroutine

107
VisiLogic Software Manual V330

Subroutine: Return
A subroutine runs until it reaches a Subroutine Return function, and then jumps back to the
beginning of the previous subroutine.

108
Ladder

Using Subroutine Return

109
VisiLogic Software Manual V330

Load HMI Display: Functions


There are three Ladder functions connected to HMI Displays.

Load HMI Display

Causes a Display to be shown on the controller's LCD as a response to a Ladder


Condition.

HMI Display Loaded

This turns a linked MB ON when a specific Display begins loading. HMI Display Loaded is
located on the Calls menu.

110
Ladder

Load Last Display

Loads the last Display loaded by the application. This function is located on the Calls menu.

To see a list of HMI Displays in a project, together with the Display number, select HMI
Information from the View menu.

Open a Subroutine
To open a Subroutine for editing:

Double-click in the Project Explorer tree, -or-


Right-click the Subroutine in the Project Explorer tree, then select Open, -or-
Right-click a Call Subroutine element to access the targeted subroutine.

Name-Rename Modules and Subroutines

111
VisiLogic Software Manual V330

Ladder Nets with Feedbacks


According to IEC 1131 - 3, it is possible to create Ladder Diagram nets that contain
feedback loops, i.e. where an element is used as both contact(s) and coil(s) in the same
net.

In Ladder Diagram, all external input values such as those associated with contacts are
gathered before each net is evaluated.

In the above example:

Where the net uses the state of its own output, the value of FAN (MB 7) coil associated with
an inverted contact of MB 7 is always the value resulting from the previous evaluation.

However, if the value of FAN (MB 7) is used in any following nets, the latest evaluated state
is used.

Elements
Ladder Elements and Functions List
Contacts

Contacts

112
Ladder

Direct Contact (NO)

Inverted Contact (NC)

Positive Transition (Rise)

Negative Transition (Fall)

Coils

Coils
Direct Coil

Inverted (negated) Coil

Set Coil

Reset Coil

Compare

Compare Functions
Greater Than

Greater/Equal

Equal

Not Equal

Less/Equal

Less Than

Math

Math Functions
Add

Subtract

Multiply

Divide

Linearization

Factor

P o we r

Square Root

Increment/Decrement
Floats

Floating Point Functions


Basic: Store Direct,Add, Sub, Mul, Div, Abs
E xt e n d e d : S q u a r e R o o t , P o w e r , E x p , L N , L o g 1 0 , A M u l ( 1 0 ^ B )
Trig: Sin, Cos, Tan, ArcSin, ArcCos, ArcTan, Degrees, Radians
Compare: Greater Than, Greater Equal, Equal, Not Equal, Less Equal, Less
Than
Convert: A+B/n, INV (A+B/n)
Logic

113
VisiLogic Software Manual V330

Logic Functions

AND

OR

XOR

Shift Left/Right

Rotate Left/Right

Bit Set/Reset

Bit Test

Clock

Clock Functions
Time

Day Of W eek

Day Of Month
Month

Year

Store

Store Functions
Store Direct Function

Store Indirect Function

Store Timer/Counter Preset

Load Indirect Functions

Load Timer/Counter Preset

Store Time/Counter: Current Value

Load Timer/Counter: Current Value

Vector

Vector
Load

Store

Find

Fill / Fill Offset

Copy / Copy Offset

Vector: Transpose
Compare / Compare Offset

Bit to Numeric, Numeric to Bit

Get Max

Get Min

114
Ladder

Calls

Calls
Jump to Label
Load HMI Display

HMI Display Loaded

Load Last HMI Dis play

Call Subroutine

Subroutine Return

Data Tables

Data Tables

Read/Write

Direct Read/Write

For information regarding advanced functions, such as MODBUS, check the topic FBs
Library.

Placing a Ladder Element in a Net

1. Select any type of Ladder element by:


Clicking its icon on the Ladder toolbar, -or-

Selecting it from the Ladder menu, -or-


Right-clicking on the Ladder to display the Ladder menu and then selecting the
element.

2. Move the element to the desired net location, then click.

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

115
VisiLogic Software Manual V330

Delete Elements
Select the desired element(s), then

Select Cut. -or-

-or-
Select Cut or Copy from the Edit menu.

Click the Delete button on the toolbar. -or


Right-click the Element, then select Delete from the menu.

Change Element Type


To change an element type after it is placed in a net and linked to an operand:

Right-click the element, select Replace Ladder Element, then select the appropriate
element type.

116
Ladder

After the element has been changed, it remains linked to the same operand.

You can use this method to change contact or coil types, to switch math and other function
types while retaining the same input and output operands.

Contacts
A contact represents an action or condition. You can link it to any of the following bit
operands:

Memory Bit
System Bit
Network System Bit
Network System Input
Output
Timer
Each contact condition in a net is loaded into the bit accumulator and evaluated to
determine the coil (output or expression) condition. There are 4 types of contacts:

Direct Contact
Inverted Contact
Positive Transition Contact (Rise or One Shot)
Negative Transition Contact (Fall)
Contacts can be connected in series and in parallel on a Ladder net.

Coils
A Coil represents a result or expression of an action. A coil turns ON when the preceding
net conditions are ON, allowing power flow to reach the coil from the net. If the preceding
net conditions are OFF, a coil turns OFF. You can link it to any of the following bit
operands:

Memory Bit
System Bit
Output
Timer
Each contact condition is evaluated in a net to determine the coil (result or expression)
condition. There are 4 types of coils:

Direct Coil
Inverted Coil
Set Coil
Reset Coil

117
VisiLogic Software Manual V330

Note Do not energize a coil more than once in a program.

Direct Coil
An Direct Coil turns ON when the preceding net conditions are ON, allowing power flow to
reach the coil from the net. If the preceding net conditions are OFF, an direct coil turns
OFF. You can link it to any of the following bit operands:

Memory Bit
System Bit
Output
Timer
The coil can represent an external output device (for example: alarm bell) or to an internal
system element, as for example, SB 41, which is key #1 on the controller's keyboard..

Direct Contacts
A Direct Contact is a normally open (NO) contact condition. You can link it to any of the
following bit operands:

Memory Bit
System Bit
Network System Bit
Network System Input
Output
Timer
A door buzzer is an example of a Direct Contact. When you push the buzzer, power flows
through the circuit and the buzzer sounds. When you release the buzzer, the sound stops.

During the system scan, the processor evaluates the program elements net by net.

If the Direct Contact bit operand (the door buzzer) is OFF (logic 0): power will not flow
through the Direct Contact. The door buzzer is silent.

If the Direct Contact address (the door buzzer) is ON (logic 1): power will flow through the
Direct Contact. The door buzzer sounds.

Inverted Coil
An Inverted Coil turns OFF when the preceding net conditions are ON, allowing power flow
to reach the coil from the net. If the preceding net conditions are OFF, an inverted coil
turns ON. You can link an Inverted Coil to an:

Memory Bit
System Bit
Output
Timer
The coil can represent an external output device (for example: alarm bell) or to an internal
system element, as (for example, SB 4 Divide by 0.

To place a coil in a Ladder net:

1. Click a Coil icon on the toolbar.


2. Move your cursor to the desired location in the net, then click.
3. The coil drops into place.

Inverted Contacts

118
Ladder

An Inverted Contact represents a normally closed contact condition. You can link it to any
of the following bit operands:

Memory Bit
System Bit
Network System Bit
Network System Input
Output
Timer
An Inverted Contact condition can be from an external input device (for example: a push
button) or from an internal input system element (for example: SB 50 Key +/- is pressed).

An emergency light contains an example of an Inverted Contact.

Normally, there is power flow through the emergency light's Inverted Coil and the light
stays off.
During an electric power outage, the power flow through the Inverted Coil stops and
the emergency light comes on.
During the system scan, the processor evaluates the program elements net by net.

If the Inverted Contact address (power supply) is ON (logic 1): power will flow through the
Inverted Contact. The emergency light will stay off.

If the Inverted Contact address (power supply) is OFF (logic 0): power will not flow through
the Inverted Contact. The emergency light comes on.

If the power outage ends and power flow is returned to the Inverted Contact, it will close
again and the emergency light will go off again.

Negative Transition Contact


A Negative Transition Contact gives a single one-shot pulse when the bit operand it is
linked to falls from ON (logic 1) to OFF (logic 0). A Negative Transition Contact registers the
fall in status from ON to OFF. You can link it to any of the following bit operands:

Memory Bit
System Bit
Network System Bit
Network System Input
Output
Timer
A computer ON/OFF button is an example of a Negative Transition Contact. The computer
is ON.

If you push the ON/OFF button in without releasing it, the computer will not shut down. But
when you release the button, the system registers a change in status from ON to OFF. The
computer then shuts down.

During the system scan, a Negative Transition Contact address is evaluated for a transition
from ON to OFF. A transition allows power to flow through the Negative Transition Contact
for one scan.

At the end of a scan, the Negative Transition Contact is reset to OFF (logic 0). The
Negative Transition Contact can only be re-activated when the triggering signal again
changes from ON to Off.

Positive Transition Contact

119
VisiLogic Software Manual V330

A Positive Transition Contact gives a single one-shot pulse when its reference address
rises from OFF (logic 0) to ON (logic 1). A Negative Transition Contact registers the fall in
status from OFF to ON. You can link it to any of the following bit operands:

Memory Bit
System Bit
Network System Bit
Network System Input
Output
Timer
A cellular phone keypad key is an example of a Positive Transition Contact. When you
push a key a number is displayed on the screen. It does not matter if you push the key
quickly or hold it down for several seconds. The number will only appear once on the
screen.

The cellular phone registers the transition from key NOT pressed to key pressed. The
length of time the key is pressed is not relevant. You must release the key and press it
again to repeat the number on the cellular phone screen.

During the system scan, a Positive Transition Contact address is evaluated for a transition
from OFF to ON. A transition allows power to flow through the Positive Transition Contact
for one scan.

At the end of a scan, the Positive Transition Contact is reset to ON (logic 1). The Positive
Transition Contact can only be re-activated when the triggering signal again changes from
OFF to ON.

Reset Coil
A reset coil turns a set coil OFF (unlatches), when the preceding net conditions are ON,
allowing power flow to reach the reset coil from the net.

Note Once a set coil is turned ON, it stays ON, independent of the original set condition,
until a reset coil linked to the same address resets (unlatches) the coil condition. You can
link it to any of the following bit operands:

Memory Bit
System Bit
Output
Timer
Do not use a set coil without a reset coil in a program.

Set Coil
A set coil separates the coil from the action or condition that energized the coil. Once
energized, a set coil's result is no longer dependant on the action that energized it. A set
coil stays energized (latched) until its condition is reset (unlatched) by a reset coil. You can
link it to any of the following bit operands:

Memory Bit
System Bit
Output
Timer
An example of a set coil is an overhead light. When you turn on a light, it stays lit until you
turn it off (reset or unlatch it) or the light bulb burns out. You do not have to hold the light
switch to keep the light on.

An example of a coil that you do not want to be set ( latched) is a car horn. You expect it to
toot only when you press on the horn button and you expect it to stop when you stop
pressing on the horn button.

120
Ladder

Do not use a set coil without a reset coil in a program.

Operands
Operands
Ladder elements and functions are linked to operands. Operands contain data. The Ladder
elements and functions determine the way that operand data is used in your program.
Every Operand has an Address and a Description. When you select a Ladder element and
place it in a net, the Select Operand and Address box opens, enabling you to link an
Operand type, select an address, and assign a description.

To View Operand Lists

1. Select the Operand tab at the bottom of the Output Window; the operands are
displayed.
2. Click an operand type in the left pane; a list of that operand type is displayed.
Note that you can edit values and descriptions in the Output Window.

Operand Types and Symbols

Type Symbol Quantity Value Address Range


Input I 544 Bit I0-I543
Output O 544 Bit O0-O543
Timer T 192 32-bit T0-T191
Counters (C) c 24 16-bit C0-C24
Memory Bit MB 2048 Bit MB0-MB2047
Memory Integer MI 1600 16-bit MI0-MI1599
Memory Long Int eger ML 256 32-bit ML0-ML255
Double W ord (unsigned) DW 64 32-bit D W 0 - DW 6 3
Memory Floating Point MF 24 32 MF0-MF24
Integer
Constant Value # Dynamic Dynamic

System Operands

System Operands are connected to certain functions and values in the controller's
operating system.
Type Symbol Quantity Value Address Range
System Bit SB 512 Bit SB0-SB511
System Integer SI 512 16-bit SI0-SI511
System Long Integer SL 56 32-bit SL0-SL63
System Double W ord (unsigned SDW 64 32-bit

Network Operand Types and Symbols

If a controller is networked, the following operands are accessible to other controllers:


Type Symbol Quantity Value Address Range
Network System Bit NSB 8 Bit SB200-SB207
Network Input NI 17 Bit I0-I16
Network System Integer NSI 2 16-bit SI200-SI201

Linking Operands to Elements


When you place a Ladder element or function on a net, the Select Operand and Address
dialog box opens. All of the operands and operand types that are displayed in the Select
Operand and Address dialog box are applicable to the element or function that you have

121
VisiLogic Software Manual V330

selected. To edit an operand attached to an element, you can also double-click on the
yellow Description field of an element after it has been placed in the Ladder.

You can search for a particular operand by using the Search: Symbolic Name function at
the bottom of the dialog box.

Click on the elements in the dialog box to learn their function.

Power-up Values
Power-up values can be assigned to most operands. These values are written into the
operands when the controller is turned on.

Bit operands can be SET or RESET. Integers, Long Integers, and Double Words can be
assigned values that are written into the operand at power-up.

You can assign Power-up Values in the:

Select Operand and Address Dialog Box


Check the box next to the plug-shaped icon. This enables you to enter a value in
the Power-up value fill-in field.

Operand View Window


1. Select the Operand tab at the bottom of the screen.
2. Click on the Operand type to display the list of operands.
3. Enter Power-up values in the column headed by the Power-up icon.

Constant Values #
A Constant Value is an integer number, either signed or unsigned, that is created by the
programmer. Constant Values are symbolized by a number sign.

122
Ladder

To use a Constant Value in your program,


select the Constant option in the Select
Operand and Address dialog box and enter a
number.
You can also select the unsigned integer
option.

Constant Value Operands

You can create a list of named Constant Value Operands in the Output Window at the
bottom of the screen.

1. Select the Constant tab in the Output Window; the list of Constant Values opens.
2. Enter a Description and a Value; note the Unsigned option.
3. Create a new Constant Value by pressing Enter.
When you create a Constant Value in this way, the program references the value by the
description.

By entering the Constant Value's description in the Select Operand and Address dialog
box, you can use this Constant Value in your application.

Double Word (DW)


Double Words are 32-bit unsigned integer operands, maximum value 4,294,967,296.

There are 64 Double Words, address DW0 to DW63.

Inputs (I)
Inputs are bit operands (0 or 1).

The number of Inputs varies according to the Snap-in I/O Modules and I/O Expansion
Modules you integrate into your system.

An Input is an actual hardwired input connection into the controller.

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

Memory Bits (MB)


Memory Bits are bit operands ( 0 or 1).

There are 1024 MBs, address MB 0 - MB 1023.

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

Memory Integers (MI)


Memory Integers are 16-bit integer operands that may be signed or unsigned. The range of
an MI is -32768 to +32767.

There are 1024 MIs (Address MI 0 - MI 1023).

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

123
VisiLogic Software Manual V330

Memory Long Integer (ML)


Memory Long Integers are 32-bit integer operands that may be signed or unsigned, with a
range of -2,147,483,648 to +2,147,483,647.

There are 256 MLs (ML 0 - ML 255).

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

Memory Floating Point Integer (MF)


Floating point integers are 32-bit integer operands that may be signed or unsigned, with a
range of -2,147,483,648 to +2,147,483,647.

There are 24 MFs (MF 0 - MF23).

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

Network Operands
Each controller contains specific Network Operands. If a controller is integrated into a
network, these operands can be read by the other controllers within the network.

You can network up to up to 63 controllers via CANbus. You assign each controller a
unique Unit ID number, 1 through 63. Each controller can read information from up to 8
other controllers in the network. To enable, for example, Controller 18 to access SB 200 in
Controller 62, you define a network operand using the unique ID number 62.

Network Operands

Type Symbol Address Range


Network System Bit NSB SB200-SB215
Network Input NI I0-I15
Network System Integer NSI SI200-SI201

Operand Addressing
An Operand Address is the physical location in the controller memory where the data is
stored.

For example:

MB 10 - "10" is the address of the MB Operand


MI 35 - "35" is the address of the MI Operand
T 12 - "12" is the address of the Timer Operand
You can also assign descriptions to the operands you use in your application.

124
Ladder

Outputs (O)
Outputs are bit operands ( 0 or 1).

The number of Outputs varies according to the Snap-in I/O Modules and I/O Expansion
Modules you integrate into your system.

An Output is an actual hardwired output connection from the controller.

To display a list of operands, click on the Operand tab in the Output Window at bottom of
the screen, then select the operand type. Scroll down to view the list

System Operands (SI) (SL) (SB) (SDW)


System Operands types include: System Bits (SB), System Integers (SI), System Double
Word (SDW), and System Long (SL).

System Operands are connected to certain functions and values in the controller's
operating system. For example, specific System Integers (SI), for example, are connected
to the controller's high speed counter/shaft-encoder; specific System Bits (SB) are
connected to the controller's keypad keys.

Specific System Operands are linked to fixed parameters and are read-only by the user
program, such as
SB 2 Power-up bit.

You may write into certain data types such as SI 8 Unit ID. All SBs and SIs not listed are
reserved for use by the system.

Note System Operands have preset descriptions that describe their function. If
descriptions have been changed, or if you are opening a project that was written using a
different version of VisiLogic, you can display restore descriptions via the Project Menu
Project>System Descriptions>Restore all System Descriptions.

To display a list of System Operands with their descriptions, click on the Operand tab in the
Output Window at bottom of the screen, then select the operand type. Scroll down to view
the list.

System Bits

SB 0 Always 0
SB 1 Always 1
SB 2 P o we r - u p b i t
SB 3 1 second pulse
SB 4 Divide by zero
SB 5 Outputs short circuit
SB 6 Keyboard is active
SB 7 100 mS pulse
SB 8 Battery low
SB9 RAM failure: Bit value is not 0 or 1
SB 10 Float Error
SB 11 User Stack Overflow
SB 14 Calculate current controller temperature. Automatically reset.
SB 16 Touchscreen Active (has been touched), V280 only
SB 17 Enable/Disable Touch-screen indication (Message Board function), enables a
m e s s a g e t o b e h a n d w r i t t e n o n t h e t o u c h - s c r e e n wi t h a s t y l u s
SB 30 HMI keypad entries completed
SB 31 Refresh current LCD screen display variables
SB 32 HMI keypad entry in progress
SB 33 Display, Call Sub: Turns ON for a single scan cycle, when a Display containing

125
VisiLogic Software Manual V330

a Call Sub starts loading. Note that the positive status of SB33 is only visible
within t he specific subroutine when it runs. May be used to initialize operands
in the HMI subroutine
SB 34 D i s p l a y E xi t : T u r n s O N f o r a s i n g l e s c a n c y c l e w h e n a d i s p l a y i s e xi t e d .
SB 40 Key: # 0
SB 41 Key: # 1
SB 42 Key: # 2
SB 43 Key: # 3
SB 44 Key: # 4
SB 45 Key: # 5
SB 46 Key: # 6
SB 47 Key: # 7
SB 48 Key: # 8
SB 49 Key: # 9
SB 50 Plus/Minus
SB 51 Left Arrow
SB 52 Right Arrow
SB 53 ENTER
SB 55 Up
SB 56 Down
SB 57 ESC
SB 58 F1
SB 59 F2
SB 60 F3
SB 61 F4
SB 62 F5
SB 63 F6
SB 64 F7
SB 65 F8
SB 66 F9
SB 67 F10
SB 68 F11
SB 69 F12
SB 70 F13
SB 71 F14
SB 72 F15
SB 80 Modem Initialized: COM 1
SB 81 Modem Initialization Failed: COM 1
SB 82 Modem Initialized: COM 2
SB 83 Modem Initialization Failed: COM 2
SB 84 Modem Initialized: COM 3
SB 85 Modem Initialization Failed: COM 3
SB 86 Modem Connection Stat us: COM 1
SB 87 Modem Connection Stat us: COM 2
SB 88 Modem Connection Stat us: COM 3
SB 90 I/O Expansion error \ I/O Expansion not connected. See Help Topic Detecting
short-circuited end devices
SB 120 DTR COM 1
SB 122 DTR COM 2
SB 124 DTR COM 3
SB 132 Port 1 Transmit busy
SB 133 Port 2 Transmit busy
SB 134 Port 3 Transmit busy
SB 141 Ethernet: Card Exists
SB 142 Ethernet: Card Initialized
SB 143 Ethernet: Socket 0 Initialized
SB 144 Ethernet: Socket 1 Initialized

126
Ladder

SB 145 Ethernet: Socket 2 Initialized


SB 146 Ethernet: Socket 3 Initialized
SB 147 Ethernet: Socket 0 Connected
SB 148 Ethernet: Socket 1 Connected
SB 149 Ethernet: Socket 2 Connected
SB 150 Ethernet: Socket 3 Connected
SB 151 Ethernet: Socket 0 TimeOut
SB 152 Ethernet: Socket 1 TimeOut
SB 153 Ethernet: Socket 2 TimeOut
SB 154 Ethernet: Socket 3 TimeOut
SB 184 SMS: Transmission succeeded
SB 185 SMS: Transmission Failed
SB 200 CANbus Network operand
SB 201 CANbus Network operand
SB 202 CANbus Network operand
SB 203 CANbus Network operand
SB 204 CANbus Network operand
SB 205 CANbus Network operand
SB 206 CANbus Network operand
SB 207 CANbus Network operand
SB 208 CANbus Network operand
SB 209 CANbus Network operand
SB 210 CANbus Network operand
SB 211 CANbus Network operand
SB 212 CANbus Network operand
SB 213 CANbus Network operand
SB 214 CANbus Network operand
SB 215 CANbus Network operand
SB 236 CANbus Network communication error
SB 237 CANbus Network disable
SB 250 K e y p a d e n t r y wi t h i n l i m i t s
SB 251 K e y p a d e n t r y e xc e e d s l i m i t s
SB 500 D T W r i t e : A d d r e s s e xc e e d s D T r a n g e

System Integers
# Description Comments
SI 0 Scan Time, mSec
SI 6 Current key pressed

SI 7 LCD Contrast Control 0=Minimal Contrast, 50=Medium Cont rast, 100=Maximal


Contrast
SI 8 Unit ID (Network) The ID # 1 is assigned by default.

SI 9 LCD Backlight intensity 0 - 0ff


1 - On (low intensity) (V230 only)
2 - On (max. intensity) - Default
SI Current controller I n c l u d e s d e c i m a l p o i n t . F o r e xa m p l e , i f t h e v a l u e i s 2 4 5 ,
14 temperature the actual value is 24.5.
SI Current second According to RTC
30
SI Current time
31
SI Current date
32
SI Current year
33
SI Current day
34

127
VisiLogic Software Manual V330

COM Port
SI Modem Status: COM 1
80 Modem Error (SI 81,83,85,) Modem Status ( SI 80, 82, 84,
86,87,88)
SI Modem Error Code: COM 1
81
Value Message Value Message
SI Modem Status: COM 2
82
0 No error 0 Modem Idle
SI Modem Error Code: COM 2
83
1 TimeOut time 1 Initialization in
SI Modem Status: COM 3 e xc e e d e d : n o Progress
84 reply
SI Modem Error Code: COM 3
85 2 Reply Error 2 Initialization OK
SI Modem Connection Stat us:
86 COM 1 3 Wrong PIN 3 Initialization
SI Modem Connection Stat us: number Failed
87 COM 2
SI Modem Connection Stat us: 4 Registration 4 Modem
88 COM 3 failed Connected

5 PUK number 5 Hang-up in


needed progress

10 COM Busy 6 Dial in progress

11 Reply Busy

12 Reply No Dial

GSM Cellular Modem


SI 185 GSM Signal Quality If this is less than 11, reposition the antenna.
CANbus
SI 200 CANbus Network operand
SI 201 CANbus Network operand
SI 236 CANbus Network
communication error code Value Message

1 No Acknowledgement

2 CANbus OFF

4 CANbus Warning error

10 ISC receiving TimeOut

SI 237 CANbus Network: failed unit


ID
HMI
SI 249 Last Active Keypad Entry
Variable
SI 250 Currently active keypad When either SB 250' Keypad Entry W ithin Limits' or
entry, read/write S B 2 5 1 ' K e y p a d E n t r y E xc e e d s L i m i t s ' t u r n O N , t h e
index number of the variable is stored here.
SI 251 Previous HMI Display
Number
SI 252 Current HMI Display T o s e e a l i s t o f D i s p l a y s i n a p r o j e c t t o g e t h e r wi t h t h e i r
Number Display numbers, select HMI Information from the View
menu.
SI 500 General Error
Value Message

3 7FFF or 8000 (integer


result)FFFF or
0000(unsigned integer
result)

128
Ladder

4 +INF or -INF (float result)

5 0.0 (float result)

7 +INF or -INF or NaN (float


result)

9 NAN (float result)

10 0 (integer result)

11 Floating point stack


underflow

12 Floating point stack


overflow

SI 503 User Stack Depth

On-line Test (Remote Access) Mode

These SIs enable the controller to send SMS messages when the controller is in On-line
Test (Remote Access) mode. The SIs do not need to be used in the application because
the process is transparent to the user.

SI Description

86 Modem Connection Stat us: COM 1

87 Modem Connection Stat us: COM 2

88 Modem Connection Stat us: COM 3

System Long Integers

SL 4 Divide Remainder (signed divide function)

System Double Words

S DW 0 10mS counter
S DW 3 2.5 mS counter

S DW 4 Divide Remainder Unsigned divide function


S DW 5 Expansion module short circuit bitmap
S DW 6 Snap-in module short circuit bitmap
S DW 1 3 Phone number of last received SMS last 8 digits

Timers (T)
To use a timer in your program, place an element in a net, select T, then define the timer's
attributes as shown below.'

129
VisiLogic Software Manual V330

There are 3 types of timers. Each timer type has 3 variables:

Timer Bit Value: A timer is scanned as a bit data type (scan for OFF, scan for ON).
The result of the scan is dependent on the timer type.
Timer Preset Value. A running timer always decrements (counts down) from the
Preset Value. The Preset Values are loaded for all timers at power up. The Preset
Value is also loaded into the Current Value when the timer is reset.
Timer Current Value. The current value of the timer is dependent on the timer type.
All timer types are activated by a rising transition edge, OFF to ON. The condition you use
to activate the timer should be scanned only once per PLC program scan

TD- Timer: On Delay

When the timer's Start & Run Condition is OFF, the timer's Bit Value is also OFF.

When the timer's Start & Run Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF.

If the timer's Start & Run Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Start & Run Condition falls while the timer is decrementing, the timer stops
running. The current value of the timer remains.

Timer Reset takes precedence over the timer's Start & Run Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Start & Run Condition cannot activate the timer as
long as Reset is ON..

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Start & Run Condition rises.

Below, pressing Key #1 on the Vision keypad activates TD1, which is preset to 5 seconds.
If Key #1 is held down for 5 seconds, TD1 decrements to zero. O1 switches on.

If, however, Key #1 is released before TD1 has finished, the timer stops. When Key #1 is
pressed again, TD1 again begins to decrement from 5 seconds.

TA Timer: Accumulated

130
Ladder

When the timer's Run Enable Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF. When
the timer's Run Enable Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Run Enable Condition falls while the timer is running, the timer stops running,
but the current value of the timer is retained. When the timer is reactivated, it begins
decrementing from the retained value.

Timer Reset takes precedence over the timer's Run Enable Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Run Enable Condition cannot activate the timer as
long as Reset is ON.

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Run Enable Condition rises.

Note Once a TA Timer has reached its preset value, its Bit Value remains ON until the
timer is reset in the program. The timer cannot be activated by Run Enable until it has
been reset.

In the net below, pressing Key #2 on the Vision keypad activates TA2, which is preset to 5
seconds. If Key #2 is held down for 5 seconds, TA2 decrements to zero. O2 switches on.

If, however, Key #2 is released after 2.53 seconds--before TA2 has reached the preset
value--the timer stops and its current value is retained . When Key #2 is pressed again,
TA2 begins to decrement from 2.53 seconds. When TA2 decrements to 0, O2 turns ON.

TE Timer: Extended Pulse

131
VisiLogic Software Manual V330

When the timer's Start Condition rises, and the Bit Value is OFF, the timer's Preset Value is
loaded into the timer's Current Value. The timer begins to run and the Bit Value turns ON.
If the timer's Start Condition remains ON during subsequent PLC cycles, the Current Value
of the timer continues to decrement. However, if the timer's Start Condition rises before the
timer has decremented to its Preset Value, the timer reloads the Preset Value into the
Current Value, and again begins to decrement. Note that a falling Start condition does not
affect the timer.
When the timer has decremented to 0 the timer's Bit Value turns OFF. Note that when the
timer has finished running, its Current Value is 0.
Timer Reset takes precedence over the timer's Start Condition. When the timer' Reset
Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded into the
Current Value, and the timer's Start Condition cannot activate the timer as long as Reset is
ON..
When the timer's Reset Condition falls while the timer's Start Condition is ON, the timer
begins to run, exactly the same as when the timer's Start Condition rises.
Note Once a TE Timer has reached its preset value, its Bit Value remains OFF until the
timer is reset in the program.
In the nets below, pressing Key #3 on the Vision keypad activates TE3, which is preset to 5
seconds. Once Key #3 is pressed, TE3 decrements to zero. O3 switches on.

Note A Timer value can be displayed in a Display as either a current or elapsed value.

Viewing and Setting Timers

To display a list of Timers, click on the Operand tab in the Output Window at bottom of the
screen, then select Timers. Scroll down to view the list.

Timers can also be preset and edited in the Select Operand and Address dialog box when
you insert a timer into your program.

You can also use Information Mode to edit or enter a timer value via the controller keyboard
while the controller is running its control program.

Counters (C)
VisiLogic offers 24 built-in counters, represented by the symbol C. To use an Up Counter
in your program, place an Increment function in a net and select C. To use a Down Counter
in your program, use a Decrement function.

132
Ladder

A counter counts rising-edge pulses.

When the accumulated number of pulses equals the counter's preset value, power flows
through the function and the counter bit turns ON. Once the preset value is reached, the
counter bit stays ON until it is reset via a Reset Coil. This also initializes the counter value.

Note Counter values can by displayed on the controller screen via a Counter Variable in
the HMI editor. Either the current or the elapsed counter value can be shown in a Display.

Viewing and Setting Counters

A counter's Preset Value can be assigned either in the Select Operand box or in the Output
Window. To display a list of Counters, click on the Operand tab in the Output Window at
bottom of the screen, then select Counters. Scroll down to view the list.

Functions
Placing a Function in a Net

1. Select any type of Ladder function by:


Selecting it from the Ladder toolbar, -or-
Selecting it from the Ladder menu, -or-
Right-clicking on the Ladder to display the Ladder menu and then selecting the
function.

2. Move the function to the desired net location, then click.

133
VisiLogic Software Manual V330

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

Ladder Elements and Functions List


Contacts

Contacts
Direct Contact (NO)

Inverted Contact (NC)

Positive Transition (Rise)

Negative Transition (Fall)

Coils

Coils
Direct Coil

Inverted (negated) Coil

Set Coil

Reset Coil

Compare

Compare Functions
Greater Than

134
Ladder

Greater/Equal

Equal

Not Equal

Less/Equal

Less Than

Math

Math Functions
Add

Subtract

Multiply

Divide

Linearization

Factor

P o we r

Square Root

Increment/Decrement
Floats

Floating Point Functions


Basic: Store Direct,Add, Sub, Mul, Div, Abs
E xt e n d e d : S q u a r e R o o t , P o w e r , E x p , L N , L o g 1 0 , A M u l ( 1 0 ^ B )
Trig: Sin, Cos, Tan, ArcSin, ArcCos, ArcTan, Degrees, Radians
Compare: Greater Than, Greater Equal, Equal, Not Equal, Less Equal, Less
Than
Convert: A+B/n, INV (A+B/n)
Logic

Logic Functions

AND

OR

XOR

Shift Left/Right

Rotate Left/Right

Bit Set/Reset

Bit Test

Clock

Clock Functions
Time

Day Of W eek

Day Of Month

135
VisiLogic Software Manual V330

Month

Year

Store

Store Functions
Store Direct Function

Store Indirect Function

Store Timer/Counter Preset

Load Indirect Functions

Load Timer/Counter Preset

Store Time/Counter: Current Value

Load Timer/Counter: Current Value

Vector

Vector
Load

Store

Find

Fill / Fill Offset

Copy / Copy Offset

Vector: Transpose
Compare / Compare Offset

Bit to Numeric, Numeric to Bit

Get Max

Get Min

Calls

Calls
Jump to Label
Load HMI Display

HMI Display Loaded

Load Last HMI Dis play

Call Subroutine

Subroutine Return

Data Tables

Data Tables

Read/Write

Direct Read/Write

136
Ladder

For information regarding advanced functions, such as MODBUS, check the topic FBs
Library.

FBs Library
Unitronics offers an FB library for advanced functions, such as SMS messaging and
MODBUS communications. FBs that are currently installed in VisiLogic are listed under the
FB's menu.

Note You must use a condition (RLO) to activate any FB that requires Configuration in
your application, such as MODBUS or SMS.

To install an updated FB library, select Update from the Web from the FBs menu or Help
menu, then follow the on-screen instructions. Note that at the end of the download, you
must close and then restart VisiLogic. The new FBs will appear on the FBs menu.

Note To enable Live Update, you can select to use a proxy server in Project Properties.

Use Function Block Information, located on the View menu, to check:

Which FBs are installed in your library.


Which FB versions are installed, which versions are used in the open project, and to
manage FB versions.
FB memory usage.
FB Library

137
VisiLogic Software Manual V330

Versions Used

Compare Functions

Compare Functions

A compare function block compares two values according to the type of function you select.

If the comparison is true (logic 1): power flows through the block.

If the comparison is false (logic 0): power does not flow through the block.

There are 6 types of Compare Functions:

Greater Than
Greater Than or Equal To

138
Ladder

Equal To
Not Equal To
Less Than or Equal To
Note The Vector menu includes a Compare Vector function.

These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Equal

The Equal function block compares the value of input A to input B.

If input A is equal to input B : power will flow through the function block.

If input A is not equal to input B: power will not flow through the function block.

According to the above example:

If MI 1 is equal to MI 3; then MB 55 will go to logic "1" (ON).


If MI 1 is not equal to MI 3; then MB 55 will go to logic "0" (OFF).
These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Greater or Equal to

The Greater Than or Equal function block compares the value of input A to input B.

If input A is greater than or equal to input B: power will flow through the function block.

If input A is not greater than or not equal to input B: power will not flow through the function
block.

139
VisiLogic Software Manual V330

According to the above example:

If MI 1 value is greater or equal to constant integer 35; then MB 50 will go to logic "1"
(ON).
If MI 1 value is not greater or equal to constant integer 35; then MB 50 will go to logic
"0" (OFF).
These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Greater Than

The Greater Than function block compares the value of input A to input B.

If input A is greater than input B: power will flow through the function block.

If input A is not greater than input B: power will not flow through the function block.

According to the above example:

If MI 1 value is greater than 35; then MB 50 will go to logic "1" (ON).


If MI 1 not greater than 35; MB 50 will go to logic "0".
Note Greater and Less Than function blocks do not give an output when input A equals
input B.

140
Ladder

These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Less or Equal to

The Less Than or Equal To function compares input A to input B. The function is located on
the Compare menu.

If input A is less than or equal to input B: power will flow through the function.

If input A is not less than or equal to input B: power will not flow through the function.

According to the above example:

If MI1's value is less than or equal to MI3's value, then MB 51 will go to logic "1" (ON).
If MI1's value is less than or equal to MI3's value, then MB 51 will go to logic "0"
(OFF).
These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Less Than

The Less Than function compares input A to input B. The function is located on the
Compare menu.

If input A is less than input B: power will flow through the function.

If input A is not less than input B: power will not flow through the function.

141
VisiLogic Software Manual V330

According to the above example:

If MI 1 value is less than constant integer 35; then MB 60 will go to logic "1" (ON).
If MI 1 values is not less than constant integer 35; MB 60 will go to logic "0" (OFF).
These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

Not Equal

The Not Equal function evaluates input A to see if its integer value is not equal to input B.
The function is located on the Compare menu.

If input A is not equal to input B: power will flow through the function.

If input A is equal to input B: power will not flow through the function.

According to the above example:

If MI 1 is not equal to MI 3; then MB 65 will go to logic "1" (ON).


If MI 1 is equal to MI 3; then MB 65 will go to logic "0" (OFF).
These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)

142
Ladder

Constant Value #

Logic Functions

Logic Functions

Function blocks are provided for:

Bit Test
Set/Reset Bit
AND
OR
XOR
Shift
Rotate
The internal operation of a function block is transparent to the user. You select input
operands; the result is automatically output by the function block.

The input values in a logic function may be:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The functions are located under the Logic menu on the Ladder toolbar.

AND

The AND logic function evaluates the state of two integers.

If a bit is true (logic 1) in both input A and B, then the output C will be true (logic 1).
If input A and B is false (logic 0), then the output C will be false (logic 0).
If either input A or B is false (logic 0) - the output C will be false (logic 0).

The input values in an AND function may be:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #

143
VisiLogic Software Manual V330

With the exception of Constant Value, any of these operands may be used to contain the
output value.

AND can be used to mask out certain bits of an input integer not relevant to a given
function.

Example:

If a clock function block uses the first bit of a 16-bit word to decide if a given time is A.M. or
P.M., you can mask out the other 15 bits. This will tell you if the current time is A.M. or P.M.

All of the non-relevant bits will be turned off (logic 0) except the A.M. / P.M. bit.

The function is located under the Logic menu on the Ladder toolbar.

OR

The OR logic function block can evaluate the state of two integers to see if either input A or
B is true. If input A OR B is true - the output C will be true (logic 1). If both input A and B are
true (logic 1) - the output C will also be true (logic 1).

144
Ladder

The input values in an OR function may be:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The function is located under the Logic menu on the Ladder toolbar.

XOR

The XOR logic function block can evaluate the state of two integers to see if input A and B
are equal. If either input A OR B is true - the output C will be true (logic 1). If both input A
and B are true (logic 1) - the output C will be false (logic 0). If both input A and B are false
(logic 0) - the output C will be false (logic 0).

The input values in a XOR function may be:

145
VisiLogic Software Manual V330

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

Use XOR to recognize changes in an integer to check for integer bit corruption. If 2 integers
are equal: the result will return logic 0. If there has been bit corruption: the corrupted bit will
return logic 1.

The function is located under the Logic menu on the Ladder toolbar.

Shift

The Shift function moves the bits in an integer to the left or to the right. Note that any bit
shifted out cannot be recovered.

Shift Right

Operand A: contains the value to be shifted.


Operand B: contains the number of bits to be shifted.
Operand C: contains the resulting value.
Operand D: shows the status of the final bit in the integer after the operation.

146
Ladder

The Shift function may be performed on values contained in the following operands:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
The functions are located under the Logic menu on the Ladder toolbar.

Rotate

The Rotate function moves the bits in an integer to the left or to the right.

Operand A: contains the value to be rotated.


Operand B: contains the number of bits to be rotated.
Operand C: contains the resulting value.
Operand D: shows the status of the final bit in the integer after the operation.

The Rotate function may be performed on values contained in the following operands:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
The functions are located under the Logic menu on the Ladder toolbar.

Vector: Bit to Numeric, Numeric to Bit

147
VisiLogic Software Manual V330

Use these functions to convert an array of bit values to a numeric value, or a numeric value
to an array of bits.

The functions are located on the Vector menu.

Bit to Numeric

Operand A: contains the Start Address for the array of bits to be converted.
Operand B: is the start of the vector that will contain the converted value. Take care
in addressing operands, since the converted value may not fit into a single register;
the function will overwrite as many consecutive registers as it requires to convert the
value.
Operand C: contains the length of the bit array that will be converted.

Numeric to Bit

Operand A: contains the Address of the value to be converted.


Operand B: contains the Start Address of the bit array that will contain the converted
value.
Operand C: contains the Length of the bit array that will contain the converted value.

148
Ladder

Bit Test

Bit Test enables you to select a bit within a vector of registers, and store its status in an
MB.

Operand A, Start of Vector, determines the start of the vector of registers.


Operand B, Offset in Vector, selects the bit within that vector.
Operand C, Target Bit, determines where the value of the selected bit will be stored.

The function is located under the Logic menu on the Ladder toolbar.

Set/Reset Bit

Set Bit enables you to select a bit within a vector of registers, and set it.

Reset Bit enables you to select a bit within a vector of registers, and reset it.

Operand A, Start of Vector, determines the start of the vector of registers.


Operand B, Offset in Vector, selects the bit within that vector.

149
VisiLogic Software Manual V330

The functions are located under the Logic menu on the Ladder toolbar.

Store Bit Status

Use this to select an MB and store its status in an MB within a defined vector.

Operand A, Start of Vector, determines where the vector begins.


Operand B, Offset in Vector, selects the target bit within that vector.
Operand C, Bit Value, determines the source bit. The status of this bit will be stored
into the target bit within the defined vector.

The function is located under the Logic menu on the Ladder toolbar.

Load Bit Status

Use this to select an MB within a defined vector and load its status in an MB outside of that
vector.

Operand A, Start of Vector, determines where the vector begins.


Operand B, Offset in Vector, selects the source bit within that vector.
Operand C, Bit Value, determines the target bit--where the value of the source bit
will be stored.

The function is located under the Logic menu on the Ladder toolbar.

Binary Numbers

Memory Integers and System Integers are 16-bit binary numbers. You enter decimal
numbers into Memory Integers and System Integers. The program converts these decimal
numbers into binary numbers and performs the specified functions.

You may want to use a logic function to mask out bits or check for bit corruption. You can
do this by using a decimal number that converts to the appropriate binary number. The
following charts will help you understand why the decimal numbers {0,1,2,4,8,16,32,64,128,

150
Ladder

etc} were chosen for use with logical OR to evaluate keypad input numbers in the following
example.

151
VisiLogic Software Manual V330

152
Ladder

Math Functions

Math Functions

You perform mathematical functions by placing math function blocks in a net. Function

blocks are provided for:

Increment/Decrement

153
VisiLogic Software Manual V330

Addition
Subtraction
Multiplication
Division
Square Root
Power
Factor
Linearization
Each type of math function can use up to 8 input values to compute a single sum.

The internal operation of a function block is transparent to the user.

The example below shows an Add function block with 2 input values.

The operands listed below can be used to provide both input and output values, with
exception of Constant Values. Constant values can provide input values, but can not
contain output values.

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
To place a function in a net

1. Select any type of Ladder function by:


Selecting it from the Ladder toolbar,
-or-
Selecting it from the Ladder menu,
-or-
Right-clicking on the Ladder to display the Ladder menu and then selecting the
function.
2. Move the function to the desired net location, then click.

154
Ladder

3. Link operands using the Select Operand and Address dialog box.

Multiple Input Values in Math Functions

You can input up to 8 values into a math function block. The function will output a single
sum. This example shows an Add function that uses 5 input values.

1. Click on the Math button on the Ladder toolbar.


-or-
Right-click on the Ladder to show the Ladder pop-up menu.
2. Select More..., then select the desired function type.
3. Click on the function with the desired number of input values.

4. Move the function to the desired net location, then click. The net automatically
enlarges to fit the function

155
VisiLogic Software Manual V330

5. Link operands using the Select Operand and Address dialog box. The dialog box
opens automatically until all input values and the output value have been linked.

Add

The math function Add is executed by the Add function block shown below. You can
choose to add up to 8 input values of the following operand types:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The example below shows an Add function with two input values.

Divide

156
Ladder

The math function Divide is executed by the Divide function block shown below. The input
values in a Divide function may be:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

T
This Divide function can only return whole numbers. To divide floating point numbers, use
the Divide function on the Float menu.

Signed remainder values are stored in SL 4 - Divide Remainder (Signed); unsigned results
are stored in SDW 4 Divide Remainder (Unsigned).

Note that you must store the remainder values immediately after the division function
because these registers will be overwritten by the next division function.

Values may not be divided by zero. In the event that this occurs, System Bit 4 (SB 4 -
Divide by Zero) turns ON.

Multiply

The math function Multiply is executed by the Multiply function block shown below. You can
choose to multiply up to 8 input values of the following types:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The example below shows a Multiply function with two input values.

157
VisiLogic Software Manual V330

Subtract

The math function Subtract is executed by the Subtract function block shown below. The
function is located on the Math menu.

The input values in a Subtract function may be:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

Linearization

The Linearization function, located on the FBs menu, converts values. Use it, for example,
to convert analog input values to a value in degrees Celsius.

158
Ladder

If, for
example,
X1 and
Y1 are 0,
and
X2=100
while
Y2=1023,
the
output
value will
be
linearized
as
graphed.

These
values
would
cause:

A
tem
per
atur
e
inp
ut
of
100
0C
to
be
con
vert
ed
to
102
3

159
VisiLogic Software Manual V330

Digi
tal
val
ue.
A
tem
per
atur
e
inp
ut
of
500
C
to
be
con
vert
ed
to
512
Digi
tal
val
ue
You can convert values contained in the following operand types:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
With the exception of Constant Value, any of these operands may be used to contain the
output value.

Linearizing Analog I/O values

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Working within the 4-20mA range

160
Ladder

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly. In the examples below, the analog device is a pressure transducer; values are
therefore translated to millibars.

10-bit Analog Input, V200-18-E1

12-bit Analog Output,IO-A14-AO2

12-bit Analog Input, IO-A14-AO2

14-bit Analog Input, V120-12-UN2

Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

161
VisiLogic Software Manual V330

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

Factor

The math function Factor uses 3 input values. Factor divides an A input value by a B input
value and then multiplies the result by a C input value. The result is stored in an output
operand, D.

You can use the following operand types in this operation:

162
Ladder

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The example below shows a Factor function.

Power

The math function Power uses 2 input values. Power raises an A input value by the power
of a B (exponent) input value. The result is stored in an output operand, C. The function is
located on the Math menu.

You can use the following operand types in this operation:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Constant Value #
With the exception of Constant Value, any of these operands may be used to contain the
output value.

The example below shows a Power function.

Square Root

This function returns the square root of an input value. The input value serves as the
radicand. The result is stored in an output operand. The function is located on the Math
menu.

You can find the square root of values contained in the following operand types:

163
VisiLogic Software Manual V330

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
The example below shows a Square Root function.

Vector: Get Max

The Get Max function finds the largest value within a range of operands. The function is
located on the Vector menu.

Get Max uses 2 input values. The A input sets the beginning of the operand range, the B
input sets the end of the range. The result is stored in an output operand, C.

In the example below, the function checks MI 50 through 60. The largest value in the
range, 2304, is contained in MI 62; therefore 2304 is stored in MI 59.

164
Ladder

Vector: Get Min

The Get Min function finds the smallest value within a range of operands. The function is
located on the Vector menu.

Get Min uses 2 input values. The A input sets the beginning of the operand range, the B
input sets the end of the range. The result is stored in an output operand, C.

In the example below, the function checks MI 50 through 60. The smallest value in the
range, 6, is contained in MI 52; therefore 6 is stored in MI 61.

165
VisiLogic Software Manual V330

Increment/Decrement

These functions are located on the Math function menu; an Increment button is also located
on the shortcut toolbar.

Increment increases the value in the selected operand by 1.

Decrement decreases the value in the selected operand by 1.

166
Ladder

You can implement counters in your program by selecting a Counter (C) operand output
type.

Store & Load Functions

Store and Load Functions

Store and load functions can be used to copy values from an operand, or range of
operands, to another. You access both types of functions from the Store menu.

The available functions are listed below.

Store Direct Function


Store Indirect Function
Load Indirect Functions
Store Timer/Counter Preset
Load Timer/Counter Preset
Store Timer/Counter: Current Value
Load Timer/Counter: Current Value

Store Direct Function

Store Direct allows you to write a value contained in an operand or constant into another
operand.

To use the Store Direct function:

1. Click Store on the Ladder Toolbar.

2. Select Store Direct, then place the Store Direct function in the desired net.

167
VisiLogic Software Manual V330

3. Enter the desired Operands and Addresses.

4. The Store Direct element appears on the net with the set Operands and
Addresses.

According to the above example, the value in MI 3 will be stored in MI 100. The previous
value in MI 100 is overwritten. The current value in MI 3 remains unchanged.

Store Indirect Function

Store Indirect allows you to write a value contained in certain types of operands into
another operand using indirect addressing. The 'B' output parameter of the Store Indirect
function is actually a pointer to another operand.

When you select the function type from the Store menu, the program writes the input A
value into the address referenced by the output B value--according to the type of function
you select.

168
Ladder

Example: Store Indirect MI

In the example below, SI2 contains the value 5 and SDW1 contains the value 10. Since the
function type is Store Indirect MI, MI10 is where the value in SI2 will be stored.

The value 5 will therefore be stored in MI 10.

Store Timer/Counter Preset

You can set a Timer or Counter preset value by storing an operand or constant value into
the desired operand.

Operand A: contains the value to be stored in the timer/counter.


Operand B: this is the timer/counter to be preset.

Note The value that is stored in the Timer is broken down into units of 10 milliseconds.
In the above example, if MI 13 is equal to 1023, the value stored into T1 will be 10 seconds
and 23 milliseconds.

Store Timer/Counter: Current Value

You can store an operand or constant value into a current Timer or Counter value.

Operand A: contains the value.


Operand B: this is the timer/counter where the value will be stored.

169
VisiLogic Software Manual V330

Note The value that is stored in the Timer is broken down into units of 10 milliseconds.
In the above example, if MI 16 is equal to 1023, the value stored into T0 will be 10 seconds
and 23 milliseconds.

Load Indirect Functions

Load Indirect allows you to take a value contained in a source operand and load it into a
destination operand using indirect addressing.

The example below is based on a Load Indirect MI function.

1. Click Store on the Ladder Toolbar, then select Load Indirect MI from the Load
Indirect menu.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses. The first operand contains the offset
address. In the figure below, SI 2 is linked to the first operand. This is a Load Indirect MI
function; therefore if SI contains 3, the function will take the value in MI 3 and store it in ML 5,
the second linked operand.

According to the above example, if the value in MI 3 is 986, 986 will be stored in ML 5. The
previous value in ML 5 is overwritten. The current value in MI 3 remains unchanged.

Load Timer/Counter Preset

You can load the preset value of a Timer or Counter into an operand.

Operand A: this is the Timer/Counter preset value.


Operand B: this is where the value will be stored.

170
Ladder

Note Timer value units are 10 milliseconds. In the above example, if TI is equal to 10
seconds and 23 milliseconds, the value 1023 will be stored into MI 16.

Load Timer/Counter: Current Value

You can load the current value of a Timer/Counter into an operand.

Operand A: this is the Timer/Counter current value.


Operand B: this is where the value will be stored.

Note Timer value units are 10 milliseconds. In the above example, if T0 is equal to 10
seconds and 23 milliseconds, the value 1023 will be stored into MI 10.

Fill Direct

Fill Direct enables you to set a range of numeric operands or MBs. The function copies a
value from a desired operand, then writes that value into every operand within in the set
range.

Operand A: this is the operand which contains the value to be copied.


Operand B: this is the first operand in the range.
Operand C: this sets the length, meaning the number, of operands in that range.

Vector Copy

171
VisiLogic Software Manual V330

Vector Copy enables you to set a range of operands, copy the values of each operand
within that range, then write those values into a corresponding range of operands of the
same length. The function is located on the Vector menu.

Operand A: this is the range of operands from which the values will be copied.
Operand B: this is the first operand in the vector, the range of operands to which the
values will be copied.
Operand C: this sets the length, meaning the number, of operands for both ranges.

Time Functions

Clock Functions

Program clock and calendar functions in the Ladder by selecting the appropriate functions
from the Clock menu on the Ladder toolbar. Function are provided for:

Time
Day of the Week
Day of the Month-Direct and Indirect
Month
Year
Setting a Clock Function's Time or Date

172
Ladder

Direct Clock function:


The time or date of a Direct Clock function is set within the function you place in your
program.
Indirect Clock Function:
Indirect Clock functions are linked to registers. Values may be placed into the linked
register by your application, or may be entered via the controller keypad.

Direct Clock Function: Example

This example shows you how to build a ladder net that drives a coil:

between the hours 9:00 am and 6:00 PM.


Monday through Friday
beginning on the 15th day of a month, until and including the 24th
in the years 2000 and 2001
Remember that the elements must touch to enable power flow to the coil.

1. Place an Direct Time Function in the net.

2. Set a Start and End Time. When the RTC is within this range, power flows through
the function block.

3. Select Day of the Week , place it in the net, then select the desired days.

173
VisiLogic Software Manual V330

4. Select Day of Month , place it in the net, then select the desired dates.

5. Select Year, then enter the year.

6. Enlarge the net, place and link a coil, then use the Connect Elements Tool to draw
lines between the elements.

Indirect Clock Function example

To enable times and dates for tasks or programs to be set from the controller keypad, you:

174
Ladder

Place Clock function blocks in the Ladder.


Create HMI Displays that include keypad-entry Time Function Variables.
This type of Variable accepts a time value that is entered via the controller keyboard,
storing
the number in the linked operand.
This example shows you how to build a ladder net that drives a coil according to the time
and date, and how to build the HMI Displays, add the required Variables and jump between
Displays.

Building the Ladder

1. Place an Indirect Time Function in the net.

2. Link an operand. The Time function requires two consecutive MIs; the second is
automatically assigned by the program. These 2 MIs define a time range. The first
MI sets the Start Time for the function, the second MI marks the End Time. When the
RTC is within this range, power flows through the function block.

3. Place a Day Of The Week function so that it touches the first function, enabling
power flow. This function uses a 16-bit register to contain a 7-bit bitmap representing
the days of the week.

175
VisiLogic Software Manual V330

4. Link an operand.

5. Place a Day of The Month function so that it touches the last function.

6. Link an operand. This function uses an ML or SL to contain a 32-bit bitmap.

176
Ladder

7. Place a Month function so that it touches the last function.

8. Link an operand.

9. Place a Direct Coil in the net as shown below, and link an operand. The Ladder net
is complete; now create the supporting HMI Displays and Variables.

177
VisiLogic Software Manual V330

You build the net using Indirect Time functions.

Building the HMI Displays

Here, you will create variables that enable Start Time, End Time, Day of Week, and Day of
Month, and month to be set from the controller keyboard.

Start & End Time Variables

1. Open the HMI Display editor.

2. Create and name a Display: Start and End Time.

178
Ladder

3. Draw a text box, and enter fixed text: Start Time.

4. Draw another text box, and enter the text: End Time.

179
VisiLogic Software Manual V330

5. Create a field to hold the first Time Function Variable, Start Time.

6. Define the Variable as Keypad Entry and link it as shown below.

180
Ladder

6. Create a field and define the End Time Variable, linking it to MI 31.

This Display is complete.

Day of Week & Day of Month Variables

1. Create and name a new display; Select Day and Date.


2. Draw a text box, entering the text Select Day.
3. Draw another text box, entering the text Select Date.
4. Create a field to hold the Select Day Variable.
5. Define this variable as Day of Week, and link it to MI 32.

6. Create a field to hold the Select Date Variable.


7. Define this variable as Day of Month, and link it to ML 33.

181
VisiLogic Software Manual V330

This Display is complete.

Month Variable

1. Create and name a new display; Select Month.


2. Draw a text box, entering the text Select Month.
3. Create a field to hold the Select Month Variable.
4. Define this variable as Month, and link it to MI 34.

This Display is complete.

You must create variables that enable times and dates to be set from the controller
keyboard.

Setting Jumps

1. Open Display Start and End Time.


2. Click on the first Jump Condition, and select SB 30: HMI keypad entries completed.

3. Click on Display, and select Display 2.

4. Open Display Select Day and Date,click on the first Jump Condition, and select SB
30..

182
Ladder

5. Click on Display, and select Display 3, Select Month.

Set the Jump from Display 3 according to your requirements.

Jumps move from Display to Display, enabling the user to enter the required data.

To see how register values relate to individual functions, refer to the individual topics listed
below.

Day of the Month-Direct and Indirect

Day of the Week-Direct and Indirect

Day of the Month-Direct and Indirect

The Day of the Month function enables you to assign tasks or run programs on specific
days, such as the 14th and 21st of a month, according to the RTC calendar embedded in
the controller.

Direct Day of the Month:

According to the above example:

On the 1st, 3rd, 5th and 7th the function block's output will be logic "1" (ON).
On the other days of the month the function block's output will be logic "0" (OFF).
Indirect Day of the Month

Indirect Clock functions are linked to registers. Values may be placed into the linked
register by your application, or may be entered via the controller keypad.

The Indirect Month Time function is linked to a 32-bit ML or SL that provides a bitmap for
the functions. The ML value shown below contains the decimal value 271077376
(hexadecimal 10285000). According to this value:

On the 12th, 14th, 19th, 21st and 28th of the month the FB's output will be logic "1"
(ON).
On the other days of the month the FB's output will be logic "0" (OFF).

S et ting Da y o f M ont h vi a Cont roll er Ke yp a d


Place an Indirect Day of Month clock function in the Ladder.

183
VisiLogic Software Manual V330

Create HMI Displays that include keyboard-entry variables.


This type of variable accepts a number entered via the controller keyboard, and
stores the number in a linked operand, ML or SL.

To select the days using the controller's keyboard, the operator uses:

Up and Down scroll arrow keys to scroll through the days of the month.
The <Enter>key to select the desired days of the month.

Day of the Week-Direct and Indirect

The Day of the Week function block enables you to assign tasks or run programs on
specific days, such as Monday or Tuesday, according to the RTC calendar embedded in
the controller..

Direct Day of the Week:

184
Ladder

According to the above example:

On Monday, Tuesday, Wednesday, Thursday, and Friday the function block's output
will be logic "1" (ON).
On Saturday and Sunday the function block's output will be logic "0" (OFF).
Indirect Day of the Week

Indirect Clock functions are linked to registers. Values may be placed into the linked
register by your application, or may be entered via the controller keypad.

The Indirect Day of Week function is linked to a 16-bit register that provides a 7-bit bitmap
in the linked MI. The MI value shown below contains the decimal value 42 (hexadecimal
2A). According to this value:

On Monday, Wednesday and Friday the function block will go to logic "1" (ON).
On Sunday, Tuesday, Thursday and Saturday the function block will go to logic "0"
(OFF).

S et ting Da y o f W eek via Co nt roll er Ke yp a d


Place an Indirect Day of Week function in the Ladder.

Create HMI Displays that include keyboard-entry variables.


This type of variable accepts a number entered via the controller keyboard, and
stores the number in a linked MI, SI, ML or SL.

To select the days using the controller's keyboard, the operator uses:

Up and Down scroll arrow keys to scroll through the days of the week,
The <Enter>key to select the desired days of the week.

185
VisiLogic Software Manual V330

Month-Direct and Indirect

The Month function block is used for monthly time functions.

Direct Month Function:

The Direct Month function block contains the twelve months of the year.

According to the above example, power will flow through the function during the months of
July and August.

Indirect Month Function

Indirect Clock functions are linked to registers. Values may be placed into the linked
register by your application, or may be entered via the controller keypad.

The Indirect Day of Week function is linked to a 16-bit register that provides a 7-bit bitmap
in the linked MI. The MI value shown below contains the decimal value 42 (hexadecimal
2A). According to this value:

On Monday, Wednesday and Friday the function block will go to logic "1" (ON).
On Sunday, Tuesday, Thursday and Saturday the function block will go to logic "0"
(OFF).

S et ting M on th v ia Con tr olle r Ke yp a d


Place an Indirect Month function in the Ladder.

186
Ladder

Create HMI Displays that include keyboard-entry variables.


This type of variable accepts a number entered via the controller keyboard, and
stores the number in a linked MI, SI, ML or SL.

Up and Down scroll arrow keys for scrolling through the months
+/- keys for selecting the desired months
enter key for confirming selection
The Indirect Month function values are entered into a 12-bit bitmap in the linked MI. The MI
value shown below contains the decimal value 3591 (hexadecimal E07). According to these
values:

During the months of January, February, March, October, November, and December
the function block will go to logic "1" (ON).
During the months of April, May, June, July, August, and September the function
block will go to logic "0" (OFF).

Time-Direct and Indirect

The Time function block is used for 24 hour time functions.

Direct Time Function:

The Direct Time function block has a 'from' (start) and a 'to' (end) time set by the
programmer.

187
VisiLogic Software Manual V330

According to the above example:

Power will flow through the function between 4 A.M. and 1 P.M. .

Indirect Time Function

Indirect Clock functions are linked to registers. Values may be placed into the linked
register by your application, or may be entered via the controller keypad.

The Indirect Time function is linked to two consecutive registers.


The values are read as hexadecimal (BCD). According to the figure shown below:

Between the hours of 7:30 and 11:59 P.M., the FB's output will be logic "1" (ON).
At all other times, the FB's output will be logic "0" (OFF).

S et ting Time (Hour ) via Con tr olle r Ke yp a d


Place an Indirect Time clock function in the Ladder.

Create HMI Displays that include keyboard-entry variables.


This type of variable accepts a number entered via the controller keyboard, and
stores the number in a linked register.

188
Ladder

To select the days using the controller's keyboard, the operator uses:

The number keys.


The <Enter> key to confirm the entry.

Year

The Year function block is used for yearly time functions.

Direct Year Function:

The Direct Year function block has a 'from' (start) and a 'to' (end) year set by the
programmer.

If the RTC is within this range, power will flow through the function block.

According to the above example:

Between the years 2002 - 2005, power will flow through the function.
Indirect Year Function:

The Indirect Year function block is linked to two consecutive integers. These integer values
are entered by the user via the controller keypad.

If the RTC is within these two times: power will flow through the function.

If the RTC is not currently within these two times: power will not flow through the function.

189
VisiLogic Software Manual V330

You must create a Time Function Variable in Year (CY) format for the user to enter the
start and end years.

To select the year using the controller's keyboard, the operator uses:

Up and Down scroll arrow keys to scroll through the years


Enter key to select the desired year

Vector Functions

Vector Operations

Vector operations enable you to select an operand type, define a vector within that type,
and to perform different actions within the defined vector.

Vector: Bit to Numeric, Numeric to Bit


Vector: Compare
Vector: Copy
Vector: Transpose
Vector: Fill
Vector: Find
Vector: Get Max
Vector: Get Min
Vector: Load
Vector: Store

Vector: Load

Load allows you to take a value contained in a source operand and load it into a target
operand. This value may be either the status of a bit operand or a register value.

1. Click the Vector menu on the Ladder Toolbar, then select Load.

190
Ladder

2. Place the function in the desired net.


3. Link the desired Operands and Addresses. Operands A and B determine the location
of the source value. Operand A determines the starting point for the function. Operand B
contains the offset value, and the operand linked to Operand C is the target operand.
Example: Registers

Below, the value in ML 89 is loaded into ML 3. If the value in ML 89 is 986, 986 will be
stored in ML 3. The previous value in ML 3 is overwritten. The current value in ML 2
remains unchanged.

Example: Bit Operands

Below, the status of MB 4 is loaded into O 6. If MB 4 is ON, O 6 will be turned ON. The
status of O 6 is overwritten. The status of MB 4 remains unchanged.

Note that:

191
VisiLogic Software Manual V330

If you link a bit operand to Operand A, the function will only allow you to link a bit
operand to Operand C.
If you link a register to Operand A, the function will only allow you to link a register
to Operand C.
If a double register (ML, SL, DW, SDW) is used as the source operand, and a single
register (MI), is used as the target, only the first 16 bits will be loaded from the
source into the target operand.

Vector: Store

Store allows you to take a value contained in a source operand and load it into a target
operand. This value may be either the status of a bit operand or a register value.

1. Click the Vector menu on the Ladder Toolbar, then select Store.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses. Operands A and B determine the location
of the target operand. Operand A determines the starting point for the function. Operand B
contains the offset value, and the operand linked to Operand C is the source operand.
Example: Registers

Below, the value in MI 10 is loaded into MI 132. If the value in MI 10 is 64, 64 will be stored
in MI 132. The previous value in MI 132 is overwritten. The current value in MI 10 remains
unchanged.

192
Ladder

Example: Bit Operands

Below, the status of O 10 is stored into MB 26. If O 10 is ON, MB 10 will be turned ON. The
status of MB 10 is overwritten. The status of O 10 remains unchanged.

Note that:

If you link a bit operand to Operand A, the function will only allow you to link a bit
operand to Operand C.
If you link a register to Operand A, the function will only allow you to link a register
to Operand C.
If a double register (ML, SL, DW, SDW) is used as the source operand, and a single
register (MI), is used as the target, only the first 16 bits will be loaded from the
source into the target operand.

Vector: Find

The Find function:

searches through a vector,


locates either an integer value or the first bit of a desired status within that vector,
records the location of the operand containing the desired value.
1. Click the Vector menu on the Ladder Toolbar, then select Find.

2. Place the function in the desired net.

193
VisiLogic Software Manual V330

3. Link the desired Operands and Addresses.


Operand A, Locate Value in Vector, determines the value or bit status to be found.
Operand B, Locate Start Address, determines from where the function begins to search. If
you select MB 3, for example, the function will search through the MB vector, and will begin to
search at MB #3.
Operand C, Vector Length, determines the length of the vector to be searched.
Operand D, Value's Location, is where the function records the location of the operand--if it is
found.
Example: Find Register Value

Below, if MI 3 contains the value 16, the function searches for 16 from MI 4 to MI 8. MI 3. If
the value 16 is found in the vector, the address of the operand containing 16 is recorded in
MI 6.

Example: Find Bit Status

Below, if MB 0 is OFF, the function searches from O 6 to O 15. If a bit having OFF status if
found, the location of the bit is recorded in MI 2.

Note that:

When the function finds the value, it stops running. This means that if the value is
contained by more than one operand in the vector, only the location of the first
operand containing that value is recorded.
If the value is not found, the function stops until it is reactivated.

194
Ladder

Vector: Fill

Fill enables you to:

select an register, bit operand, or constant value,


define a vector of operands,
write the selected value into every operand within the vector.
The function is located on the Vector menu.

Vector Fill

1. Click the Vector menu on the Ladder Toolbar, then select Fill.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the source value.
Operand B: this is the address of the first operand in the vector.
Operand C: this is the vector length.
Example:

Below, the constant value 4 is written into MI 4 through 10.

195
VisiLogic Software Manual V330

Vector: Fill (Offset)

Fill (Offset) enables you to:

Select an register, bit operand, or constant value,


define a vector of operands that is offset from a selected start address,
write the selected value into every operand within the vector.

1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Fill.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the source value.
Operand B: this is the start address.
Operand C: this is the offset from the start address.
Operand D: this is the vector length.
Example:

Below, the status of O 0 is written into MB 60 through 63.

196
Ladder

Vector: Copy

Copy enables you to:

define a vector of operands,


copy the values or bit status of each operand within that vector,
write those values or status into a corresponding vector of operands of the same
length.
The function is located on the Vector menu.

Copy

1. Click the Vector menu on the Ladder Toolbar, then select Copy.

197
VisiLogic Software Manual V330

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the range of operands from which the values will be copied.
Operand B: this is the first operand in the vector, the range of operands to which the values
will be copied.
Operand C: this sets the length, meaning the number, of operands for both ranges.
Example:

Below, the values in MI 0 through 10 will be copied to MI 100 to 101.

Copy (Offset)

Copy (Offset) enables you to:

Define a source vector of operands that is offset from a selected start address,
copy the values or bit status of each operand within that range,
define a target vector of operands that is offset from a selected start address,
write the source values or status into the target vector.

1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Copy.

198
Ladder

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the start address for the source vector.
Operand B: this is the offset from the start address.
Operand C: this is the start address for the target vector.
Operand D: this is the offset from the start address.
Operand E: this is the vector length.
Example:

Below, the status of MB 64 through MB 71 will be copied to MB 603 through 608.

Vector: Transpose

Transpose enables you to:

Define a source vector of registers that is offset from a selected start address,

199
VisiLogic Software Manual V330

Copy the low byte of each register within that range,


Define a target vector of operands that is offset from a selected start address,
Write the low byte of each source register into the consecutive bytes of the target
vector.

1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Copy.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the start address for the source vector.
Operand B: this is the offset from the start address.
Operand C: this is the start address for the target vector.
Operand D: this is the offset from the start address.
Operand E: this is the vector length.
Example:

Below, the low bytes of MI 5, 6, and 7 are copied into the consecutive bytes of MI 18 and
19.

Vector: Compare

200
Ladder

Compare enables you to:

Define 2 vectors of operands,


compare the values or bit status of each corresponding operand within that range,
record the location of the first set of unmatched values found.
The function is located on the Vector menu.

Compare

1. Click the Vector menu on the Ladder Toolbar, then select Compare.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the start address for the first vector of operands.
Operand B: this is the start address for the second vector of operands.
Operand C: this sets the length of both vectors.
Operand D: this MB turns ON when the corresponding values in both vectors match, and
turns OFF when corresponding operand values do not match.
Operand E: this MI contains the location of the first set of unmatched operands in the vector.
If all of the corresponding values match, the MI contains -1.
Example:

Below, the values in MI 10 through 13 will be compared to MI 3 through 6. MI 12 and MI 5


occupy corresponding locations in the their respective vectors. When the function finds that
the values in MI 12 and MI 5 do not match, the function turns MB 1 turns OFF and stores
the location of the operands into MI 100.

201
VisiLogic Software Manual V330

Compare (Offset)

Compare (Offset) enables you to:

Define a source vector of operands that is offset from a selected start address,
define a target vector of operands that is offset from a selected start address,
compare the values or bit status of each corresponding operand within that range,
record the location of the first set of unmatched values found.

1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Compare.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the start address for the first vector.
Operand B: this is the offset from the start address.
Operand C: this is the start address for the second vector.
Operand D: this is the offset from the start address.
Operand E: this is the vector length.
Operand F: this MB turns ON when the corresponding values in both vectors match, and
turns OFF when corresponding operand values do not match.
Operand G: this MI contains the location of the first set of unmatched operands in the vector.
If all of the corresponding values match, the MI contains -1.
Example:

Below, the values in MB 4 through MB 14 will be compared to MB 105 through MB 112. MB


12 and MB 110 occupy corresponding locations in the their respective vectors. When the
function finds that the values in MB 12 and MB 110 do not match, the function turns MB 2
OFF and stores the location of the operands into MI 6.

202
Ladder

Vector: Bit to Numeric, Numeric to Bit

Use these functions to convert an array of bit values to a numeric value, or a numeric value
to an array of bits.

The functions are located on the Vector menu.

Bit to Numeric

Operand A: contains the Start Address for the array of bits to be converted.
Operand B: is the start of the vector that will contain the converted value. Take care
in addressing operands, since the converted value may not fit into a single register;
the function will overwrite as many consecutive registers as it requires to convert the
value.
Operand C: contains the length of the bit array that will be converted.

203
VisiLogic Software Manual V330

Numeric to Bit

Operand A: contains the Address of the value to be converted.


Operand B: contains the Start Address of the bit array that will contain the converted
value.
Operand C: contains the Length of the bit array that will contain the converted value.

Vector: Get Max

The Get Max function finds the largest value within a range of operands. The function is
located on the Vector menu.

Get Max uses 2 input values. The A input sets the beginning of the operand range, the B
input sets the end of the range. The result is stored in an output operand, C.

In the example below, the function checks MI 50 through 60. The largest value in the
range, 2304, is contained in MI 62; therefore 2304 is stored in MI 59.

204
Ladder

Vector: Get Min

The Get Min function finds the smallest value within a range of operands. The function is
located on the Vector menu.

Get Min uses 2 input values. The A input sets the beginning of the operand range, the B
input sets the end of the range. The result is stored in an output operand, C.

In the example below, the function checks MI 50 through 60. The smallest value in the
range, 6, is contained in MI 52; therefore 6 is stored in MI 61.

205
VisiLogic Software Manual V330

Vector: Move Memory

Move Memory enables you to:

define a vector of registers,


copy the values register within that vector,
write those values into a corresponding vector of registers of the same length.
To use this function

1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Move
Memory.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operand A: this is the start address for the source vector.
Operand B: this is the offset from the start address.

206
Ladder

Operand C: this is the start address for the target vector.


Operand D: this is the offset from the start address.
Operand E: this is the vector length.
Example:

Below, the values within DW 49 and 50 are copied into MIs 602, 603, 604, and 604.

Note When an MI value is copied into a double register, the MI value will occupy the 2
low bytes of the double register.

Floating Math Functions


Float Functions
Float function blocks enable you to use Memory Float (MF) values in your program.

The Float menu on the Ladder toolbar includes the following functions:

Basic
Extended
Trig
Compare
Convert
Note Floating point values cannot be directly displayed on the controller screen. In order
to display a floating point value, use the Convert Float INV function to express the value in
2 MIs or MLs, and then use a Display number variable to show them on screen.

Float Functions: Basic


These are the basic Float functions:

Store Direct

207
VisiLogic Software Manual V330

Stores a register value into an MF.


Add
Adds two values and stores the result in an MF.
Sub
Subtracts two values and stores the result in an MF.
Mul
Multiplies two values and stores the result in an MF.
Div
Divides two values and stores the result in an MF.

Abs
Returns the absolute value of an MF or constant number. The absolute value of a
number is the number without its sign.

If, for example, the input value is -2, the absolute number output by the Abs
function will be 2.

Float Functions: Extended


These are the extended Float functions:

Square root
This function returns the square root of an input value. The input value serves as the
radicand. The result is stored in an output MF.
Power
Power uses 2 input values. Power raises an A input value by the power of a B
(exponent) input value. The result is stored in an output MF, C
Exp
Returns the value of the input number raised to the power of 'e'. The constant e
equals 2.71828182845904, the base of the natural logarithm.

EXP is the inverse of LN, natural log. If, for example, the value 1 is input to the Exp
function, the output result is 2.718282. If the value 2 is input, the output result will
be 7.389056.

LN
Returns the natural logarithm of the input number, using base 'e'. The constant e
equals 2.71828182845904.

LN is the inverse of Exp. If, for example, the value 6 is input to the LN function, the
output result is 1.791759. If the value 6- is input, the output result will be 4.094345.

Log10
Returns the logarithm of the input number, using base 10.

If, for example, the value 6 is input to the Log10 function, the output result is
0.7781513. If the value 60 is input, the output result will be 1.778151; an input of
600 results in an output of 2.778151

A(10^B)
A(10^B) uses 2 input values. The A value is multiplied by 10 to the power of the B
value.

If, for example, the A value is 3, and the B value is 2, the output value will be 300:
3(10^2). If A is 3 and B is 9, the result will be 3,000,000,000.

A(10^B) uses two input values. The A value is multiplied by 10 to the power of the
B value.

208
Ladder

If, for example, the A value is 3, and the B value is 2, the output value will be 300:
3(10^2). If A is 3 and B is 9, the result will be 3,000,000,000.

Float: Trig Functions


These are the Trigonometric functions:

Sin
The function's output is the sine of the input value.

Cos
The function's output is the cosine of the input value.

Tan
The function's output is the tangent of the input value.

ArcSin
The function's output is the inverse sine of the input value.

ArcCos
The function's output is the inverse cosine of the input value.

ArcTan
The function's output is the inverse tangent of the input value.

Degrees
Converts the input value into degrees.

Radians
Converts the input value into radians.

Float: Convert
These are the Convert Float functions:

A+B/n
This function takes 2 non-float values (whole numbers) and creates a single floating
value.
The two non-float values are added together; the A input, a whole number, is added
to the B input, which is the fractional part of the number following the decimal point.
Note The Data Type (M I or M L) selected for operand B determine n, the number
of digits that follow the point. When an MI is selected, n equals 1000; when an ML is
selected, n equals 1,000,000.

INV (A+B/n)
Casting separates an MF value into two registers, where output A contains the whole
number, and output B contains the fractional part of the number following the decimal
point.

209
VisiLogic Software Manual V330

This function enables you to show floating-point values on the controller screen, by
using 2 Numeric Display Variables, linked to the output MIs.

Note The Data Type (M I or M L) selected for operand B determine n, the number of
digits that follow the point. When an MI is selected, n equals 1000; when an ML is selected,
n equals 1,000,000.

Float: Compare Functions


These are the Compare Float functions:

Greater Than
The Greater Than function compares the value of input A to input B.

When the function is activated:

If input A is greater than input B, the output MB turns ON.


If input A is not greater than input B, the output MB turns OFF.
Greater Than or Equal To
The Greater Than or Equal function block compares the value of input A to input B.

When the function is activated:

If input A is greater than or equal to input B, the output MB turns ON.


If input A is not greater than or equal to input B, the output MB turns OFF.
Equal
The Equal function block compares the value of input A to input B.

When the function is activated:

If input A is equal to input B, the output MB turns ON.


If input A is not equal to input B, the output MB turns OFF.
Not Equal
The Not Equal function evaluates input A to see if its integer value is not equal to
input B.

When the function is activated:

If input A is not equal to input B, the output MB turns ON.


If input A is equal to input B, the output MB turns OFF.
Less Than or Equal To
The Less Than or Equal To function compares input A to input B.

When the function is activated:

If input A is less than or equal to input B, the output MB turns ON.


If input A is not less than or equal to input B, the output MB turns OFF.
Less Than
The Less Than function compares input A to input B.

210
Ladder

When the function is activated:

If input A is less than input B, the output MB turns ON.


If input A is not less than input B, the output MB turns OFF.

Float Errors
When an Float function error occurs, SB 10 Float Error turns on. This SB is reset by the
user.

The error code is stored in SI 500 General Error. The codes are shown below.

Value Message Result

3 Integer 7FFF or 8000 (integer result)FFFF or 0000(unsigned


Overflow integer result)

4 Floating +INF or -INF (float result)


Overflow

5 Floating 0.0 (float result)


Underflow

7 Divide by +INF or -INF or NaN (float result)


Zero

9 Undefined NAN (float result)


Float

10 Conversion 0 (integer result)


Error

11 Floating point Floating point stack underflow


Stack
Overflow

12 Floating point Floating point stack overflow


Stack
Underflow

INF Infinite which is the largest absolute floating point number.

NAN Not a Number, special notation for undefined floating point number.

Timers & Counters


Counters (C)
VisiLogic offers 24 built-in counters, represented by the symbol C. To use an Up Counter
in your program, place an Increment function in a net and select C. To use a Down Counter
in your program, use a Decrement function.

A counter counts rising-edge pulses.

When the accumulated number of pulses equals the counter's preset value, power flows
through the function and the counter bit turns ON. Once the preset value is reached, the
counter bit stays ON until it is reset via a Reset Coil. This also initializes the counter value.

211
VisiLogic Software Manual V330

Note Counter values can by displayed on the controller screen via a Counter Variable in
the HMI editor. Either the current or the elapsed counter value can be shown in a Display.

Viewing and Setting Counters

A counter's Preset Value can be assigned either in the Select Operand box or in the Output
Window. To display a list of Counters, click on the Operand tab in the Output Window at
bottom of the screen, then select Counters. Scroll down to view the list.

Timers (T)
To use a timer in your program, place an element in a net, select T, then define the timer's
attributes as shown below.'

There are 3 types of timers. Each timer type has 3 variables:

Timer Bit Value: A timer is scanned as a bit data type (scan for OFF, scan for ON).
The result of the scan is dependent on the timer type.
Timer Preset Value. A running timer always decrements (counts down) from the
Preset Value. The Preset Values are loaded for all timers at power up. The Preset
Value is also loaded into the Current Value when the timer is reset.
Timer Current Value. The current value of the timer is dependent on the timer type.
All timer types are activated by a rising transition edge, OFF to ON. The condition you use
to activate the timer should be scanned only once per PLC program scan

TD- Timer: On Delay

212
Ladder

When the timer's Start & Run Condition is OFF, the timer's Bit Value is also OFF.

When the timer's Start & Run Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF.

If the timer's Start & Run Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Start & Run Condition falls while the timer is decrementing, the timer stops
running. The current value of the timer remains.

Timer Reset takes precedence over the timer's Start & Run Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Start & Run Condition cannot activate the timer as
long as Reset is ON..

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Start & Run Condition rises.

Below, pressing Key #1 on the Vision keypad activates TD1, which is preset to 5 seconds.
If Key #1 is held down for 5 seconds, TD1 decrements to zero. O1 switches on.

If, however, Key #1 is released before TD1 has finished, the timer stops. When Key #1 is
pressed again, TD1 again begins to decrement from 5 seconds.

TA Timer: Accumulated

213
VisiLogic Software Manual V330

When the timer's Run Enable Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF. When
the timer's Run Enable Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Run Enable Condition falls while the timer is running, the timer stops running,
but the current value of the timer is retained. When the timer is reactivated, it begins
decrementing from the retained value.

Timer Reset takes precedence over the timer's Run Enable Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Run Enable Condition cannot activate the timer as
long as Reset is ON.

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Run Enable Condition rises.

Note Once a TA Timer has reached its preset value, its Bit Value remains ON until the
timer is reset in the program. The timer cannot be activated by Run Enable until it has
been reset.

In the net below, pressing Key #2 on the Vision keypad activates TA2, which is preset to 5
seconds. If Key #2 is held down for 5 seconds, TA2 decrements to zero. O2 switches on.

If, however, Key #2 is released after 2.53 seconds--before TA2 has reached the preset
value--the timer stops and its current value is retained . When Key #2 is pressed again,
TA2 begins to decrement from 2.53 seconds. When TA2 decrements to 0, O2 turns ON.

TE Timer: Extended Pulse

When the timer's Start Condition rises, and the Bit Value is OFF, the timer's Preset Value is
loaded into the timer's Current Value. The timer begins to run and the Bit Value turns ON.
If the timer's Start Condition remains ON during subsequent PLC cycles, the Current Value
of the timer continues to decrement. However, if the timer's Start Condition rises before the
timer has decremented to its Preset Value, the timer reloads the Preset Value into the
Current Value, and again begins to decrement. Note that a falling Start condition does not
affect the timer.
When the timer has decremented to 0 the timer's Bit Value turns OFF. Note that when the
timer has finished running, its Current Value is 0.

214
Ladder

Timer Reset takes precedence over the timer's Start Condition. When the timer' Reset
Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded into the
Current Value, and the timer's Start Condition cannot activate the timer as long as Reset is
ON..
When the timer's Reset Condition falls while the timer's Start Condition is ON, the timer
begins to run, exactly the same as when the timer's Start Condition rises.
Note Once a TE Timer has reached its preset value, its Bit Value remains OFF until the
timer is reset in the program.
In the nets below, pressing Key #3 on the Vision keypad activates TE3, which is preset to 5
seconds. Once Key #3 is pressed, TE3 decrements to zero. O3 switches on.

Note A Timer value can be displayed in a Display as either a current or elapsed value.

Viewing and Setting Timers

To display a list of Timers, click on the Operand tab in the Output Window at bottom of the
screen, then select Timers. Scroll down to view the list.

Timers can also be preset and edited in the Select Operand and Address dialog box when
you insert a timer into your program.

You can also use Information Mode to edit or enter a timer value via the controller keyboard
while the controller is running its control program.

FB Library
FBs Library
Unitronics offers an FB library for advanced functions, such as SMS messaging and
MODBUS communications. FBs that are currently installed in VisiLogic are listed under the
FB's menu.

215
VisiLogic Software Manual V330

Note You must use a condition (RLO) to activate any FB that requires Configuration in
your application, such as MODBUS or SMS.

To install an updated FB library, select Update from the Web from the FBs menu or Help
menu, then follow the on-screen instructions. Note that at the end of the download, you
must close and then restart VisiLogic. The new FBs will appear on the FBs menu.

Note To enable Live Update, you can select to use a proxy server in Project Properties.

Use Function Block Information, located on the View menu, to check:

Which FBs are installed in your library.


Which FB versions are installed, which versions are used in the open project, and to
manage FB versions.
FB memory usage.
FB Library

Versions Used

216
Ladder

Communication FBs

COM Port: Init

About Communication Ports

All Vision controllers comprise RS232 serial communication ports. RS232/RS485 adaptors
are available by separate order. Certain models, such as the Vision120, support both
RS232 and RS485. For details on communications hardware settings, refer to the User
Guides and documentation supplied with relevant models.

Separate CANbus ports are also provided with specific controller models.

Note All ports can be used simultaneously. For example, a single controller may use one
serial port to send messages to a modem via RS232, another port to communicate with a
frequency converter, while the controller engages in communications via its CANbus port.

COM Init is located on the FB menu. Use this function block:

To initialize communication port settings and enable the controller to communicate


with external devices such as modems.
To synchronize port settings, enabling the controller to engage in inter-device
communications via protocols such as MODBUS.
Note COM Init is generally performed once in a program. It is usually a power-up task,
however a one-shot transitional contact may also be used.

217
VisiLogic Software Manual V330

Note Communications cannot flow through the port during initialization. To avoid
conflicts in your program, use the Modem Initialization Status SBs.

Modem status can be checked via the System Bits listed below.

SB Description

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

85 Modem Initialized Failed: COM 3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

218
Ladder

Examples

The applications below use the COM Init function. To locate application examples, select
Examples from the Help menu.

SMS messaging.vlp
MODBUS Slave.vlp
MODBUS Master.vlp

Using Ethernet

Unitronics currently supports both TCP and UDP protocols, as explained in the topic About
Ethernet. This topic also contains general information about Ethernet, IP addressing,
sockets, and ports.

Ethernet uses star topology.

In order to use Ethernet, your controller must comprise an Ethernet port.

V2xx Vision OPLCs can be ordered with or without an Ethernet port. The Ethernet port
enables you to implement communications via TCP/IP, such as MODBUS over TCP. To
check if your Vision controller was supplied with an installed Ethernet port, first check the
devices model number. In addition, note that the Ethernet port is an RJ-45-type port that is
lined with metal.

219
VisiLogic Software Manual V330

Via Ethernet, you can:

Communicate data within a PLC network.


Use a PC running VisiLogic, Remote Access, or other communication .dll to access a
networked PLC.
Use a PC to access a PLC via MODBUS over TPC.
Use MODBUS over TCP to access any external device, such as barcode readers or
scales, that support the MODBUS protocol.
The default socket configuration enables you to implement all of these communication
options.

Default Socket Configuration

Vision controllers currently offer 4 sockets. The default socket configuration includes:

Socket Protocol Port Function


Number
0 UDP 20,000 E n a b l e s d a t a t o b e b o t h t r a n s m i t t e d a n d r e c e i v e d wi t h i n a
PLC network.
Note If you are using the default settings for Socket 0,
note that data is sent via Unicast to IP: 255.255.255.255.
port: 20,000 plus the last byte of the IP address originally
assigned to the device.
This is why Port numbers 20,000-20,255 are reserved for
Socket 0.
1 UDP 20,256 Enabl es PC to PLC com m unication vi a UnCm Drv1.dll,
including VisiLogic, Remote Access, and other Unitronics
communication applications.
2 TCP 502 Set to 'listen' as slave (server), enables MODBUS
applications such as OPC servers and SCADA systems
which use MODBUS TCP over IP.
3 TCP 20,257 Set as MODBUS master, enables communication with
e xt e r n a l d e v i c e s s u c h a s b a r c o d e r e a d e r s a n d l i n e
printers.

220
Ladder

Note The default configuration means that, for most applications, you do not
need to include a Socket Init FB in the ladder application. However, if, for
example, your application requires 4 sockets for TCP, change the default
configuration of Sockets 0 & 1 from UDP to TCP via the Socket Init FBs.


Note When using the default socket configuration, Socket 0 cannot be used to
communicate data between routers, and therefore cannot transfer data
between Intranets as shown in the figure below. This is because the
default configuration for Socket 0 uses Unicast.

Note Note that when TCP is used, the formal 'handshake' required by the
protocol means that, during each session occurring via a defined socket,
other communications cannot flow through that socket until the current
session has been terminated.

Such is not the case with UDP. Since there is no formal handshake,
communications can continue to flow through a socket even when there
are multiple requests.

General

When using Ethernet, use the MODBUS IP FBs. For detailed information regarding
MODBUS IP commands, refer to the MODBUS IP help topics.

Note In order to implement Ethernet, a controller must be assigned an IP address.


This is done via the Ethernet Card Init FB, which must be included in the Ladder
applications of both master and slave controllers.
Only Class C-type addresses are supported, as explained in the topic About
Ethernet.
Note When the Ethernet card finishes initialization, SB 142 rises. Use this as a
condition before activating any Ethernet element, such as Socket Connect.
Note An activating condition must be placed before the Ethernet Card Init FB. This
may be assigned as a power-up task; however a one-shot transitional contact
may also be used.
Note Unitronics proprietary 'COM Protocol FB' located on the FBs menu, which may
ordinarily be used to access external slave devices, is not currently compatible
with Ethernet.
Examples

PLC to external device: MODBUS Master over TCP/IP

In this case, the controller acts as a MODBUS master; slave devices accessed may be, for
example, I/Os or barcode readers. The master PLC Ladder application must include the
elements shown below.

221
VisiLogic Software Manual V330

Step 1: Initializing the Ethernet card and Configuring MODBUS

In the figure below, Socket 3 is used, which is the default TCP socket for accessing
external slave devices.

Note The slave unit ID must be set to 255.

Step 2: Establishing the Ethernet Connection: Connect Socket

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave devices are indirect addresses
(pointers). In the figure below, the Start of Vector parameter is 5610. This means
that the master will begin reading from register 5610 in the MODBUS-based
slave device.

222
Ladder

Step 4: Terminating the Ethernet connection: Close Socket

When you terminate the connection, use the 'Function in Progress' MB to ensure that you
do not terminate the connection while data is being communicated.

PLC networks, PLC to PLC

Any controller within the network can be both master and slave. In order to be read by
the master, a slave's application must contain the MODBUS IP Scan FB.
Using UDP to implement controller-to-controller communication

In order to communicate via Ethernet throughout your controller network, you must include
an Ethernet Card Init FB in the ladder application of each networked controller. Remember
that, when using UDP, it is not necessary to use the Socket: Connect or Socket: Close
elements; these are only required by TCP applications.

Master
The master PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card and configuring MODBUS

The MODBUS Configuration is linked to Socket 0, which is by default set to UDP.

223
VisiLogic Software Manual V330

Note A PLC defined as a UDP master can communicate with a number of


slave devices.

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave PLCs are indirect addresses
(pointers). In the figure below, Below, the Slave: Start of Vector
parameter is 15. This means that the master will begin reading from MI
15 in the slave PLC. Since the Read: Vector Length parameter is 3, the
function takes the values in MI 15, 16 and 17.
The Master: Start of Vector parameter is 17; therefore the values will be
written into MI 17, 18, an 19 in the master device.

Slave
The slave PLC Ladder application must include the elements shown below.

224
Ladder

Step 1: Initializing the Ethernet card and configuring MODBUS

Step 2: Scan

To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.

Using TCP to implement controller-to-controller communication

Master
The master PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card, Socket, and Configuring MODBUS

In the figure below, the socket is configured to use TCP.

225
VisiLogic Software Manual V330

Step 2: Establishing the Ethernet Connection: Connect Socket

Note It is recommended that there be a time elapse of a few seconds after the
Ethernet Card Initialization and before activating Socket Connect. A timer
may be used for this purpose.

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave PLCs are indirect addresses
(pointers). In the figure below, Below, the Slave: Start of Vector
parameter is 15. This means that the master will begin reading from MI
15 in the slave PLC. Since the Read: Vector Length parameter is 3, the
function takes the values in MI 15, 16 and 17.
The Master: Start of Vector parameter is 17; therefore the values will be
written into MI 17, 18, an 19 in the master device.

226
Ladder

Step 4: Terminating the Ethernet connection: Close Socket

When you terminate the connection, use the 'Function in Progress' MB to ensure
that you do not terminate the connection while data is being communicated.

Slave
The slave PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card, Socket, and Configuring MODBUS

In the figure below, the socket is configured to use TCP.

227
VisiLogic Software Manual V330

Step 2: Scan

To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.

PC to PLC: Accessing PLC via SCADA

To enable the SCADA application to access the PLC, the PLC is defined as a slave device.
The slave PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card and configuring MODBUS

Port 502 is the well-known port for MODBUS applications.

228
Ladder

Step 2: Scan

To enable the SCADA application to access the slave, include a MODBUS Scan FB in the
slave's application.

Ethernet Operations

The Ethernet FBs are grouped under Ethernet on the FB's menu.

Ethernet: Card Init

Ethernet: Socket Init

229
VisiLogic Software Manual V330

Ethernet: TCP Connect \ TCP Close

Ethernet FAQs
Using the PLC as a webserver

This feature is not currently supported.

Using VisiLogic to access a remote controller via Ethernet

This feature will be supported in the next version of VisiLogic.

Dial & Hang-up

These functions are located on the FB's> COM Port menu.

Dial

This enables you to use Ladder conditions to dial a modem.


Note In the conditions used to activate the Dial function, include the appropriate Modem
Initialized System Bit: SB 80, SB 82, or SB 84.

Hang-up

This enables you to use Ladder conditions to break the connection.

Note Before activating Hang-up, check whether the connection exists, via the
appropriate Modem Connection Status System Bit: SB 86, SB 87, or SB 88.

230
Ladder

PID Function

PID Function

The PID function uses system feedback to continuously control a dynamic process. The
purpose of PID control is to keep a process running as close as possible to a desired Set
Point.

About PID and Process Control

A common type of control is On-Off control. Many heating systems work on this principle.
The heater is off when the temperature is above the Set Point, and turns on when the
temperature is below the Set Point. The lag in the system response time causes the
temperature to overshoot and oscillate around the Set Point.

PID control enables you to minimize overshoot and damp the resulting

oscillations.
PID enables your controller to automatically regulate your process by:

1. Taking the output signal from the process, called the Process Variable (PV),
2. Comparing this output value with the process Set Point. The difference between the
output Process Variable and the Set Point is called the Error signal.
3. Using the Error signal to regulate the controller output signal, called the Control
Variable (CV), to keep the process running at the Set Point. Note that this output
signal may be an analog or time-proportional variable value.
In the figure below, a system is regulated according to temperature.

231
VisiLogic Software Manual V330

Inside the PID Function

The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID
output is the combined output of all 3 actions.

All of the PID functions are activated by changes in the process Error, the difference
between the Process Value and the process Set Point value (E = SP PV).
Proportional Band

The proportional band is a range defined around the Set Point. It is expressed as a
percentage of the total Process Value (PV). When the PV is within this range, the PID
function is active.

Note The proportional band may exceed 100%. In this case, PID control is applied over
the entire system range.

Proportional Action

Proportional action begins after the PV enters the proportional band; at this point, the Error
is 100%. The action outputs a value that is in direct linear proportion to the size of the
Error value.

A broad proportional band causes a more gradual initial response from the controller.
Typically, Set Point overshoot is low; but when the system stabilizes, oscillations around
the Set Point tend to be greater.

232
Ladder

A narrow band causes a rapid response that typically overshoots the Set Point by a greater
margin. However, the system does tend to stabilize closer to the set point. Note that a
proportional band set at 0.0% actually forces the controller into On-Off mode.

The drawback of proportional control is that it can cause the system to stabilize below set
point. This occurs because when the system is at set point, Error is zero and the control
value output is therefore pegged at zero as well. The majority of systems require
continuous power to run at set point. This is achieved by integrating integral and derivative
control into the system.

Direct and Reverse Action

Direct action causes the output to change in the same direction as the change in Error,
meaning that a positive change in Error causes a positive change in the proportional bands
output. Reverse action creates an inverse change in the output, meaning that a positive
change in Error causes a negative change in output.

Integral Action

Integral action responds to the rate of change in the controllers CV output relative to the
change in Error. The integral time you set is the amount of time, as calculated by the
controller, required to bring the process to Set Point. Note that if you set a short integral
time, the function will respond very quickly and may overshoot the Set Point. Setting a
larger integral time value will cause a slower response. Integral time is sometimes called
Reset.

The controllers CV output may reach and remain at 100%, a condition called saturation.
This may occur, for example, if the process is unable to reach Set Point. This causes the
Error signal to remain stuck in either the positive or negative range. In this situation, the
integral action will grow larger and larger as the Error accumulates over time. This is called
integral "wind up", which can cause the controller to overshoot the set point by a wide
margin.

This situation can be prevented by setting an MB to clear the accumulated Integral error
when saturation is occurs.

233
VisiLogic Software Manual V330

Derivative Action

Derivative action responds to the rate and direction of change in the Error. This means that
a fast change in error causes a strong response from the controller.

The derivative action anticipates the PVs value in relation to the Set Point and adjusts the
controllers CV output accordingly, thus shortening the PID functions response time.

AutoTune---Note: This feature is not included in the current product release.

Note: AutoTune is not included in the current product release.

AutoTune enables the controller to automatically optimize PID settings in accordance with
the code you select. The code determines the speed of the controllers response.

The figure below shows how the code affects the controllers response. A setting of zero
enables a fast (under-damped) response, causing the controller to overshoot the Set Point
and oscillate. A setting of 10 causes a slow (over-damped) response. Although this avoids
Set Point overshoot for a more stable response, note that the system will take longer to
achieve set point.

In either case, AutoTune causes the system to stabilize at the Set Point.

Placing a PID function

1. Select PID Scan from the FBs menu, then place the function in the net.

234
Ladder

The PID parameter box opens as shown below.

2. The Select Operand and Address box opens; link operands to the PID parameters.

PID Function Parameters

Parameters: Type Function


Inputs

PV: MI PV is the feedback from the process. PV is output from the process
Process and input to the PID function. In a heating system, the temperature
Value measured by a temperature sensor provides the PV.

SP: MI SP is the target value for the process. In a heating system, this is
Set Point the temperature value set for the system. Note that the Set Point
and Process value must be given in the same type of units (degrees
Celsius, bars, meters per second, etc.)

ST: MI Use this parameter to define the intervals between PID function
Sample or # updates, in units of 10mSecs.
Time

Xp: MI Use this parameter to define the proportional band, in units of 0.1%.
Proportional or # The proportional band is a percentage of the total Process Value
Band (PV). It is a range defined around t he Set Poi nt. W hen the PV is
within this range, the PID function is active.

235
VisiLogic Software Manual V330

Intgl. Time: MI Use this parameter to define the integral time, in units of 1 second.
Integral or # Integral action responds to the rate of change in the controllers CV
Time output relative to the change in Error. The integral time you set is
the amount of time, as calculated by the controller, required to bring
the process to Set Point.

Deriv. Time: MI Use this parameter to define the derivative time, in units of 1
Derivative or # second. Derivative action responds to the rate and direction of
Time change in the Error. This means that a fast change in error causes
a strong response from the controller. The derivative action
anticipates the PVs value in relation to the Set Point and adjusts
the CV accordingly, thus shortening the PID functions response
time.

DB: MI Use this parameter to define the dead band, in units of 0.1%. Note
Dead Band or # that the dead band is a percentage of the proportional band. W hen
v a l u e s a r e wi t h i n t h e d e a d b a n d r a n g e , t h e P I D f u n c t i o n s u s p e n d s
action; the controllers CV output is not changed.

SPPV-High: MI Use this parameter to define the upper limit for the Process Value.
Set Point for or #
Process
Value

S P P V - L o w: MI Use this parameter to define the lower limit for the Process Value.
Set Point for or #
Process
Value

CV-High: MI Use this parameter to define the upper limit for the Control Value.
Set Point for or #
Control
Value

C V - L o w: MI Use this parameter to define the lower limit for the Control Value.
Set Point for or #
Control
Value

Reserved 1 This parameter is reserved for a feature that will be added in the
future.

Reverse: MB Select ON to activate Reverse Action, Off to activate Direct Action.


Reverse Direct action causes the output to change in the same direction as
Action the change in Error; a positive Error deviation causes a positive
change in the proportional bands output. Reverse action creates an
inverse change in the output; a positive Error deviation causes a
negative change in output.

RST INTGL: MB Use this parameter to clear integral error.


Reset If the system does not reach setpoint within the time defined in the
Integral parameter Intgl. Time, Int egral error occurs and may increas e. Use
Error this parameter to prevent the error from growing large enough to
interfere with the Integral operation.

Reserved 2 This parameter is reserved for a feature that will be added in the
future.

Parameters: Type Function


Outputs

CV: MI CV is the output from the PID function. CV is output from the PID
Control function and input to the process. Note that this output signal may
Value be an analog or time-proportional variable value.

CV(P): MI This is the Proportional component of the PID function, calculated


Proportional by the controller.
Value

CV(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value

236
Ladder

CV(P): MI This is the Derivative component of the PID function, calculated by


Derivative the controller.
Value
Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

237
VisiLogic Software Manual V330

PID Function

The PID function uses system feedback to continuously control a dynamic process. The
purpose of PID control is to keep a process running as close as possible to a desired Set
Point.

About PID and Process Control

A common type of control is On-Off control. Many heating systems work on this principle.
The heater is off when the temperature is above the Set Point, and turns on when the
temperature is below the Set Point. The lag in the system response time causes the
temperature to overshoot and oscillate around the Set Point.

238
Ladder

PID control enables you to minimize overshoot and damp the resulting

oscillations.
PID enables your controller to automatically regulate your process by:

1. Taking the output signal from the process, called the Process Variable (PV),
2. Comparing this output value with the process Set Point. The difference between the
output Process Variable and the Set Point is called the Error signal.
3. Using the Error signal to regulate the controller output signal, called the Control
Variable (CV), to keep the process running at the Set Point. Note that this output
signal may be an analog or time-proportional variable value.
In the figure below, a system is regulated according to temperature.

Inside the PID Function

The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID
output is the combined output of all 3 actions.

All of the PID functions are activated by changes in the process Error, the difference
between the Process Value and the process Set Point value (E = SP PV).
Proportional Band

The proportional band is a range defined around the Set Point. It is expressed as a
percentage of the total Process Value (PV). When the PV is within this range, the PID
function is active.

239
VisiLogic Software Manual V330

Note The proportional band may exceed 100%. In this case, PID control is applied over
the entire system range.

Proportional Action

Proportional action begins after the PV enters the proportional band; at this point, the Error
is 100%. The action outputs a value that is in direct linear proportion to the size of the
Error value.

A broad proportional band causes a more gradual initial response from the controller.
Typically, Set Point overshoot is low; but when the system stabilizes, oscillations around
the Set Point tend to be greater.

A narrow band causes a rapid response that typically overshoots the Set Point by a greater
margin. However, the system does tend to stabilize closer to the set point. Note that a
proportional band set at 0.0% actually forces the controller into On-Off mode.

The drawback of proportional control is that it can cause the system to stabilize below set
point. This occurs because when the system is at set point, Error is zero and the control
value output is therefore pegged at zero as well. The majority of systems require
continuous power to run at set point. This is achieved by integrating integral and derivative
control into the system.

Direct and Reverse Action

Direct action causes the output to change in the same direction as the change in Error,
meaning that a positive change in Error causes a positive change in the proportional bands
output. Reverse action creates an inverse change in the output, meaning that a positive
change in Error causes a negative change in output.

240
Ladder

Integral Action

Integral action responds to the rate of change in the controllers CV output relative to the
change in Error. The integral time you set is the amount of time, as calculated by the
controller, required to bring the process to Set Point. Note that if you set a short integral
time, the function will respond very quickly and may overshoot the Set Point. Setting a
larger integral time value will cause a slower response. Integral time is sometimes called
Reset.

The controllers CV output may reach and remain at 100%, a condition called saturation.
This may occur, for example, if the process is unable to reach Set Point. This causes the
Error signal to remain stuck in either the positive or negative range. In this situation, the
integral action will grow larger and larger as the Error accumulates over time. This is called
integral "wind up", which can cause the controller to overshoot the set point by a wide
margin.

This situation can be prevented by setting an MB to clear the accumulated Integral error
when saturation is occurs.

Derivative Action

Derivative action responds to the rate and direction of change in the Error. This means that
a fast change in error causes a strong response from the controller.

The derivative action anticipates the PVs value in relation to the Set Point and adjusts the
controllers CV output accordingly, thus shortening the PID functions response time.

AutoTune---Note: This feature is not included in the current product release.

Note: AutoTune is not included in the current product release.

AutoTune enables the controller to automatically optimize PID settings in accordance with
the code you select. The code determines the speed of the controllers response.

The figure below shows how the code affects the controllers response. A setting of zero
enables a fast (under-damped) response, causing the controller to overshoot the Set Point
and oscillate. A setting of 10 causes a slow (over-damped) response. Although this avoids
Set Point overshoot for a more stable response, note that the system will take longer to
achieve set point.

In either case, AutoTune causes the system to stabilize at the Set Point.

241
VisiLogic Software Manual V330

Placing a PID function

1. Select PID Scan from the FBs menu, then place the function in the net.

The PID parameter box opens as shown below.

2. The Select Operand and Address box opens; link operands to the PID parameters.

PID Function Parameters

242
Ladder

Parameters: Type Function


Inputs

PV: MI PV is the feedback from the process. PV is output from the process
Process and input to the PID function. In a heating system, the temperature
Value measured by a temperature sensor provides the PV.

SP: MI SP is the target value for the process. In a heating system, this is
Set Point the temperature value set for the system. Note that the Set Point
and Process value must be given in the same type of units (degrees
Celsius, bars, meters per second, etc.)

ST: MI Use this parameter to define the intervals between PID function
Sample or # updates, in units of 10mSecs.
Time

Xp: MI Use this parameter to define the proportional band, in units of 0.1%.
Proportional or # The proportional band is a percentage of the total Process Value
Band (PV). It is a range defined around t he Set Poi nt. W hen the PV is
within this range, the PID function is active.

Intgl. Time: MI Use this parameter to define the integral time, in units of 1 second.
Integral or # Integral action responds to the rate of change in the controllers CV
Time output relative to the change in Error. The integral time you set is
the amount of time, as calculated by the controller, required to bring
the process to Set Point.

Deriv. Time: MI Use this parameter to define the derivative time, in units of 1
Derivative or # second. Derivative action responds to the rate and direction of
Time change in the Error. This means that a fast change in error causes
a strong response from the controller. The derivative action
anticipates the PVs value in relation to the Set Point and adjusts
the CV accordingly, thus shortening the PID functions response
time.

DB: MI Use this parameter to define the dead band, in units of 0.1%. Note
Dead Band or # that the dead band is a percentage of the proportional band. W hen
v a l u e s a r e wi t h i n t h e d e a d b a n d r a n g e , t h e P I D f u n c t i o n s u s p e n d s
action; the controllers CV output is not changed.

SPPV-High: MI Use this parameter to define the upper limit for the Process Value.
Set Point for or #
Process
Value

S P P V - L o w: MI Use this parameter to define the lower limit for the Process Value.
Set Point for or #
Process
Value

CV-High: MI Use this parameter to define the upper limit for the Control Value.
Set Point for or #
Control
Value

C V - L o w: MI Use this parameter to define the lower limit for the Control Value.
Set Point for or #
Control
Value

Reserved 1 This parameter is reserved for a feature that will be added in the
future.

Reverse: MB Select ON to activate Reverse Action, Off to activate Direct Action.


Reverse Direct action causes the output to change in the same direction as
Action the change in Error; a positive Error deviation causes a positive
change in the proportional bands output. Reverse action creates an
inverse change in the output; a positive Error deviation causes a
negative change in output.

RST INTGL: MB Use this parameter to clear integral error.


Reset If the system does not reach setpoint within the time defined in the
Integral parameter Intgl. Time, Int egral error occurs and may increas e. Use
Error this parameter to prevent the error from growing large enough to
interfere with the Integral operation.

243
VisiLogic Software Manual V330

Reserved 2 This parameter is reserved for a feature that will be added in the
future.

Parameters: Type Function


Outputs

CV: MI CV is the output from the PID function. CV is output from the PID
Control function and input to the process. Note that this output signal may
Value be an analog or time-proportional variable value.

CV(P): MI This is the Proportional component of the PID function, calculated


Proportional by the controller.
Value

CV(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value

CV(P): MI This is the Derivative component of the PID function, calculated by


Derivative the controller.
Value
Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

244
Ladder

Linearization

Linearization

The Linearization function, located on the FBs menu, converts values. Use it, for example,
to convert analog input values to a value in degrees Celsius.

245
VisiLogic Software Manual V330

If, for
example,
X1 and
Y1 are 0,
and
X2=100
while
Y2=1023,
the
output
value will
be
linearized
as
graphed.

These
values
would
cause:

A
tem
per
atur
e
inp
ut
of
100
0C
to
be
con
vert
ed
to
102
3
Digi
tal
val
ue.
A
tem
per
atur
e
inp
ut
of
500
C
to
be
con
vert
ed
to
512

246
Ladder

Digi
tal
val
ue
You can convert values contained in the following operand types:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
With the exception of Constant Value, any of these operands may be used to contain the
output value.

Linearizing Analog I/O values

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly. In the examples below, the analog device is a pressure transducer; values are
therefore translated to millibars.

10-bit Analog Input, V200-18-E1

12-bit Analog Output,IO-A14-AO2

247
VisiLogic Software Manual V330

12-bit Analog Input, IO-A14-AO2

14-bit Analog Input, V120-12-UN2

Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

248
Ladder

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

249
Communications

COM Port: Init


About Communication Ports

All Vision controllers comprise RS232 serial communication ports. RS232/RS485 adaptors
are available by separate order. Certain models, such as the Vision120, support both
RS232 and RS485. For details on communications hardware settings, refer to the User
Guides and documentation supplied with relevant models.

Separate CANbus ports are also provided with specific controller models.

Note All ports can be used simultaneously. For example, a single controller may use one
serial port to send messages to a modem via RS232, another port to communicate with a
frequency converter, while the controller engages in communications via its CANbus port.

COM Init is located on the FB menu. Use this function block:

To initialize communication port settings and enable the controller to communicate


with external devices such as modems.
To synchronize port settings, enabling the controller to engage in inter-device
communications via protocols such as MODBUS.
Note COM Init is generally performed once in a program. It is usually a power-up task,
however a one-shot transitional contact may also be used.

Note Communications cannot flow through the port during initialization. To avoid
conflicts in your program, use the Modem Initialization Status SBs.

251
VisiLogic Software Manual V330

Modem status can be checked via the System Bits listed below.

SB Description

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

85 Modem Initialized Failed: COM 3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

Examples

The applications below use the COM Init function. To locate application examples, select
Examples from the Help menu.

SMS messaging.vlp
MODBUS Slave.vlp
MODBUS Master.vlp

RS485 Options
The information in this topic is common to all Unitronics' controllers networked via RS485.
Note that before you carry out any tasks associated with wiring, you must read and fully
understand the safety guidelines.

About RS485
RS485 is a balanced serial interface for the transmission of digital data, which enables you
to create a multi-drop network containing up to 32 devices, or nodes

RS485 gives you 2 main advantages over RS232: longer cable lengths and greater
immunity to noise. In comparison to RS232, RS485 uses lower voltage and differential
signals. RS485 uses a differential voltage loop interface (balanced differential signal);
differential data transmission reduces the effects of ground shifts and induced noise
signals, even in an electrically noisy environment. The system is based on balanced
circuits that rely on twisted-pair wires (A & B). Thus, the data conversion of logical 0 and 1
is made by converting the polarity of the two wires by reference to each other, instead of
changing polarity of a single wire by reference to the "SG" (Signal Ground).

252
Communications

The noise immunity results from the fact that, when electromagnetic noise is induced over
the differential signals, the same noise is induced on both signals. When the receiver
subtracts the differential signals, the result is noise compensation.

The same 2 wires are used for transmitting and receiving; therefore, within RS485
networks, only one device can transmit while all of the other devices 'listen' (receive).

Unitronics' controllers offer different options for networking via RS485, according to the
network series.

Network Topology & Wiring


The network topology is multi-drop bus. Every RS485 network includes 2 types of nodes;
node refers to every device that is physically connected to the network.

End Nodes: The devices attached at both physical ends of the network, containing a
network terminator.
In-line Node: All devices connected to the network that are not end nodes.
To enable a rapid rate of communication over relatively long distances, the wires function
as transmission lines. For this reason, the end nodes of the network must contain network
terminators for the purpose of impedance matching. The method for setting network
terminators is described individually for each device.

RS485 Network Wiring

Use shielded twisted pair (STP) cables to network devices. Recommended cables types
are:

Twinax cable, type H8106 Control cable, type due 4001 (0.5mm2 , twisted pair)
Twinax cable, type H3094 Control cable, type V45551-F21-B5 (1.5mm2 , twisted
pair)
The combined total length of all network cables cannot exceed 1219 meters, as shown
below.

RS485 wiring considerations

With the exception of the M90-19-R4, the RS485 signals are NOT isolated. If the
controller is used with a non-isolated external device, avoid potential voltage that
exceeds 10V. To avoid severely damaging the system, all non-isolated device ports
should relate to the same 0Vsignal.
Minimize the stub (drop) length leading from each device to the bus. The stub should
not exceed 5 centimeters. Ideally, the main cable must be run in and out of the
networked device as shown below. The connectors MJ10-22-CS66 (V120 and M91
series) and MJ10-22-CS65 (V2xxx series), shown below, enable this to be easily
accomplished.

253
VisiLogic Software Manual V330

Do not cross positive (A) and negative (B) signals. Positive terminals must be wired
to positive, and negative terminals to negative.
You must create network termination points by using the two end point devices
integrated into your network. The method of creating termination points varies
according to the controller series.

RS485, by controller type


RS485 is implemented differently in Unitronics' controllers, according to model type. These
options are summarized below.

Vision controllers are programmed using VisiLogic software. When Vision controllers are
networked via RS485, the COM ports must be initialized to the RS485 standard as
explained in COM Port: Init.

In addition, you must assign a unique Unit ID number to each controller, as explained in the
Help topic: Assigning a Unit ID number. Note that there is a range of ID numbers reserved
for RS485, numbers 64-127.

Vision 230/260/280
May be ordered with or without RS485 ports. A V2xx controller that is ordered containing an
RS485 port has a part number that ends in the number '1', for example: V2xx-1x-B21x1. If
your V2xxx controller does not have an RS485 port, you can order a port module, V200-19-
R4, and install it.

Note that the ports are not isolated. The connector type is RJ-45. RS485 termination
settings are determined via jumper.

If your V2xxx controller does not have an RS485 port, you can order a port module, V200-
19-R4, and install it. Installation instructions are provided together with the module when it
is ordered separately. The information below applies whether or not the RS485 port was
supplied with the V2xxx controller, or whether it is ordered and installed separately.

Network Termination Settings

The jumper settings shown above determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is YES, whether or not the
RS485 port was supplied already installed in the controller. If the OPLC is not a network
end device, set both jumpers to NO.

254
Communications

To open the controller in order to access the module and change the jumper settings, follow
the relevant instructions listed below.

1. Turn power off before opening the


controller.
2. Open the OPLC by inserting a
screwdriver into the slots located on
the sides of the controller as shown,
then carefully prying the cover off.
3. The RS485 ports location is
covered by plastic. Remove the
plastic covering by using a razor
cutter to cut through the tabs.

4. Locate the J3 connector.

5. Install the module by placing the J1


connector (female) of the module onto the
J3 connector (male) in the controller.
6. Make sure that the connection is
secure.
7. Close the controller by snapping the
plastic cover back in its place. If the module
is correctly placed, the cover will snap on
easily.

Vision 120/ M91

Vision 120 series

Offers 2 serial communication ports. Each port can be adapted to either the RS232 or RS485
standard, via jumpers located within the controller and VisiLogic software settings. Note that
the ports are not isolated. The connector type is RJ-11. RS485 termination settings are
determined via jumper.

M91 series

255
VisiLogic Software Manual V330

An M91 that contains an RS485/RS232port has a part number that includes the number '4',
for example: M91-19-4UN2.

RS485 is via an RJ-11-type serial communication port. Each port can be adapted to either
the RS232 or RS485 standard, via jumpers located within the controller. The M91 is
programmed using U90 Ladder software.
The port mode is determined by SI 64, Set COM Port Mode, as described in the U90
Ladder help topic: COM Port Mode: RS232/RS485 (M91 only).

Note that the port is not isolated. RS485 termination settings are determined via jumper.

Vision 120/ M91 RS232/RS485 COM ports

The information below applies to both Vision 120 and M91 series controllers. The
controllers in these series offer RJ-11-type serial communication ports. Each port can be
adapted to either the RS232 or RS485 standard, via jumpers located within the controller.
In the case of the Vision 120, appropriate VisiLogic program settings are also required.

RJ-11 type port

The pinout below is of the RJ-11 type port, when the port is used for RS485.

Note When a port is set to RS485, both RS232 and RS485 can be used
simultaneously if flow control signals DTR and DSR are not used.

The ports are not isolated. If the controller is used with a non-isolated
Note external device, avoid potential voltage that exceeds 10V.
To avoid damaging the system, all non-isolated device ports should
relate to the same ground signal.

RS232/RS485 Jumper Settings

Use the jumper settings shown below to change the functionality of the controller's COM
port.

To open the controller and access the jumpers, refer to the instructions below.

RS485 Network Termination Settings

The jumper settings shown below determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is ON. If the OPLC is not a
network end device, set both jumpers to OFF.

256
Communications

Opening the Controller

Before opening the controller, touch a grounded object to


discharge any electrostatic charge.
Note Avoid touching the PCB board directly by holding the PCB board
by its connectors.

1. Turn power off before opening the controller.


2. Locate the 4 slots on the sides of the controller.
3. Using the blade of a flat-bladed screwdriver, gently
pry off the back of the controller as shown.

4. Gently remove the top PCB board:


Use one hand to hold the top-
most PCB board by its top
and bottom connectors as
shown.
With the other hand, grasp
the controller, while keeping
hold of the serial ports; this
will keep the bottom board
from being removed together
with the top board.
Steadily pull the top board
off.

5. Locate the jumpers shown in Figure 9, then change


the jumper settings as required.

257
VisiLogic Software Manual V330

6. Gently replace the PCB board as


shown. Make certain that the pins fit correctly
into their matching receptacle.
Do not force the board into
place; doing so may damage
the controller.
7. Close the controller by snapping the
plastic cover back in its place. If the card is
placed correctly, the cover will snap on easily.

M90
These controllers are programmed via U90 Ladder.

RS485 communications are enabled via an external RS232/RS485 converter, such as


Unitronics' M90-19-R4, which can be connected to the controller's RS232 port. No U90
Ladder software settings are required.

The M90-19-R4 RS485 port is isolated.

Note that since the M90-19-R4 is an external converter, it is also compatible with other
devices, such as PCs.

Vision / M91 RS485 Port Specifications


The specifications below apply to RS485 ports for all Vision and M91 controllers.

Input Voltage -7 to +12V differential max.

Cable type Shielded twisted pair, in compliance with EIA RS485

Cable length 1200m maximum (4000 feet)

Galvanic Isolation No

Baud rate 110 - 57600 bps

Complete specification for the M90-19-R4, which converts serial data from the RS232
standard to either RS422 or RS485, is located on the Setup CD. It is also available from
your local Unitronics distributor. This module is recommended for use with M90 controllers
and other devices.

User safety and equipment protection guidelines


This information is intended to aid trained and competent personnel in the installation of this
equipment as defined by the European directives for machinery, low voltage, and EMC.
Only a technician or engineer trained in the local and national electrical standards should
perform tasks associated with the devices electrical wiring.

Before using a Unitronics' product, it is the responsibility of the user to read and understand
this document and any accompanying documentation.

Symbols are used to highlight information relating to the users personal safety and
equipment protection throughout this document. When these symbols appear, the
associated information must be read carefully and understood fully.

258
Communications

Under no circumstances will Unitronics be liable or responsible for any consequential


damage that may arise as a result of installation or use of equipment, and is not
responsible for problems resulting from improper or irresponsible use of Unitronics
devices.
All examples and diagrams shown are intended to aid understanding. They do not
guarantee operation.
Unitronics accepts no responsibility for actual use of a product based on these
examples.
Only qualified service personnel should open a device or carry out repairs.
Please dispose of this product in accordance with local and national standards and
regulations.
Failure to comply with appropriate safety guidelines can result in
severe personal injury or property damage. Always exercise proper
caution when working with electrical equipment.
Check the user program before running it.
Note Do not attempt to use a device with parameters exceeding
permissible levels.
Install an external circuit breaker and take appropriate safety
measures against short-circuiting in external wiring.
To avoid damaging the system, do not connect or disconnect a
device when the power is on.
Do not touch live wires.
Double-check all the wiring before turning on the power supply.

Modems
To enable a Vision controller to communicate via standard or GSM modem:

1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally performed once in a program. It is usually a power-
up task, however a one-shot transitional contact may also be used.
Communications cannot flow through the port during initialization.

259
VisiLogic Software Manual V330

2. Place the conditions and elements in your Ladder program.


Note Communications cannot flow through the port during initialization. To
avoid conflicts in your program, use the Modem Initialization Status SBs.

Modem status can be checked via the System Bits listed below.

SB Description

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

85 Modem Initialized Failed: COM 3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

260
Communications

3. Connect the modem.

261
VisiLogic Software Manual V330

Note If call are routed via a switchboard, note that the switchboard settings may interfere
with communications. Consult with your switchboard provider.
PC/PLC modem communications: Both PC and controller must use the same type
of modem: either landline or GSM. Internal PC modems must be used in conjunction with
the driver provided by the modem's manufacturer.
Examples

To locate application examples, select Examples from the Help menu.

SMS messaging.vlp

PLC Programming via Modem: Remote Access


Use a PC linked to GSM or landline modem to access a remote controller and:

Download and upload applications.


Test and troubleshoot problems in remote controllers and applications.
To remotely access a controller:

Note The PC-modem cable is not the same type of cable used to connect between
the controller and the modem. Ensure that the cable used to connect the PC
to the modem provides connection points for all of the modem's pins.
Note If calls are routed via a switchboard, note that the switchboard settings may
interfere with communications. Consult with your switchboard provider
Note If, within the modem initialization strings, the parameter S7 TimeOut, is to
short to permit the PLC's modem to answer, an error will result.
For example, if this parameter is set as S7=30, the PC modem will wait for 3
seconds to receive an answer from the PLC's modem. If, however, the PLC
program's COM Init FB Answer Settings are set to 'Answer after 6 rings,' the
PLC modem will not be able to answer before the 3 seconds have elapsed. In
this case, the TimeOut parameter is exceeded, and the PC modem will return
the No Carrier error.
Note PC/PLC modem communications: Both PC and controller must use the same
type of modem: either landline or GSM. Internal PC modems must be used in
conjunction with the driver provided by the modem's manufacturer.

Controller Setup
1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally a power-up task, however a one-shot transitional
contact may also be used.

262
Communications

2. Place conditions and elements in your Ladder program.

3. Connect the modem.

263
VisiLogic Software Manual V330

PC Modem Setup
Open PC Modem Configuration from the Connection menu.

264
Communications

Note If, within the modem initialization strings, the parameter S7 TimeOut, is to short to
permit the PLC's modem to answer, an error will result.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to
receive an answer from the PLC's modem. If, however, the PLC program's COM Init FB
Answer Settings are set to 'Answer after 6 rings,' the PLC modem will not be able to answer
before the 3 seconds have elapsed. In this case, the TimeOut parameter is exceeded, and
the PC modem will return the No Carrier error.

About Ethernet
General information regarding the parameters required to implement Ethernet is given
below. A glossary of Ethernet terms is included at the bottom of this topic. To learn how to
specifically define parameters within the VisiLogic Ethernet FBs, refer to Using Ethernet.

Unitronics' Ethernet uses star topology.

265
VisiLogic Software Manual V330

About Networks
Generally, controllers are part of a closed, internal control network. A closed network may
be referred to as a LAN (Local Area Network) or an Intranet. When Intranets are
connected via gateway devices, they form a WAN (Wide Area Network). The Internet,
which is made up of connected Intranets or LANs, is a form of WAN. Internet
communications are via the TCP/IP protocol.

Large manufacturing companies, for example, may be made up of a number of factories,


each of which contains its own LAN, closed control network. Within the company, all of
these LANs may be connected by gateway devices, forming a proprietary WAN--a
company Internet, which in turn may be connected to the Internet--the World Wide Web.

Within closed controller networks, Ethernet is becoming a common protocol. Ethernet


communications are also via the TCP/IP protocol.

What is an IP address?
In order to enable a controller to communicate over Ethernet, you must assign it an IP
address.

An IP address is a unique number which identifies a computer or controller on a TCP/IP


network. These networks use the IP address to route messages to their destination. An IP
address is a 32-bit numeric address which is divided into four numbers (octets). Each octet
is separated by a period formatted as follows: 1.160.10.240. The decimal value in each
octet can range from zero to 255, or 00000000 - 11111111 in binary notation.

Note The values '0' and '255' are restricted and should not normally be used.

Internally, within an Intranet, you can assign IP addresses at random as long as each one
is unique within the Intranet. The common IP may be: 192.168.192.xx, where the last octet
is the identifies the device on the network.

Note In the majority of cases, controllers are part of a closed control network (Intranet).
The controllers' IP addresses are unique only within the Intranet, and cannot be accessed
via the Internet--unless an valid Internet IP address is purchased from a ISP and
assigned to the controller.

IP Addresses and Networks


In binary form, the IP address 68.212.226.204 is
10101000.11010100.11100010.11001100.

The 4 octets of the address are used to create classes of IP addresses. Networks are
divided into 5 classes, according to size, as explained below. The octets are split into two
sections: Net and Host. The Net section is represented by the first octet. It is used to
identify the network that a device belongs to. The Host (sometimes called Node) section
identifies the actual device on the network. The Host section is always contains by the final

266
Communications

octets; how many octets is determined by the network class. There are five IP classes plus
certain special addresses.

Although decimals are generally used to represent IP addresses, it is the binary value
which determines which class of network the IP address belongs to. All nodes on a given
network share the same network prefix but must have a unique host number.

Default The IP address of 0.0.0.0 is used for the default network.


Network
Class A T h i s c l a s s i s f o r v e r y l a r g e n e t wo r k s .
Network B i n a r y a d d r e s s s t a r t wi t h ' 0 ' , m e a n i n g t h a t t h e d e c i m a l v a l u e c a n b e a n y w h e r e
from 1 to 126.
The first octet bits identify the network as Class A ; Octets 2, 3, and 4 (the
n e xt 2 4 b i t s ) i n d i c a t e t h e h o s t wi t h i n t h e n e t w o r k .
An example of a Class A IP address is 102.168.212.226, where "102" identifies
the network and "168.212.226" identifies the host on that network.
Note The IP address 127.0.0.1 is used as the loopback address. This means
that it is used by the host computer to send a message back to itself. It is
c o m m o n l y u s e d f o r t r o u b l e s h o o t i n g a n d n e t wo r k t e s t i n g .
Class B This class is used for medium-sized networks.
Network T h e f i r s t t wo o c t e t s i d e n t i f y t h e n e t w o r k a s C l a s s B ; O c t e t s 3 a n d 4 ( t h e
r e m a i n i n g 1 6 b i t s ) i n d i c a t e t h e h o s t wi t h i n t h e n e t w o r k . B i n a r y a d d r e s s e s s t a r t
with '10', meaning that the decimal value can be anywhere from 128 to 191.
An example of a Class B IP address is 168.212.226.204 where "168.212"
i d e n t i f i e s t h e n e t wo r k a n d " 2 2 6 . 2 0 4 " i d e n t i f i e s t h e h o s t o n t h a t n e t w o r k .
Class C This class is used for small to medium-sized networks. This is the most
Network c o m m o n t y p e o f n e t wo r k .
The first three octets identify the network as Class C; Octet 4 (8 bits) indicate
t h e h o s t wi t h i n t h e n e t w o r k . B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 0 ' , m e a n i n g t h a t t h e
decimal number can be anywhere from 192 to 223.
An example of a Class C IP address is 200.168.212.226 where "200.168.212"
i d e n t i f i e s t h e n e t wo r k a n d " 2 2 6 " i d e n t i f i e s t h e h o s t o n t h a t n e t w o r k .
Class D T h i s c l a s s i s u s e d f o r m u l t i c a s t i n g , wh e r e a n o d e s e n d s a p a c k e t a d d r e s s e d t o
Network a special group address.
B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 1 0 ' , t h e r e f o r e t h e d e c i m a l n u m b e r c a n b e
anywhere from 224 to 239.
Class E This class is used for experimental purposes only.
Network B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 1 1 ' , therefore the decimal number can be
anywhere from 240 to 255. Class E n e t wo r k s a r e u s e d f o r e x p e r i m e n t a t i o n .
They have never been documented o r u t i l i z e d i n a s t a n d a r d wa y .
Broadcast Messages that are intended for all computers on a network are sent as
b r o a d c a s t s . T h e s e m e s s a g e s a l wa y s u s e t h e I P a d d r e s s 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5 .
Subnet
A subnet is a part of a network.

All of the devices within a subnet share a common address component. On TCP/IP
networks, subnets are defined as all devices whose IP addresses have the same prefix.
Devices within a particular subnet might, for example, have IP addresses that start with
100.100.100.

Subnetting enables the network administrator to further divide the host part of the address
into two or more subnets. In this case, a part of the host address is reserved to identify the
particular subnet.

267
VisiLogic Software Manual V330

Subnet Mask
One of the crucial tasks for any router is knowing when a packet of information stays on its
local network. For this, it uses a 'subnet mask'.

A network mask indicates which portion of the address identifies the network and which
portion of the address identifies the node. Class A, B, and C networks have default masks,
also known as natural masks, as shown below.

Class A: 255.0.0.0 - binary - 11111111.00000000.00000000.00000000

Class B: 255.255.0.0 - binary - 11111111.11111111.00000000.00000000

Class C: 255.255.255.0 - binary - 11111111.11111111.11111111.00000000

Since class C networks are the most common type, the most commonly used subnet mask
usually reads "255.255.255.xx.". This tells the router that all messages with the sender and
receiver having an address sharing the first three groups of numbers are on the same
network, and shouldn't be sent out to another network. For example: The computer at
address 192.168.192.254 sends a request to the computer at 192.168.192.252. The router,
which sees all the packets, matches the first three groups in the address of both sender
and receiver (192.168.192.), and keeps the packet on the local network.

Gateway
A gateway is special software, or a device running special software, that routes data
between different networks.

In the case of control networks, the gateway is generally a PC. The gateway PC has its
own IP address.

For example, a proxy server provides a gateway between a private network to the Internet.
The proxy server is configured to enable a workstation to communicate with remote
services on the Internet. In this case, the gateway acts as a barrier that allows a device to
request information from the Internet and to receive information, but does not allow access
to the host network by unauthorized users.

268
Communications

Note The IP address assigned to the gateway device is generally the last available
address.

Socket
A software mechanism that connects an application to a network protocol. A program can,
for example, send and receive TCP/IP messages by opening a socket and reading and
writing data to and from the socket. Note that a socket is a software object, not a physical
component.

Note that when TCP is used, the formal 'handshake' required by the protocol means that
during each session occurring via a defined socket, other communications cannot flow
through any of the other sockets until the current session has been terminated.

Such is not the case with UDP. Since there is no formal handshake, communications can
continue to flow through a socket even when there are multiple requests.

Protocols: UDP and TCP


UDP stands for User Datagram Protocol. It is a connectionless protocol that, like TCP, runs
on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services,
offering instead a direct way to send and receive datagrams over an IP network. It's used
primarily for broadcasting messages over a network.

Note In Unitronics' implementation of Ethernet, UDP is a secure protocol. Here, UDP


runs under MODBUS as well as under Unitronics' proprietary protocols; these additional
layers provide the level of data security required by control applications.

TCP stands for Transmission Control Protocol. TCP is one of the main protocols in TCP/IP
networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to
establish a connection and exchange streams of data. TCP guarantees delivery of data and
also guarantees that packets will be delivered in the same order in which they were sent.

UDP takes messages from application process, attaches source and destination port
number fields for the multiplexing/demultiplexing service, adds two other fields of minor
importance, and passes the resulting "segment" to the network layer. The network layer
encapsulates the segment into an IP datagram and then makes a best-effort attempt to
deliver the segment to the receiving host. If the segment arrives at the receiving host, UDP
uses the port numbers and the IP source and destination addresses to deliver the data in
the segment to the correct application process. Note that with UDP there is no handshaking
between sending and receiving transport-layer entities before sending a segment. For this
reason, UDP is said to be connectionless.

TCP uses a three-way handshake before it starts to transfer data. UDP just blasts away
without any formal preliminaries. Thus UDP does not introduce any delay to establish a
connection. This is probably the principle reason why DNS runs over UDP rather than TCP
-- DNS would be much slower if it ran over TCP. HTTP uses TCP rather than UDP, since
reliability is critical for Web pages with text. But the TCP connection establishment delay in
HTTP is an important contributor to the "world wide wait".

TCP maintains connection state in the end systems. This connection state includes receive
and send buffers, congestion control parameters, and sequence and acknowledgment
number parameters. UDP, on the other hand, does not maintain connection state and does
not track any of these parameters. For this reason, a server devoted to a particular
application can typically support many more active clients when the application runs over
UDP rather than TCP.

The TCP segment has 20 bytes of header overhead in every segment, whereas UDP only
has 8 bytes of overhead.

TCP has a congestion control mechanism that throttles the sender when one or more links
between sender and receiver becomes excessively congested. This throttling can have a
severe impact on real-time applications, which can tolerate some packet loss but require a
minimum send rate. On the other hand, the speed at which UDP sends data is only

269
VisiLogic Software Manual V330

constrained by the rate at which the application generates data, the capabilities of the
source (CPU, clock rate, etc.) and the access bandwidth to the Internet. We should keep in
mind, however, that the receiving host does not necessarily receive all the data - when the
network is congested, a significant fraction of the UDP-transmitted data could be lost due
to router buffer overflow. Thus, the receive rate is limited by network congestion even if the
sending rate is not constrained.

Local Port
In TCP/IP and UDP networks, a port is an endpoint to a logical connection and the way a
client program specifies a specific server program on a computer in a network.

The port numbers are divided into three ranges: the Well Known Ports, the Registered
Ports, and the Dynamic and/or Private Ports.

The Well Known Ports, sometimes called the contact port, are those from 0 through
1023. The Well Known Ports numbers are assigned by the IANA and on most
systems can only be used by system (or root) processes or by programs executed by
privileged users.
Note Port 502 is reserved for SCADA.
The Registered Ports are those from 1024 through 4915. The Registered Ports are
listed by the IANA and on most systems can be used by ordinary user processes or
programs executed by ordinary users.
The Dynamic and/or Private Ports are those from 49152 through 65535
To the extent possible, these same port assignments are used with the UDP [RFC768].

Port Number Description


1 TCP Port Service Multiplexer (TCPMUX)
5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
29 MSG ICP
37 Time
42 Host Name Server (Nameserv)
43 WhoIs
49 Login Host Protocol (Login)
53 Domain Name System (DNS)
69 Trivial File Transfer Protocol (TFTP)
70 Gopher Services
79 Finger
80 HTTP
103 X.400 Standard
108 SNA Gateway Access Server
109 POP2
110 POP3
115 Simple File Transfer Protocol (SFTP)
118 SQL Services
119 Newsgroup (NNTP)
137 NetBIOS Name Service
139 NetBIOS Datagram Service
143 Interim Mail Access Protocol (IMAP)
150 NetBIOS Session Service
156 SQL Server
161 SNMP
179 Border Gateway Protocol (BGP)

270
Communications

190 Gateway Access Control Protocol (GACP)


194 Internet Relay Chat (IRC)
197 Directory Location Service (DLS)
389 Lightweight Directory Access Protocol (LDAP)
396 Novell Netware over IP
443 HTTPS
444 Simple Network Paging Protocol (SNPP)
445 Microsoft-DS
458 Apple QuickTime
502 MODBUS
546 DHCP Client
547 DHCP Server
563 SNEWS
569 MSN
1080 Socks

Glossary
ARP

Address Resolution Protocol associates an IP address to a hardware address by


requesting the sending machine for additional information called a MAC address. This only
applies to Ethernet based networks.

Client

The client is generally an application that runs on a personal computer or workstation and
relies on a server to perform some operations. For example, an e-mail client is an
application that enables you to send and receive e-mail.

Client/server architecture

In this type of network architecture, each computer or process on the network is either a
client or a server. Servers are powerful computers or processes dedicated to managing
disk drives (file servers), printers (print servers), or network traffic (network servers ).
Clients are PCs or workstations on which users run applications. Clients rely on servers for
resources, such as files, devices, and even processing power.

Another type of network architecture is known as a peer-to-peer architecture because each


node has equivalent responsibilities. Both client/server and peer-to-peer architectures are
widely used, and each has unique advantages and disadvantages.

DHCP

Dynamic Host Configuration Protocol is a protocol for organizing and simplifying the
administration of IP addresses for local machines. In many cases (such as with WinRoute)
A DHCP server is built into the gateway for further simplification.

DNS

Domain Name System is a naming scheme for IP addressing. For example www.kerio.com
is a domain name and has an associated IP address. A DNS server matches domain
names to an IP address. We use the domain name system because it is easier to
remember a domain name than a string of numbers.

Firewall

A filtering module located on a gateway machine that examines all incoming and outgoing
traffic to determine if it may be routed to its destination. WinRoute Lite is a simple Firewall
based on Network Address Translation.

Gateway

271
VisiLogic Software Manual V330

The point of entrance from one network to another. A gateway is responsible for the proper
distribution of data coming in and going out of a local area network. WinRoute must be
installed on the gateway machine, also referred to as the host computer or network router.

ICMP

Internet Control Message Protocol uses datagrams to report errors in transmission between
the host and gateway.

IP address

An IP address is the unique 32-bit number, which identifies a computer in a network. In


order to communicate across wide area networks, each computer must have a unique IP
address. Local area networks cannot directly communicate across wide area networks
because they are defined by a private class of IP's.

Local Area Network

A Local Area Network (LAN) is a group of interconnected computers with the ability to
share resources without having to access a wide area network.

MAC Address

A Media Access Control (MAC) address is a hard-coded interface identification used by


layer 2 devices (switch or bridge) for proper forwarding of frames between computers on a
network.

NAT

Network Address Translation is an Internet standard that enables a local-area network


(LAN) to use one set of IP addresses for internal traffic and a second set of addresses for
external traffic. A NAT box located where the LAN meets the Internet makes all necessary
IP address translations.

NAT serves three main purposes:

Provides a type of firewall by hiding internal IP addresses


Enables a company to use more internal IP addresses. Since they're used internally
only, there's no possibility of conflict with IP addresses used by other companies and
organizations.
Allows a company to combine multiple ISDN connections into a single Internet
connection.
Network interface

A network interface may be an Ethernet card, modem, ISDN card, etc. The computer sends
and receives packets by means of the network interface.

Network Mask

A Network mask is used to group IP addresses together. Routers use a subnet mask to
define the group (or IP subnet) to which an IP address belongs so that it can identify the
correct interface from which it should forward an IP packet.

Packet

When data is transmitted over the network it is broken up into smaller pieces called packets
and individually routed to their destination. This way if one packet is not properly received,
the receiving party can request resubmission of the single packet, as opposed to the entire
piece of data. Each packet contains headers, which are responsible for the successful
transmission of the packet, and a data part, which contains a portion of the original data
being transmitted over the network. The term packet is used when referring to layer 3
devices (i.e. a router). A frame is the term used when referring to layer two devices (i.e. a
switch).

272
Communications

Peer-to-peer architecture

A type of network in which each workstation has equivalent capabilities and responsibilities.
This differs from client/server architectures, in which some computers are dedicated to
serving the others. Peer-to-peer networks are generally simpler, but they usually do not
offer the same performance under heavy loads.

Port

A port, in terms of TCP/IP, is a 16-bit number (the allowed range being 1 through 65535)
used by the protocols of the transport layer - the TCP and UDP protocols. Ports are used to
address applications. In other words, when a packet is received by the computer, the
operating system uses port information to determine which application will receive the data
within the packet.

Port Mapping

Port mapping is an advanced feature of WinRoute that allows servers to be hosted securely
behind NAT. When a packet is received by the WinRoute host it can be forwarded (by
translating the destination information in the packet header) to another computer in the
local network.

Protocol

Defines rules for the transmission of data.

RAS

Remote Access Service refers to the ability to dial into another computer or network
remotely. In the context of WinRoute, RAS simply refers to a dial-up connection.

TCP/IP

TCP/IP is a suite of networking protocols used for communication across networks. It is the
standard form of communication over the Internet. The two most significantly used Internet
Protocols are TCP and UDP. Transmission Control Protocol (TCP) is a connection oriented
protocol intended to provide reliability and to ensure that all data is transferred successfully
from one computer to another. User Datagram Protocol (UDP) is a connectionless protocol
that does not require any confirmation from the receiving party. UDP is more commonly
used for multimedia and streaming applications.

273
Ethernet

About Ethernet
General information regarding the parameters required to implement Ethernet is given
below. A glossary of Ethernet terms is included at the bottom of this topic. To learn how to
specifically define parameters within the VisiLogic Ethernet FBs, refer to Using Ethernet.

Unitronics' Ethernet uses star topology.

About Networks
Generally, controllers are part of a closed, internal control network. A closed network may
be referred to as a LAN (Local Area Network) or an Intranet. When Intranets are
connected via gateway devices, they form a WAN (Wide Area Network). The Internet,
which is made up of connected Intranets or LANs, is a form of WAN. Internet
communications are via the TCP/IP protocol.

Large manufacturing companies, for example, may be made up of a number of factories,


each of which contains its own LAN, closed control network. Within the company, all of
these LANs may be connected by gateway devices, forming a proprietary WAN--a
company Internet, which in turn may be connected to the Internet--the World Wide Web.

Within closed controller networks, Ethernet is becoming a common protocol. Ethernet


communications are also via the TCP/IP protocol.

What is an IP address?
In order to enable a controller to communicate over Ethernet, you must assign it an IP
address.

An IP address is a unique number which identifies a computer or controller on a TCP/IP


network. These networks use the IP address to route messages to their destination. An IP
address is a 32-bit numeric address which is divided into four numbers (octets). Each octet
is separated by a period formatted as follows: 1.160.10.240. The decimal value in each
octet can range from zero to 255, or 00000000 - 11111111 in binary notation.

Note The values '0' and '255' are restricted and should not normally be used.

Internally, within an Intranet, you can assign IP addresses at random as long as each one
is unique within the Intranet. The common IP may be: 192.168.192.xx, where the last octet
is the identifies the device on the network.

Note In the majority of cases, controllers are part of a closed control network (Intranet).
The controllers' IP addresses are unique only within the Intranet, and cannot be accessed
via the Internet--unless an valid Internet IP address is purchased from a ISP and
assigned to the controller.

275
VisiLogic Software Manual V330

IP Addresses and Networks


In binary form, the IP address 68.212.226.204 is
10101000.11010100.11100010.11001100.

The 4 octets of the address are used to create classes of IP addresses. Networks are
divided into 5 classes, according to size, as explained below. The octets are split into two
sections: Net and Host. The Net section is represented by the first octet. It is used to
identify the network that a device belongs to. The Host (sometimes called Node) section
identifies the actual device on the network. The Host section is always contains by the final
octets; how many octets is determined by the network class. There are five IP classes plus
certain special addresses.

Although decimals are generally used to represent IP addresses, it is the binary value
which determines which class of network the IP address belongs to. All nodes on a given
network share the same network prefix but must have a unique host number.

Default The IP address of 0.0.0.0 is used for the default network.


Network
Class A T h i s c l a s s i s f o r v e r y l a r g e n e t wo r k s .
Network B i n a r y a d d r e s s s t a r t wi t h ' 0 ' , m e a n i n g t h a t t h e d e c i m a l v a l u e c a n b e a n y w h e r e
from 1 to 126.
The first octet bits identify the network as Class A ; Octets 2, 3, and 4 (the
n e xt 2 4 b i t s ) i n d i c a t e t h e h o s t wi t h i n t h e n e t w o r k .
An example of a Class A IP address is 102.168.212.226, where "102" identifies
the network and "168.212.226" identifies the host on that network.
Note The IP address 127.0.0.1 is used as the loopback address. This means
that it is used by the host computer to send a message back to itself. It is
c o m m o n l y u s e d f o r t r o u b l e s h o o t i n g a n d n e t wo r k t e s t i n g .
Class B This class is used for medium-sized networks.
Network T h e f i r s t t wo o c t e t s i d e n t i f y t h e n e t w o r k a s C l a s s B ; O c t e t s 3 a n d 4 ( t h e
r e m a i n i n g 1 6 b i t s ) i n d i c a t e t h e h o s t wi t h i n t h e n e t w o r k . B i n a r y a d d r e s s e s s t a r t
with '10', meaning that the decimal value can be anywhere from 128 to 191.
An example of a Class B IP address is 168.212.226.204 where "168.212"
i d e n t i f i e s t h e n e t wo r k a n d " 2 2 6 . 2 0 4 " i d e n t i f i e s t h e h o s t o n t h a t n e t w o r k .
Class C This class is used for small to medium-sized networks. This is the most
Network c o m m o n t y p e o f n e t wo r k .
The first three octets identify the network as Class C; Octet 4 (8 bits) indicate
t h e h o s t wi t h i n t h e n e t w o r k . B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 0 ' , m e a n i n g t h a t t h e
decimal number can be anywhere from 192 to 223.
An example of a Class C IP address is 200.168.212.226 where "200.168.212"
i d e n t i f i e s t h e n e t wo r k a n d " 2 2 6 " i d e n t i f i e s t h e h o s t o n t h a t n e t w o r k .
Class D T h i s c l a s s i s u s e d f o r m u l t i c a s t i n g , wh e r e a n o d e s e n d s a p a c k e t a d d r e s s e d t o
Network a special group address.
B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 1 0 ' , t h e r e f o r e t h e d e c i m a l n u m b e r c a n b e
anywhere from 224 to 239.
Class E This class is used for experimental purposes only.
Network B i n a r y a d d r e s s e s s t a r t wi t h ' 1 1 1 1 ' , therefore the decimal number can be
anywhere from 240 to 255. Class E n e t wo r k s a r e u s e d f o r e x p e r i m e n t a t i o n .
They have never been documented o r u t i l i z e d i n a s t a n d a r d wa y .
Broadcast Messages that are intended for all computers on a network are sent as
b r o a d c a s t s . T h e s e m e s s a g e s a l wa y s u s e t h e I P a d d r e s s 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5 .
Subnet
A subnet is a part of a network.

All of the devices within a subnet share a common address component. On TCP/IP
networks, subnets are defined as all devices whose IP addresses have the same prefix.
Devices within a particular subnet might, for example, have IP addresses that start with
100.100.100.

276
Ethernet

Subnetting enables the network administrator to further divide the host part of the address
into two or more subnets. In this case, a part of the host address is reserved to identify the
particular subnet.

Subnet Mask
One of the crucial tasks for any router is knowing when a packet of information stays on its
local network. For this, it uses a 'subnet mask'.

A network mask indicates which portion of the address identifies the network and which
portion of the address identifies the node. Class A, B, and C networks have default masks,
also known as natural masks, as shown below.

Class A: 255.0.0.0 - binary - 11111111.00000000.00000000.00000000

Class B: 255.255.0.0 - binary - 11111111.11111111.00000000.00000000

Class C: 255.255.255.0 - binary - 11111111.11111111.11111111.00000000

Since class C networks are the most common type, the most commonly used subnet mask
usually reads "255.255.255.xx.". This tells the router that all messages with the sender and
receiver having an address sharing the first three groups of numbers are on the same
network, and shouldn't be sent out to another network. For example: The computer at
address 192.168.192.254 sends a request to the computer at 192.168.192.252. The router,
which sees all the packets, matches the first three groups in the address of both sender
and receiver (192.168.192.), and keeps the packet on the local network.

Gateway
A gateway is special software, or a device running special software, that routes data
between different networks.

In the case of control networks, the gateway is generally a PC. The gateway PC has its
own IP address.

277
VisiLogic Software Manual V330

For example, a proxy server provides a gateway between a private network to the Internet.
The proxy server is configured to enable a workstation to communicate with remote
services on the Internet. In this case, the gateway acts as a barrier that allows a device to
request information from the Internet and to receive information, but does not allow access
to the host network by unauthorized users.

Note The IP address assigned to the gateway device is generally the last available
address.

Socket
A software mechanism that connects an application to a network protocol. A program can,
for example, send and receive TCP/IP messages by opening a socket and reading and
writing data to and from the socket. Note that a socket is a software object, not a physical
component.

Note that when TCP is used, the formal 'handshake' required by the protocol means that
during each session occurring via a defined socket, other communications cannot flow
through any of the other sockets until the current session has been terminated.

Such is not the case with UDP. Since there is no formal handshake, communications can
continue to flow through a socket even when there are multiple requests.

Protocols: UDP and TCP


UDP stands for User Datagram Protocol. It is a connectionless protocol that, like TCP, runs
on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services,
offering instead a direct way to send and receive datagrams over an IP network. It's used
primarily for broadcasting messages over a network.

Note In Unitronics' implementation of Ethernet, UDP is a secure protocol. Here, UDP


runs under MODBUS as well as under Unitronics' proprietary protocols; these additional
layers provide the level of data security required by control applications.

TCP stands for Transmission Control Protocol. TCP is one of the main protocols in TCP/IP
networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to

278
Ethernet

establish a connection and exchange streams of data. TCP guarantees delivery of data and
also guarantees that packets will be delivered in the same order in which they were sent.

UDP takes messages from application process, attaches source and destination port
number fields for the multiplexing/demultiplexing service, adds two other fields of minor
importance, and passes the resulting "segment" to the network layer. The network layer
encapsulates the segment into an IP datagram and then makes a best-effort attempt to
deliver the segment to the receiving host. If the segment arrives at the receiving host, UDP
uses the port numbers and the IP source and destination addresses to deliver the data in
the segment to the correct application process. Note that with UDP there is no handshaking
between sending and receiving transport-layer entities before sending a segment. For this
reason, UDP is said to be connectionless.

TCP uses a three-way handshake before it starts to transfer data. UDP just blasts away
without any formal preliminaries. Thus UDP does not introduce any delay to establish a
connection. This is probably the principle reason why DNS runs over UDP rather than TCP
-- DNS would be much slower if it ran over TCP. HTTP uses TCP rather than UDP, since
reliability is critical for Web pages with text. But the TCP connection establishment delay in
HTTP is an important contributor to the "world wide wait".

TCP maintains connection state in the end systems. This connection state includes receive
and send buffers, congestion control parameters, and sequence and acknowledgment
number parameters. UDP, on the other hand, does not maintain connection state and does
not track any of these parameters. For this reason, a server devoted to a particular
application can typically support many more active clients when the application runs over
UDP rather than TCP.

The TCP segment has 20 bytes of header overhead in every segment, whereas UDP only
has 8 bytes of overhead.

TCP has a congestion control mechanism that throttles the sender when one or more links
between sender and receiver becomes excessively congested. This throttling can have a
severe impact on real-time applications, which can tolerate some packet loss but require a
minimum send rate. On the other hand, the speed at which UDP sends data is only
constrained by the rate at which the application generates data, the capabilities of the
source (CPU, clock rate, etc.) and the access bandwidth to the Internet. We should keep in
mind, however, that the receiving host does not necessarily receive all the data - when the
network is congested, a significant fraction of the UDP-transmitted data could be lost due
to router buffer overflow. Thus, the receive rate is limited by network congestion even if the
sending rate is not constrained.

Local Port
In TCP/IP and UDP networks, a port is an endpoint to a logical connection and the way a
client program specifies a specific server program on a computer in a network.

The port numbers are divided into three ranges: the Well Known Ports, the Registered
Ports, and the Dynamic and/or Private Ports.

The Well Known Ports, sometimes called the contact port, are those from 0 through
1023. The Well Known Ports numbers are assigned by the IANA and on most
systems can only be used by system (or root) processes or by programs executed by
privileged users.
Note Port 502 is reserved for SCADA.
The Registered Ports are those from 1024 through 4915. The Registered Ports are
listed by the IANA and on most systems can be used by ordinary user processes or
programs executed by ordinary users.
The Dynamic and/or Private Ports are those from 49152 through 65535
To the extent possible, these same port assignments are used with the UDP [RFC768].

Port Number Description

279
VisiLogic Software Manual V330

1 TCP Port Service Multiplexer (TCPMUX)


5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
29 MSG ICP
37 Time
42 Host Name Server (Nameserv)
43 WhoIs
49 Login Host Protocol (Login)
53 Domain Name System (DNS)
69 Trivial File Transfer Protocol (TFTP)
70 Gopher Services
79 Finger
80 HTTP
103 X.400 Standard
108 SNA Gateway Access Server
109 POP2
110 POP3
115 Simple File Transfer Protocol (SFTP)
118 SQL Services
119 Newsgroup (NNTP)
137 NetBIOS Name Service
139 NetBIOS Datagram Service
143 Interim Mail Access Protocol (IMAP)
150 NetBIOS Session Service
156 SQL Server
161 SNMP
179 Border Gateway Protocol (BGP)
190 Gateway Access Control Protocol (GACP)
194 Internet Relay Chat (IRC)
197 Directory Location Service (DLS)
389 Lightweight Directory Access Protocol (LDAP)
396 Novell Netware over IP
443 HTTPS
444 Simple Network Paging Protocol (SNPP)
445 Microsoft-DS
458 Apple QuickTime
502 MODBUS
546 DHCP Client
547 DHCP Server
563 SNEWS
569 MSN
1080 Socks

Glossary
ARP

Address Resolution Protocol associates an IP address to a hardware address by


requesting the sending machine for additional information called a MAC address. This only
applies to Ethernet based networks.

Client

280
Ethernet

The client is generally an application that runs on a personal computer or workstation and
relies on a server to perform some operations. For example, an e-mail client is an
application that enables you to send and receive e-mail.

Client/server architecture

In this type of network architecture, each computer or process on the network is either a
client or a server. Servers are powerful computers or processes dedicated to managing
disk drives (file servers), printers (print servers), or network traffic (network servers ).
Clients are PCs or workstations on which users run applications. Clients rely on servers for
resources, such as files, devices, and even processing power.

Another type of network architecture is known as a peer-to-peer architecture because each


node has equivalent responsibilities. Both client/server and peer-to-peer architectures are
widely used, and each has unique advantages and disadvantages.

DHCP

Dynamic Host Configuration Protocol is a protocol for organizing and simplifying the
administration of IP addresses for local machines. In many cases (such as with WinRoute)
A DHCP server is built into the gateway for further simplification.

DNS

Domain Name System is a naming scheme for IP addressing. For example www.kerio.com
is a domain name and has an associated IP address. A DNS server matches domain
names to an IP address. We use the domain name system because it is easier to
remember a domain name than a string of numbers.

Firewall

A filtering module located on a gateway machine that examines all incoming and outgoing
traffic to determine if it may be routed to its destination. WinRoute Lite is a simple Firewall
based on Network Address Translation.

Gateway

The point of entrance from one network to another. A gateway is responsible for the proper
distribution of data coming in and going out of a local area network. WinRoute must be
installed on the gateway machine, also referred to as the host computer or network router.

ICMP

Internet Control Message Protocol uses datagrams to report errors in transmission between
the host and gateway.

IP address

An IP address is the unique 32-bit number, which identifies a computer in a network. In


order to communicate across wide area networks, each computer must have a unique IP
address. Local area networks cannot directly communicate across wide area networks
because they are defined by a private class of IP's.

Local Area Network

A Local Area Network (LAN) is a group of interconnected computers with the ability to
share resources without having to access a wide area network.

MAC Address

A Media Access Control (MAC) address is a hard-coded interface identification used by


layer 2 devices (switch or bridge) for proper forwarding of frames between computers on a
network.

NAT

281
VisiLogic Software Manual V330

Network Address Translation is an Internet standard that enables a local-area network


(LAN) to use one set of IP addresses for internal traffic and a second set of addresses for
external traffic. A NAT box located where the LAN meets the Internet makes all necessary
IP address translations.

NAT serves three main purposes:

Provides a type of firewall by hiding internal IP addresses


Enables a company to use more internal IP addresses. Since they're used internally
only, there's no possibility of conflict with IP addresses used by other companies and
organizations.
Allows a company to combine multiple ISDN connections into a single Internet
connection.
Network interface

A network interface may be an Ethernet card, modem, ISDN card, etc. The computer sends
and receives packets by means of the network interface.

Network Mask

A Network mask is used to group IP addresses together. Routers use a subnet mask to
define the group (or IP subnet) to which an IP address belongs so that it can identify the
correct interface from which it should forward an IP packet.

Packet

When data is transmitted over the network it is broken up into smaller pieces called packets
and individually routed to their destination. This way if one packet is not properly received,
the receiving party can request resubmission of the single packet, as opposed to the entire
piece of data. Each packet contains headers, which are responsible for the successful
transmission of the packet, and a data part, which contains a portion of the original data
being transmitted over the network. The term packet is used when referring to layer 3
devices (i.e. a router). A frame is the term used when referring to layer two devices (i.e. a
switch).

Peer-to-peer architecture

A type of network in which each workstation has equivalent capabilities and responsibilities.
This differs from client/server architectures, in which some computers are dedicated to
serving the others. Peer-to-peer networks are generally simpler, but they usually do not
offer the same performance under heavy loads.

Port

A port, in terms of TCP/IP, is a 16-bit number (the allowed range being 1 through 65535)
used by the protocols of the transport layer - the TCP and UDP protocols. Ports are used to
address applications. In other words, when a packet is received by the computer, the
operating system uses port information to determine which application will receive the data
within the packet.

Port Mapping

Port mapping is an advanced feature of WinRoute that allows servers to be hosted securely
behind NAT. When a packet is received by the WinRoute host it can be forwarded (by
translating the destination information in the packet header) to another computer in the
local network.

Protocol

Defines rules for the transmission of data.

RAS

282
Ethernet

Remote Access Service refers to the ability to dial into another computer or network
remotely. In the context of WinRoute, RAS simply refers to a dial-up connection.

TCP/IP

TCP/IP is a suite of networking protocols used for communication across networks. It is the
standard form of communication over the Internet. The two most significantly used Internet
Protocols are TCP and UDP. Transmission Control Protocol (TCP) is a connection oriented
protocol intended to provide reliability and to ensure that all data is transferred successfully
from one computer to another. User Datagram Protocol (UDP) is a connectionless protocol
that does not require any confirmation from the receiving party. UDP is more commonly
used for multimedia and streaming applications.

Using Ethernet
Unitronics currently supports both TCP and UDP protocols, as explained in the topic About
Ethernet. This topic also contains general information about Ethernet, IP addressing,
sockets, and ports.

Ethernet uses star topology.

In order to use Ethernet, your controller must comprise an Ethernet port.

V2xx Vision OPLCs can be ordered with or without an Ethernet port. The Ethernet port
enables you to implement communications via TCP/IP, such as MODBUS over TCP. To
check if your Vision controller was supplied with an installed Ethernet port, first check the
devices model number. In addition, note that the Ethernet port is an RJ-45-type port that is
lined with metal.

Via Ethernet, you can:

Communicate data within a PLC network.


Use a PC running VisiLogic, Remote Access, or other communication .dll to access a
networked PLC.
Use a PC to access a PLC via MODBUS over TPC.
Use MODBUS over TCP to access any external device, such as barcode readers or
scales, that support the MODBUS protocol.

283
Ethernet

Note Currently, a PLC can be configured as either a master or slave device.

The default socket configuration enables you to implement all of these communication
options.

Default Socket Configuration


Vision controllers currently offer 4 sockets. The default socket configuration includes:

Socket Protocol Port Function


Number
0 UDP 20,000 Enables data to be both transmitted and received within a
PLC network.
Note If you are using the default settings for Socket 0,
note that data is sent via Unicast to IP: 255.255.255.255.
port: 20,000 plus the last byte of the IP address originally
assigned to the device.
This is why Port numbers 20,000-20,255 are reserved for
Socket 0.
1 TCP 20,256 Enables PC to PLC communication via UnCmDrv1.dll,
including VisiLogic, Remote Access, and other Unitronics
communication applications.
2 TCP 502 Set to 'listen' as slave (server), enables MODBUS
applications such as OPC servers and SCADA systems
which use MODBUS TCP over IP.
3 TCP 20,257 Set as TCP master, enables communication with external
devices such as bar code readers and line printers.

Note The default configuration means that, for most applications, you do not
need to include a Socket Init FB in the ladder application. However, if, for
example, your application requires 4 sockets for TCP, change the default
configuration of Sockets 0 & 1 from UDP to TCP via the Socket Init FBs.

284
Ethernet

Note When using the default socket configuration, Socket 0 cannot be used to
communicate data between routers, and therefore cannot transfer data
between Intranets as shown in the figure below. This is because the
default configuration for Socket 0 uses Unicast.

Note Note that when TCP is used, the formal 'handshake' required by the
protocol means that, during each session occurring via a defined socket,
other communications cannot flow through that socket until the current
session has been terminated.

Such is not the case with UDP. Since there is no formal handshake,
communications can continue to flow through a socket even when there
are multiple requests.

General
When using Ethernet, use the MODBUS IP FBs. For detailed information regarding
MODBUS IP commands, refer to the MODBUS IP help topics.

Note In order to implement Ethernet, a controller must be assigned an IP address.


This is done via the Ethernet Card Init FB, which must be included in the Ladder
applications of both master and slave controllers.
Only Class C-type addresses are supported, as explained in the topic About
Ethernet.
Note When the Ethernet card finishes initialization, SB 142 rises. Use this as a
condition before activating any Ethernet element, such as Socket Connect.
Note An activating condition must be placed before the Ethernet Card Init FB. This
may be assigned as a power-up task; however a one-shot transitional contact
may also be used.
Note Unitronics proprietary 'COM Protocol FB' located on the FBs menu, which may
ordinarily be used to access external slave devices, is not currently compatible
with Ethernet.
Examples
PLC to external device: MODBUS Master over TCP/IP
In this case, the controller acts as a MODBUS master; slave devices accessed may be, for
example, I/Os or barcode readers. The master PLC Ladder application must include the
elements shown below.

Step 1: Initializing the Ethernet card and Configuring MODBUS

In the figure below, Socket 3 is used, which is the default TCP socket for accessing
external slave devices.

285
VisiLogic Software Manual V330

Note The slave unit ID must be set to 255.

Step 2: Establishing the Ethernet Connection: Connect Socket

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave devices are indirect addresses
(pointers). In the figure below, the Start of Vector parameter is 5610. This means
that the master will begin reading from register 5610 in the MODBUS-based
slave device.

286
Ethernet

Step 4: Terminating the Ethernet connection: Close Socket

When you terminate the connection, use the 'Function in Progress' MB to ensure that you
do not terminate the connection while data is being communicated.

PLC networks, PLC to PLC


Any controller within the network can be both master and slave. In order to be read by
the master, a slave's application must contain the MODBUS IP Scan FB.

Using UDP to implement controller-to-controller communication

In order to communicate via Ethernet throughout your controller network, you must include
an Ethernet Card Init FB in the ladder application of each networked controller. Remember
that, when using UDP, it is not necessary to use the Socket: Connect or Socket: Close
elements; these are only required by TCP applications.

Master
The master PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card and configuring MODBUS

The MODBUS Configuration is linked to Socket 0, which is by default set to UDP.

287
VisiLogic Software Manual V330

Note A PLC defined as a UDP master can communicate with a number of


slave devices.

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave PLCs are indirect addresses
(pointers). In the figure below, Below, the Slave: Start of Vector
parameter is 15. This means that the master will begin reading from MI
15 in the slave PLC. Since the Read: Vector Length parameter is 3, the
function takes the values in MI 15, 16 and 17.
The Master: Start of Vector parameter is 17; therefore the values will be
written into MI 17, 18, an 19 in the master device.

Slave
The slave PLC Ladder application must include the elements shown below.

288
Ethernet

Step 1: Initializing the Ethernet card and configuring MODBUS

Step 2: Scan

To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.

Using TCP to implement controller-to-controller communication

Master
The master PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card, Socket, and Configuring MODBUS

In the figure below, the socket is configured to use TCP.

289
VisiLogic Software Manual V330

Step 2: Establishing the Ethernet Connection: Connect Socket

Note It is recommended that there be a time elapse of a few seconds after the
Ethernet Card Initialization and before activating Socket Connect. A timer
may be used for this purpose.

Step 3: Using MODBUS Commands

Note Note that the operand addresses in slave PLCs are indirect addresses
(pointers). In the figure below, Below, the Slave: Start of Vector
parameter is 15. This means that the master will begin reading from MI
15 in the slave PLC. Since the Read: Vector Length parameter is 3, the
function takes the values in MI 15, 16 and 17.
The Master: Start of Vector parameter is 17; therefore the values will be
written into MI 17, 18, an 19 in the master device.

290
Ethernet

Step 4: Terminating the Ethernet connection: Close Socket

When you terminate the connection, use the 'Function in Progress' MB to ensure
that you do not terminate the connection while data is being communicated.

Slave
The slave PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card, Socket, and Configuring MODBUS

In the figure below, the socket is configured to use TCP.

291
VisiLogic Software Manual V330

Step 2: Scan

To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.

PC to PLC: Accessing PLC via SCADA


To enable the SCADA application to access the PLC, the PLC is defined as a slave device.
The slave PLC Ladder application must include the elements shown below.

Step 1: Initializing the Ethernet card and configuring MODBUS

Port 502 is the well-known port for MODBUS applications.

292
Ethernet

Step 2: Scan

To enable the SCADA application to access the slave, include a MODBUS Scan FB in the
slave's application.

Ethernet Operations

The Ethernet FBs are grouped under Ethernet on the FB's menu.

Ethernet: Card Init

Ethernet: Socket Init

293
VisiLogic Software Manual V330

Ethernet: TCP Connect \ TCP Close

Ethernet FAQs
Using the PLC as a webserver

This feature is not currently supported.

Using VisiLogic to access a remote controller via Ethernet

This feature will be supported in the next version of VisiLogic.

Ethernet: Card Init


This function is located under Ethernet on the FB's menu.

If you assign an IP address indirectly, via an MI vector, note that the vector is 4 MIs long.
The low byte of each MI provides the number for an octet within the IP address.

If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI 3 contain
the values 192, 198, 192, 45, the IP address will be 192.198.192. 45.

Note In order to implement Ethernet, a controller must be assigned an IP address.


This is done via the Ethernet Card Init FB, which must be included in the
Ladder applications of both master and slave controllers. Information on IP
addressing is given in the topic About Ethernet
Note When the Ethernet card finishes initialization, SB 142 rises. Use this as a
condition before activating any Ethernet element, such as Socket: Connect.
Note An activating condition must be placed before the Ethernet Card Init FB. This

294
Ethernet

may be assigned as a power-up task; however a one-shot transitional contact


may also be used.
Note If you have linked the IP address to a vector of MIs, and this condition is not
activated, the IP address will not be assigned to the controller. Make sure, for
example, that if you have used a power-up condition, that the controller does
go through power-up.

Ethernet: Socket Init


This function is located under Ethernet on the FB's menu.

Vision controllers currently offer 4 sockets.

The default configuration means that, for most applications, you do not need to include a
Socket Init FB in the ladder application. However, if, for example, your application requires
4 sockets for TCP, change the default configuration of Sockets 0 & 1 from UDP to TCP via
the Socket Init FBs.

The default socket configuration includes:

Socket Protocol Port Function


Number
0 UDP 20,000 E n a b l e s d a t a t o b e b o t h t r a n s m i t t e d a n d r e c e i v e d wi t h i n a
PLC network.
Note If you are using the default settings for Socket 0,
note that data is sent via Unicast to IP: 255.255.255.255.
port: 20,000 plus the last byte of the IP address originally
assigned to the device.
This is why Port numbers 20,000-20,255 are reserved for
Socket 0.
1 UDP 20,256 Enabl es PC to PLC com m unication vi a UnCm Drv1.dll,

295
VisiLogic Software Manual V330

including VisiLogic, Remote Access, and other Unitronics


communication applications.
2 TCP 502 Set to 'listen' as slave (server), enables MODBUS
applications such as OPC servers and SCADA systems
which use MODBUS TCP over IP.
3 TCP 20,257 Set as MODBUS master, enables communication with
e xt e r n a l d e v i c e s s u c h a s b a r c o d e r e a d e r s a n d l i n e
printers.

Note When TCP is used, the formal 'handshake' required by the protocol means that
during each session occurring via a defined socket, other communications
cannot flow through any of the other sockets until the current session has been
terminated.
Such is not the case with UDP. Since there is no formal handshake,
communications can continue to flow through a socket even when there are
multiple requests.

Ethernet: TCP Connect \ TCP Close


TCP applications require you to use a TCP: Connect FB to establish the Ethernet
connection after the Ethernet card is initialized and before activating any of the MODBUS
IP commands.

To terminate the session, use the TCP: Close FB. Both elements are located under
Ethernet on the FB's menu.

296
Networks

About Networks
You can create a decentralized control network of up to 63 controllers using CANbus. This
is sometimes called a multi-master network. In such a network, CANbus enables inter-PLC
data exchange. Technical specifications and wiring diagrams are given in the User Guide.
Vision controllers also support data exchange via the MODBUS protocol

.
You can network M90 Micro-OPLCs and Vision OPLC controllers.

You can access a networked controller unit via its RS232 port using a PC. Using any
networked controller as a bridge, you can view, read, and write data into any unit, as well
as upload and download programs.

This feature can also allow you to view your network via a SCADA program.

297
VisiLogic Software Manual V330

COM Ports
All Vision controllers comprise RS232 serial communication ports. RS232/RS485 adaptors
are available by separate order. Certain models, such as the Vision120, support both
RS232 and RS485. For details on communications hardware settings, refer to the User
Guides and documentation supplied with relevant models.

Separate CANbus ports are also provided with specific controller models.

Note All ports can be used simultaneously. For example, a single controller may use one
serial port to send messages to a modem via RS232, another port to communicate with a
frequency converter, while the controller engages in communications via its CANbus port.

Communication ports must be initialized in your control program using the COM Init FB,
located on the FB's menu.

Assigning a Unit ID number


When you create an controller network, you must assign a Unit ID number to each
controller. A Unit ID number is unique. The same ID number must not be assigned to more
than one device within a network.

You use this number for two purposes:

To enable controllers to exchange data.


To access a networked controller via your PC.
Note The default ID # is 1.

To assign a Unit ID number, store a value into SI 8.

298
Networks

Note ID numbers
1-63 are reserved for
controllers linked via
CANbus; ID numbers
64-127 are reserved
for controllers
networked via RS485.

Using this range of ID


numbers prevents a
polled controller from
attempting to act as a
CANbus bridge,
preventing it from
attempting to locate
the requested
controller.

Instead of storing a constant value into SI 8, you can link a register value. In this way, you
can enable an end-user to enter an Unit ID number via the HMI panel in Information mode.
You can also create a Display for this purpose as shown below.

Note Although you can place a different ID number directly into SI 8 via Information
mode, this number will be erased the next time the controller powers up.

Accessing a Networked PLC via PC


Use a PC to access controllers within a network either via a direct connection or via GSM
or landline modem.

299
VisiLogic Software Manual V330

Accessing a Networked Controller


1. Connect your PC to any controller in the network using the programming cable
supplied with the controller kit.

Note Different PCs can access a network at the same time, using different controller
units as bridges. However, 2 different PCs cannot simultaneously access the same
controller unit.

2. Select a networked controller by opening Communication & OS from the Connection


menu, and then entering the Unit ID number.

300
Networks

Accessing a Networked Controller via Modem

Note The PC-modem cable is not the same type of cable used to connect between the
controller and the modem. Ensure that the cable used to connect the PC to the modem
provides connection points for all of the modem's pins.
In order to ensure successful operations, it is recommended that you use an external PC
modem. Internal modems may not support communications.
Both PC and controller must use the same type of modem: either landline or GSM.
Internal PC modems must be used in conjunction with the driver provided by the modem's
manufacturer.
If call are routed via a switchboard, note that the switchboard settings may interfere with
communications. Consult with your switchboard provider.

Modems: Setting Up
PLC-Modem Connection

301
VisiLogic Software Manual V330

PC Modem Configuration

Open PC Modem Configuration from the Options menu.

302
Networks

Note If, within the modem initialization strings, the parameter S7 TimeOut, is to short to
permit the PLC's modem to answer, an error will result.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to
receive an answer from the PLC's modem. If, however, the PLC program's COM Init FB
Answer Settings are set to 'Answer after 6 rings,' the PLC modem will not be able to answer
before the 3 seconds have elapsed. In this case, the TimeOut parameter is exceeded, and
the PC modem will return the No Carrier error.

Online Test Mode & Remote Access

303
VisiLogic Software Manual V330

You can run Online Test mode and use Remote Access session to display the networked
controller on your PC screen.

To do this, click the Online Test button on the toolbar, then click the Remote Access button.

The controller model that is shown on the display is the one selected in Hardware
Configuration.

During a Remote Access session, you can:

Use your cursor to operate the controller keypad and activate touch-screen objects
(relevant models).
Use your PC keyboard to operate the controller keypad (numeric keys, function keys
<F1> to <F8>). Note that the Vision <ESC> key is <E> on the PC keyboard, and that
<F9> is reserved for activating Online mode.
Enter Information Mode by pressing the <i> key with your cursor.

Network Operands
Each controller contains specific Network Operands. If a controller is integrated into a
network, these operands can be read by the other controllers within the network.

You can network up to up to 63 controllers via CANbus. You assign each controller a
unique Unit ID number, 1 through 63. Each controller can read information from up to 8
other controllers in the network. To enable, for example, Controller 18 to access SB 200 in
Controller 62, you define a network operand using the unique ID number 62.

Network Operands

Type Symbol Address Range


Network System Bit NSB SB200-SB215
Network Input NI I0-I15
Network System Integer NSI SI200-SI201

304
Networks

CANbus Networking
You can connect up to 63 units in a CANbus network. Each controller can read information
from up to 8 other controllers in the network. When you create a network, you assign each
controller a unique Unit ID number ranging from 1 to 63.

Each controller contains specific Network Operands. When a controller is integrated into a
network, these operands can be read by the other controllers within the network. To
enable, for example, Controller 18 to access data in Controller 36, you address Network
Operands using the unique ID number: 36.

CANbus communications flow through the CANbus port. To implement CANbus, use a
COM Port Init FB as shown below. Directions for CANbus wiring may be found in the
documentation supplied with the controller.

Check Network Status


The network status is checked via the bridge. Access Check Network Status by opening
the Connection menu, selecting Communication & OS, then clicking the network tab.

305
VisiLogic Software Manual V330

CANbus Network Problems


SI 237 CANbus Network: Failed Unit ID contains a bitmap showing the network ID number
of the unit in error. SI 236 CANbus Network Communication Error Code contains the index
of the error message.

Value Message

1 No Acknowledgement

2 CANbus OFF

4 CANbus Warning error

10 SC receiving TimeOut

Problem Possible cause R e c o m m e n d e d Ac t i o n

Failed Baud rate All controllers in the network must be set to the
communication settings same CANbus baud rate. Baud rate may be set:
By initializing a port via the COM Init FB.
Temporarily via Info mode;however, note
t h a t t h e b a u d r a t e wi l l b e r e s e t a t t h e n e xt
power-up

Termination Termination resistor settings are provided in the


resistors chapter Communications in the controller's user
guide.

CANbus power Check that the CANbus power supply is properly


supply connected, and that the voltage is in the permissible
range as described in the chapter Communications in
the controller's user guide.

Incorrect ID You may not have assigned the correct unit ID


number number in your operand addresses (between 1-63).
C h e c k t h e O P L C s e t t i n g s t a b C o m m u n i c a t e wi t h
OPLC.

PC cannot Incorrect setting W h e n y o u c o m m u n i c a t e wi t h t h e c o n t r o l l e r u n i t t h a t


communicate y o u a r e u s i n g a s a b r i d g e t o t h e n e t wo r k , e i t h e r
with bridge enter the ID# of the bridge or select Direct

306
Networks

Connection in the OPLC settings tab Communicate


with OPLC.

PC cannot Communication Make sure the current RS232 parameters in your


communicate settings project are the same as the parameters that are
w i t h n e t wo r k actually in the bridge. Check these topics:Check
Network Status,Vision Communication PC Settings

Incorrect baud The bridge's RS232 port's baud rate cannot be set
rate below 9600.

RS485 Options
The information in this topic is common to all Unitronics' controllers networked via RS485.
Note that before you carry out any tasks associated with wiring, you must read and fully
understand the safety guidelines.

About RS485
RS485 is a balanced serial interface for the transmission of digital data, which enables you
to create a multi-drop network containing up to 32 devices, or nodes

RS485 gives you 2 main advantages over RS232: longer cable lengths and greater
immunity to noise. In comparison to RS232, RS485 uses lower voltage and differential
signals. RS485 uses a differential voltage loop interface (balanced differential signal);
differential data transmission reduces the effects of ground shifts and induced noise
signals, even in an electrically noisy environment. The system is based on balanced
circuits that rely on twisted-pair wires (A & B). Thus, the data conversion of logical 0 and 1
is made by converting the polarity of the two wires by reference to each other, instead of
changing polarity of a single wire by reference to the "SG" (Signal Ground).

The noise immunity results from the fact that, when electromagnetic noise is induced over
the differential signals, the same noise is induced on both signals. When the receiver
subtracts the differential signals, the result is noise compensation.

The same 2 wires are used for transmitting and receiving; therefore, within RS485
networks, only one device can transmit while all of the other devices 'listen' (receive).

Unitronics' controllers offer different options for networking via RS485, according to the
network series.

Network Topology & Wiring


The network topology is multi-drop bus. Every RS485 network includes 2 types of nodes;
node refers to every device that is physically connected to the network.

End Nodes: The devices attached at both physical ends of the network, containing a
network terminator.
In-line Node: All devices connected to the network that are not end nodes.
To enable a rapid rate of communication over relatively long distances, the wires function
as transmission lines. For this reason, the end nodes of the network must contain network
terminators for the purpose of impedance matching. The method for setting network
terminators is described individually for each device.

RS485 Network Wiring

Use shielded twisted pair (STP) cables to network devices. Recommended cables types
are:

Twinax cable, type H8106 Control cable, type due 4001 (0.5mm2 , twisted pair)
Twinax cable, type H3094 Control cable, type V45551-F21-B5 (1.5mm2 , twisted
pair)

307
VisiLogic Software Manual V330

The combined total length of all network cables cannot exceed 1219 meters, as shown
below.

RS485 wiring considerations

With the exception of the M90-19-R4, the RS485 signals are NOT isolated. If the
controller is used with a non-isolated external device, avoid potential voltage that
exceeds 10V. To avoid severely damaging the system, all non-isolated device ports
should relate to the same 0Vsignal.
Minimize the stub (drop) length leading from each device to the bus. The stub should
not exceed 5 centimeters. Ideally, the main cable must be run in and out of the
networked device as shown below. The connectors MJ10-22-CS66 (V120 and M91
series) and MJ10-22-CS65 (V2xxx series), shown below, enable this to be easily
accomplished.

Do not cross positive (A) and negative (B) signals. Positive terminals must be wired
to positive, and negative terminals to negative.
You must create network termination points by using the two end point devices
integrated into your network. The method of creating termination points varies
according to the controller series.

RS485, by controller type


RS485 is implemented differently in Unitronics' controllers, according to model type. These
options are summarized below.

Vision controllers are programmed using VisiLogic software. When Vision controllers are
networked via RS485, the COM ports must be initialized to the RS485 standard as
explained in COM Port: Init.

In addition, you must assign a unique Unit ID number to each controller, as explained in the
Help topic: Assigning a Unit ID number. Note that there is a range of ID numbers reserved
for RS485, numbers 64-127.

Vision 230/260/280
May be ordered with or without RS485 ports. A V2xx controller that is ordered containing an
RS485 port has a part number that ends in the number '1', for example: V2xx-1x-B21x1. If
your V2xxx controller does not have an RS485 port, you can order a port module, V200-19-
R4, and install it.

308
Networks

Note that the ports are not isolated. The connector type is RJ-45. RS485 termination
settings are determined via jumper.

If your V2xxx controller does not have an RS485 port, you can order a port module, V200-
19-R4, and install it. Installation instructions are provided together with the module when it
is ordered separately. The information below applies whether or not the RS485 port was
supplied with the V2xxx controller, or whether it is ordered and installed separately.

Network Termination Settings

The jumper settings shown above determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is YES, whether or not the
RS485 port was supplied already installed in the controller. If the OPLC is not a network
end device, set both jumpers to NO.

To open the controller in order to access the module and change the jumper settings, follow
the relevant instructions listed below.

1. Turn power off before opening the


controller.
2. Open the OPLC by inserting a
screwdriver into the slots located on
the sides of the controller as shown,
then carefully prying the cover off.
3. The RS485 ports location is
covered by plastic. Remove the
plastic covering by using a razor
cutter to cut through the tabs.

4. Locate the J3 connector.

309
VisiLogic Software Manual V330

5. Install the module by placing the J1


connector (female) of the module onto the
J3 connector (male) in the controller.
6. Make sure that the connection is
secure.
7. Close the controller by snapping the
plastic cover back in its place. If the module
is correctly placed, the cover will snap on
easily.

Vision 120/ M91

Vision 120 series

Offers 2 serial communication ports. Each port can be adapted to either the RS232 or RS485
standard, via jumpers located within the controller and VisiLogic software settings. Note that
the ports are not isolated. The connector type is RJ-11. RS485 termination settings are
determined via jumper.

M91 series

An M91 that contains an RS485/RS232port has a part number that includes the number '4',
for example: M91-19-4UN2.

RS485 is via an RJ-11-type serial communication port. Each port can be adapted to either
the RS232 or RS485 standard, via jumpers located within the controller. The M91 is
programmed using U90 Ladder software.
The port mode is determined by SI 64, Set COM Port Mode, as described in the U90
Ladder help topic: COM Port Mode: RS232/RS485 (M91 only).

Note that the port is not isolated. RS485 termination settings are determined via jumper.

Vision 120/ M91 RS232/RS485 COM ports

The information below applies to both Vision 120 and M91 series controllers. The
controllers in these series offer RJ-11-type serial communication ports. Each port can be
adapted to either the RS232 or RS485 standard, via jumpers located within the controller.
In the case of the Vision 120, appropriate VisiLogic program settings are also required.

RJ-11 type port

The pinout below is of the RJ-11 type port, when the port is used for RS485.

Note When a port is set to RS485, both RS232 and RS485 can be used

310
Networks

simultaneously if flow control signals DTR and DSR are not used.

The ports are not isolated. If the controller is used with a non-isolated
Note external device, avoid potential voltage that exceeds 10V.
To avoid damaging the system, all non-isolated device ports should
relate to the same ground signal.

RS232/RS485 Jumper Settings

Use the jumper settings shown below to change the functionality of the controller's COM
port.

To open the controller and access the jumpers, refer to the instructions below.

RS485 Network Termination Settings

The jumper settings shown below determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is ON. If the OPLC is not a
network end device, set both jumpers to OFF.

Opening the Controller

Before opening the controller, touch a grounded object to


discharge any electrostatic charge.
Note Avoid touching the PCB board directly by holding the PCB board
by its connectors.

1. Turn power off before opening the controller.


2. Locate the 4 slots on the sides of the controller.
3. Using the blade of a flat-bladed screwdriver, gently
pry off the back of the controller as shown.

311
VisiLogic Software Manual V330

4. Gently remove the top PCB board:


Use one hand to hold the top-
most PCB board by its top
and bottom connectors as
shown.
With the other hand, grasp
the controller, while keeping
hold of the serial ports; this
will keep the bottom board
from being removed together
with the top board.
Steadily pull the top board
off.

5. Locate the jumpers shown in Figure 9, then change


the jumper settings as required.

6. Gently replace the PCB board as


shown. Make certain that the pins fit correctly
into their matching receptacle.
Do not force the board into
place; doing so may damage
the controller.
7. Close the controller by snapping the
plastic cover back in its place. If the card is
placed correctly, the cover will snap on easily.

M90
These controllers are programmed via U90 Ladder.

RS485 communications are enabled via an external RS232/RS485 converter, such as


Unitronics' M90-19-R4, which can be connected to the controller's RS232 port. No U90
Ladder software settings are required.

The M90-19-R4 RS485 port is isolated.

Note that since the M90-19-R4 is an external converter, it is also compatible with other
devices, such as PCs.

312
Networks

Vision / M91 RS485 Port Specifications


The specifications below apply to RS485 ports for all Vision and M91 controllers.

Input Voltage -7 to +12V differential max.

Cable type Shielded twisted pair, in compliance with EIA RS485

Cable length 1200m maximum (4000 feet)

Galvanic Isolation No

Baud rate 110 - 57600 bps

Complete specification for the M90-19-R4, which converts serial data from the RS232
standard to either RS422 or RS485, is located on the Setup CD. It is also available from
your local Unitronics distributor. This module is recommended for use with M90 controllers
and other devices.

User safety and equipment protection guidelines


This information is intended to aid trained and competent personnel in the installation of this
equipment as defined by the European directives for machinery, low voltage, and EMC.
Only a technician or engineer trained in the local and national electrical standards should
perform tasks associated with the devices electrical wiring.

Before using a Unitronics' product, it is the responsibility of the user to read and understand
this document and any accompanying documentation.

Symbols are used to highlight information relating to the users personal safety and
equipment protection throughout this document. When these symbols appear, the
associated information must be read carefully and understood fully.

Under no circumstances will Unitronics be liable or responsible for any consequential


damage that may arise as a result of installation or use of equipment, and is not
responsible for problems resulting from improper or irresponsible use of Unitronics
devices.
All examples and diagrams shown are intended to aid understanding. They do not
guarantee operation.
Unitronics accepts no responsibility for actual use of a product based on these
examples.
Only qualified service personnel should open a device or carry out repairs.
Please dispose of this product in accordance with local and national standards and
regulations.
Failure to comply with appropriate safety guidelines can result in
severe personal injury or property damage. Always exercise proper
caution when working with electrical equipment.
Check the user program before running it.
Note Do not attempt to use a device with parameters exceeding
permissible levels.
Install an external circuit breaker and take appropriate safety
measures against short-circuiting in external wiring.
To avoid damaging the system, do not connect or disconnect a

313
VisiLogic Software Manual V330

device when the power is on.


Do not touch live wires.
Double-check all the wiring before turning on the power supply.

314
Data Tables

About Data Tables


You can store data into the Data Table memory section of your controller, then access the
data in accordance with program requirements. Vision controllers can contain up to
120kbytes of Data Tables. You create tables in VisiLogic, define their structure, then
download them to the controller. Data within the tables can be copied and pasted to and
from third-party tools such as Excel.

Note Data Tables are based on bytes, not on registers.

Data tables consist of columns and rows.

Creating a Data Table


1. Open the Data Tables editor by clicking the PLC Data Tables on the toolbar, or
by selecting it from the Data Tables menu.

2. Create a table by clicking the Add Table icon, then name the table and define the
number of columns and rows.

Note The grid that appears represents only the table's column and row structure. Each
column in the table can contain up to 100 elements, such as MIs.

315
VisiLogic Software Manual V330

3. Define a table's columns by selecting the column, then clicking the Edit button , or
by right-clicking and selecting Edit from the Column menu.

Data Table Options


Menu Name Option

File Import/Export
Data Tables can be exported from an application as .upd files, then
imported into any VisiLogic program.
M e m o r y Requirements
D i s p l a y s p i e c h a r t s t h a t s h o w t h e a m o u n t o f m e m o r y t h a t wi l l b e r e q u i r e d
b y t h e d a t a t a b l e s wh e n t h e p r o j e c t i s d o w n l o a d e d .

Connection All of the Connection commands require that the PLC be connected to
the PC.
Read Structure from PLC
Imports the structure of the data tables within the PLC into the project.
V e r i f y: Tables Structure
Compares the table structure in the project to the structure of tables
within the PLC.
The commands below also require that the table structure in the PLC be
i d e n t i c a l wi t h t h e t a b l e s t r u c t u r e i n t h e c u r r e n t p r o j e c t .
R e a d Range
R e a d s t h e v a l u e s o f t h e s e l e c t e d c e l l s f r o m wi t h i n t h e P L C d a t a t a b l e
into the project.
W rite Rang e
Writes the values of the selected cells from the project data table into
the PLC.
V e r i f y Cell Value: by Range
C o m p a r e s t h e v a l u e s o f t h e c e l l s i n t h e p r o j e c t t o t h e v a l u e s wi t h i n t h e
PLC.

Table Table options have short-cut buttons on the left side of the Tables pane. Right-clicking the
pane also opens the Table menu.
Add Table
Adds a new data table.
Edit Table
Enables you to change the name of the data table and the number of
r o ws a n d c o l u m n s .
D e l e t e Table
Deletes the entire table, both values and structure.
D u p l i c a t e Table
Creates a new table, including both the values and the structure of the
table being duplicated.
S e l e c t All
Selects the entire table.

Row Edit Number of Rows


Enables you to change the name of the data table and the number of
r o ws a n d c o l u m n s .
Insert Row
Enables you to insert a row at any point in the table.
Delete Row
Enables you to delete a row from any point in the table.
Note Inserting or deleting a row changes the index number of all
s u c c e s s i v e r o ws ; i m p a c t i n g y o u r d a t a o p e r a t i o n s .

316
Data Tables

Column Set Cell Value


E n a b l e s y o u t o e n t e r v a l u e s f o r a c e l l o r r a n g e o f c e l l s wi t h i n a c o l u m n .
Insert Column
Inserts a column.
Edit Column
Enables you to name the column, set a data type for the entire column,
define the number of elements held by each cell in the column and make
other selections based on the data type that has been assigned to the
column.
Delete Column
Deletes a column.

Column Parameters
The column structure options change according to the data type selected.
Parameter Function

Description Assign a unique name.

Type A column is assigned to the data type s


Data types may be directly assigned, o

Part of Project, Protects the marked data from being m


Read-only Recommended column order

Min/ Max Enables you to set limits for the value

Format View Choose between decimal and hexadeci

Number of elements A column can contain a maximum of 10

Database-Read/Write
Read/Write functions enable you to copy a row of values from and to Data Tables. They are
located on the Data Tables menu.

Note Reading/Writing data from linked operands of different data types is not supported.

317
VisiLogic Software Manual V330

Read
A row in a Data Table is the source for the Read function. Values are read from the Data
Table into the operands that are linked to it in the Read function.

Write
Operands within the PLC memory are the source for the Read function. Values are read
from the PLC into the Data Table cells that are linked to it in the Write function.

318
Data Tables

Read/Write Direct
These operations access the values in the database without reference to table structure

Database: Read Direct

The Read Direct operation copies data from the data tables into a vector of registers within
the controller.

1. Select Direct: Read from the Data Tables menu.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operands A & B determine the data's destination --to where the data from the data
table will be copied.
Operand A: sets the register type for the target vector and the start register.
Operand B: determines the offset, in registers, from the start register.

Operands C, D, & E determine the data's source --from where in the data table the
data will be copied.
Operand C: contains the start byte of the source vector within the data table.
Operand D: determines the offset, in bytes, from the start register.
Operand E: determines the length of the source vector.

Note that the length is relative to the type of register linked to Operand A. For

319
VisiLogic Software Manual V330

example, if Operand A is linked to an MI and Operand E contains 5, 10 bytes of data


will be copied from the data table into 5 MIs, 2 bytes into each MI.
If Operand A is linked to a double register; ML or DW; and Operand E contains 2, 8
bytes of data will be copied into 2 double register.

Read Example

Below, database bytes 28, 29, 30, 31, 32, and 33 are read and written into MIs 15, 16, and
17.

Database: Write Direct

The Write operation copies data a vector of registers into the database.

1. Select Data Block Read from the Data Tables menu.

2. Place the function in the desired net.


3. Link the desired Operands and Addresses.
Operands A & B determine the data's source --from which registers the data will be
copied.
Operand A: sets the register type for the target vector and the start register.
Operand B: determines the offset, in registers, from the start register.

320
Data Tables

Operands C, D, & E determine the data's destination--to where in the database the
data will be written.
Operand C: contains the start byte of the source vector within the database.
Operand D: determines the offset, in bytes, from the start register.
Operand E: determines the length of the source vector.

Note that the length is relative to the type of register linked to Operand A. For
example, if Operand A is linked to an MI and Operand E contains 5, the data from 5
registers will be copied into 10 database bytes, 2 bytes per MI.
If Operand A is linked to a double register; ML or DW; and Operand E contains 2, the
data from 2 double registers will be copied into 8 database bytes, 4 bytes per ML or
DW.

Write Example

Below, MIs 26, 27, 28, 29 are written into database bytes 28 through 33; each register is
copied into 2 bytes within the database.

Program Recipes
A recipe is a collection of ingredients or values that are used to prepare a batch of product
or to perform a specific task.

Data Tables can be used to contain parameters for pre-programmed recipes.

For example, assume that a laundry machine performs different tasks such as 'Fill', 'Wash'
and 'Rinse'. A Data Table is created that contains 1 row for each task. Each row contains
cells; each cell holds a specific parameter required for the task assigned to that row. The
parameter values are transferred into the cells via a Write to Data Tables function. Within
the Write function, the operands containing the parameter values are linked directly to the
appropriate cells.

321
VisiLogic Software Manual V330

Data Tables: Synchronizing Data


When you download Data Tables to a controller, VisiLogic checks to see if the controller
already contains Data Tables. If the structure of the tables is not identical, VisiLogic opens
the Synchronize Data Tables box.

To synchronize data values, VisiLogic uploads the data from the PLC Data Tables into Data
Tables within the PC, and then downloads the tables and data values when download is
completed. This enables you to preserve values within the controller's Data Tables, even if
the data type in that column has been changed. For example, if a Data Table column in the
PLC that contains an integer is transferred to a long integer, the two bytes of the integer
value will be placed in the 2 least significant bytes of the long integer.

Synchronize VisiLogic automatically uploads all of the data values in the PLC Data Tables into the PC
all columns tables. Data is matched up according to column name. When download is completed, the
n e w D a t a T a b l e i s i n s t a l l e d i n t h e P L C wi t h a l l o f i t s d a t a v a l u e s i n t a c t .

Synchronize S e l e c t i n g t h i s o p t i o n o p e n s u p a wi n d o w t h a t e n a b l e s y o u t o m a n u a l l y l i n k t h e P C D a t a
selected T a b l e c o l u m n s wi t h t h o s e i n y o u r P C . T h e d a t a v a l u e s wi t h i n t h e c o l u m n s a r e t h e n
columns transferred to the new defined location.

322
Data Tables

Do not Downloads the Data Tables as structured in your project, regardless of any PLC data.
synchronize

Data Tables and Excel


Data can be imported to and exported from Excel.

Export

Type your drop-down text here.


When you click the Export to Excel icon, VisiLogic opens a Save As dialog box, enabling
you to create an Excel file to save your data. The data is copied as shown below.

323
VisiLogic Software Manual V330

Import

When you click the Import from Excel icon, VisiLogic opens an Open dialog box, enabling
you to select an Excel source file. The data is copied as shown below.

324
Data Tables

Copy & paste data

To copy/paste data to and from Data Tables and Excel.

1. Select data. You can select individual cells, rows, columns, or contiguous groups of
cells.
2. Copy the values to the Clipboard either by pressing <Ctrl>+ <C> or by clicking the
Copy button.
3. Click the cursor in the Paste location, then paste the either press <Ctrl> + <V> or
click the Paste button.
Note The selection is pasted towards the right and down. When you paste from Excel to
Data Tables, the Data Table must have enough rows and columns to contain the Paste
selection.

325
FAQs

General
What are...

Operands

Ladder elements and functions are linked to operands. Operands contain data. The Ladder
elements and functions determine the way that operand data is used in your program.
Every Operand has an Address and a Description. When you select a Ladder element and
place it in a net, the Select Operand and Address box opens, enabling you to link an
Operand type, select an address, and assign a description.
To View Operand Lists
1. Select the Operand tab at the bottom of the Output Window; the operands are
displayed.
2. Click an operand type in the left pane; a list of that operand type is displayed.
Note that you can edit values and descriptions in the Output Window.

Operand Types and Symbols

Type Symbol Quantity Value Address Range


Input I 544 Bit I0-I543
Output O 544 Bit O0-O543
Timer T 192 32-bit T0-T191
Counters (C) c 24 16-bit C0-C24
Memory Bit MB 2048 Bit MB0-MB2047
Memory Integer MI 1600 16-bit MI0-MI1599
Memory Long Int eger ML 256 32-bit ML0-ML255
Double W ord (unsigned) DW 64 32-bit D W 0 - DW 6 3
Memory Floating Point MF 24 32 MF0-MF24
Integer
Constant Value # Dynamic Dynamic
System Operands

System Operands are connected to certain functions and values in the controller's
operating system.
Type Symbol Quantity Value Address Range
System Bit SB 512 Bit SB0-SB511
System Integer SI 512 16-bit SI0-SI511
System Long Integer SL 56 32-bit SL0-SL63
System Double W ord (unsigned SDW 64 32-bit
Network Operand Types and Symbols

If a controller is networked, the following operands are accessible to other controllers:


Type Symbol Quantity Value Address Range
Network System Bit NSB 8 Bit SB200-SB207
Network Input NI 17 Bit I0-I16
Network System Integer NSI 2 16-bit SI200-SI201

System Operands (SI) (SL) (SB) (SDW)

System Operands types include: System Bits (SB), System Integers (SI), System Double
Word (SDW), and System Long (SL).

327
VisiLogic Software Manual V330

System Operands are connected to certain functions and values in the controller's
operating system. For example, specific System Integers (SI), for example, are connected
to the controller's high speed counter/shaft-encoder; specific System Bits (SB) are
connected to the controller's keypad keys.

Specific System Operands are linked to fixed parameters and are read-only by the user
program, such as
SB 2 Power-up bit.

You may write into certain data types such as SI 8 Unit ID. All SBs and SIs not listed are
reserved for use by the system.

Note System Operands have preset descriptions that describe their function. If
descriptions have been changed, or if you are opening a project that was written using a
different version of VisiLogic, you can display restore descriptions via the Project Menu
Project>System Descriptions>Restore all System Descriptions.

To display a list of System Operands with their descriptions, click on the Operand tab in the
Output Window at bottom of the screen, then select the operand type. Scroll down to view
the list.

System Bits

SB 0 Always 0
SB 1 Always 1
SB 2 P o we r - u p b i t
SB 3 1 second pulse
SB 4 Divide by zero
SB 5 Outputs short circuit
SB 6 Keyboard is active
SB 7 100 mS pulse
SB 8 Battery low
SB9 RAM failure: Bit value is not 0 or 1
SB 10 Float Error
SB 11 User Stack Overflow
SB 14 Calculate current controller temperature. Automatically reset.
SB 16 Touchscreen Active (has been touched), V280 only
SB 17 Enable/Disable Touch-screen indication (Message Board function), enables a
m e s s a g e t o b e h a n d w r i t t e n o n t h e t o u c h - s c r e e n wi t h a s t y l u s
SB 30 HMI keypad entries completed
SB 31 Refresh current LCD screen display variables
SB 32 HMI keypad entry in progress
SB 33 Display, Call Sub: Turns ON for a single scan cycle, when a Display containing
a Call Sub starts loading. Note that the positive status of SB33 is only visible
within t he specific subroutine when it runs. May be used to initialize operands
in the HMI subroutine
SB 34 D i s p l a y E xi t : T u r n s O N f o r a s i n g l e s c a n c y c l e w h e n a d i s p l a y i s e xi t e d .
SB 40 Key: # 0
SB 41 Key: # 1
SB 42 Key: # 2
SB 43 Key: # 3
SB 44 Key: # 4
SB 45 Key: # 5
SB 46 Key: # 6
SB 47 Key: # 7
SB 48 Key: # 8
SB 49 Key: # 9
SB 50 Plus/Minus
SB 51 Left Arrow
SB 52 Right Arrow

328
FAQs

SB 53 ENTER
SB 55 Up
SB 56 Down
SB 57 ESC
SB 58 F1
SB 59 F2
SB 60 F3
SB 61 F4
SB 62 F5
SB 63 F6
SB 64 F7
SB 65 F8
SB 66 F9
SB 67 F10
SB 68 F11
SB 69 F12
SB 70 F13
SB 71 F14
SB 72 F15
SB 80 Modem Initialized: COM 1
SB 81 Modem Initialization Failed: COM 1
SB 82 Modem Initialized: COM 2
SB 83 Modem Initialization Failed: COM 2
SB 84 Modem Initialized: COM 3
SB 85 Modem Initialization Failed: COM 3
SB 86 Modem Connection Stat us: COM 1
SB 87 Modem Connection Stat us: COM 2
SB 88 Modem Connection Stat us: COM 3
SB 90 I/O Expansion error \ I/O Expansion not connected. See Help Topic Detecting
short-circuited end devices
SB 120 DTR COM 1
SB 122 DTR COM 2
SB 124 DTR COM 3
SB 132 Port 1 Transmit busy
SB 133 Port 2 Transmit busy
SB 134 Port 3 Transmit busy
SB 141 Ethernet: Card Exists
SB 142 Ethernet: Card Initialized
SB 143 Ethernet: Socket 0 Initialized
SB 144 Ethernet: Socket 1 Initialized
SB 145 Ethernet: Socket 2 Initialized
SB 146 Ethernet: Socket 3 Initialized
SB 147 Ethernet: Socket 0 Connected
SB 148 Ethernet: Socket 1 Connected
SB 149 Ethernet: Socket 2 Connected
SB 150 Ethernet: Socket 3 Connected
SB 151 Ethernet: Socket 0 TimeOut
SB 152 Ethernet: Socket 1 TimeOut
SB 153 Ethernet: Socket 2 TimeOut
SB 154 Ethernet: Socket 3 TimeOut
SB 184 SMS: Transmission succeeded
SB 185 SMS: Transmission Failed
SB 200 CANbus Network operand
SB 201 CANbus Network operand
SB 202 CANbus Network operand
SB 203 CANbus Network operand
SB 204 CANbus Network operand

329
VisiLogic Software Manual V330

SB 205 CANbus Network operand


SB 206 CANbus Network operand
SB 207 CANbus Network operand
SB 208 CANbus Network operand
SB 209 CANbus Network operand
SB 210 CANbus Network operand
SB 211 CANbus Network operand
SB 212 CANbus Network operand
SB 213 CANbus Network operand
SB 214 CANbus Network operand
SB 215 CANbus Network operand
SB 236 CANbus Network communication error
SB 237 CANbus Network disable
SB 250 K e y p a d e n t r y wi t h i n l i m i t s
SB 251 K e y p a d e n t r y e xc e e d s l i m i t s
SB 500 D T W r i t e : A d d r e s s e xc e e d s D T r a n g e

System Integers

# Description Comments
SI 0 Scan Time, mSec
SI 6 Current key pressed

SI 7 LCD Contrast Control 0=Minimal Contrast, 50=Medium Cont rast, 100=Maximal


Contrast
SI 8 Unit ID (Network) The ID # 1 is assigned by default.

SI 9 LCD Backlight intensity 0 - 0ff


1 - On (low intensity) (V230 only)
2 - On (max. intensity) - Default
SI Current controller I n c l u d e s d e c i m a l p o i n t . F o r e xa m p l e , i f t h e v a l u e i s 2 4 5 ,
14 temperature the actual value is 24.5.
SI Current second According to RTC
30
SI Current time
31
SI Current date
32
SI Current year
33
SI Current day
34
COM Port
SI Modem Status: COM 1
80 Modem Error (SI 81,83,85,) Modem Status ( SI 80, 82, 84,
86,87,88)
SI Modem Error Code: COM 1
81
Value Message Value Message
SI Modem Status: COM 2
82
0 No error 0 Modem Idle
SI Modem Error Code: COM 2
83
1 TimeOut time 1 Initialization in
SI Modem Status: COM 3 e xc e e d e d : n o Progress
84 reply
SI Modem Error Code: COM 3
85 2 Reply Error 2 Initialization OK
SI Modem Connection Stat us:
86 COM 1 3 Wrong PIN 3 Initialization
SI Modem Connection Stat us: number Failed
87 COM 2

330
FAQs

SI Modem Connection Stat us:


88 COM 3 4 Registration 4 Modem
failed Connected

5 PUK number 5 Hang-up in


needed progress

10 COM Busy 6 Dial in progress

11 Reply Busy

12 Reply No Dial

GSM Cellular Modem


SI 185 GSM Signal Quality If this is less than 11, reposition the antenna.
CANbus
SI 200 CANbus Network operand
SI 201 CANbus Network operand
SI 236 CANbus Network
communication error code Value Message

1 No Acknowledgement

2 CANbus OFF

4 CANbus Warning error

10 ISC receiving TimeOut

SI 237 CANbus Network: failed unit


ID
HMI
SI 249 Last Active Keypad Entry
Variable
SI 250 Currently active keypad When either SB 250' Keypad Entry W ithin Limits' or
entry, read/write S B 2 5 1 ' K e y p a d E n t r y E xc e e d s L i m i t s ' t u r n O N , t h e
index number of the variable is stored here.
SI 251 Previous HMI Display
Number
SI 252 Current HMI Display T o s e e a l i s t o f D i s p l a y s i n a p r o j e c t t o g e t h e r wi t h t h e i r
Number Display numbers, select HMI Information from the View
menu.
SI 500 General Error
Value Message

3 7FFF or 8000 (integer


result)FFFF or
0000(unsigned integer
result)

4 +INF or -INF (float result)

5 0.0 (float result)

7 +INF or -INF or NaN (float


result)

9 NAN (float result)

10 0 (integer result)

11 Floating point stack


underflow

12 Floating point stack


overflow

331
VisiLogic Software Manual V330

SI 503 User Stack Depth

On-line Test (Remote Access) Mode

These SIs enable the controller to send SMS messages when the controller is in On-line
Test (Remote Access) mode. The SIs do not need to be used in the application because
the process is transparent to the user.

SI Description

86 Modem Connection Stat us: COM 1

87 Modem Connection Stat us: COM 2

88 Modem Connection Stat us: COM 3

System Long Integers

SL 4 Divide Remainder (signed divide function)

System Double Words

S DW 0 10mS counter
S DW 3 2.5 mS counter

S DW 4 Divide Remainder Unsigned divide function


S DW 5 Expansion module short circuit bitmap
S DW 6 Snap-in module short circuit bitmap
S DW 1 3 Phone number of last received SMS last 8 digits

Watch Folders

Watch Folders enable you to:

Arrange related groups of operands in folders.


Name the folders.
View these operands in the tabbed Output Window at the bottom of the screen.
To view a Watch folder, click the Watches tab at the bottom of the screen, then select the
desired folder. Edit the folder by right-clicking a line, then selecting the appropriate function.

332
FAQs

Adding Operands to a Watch Folder from a net

To add a single operand to a Watch folder, right-click it in the Ladder or in the


Operand Output Window.

To add all of the operands within a net to a Watch folder, right-click the right-hand rail
of the desired net..

333
VisiLogic Software Manual V330

Memory Backup

The controller's battery backs up Real Time Clock (RTC), all operand, and Data Table
values. Note that the control application is stored in non-volatile memory, and is therefore
protected.

How do I...

Opening a New Project

To open a new project:

On the Project menu , click New.


-or-
On the Standard toolbar, select New .
-or-
On the keyboard, press Ctrl + N

Opening an Existing Project

To open an existing project

On the Project menu, click Open.


-or-

On the Standard toolbar, select Open .


-or-

334
FAQs

Ctrl + O.

The Open dialog box appears. Select the file you want to open.

Saving a Project

Click Save on the standard toolbar.


-or-
Select Save from the Project menu
-or-
Press Ctrl + S on your computer keyboard.
To save your project under another name, select Save As from the Project menu.

Saving a Project

Click Save on the standard toolbar.


-or-
Select Save from the Project menu
-or-
Press Ctrl + S on your computer keyboard.
To save your project under another name, select Save As from the Project menu.

Downloading/Uploading a Project

The Download process transfers your project from the PC to the controller.

To download a project to a controller:

1. Connect the controller to the PC with the programming cable.

2. Click the Download icon on the Standard toolbar.


3. The downloading process begins.

To upload a project from a controller:

1. Connect the controller to the PC with the programming cable.


2. Click the Upload icon on the Standard toolbar.
3. The uploading process begins.

335
VisiLogic Software Manual V330

Upload copies the complete project from the controller into the PC.

Via Project Properties, you can apply upload and download options:

Assign a project password. Password protection requires users to enter a password


before uploading a project to a PC.
Prevent project upload.

Output Window, Operand View

Watch Folders

Watch Folders enable you to:

Arrange related groups of operands in folders.


Name the folders.
View these operands in the tabbed Output Window at the bottom of the screen.
To view a Watch folder, click the Watches tab at the bottom of the screen, then select the
desired folder. Edit the folder by right-clicking a line, then selecting the appropriate function.

Adding Operands to a Watch Folder from a net

336
FAQs

To add a single operand to a Watch folder, right-click it in the Ladder or in the


Operand Output Window.

To add all of the operands within a net to a Watch folder, right-click the right-hand rail
of the desired net..

337
VisiLogic Software Manual V330

Watch Folders

Watch Folders enable you to:

Arrange related groups of operands in folders.


Name the folders.
View these operands in the tabbed Output Window at the bottom of the screen.
To view a Watch folder, click the Watches tab at the bottom of the screen, then select the
desired folder. Edit the folder by right-clicking a line, then selecting the appropriate function.

Adding Operands to a Watch Folder from a net

To add a single operand to a Watch folder, right-click it in the Ladder or in the


Operand Output Window.

338
FAQs

To add all of the operands within a net to a Watch folder, right-click the right-hand rail
of the desired net..

Find

Highlight an operand or Ladder Element and press <Ctrl> + <F>; the results will be
displayed in the Output window at the bottom of the screen. Highlighting a function and
pressing <Ctrl> + <F> will open a dialog box, enabling you to select the desired
operand.

In addition, VisiLogic offers the following Find functions:

Find
Use Find to locate operands, labels, subroutines and Displays.

339
VisiLogic Software Manual V330

Note Labels: Clicking on a found 'Label' will list the Jump to Label linked to that
label in the Output Window.

Find & Replace Operand


The Find & Replace Operand utility enables you quickly replace any operand that is
used in a project.

Find FB
Find FB enables you to locate the FBs in your project.

340
FAQs

Find Font
This enables you to find fonts used in HMI Displays.

Finding a Load Display Target

341
VisiLogic Software Manual V330

Finding a Call Subroutine Target

Go To Label
To find Labels, use Go To Label<Alt> + <Right/Left arrow> and List of
Labels <Ctrl> + <L> utility.

342
FAQs

Find Constant Value


To find Constant values, either:

Click on the Constant, then press <Ctrl> + <F>; the results


appear in the Output window.

Start Find, select the Constant tab and enter the value, then press
OK ; the results appear in the Output window.

Power-up Values

Power-up values can be assigned to most operands. These values are written into the
operands when the controller is turned on.

Bit operands can be SET or RESET. Integers, Long Integers, and Double Words can be
assigned values that are written into the operand at power-up.

You can assign Power-up Values in the:

Select Operand and Address Dialog Box


Check the box next to the plug-shaped icon. This enables you to enter a value in
the Power-up value fill-in field.

343
VisiLogic Software Manual V330

Operand View Window


1. Select the Operand tab at the bottom of the screen.
2. Click on the Operand type to display the list of operands.
3. Enter Power-up values in the column headed by the Power-up icon.

Assign a Description to Multiple Operands

To assign a Description to multiple operands, select a range of operands by dragging your


cursor across them, then type a description and click OK.

You can also copy and paste text to and from other Windows applications.

On-Line Test Mode (Debug)

To test a project, first connect the controller to your PC using the program download cable
provided with the software package, then download the project and click the On-Line Test
button.

Note The controller can send and receive SMS messages when the controller is in Test
mode.

344
FAQs

Show STL

You can view STL code for a particular Subroutine, whether off-line or in Online Test mode.

To view STL online test values after downloading a project to a controller, open STL View,
then press F9 to enter online test mode.

345
VisiLogic Software Manual V330

Verify Project

The Verify utility shows the differences between the project open in your PC and the
program currently installed in the controller.

To use Verify:

1. Connect your PC it to the controller using a program download cable


2. Select Verify from the Connection menu.

Verify marks different sections with an , as shown below.

346
FAQs

Information Mode

Information Mode is a utility that is embedded in the operating system of the controller. Via
Information Mode, you can view data on the LCD screen, use the controllers keyboard to
directly edit data, and perform certain actions such as resetting the controller. You can
enter Information Mode at any time without regard to what is currently displayed on the
LCD screen.

Enter Information Mode by pressing the <i> key for a few seconds. The default password is
1111.

Viewing data does not


affect the controllers
program. Performing
actions, such as
initializing the
controller, can
influence the program.

Note When you


use Information Mode,
the keyboard is
dedicated to that
purpose. The keys
return to normal
application functions
when you exit
Information Mode.
Using Information Mode

1. To enter Information mode, press the <i>button on the Visions keyboard.


2. Enter your password. The default password is 1111. This password remains in
effect until you change it via the Information Mode screen described in the table
below.
3. The controller enters Information Mode, showing the first category, Data Types.

The controller will block


entry into Information
mode until the correct
password has been
entered. This is why you
must record any password
you set for your controller.

The data in Information


Mode is arranged in
Categories. Each
Category contains several
Subjects. You navigate
Information Mode by using
the keyboard buttons.

To exit Information mode,


press the <ESC>button on
the Visions keyboard.
Each press returns one
level up. Press the

347
VisiLogic Software Manual V330

number of times
necessary to exit.

Note When you reenter Information Mode, the controller will return to the last Category
viewed.

The table below shows the categories of information that can be accessed in this mode.

Category Subject Possible Actions

Data Types Memory Bits View bit status

System Bits Change bit status (Set/Reset)

Memory Integers View integer/long integer/double word value.


System Integers
Change values
Memory Longs
Toggle Base: view the value in decimal or
System Longs hexadecimal form.

Memory Double
Words

System Double
Words

Inputs View input status.


Force input status to 1 (FR1) or 0 (FR0).
Forced values stay in effect until Normal mode
(NRM) is selected, or until the controller is
initialized or reset.
Note Forced values do influence your
program. This can be useful in testing the
effect of an input condition on an output
status.

Outputs View output status.


Force output status to 1 (FR1) or 0 (FR0).
Note that forced output values do not affect
your program.
Set/Reset output status.

Timers Enter a Preset Timer value.


View the current timer value and status by
selecting the R.T. option.

System Model & O/S Ver Check the controllers model number and
operating system version.
C h e c k wh e t h e r t h e c o n t r o l l e r i s i n R u n o r S t o p
mode.

W orking Mode C h e c k wh e t h e r t h e c o n t r o l l e r i s i n R u n o r S t o p
mode.
Reset the controller. This restarts your
program; restoring power-up values to all data
types except for those protected by the battery
backup. The battery protects Real Time Clock
(RTC), all operand, and Data Table values.
Initialize the controller. This restarts your
program and initializes all values, restoring 0
values to all data types.

Time & Date View the Real Time Clock (RTC) settings.
Note that the RTC settings control all time-
based functions.
Change the RTC settings via the controllers

348
FAQs

keyboard.

Unit ID The Unit ID number identifies a networked controller.


You can:
Change the ID number. The new ID number
will remain in effect until the controller is
reset.
Burn the ID number into the controllers FLASH
m em ory. This is a perm anent change.

Serial Port 1 View and edit communication settings.


Serial Port 2
Select to Change or Burn the new settings.

CANbus Baud Rate Change the CANbus baud rate.

Function Reserved for


Block future use

P a s s wo r d New Set a New Password

Hardware C h e c k i f I / O E xp a n s i o n M o d u l e s a r e i n s t a l l e d .
Configuration N o t e t h a t I / O E xp a n s i o n M o d u l e s a r e
represented by letters. Identical module types
are represented by identical letters as shown
below.
S h o ws i f a n I / O m o d u l e i s s h o r t - c i r c u i t e d .

PLC Programming via Modem: Remote Access

Use a PC linked to GSM or landline modem to access a remote controller and:

Download and upload applications.


Test and troubleshoot problems in remote controllers and applications.
To remotely access a controller:

349
VisiLogic Software Manual V330

Note The PC-modem cable is not the same type of cable used to connect between
the controller and the modem. Ensure that the cable used to connect the PC
to the modem provides connection points for all of the modem's pins.
Note If calls are routed via a switchboard, note that the switchboard settings may
interfere with communications. Consult with your switchboard provider
Note If, within the modem initialization strings, the parameter S7 TimeOut, is to
short to permit the PLC's modem to answer, an error will result.
For example, if this parameter is set as S7=30, the PC modem will wait for 3
seconds to receive an answer from the PLC's modem. If, however, the PLC
program's COM Init FB Answer Settings are set to 'Answer after 6 rings,' the
PLC modem will not be able to answer before the 3 seconds have elapsed. In
this case, the TimeOut parameter is exceeded, and the PC modem will return
the No Carrier error.
Note PC/PLC modem communications: Both PC and controller must use the same
type of modem: either landline or GSM. Internal PC modems must be used in
conjunction with the driver provided by the modem's manufacturer.

Controller Setup

1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally a power-up task, however a one-shot transitional
contact may also be used.

2. Place conditions and elements in your Ladder program.

350
FAQs

3. Connect the modem.

351
VisiLogic Software Manual V330

PC Modem Setup

Open PC Modem Configuration from the Connection menu.

Note If, within the modem initialization strings, the parameter S7 TimeOut, is to short to
permit the PLC's modem to answer, an error will result.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to
receive an answer from the PLC's modem. If, however, the PLC program's COM Init FB
Answer Settings are set to 'Answer after 6 rings,' the PLC modem will not be able to answer
before the 3 seconds have elapsed. In this case, the TimeOut parameter is exceeded, and
the PC modem will return the No Carrier error.

Ladder

352
FAQs

What are....?

Timers (T)

To use a timer in your program, place an element in a net, select T, then define the timer's
attributes as shown below.'

There are 3 types of timers. Each timer type has 3 variables:

Timer Bit Value: A timer is scanned as a bit data type (scan for OFF, scan for ON).
The result of the scan is dependent on the timer type.
Timer Preset Value. A running timer always decrements (counts down) from the
Preset Value. The Preset Values are loaded for all timers at power up. The Preset
Value is also loaded into the Current Value when the timer is reset.
Timer Current Value. The current value of the timer is dependent on the timer type.
All timer types are activated by a rising transition edge, OFF to ON. The condition you use
to activate the timer should be scanned only once per PLC program scan

TD- Timer: On Delay

When the timer's Start & Run Condition is OFF, the timer's Bit Value is also OFF.

When the timer's Start & Run Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF.

If the timer's Start & Run Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Start & Run Condition falls while the timer is decrementing, the timer stops
running. The current value of the timer remains.

Timer Reset takes precedence over the timer's Start & Run Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Start & Run Condition cannot activate the timer as
long as Reset is ON..

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Start & Run Condition rises.

353
VisiLogic Software Manual V330

Below, pressing Key #1 on the Vision keypad activates TD1, which is preset to 5 seconds.
If Key #1 is held down for 5 seconds, TD1 decrements to zero. O1 switches on.

If, however, Key #1 is released before TD1 has finished, the timer stops. When Key #1 is
pressed again, TD1 again begins to decrement from 5 seconds.

TA Timer: Accumulated

When the timer's Run Enable Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF. When
the timer's Run Enable Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Run Enable Condition falls while the timer is running, the timer stops running,
but the current value of the timer is retained. When the timer is reactivated, it begins
decrementing from the retained value.

Timer Reset takes precedence over the timer's Run Enable Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Run Enable Condition cannot activate the timer as
long as Reset is ON.

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Run Enable Condition rises.

Note Once a TA Timer has reached its preset value, its Bit Value remains ON until the
timer is reset in the program. The timer cannot be activated by Run Enable until it has
been reset.

In the net below, pressing Key #2 on the Vision keypad activates TA2, which is preset to 5
seconds. If Key #2 is held down for 5 seconds, TA2 decrements to zero. O2 switches on.

If, however, Key #2 is released after 2.53 seconds--before TA2 has reached the preset
value--the timer stops and its current value is retained . When Key #2 is pressed again,
TA2 begins to decrement from 2.53 seconds. When TA2 decrements to 0, O2 turns ON.

354
FAQs

TE Timer: Extended Pulse

When the timer's Start Condition rises, and the Bit Value is OFF, the timer's Preset Value is
loaded into the timer's Current Value. The timer begins to run and the Bit Value turns ON.
If the timer's Start Condition remains ON during subsequent PLC cycles, the Current Value
of the timer continues to decrement. However, if the timer's Start Condition rises before the
timer has decremented to its Preset Value, the timer reloads the Preset Value into the
Current Value, and again begins to decrement. Note that a falling Start condition does not
affect the timer.
When the timer has decremented to 0 the timer's Bit Value turns OFF. Note that when the
timer has finished running, its Current Value is 0.
Timer Reset takes precedence over the timer's Start Condition. When the timer' Reset
Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded into the
Current Value, and the timer's Start Condition cannot activate the timer as long as Reset is
ON..
When the timer's Reset Condition falls while the timer's Start Condition is ON, the timer
begins to run, exactly the same as when the timer's Start Condition rises.
Note Once a TE Timer has reached its preset value, its Bit Value remains OFF until the
timer is reset in the program.
In the nets below, pressing Key #3 on the Vision keypad activates TE3, which is preset to 5
seconds. Once Key #3 is pressed, TE3 decrements to zero. O3 switches on.

Note A Timer value can be displayed in a Display as either a current or elapsed value.

Viewing and Setting Timers

To display a list of Timers, click on the Operand tab in the Output Window at bottom of the
screen, then select Timers. Scroll down to view the list.

355
VisiLogic Software Manual V330

Timers can also be preset and edited in the Select Operand and Address dialog box when
you insert a timer into your program.

You can also use Information Mode to edit or enter a timer value via the controller keyboard
while the controller is running its control program.

Counters (C)

VisiLogic offers 24 built-in counters, represented by the symbol C. To use an Up Counter


in your program, place an Increment function in a net and select C. To use a Down Counter
in your program, use a Decrement function.

A counter counts rising-edge pulses.

When the accumulated number of pulses equals the counter's preset value, power flows
through the function and the counter bit turns ON. Once the preset value is reached, the
counter bit stays ON until it is reset via a Reset Coil. This also initializes the counter value.

Note Counter values can by displayed on the controller screen via a Counter Variable in
the HMI editor. Either the current or the elapsed counter value can be shown in a Display.

Viewing and Setting Counters

A counter's Preset Value can be assigned either in the Select Operand box or in the Output
Window. To display a list of Counters, click on the Operand tab in the Output Window at
bottom of the screen, then select Counters. Scroll down to view the list.

356
FAQs

Network Operands

Each controller contains specific Network Operands. If a controller is integrated into a


network, these operands can be read by the other controllers within the network.

You can network up to up to 63 controllers via CANbus. You assign each controller a
unique Unit ID number, 1 through 63. Each controller can read information from up to 8
other controllers in the network. To enable, for example, Controller 18 to access SB 200 in
Controller 62, you define a network operand using the unique ID number 62.

Network Operands
Type Symbol Address Range
Network System Bit NSB SB200-SB215
Network Input NI I0-I15
Network System Integer NSI SI200-SI201

PID Function

The PID function uses system feedback to continuously control a dynamic process. The
purpose of PID control is to keep a process running as close as possible to a desired Set
Point.

About PID and Process Control

A common type of control is On-Off control. Many heating systems work on this principle.
The heater is off when the temperature is above the Set Point, and turns on when the
temperature is below the Set Point. The lag in the system response time causes the
temperature to overshoot and oscillate around the Set Point.

357
VisiLogic Software Manual V330

PID control enables you to minimize overshoot and damp the resulting

oscillations.
PID enables your controller to automatically regulate your process by:

1. Taking the output signal from the process, called the Process Variable (PV),
2. Comparing this output value with the process Set Point. The difference between the
output Process Variable and the Set Point is called the Error signal.
3. Using the Error signal to regulate the controller output signal, called the Control
Variable (CV), to keep the process running at the Set Point. Note that this output
signal may be an analog or time-proportional variable value.
In the figure below, a system is regulated according to temperature.

Inside the PID Function

The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID
output is the combined output of all 3 actions.

All of the PID functions are activated by changes in the process Error, the difference
between the Process Value and the process Set Point value (E = SP PV).
Proportional Band

The proportional band is a range defined around the Set Point. It is expressed as a
percentage of the total Process Value (PV). When the PV is within this range, the PID
function is active.

358
FAQs

Note The proportional band may exceed 100%. In this case, PID control is applied over
the entire system range.

Proportional Action

Proportional action begins after the PV enters the proportional band; at this point, the Error
is 100%. The action outputs a value that is in direct linear proportion to the size of the
Error value.

A broad proportional band causes a more gradual initial response from the controller.
Typically, Set Point overshoot is low; but when the system stabilizes, oscillations around
the Set Point tend to be greater.

A narrow band causes a rapid response that typically overshoots the Set Point by a greater
margin. However, the system does tend to stabilize closer to the set point. Note that a
proportional band set at 0.0% actually forces the controller into On-Off mode.

The drawback of proportional control is that it can cause the system to stabilize below set
point. This occurs because when the system is at set point, Error is zero and the control
value output is therefore pegged at zero as well. The majority of systems require
continuous power to run at set point. This is achieved by integrating integral and derivative
control into the system.

Direct and Reverse Action

Direct action causes the output to change in the same direction as the change in Error,
meaning that a positive change in Error causes a positive change in the proportional bands
output. Reverse action creates an inverse change in the output, meaning that a positive
change in Error causes a negative change in output.

359
VisiLogic Software Manual V330

Integral Action

Integral action responds to the rate of change in the controllers CV output relative to the
change in Error. The integral time you set is the amount of time, as calculated by the
controller, required to bring the process to Set Point. Note that if you set a short integral
time, the function will respond very quickly and may overshoot the Set Point. Setting a
larger integral time value will cause a slower response. Integral time is sometimes called
Reset.

The controllers CV output may reach and remain at 100%, a condition called saturation.
This may occur, for example, if the process is unable to reach Set Point. This causes the
Error signal to remain stuck in either the positive or negative range. In this situation, the
integral action will grow larger and larger as the Error accumulates over time. This is called
integral "wind up", which can cause the controller to overshoot the set point by a wide
margin.

This situation can be prevented by setting an MB to clear the accumulated Integral error
when saturation is occurs.

Derivative Action

Derivative action responds to the rate and direction of change in the Error. This means that
a fast change in error causes a strong response from the controller.

The derivative action anticipates the PVs value in relation to the Set Point and adjusts the
controllers CV output accordingly, thus shortening the PID functions response time.

AutoTune---Note: This feature is not included in the current product release.

Note: AutoTune is not included in the current product release.

AutoTune enables the controller to automatically optimize PID settings in accordance with
the code you select. The code determines the speed of the controllers response.

The figure below shows how the code affects the controllers response. A setting of zero
enables a fast (under-damped) response, causing the controller to overshoot the Set Point
and oscillate. A setting of 10 causes a slow (over-damped) response. Although this avoids
Set Point overshoot for a more stable response, note that the system will take longer to
achieve set point.

In either case, AutoTune causes the system to stabilize at the Set Point.

360
FAQs

Placing a PID function

1. Select PID Scan from the FBs menu, then place the function in the net.

The PID parameter box opens as shown below.

2. The Select Operand and Address box opens; link operands to the PID parameters.

PID Function Parameters

361
VisiLogic Software Manual V330

Parameters: Type Function


Inputs

PV: MI PV is the feedback from the process. PV is output from the process
Process and input to the PID function. In a heating system, the temperature
Value measured by a temperature sensor provides the PV.

SP: MI SP is the target value for the process. In a heating system, this is
Set Point the temperature value set for the system. Note that the Set Point
and Process value must be given in the same type of units (degrees
Celsius, bars, meters per second, etc.)

ST: MI Use this parameter to define the intervals between PID function
Sample or # updates, in units of 10mSecs.
Time

Xp: MI Use this parameter to define the proportional band, in units of 0.1%.
Proportional or # The proportional band is a percentage of the total Process Value
Band (PV). It is a range defined around t he Set Poi nt. W hen the PV is
within this range, the PID function is active.

Intgl. Time: MI Use this parameter to define the integral time, in units of 1 second.
Integral or # Integral action responds to the rate of change in the controllers CV
Time output relative to the change in Error. The integral time you set is
the amount of time, as calculated by the controller, required to bring
the process to Set Point.

Deriv. Time: MI Use this parameter to define the derivative time, in units of 1
Derivative or # second. Derivative action responds to the rate and direction of
Time change in the Error. This means that a fast change in error causes
a strong response from the controller. The derivative action
anticipates the PVs value in relation to the Set Point and adjusts
the CV accordingly, thus shortening the PID functions response
time.

DB: MI Use this parameter to define the dead band, in units of 0.1%. Note
Dead Band or # that the dead band is a percentage of the proportional band. W hen
v a l u e s a r e wi t h i n t h e d e a d b a n d r a n g e , t h e P I D f u n c t i o n s u s p e n d s
action; the controllers CV output is not changed.

SPPV-High: MI Use this parameter to define the upper limit for the Process Value.
Set Point for or #
Process
Value

S P P V - L o w: MI Use this parameter to define the lower limit for the Process Value.
Set Point for or #
Process
Value

CV-High: MI Use this parameter to define the upper limit for the Control Value.
Set Point for or #
Control
Value

C V - L o w: MI Use this parameter to define the lower limit for the Control Value.
Set Point for or #
Control
Value

Reserved 1 This parameter is reserved for a feature that will be added in the
future.

Reverse: MB Select ON to activate Reverse Action, Off to activate Direct Action.


Reverse Direct action causes the output to change in the same direction as
Action the change in Error; a positive Error deviation causes a positive
change in the proportional bands output. Reverse action creates an
inverse change in the output; a positive Error deviation causes a
negative change in output.

RST INTGL: MB Use this parameter to clear integral error.


Reset If the system does not reach setpoint within the time defined in the
Integral parameter Intgl. Time, Int egral error occurs and may increas e. Use
Error this parameter to prevent the error from growing large enough to
interfere with the Integral operation.

362
FAQs

Reserved 2 This parameter is reserved for a feature that will be added in the
future.

Parameters: Type Function


Outputs

CV: MI CV is the output from the PID function. CV is output from the PID
Control function and input to the process. Note that this output signal may
Value be an analog or time-proportional variable value.

CV(P): MI This is the Proportional component of the PID function, calculated


Proportional by the controller.
Value

CV(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value

CV(P): MI This is the Derivative component of the PID function, calculated by


Derivative the controller.
Value
Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

363
VisiLogic Software Manual V330

How do I....

Adding and Inserting Nets

To add a net to the bottom of your Ladder:

Click the Append Ladder icon .


To insert a Ladder net:

1. Click on the Insert Net icon ; your cursor changes into a cross-hairs.
2. Click on a net; the new net is inserted above the net you clicked on.

Adding and Inserting Nets

To add a net to the bottom of your Ladder:

Click the Append Ladder icon .


To insert a Ladder net:

1. Click on the Insert Net icon ; your cursor changes into a cross-hairs.
2. Click on a net; the new net is inserted above the net you clicked on.

Deleting Nets

First, select the desired nets.

364
FAQs

To select one net


Click on the left rail of a net to select it; the rail in that net turns grey.

To select more than one net:


1. Select the first net by clicking on the left net bar.

2. Hold the Shift button and click on the last net in the range that you want to
copy.

365
VisiLogic Software Manual V330

To move the selected nets,

Press the Delete button on your computer keyboard; the net is deleted and all of the
nets in your project move up.

Nets: Sizing and Resizing

To shrink a net to its minimum height, double-click the net's left-hand rail.

Nets can be also manually resized.

366
FAQs

The Ladder menu contains two options that enable you to resize nets throughout a project.

Move, Copy, & Paste Nets

1. Select the desired net(s).

367
VisiLogic Software Manual V330

2. Select the desired operation.

-or-
Select Cut or Copy from the Edit menu.

3. Place the elements in the net.

368
FAQs

-or-
Select Paste from the Edit menu.

You can also cut, copy and paste nets between projects, subject to the information listed
below:

Once you have cut or copied your selection from the source project, open a target
project without closing VisiLogic, either by using the New Project or Open project
buttons or via these options on the Project menu. If you close VisiLogic, the selection
will be lost.

If the source project contains Call Subroutine or Load HMI operations, note that the
referenced elements will be marked as missing, even if the target project contains
elements of the same name. Note that you can reassign the references.

If the selection contains FBs, and no FBs of that type currently exist in the target
project, the pasted FBs will be the version currently in VisiLogic FB library--in other
words, if the source selection contains older FB versions, they are automatically
updated during the Paste operation.
If the selection contains FBs, and FBs of that type currently exist in the target project
in a different version, Paste cannot be completed.
If your selection contains only Labels, without the attendant Jump to Label, they will
be marked as missing, even if the target project contains Jumps of the same name.
Note that you can reassign the references.

369
VisiLogic Software Manual V330

If the selection contains Labels or Jumps with the same name as those in the target
project, these will be automatically renamed by the program when they are pasted.

If you copy both Labels and Jump to Label, the Jumps will be marked as missing.
Note that you can reassign the references.

Move, Copy, & Paste Nets

1. Select the desired net(s).

370
FAQs

2. Select the desired operation.

-or-
Select Cut or Copy from the Edit menu.

3. Place the elements in the net.

371
VisiLogic Software Manual V330

-or-
Select Paste from the Edit menu.

You can also cut, copy and paste nets between projects, subject to the information listed
below:

Once you have cut or copied your selection from the source project, open a target
project without closing VisiLogic, either by using the New Project or Open project
buttons or via these options on the Project menu. If you close VisiLogic, the selection
will be lost.

If the source project contains Call Subroutine or Load HMI operations, note that the
referenced elements will be marked as missing, even if the target project contains
elements of the same name. Note that you can reassign the references.

If the selection contains FBs, and no FBs of that type currently exist in the target
project, the pasted FBs will be the version currently in VisiLogic FB library--in other
words, if the source selection contains older FB versions, they are automatically
updated during the Paste operation.
If the selection contains FBs, and FBs of that type currently exist in the target project
in a different version, Paste cannot be completed.
If your selection contains only Labels, without the attendant Jump to Label, they will
be marked as missing, even if the target project contains Jumps of the same name.
Note that you can reassign the references.

372
FAQs

If the selection contains Labels or Jumps with the same name as those in the target
project, these will be automatically renamed by the program when they are pasted.

If you copy both Labels and Jump to Label, the Jumps will be marked as missing.
Note that you can reassign the references.

Comments Tool

Ladder Editor Comments enable you to place remarks program nets. Comments can be
written directly into the Comment pane, or written in Notepad and pasted.

Comments are not downloaded to the controller. To toggle Comments in and out of view,
press <Alt> + <C>, or select the option from the View menu.

Insert a comment:

1. Click on the Comment icon ; your cursor changes into a cross-hairs .


-or-
Select Insert Comment from either the Insert or Ladder menu.

373
VisiLogic Software Manual V330

-or-
Right-click on the Ladder, and then select Insert Comment.
2. Click on a net; a Comment field opens in the net you clicked.
3. Type text in the field.

Move, Copy, and Paste Comments:

1. Select the Comment.

2. Place the Comment in the net.

-or-
Select Paste from the Edit menu.

Delete a Comment

1. Select the Comment.

374
FAQs

2. Select Delete.
-or-
Press the Delete button on your PC's keyboard.

Connecting Ladder Elements and Functions

Use the Connect Elements tool to connect two or more elements or functions in a net. All
net elements must be connected in order to allow power to flow through the net. If they are
not connected you will not be able to compile your application.

Connecting Elements

Placing a Ladder Element in a Net

1. Select any type of Ladder element by:


Clicking its icon on the Ladder toolbar, -or-

375
VisiLogic Software Manual V330

Selecting it from the Ladder menu, -or-


Right-clicking on the Ladder to display the Ladder menu and then selecting the
element.

2. Move the element to the desired net location, then click.

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

Timers (T)

To use a timer in your program, place an element in a net, select T, then define the timer's
attributes as shown below.'

There are 3 types of timers. Each timer type has 3 variables:

Timer Bit Value: A timer is scanned as a bit data type (scan for OFF, scan for ON).
The result of the scan is dependent on the timer type.
Timer Preset Value. A running timer always decrements (counts down) from the
Preset Value. The Preset Values are loaded for all timers at power up. The Preset
Value is also loaded into the Current Value when the timer is reset.
Timer Current Value. The current value of the timer is dependent on the timer type.
All timer types are activated by a rising transition edge, OFF to ON. The condition you use
to activate the timer should be scanned only once per PLC program scan

376
FAQs

TD- Timer: On Delay

When the timer's Start & Run Condition is OFF, the timer's Bit Value is also OFF.

When the timer's Start & Run Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF.

If the timer's Start & Run Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Start & Run Condition falls while the timer is decrementing, the timer stops
running. The current value of the timer remains.

Timer Reset takes precedence over the timer's Start & Run Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Start & Run Condition cannot activate the timer as
long as Reset is ON..

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Start & Run Condition rises.

Below, pressing Key #1 on the Vision keypad activates TD1, which is preset to 5 seconds.
If Key #1 is held down for 5 seconds, TD1 decrements to zero. O1 switches on.

If, however, Key #1 is released before TD1 has finished, the timer stops. When Key #1 is
pressed again, TD1 again begins to decrement from 5 seconds.

TA Timer: Accumulated

377
VisiLogic Software Manual V330

When the timer's Run Enable Condition rises, the timer's Preset Value is loaded into the
timer's Current Value. The timer begins to run. Note that the timer's Bit Value is OFF. When
the timer's Run Enable Condition remains ON during subsequent PLC cycles, the Current
Value of the timer continues to decrement.

When the timer has decremented to 0, and the timer's Start & Run Condition is still ON, the
timer's Bit Value turns ON. Note that when the timer has finished running, its Current Value
is 0.

If the timer's Run Enable Condition falls while the timer is running, the timer stops running,
but the current value of the timer is retained. When the timer is reactivated, it begins
decrementing from the retained value.

Timer Reset takes precedence over the timer's Run Enable Condition. When the timer'
Reset Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded
into the Current Value, and the timer's Run Enable Condition cannot activate the timer as
long as Reset is ON.

When the timer's Reset Condition falls while the timer's Start & Run Condition is ON, the
timer begins to run, exactly the same as when the timer's Run Enable Condition rises.

Note Once a TA Timer has reached its preset value, its Bit Value remains ON until the
timer is reset in the program. The timer cannot be activated by Run Enable until it has
been reset.

In the net below, pressing Key #2 on the Vision keypad activates TA2, which is preset to 5
seconds. If Key #2 is held down for 5 seconds, TA2 decrements to zero. O2 switches on.

If, however, Key #2 is released after 2.53 seconds--before TA2 has reached the preset
value--the timer stops and its current value is retained . When Key #2 is pressed again,
TA2 begins to decrement from 2.53 seconds. When TA2 decrements to 0, O2 turns ON.

TE Timer: Extended Pulse

When the timer's Start Condition rises, and the Bit Value is OFF, the timer's Preset Value is
loaded into the timer's Current Value. The timer begins to run and the Bit Value turns ON.
If the timer's Start Condition remains ON during subsequent PLC cycles, the Current Value
of the timer continues to decrement. However, if the timer's Start Condition rises before the
timer has decremented to its Preset Value, the timer reloads the Preset Value into the
Current Value, and again begins to decrement. Note that a falling Start condition does not
affect the timer.
When the timer has decremented to 0 the timer's Bit Value turns OFF. Note that when the
timer has finished running, its Current Value is 0.

378
FAQs

Timer Reset takes precedence over the timer's Start Condition. When the timer' Reset
Condition rises, the timer's Bit Value turns OFF. The timer's Preset Value is loaded into the
Current Value, and the timer's Start Condition cannot activate the timer as long as Reset is
ON..
When the timer's Reset Condition falls while the timer's Start Condition is ON, the timer
begins to run, exactly the same as when the timer's Start Condition rises.
Note Once a TE Timer has reached its preset value, its Bit Value remains OFF until the
timer is reset in the program.
In the nets below, pressing Key #3 on the Vision keypad activates TE3, which is preset to 5
seconds. Once Key #3 is pressed, TE3 decrements to zero. O3 switches on.

Note A Timer value can be displayed in a Display as either a current or elapsed value.

Viewing and Setting Timers

To display a list of Timers, click on the Operand tab in the Output Window at bottom of the
screen, then select Timers. Scroll down to view the list.

Timers can also be preset and edited in the Select Operand and Address dialog box when
you insert a timer into your program.

You can also use Information Mode to edit or enter a timer value via the controller keyboard
while the controller is running its control program.

Counters (C)

VisiLogic offers 24 built-in counters, represented by the symbol C. To use an Up Counter


in your program, place an Increment function in a net and select C. To use a Down Counter
in your program, use a Decrement function.

A counter counts rising-edge pulses.

When the accumulated number of pulses equals the counter's preset value, power flows
through the function and the counter bit turns ON. Once the preset value is reached, the
counter bit stays ON until it is reset via a Reset Coil. This also initializes the counter value.

379
VisiLogic Software Manual V330

Note Counter values can by displayed on the controller screen via a Counter Variable in
the HMI editor. Either the current or the elapsed counter value can be shown in a Display.

Viewing and Setting Counters

A counter's Preset Value can be assigned either in the Select Operand box or in the Output
Window. To display a list of Counters, click on the Operand tab in the Output Window at
bottom of the screen, then select Counters. Scroll down to view the list.

Oscillating pulse

SB 3 is a built-in 1 second pulse oscillator that generates a 1 Hz pulse. SB 7 generates a 1


Hz pulse every 100mSec.

You can link these SBs to a:

Direct Contact
Inverted Contact
Positive Transition Contact
Negative Transition Contact.

The following example shows a counter that increments by one at each one second pulse.

380
FAQs

Change Element Type

To change an element type after it is placed in a net and linked to an operand:

Right-click the element, select Replace Ladder Element, then select the appropriate
element type.

After the element has been changed, it remains linked to the same operand.

You can use this method to change contact or coil types, to switch math and other function
types while retaining the same input and output operands.

Delete Elements

Select the desired element(s), then

Select Cut. -or-

381
VisiLogic Software Manual V330

-or-
Select Cut or Copy from the Edit menu.

Click the Delete button on the toolbar. -or


Right-click the Element, then select Delete from the menu.

Change Element Type

To change an element type after it is placed in a net and linked to an operand:

Right-click the element, select Replace Ladder Element, then select the appropriate
element type.

After the element has been changed, it remains linked to the same operand.

You can use this method to change contact or coil types, to switch math and other function
types while retaining the same input and output operands.

Change Element Type

To change an element type after it is placed in a net and linked to an operand:

Right-click the element, select Replace Ladder Element, then select the appropriate
element type.

382
FAQs

After the element has been changed, it remains linked to the same operand.

You can use this method to change contact or coil types, to switch math and other function
types while retaining the same input and output operands.

Placing a Function in a Net

1. Select any type of Ladder function by:


Selecting it from the Ladder toolbar, -or-
Selecting it from the Ladder menu, -or-
Right-clicking on the Ladder to display the Ladder menu and then selecting the
function.

2. Move the function to the desired net location, then click.

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

383
VisiLogic Software Manual V330

Placing a Function in a Net

1. Select any type of Ladder function by:


Selecting it from the Ladder toolbar, -or-
Selecting it from the Ladder menu, -or-
Right-clicking on the Ladder to display the Ladder menu and then selecting the
function.

2. Move the function to the desired net location, then click.

3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.

Output Window, Operand View

384
FAQs

Output Window, Operand View

Operand Descriptions

You can assign descriptions to operands:

When you place them in the Ladder. When you place a Ladder element or function on
a net, the Select Operand and Address dialog box opens, allowing you to enter a
description.
By double-clicking an element that is already in the net to open the Select Operand
and Address dialog box and edit the description.
By entering a description in the Output Window (Operand tab). In this way, you can
assign a description to several operands at once.

Get Next Address

Click here to assign the next free address of the operand type you select.

Power-up Values

Power-up values can be assigned to most operands. These values are written into the
operands when the controller is turned on.

385
VisiLogic Software Manual V330

Bit operands can be SET or RESET. Integers, Long Integers, and Double Words can be
assigned values that are written into the operand at power-up.

You can assign Power-up Values in the:

Select Operand and Address Dialog Box


Check the box next to the plug-shaped icon. This enables you to enter a value in
the Power-up value fill-in field.

Operand View Window


1. Select the Operand tab at the bottom of the screen.
2. Click on the Operand type to display the list of operands.
3. Enter Power-up values in the column headed by the Power-up icon.

Power-up Values

Power-up values can be assigned to most operands. These values are written into the
operands when the controller is turned on.

Bit operands can be SET or RESET. Integers, Long Integers, and Double Words can be
assigned values that are written into the operand at power-up.

You can assign Power-up Values in the:

Select Operand and Address Dialog Box


Check the box next to the plug-shaped icon. This enables you to enter a value in
the Power-up value fill-in field.

Operand View Window


1. Select the Operand tab at the bottom of the screen.

386
FAQs

2. Click on the Operand type to display the list of operands.


3. Enter Power-up values in the column headed by the Power-up icon.

Search: Symbolic Name

Use Search: Symbolic Name to find operands by description. Within the Select Operand
box, this is activated via <Ctrl> + <L> .

Setting Hexadecimal--Decimal Values

Use the drop-down box in the Select Operand and Address dialog box or in the Output
Window (Operand tab) to set a value according to decimal or hexadecimal notation.

Program Sequencing: Modules, Subroutines, Labels & Jumps

A module is a container of subroutines. Use modules and subroutines to divide your


application into program blocks. You can then run these program blocks conditionally, from
any point in your control application.

387
VisiLogic Software Manual V330

Note Within the program tree, elements are presented alphabetically. This does not
affect the order in which the program runs.
Note Ladder Modules and subroutines can be moved via drag-and-drop, as can HMI
Modules and Displays. Again, moving elements does not affect the order in
which they run.
The Main Ladder Module, Main Subroutine, Start-up HMI Module and the Start-
up HMI Display cannot be moved via drag-and-drop or erased. For easy
identification, they are always marked in orange.
To control the Ladder program flow sequence, use the Call Subroutine function to
conditionally call subroutines. Within a subroutine, you control the sequence by
conditionally skipping over nets using Labels and Jump to Label functions. This enables
you to shorten the program scan time.

A new VisiLogic project contains the main module and subroutine for the program. Each
new subroutine contains a default number of nets and a Subroutine Return function.

Subroutines do not run if they are not called by Call Subroutine. If no Call Subroutine
commands are included in the first subroutine of the main module, the program runs until it
reaches the Subroutine Return function, and then jumps back to the beginning of the first
subroutine.

Note If a subroutine does not run, the coils in that subroutine will not be updated. For
example, Subroutine 4 contains . If MB0 is turned ON in Subroutine 1, but
Subroutine 4 is not called, O0 is not updated. The order in which I/Os are updated depend
on the PLC program scan.
Some FBs require Configuration, such as SMS. The FB Configuration should be placed
in the first subroutine of the main program module. If a Configuration is in a subroutine that
is not called into the program, linked FBs will not be processed even if the activating
condition for that FB has been turned ON.

Subroutines can be reused as many times as required. Subroutines can also be exported
and imported between projects.

PLC Program Scan

388
FAQs

The scan cycle is performed continuously.

Note Power-up tasks, relating to the status of SB2 Power-up bit, are performed when
the controller is turned on. These tasks are performed before the program scan.

Call Subroutine & Subroutine: Return

389
VisiLogic Software Manual V330

Within Subroutines: Labels & Jumps

390
FAQs

Calls, Jumps, and Labels

The Call menu's functions enable you to set the sequence in which your program runs.

Load HMI Display: Functions

There are three Ladder functions connected to HMI Displays.

Load HMI Display

Causes a Display to be shown on the controller's LCD as a response to a Ladder


Condition.

391
VisiLogic Software Manual V330

HMI Display Loaded

This turns a linked MB ON when a specific Display begins loading. HMI Display Loaded is
located on the Calls menu.

]
Load Last Display

Loads the last Display loaded by the application. This function is located on the Calls menu.

To see a list of HMI Displays in a project, together with the Display number, select HMI
Information from the View menu.

Call Subroutine

This function causes a subroutine to run in response to a Ladder Condition.

392
FAQs

Using Call Subroutine

393
VisiLogic Software Manual V330

Open a Subroutine

To open a Subroutine for editing:

Double-click in the Project Explorer tree, -or-


Right-click the Subroutine in the Project Explorer tree, then select Open, -or-

394
FAQs

Right-click a Call Subroutine element to access the targeted subroutine.

Name-Rename Modules and Subroutines

Subroutine: Return

A subroutine runs until it reaches a Subroutine Return function, and then jumps back to the
beginning of the previous subroutine.

395
VisiLogic Software Manual V330

Using Subroutine Return

396
FAQs

Network Operands

Each controller contains specific Network Operands. If a controller is integrated into a


network, these operands can be read by the other controllers within the network.

You can network up to up to 63 controllers via CANbus. You assign each controller a
unique Unit ID number, 1 through 63. Each controller can read information from up to 8
other controllers in the network. To enable, for example, Controller 18 to access SB 200 in
Controller 62, you define a network operand using the unique ID number 62.

Network Operands
Type Symbol Address Range

397
VisiLogic Software Manual V330

Network System Bit NSB SB200-SB215


Network Input NI I0-I15
Network System Integer NSI SI200-SI201

FBs Library

Unitronics offers an FB library for advanced functions, such as SMS messaging and
MODBUS communications. FBs that are currently installed in VisiLogic are listed under the
FB's menu.

Note You must use a condition (RLO) to activate any FB that requires Configuration in
your application, such as MODBUS or SMS.

To install an updated FB library, select Update from the Web from the FBs menu or Help
menu, then follow the on-screen instructions. Note that at the end of the download, you
must close and then restart VisiLogic. The new FBs will appear on the FBs menu.

Note To enable Live Update, you can select to use a proxy server in Project Properties.

Use Function Block Information, located on the View menu, to check:

Which FBs are installed in your library.


Which FB versions are installed, which versions are used in the open project, and to
manage FB versions.
FB memory usage.
FB Library

398
FAQs

Versions Used

Use Functions to...

Store and Load Functions

Store and load functions can be used to copy values from an operand, or range of
operands, to another. You access both types of functions from the Store menu.

399
VisiLogic Software Manual V330

The available functions are listed below.

Store Direct Function


Store Indirect Function
Load Indirect Functions
Store Timer/Counter Preset
Load Timer/Counter Preset
Store Timer/Counter: Current Value
Load Timer/Counter: Current Value

Store Direct Function

Store Direct allows you to write a value contained in an operand or constant into another
operand.

To use the Store Direct function:

1. Click Store on the Ladder Toolbar.

2. Select Store Direct, then place the Store Direct function in the desired net.

3. Enter the desired Operands and Addresses.

400
FAQs

4. The Store Direct element appears on the net with the set Operands and
Addresses.

According to the above example, the value in MI 3 will be stored in MI 100. The previous
value in MI 100 is overwritten. The current value in MI 3 remains unchanged.

Float Functions

Float function blocks enable you to use Memory Float (MF) values in your program.

The Float menu on the Ladder toolbar includes the following functions:

Basic
Extended
Trig
Compare
Convert
Note Floating point values cannot be directly displayed on the controller screen. In order
to display a floating point value, use the Convert Float INV function to express the value in
2 MIs or MLs, and then use a Display number variable to show them on screen.

Indirect Clock Function example

To enable times and dates for tasks or programs to be set from the controller keypad, you:

Place Clock function blocks in the Ladder.


Create HMI Displays that include keypad-entry Time Function Variables.
This type of Variable accepts a time value that is entered via the controller keyboard,
storing
the number in the linked operand.
This example shows you how to build a ladder net that drives a coil according to the time
and date, and how to build the HMI Displays, add the required Variables and jump between
Displays.

Building the Ladder

401
VisiLogic Software Manual V330

1. Place an Indirect Time Function in the net.

2. Link an operand. The Time function requires two consecutive MIs; the second is
automatically assigned by the program. These 2 MIs define a time range. The first
MI sets the Start Time for the function, the second MI marks the End Time. When the
RTC is within this range, power flows through the function block.

3. Place a Day Of The Week function so that it touches the first function, enabling
power flow. This function uses a 16-bit register to contain a 7-bit bitmap representing
the days of the week.

402
FAQs

4. Link an operand.

5. Place a Day of The Month function so that it touches the last function.

6. Link an operand. This function uses an ML or SL to contain a 32-bit bitmap.

403
VisiLogic Software Manual V330

7. Place a Month function so that it touches the last function.

8. Link an operand.

9. Place a Direct Coil in the net as shown below, and link an operand. The Ladder net
is complete; now create the supporting HMI Displays and Variables.

404
FAQs

You build the net using Indirect Time functions.

Building the HMI Displays

Here, you will create variables that enable Start Time, End Time, Day of Week, and Day of
Month, and month to be set from the controller keyboard.

Start & End Time Variables

1. Open the HMI Display editor.

2. Create and name a Display: Start and End Time.

405
VisiLogic Software Manual V330

3. Draw a text box, and enter fixed text: Start Time.

4. Draw another text box, and enter the text: End Time.

406
FAQs

5. Create a field to hold the first Time Function Variable, Start Time.

6. Define the Variable as Keypad Entry and link it as shown below.

407
VisiLogic Software Manual V330

6. Create a field and define the End Time Variable, linking it to MI 31.

This Display is complete.

Day of Week & Day of Month Variables

1. Create and name a new display; Select Day and Date.


2. Draw a text box, entering the text Select Day.
3. Draw another text box, entering the text Select Date.
4. Create a field to hold the Select Day Variable.
5. Define this variable as Day of Week, and link it to MI 32.

6. Create a field to hold the Select Date Variable.


7. Define this variable as Day of Month, and link it to ML 33.

408
FAQs

This Display is complete.

Month Variable

1. Create and name a new display; Select Month.


2. Draw a text box, entering the text Select Month.
3. Create a field to hold the Select Month Variable.
4. Define this variable as Month, and link it to MI 34.

This Display is complete.

You must create variables that enable times and dates to be set from the controller
keyboard.

Setting Jumps

1. Open Display Start and End Time.


2. Click on the first Jump Condition, and select SB 30: HMI keypad entries completed.

3. Click on Display, and select Display 2.

4. Open Display Select Day and Date,click on the first Jump Condition, and select SB
30..

409
VisiLogic Software Manual V330

5. Click on Display, and select Display 3, Select Month.

Set the Jump from Display 3 according to your requirements.

Jumps move from Display to Display, enabling the user to enter the required data.

To see how register values relate to individual functions, refer to the individual topics listed
below.

Day of the Month-Direct and Indirect

Day of the Week-Direct and Indirect

Direct Clock Function: Example

This example shows you how to build a ladder net that drives a coil:

between the hours 9:00 am and 6:00 PM.


Monday through Friday
beginning on the 15th day of a month, until and including the 24th
in the years 2000 and 2001
Remember that the elements must touch to enable power flow to the coil.

1. Place an Direct Time Function in the net.

2. Set a Start and End Time. When the RTC is within this range, power flows through
the function block.

410
FAQs

3. Select Day of the Week , place it in the net, then select the desired days.

4. Select Day of Month , place it in the net, then select the desired dates.

5. Select Year, then enter the year.

6. Enlarge the net, place and link a coil, then use the Connect Elements Tool to draw
lines between the elements.

Store Indirect Function

411
VisiLogic Software Manual V330

Store Indirect allows you to write a value contained in certain types of operands into
another operand using indirect addressing. The 'B' output parameter of the Store Indirect
function is actually a pointer to another operand.

When you select the function type from the Store menu, the program writes the input A
value into the address referenced by the output B value--according to the type of function
you select.

Example: Store Indirect MI

In the example below, SI2 contains the value 5 and SDW1 contains the value 10. Since the
function type is Store Indirect MI, MI10 is where the value in SI2 will be stored.

The value 5 will therefore be stored in MI 10.

Compare Functions

A compare function block compares two values according to the type of function you select.

If the comparison is true (logic 1): power flows through the block.

If the comparison is false (logic 0): power does not flow through the block.

There are 6 types of Compare Functions:

Greater Than
Greater Than or Equal To
Equal To
Not Equal To
Less Than or Equal To
Note The Vector menu includes a Compare Vector function.

These values may be compared:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
Network System Integer (NSI)

412
FAQs

Constant Value #

Multiple Input Values in Math Functions

You can input up to 8 values into a math function block. The function will output a single
sum. This example shows an Add function that uses 5 input values.

1. Click on the Math button on the Ladder toolbar.


-or-
Right-click on the Ladder to show the Ladder pop-up menu.
2. Select More..., then select the desired function type.
3. Click on the function with the desired number of input values.

4. Move the function to the desired net location, then click. The net automatically
enlarges to fit the function

5. Link operands using the Select Operand and Address dialog box. The dialog box
opens automatically until all input values and the output value have been linked.

PID Function

413
VisiLogic Software Manual V330

The PID function uses system feedback to continuously control a dynamic process. The
purpose of PID control is to keep a process running as close as possible to a desired Set
Point.

About PID and Process Control

A common type of control is On-Off control. Many heating systems work on this principle.
The heater is off when the temperature is above the Set Point, and turns on when the
temperature is below the Set Point. The lag in the system response time causes the
temperature to overshoot and oscillate around the Set Point.

PID control enables you to minimize overshoot and damp the resulting

oscillations.
PID enables your controller to automatically regulate your process by:

1. Taking the output signal from the process, called the Process Variable (PV),
2. Comparing this output value with the process Set Point. The difference between the
output Process Variable and the Set Point is called the Error signal.
3. Using the Error signal to regulate the controller output signal, called the Control
Variable (CV), to keep the process running at the Set Point. Note that this output
signal may be an analog or time-proportional variable value.
In the figure below, a system is regulated according to temperature.

414
FAQs

Inside the PID Function

The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID
output is the combined output of all 3 actions.

All of the PID functions are activated by changes in the process Error, the difference
between the Process Value and the process Set Point value (E = SP PV).
Proportional Band

The proportional band is a range defined around the Set Point. It is expressed as a
percentage of the total Process Value (PV). When the PV is within this range, the PID
function is active.

Note The proportional band may exceed 100%. In this case, PID control is applied over
the entire system range.

Proportional Action

Proportional action begins after the PV enters the proportional band; at this point, the Error
is 100%. The action outputs a value that is in direct linear proportion to the size of the
Error value.

A broad proportional band causes a more gradual initial response from the controller.
Typically, Set Point overshoot is low; but when the system stabilizes, oscillations around
the Set Point tend to be greater.

415
VisiLogic Software Manual V330

A narrow band causes a rapid response that typically overshoots the Set Point by a greater
margin. However, the system does tend to stabilize closer to the set point. Note that a
proportional band set at 0.0% actually forces the controller into On-Off mode.

The drawback of proportional control is that it can cause the system to stabilize below set
point. This occurs because when the system is at set point, Error is zero and the control
value output is therefore pegged at zero as well. The majority of systems require
continuous power to run at set point. This is achieved by integrating integral and derivative
control into the system.

Direct and Reverse Action

Direct action causes the output to change in the same direction as the change in Error,
meaning that a positive change in Error causes a positive change in the proportional bands
output. Reverse action creates an inverse change in the output, meaning that a positive
change in Error causes a negative change in output.

Integral Action

Integral action responds to the rate of change in the controllers CV output relative to the
change in Error. The integral time you set is the amount of time, as calculated by the
controller, required to bring the process to Set Point. Note that if you set a short integral
time, the function will respond very quickly and may overshoot the Set Point. Setting a
larger integral time value will cause a slower response. Integral time is sometimes called
Reset.

The controllers CV output may reach and remain at 100%, a condition called saturation.
This may occur, for example, if the process is unable to reach Set Point. This causes the
Error signal to remain stuck in either the positive or negative range. In this situation, the
integral action will grow larger and larger as the Error accumulates over time. This is called
integral "wind up", which can cause the controller to overshoot the set point by a wide
margin.

This situation can be prevented by setting an MB to clear the accumulated Integral error
when saturation is occurs.

416
FAQs

Derivative Action

Derivative action responds to the rate and direction of change in the Error. This means that
a fast change in error causes a strong response from the controller.

The derivative action anticipates the PVs value in relation to the Set Point and adjusts the
controllers CV output accordingly, thus shortening the PID functions response time.

AutoTune---Note: This feature is not included in the current product release.

Note: AutoTune is not included in the current product release.

AutoTune enables the controller to automatically optimize PID settings in accordance with
the code you select. The code determines the speed of the controllers response.

The figure below shows how the code affects the controllers response. A setting of zero
enables a fast (under-damped) response, causing the controller to overshoot the Set Point
and oscillate. A setting of 10 causes a slow (over-damped) response. Although this avoids
Set Point overshoot for a more stable response, note that the system will take longer to
achieve set point.

In either case, AutoTune causes the system to stabilize at the Set Point.

Placing a PID function

1. Select PID Scan from the FBs menu, then place the function in the net.

417
VisiLogic Software Manual V330

The PID parameter box opens as shown below.

2. The Select Operand and Address box opens; link operands to the PID parameters.

PID Function Parameters

Parameters: Type Function


Inputs

PV: MI PV is the feedback from the process. PV is output from the process
Process and input to the PID function. In a heating system, the temperature
Value measured by a temperature sensor provides the PV.

SP: MI SP is the target value for the process. In a heating system, this is
Set Point the temperature value set for the system. Note that the Set Point
and Process value must be given in the same type of units (degrees
Celsius, bars, meters per second, etc.)

ST: MI Use this parameter to define the intervals between PID function
Sample or # updates, in units of 10mSecs.
Time

Xp: MI Use this parameter to define the proportional band, in units of 0.1%.
Proportional or # The proportional band is a percentage of the total Process Value
Band (PV). It is a range defined around t he Set Poi nt. W hen the PV is
within this range, the PID function is active.

418
FAQs

Intgl. Time: MI Use this parameter to define the integral time, in units of 1 second.
Integral or # Integral action responds to the rate of change in the controllers CV
Time output relative to the change in Error. The integral time you set is
the amount of time, as calculated by the controller, required to bring
the process to Set Point.

Deriv. Time: MI Use this parameter to define the derivative time, in units of 1
Derivative or # second. Derivative action responds to the rate and direction of
Time change in the Error. This means that a fast change in error causes
a strong response from the controller. The derivative action
anticipates the PVs value in relation to the Set Point and adjusts
the CV accordingly, thus shortening the PID functions response
time.

DB: MI Use this parameter to define the dead band, in units of 0.1%. Note
Dead Band or # that the dead band is a percentage of the proportional band. W hen
v a l u e s a r e wi t h i n t h e d e a d b a n d r a n g e , t h e P I D f u n c t i o n s u s p e n d s
action; the controllers CV output is not changed.

SPPV-High: MI Use this parameter to define the upper limit for the Process Value.
Set Point for or #
Process
Value

S P P V - L o w: MI Use this parameter to define the lower limit for the Process Value.
Set Point for or #
Process
Value

CV-High: MI Use this parameter to define the upper limit for the Control Value.
Set Point for or #
Control
Value

C V - L o w: MI Use this parameter to define the lower limit for the Control Value.
Set Point for or #
Control
Value

Reserved 1 This parameter is reserved for a feature that will be added in the
future.

Reverse: MB Select ON to activate Reverse Action, Off to activate Direct Action.


Reverse Direct action causes the output to change in the same direction as
Action the change in Error; a positive Error deviation causes a positive
change in the proportional bands output. Reverse action creates an
inverse change in the output; a positive Error deviation causes a
negative change in output.

RST INTGL: MB Use this parameter to clear integral error.


Reset If the system does not reach setpoint within the time defined in the
Integral parameter Intgl. Time, Int egral error occurs and may increas e. Use
Error this parameter to prevent the error from growing large enough to
interfere with the Integral operation.

Reserved 2 This parameter is reserved for a feature that will be added in the
future.

Parameters: Type Function


Outputs

CV: MI CV is the output from the PID function. CV is output from the PID
Control function and input to the process. Note that this output signal may
Value be an analog or time-proportional variable value.

CV(P): MI This is the Proportional component of the PID function, calculated


Proportional by the controller.
Value

CV(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value

419
VisiLogic Software Manual V330

CV(P): MI This is the Derivative component of the PID function, calculated by


Derivative the controller.
Value
Linearizing a PID Analog Output Value

Analog values can be converted to physical values, for example Engineering Units (EU)
such as degrees Celsius, by using the Linearization FB.

Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.

Linearizing a PID output-to-analog output

Working within the 4-20mA range

Available ranges, according to controller and I/O module, are shown in the topic Analog I/O
ranges. Note that devices used in conjunction with the controller must be calibrated
accordingly.

Limits can be set for the output range, in this case linearization is not required.

420
FAQs

Shift

The Shift function moves the bits in an integer to the left or to the right. Note that any bit
shifted out cannot be recovered.

Shift Right

Operand A: contains the value to be shifted.


Operand B: contains the number of bits to be shifted.
Operand C: contains the resulting value.
Operand D: shows the status of the final bit in the integer after the operation.

The Shift function may be performed on values contained in the following operands:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)

421
VisiLogic Software Manual V330

System Operands:(SI) (SL)(SDW)


The functions are located under the Logic menu on the Ladder toolbar.

Rotate

The Rotate function moves the bits in an integer to the left or to the right.

Operand A: contains the value to be rotated.


Operand B: contains the number of bits to be rotated.
Operand C: contains the resulting value.
Operand D: shows the status of the final bit in the integer after the operation.

The Rotate function may be performed on values contained in the following operands:

Memory Integer (MI)


Memory Long Integer (ML)
Double Word (DW)
System Operands:(SI) (SL)(SDW)
The functions are located under the Logic menu on the Ladder toolbar.

Displays
What are...

About Displays

Displays tell your operators what to do. You can have your operators log in with a
password, enter setpoints and other data, and instruct the operator what to do in case of an
system problem or alarm. A Display can contain both text and images. Text and images
can be both fixed and/or variable.

Variables are inserted into a Display to:

Show run-time values as integers


Represent run-time values with either text, images, or bar graphs
Show text messages that vary according to runtime conditions.

422
FAQs

Changing Displays (Jumps)

To change between Displays, set Jumps. A Jump contains a Jump condition, which is
linked to a bit operand, and a destination Display. You can also load a Display by placing a
function in a Ladder net.

Setting Jumps

1. Open a Display.
2. Click on a Jump Condition field, and select an operand.

3. Click on Display field, and select a destination Display.

To edit a Jump, click the desired field and make a new selection.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.
Note To see a list of Displays in a project together with their Display numbers, select
HMI Information from the View menu.

Graphic Images in Displays

Simple geometric shapes can be drawn on a Display.


Graphic images can be imported from the Image Library, or created with a program such as
Microsoft Paint and then imported.

Fixed graphic images


This type of image stays on the screen and does not change until a different Display
is loaded by the program.

Variable graphic images


Variable images change according to the value of a linked operand. Binary Image
Variables are linked to bit operand status (MB, SB, I, T, O). List Image
Variables are linked to integers (MI, SI, ML, SL)
You can draw graphic images directly on a Display, or import images.

Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.

Grid

The grid can help you align elements within a Display. Toggle the Display grid on by
clicking the Grid button on the toolbar; click it again to turn the grid off.

How do I....

423
VisiLogic Software Manual V330

Add and Name a Display

Open a Display

Click the Display name in the Project Window.

Delete/Clear a Display

424
FAQs

HMI Display Editor

Use the HMI Display Editor to create the Displays that are shown on the controller screen
after the program is downloaded. When you select HMI from the Project Explorer tree, a
Display replica opens. The size of this replica reflects the type of Vision controller you have
selected in your project's Hardware Configuration.

Displays tell your operators what to do. You can have your operators log in with a
password, enter setpoints and other data, and instruct the operator what to do in case of a
system problem or alarm. A Display can contain both text and images. Text and images
can be both fixed and/or variable.

Variables are inserted into a Display to:

Show run-time values as integers


Represent run-time values with either text, images, or bar graphs
Show text messages that vary according to runtime conditions.
Below, click the elements outlined in blue to learn more about a specific
feature.

Changing Displays (Jumps)

To change between Displays, set Jumps. A Jump contains a Jump condition, which is
linked to a bit operand, and a destination Display. You can also load a Display by placing a
function in a Ladder net.

Setting Jumps

1. Open a Display.
2. Click on a Jump Condition field, and select an operand.

3. Click on Display field, and select a destination Display.

To edit a Jump, click the desired field and make a new selection.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

425
VisiLogic Software Manual V330

Note To see a list of Displays in a project together with their Display numbers, select
HMI Information from the View menu.

Clear/Edit Display Jumps & Destinations

Calling a Subroutine via Display

You can use a specific Display to call a specific Subroutine. This Subroutine will run during
the time that the Display is shown on the controller's LCD.

Timers: Displaying Values

A Timer Variable shows a timer's value in a Display.

1. Create a Variable field, and then select Timer.

426
FAQs

2. Select from the features and formats shown below.

427
VisiLogic Software Manual V330

Name/Rename Displays & Variables

Graphic Images in Displays

Simple geometric shapes can be drawn on a Display.


Graphic images can be imported from the Image Library, or created with a program such as
Microsoft Paint and then imported.

Fixed graphic images


This type of image stays on the screen and does not change until a different Display
is loaded by the program.

Variable graphic images


Variable images change according to the value of a linked operand. Binary Image
Variables are linked to bit operand status (MB, SB, I, T, O). List Image
Variables are linked to integers (MI, SI, ML, SL)
You can draw graphic images directly on a Display, or import images.

Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.

Images: Fixed

This type of image stays on the screen until a different Display is loaded by the program.

428
FAQs

Text in HMI Displays

Displays can contain both fixed and Variable text. Fixed (constant) text does not change
according to run-time conditions. Variable text can show run-time values, such as timer
values, or display operating instructions according to system status.

Display ASCII String

You can display a vector of MI, ML, or DW values as an ASCII string. The value of each
byte in the vector is displayed as an ASCII character.

Display ASCII String is located on the Text Variable menu.

429
VisiLogic Software Manual V330

The Display String 'trigger' MB is automatically reset.

Note String Pattern defines the size of the text field. The default string 'Text To Display'
will provide a field long enough to contain most strings.

To create a field that contains enough bytes to provide for the width of the ASCII characters
in a variable string, enter a line of text in String Pattern that contains characters of the
necessary width.

The character ' W ' is generally the widest character in a font set.

430
FAQs

Note A vector is read either until the end of the defined vector length, or until a 'null'
character is encountered. By adding a null character to the end of the stream, you can mark
the end of a data string. This can prevent other data, that might be present in a vector, from
being added to the data string when the vector is read.

Group/Ungroup

1. Select elements in a Display by dragging the mouse over them, they are highlighted
in blue.
2. Click the Group button on the toolbar to convert the elements into a single unit; click
the Ungroup button to disassemble the unit.

Text: Fixed

Fixed (constant) text does not change according to run-time conditions.

To place fixed text messages in a Display:

431
VisiLogic Software Manual V330

Fonts

Fonts are used in text boxes and to display Variable data.

Note Fonts are not standardized. For example, two different PCs may both contain a
font called Arial. Displays created on one PC using that font may look different or distorted
when opened on the other PC. This can be fixed by opening the application and replacing
the font; you may replace the font with a font of the same name to solve this problem.

Font Handler

Font Handler enables you to define the fonts and character sets you use to write text in
Displays.
Use Font Handler to:

Add fonts. Note that VisiLogic is supplied with a single default font.
Define fonts, including size, style, and effect.
Delete unused fonts, and unused characters. This can dramatically decrease the font
memory requirements.
Select foreign or special characters, such as degree signs.
Using Font Handler

432
FAQs

Open Font Handler by clicking the icon on the toolbar, or by selecting it from the HMI
menu.

433
VisiLogic Software Manual V330

Note Any characters within a font that are too big to be displayed on the controller's LCD
will be marked in red.

Deleting Fonts

Remove unused fonts to reduce the size of your program.

434
FAQs

Fonts: Edit and Replace

You can globally edit font type, size and style, or replace the fonts you use in your Displays.
In the example below, MS Sans Serif (8) is replaced by Verdana (10). This action will
replace all of text based on MS Sans Serif (8) throughout all of the Displays in your project.

435
VisiLogic Software Manual V330

Grid

The grid can help you align elements within a Display. Toggle the Display grid on by
clicking the Grid button on the toolbar; click it again to turn the grid off.

Creating Images with Microsoft Paint

When you insert an image, it stretches or shrinks to match the size of the field you have
drawn on the Display. This results in some degree of distortion. To avoid this, create
images that match the required size.

Note An imported image cannot exceed the size of the controller's display screen. For
example, the V230's Display screen is 128x64 pixels, therefore an image of 100x100 pixels
cannot be used unless it is resized in a third-party utility such as Paint.

After reading the information below, view Edit Image Collections with Paint Step 1.exe
movie, located on the VisiLogic setup CD.

1. Determine the required image size in pixels. You can do this by inserting any image,
resizing it to meet your requirements, then holding the cursor above it to display the
image's ToolTip.

2. Open Microsoft Paint, then set the image attributes to match your requirements; the
drawing area changes accordingly.

436
FAQs

3. From the View menu, open Zoom, then select Large Size,
or
Use Paint's Magnifying icon to enlarge the view.

4. From the View menu, open Zoom, then select Show Grid.

5. Draw your image on the grid.


6. If images distort when they are resized, you can use Paint's pencil tool to change the
color of individual pixels in the bitmap. Use Skew to proportionally resize images.

437
VisiLogic Software Manual V330

7. Save the image into a folder in your Image Library.

8. After you insert the image, use Fit to Original Size to resize the image to match its
actual dimensions.

Variables
What are...

Variables

438
FAQs

Variables enable you to show run-time values, text, images, and bar graphs on the
controller's screen in response to run-time conditions. Bit, or binary text variables, for
example, display text messages on the controller's LCD screen according to the status of a
bit operand.

A Display may contain up to 16 variables.

You can also use Keypad Entry Variables to enable an operator to enter a password, or
data such as setpoints from the controller's keyboard.

Variable Editor

When you insert a variable into a display, the Variable Editor opens, showing you the
options that are relevant for that type of Variable.

After you have inserted Variables into a display, they are shown with that display in the
Project tree.

Variable Images

Variable images change according to the value of a linked integer.

439
VisiLogic Software Manual V330

Text Variables

Variable text can show run-time values, such as timer values, or display operating
instructions according to operand status. A Binary Text Variable is shown below.

440
FAQs

Number Variable

A Number Variable enables you to:

Show any numeric value within a Display.


Control the format in which that value is shown, including the placement of a decimal
point and leading zeros.
Use Linearization to show a converted value, such as an analog temperature
converted to degrees Celsius.
Allow the operator to use the controller keypad to enter a number, such as a setpoint,
via a Keypad Entry Variable.
Inserting and Defining the Variable

1. Create a Variable field, and then select Number.

441
VisiLogic Software Manual V330

2. Select from the features and formats shown below.

To see how to use Keypad Entry Variables, refer to the Indirect Clock example.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

Note SB 250, Keypad Entry within Limits, turns ON when a legal value is entered; SB
251, Keypad entry exceeds limits, turns ON when a value is out of range. You can use the

442
FAQs

status of these bits, for example, to provide a jump condition to another Display. When
either of these SBs turns ON, the index number of the active variable is stored in SI 249.

Variable Types: Table

Text Image Numeric Clock Timer


Variable Variable Variable Variable /Counter
Variable
Binary(bit) Binary Image Number Real Time Timer
T e xt Clock
List of List of Images: P a s s wo r d Clock Counter
T e xt s : b y by Pointer Variables
Pointer
List of List of Images: Bar Graph
T e xt s : b y by Range
Range
Display
ASCII

Bar Graphs: Displaying Values

Bar graphs can be used to show how values progress. You can use them together with
other Display elements to help operators track system progress and status.

This is a sample of a Display and how its elements can look on the controller's LCD.

443
VisiLogic Software Manual V330

Inserting and Defining the Variable

1. Create a Variable field, and then select Bar Graph.

2. Select from the features and formats shown below.

How do I...

Inserting a Variable into a Display

To show variable data, you first create a field in the Display. The field is a container that
holds the data.

444
FAQs

445
VisiLogic Software Manual V330

A field that is not big enough to contain its data is red. To resize a field, click it and drag the
edges.

Delete a Variable

To delete a Variable:

1. Select a Variable, either within a Display or from the Project Explorer Tree.
2. Either press Delete on your PC keyboard, or click the Delete button.

Resizing a Field

A Variable field that is not big enough to contain its data is red. To resize a field, click it and
drag the edges.

Bit (Binary) Text Variable

This type of variable displays a different text message on the controller's LCD screen
according to the status of a bit operand.

446
FAQs

Inserting and Defining the Variable

1. Create a Variable field, and then select Binary Text from the Text menu.

447
VisiLogic Software Manual V330

2. Link a bit operand, and enter text for both bit states.

Bit (Binary) Image Variable

This type of variable displays a different image on the controller's LCD screen according to
the status of a bit operand.

Inserting and Defining the Variable

1. Create a Variable field, and then select Binary Image from the Image menu.

448
FAQs

2. Link a bit operand, and select images for both bit states.

Fonts in Binary Text Variables

You can select different fonts for each bit state. Remember that you must first add fonts to
the system via Font Handler.

Naming a Variable

You can name a Variable by assigning a description when you insert the Variable into the
Display. You can rename it by double-clicking the Variable to open and entering a new
name, or by right clicking the Variable's name in the Project tree and selecting Rename.

449
VisiLogic Software Manual V330

Integer Variables (MI, SI, ML, SL, DW, SDW)

You can represent integer values by showing a numeric value on screen, or by showing
text messages, images, or bar graphs. You can also enable data and passwords to be
entered into the system via the controller keyboard.

Show Display Variables

After you have inserted Variables into a display, they are shown with that display in the
Project tree.

Text in HMI Displays

Displays can contain both fixed and Variable text. Fixed (constant) text does not change
according to run-time conditions. Variable text can show run-time values, such as timer
values, or display operating instructions according to system status.

Graphic Images in Displays

Simple geometric shapes can be drawn on a Display.


Graphic images can be imported from the Image Library, or created with a program such as
Microsoft Paint and then imported.

Fixed graphic images


This type of image stays on the screen and does not change until a different Display
is loaded by the program.

Variable graphic images


Variable images change according to the value of a linked operand. Binary Image
Variables are linked to bit operand status (MB, SB, I, T, O). List Image
Variables are linked to integers (MI, SI, ML, SL)
You can draw graphic images directly on a Display, or import images.

Note Although an imported image can be resized, resizing may result in some degree of
distortion.
To avoid this, use images that are created to match the required size.

Clock Variables

450
FAQs

Place Clock Variables in Displays to show times and dates. In addition to showing RTC
values, use Clock Variables in conjunction with Indirect time functions to enable an operator
to set times via the controller keypad.

A keypad-enabled Clock Variable accepts a number entered via the controller keyboard,
and stores the number in the operand linked to the Variable.

In se r ting and De fini ng a Ke yp a d E nt r y Clo ck Va ri able

Create a Variable field and select Time Function, then select the format and display
font.

451
VisiLogic Software Manual V330

Note Step-by-step instructions on how to use Keypad Entry Clock Variable values are
provided in the Indirect Clock function example.

Timers: Displaying Values

A Timer Variable shows a timer's value in a Display.

1. Create a Variable field, and then select Timer.

452
FAQs

2. Select from the features and formats shown below.

Presetting Timer via Keyboard

You can preset a Timer using the controller's keyboard.

You can also use Information Mode to edit or enter a timer value via the controller keyboard
while the controller is running its control program.

Number Variable

A Number Variable enables you to:

Show any numeric value within a Display.


Control the format in which that value is shown, including the placement of a decimal
point and leading zeros.
Use Linearization to show a converted value, such as an analog temperature
converted to degrees Celsius.

453
VisiLogic Software Manual V330

Allow the operator to use the controller keypad to enter a number, such as a setpoint,
via a Keypad Entry Variable.
Inserting and Defining the Variable

1. Create a Variable field, and then select Number.

2. Select from the features and formats shown below.

To see how to use Keypad Entry Variables, refer to the Indirect Clock example.

454
FAQs

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

Note SB 250, Keypad Entry within Limits, turns ON when a legal value is entered; SB
251, Keypad entry exceeds limits, turns ON when a value is out of range. You can use the
status of these bits, for example, to provide a jump condition to another Display. When
either of these SBs turns ON, the index number of the active variable is stored in SI 249.

Display Number Format

You can show numbers in different formats.

Linearization for Display

Use Linearization to show a converted value, such as an analog temperature converted to


degrees Celsius.
Inserting and Defining the Variable
1. Create a Variable field, and then select Number.

455
VisiLogic Software Manual V330

2. Apply Linearization as shown below.

According to the example:

A temperature entry of 1000 C will be converted to 1023 Digital value.


A temperature entry of 500 C will be converted to 512 Digital value.

456
FAQs

Number Variable

A Number Variable enables you to:

Show any numeric value within a Display.


Control the format in which that value is shown, including the placement of a decimal
point and leading zeros.
Use Linearization to show a converted value, such as an analog temperature
converted to degrees Celsius.
Allow the operator to use the controller keypad to enter a number, such as a setpoint,
via a Keypad Entry Variable.
Inserting and Defining the Variable

1. Create a Variable field, and then select Number.

2. Select from the features and formats shown below.

457
VisiLogic Software Manual V330

To see how to use Keypad Entry Variables, refer to the Indirect Clock example.

Note When an HMI keypad entry variable is active, and the Enter key is pressed on the
controller keypad, SB 30 HMI Keypad Entries Completed turns ON. This can be used as a
Jump condition.

Note SB 250, Keypad Entry within Limits, turns ON when a legal value is entered; SB
251, Keypad entry exceeds limits, turns ON when a value is out of range. You can use the
status of these bits, for example, to provide a jump condition to another Display. When
either of these SBs turns ON, the index number of the active variable is stored in SI 249.

Bar Graphs: Displaying Values

Bar graphs can be used to show how values progress. You can use them together with
other Display elements to help operators track system progress and status.

This is a sample of a Display and how its elements can look on the controller's LCD.

458
FAQs

Inserting and Defining the Variable

1. Create a Variable field, and then select Bar Graph.

459
VisiLogic Software Manual V330

2. Select from the features and formats shown below.

Limit Keypad Entry

460
FAQs

Note SB 250, Keypad Entry within Limits, turns ON when a legal value is entered; SB
251, Keypad entry exceeds limits, turns ON when a value is out of range. You can use the
status of these bits, for example, to provide a jump condition to another Display. When
either of these SBs turns ON, the index number of the active variable is stored in SI 249.

Linearization for Display

Use Linearization to show a converted value, such as an analog temperature converted to


degrees Celsius.
Inserting and Defining the Variable
1. Create a Variable field, and then select Number.

461
VisiLogic Software Manual V330

2. Apply Linearization as shown below.

According to the example:

A temperature entry of 1000 C will be converted to 1023 Digital value.


A temperature entry of 500 C will be converted to 512 Digital value.

462
FAQs

Display Number Format

You can show numbers in different formats.

Clock Variable: View RTC

The Real-Time-Clock value in the controller can be shown in a Display.


Inserting and Defining the Variable
Create a Variable field and select Real Time Clock, then define the Variable by
selecting the time format and display font. You do not link an operand because this
variable is already linked to the RTC.

463
VisiLogic Software Manual V330

Resizing a Field
A Variable field that is not big enough to contain its data is red. To resize a field, click it and
drag the edges.

Fonts
Fonts are used in text boxes and to display Variable data.

Note Fonts are not standardized. For example, two different PCs may both contain a
font called Arial. Displays created on one PC using that font may look different or distorted
when opened on the other PC. This can be fixed by opening the application and replacing
the font; you may replace the font with a font of the same name to solve this problem.

Hardware Configuration
How do I...

464
FAQs

Hardware Configuration

The foundation of a Vision control system is the controller. The Snap-in I/O Module
provides an on-board I/O configuration. You add I/Os by integrating I/O Expansion
Modules.

VisiLogic's Hardware Configuration allows you to configure inputs: analog, digital, and high-
speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital,
and PWM high-speed outputs.

Open Hardware Configuration by clicking the button on the toolbar, or selecting it from
the View menu.
Selecting Hardware Elements

Configuring I/O Expansion Modules

Note I/O Expansion Modules may require an adapter. Check with your distributor for
additional details.

465
VisiLogic Software Manual V330

Configuring Snap-in I/O Modules

High-Speed Counters: Snap-in IO Modules

Certain digital inputs on Snap-in I/O Modules are high-speed inputs that can be used as a
32-bit high-speed counter of the following types:

High-Speed Counter
High-Speed Counter with Reset

466
FAQs

Frequency Measurer
Shaft Encoder
Configuring a High-Speed Counter

The linked operand contains the counter value which is current at the last program scan.

To measure frequency, click the second input field and select the sample rate.

High-Speed Counter: Reload

Reload enables you to immediately load 0 into a high-speed counter when the counter
value reaches a target value.

467
VisiLogic Software Manual V330

High-Speed Counters: I/O Expansion Modules

Certain digital inputs on certain I/O Expansion Modules are high-speed inputs that can be
used as a 16-bit high-speed counter of the following types:

High-Speed Counter
High-Speed Counter with Reset
Frequency Measurer
Configuring a High-Speed Counter

468
FAQs

The linked operand contains the counter value which is current at the last program scan.
Use this operand in your program like any other.

Configuring Digital Inputs

Note PNP/NPN must be set within the hardware, as explained in the technical
specifications supplied with the I/O module. The program settings do not influence the
actual hardware input setting.

You can also assign a single description to a several lines.

Configuring Digital Outputs

Digital Outputs may be Relay or Transistor type.

469
VisiLogic Software Manual V330

Note PNP/NPN must be set within the hardware, as explained in the technical
specifications supplied with the I/O module. The program settings do not influence the
actual hardware input setting.

You can also assign a single description to a several lines.

Configuring Digital Inputs

Note PNP/NPN must be set within the hardware, as explained in the technical
specifications supplied with the I/O module. The program settings do not influence the
actual hardware input setting.

You can also assign a single description to a several lines.

470
FAQs

Configuring an Analog Input

Before you can use an analog input in your program, you must link it to an operand. An
analog input value can be contained in an MI, ML, or DW.

471
VisiLogic Software Manual V330

Configuring a PT100 Input

Configuring an Analog Output

472
FAQs

Communications
How do I...

COM Ports

All Vision controllers comprise RS232 serial communication ports. RS232/RS485 adaptors
are available by separate order. Certain models, such as the Vision120, support both
RS232 and RS485. For details on communications hardware settings, refer to the User
Guides and documentation supplied with relevant models.

Separate CANbus ports are also provided with specific controller models.

Note All ports can be used simultaneously. For example, a single controller may use one
serial port to send messages to a modem via RS232, another port to communicate with a
frequency converter, while the controller engages in communications via its CANbus port.

Communication ports must be initialized in your control program using the COM Init FB,
located on the FB's menu.

473
VisiLogic Software Manual V330

RS485 Options

The information in this topic is common to all Unitronics' controllers networked via RS485.
Note that before you carry out any tasks associated with wiring, you must read and fully
understand the safety guidelines.

About RS485

RS485 is a balanced serial interface for the transmission of digital data, which enables you
to create a multi-drop network containing up to 32 devices, or nodes

RS485 gives you 2 main advantages over RS232: longer cable lengths and greater
immunity to noise. In comparison to RS232, RS485 uses lower voltage and differential
signals. RS485 uses a differential voltage loop interface (balanced differential signal);
differential data transmission reduces the effects of ground shifts and induced noise
signals, even in an electrically noisy environment. The system is based on balanced
circuits that rely on twisted-pair wires (A & B). Thus, the data conversion of logical 0 and 1
is made by converting the polarity of the two wires by reference to each other, instead of
changing polarity of a single wire by reference to the "SG" (Signal Ground).

The noise immunity results from the fact that, when electromagnetic noise is induced over
the differential signals, the same noise is induced on both signals. When the receiver
subtracts the differential signals, the result is noise compensation.

The same 2 wires are used for transmitting and receiving; therefore, within RS485
networks, only one device can transmit while all of the other devices 'listen' (receive).

Unitronics' controllers offer different options for networking via RS485, according to the
network series.

Network Topology & Wiring

The network topology is multi-drop bus. Every RS485 network includes 2 types of nodes;
node refers to every device that is physically connected to the network.

End Nodes: The devices attached at both physical ends of the network, containing a
network terminator.
In-line Node: All devices connected to the network that are not end nodes.
To enable a rapid rate of communication over relatively long distances, the wires function
as transmission lines. For this reason, the end nodes of the network must contain network
terminators for the purpose of impedance matching. The method for setting network
terminators is described individually for each device.
RS485 Network Wiring

Use shielded twisted pair (STP) cables to network devices. Recommended cables types
are:

Twinax cable, type H8106 Control cable, type due 4001 (0.5mm2 , twisted pair)
Twinax cable, type H3094 Control cable, type V45551-F21-B5 (1.5mm2 , twisted
pair)
The combined total length of all network cables cannot exceed 1219 meters, as shown
below.

474
FAQs

RS485 wiring considerations


With the exception of the M90-19-R4, the RS485 signals are NOT isolated. If the
controller is used with a non-isolated external device, avoid potential voltage that
exceeds 10V. To avoid severely damaging the system, all non-isolated device ports
should relate to the same 0Vsignal.
Minimize the stub (drop) length leading from each device to the bus. The stub should
not exceed 5 centimeters. Ideally, the main cable must be run in and out of the
networked device as shown below. The connectors MJ10-22-CS66 (V120 and M91
series) and MJ10-22-CS65 (V2xxx series), shown below, enable this to be easily
accomplished.

Do not cross positive (A) and negative (B) signals. Positive terminals must be wired
to positive, and negative terminals to negative.
You must create network termination points by using the two end point devices
integrated into your network. The method of creating termination points varies
according to the controller series.

RS485, by controller type

RS485 is implemented differently in Unitronics' controllers, according to model type. These


options are summarized below.

Vision controllers are programmed using VisiLogic software. When Vision controllers are
networked via RS485, the COM ports must be initialized to the RS485 standard as
explained in COM Port: Init.

In addition, you must assign a unique Unit ID number to each controller, as explained in the
Help topic: Assigning a Unit ID number. Note that there is a range of ID numbers reserved
for RS485, numbers 64-127.

Vision 230/260/280

May be ordered with or without RS485 ports. A V2xx controller that is ordered containing an
RS485 port has a part number that ends in the number '1', for example: V2xx-1x-B21x1. If
your V2xxx controller does not have an RS485 port, you can order a port module, V200-19-
R4, and install it.

Note that the ports are not isolated. The connector type is RJ-45. RS485 termination
settings are determined via jumper.

475
VisiLogic Software Manual V330

If your V2xxx controller does not have an RS485 port, you can order a port module, V200-
19-R4, and install it. Installation instructions are provided together with the module when it
is ordered separately. The information below applies whether or not the RS485 port was
supplied with the V2xxx controller, or whether it is ordered and installed separately.

Network Termination Settings

The jumper settings shown above determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is YES, whether or not the
RS485 port was supplied already installed in the controller. If the OPLC is not a network
end device, set both jumpers to NO.

To open the controller in order to access the module and change the jumper settings, follow
the relevant instructions listed below.

1. Turn power off before opening the


controller.
2. Open the OPLC by inserting a
screwdriver into the slots located on
the sides of the controller as shown,
then carefully prying the cover off.
3. The RS485 ports location is
covered by plastic. Remove the
plastic covering by using a razor
cutter to cut through the tabs.

4. Locate the J3 connector.

476
FAQs

5. Install the module by placing the J1


connector (female) of the module onto the
J3 connector (male) in the controller.
6. Make sure that the connection is
secure.
7. Close the controller by snapping the
plastic cover back in its place. If the module
is correctly placed, the cover will snap on
easily.

Vision 120/ M91

Vision 120 series


Offers 2 serial communication ports. Each port can be adapted to either the RS232 or RS485
standard, via jumpers located within the controller and VisiLogic software settings. Note that
the ports are not isolated. The connector type is RJ-11. RS485 termination settings are
determined via jumper.
M91 series

An M91 that contains an RS485/RS232port has a part number that includes the number '4',
for example: M91-19-4UN2.

RS485 is via an RJ-11-type serial communication port. Each port can be adapted to either
the RS232 or RS485 standard, via jumpers located within the controller. The M91 is
programmed using U90 Ladder software.
The port mode is determined by SI 64, Set COM Port Mode, as described in the U90
Ladder help topic: COM Port Mode: RS232/RS485 (M91 only).

Note that the port is not isolated. RS485 termination settings are determined via jumper.
Vision 120/ M91 RS232/RS485 COM ports

The information below applies to both Vision 120 and M91 series controllers. The
controllers in these series offer RJ-11-type serial communication ports. Each port can be
adapted to either the RS232 or RS485 standard, via jumpers located within the controller.
In the case of the Vision 120, appropriate VisiLogic program settings are also required.

RJ-11 type port

The pinout below is of the RJ-11 type port, when the port is used for RS485.

Note When a port is set to RS485, both RS232 and RS485 can be used
simultaneously if flow control signals DTR and DSR are not used.

477
VisiLogic Software Manual V330

The ports are not isolated. If the controller is used with a non-isolated
Note external device, avoid potential voltage that exceeds 10V.
To avoid damaging the system, all non-isolated device ports should
relate to the same ground signal.

RS232/RS485 Jumper Settings

Use the jumper settings shown below to change the functionality of the controller's COM
port.

To open the controller and access the jumpers, refer to the instructions below.
RS485 Network Termination Settings

The jumper settings shown below determine whether the controller can function as an end
device in a RS485 network. Note that the factory default setting is ON. If the OPLC is not a
network end device, set both jumpers to OFF.

Opening the Controller

Before opening the controller, touch a grounded object to


discharge any electrostatic charge.
Note Avoid touching the PCB board directly by holding the PCB board
by its connectors.

1. Turn power off before opening the controller.


2. Locate the 4 slots on the sides of the controller.
3. Using the blade of a flat-bladed screwdriver, gently
pry off the back of the controller as shown.

478
FAQs

4. Gently remove the top PCB board:


Use one hand to hold the top-
most PCB board by its top
and bottom connectors as
shown.
With the other hand, grasp
the controller, while keeping
hold of the serial ports; this
will keep the bottom board
from being removed together
with the top board.
Steadily pull the top board
off.

5. Locate the jumpers shown in Figure 9, then change


the jumper settings as required.

6. Gently replace the PCB board as


shown. Make certain that the pins fit correctly
into their matching receptacle.
Do not force the board into
place; doing so may damage
the controller.
7. Close the controller by snapping the
plastic cover back in its place. If the card is
placed correctly, the cover will snap on easily.

M90

These controllers are programmed via U90 Ladder.

RS485 communications are enabled via an external RS232/RS485 converter, such as


Unitronics' M90-19-R4, which can be connected to the controller's RS232 port. No U90
Ladder software settings are required.

The M90-19-R4 RS485 port is isolated.

Note that since the M90-19-R4 is an external converter, it is also compatible with other
devices, such as PCs.

479
VisiLogic Software Manual V330

Vision / M91 RS485 Port Specifications

The specifications below apply to RS485 ports for all Vision and M91 controllers.

Input Voltage -7 to +12V differential max.

Cable type Shielded twisted pair, in compliance with EIA RS485

Cable length 1200m maximum (4000 feet)

Galvanic Isolation No

Baud rate 110 - 57600 bps

Complete specification for the M90-19-R4, which converts serial data from the RS232
standard to either RS422 or RS485, is located on the Setup CD. It is also available from
your local Unitronics distributor. This module is recommended for use with M90 controllers
and other devices.

User safety and equipment protection guidelines

This information is intended to aid trained and competent personnel in the installation of this
equipment as defined by the European directives for machinery, low voltage, and EMC.
Only a technician or engineer trained in the local and national electrical standards should
perform tasks associated with the devices electrical wiring.

Before using a Unitronics' product, it is the responsibility of the user to read and understand
this document and any accompanying documentation.

Symbols are used to highlight information relating to the users personal safety and
equipment protection throughout this document. When these symbols appear, the
associated information must be read carefully and understood fully.

Under no circumstances will Unitronics be liable or responsible for any consequential


damage that may arise as a result of installation or use of equipment, and is not
responsible for problems resulting from improper or irresponsible use of Unitronics
devices.
All examples and diagrams shown are intended to aid understanding. They do not
guarantee operation.
Unitronics accepts no responsibility for actual use of a product based on these
examples.
Only qualified service personnel should open a device or carry out repairs.
Please dispose of this product in accordance with local and national standards and
regulations.
Failure to comply with appropriate safety guidelines can result in
severe personal injury or property damage. Always exercise proper
caution when working with electrical equipment.
Check the user program before running it.
Note Do not attempt to use a device with parameters exceeding
permissible levels.
Install an external circuit breaker and take appropriate safety

480
FAQs

measures against short-circuiting in external wiring.


To avoid damaging the system, do not connect or disconnect a
device when the power is on.
Do not touch live wires.
Double-check all the wiring before turning on the power supply.

Modems

To enable a Vision controller to communicate via standard or GSM modem:

1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally performed once in a program. It is usually a power-
up task, however a one-shot transitional contact may also be used.
Communications cannot flow through the port during initialization.

2. Place the conditions and elements in your Ladder program.


Note Communications cannot flow through the port during initialization. To
avoid conflicts in your program, use the Modem Initialization Status SBs.

Modem status can be checked via the System Bits listed below.

SB Description

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

481
VisiLogic Software Manual V330

85 Modem Initialized Failed: COM 3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

3. Connect the modem.

482
FAQs

Note If call are routed via a switchboard, note that the switchboard settings may interfere
with communications. Consult with your switchboard provider.
PC/PLC modem communications: Both PC and controller must use the same type
of modem: either landline or GSM. Internal PC modems must be used in conjunction with
the driver provided by the modem's manufacturer.
Examples

To locate application examples, select Examples from the Help menu.

SMS messaging.vlp

PLC Programming via Modem: Remote Access

Use a PC linked to GSM or landline modem to access a remote controller and:

Download and upload applications.


Test and troubleshoot problems in remote controllers and applications.
To remotely access a controller:

483
VisiLogic Software Manual V330

Note The PC-modem cable is not the same type of cable used to connect between
the controller and the modem. Ensure that the cable used to connect the PC
to the modem provides connection points for all of the modem's pins.
Note If calls are routed via a switchboard, note that the switchboard settings may
interfere with communications. Consult with your switchboard provider
Note If, within the modem initialization strings, the parameter S7 TimeOut, is to
short to permit the PLC's modem to answer, an error will result.
For example, if this parameter is set as S7=30, the PC modem will wait for 3
seconds to receive an answer from the PLC's modem. If, however, the PLC
program's COM Init FB Answer Settings are set to 'Answer after 6 rings,' the
PLC modem will not be able to answer before the 3 seconds have elapsed. In
this case, the TimeOut parameter is exceeded, and the PC modem will return
the No Carrier error.
Note PC/PLC modem communications: Both PC and controller must use the same
type of modem: either landline or GSM. Internal PC modems must be used in
conjunction with the driver provided by the modem's manufacturer.

Controller Setup

1. Initialize the port using a COM Init FB, located on the FBs menu.
Note COM Init is generally a power-up task, however a one-shot transitional
contact may also be used.

2. Place conditions and elements in your Ladder program.

484
FAQs

3. Connect the modem.

485
VisiLogic Software Manual V330

PC Modem Setup

Open PC Modem Configuration from the Connection menu.

Note If, within the modem initialization strings, the parameter S7 TimeOut, is to short to
permit the PLC's modem to answer, an error will result.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to
receive an answer from the PLC's modem. If, however, the PLC program's COM Init FB
Answer Settings are set to 'Answer after 6 rings,' the PLC modem will not be able to answer
before the 3 seconds have elapsed. In this case, the TimeOut parameter is exceeded, and
the PC modem will return the No Carrier error.

Exceed the SMS phone book 8 number limit?

486
FAQs

In the SMS Configuration Phone Book, use a vector of registers to indirectly dial a number.

Dialing from the Controller's Keypad

If your controller is hooked up to a modem, a phone number may be dialed from the
controller's keypad. This explanation is based on a sample application that is installed on
your hard disk together with VisiLogic. To open this application, open the Help menu, click
Examples, and then select Dialing via Vision Keypad.

About the Application

When downloaded, this application:

Displays a blinking cursor on-screen. This aids the user in entering a phone number
by pressing keys on the Vision keypad.

'Converts' the entered numbers to ASCII, then saves them, as they are entered, into
a vector of registers that starts at MI 1011, the Phone Entry vector. One ASCII
character is entered into the low byte of each register.

A Transpose function is linked to the vector starting at MI1011. Transpose copies the
low byte of each register in that vector, and stores it into the consecutive bytes of a
vector that starts at MI 1001, the Phone Number Vector. For example, Transpose can
extract the low bytes from MI 1011,1012, 1013 & 1013 and store all 4 bytes into MI
1001 and 1002.

Displays the numbers as they are entered, via the HMI variable Display ASCII String,
which displays the Phone Number vector starting at MI 1001.

The character Carriage Return (ASCII value 13) is required by the modem as the final
character in the number to be dialed. When the user has finished entering the number
and presses Enter, the Carriage Return value is stored as the final character in the
vector that provides the phone number.

Finally, the number us dialed via a Dial FB. The FB dials the number contained in the
vector of registers starting with MI 1001, Phone Number vector.
Note In order to understand how this application works, you must be familiar with the
Vector: Fill (Offset) and Vector: Transpose functions.

Ladder

Initializing the COM port

The application is based on the Wavecom GSM modem. The Vision-to-modem connection
is via COM 2.

The net shown below is the first net of the main program module. When COM 2 is
initialized, SB 82 Modem Initialized: COM 2 turns ON; this condition activates the Dial
function in the next subroutine, Enter Phone Number.

487
VisiLogic Software Manual V330

Building the Cursor

The ASCII values for 'underscore' and 'blank space' are alternately stored into MI 1008 at .5
second intervals. The current value is copied into the Phone Entry vector starting at MI
1011, via a Vector: Fill Offset FB.

The offset value is provided by a counter that increments after every number entered. The
offset values ensures that the cursor value is included as the last character in that vector.

Every time a value is entered, Vector: Transpose copies the low bytes of the Phone Entry
vector, which contains the ASCII values, to the Phone Number vector starting at MI 1001.

En te ring numbe r s: 'Con ve r t' to AS CII

488
FAQs

When a key is pressed, its value is automatically stored into SI 6. In this application,
whenever keys 0 to 9 are pressed, the value stored in SI 6 is 'converted' to an ASCII value
by adding the constant value 8. The ASCII value can then be displayed. For example, if
Key#4 is pressed, the value in SI 6 will be 44 (HEX 2C). Adding 8 'converts' the value to
52 (HEX 34), which is the ASCII value for 4. 4 can then be displayed on the screen.

Note MI 1010 is incremented whenever a legal value is entered. The incrementing value
acts as a pointer, correctly placing entered numbers in the Phone Number vector.

Placing entered numbers in the Phone Number vector

Using the incrementing value of MI 1010 as a pointer, the Fill Vector function places each
'converted' number into the correct register in the Phone Entry vector, starting at MI 1011, .

Via the Transpose function, the low byte of each register in the Phone Entry is copied into
the Phone Number vector as shown in the figure below.

Dial and Hang-up

489
VisiLogic Software Manual V330

The Dial function is linked to the Phone Number vector starting with MI1001. This vector is
also displayed on the controller's screen.

Note Since the Enter key is pressed when the user has finished entering the number,
SB 53 is used as one of the Dial conditions, as is SB 82 Modem Initialized.
SB 87 Modem connected is used to activate the Hangup function, and to display
text on the controller screen.

HMI Display

This application contains 1 display with 3 variables.

Disconnected\Connected: Binary Text variable

Show the phone number: Display ASCII String

This variable is refreshed in the Ladder application via MB 1000 Display String on HMI.

490
FAQs

Save, Dial, Hangup?

While the number is being entered, the text Save will be displayed. Once the number has
been entered, the status of SB 87 Modem connected determines whether Dial or Hangup
will be displayed.

491
VisiLogic Software Manual V330

Using Hyperterminal for COM Troubleshooting

You can use a standard Windows application called Hyperterminal to perform certain tasks,
such as changing a modems communication rate.

Note The modem driver does not need to be installed in order to access the modem via
Hyperterminal.

Modem Connections

This is the interface between the Data


Communications Equipment (DCE; the
modem) and the Data Terminal Equipment
(DTE; the controller or PC). The arrows
below show the direction of data flow.
Note Unitronics controllers do not
support the control lines. This is
why the DTE side of the table
comprises only 3 pins.
Note Since the DSR can be
permanently set to ON,
connecting it to the RTS causes
the terminal always be ready to
transmit\receive data.

Data Flow Direction

Generally, when you transmit data, you send it out. Note, however, that transmitted data
(TXD) is input to the DCE. A Receive Data signal (RXD) is input to the DTE, but output
from the DCE.

Therefore, the RXD and TXD signals are crossed within the majority of modems. This
means that a straight through "one to one" cable is generally all that is necessary between
a modem and a controller or PC serial port.
RS-232 signal information

RXD Input for DTE devices (Receive), output for DCE devices. This is
Receive Data the data channel from the DCE device to the DTE device.
T XD Output for DTE devices (Send), input for DCE devices. This is the
Transmit Data data channel from the DTE device to the DCE device.
GND Signal return for all signal lines.
Signal Ground
RTS Terminal is ready to receive data. W hen the DTE is ready to receive
Request To data, the DTE serial port RTS signal is ON.
Send
CTS Terminal is ready --not related to data transfer.
Clear To Send
DTR It is an output for DTE devices and an input for DCE devices. This
Data Terminal signal is typically used in UNIX to show that the port has been
Read activated or "opened".
DSR Detects if the RS232 is actually connected.
Data Set Ready
DCD T u r n s O N wh e n t h e m o d e m s c o n n e c t .
Data Carrier
Detect
RING T u r n s O N wh e n s o m e o n e i s c a l l i n g t h e D T E .

Cable Pin-out
The Unitronics cable provided with modem kits does not provide a standard connection. This
connection is adapted to support the fact that Unitronics controllers do not support the control

492
FAQs

lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is
always ready to receive data.

Using Hyperterminal

1. Open Hyperterminal. The program can generally be located by clicking the Start
button in the lower left corner of your screen, then selecting
Programs>Accessories>Communications>Hyperterminal. The New Connection
window opens as shown below.
Note Hyperterminal generally starts by pointing to the internal modem, if one is
installed on the PC.

493
VisiLogic Software Manual V330

2. Enter a name for the new connection and select an icon, and then click OK. The
Connect To box opens .
3. Select a COM port for the modem, and then click OK.

4. The Port Settings box opens as shown below. To enable your PC to communicate
with the modem, set the COM port parameters to a BPS of either 9600 or 19200, Data bits=8,
Parity=N, Stop bits=1, Flow control=None, and then click OK.

5. Open the modems Properties box by clicking on the Properties button, then open
ASCII Setup.

494
FAQs

6. Select the options shown below, and then click OK.

Hyperterminal is now connected to your PC via COM 1; the ASCII settings now enable you
to enter commands via the PC keyboard and see the replies from the modem within the
Hyperterminal window.

To test the connection, type AT; if the connection is valid the modem will respond 'OK'.

To change the modems baud rate, type AT+IPR=19200&W; the command '&W' burns the
new baud rate into the modem's non-volatile memory.

495
VisiLogic Software Manual V330

Typical initialization strings used with an Siemens M20-type modem are shown below.

Modem Commands

Note The modem must reply with either OK or READY to each command entered. If the
modem fails to answer, the command has not been processed.

+++ Escape Sequence. This causes the modem to close connections and go back
to command mode
AT This command means Attention; and is used to begin a session
AT&F Restores factory default settings
ATZ Resets the modem. This command may take time to implement, so the
response from the modem may be delayed
ATE0 No Echo
V1 Enable Verbose (long) response
Q0 Respond
X4 Detailed answers
&D0 Ignore DTR
&D2 Once DTR falls, disconnect and go to command mode
&D1 Once DTR falls, disconnect
&S0 DSR always ON.
Since the DSR can be permanently set to ON, connecting it to the RTS
causes the terminal always be ready to transmit\receive data
&S1 DSR OFF in command and test modes
&C1 Give the user a signal for the DCD
&C0 Dont give the user a signal for the DCD (refers to LED indications where
relevant)
ATS0=1 Auto-Answer after 1 ring
S0=0 M o d e m d o e s n ' t a n s we r . F o r c e s P L C t o a n s we r wi t h A T A ( p i c k u p )
S10=15 Sets the time ( in units of 0.1 sec) from the time when CD is not detected,
u n t i l t h e s t r i n g N O C A R R I E R i s s h o wn . I f t h e v a l u e i s 2 5 5 , t h e n t h e C D
signal will not falleven if the modems are no longer connected
S7=30 T i m e O u t : I f t h i s t i m e i s e xc e e d e d , t h e m o d e m n o t i f i e s t h a t d i a l h a s f a i l e d

496
FAQs

S12 The modem register that defines the time interval during which the line must
remain clear, before and after the +++ command.
&W Burn the configuration into the m odem s non-volati le m em ory
Initializing the modem to SMS mode via Hyperterminal

Once the modem is successfully initialized, you can use Hyperterminal to initialize the
modem to SMS mode.

Command Description Notes


at+cpin=? Is a pin number required?
at+pin=xxxx Is the pin number set in the
xxxx application?
at+creg? Has the SIM card been S h o u l d r e t u r n o n e o f t wo a n s we r s :
r e g i s t e r e d wi t h t h e l o c a l +CREG: 0,1
cellular provider? T h e S I M i s r e g i s t e r e d wi t h i t s l o c a l
provider.
+CREG: 0,5
The SIM is in roaming mode.
at+cmgf=1 G o t o t e xt m o d e

Notes Commands including question marks are run for verification twice. If the
command is not verified during the second attempt, the attempts stop.

Notes If the SIM requests the PUK number, the SIM must be taken out of the
modem and installed into a phone to enable the number to be entered.
Notes If the SIM is full, the SIM must be taken out of the modem and installed into a
phone to enable the SIM to be cleared.
Notes The modem must be able to support Text mode. P.D.U. mode is not
supported.
When a controller sends an SMS text message

It uses the Send command, containing the number to be called: AT+CMGS= phone
number.
The controller then waits for the reply '>'.
When the '>' is received, the controller sends the message, ending the line with
CTRL_Z
If the message is successfully sent, the controller will receive a message of
confirmation,+CMGS:xx. When this message is received by the controller, SB 184
turns ON. The confirmation message is acknowledged by OK.

497
VisiLogic Software Manual V330

If :
the message of confirmation is not received within 15 seconds, or
the '>' is not received within 3 seconds, SB 185 turns ON.
When the controller receives an SMS text message:

It receives the command: +CMTI: SM ,xx. Xx is a number in the controller's


memory, 1 to 20.
When the message is received, the controller asks the modem for the text via the
command AT+CMGR=xx
The modem replies with +CMGR, including the phone number, status, text, and
concluding with OK.
Note When a COM port has been successfully initialized, the relevant bit turns ON:
SB 80 , 82, 83 or 84.
If initialization fails, SB 81, 83, 85, or 87 will turn ON.
'The Sniffer'--Viewing communication strings

The instructions below show you how to construct a communications 'Sniffer'. This device
enables you to use Hyperterminal to view communication strings flowing between a PLC
and an external, connected device such as a bar code reader.

Sniffer is
COM is
connected
connected
to the
to the
external
PLC.
device.

The completed
Sniffer is
connected to a
PLC
communication
port, PC and
external
device.

Note that
communication
cables are the
programming
cable provided
by Unitronics.

To make a Sniffer, you need:

An adapter.
Two 1N4148 or 1N914 diodes.

498
FAQs

1. Open
the
adapt
er
carefu
lly via
the 4
snaps
in its
sides.

2. Cut the
red and
green
wires as
shown
below.

3. Solder
one diode
to the red
wire, and
one diode
to the
green
wire.
The
soldered
point
provides
the anode.

4. Put
isolating
material
on the
soldered
points.

499
VisiLogic Software Manual V330

5. Solder
both
diodes
cathodes
to the red
wire.

6. Put
isolating
material on the
solder.
7. Close
the
Sniffer.
8. Label
the connectors
as shown.

Note In order to run view the strings in Hyperterminal, you must set the program to
display ASCII strings as described above in Using Hyperterminal.

500
Troubleshooting

Detecting Short-circuited End Devices


The controller can detect short circuits in end devices (loads) that are connected to
transistor outputs located on snap-in or expansion I/O modules. Short circuits can also be
detected in end-devices connected to analog outputs.

If a short circuit is detected on either an expansion or snap-in I/O module, SB 5 turns ON.

If the short circuit is located on an:

I/O expansion module, the location is indicated in SDW 5.


Snap-in I/O module, the LSB in SDW 6 turns ON.
SDW 5 provides a bitmap. Each I/O expansion module included in your controller's
hardware configuration is assigned a number, 0-7, according to its place in that
configuration. In the bitmap, bits 0-7 correspond to these place numbers.

V120 only

Bit 8 within SDW 5 is reserved for the controller. A value of '1' indicates that the short-circuit
has been detected in an on-board V120 output.

In the bitmap below, short circuits have been detected in devices that are connected to
expansion modules 1 and 3, and to the V120 itself.

SDW 5
(Please note that although an SDW is 32 bits long, only 16 bits are shown below.)

Why does the Controller display the 'Restart' message?


The most common reason for this event is a peak in electromagnetic (EMF) 'noise'. This
may result from contactors, power relays, solenoid valves, etc. switching on and off, as well
as from power transformers and motor speed drivers.

Recommendations

Use different power supplies - highly recommended - one for the controller (CPU and
inputs), and a different one for other electromagnetic devices;
Use suppressors - reverse connected diodes for DC loads and RC filters for AC
loads;
Where possible, place the signal cables, including the 24V power supply, far away
from power lines, especially from cables, coming in and out of motor drivers;
If needed, use shielded cables for signals, including for 24 VDC and for power cables
between the motor driver and the motor itself.
Taking these precautions should help prevent ' Controller Restart'. If the problem persists,
contact
support@unitronics or your local Unitronics representative.

On-Line Test Mode (Debug)

501
VisiLogic Software Manual V330

To test a project, first connect the controller to your PC using the program download cable
provided with the software package, then download the project and click the On-Line Test
button.

Note The controller can send and receive SMS messages when the controller is in Test
mode.

Power-up Modes: Trouble-shooting


You can force the controller to enter Bootstrap or Stop mode by turning on the power
supply while pressing specific keypad keys.

Mode Features Possible Actions V120 V230/260 V280

Bootstrap The controller's Via Vision <I> + <I> + <I> +


LCD is on. Communication PC <ESC> <Right <Right
Settings, you can: Arrow> Arrow>
PC-PLC
communications C h e c k wh i c h O S
are enabled, but is currently
PC must be installed in the
connected to controller.
COM 1. Download a new
OS.

Stop As in Bootstrap, but As above, but all Info <I> <I> <I>
(O/S) Info mode can be mode actions are
entered. supported.
Exit Stop Mode by
entering Information
Mode, and then
selecting
System >W orking
Mode> Reset.

Bootstrap, Contrast range is 0- <I> + <I> +


default 100, this option <ESC> <Right

502
Index

LCD automatically sets + Arrow>


contrast Contrast to 50. <+/-> +
<+/->

Stop Contrast range is 0- <I> + <I> +


(O/S, 100, this option sets <+/-> <+/->
default Contrast to 50.
LCD
contrast

I/O Expansion Module Errors


An interruption in communication between an I/O expansion module and controller can
cause the controller to enter Stop Mode, and an Expansion Error message to be displayed
on the controllers LCD.

This error results when:

1. The module was connected at power-up.


2. The communication between module and controller was interrupted for more than
200 milliseconds. Interruptions may occur if the connecting cables are disconnected,
or may result from signal interference (noise).
Note When a controller enters stop mode, the program stops running and all outputs
within the system are initialized. This includes on-board outputs, outputs located on Snap-
in I/O modules, and outputs located I/O expansion modules.

What to do

Check that the cables are connected and in proper order.


Remedy signal interference. Such an error may also result from a hardware
malfunction.
If the RUN LED on the expansion module blinks, check the documentation supplied
with the expansion module to see if a hardware error is indicated.
To exit Stop Mode, reset the controller either by turning it off and on, or by entering
Information Mode, and then selecting System>Working Mode> Reset.

Compile
When you compile your program, you can see any errors in the Output Window.

Clicking the Compile tab displays the last compiled results.

HMI Element Resizing Limitations


Elements 'grow' down, and to the right. If resizing will cause Variable elements to collide, or
any element to extend beyond the boundaries of the Display, the element cannot be
returned to its original size, or resized to a larger size.

503
VisiLogic Software Manual V330

Note 'Original size' is the actual size of the element as it appears in the element's
ToolTip.
Fit to Original Size does not affect geometric shapes that are drawn on the Display.
'Original size' cannot be used to resize Variable elements if the elements have
different original sizes.

Although an imported image can be resized, resizing may result in some degree of
distortion. To avoid this, use images that are created to match the required size.
Resizing text elements changes the size of the text field, but does not affect font size.
Shapes that are imported are resized in proportion to their original size.

Float Errors
When an Float function error occurs, SB 10 Float Error turns on. This SB is reset by the
user.

The error code is stored in SI 500 General Error. The codes are shown below.

Value Message Result

3 Integer 7FFF or 8000 (integer result)FFFF or 0000(unsigned


Overflow integer result)

4 Floating +INF or -INF (float result)


Overflow

5 Floating 0.0 (float result)


Underflow

7 Divide by +INF or -INF or NaN (float result)


Zero

9 Undefined NAN (float result)


Float

10 Conversion 0 (integer result)

504
Index

Error

11 Floating point Floating point stack underflow


Stack
Overflow

12 Floating point Floating point stack overflow


Stack
Underflow

INF Infinite which is the largest absolute floating point number.

NAN Not a Number, special notation for undefined floating point number.

Changing Panel Types: Conflicts


If a project contains Displays, selecting a different panel type in your project's Hardware
Configuration may cause you to lose some of your Display elements and their properties.

If you select a smaller panel, some of the elements in your Displays may be too large. In
this case, any variable, graphic, or text elements that extend beyond the edge of the screen
will be deleted from your project, and may not be retrieved.

In addition, note that all calendar variables will be deleted.

Also, note that if you change from a touch panel to a non-touch panel, any 'touch'
properties linked to on-screen objects will be deleted.

Insufficient Flash Memory


This error message is displayed when the PLC does not have sufficient memory to handle
the current project. To see the memory requirements of the project, click the Events tab in
the Output Window at the bottom of the screen.

Communications
CANbus Network Problems
SI 237 CANbus Network: Failed Unit ID contains a bitmap showing the network ID number
of the unit in error. SI 236 CANbus Network Communication Error Code contains the index
of the error message.

Value Message

1 No Acknowledgement

2 CANbus OFF

4 CANbus Warning error

505
VisiLogic Software Manual V330

10 SC receiving TimeOut

Problem Possible cause R e c o m m e n d e d Ac t i o n

Failed Baud rate All controllers in the network must be set to the
communication settings same CANbus baud rate. Baud rate may be set:
By initializing a port via the COM Init FB.
Temporarily via Info mode;however, note
t h a t t h e b a u d r a t e wi l l b e r e s e t a t t h e n e xt
power-up

Termination Termination resistor settings are provided in the


resistors chapter Communications in the controller's user
guide.

CANbus power Check that the CANbus power supply is properly


supply connected, and that the voltage is in the permissible
range as described in the chapter Communications in
the controller's user guide.

Incorrect ID You may not have assigned the correct unit ID


number number in your operand addresses (between 1-63).
C h e c k t h e O P L C s e t t i n g s t a b C o m m u n i c a t e wi t h
OPLC.

PC cannot Incorrect setting W h e n y o u c o m m u n i c a t e wi t h t h e c o n t r o l l e r u n i t t h a t


communicate y o u a r e u s i n g a s a b r i d g e t o t h e n e t wo r k , e i t h e r
with bridge enter the ID# of the bridge or select Direct
Connection in the OPLC settings tab Communicate
with OPLC.

PC cannot Communication Make sure the current RS232 parameters in your


communicate settings project are the same as the parameters that are
w i t h n e t wo r k actually in the bridge. Check these topics:Check
Network Status,Vision Communication PC Settings

Incorrect baud The bridge's RS232 port's baud rate cannot be set
rate below 9600.

MODBUS Error Table


Error Error Message
#

0 No Errors

1 Illegal Function

2 Illegal Data Address

3 Illegal Data Value

4 Master--Time Out

5 No Communication

6 Mismatched Unit ID

7 Mismatched Command

8 Length of message

9 Function not supported

10 Illegal format

11 Mismatched received
data

506
Index

Modem Troubleshooting
General Information

Note The PC-modem cable is not the same type of cable used to connect between
the controller and the modem. Ensure that the cable used to connect the PC
to the modem provides connection points for all of the modem's pins.
Note If calls are routed via a switchboard, note that the switchboard settings may
interfere with communications. Consult with your switchboard provider
Note If, within the modem initialization strings, the parameter S7 is too short to
permit the PLC's modem to answer, an error will result.
For example, if this parameter is set as S7=30, the PC modem will wait for 3
seconds to receive an answer from the PLC's modem. If, however, the PLC
program's COM Init FB Answer Settings are set to 'Answer after 6 rings,' the
PLC modem will not be able to answer before the 3 seconds have elapsed. In
this case, the S7=30 parameter is exceeded, and the PC modem will return
the No Carrier error.
Note PC/PLC modem communications: Both PC and controller must use the same
type of modem: either landline or GSM. Internal PC modems must be used in
conjunction with the driver provided by the modem's manufacturer.

Modem commands
Note The modem must reply with either OK or READY to each command entered. If the
modem fails to answer, the command has not been processed.

+++ Escape Sequence. This causes the modem to close connections and go back
to command mode
AT This command means Attention; and is used to begin a session
AT&F Restores factory default settings
ATZ Resets the modem. This command may take time to implement, so the
response from the modem may be delayed
ATE0 No Echo
V1 Enable Verbose (long) response
Q0 Respond
X4 Detailed answers
&D0 Ignore DTR
&D2 Once DTR falls, disconnect and go to command mode
&D1 Once DTR falls, disconnect
&S0 DSR always ON.
Since the DSR can be permanently set to ON, connecting it to the RTS
causes the terminal always be ready to transmit\receive data
&S1 DSR OFF in command and test modes
&C1 Give the user a signal for the DCD
&C0 Dont give the user a signal for the DCD (refers to LED indications where
relevant)
ATS0=1 Auto-Answer after 1 ring
S0=0 M o d e m d o e s n ' t a n s we r . F o r c e s P L C t o a n s we r wi t h A T A ( p i c k u p )
S10=15 Sets the time ( in units of 0.1 sec) from the time when CD is not detected,
u n t i l t h e s t r i n g N O C A R R I E R i s s h o wn . I f t h e v a l u e i s 2 5 5 , t h e n t h e C D
signal will not falleven if the modems are no longer connected
S7=30 Time-out: If this time is exceeded, the modem notifies that dial has failed
S12 The modem register that defines the time interval during which the line must
remain clear, before and after the +++ command.
&W Burn the configuration into the m odem s non-volati le m em ory.
Note This is part of the COM Init FB's modem default initialization
strings.

PC-side modem, error messages


This deals with errors that may result from the PC's modem

507
VisiLogic Software Manual V330

Message Cause
COM Port not The PC was unable to access the PC port.
open, or modem The port may:
does not exist -Already be in use.
-Be damaged.
Modem not T h e P C r e c e i v e s n o r e p l y f r o m t h e m o d e m f o l l o wi n g t h e ' A T ' c o m m a n d .
connected Check that:
-The modem is connected to the same PC port you have defined in
PC-modem Configuration.
-The PC-modem cable is in proper order.
Modem not T h e m o d e m wa s n o t s u c c e s s f u l l y i n i t i a l i z e d .
initialized Check the topic: Using Hyperterminal for Modem Troubleshooting
The messages below describe the modem 's status if the PC dial attempt (ATD+ number)
fails. Any one of these errors aborts the Dial process.
Modem Busy
Modem Error
No Dial Tone
No Carrier Note This can occur if, within the modem initialization strings, the
parameter S7 TimeOut, is to short to permit the PLC's modem to
a n s we r .
F o r e x a m p l e , i f t h i s p a r a m e t e r i s s e t a s S 7 = 3 0 , t h e P C m o d e m wi l l
wait for 3 seconds to receive an answer from the PLC's modem. If,
however, the PLC program's COM Init FB Answer Settings are set to
' A n s w e r a f t e r 6 r i n g s , ' t h e P L C m o d e m wi l l n o t b e a b l e t o a n s w e r
before the 3 seconds have elapsed. In this case, the TimeOut
p a r a m e t e r i s e xc e e d e d , a n d t h e P C m o d e m wi l l r e t u r n t h e N o C a r r i e r
error.
Dial time-out N o r e p l y w a s r e c e i v e d f r o m t h e m o d e m wi t h i n t h e d e f i n e d t i m e .
e xc e e d e d
The messages below only relate to unsuccessful GSM modem initialization.
GSM SIM card
blocked
GSM SIM card
does not exist
Illegal GSM PIN
code
G S M N e t wo r k n o t
found
Time-out
e xc e e d e d

PLC modems
These errors may result from problems in the PLC-side modem

Message Possible cause Recommended action

Modem Busy Modem is Check that the line is free.


engaged, Use the SBs: Modem Initialization Status
or is being listed above to check the COM port status;
initialized communications cannot flow through the port
during initialization. For more information check
the topic COM Port Init.

Handshake between Modem Check the PLC-to-modem connection and pin-


m odem s com plete adapter cable out, particularly that the DSR is connected to
('CONNECT'), the RTS on the modem side.
PLC does not reply

Problem SI Value (80, 82, Possible Cause & Recommended Action


84)

Modem fails to 3 PLC-to-modem cable:


initialize (SB 81, 83, Make sure that the cable is securely connected.
85 ON) Check the modem connection and pin-out of the
PLC-to-modem adapter cables. Note that if you
use cables comprising this pin-out, you must set
the parameter Flow Control to N (none) in the
COM Port Init FB.

508
Index

Incompatible communication settings.


Most modems automatically match the
parameters of incoming data: baud rate, data
bits, parity & stop bits. You may need to
m anually change your m odem 's comm unication
settings.

0 You may have selected the wrong type of modem


in the COM Port Init FB.

Modem Connection
This is the interface between the Data
Communications Equipment (DCE; the
modem) and the Data Terminal Equipment
(DTE; the controller or PC). The arrows
below show the direction of data flow.
Note Unitronics controllers do not
support the control lines. This is
why the DTE side of the table
comprises only 3 pins.
Note Since the DSR can be
permanently set to ON,
connecting it to the RTS causes
the terminal always be ready to
transmit\receive data.

Data Flow Direction

Generally, when you transmit data, you send it out. Note, however, that transmitted data
(TXD) is input to the DCE. A Receive Data signal (RXD) is input to the DTE, but output
from the DCE.

Therefore, the RXD and TXD signals are crossed within the majority of modems. This
means that a straight through "one to one" cable is generally all that is necessary between
a modem and a controller or PC serial port.

RS-232 signal information

RXD Input for DTE devices (Receive), output for DCE devices. This is
Receive Data the data channel from the DCE device to the DTE device.
T XD Output for DTE devices (Send), input for DCE devices. This is the
Transmit Data data channel from the DTE device to the DCE device.
GND Signal return for all signal lines.
Signal Ground
RTS Terminal is ready to receive data. W hen the DTE is ready to receive
Request To data, the DTE serial port RTS signal is ON.
Send
CTS Terminal is ready --not related to data transfer.
Clear To Send
DTR It is an output for DTE devices and an input for DCE devices. This
Data Terminal signal is typically used in UNIX to show that the port has been
Read activated or "opened".
DSR Detects if the RS232 is actually connected.
Data Set Ready
DCD T u r n s O N wh e n t h e m o d e m s c o n n e c t .
Data Carrier
Detect
RING T u r n s O N wh e n s o m e o n e i s c a l l i n g t h e D T E .

Cable Pin-out

509
VisiLogic Software Manual V330

The Unitronics cable provided with modem kits does not provide a standard connection. This
connection is adapted to support the fact that Unitronics controllers do not support the control
lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is
always ready to receive data.

GSM modems

Problem SI Value (81, 83, 85) Possible Cause & Recommended Action

Wrong PIN number 3 Check the PIN number in the COM Port Init
FB; leave it empty if your SIM card has no PIN
number.

Failed Registration 4 GSM modem did not register successfully, for


e xa m p l e i f n o n e t wo r k wa s f o u n d , o r i f t h e
modem antenna is not functioning.

PUK number needed 5 The SIM card is locked due to too many
attempts to enter an incorrect PIN number.

Problem Possible Cause & Recommended Action

Cell phone does not Check the cell phone's SIM card; it may be full. You can clear
receive message the SIM card using the Clear option in the COM Port Init FB.

Modem Status & Error Messages


You can check the status of the System Bits and Integers either via ON-line Test Mode or
Information Mode. .

SBs: Modem Initialization Status

Modem status can be checked via the System Bits listed below.

SB Description

510
Index

80 Modem Initialized: COM 1

81 Modem Initialization Failed: COM 1

82 Modem Initialized: COM 2

83 Modem Initialized Failed: COM 2

84 Modem Initialized: COM 3

85 Modem Initialized Failed: COM 3

86 Modem Connection Stat us: COM 1

87 Modem Connection Stat us: COM 2

88 Modem Connection Stat us: COM3

120 DTR COM 1

122 DTR COM 2

124 DTR COM 3

SBs: Modem Status

SB 86 Modem Connection Stat us: COM 1


SB 87 Modem Connection Stat us: COM 2
SB 88 Modem Connection Stat us: COM 3

SBs: Success / Failure of SMS message transmission

SBs 184 and 185 are automatically turned OFF by the PLC when a Send SMS FB is called
by the program; the appropriate one turns ON to signal transmission status.

SB Description

184 SMS: Transmission succeeded

185 SMS: Transmission Failed

SIs: Modem Error & Status Messages

COM Port
SI Modem Status: COM 1
80 Modem Error (SI 81,83,85,) Modem Status ( SI 80, 82, 84,
86,87,88)
SI Modem Error Code: COM 1
81
Value Message Value Message
SI Modem Status: COM 2
82
0 No error 0 Modem Idle
SI Modem Error Code: COM 2
83
1 TimeOut time 1 Initialization in
SI Modem Status: COM 3 e xc e e d e d : n o Progress
84 reply
SI Modem Error Code: COM 3
85 2 Reply Error 2 Initialization OK
SI Modem Connection Stat us:
86 COM 1 3 Wrong PIN 3 Initialization
SI Modem Connection Stat us: number Failed
87 COM 2

511
VisiLogic Software Manual V330

SI Modem Connection Stat us:


88 COM 3 4 Registration 4 Modem
failed Connected

5 PUK number 5 Hang-up in


needed progress

10 COM Busy 6 Dial in progress

11 Reply Busy

12 Reply No Dial

SMS Error Messages

SMS Configuration errors

The error code will be placed in the SMS Configuration's Error Status MI.

Value Message

0 No error

1 Message received f rom a phone number that is not in the phone book, or the
number is not in the correct format

2 (Send only) Non-existent SMS message index number

3 SMS received from unauthorized phone number

4 (Scan only)The SMS message received does not exis t in the SMS configuration

5 M o d e m T i m e O u t t i m e e xc e e d e d : n o r e p l y

6 (Scan only) Received Variable Mismatch.


Variable:
Does not exist in the SMS configuration, or
Is not in the correct format, or
E xc e e d s t h e r a n g e s e t f o r t h e v a r i a b l e
7 Modem Reply Error

8 Unknown Modem Reply

9 (Send only)Either the phone number or the SMS message is in the incorrect
format and may not be transmitted

Send FB error indication

Indicates an illegal phone number format.

512
Index

SDW: Last Received SMS

SDW Description

13 Phone number of last received SMS (last 8 digits)

Using Hyperterminal for COM Troubleshooting


You can use a standard Windows application called Hyperterminal to perform certain tasks,
such as changing a modems communication rate.

Note The modem driver does not need to be installed in order to access the modem via
Hyperterminal.

Modem Connections

This is the interface between the Data


Communications Equipment (DCE; the
modem) and the Data Terminal Equipment
(DTE; the controller or PC). The arrows
below show the direction of data flow.
Note Unitronics controllers do not
support the control lines. This is
why the DTE side of the table
comprises only 3 pins.
Note Since the DSR can be
permanently set to ON,
connecting it to the RTS causes
the terminal always be ready to
transmit\receive data.

Data Flow Direction

Generally, when you transmit data, you send it out. Note, however, that transmitted data
(TXD) is input to the DCE. A Receive Data signal (RXD) is input to the DTE, but output
from the DCE.

Therefore, the RXD and TXD signals are crossed within the majority of modems. This
means that a straight through "one to one" cable is generally all that is necessary between
a modem and a controller or PC serial port.

RS-232 signal information

RXD Input for DTE devices (Receive), output for DCE devices. This is
Receive Data the data channel from the DCE device to the DTE device.
T XD Output for DTE devices (Send), input for DCE devices. This is the
Transmit Data data channel from the DTE device to the DCE device.
GND Signal return for all signal lines.
Signal Ground
RTS Terminal is ready to receive data. W hen the DTE is ready to receive

513
VisiLogic Software Manual V330

Request To data, the DTE serial port RTS signal is ON.


Send
CTS Terminal is ready --not related to data transfer.
Clear To Send
DTR It is an output for DTE devices and an input for DCE devices. This
Data Terminal signal is typically used in UNIX to show that the port has been
Read activated or "opened".
DSR Detects if the RS232 is actually connected.
Data Set Ready
DCD T u r n s O N wh e n t h e m o d e m s c o n n e c t .
Data Carrier
Detect
RING T u r n s O N wh e n s o m e o n e i s c a l l i n g t h e D T E .

Cable Pin-out

The Unitronics cable provided with modem kits does not provide a standard connection. This
connection is adapted to support the fact that Unitronics controllers do not support the control
lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is
always ready to receive data.

Using Hyperterminal

1. Open Hyperterminal. The program can generally be located by clicking the Start
button in the lower left corner of your screen, then selecting
Programs>Accessories>Communications>Hyperterminal. The New Connection
window opens as shown below.
Note Hyperterminal generally starts by pointing to the internal modem, if one is
installed on the PC.

514
Index

2. Enter a name for the new connection and select an icon, and then click OK. The
Connect To box opens .
3. Select a COM port for the modem, and then click OK.

4. The Port Settings box opens as shown below. To enable your PC to communicate
with the modem, set the COM port parameters to a BPS of either 9600 or 19200, Data bits=8,
Parity=N, Stop bits=1, Flow control=None, and then click OK.

515
VisiLogic Software Manual V330

5. Open the modems Properties box by clicking on the Properties button, then open
ASCII Setup.

6. Select the options shown below, and then click OK.

516
Index

Hyperterminal is now connected to your PC via COM 1; the ASCII settings now enable you
to enter commands via the PC keyboard and see the replies from the modem within the
Hyperterminal window.

To test the connection, type AT; if the connection is valid the modem will respond 'OK'.

To change the modems baud rate, type AT+IPR=19200&W; the command '&W' burns the
new baud rate into the modem's non-volatile memory.

Typical initialization strings used with an Siemens M20-type modem are shown below.

Modem Commands

Note The modem must reply with either OK or READY to each command entered. If the
modem fails to answer, the command has not been processed.

+++ Escape Sequence. This causes the modem to close connections and go back
to command mode
AT This command means Attention; and is used to begin a session
AT&F Restores factory default settings
ATZ Resets the modem. This command may take time to implement, so the
response from the modem may be delayed
ATE0 No Echo
V1 Enable Verbose (long) response
Q0 Respond
X4 Detailed answers
&D0 Ignore DTR
&D2 Once DTR falls, disconnect and go to command mode
&D1 Once DTR falls, disconnect
&S0 DSR always ON.
Since the DSR can be permanently set to ON, connecting it to the RTS

517
VisiLogic Software Manual V330

causes the terminal always be ready to transmit\receive data


&S1 DSR OFF in command and test modes
&C1 Give the user a signal for the DCD
&C0 Dont give the user a signal for the DCD (refers to LED indications where
relevant)
ATS0=1 Auto-Answer after 1 ring
S0=0 M o d e m d o e s n ' t a n s we r . F o r c e s P L C t o a n s we r wi t h A T A ( p i c k u p )
S10=15 Sets the time ( in units of 0.1 sec) from the time when CD is not detected,
u n t i l t h e s t r i n g N O C A R R I E R i s s h o wn . I f t h e v a l u e i s 2 5 5 , t h e n t h e C D
signal will not falleven if the modems are no longer connected
S7=30 T i m e O u t : I f t h i s t i m e i s e xc e e d e d , t h e m o d e m n o t i f i e s t h a t d i a l h a s f a i l e d
S12 The modem register that defines the time interval during which the line must
remain clear, before and after the +++ command.
&W Burn the configuration into the m odem s non-volati le m em ory

Initializing the modem to SMS mode via Hyperterminal

Once the modem is successfully initialized, you can use Hyperterminal to initialize the
modem to SMS mode.

Command Description Notes


at+cpin=? Is a pin number required?
at+pin=xxxx Is the pin number set in the
xxxx application?
at+creg? Has the SIM card been S h o u l d r e t u r n o n e o f t wo a n s we r s :
r e g i s t e r e d wi t h t h e l o c a l +CREG: 0,1
cellular provider? T h e S I M i s r e g i s t e r e d wi t h i t s l o c a l
provider.
+CREG: 0,5
The SIM is in roaming mode.
at+cmgf=1 G o t o t e xt m o d e

Notes Commands including question marks are run for verification twice. If the
command is not verified during the second attempt, the attempts stop.

Notes If the SIM requests the PUK number, the SIM must be taken out of the
modem and installed into a phone to enable the number to be entered.

Notes If the SIM is full, the SIM must be taken out of the modem and installed into a
phone to enable the SIM to be cleared.

Notes The modem must be able to support Text mode. P.D.U. mode is not

518
Index

supported.

When a controller sends an SMS text message

It uses the Send command, containing the number to be called: AT+CMGS= phone
number.
The controller then waits for the reply '>'.
When the '>' is received, the controller sends the message, ending the line with
CTRL_Z
If the message is successfully sent, the controller will receive a message of
confirmation,+CMGS:xx. When this message is received by the controller, SB 184
turns ON. The confirmation message is acknowledged by OK.
If :
the message of confirmation is not received within 15 seconds, or
the '>' is not received within 3 seconds, SB 185 turns ON.
When the controller receives an SMS text message:

It receives the command: +CMTI: SM ,xx. Xx is a number in the controller's


memory, 1 to 20.
When the message is received, the controller asks the modem for the text via the
command AT+CMGR=xx
The modem replies with +CMGR, including the phone number, status, text, and
concluding with OK.
Note When a COM port has been successfully initialized, the relevant bit turns ON:
SB 80 , 82, 83 or 84.
If initialization fails, SB 81, 83, 85, or 87 will turn ON.

'The Sniffer'--Viewing communication strings

The instructions below show you how to construct a communications 'Sniffer'. This device
enables you to use Hyperterminal to view communication strings flowing between a PLC
and an external, connected device such as a bar code reader.

Sniffer is
COM is
connected
connected
to the
to the
external
PLC.
device.

519
VisiLogic Software Manual V330

The completed
Sniffer is
connected to a
PLC
communication
port, PC and
external
device.

Note that
communication
cables are the
programming
cable provided
by Unitronics.

To make a Sniffer, you need:

An adapter.
Two 1N4148 or 1N914 diodes.

1. Open
the
adapt
er
carefu
lly via
the 4
snaps
in its
sides.

2. Cut the
red and
green
wires as
shown
below.

520
Index

3. Solder
one diode
to the red
wire, and
one diode
to the
green
wire.
The
soldered
point
provides
the anode.

4. Put
isolating
material
on the
soldered
points.

5. Solder
both
diodes
cathodes
to the red
wire.

6. Put
isolating
material on the
solder.
7. Close
the
Sniffer.
8. Label
the connectors
as shown.

Note In order to run view the strings in Hyperterminal, you must set the program to
display ASCII strings as described above in Using Hyperterminal.

521
VisiLogic Software Manual V330

Using Hyperterminal to check PC-PLC direct communications


If the PC port is defective or in use by another application, you may be unable to access a
directly connected controller with your PC.

Via Hyperterminal, you can check the PLC-PC communication connection by sending a
simple text command, Get ID. If the connection is in order, the controller replies with its ID;
if the connection is faulty, the controller will not reply.

1. Open Hyperterminal.

2. Enter a name for the new connection and select an icon, and then click OK. The
Connect To box opens.
3. Select the PC COM port that connects the PC to the controller, and then click OK.

4. The Port Settings box opens as shown below. To enable your PC to communicate
with the modem, set the COM port parameters to a BPS of either 9600 or 19200, Data bits=8,
Parity=N, Stop bits=1, Flow control=None, and then click OK.

522
Index

5. Open the Properties box by clicking on the Properties button, then open ASCII Setup.

6. Select the options shown below, and then click OK.

7. To synchronize the controller's communication settings, enter Info mode. Navigate to


System>RS232>Restore Defaults, and then press the Enter key.

523
VisiLogic Software Manual V330

8. Open Notepad, enter the text /00IDED, press Enter, and save the file. This is the Get
ID command, where 00 is the 'placeholder' for the controller's Unit ID number. 00 enables any
directly controller to answer, no matter what it's actual ID number is. ED is the command's
checksum.

Note Pressing Enter places a Carriage Return command at the end of the text.
Although the Carriage Return is not visible, the command will not be
processed without it.

9. Select Send Text file from the Transfer menu, and open the text file

.
10. If you have configured everything according to the instructions above, and the port is
functioning properly, the controller with its ID number. If the port is out of order, the controller
will not reply.

In the figure above, the characters in the string that is returned by the controller, /A00IDR1
B30000E5 may be interpreted as follows:
A 00 ID (PLC B (Hardware E5 CR (ETX)
model) Version)
Answer Requested M90-R1 OS V3.00 (00) Checksum Not visible
number

524
Index

Index
A Comment ....................................... 28, 373
Add Communications
Add (math) ........................................156 Initialize COM port............ 217, 230, 251
Add Display .......................................424 Modem 14, 59, 217, 230, 251, 259, 481,
Add font.............................................432 492, 510, 513
Add net........................................21, 364 Network ... 219, 265, 275, 283, 294, 295,
Add .......................................................156 296, 297
Addressing Operands .....................19, 121 Troubleshooting....... 252, 306, 307, 474,
Align ........................................................66 505, 506, 510
Analog I/Os Communications .................................... 14
Analog Input ..........................50, 53, 471 Communications .................................... 59
Analog Output .......................51, 53, 472 Communications .................................... 59
Configuring I/O Expansion Modules ..44, Communications .................................... 60
53, 465, 501 Communications .................................. 230
Configuring Snap-in I/O Modules.46, 53, Communications .................................. 252
466, 501 Communications .................................. 294
Hardware Configuration ....3, 43, 53, 465 Communications .................................. 295
PT100 Input.................................43, 472 Communications .................................. 296
Analog I/Os ...............................................3 Communications .................................. 297
Analog I/Os .............................................43 Communications .................................. 298
Analog I/Os .............................................52 Communications .................................. 306
Analog I/Os .............................................53 Communications .................................. 307
Analog I/Os ...........................................465 Communications .................................. 473
AND function.........................112, 134, 143 Communications .................................. 474
ASCII String ....................................90, 429 Communications .................................. 505
B Communications .................................. 507
Baud Communications .................................. 510
CANbus.............................297, 306, 505 Compare ..... 112, 134, 138, 139, 140, 141,
COM port...................................217, 251 200, 210, 412
Download ............................................61 Compile .................................. 19, 375, 503
Get COM parameters..........................60 Connect.......................................... 19, 375
Baud .......................................................59 Connecting Ladder Elements ........ 19, 375
Binary Numbers ....................................150 Constant Values................................... 122
Binary Variables. 74, 76, 78, 443, 446, 448 Contacts ...... 112, 116, 117, 118, 119, 134,
Bit 381, 382
Bit Functions .... 147, 149, 193, 195, 203 Controller 4, 31, 59, 60, 63, 122, 298, 299,
Memory Bits (MB) .............................123 343, 385, 386, 425
System Bits (SB) .......................125, 327 Controller keyboard.................. 80, 93, 450
Bit..........................................................120 Controller network 297, 298, 299, 306, 505
Bit..........................................................123 Convert MB to MI ................. 147, 190, 203
Bit..........................................................125 Convert MI to MB ................. 147, 190, 203
Bit..........................................................149 Copy & Paste ............. 21, 23, 36, 367, 370
Bit..........................................................150 Copying Values... 147, 164, 165, 190, 192,
Bit..........................................................327 193, 195, 197, 199, 200, 203, 204, 205,
Bootstrap ..............................................502 206
Bridge ...................................................299 Counter ..... 45, 46, 48, 132, 169, 170, 171,
C 211, 356, 379, 466, 468
Calendar functions................................172 Counter Values48, 96, 132, 171, 211, 356,
Call............................... 101, 107, 391, 392 379
CANbus ...... 124, 217, 251, 297, 304, 305, Counter w/reset. 3, 43, 44, 45, 46, 48, 465,
306, 357, 397, 505 466, 468
Casting..........................................206, 209 Create .................................................. 209
Change Element Type ..........116, 381, 382 Cut & Paste 21, 23, 36, 116, 367, 370, 381
Change Element's Operand ...................30 CY ........................................................ 189
Clear .....................................................426 D
Clock .......................................80, 172, 450 Data Tables.................. 315, 321, 322, 323
Coil112, 116, 117, 118, 120, 134, 381, 382 Data, entry via keypad ......... 7, 38, 63, 438
COM port ..... 217, 251, 252, 307, 474, 507 Database, read/write.... 190, 315, 317, 321

525
VisiLogic Software Manual V330

Dates ..... 80, 172, 173, 174, 401, 410, 450 Fall edge .............................................. 119
Decimal........ 207, 209, 387, 401, 455, 463 Fill vector.............................. 171, 190, 195
Delete .... 26, 116, 364, 381, 424, 434, 446 Find .............................................. 193, 339
Derivative Action.......... 231, 238, 357, 413 Find & Replace .................................... 339
Descriptions ........... 57, 121, 327, 344, 385 Find Bit ................................................. 193
Dial........................................................487 Find Value .................................... 190, 193
Digital I/Os ............. 3, 43, 44, 46, 465, 466 Fixed text ................. 35, 98, 429, 431, 450
Digital Outputs .... 44, 46, 48, 56, 465, 466, Float functions..... 207, 208, 209, 210, 211,
469 401, 504
Direct Clock function.............172, 173, 410 Flow........................................ 31, 101, 387
Direct Coil .............................................118 Folders ............................. 9, 332, 336, 338
Direct Connection ...................................59 Fonts
Direct Contact .......................................118 Font Handler..................................... 432
Direct Month Function ..........................186 Fonts .............................................. 98, 432
Display text messages..........7, 38, 63, 438 Fonts .................................................... 432
Displaying Values ... 7, 38, 63, 90, 96, 429, Fonts .................................................... 434
438 Fonts .................................................... 435
Displays .... 4, 7, 35, 36, 38, 39, 63, 64, 66, Fonts .................................................... 464
67, 68, 69, 70, 73, 74, 90, 96, 98, 110, Frequency Measurer............ 3, 43, 48, 465
391, 423, 424, 425, 429, 431, 432, 435, Function 3, 18, 19, 80, 101, 108, 112, 121,
436, 438, 443, 444, 450, 464 133, 134, 137, 138, 143, 153, 155, 167,
Distorted .................................98, 432, 464 172, 174, 199, 207, 208, 209, 210, 211,
Divide....................................155, 156, 413 215, 383, 384, 391, 395, 398, 399, 401,
Double Word.........................................123 412, 413, 450, 504
Download via network ..........................299 G
Downloading Get Max ............................... 164, 190, 204
OS .......................................................61 Get Min ................................ 165, 190, 205
Project ...........................................8, 335 Graphics....... 36, 66, 72, 73, 423, 428, 450
Downloading .............................................8 Graphs ................................. 7, 38, 63, 438
Downloading ...........................................61 Greater Than................................ 139, 140
Downloading .........................................322 Grid .............................................. 423, 436
Downloading .........................................335 Group/Ungroup .................................... 431
Duty Cycle ..............................................48 GSM ....................................... 14, 259, 481
DW ..........................................50, 123, 471 H
E Hardware Configuration .. 3, 43, 44, 46, 48,
Edit................................. 30, 116, 381, 382 50, 51, 53, 56, 465, 466, 469, 471, 472,
Edit programs-via network....................299 505
Edit values ....................................121, 327 Hexadecimal notation .......................... 387
Elapsed........................ 129, 212, 353, 376 High Speed Input .... 3, 43, 44, 45, 46, 465,
Element..... 17, 19, 30, 112, 115, 116, 121, 466, 468
134, 336, 375, 381, 382, 384, 385 High Speed Output (HSO) ... 3, 43, 48, 465
Element's Operand .................................30 High-Speed Counter3, 43, 45, 46, 48, 465,
Enable Start Time.........................174, 401 466, 468
Enter data via keypad HMI
password.................... 7, 38, 63, 93, 438 HMI keypad entries completed. 174, 401
Enter data via keypad ...............................7 HMI.... 4, 35, 36, 39, 63, 64, 66, 67, 68, 69,
Enter data via keypad .............................38 72, 74, 90, 97, 110
Enter data via keypad .............................63 HMI....................................................... 174
Enter data via keypad .............................92 HMI....................................................... 391
Enter data via keypad .............................93 HMI....................................................... 401
Enter data via keypad ...........................438 HMI....................................................... 423
Enter data via keypad ...........................441 HMI....................................................... 423
Enter data via keypad ...........................453 HMI....................................................... 424
Enter data via keypad ...........................457 HMI....................................................... 425
Equal.............................................139, 142 HMI....................................................... 425
Errors ............................................503, 510 HMI....................................................... 426
Ethernet 219, 265, 275, 283, 294, 295, 296 HMI....................................................... 428
Excel .....................................................323 HMI....................................................... 428
F HMI....................................................... 429
Factor....................................................162 HMI....................................................... 429

526
Index

HMI .......................................................443 Keypad Entry Clock Variable ......... 80, 450


HMI .......................................................444 Keypad Entry Variable ... 92, 441, 453, 457
HMI .......................................................450 L
HMI .......................................................450 Labels .................................. 101, 105, 391
HMI .......................................................487 Ladder ..... 3, 5, 9, 17, 18, 28, 31, 101, 108,
Hour ......................................................187 112, 115, 133, 134, 344, 373, 375, 383,
I 384, 387, 395, 501
I/Os Ladder Diagram ..................................... 35
I/O Expansion Modules3, 43, 44, 45, 48, Ladder element ..... 19, 112, 116, 121, 134,
51, 465, 468, 472, 503 381, 382
I/O Snap-in Modules ...................46, 466 Ladder Logic .......................................... 35
I/Os ...........................................................3 Ladder Modules ..................... 31, 101, 387
I/Os .........................................................43 Ladder Net ............................................. 17
I/Os .........................................................44 Ladder rail .............................................. 17
I/Os .........................................................45 Latched ................................................ 120
I/Os .........................................................46 Less Than ............................................ 141
I/Os .........................................................46 Lexical Search ............................... 19, 121
I/Os .......................................................465 Linearization................. 158, 245, 455, 461
I/Os .......................................................465 Link................................................. 19, 121
I/Os .......................................................466 List........................ 82, 84, 86, 88, 121, 327
I/Os .......................................................466 Load Display .......................... 66, 423, 425
I/Os .......................................................468 Load Functions ..... 68, 110, 167, 170, 190,
ID in network.........................................298 391, 399
IEC 1131-3..............................................35 Logic.... 143, 144, 146, 147, 171, 203, 421,
Image 422
Image Variable ............................73, 439 Loops ........................................... 101, 391
Image........................... 4, 7, 36, 38, 63, 72 M
Image......................................................73 Math Functions ... 153, 155, 156, 157, 158,
Image......................................................73 162, 163, 164, 165, 204, 205, 207, 245,
Image......................................................74 401, 413
Image......................................................78 MB-Memory Bits .................. 121, 123, 327
Image......................................................82 Memory ................................................ 334
Image......................................................84 MI 22 Duty Cycle Value ......................... 48
Image......................................................86 MI-Memory Integers50, 121, 123, 327, 471
Image....................................................423 ML-Memory Long Integers.... 50, 121, 124,
Image....................................................425 327, 471
Image....................................................428 Modem .. 14, 259, 262, 349, 481, 483, 492,
Image....................................................428 507, 513
Image....................................................438 Modem Error Messages....................... 510
Image....................................................439 Modules ............................. 3, 31, 101, 387
Image....................................................443 Month ........... 173, 174, 183, 186, 401, 410
Image....................................................448 Month Variable............................. 174, 401
Image....................................................450 Move
Indirect Clock function .. 80, 172, 174, 401, selected nets .............................. 26, 364
450 Move ...................................................... 26
Indirect Time Function ..........174, 187, 401 Move .................................................... 206
Information Mode....................11, 347, 503 Move .................................................... 364
Input ......................... 44, 46, 123, 465, 466 Move Elements ...................................... 23
Insert............ 21, 39, 64, 72, 364, 428, 444 Multi-master ......................................... 297
Insert comments .............................28, 373 Multiple Input Values.................... 155, 413
Insert net.........................................21, 364 Multiply ................................. 155, 157, 413
Integer, Constant ..................................122 N
Integral Action.............. 231, 238, 357, 413 Navigation ................................................ 5
Inverted Coil..........................................118 Negative Transition Contact ................ 119
Inverted Contact ...................................118 Nets... 3, 9, 17, 18, 19, 20, 21, 28, 35, 112,
J 115, 116, 117, 121, 133, 327, 332, 336,
Jumps ............ 66, 101, 105, 391, 423, 425 338, 364, 366, 373, 375, 381, 382, 383,
K 384
Keypad Entry 7, 38, 63, 93, 174, 401, 438,
453

527
VisiLogic Software Manual V330

Network... 59, 62, 121, 124, 295, 296, 297, Power ..................................................... 19
298, 299, 304, 305, 306, 327, 357, 397, Power ................................................... 163
505 Power ................................................... 375
Network Input............... 124, 304, 357, 397 Power-up modes.................................. 502
Network M90 Micro-OPLCs ..................297 Power-up Values... 31, 122, 125, 327, 343,
Networked controller 385, 386
ID.......................................................298 Preset Value ................ 129, 212, 353, 376
Networked controller.............................297 Process Control ........... 231, 238, 357, 413
Networked controller.............................298 Program Flow........... 31, 67, 101, 105, 387
New net...........................................21, 364 Program Sequence .. 31, 67, 101, 105, 387
NI ................. 121, 124, 304, 327, 357, 397 Programming cable.................. 8, 299, 335
Not Equal ..............................................142 Project ...................... 5, 8, 9, 335, 344, 501
Notepad ..........................................28, 373 Proportional Band ........ 231, 238, 357, 413
npn ......................... 3, 43, 44, 46, 465, 466 PT100 ............................................ 43, 472
NSB-Network System Bit.....124, 304, 357, PT4................................................. 43, 472
397 Pulse ................................ 45, 48, 380, 468
NSI-Network System Integer .......121, 124, PWM-Pulse Width Modulation .... 3, 43, 46,
304, 327, 357, 397 48, 465, 466
Number Variable............ 92, 441, 453, 457 R
Numeric ..........................................74, 443 Rails ............................................. 3, 17, 35
O Range .............................................. 86, 88
O Range enter ........................................... 48
S 61 Recipes ................................................ 321
OFF.............. 118, 120, 129, 212, 353, 376 Relay .............................................. 56, 469
ON ............... 118, 120, 129, 212, 353, 376 Reload............................................ 46, 466
O-Output ...............................................125 Remote Access.................... 262, 349, 483
Opening Remote PLC Programming.. 262, 349, 483
Existing Project .................................334 Remove unused fonts .......................... 434
New Project.......................................334 Rename
Opening ................................................334 Watch Folder ................ 9, 332, 336, 338
Opening ................................................334 Rename ............................................... 449
Operand.. 9, 19, 30, 31, 50, 112, 121, 122, Reset.............................................. 60, 503
124, 125, 134, 304, 305, 327, 332, 334, Reset coil ............................................. 120
336, 338, 339, 343, 357, 385, 386, 397, Resizing ................................... 20, 69, 366
471 Rotate .......................................... 147, 422
Operand Address..................................124 RS232 Parameters ..... 217, 251, 252, 306,
Operand Description...............57, 344, 385 307, 474, 505
Operand types ......................121, 124, 327 RS232 port................... 252, 297, 307, 474
Operating System ...................................61 RS485 .................................. 252, 307, 474
OR ........................................................144 RTC Real-Time-Clock..... 80, 81, 189, 334,
OS...................................................61, 502 450, 463
Outputs ............ 44, 56, 125, 465, 469, 501 Run......................................................... 60
P Rung................................................... 3, 17
Password ..................................11, 93, 347 S
Paste.................................21, 23, 367, 370 Saving a project ................................... 335
PC ...........................................59, 297, 299 SB-System Bit................ 70, 121, 125, 327
PC COM Parameters..............................59 Scan ....................................... 31, 101, 387
Pictures .............. 36, 72, 73, 423, 428, 450 SDW............................................. 125, 327
PID ............................... 231, 238, 357, 413 SDW-System Double Word ......... 121, 327
Placing function blocks . 18, 133, 153, 383, Search.................................................. 339
384 Select ..................................... 19, 121, 327
PLC .........................................................60 Setpoint .......................... 92, 441, 453, 457
PLC status ..............................................60 Shaft Encoder ........ 3, 43, 46, 48, 465, 466
pnp ......................... 3, 43, 44, 46, 465, 466 Shift .............................................. 146, 421
PNP/NPN..........................55, 56, 469, 470 Signed .......................................... 122, 124
Port .................. 14, 59, 217, 251, 298, 473 SI-System Integer .......... 67, 121, 125, 327
Positive Transition Contact...................119 Size ........................................................ 69
Power Sizing ............................................. 20, 366
flow..............................................19, 375 SL-System Long Integer ...... 121, 125, 327
Power......................................................17

528
Index

Snap-in I/O Module3, 43, 46, 48, 123, 125, U


465, 466 Undo................................................. 30, 37
Socket...................................................296 Ungroup button .................................... 431
Square root ...........................................163 Unit ID .......... 124, 298, 304, 305, 357, 397
Stop Mode ............................................503 Unlatch ................................................. 120
Store Functions... 112, 134, 167, 168, 169, Unsigned ...................... 121, 122, 124, 327
170, 171, 190, 192, 209, 399, 400, 411 Upload.................................................. 322
String ..............................................90, 429 V
Subroutine Values .......................... 121, 122, 323, 327
Return .......................................108, 395 Variable text ........................... 35, 429, 450
Subroutines. 3, 31, 67, 101, 107, 108, 111, Variable Types ......................... 74, 96, 443
387, 392, 394, 395, 426 Variables ... 4, 7, 36, 38, 39, 63, 64, 72, 73,
Subtract function...................155, 158, 413 74, 76, 78, 81, 82, 84, 86, 88, 93, 96,
Symbols 57, 121, 124, 304, 327, 344, 357, 174, 401, 423, 425, 428, 438, 443, 444,
385, 397 446, 448, 449, 450, 463
System Operands .........................125, 327 Vector Copy ......................... 171, 190, 197
T Vector operations 190, 192, 193, 195, 197,
Test mode.................................9, 344, 501 199, 200, 206
Text. 35, 74, 76, 82, 88, 98, 429, 431, 432, View Window .. 9, 121, 122, 123, 125, 327,
434, 435, 443, 446, 450, 464 332, 336, 338
Text Variable.........................................440 Vision OPLC Information 3, 43, 59, 61, 62,
Time function block...............................187 298, 305, 465
Timers35, 74, 95, 129, 169, 170, 171, 212, W
353, 376, 426, 429, 443, 450, 452, 453 Watch Folder.................... 9, 332, 336, 338
Total cycle period....................................48 Week .................................... 173, 184, 410
Transistor........................................56, 469 Welcome .................................................. 1
Trig functions ........................................209 Wiring ..................................... 14, 259, 481
Triggering signal ...................................119 X
Troubleshooting .. 211, 492, 501, 502, 503, XOR ..................................................... 145
504, 505, 507, 510, 513 Y
Year...................................................... 189

529

Вам также может понравиться