Академический Документы
Профессиональный Документы
Культура Документы
i
Table Of Contents
ii
Table Of Contents
iii
Table Of Contents
iv
Table Of Contents
v
Table Of Contents
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
viii
Table Of Contents
ix
Table Of Contents
x
Table Of Contents
xi
Table Of Contents
xii
Table Of Contents
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.
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.
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
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.
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.
3
VisiLogic Software Manual V330
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.
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
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.
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.
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.
8
Getting Started
Via Project Properties, you can apply upload and download options:
Note The controller can send and receive SMS messages when the controller is in Test
mode.
Watch Folders
Watch Folders enable you to:
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.
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.
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.
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.
Memory Double
Words
System Double
Words
12
Getting Started
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.
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
Modem status can be checked via the System Bits listed below.
SB Description
15
VisiLogic Software Manual V330
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
SMS messaging.vlp
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.
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.
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 Elements
You can search for a particular operand by using the Search: Symbolic Name function at
the bottom of the dialog box.
19
VisiLogic Software Manual V330
The Ladder menu contains two options that enable you to resize nets throughout a project.
20
Getting Started
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.
-or-
Select Cut or Copy from the Edit menu.
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.
23
VisiLogic Software Manual V330
-or-
Select Cut or Copy from the Edit menu.
-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.
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.
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
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:
28
Getting Started
-or-
Select Paste from the Edit menu.
Delete a 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.
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.
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.
32
Getting Started
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.
33
VisiLogic Software Manual V330
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.
35
VisiLogic Software Manual V330
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.
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
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.
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.
43
VisiLogic Software Manual V330
44
Hardware Configuration
High-Speed Counter
High-Speed Counter with Reset
Frequency Measurer
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.
High-Speed Counter
High-Speed Counter with Reset
Frequency Measurer
Shaft Encoder
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.
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
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.
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 ().
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.
49
VisiLogic Software Manual V330
50
Hardware Configuration
51
VisiLogic Software Manual V330
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)
Note Analog I/O values are contained in the register that you link to the I/O in Hardware
Configuration.
53
VisiLogic Software Manual V330
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.
54
Hardware Configuration
55
VisiLogic Software Manual V330
56
Hardware Configuration
You can also copy and paste text to and from other Windows applications.
57
Controller 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.
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
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.
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
60
Controller Settings
Downloading an OS
Selecting an OS
version via the drop-
down arrow and
clicking Download
installs a new
Operating System (OS)
into the controller.
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.
61
VisiLogic Software Manual V330
O\S
62
Displays: HMI
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
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.
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.
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.
Setting Jumps
1. Open a Display.
2. Click on a Jump Condition field, and select an operand.
66
Displays: HMI
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.
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 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.
69
VisiLogic Software Manual V330
Selecting more than one element, then make them of uniform size via the Resize
buttons.
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.
70
Displays: HMI
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.
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.
74
Displays: HMI
This is a sample of a Display and how its elements can look on the controller's LCD.
75
VisiLogic Software Manual V330
76
Displays: HMI
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.
78
Displays: HMI
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.
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.
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
82
Displays: HMI
83
VisiLogic Software Manual V330
84
Displays: HMI
When the operand value is equal to a particular image's number, that image is shown in
the Display.
2. Define the Variable by adding images to the List of Images and linking an operand.
85
VisiLogic Software Manual V330
Locating Images
86
Displays: HMI
Note that you can define the beginning and end of a range using either a Constant value or
an MI.
87
VisiLogic Software Manual V330
2. For each line: define the beginning of the range, the end of the range, and assign an
image.
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.
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.
90
Displays: HMI
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:
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.
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.
1. Create a Variable field, and then select Password from the Numeric menu.
93
VisiLogic Software Manual V330
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.
95
VisiLogic Software Manual V330
96
Displays: HMI
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.
98
Displays: HMI
99
Ladder
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.
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
103
VisiLogic Software Manual V330
104
Ladder
Using Labels
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.
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
109
VisiLogic Software Manual V330
This turns a linked MB ON when a specific Display begins loading. HMI Display Loaded is
located on the Calls menu.
110
Ladder
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:
111
VisiLogic Software Manual V330
In Ladder Diagram, all external input values such as those associated with contacts are
gathered before each net is evaluated.
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
Coils
Coils
Direct 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
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
Vector
Vector
Load
Store
Find
Vector: Transpose
Compare / Compare Offset
Get Max
Get Min
114
Ladder
Calls
Calls
Jump to Label
Load HMI Display
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.
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
-or-
Select Cut or Copy from the Edit menu.
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
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.
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).
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.
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.
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
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.
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.
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
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.
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.
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
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.
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.
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
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
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
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
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
Operand Addressing
An Operand Address is the physical location in the controller memory where the data is
stored.
For example:
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.
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 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
System Integers
# Description Comments
SI 0 Scan Time, mSec
SI 6 Current key pressed
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
11 Reply Busy
12 Reply No Dial
1 No Acknowledgement
2 CANbus OFF
128
Ladder
10 0 (integer result)
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
S DW 0 10mS counter
S DW 3 2.5 mS counter
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
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
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.
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.
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
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.
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
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.
Contacts
Direct Contact (NO)
Coils
Coils
Direct 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
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
Vector
Vector
Load
Store
Find
Vector: Transpose
Compare / Compare Offset
Get Max
Get Min
Calls
Calls
Jump to Label
Load HMI Display
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.
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.
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.
Equal
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.
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
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:
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.
140
Ladder
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.
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:
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
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:
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.
142
Ladder
Constant Value #
Logic Functions
Logic Functions
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 functions are located under the Logic menu on the Ladder toolbar.
AND
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).
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 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).
145
VisiLogic Software Manual V330
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
146
Ladder
The Shift function may be performed on values contained in the following operands:
Rotate
The Rotate function moves the bits in an integer to the left or to the right.
The Rotate function may be performed on values contained in the following operands:
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.
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
148
Ladder
Bit Test
Bit Test enables you to select a bit within a vector of registers, and store its status in an
MB.
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.
149
VisiLogic Software Manual V330
The functions are located under the Logic menu on the Ladder toolbar.
Use this to select an MB and store its status in an MB within a defined vector.
The function is located under the Logic menu on the Ladder toolbar.
Use this to select an MB within a defined vector and load its status in an MB outside of that
vector.
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
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 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.
154
Ladder
3. Link operands using the Select Operand and Address dialog box.
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.
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:
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:
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:
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.
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:
Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.
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.
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
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.
162
Ladder
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.
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
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
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.
166
Ladder
You can implement counters in your program by selecting a Counter (C) operand output
type.
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.
Store Direct allows you to write a value contained in an operand or constant into another
operand.
2. Select Store Direct, then place the Store Direct function in the desired net.
167
VisiLogic Software Manual V330
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 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
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.
You can set a Timer or Counter preset value by storing an operand or constant value into
the desired operand.
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.
You can store an operand or constant value into a current Timer or Counter value.
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 allows you to take a value contained in a source operand and load it into a
destination operand using indirect addressing.
1. Click Store on the Ladder Toolbar, then select Load Indirect MI from the Load
Indirect menu.
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.
You can load the preset value of a Timer or Counter into an operand.
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.
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.
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
This example shows you how to build a ladder net that drives a coil:
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.
6. Enlarge the net, place and link a coil, then use the Connect Elements Tool to draw
lines between the elements.
To enable times and dates for tasks or programs to be set from the controller keypad, you:
174
Ladder
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.
176
Ladder
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
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.
178
Ladder
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.
180
Ladder
6. Create a field and define the End Time Variable, linking it to MI 31.
181
VisiLogic Software Manual V330
Month Variable
You must create variables that enable times and dates to be set from the controller
keyboard.
Setting Jumps
4. Open Display Select Day and Date,click on the first Jump Condition, and select SB
30..
182
Ladder
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.
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.
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).
183
VisiLogic Software Manual V330
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.
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..
184
Ladder
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).
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
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 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).
186
Ladder
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).
The Direct Time function block has a 'from' (start) and a 'to' (end) time set by the
programmer.
187
VisiLogic Software Manual V330
Power will flow through the function between 4 A.M. and 1 P.M. .
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.
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).
188
Ladder
To select the days using the controller's keyboard, the operator uses:
Year
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.
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:
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: 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
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.
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.
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
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
193
VisiLogic Software Manual V330
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.
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
Vector Fill
1. Click the Vector menu on the Ladder Toolbar, then select Fill.
195
VisiLogic Software Manual V330
1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Fill.
196
Ladder
Vector: Copy
Copy
1. Click the Vector menu on the Ladder Toolbar, then select Copy.
197
VisiLogic Software Manual V330
Copy (Offset)
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
Vector: Transpose
Define a source vector of registers that is offset from a selected start address,
199
VisiLogic Software Manual V330
1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Copy.
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
1. Click the Vector menu on the Ladder Toolbar, then select Compare.
201
VisiLogic Software Manual V330
Compare (Offset)
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.
202
Ladder
Use these functions to convert an array of bit values to a numeric value, or a numeric value
to an array of bits.
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
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
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
1. Click the Vector menu on the Ladder Toolbar, click Use Offset, then select Move
Memory.
206
Ladder
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.
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.
Store Direct
207
VisiLogic Software Manual V330
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.
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.
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.
Greater Than
The Greater Than function compares the value of input A to input B.
210
Ladder
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.
NAN Not a Number, special notation for undefined floating point number.
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.
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.'
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
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.
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.
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.
Versions Used
216
Ladder
Communication FBs
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.
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
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.
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
Vision controllers currently offer 4 sockets. The default socket configuration includes:
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.
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
In the figure below, Socket 3 is used, which is the default TCP socket for accessing
external slave devices.
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
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.
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.
223
VisiLogic Software Manual V330
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 2: Scan
To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.
Master
The master PLC Ladder application must include the elements shown below.
225
VisiLogic Software Manual V330
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.
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
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.
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.
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.
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.
229
VisiLogic Software Manual V330
Ethernet FAQs
Using the PLC as a webserver
Dial
Hang-up
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.
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
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 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 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.
1. Select PID Scan from the FBs menu, then place the function in the net.
234
Ladder
2. The Select Operand and Address box opens; link operands to the PID parameters.
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.
Reserved 2 This parameter is reserved for a feature that will be added in the
future.
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(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value
236
Ladder
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.
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.
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.
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 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 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
1. Select PID Scan from the FBs menu, then place the function in the net.
2. The Select Operand and Address box opens; link operands to the PID parameters.
242
Ladder
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.
243
VisiLogic Software Manual V330
Reserved 2 This parameter is reserved for a feature that will be added in the
future.
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(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
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.
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:
Note Analog output values are contained in the register that you link to the output in
Hardware Configuration.
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.
247
VisiLogic Software Manual V330
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
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
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
257
VisiLogic Software Manual V330
M90
These controllers are programmed via U90 Ladder.
Note that since the M90-19-R4 is an external converter, it is also compatible with other
devices, such as PCs.
Galvanic Isolation No
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.
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
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
Modem status can be checked via the System Bits listed below.
SB Description
260
Communications
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
SMS messaging.vlp
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
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.
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.
What is an IP address?
In order to enable a controller to communicate over Ethernet, you must assign it an IP
address.
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.
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.
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.
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.
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].
270
Communications
Glossary
ARP
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.
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
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
NAT
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
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.
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.
What is an IP address?
In order to enable a controller to communicate over Ethernet, you must assign it an IP
address.
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
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.
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.
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.
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].
279
VisiLogic Software Manual V330
Glossary
ARP
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.
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
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
NAT
281
VisiLogic Software Manual V330
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
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.
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.
283
Ethernet
The default socket configuration enables you to implement all of these communication
options.
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.
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 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
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.
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.
287
VisiLogic Software Manual V330
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 2: Scan
To enable the master PLC to access the slave, include a MODBUS Scan FB in the
slave's application.
Master
The master PLC Ladder application must include the elements shown below.
289
VisiLogic Software Manual V330
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.
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
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.
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.
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.
293
VisiLogic Software Manual V330
Ethernet FAQs
Using the PLC as a webserver
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.
294
Ethernet
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.
295
VisiLogic Software Manual V330
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.
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.
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.
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.
299
VisiLogic Software Manual V330
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.
300
Networks
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
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.
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.
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
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.
305
VisiLogic Software Manual V330
Value Message
1 No Acknowledgement
2 CANbus OFF
10 SC receiving TimeOut
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
306
Networks
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.
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.
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.
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.
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.
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.
309
VisiLogic Software Manual V330
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.
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.
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.
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.
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.
311
VisiLogic Software Manual V330
M90
These controllers are programmed via U90 Ladder.
Note that since the M90-19-R4 is an external converter, it is also compatible with other
devices, such as PCs.
312
Networks
Galvanic Isolation No
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.
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.
313
VisiLogic Software Manual V330
314
Data Tables
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.
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.
316
Data Tables
Column Parameters
The column structure options change according to the data type selected.
Parameter Function
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
The Read Direct operation copies data from the data tables into a vector of registers within
the controller.
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
Read Example
Below, database bytes 28, 29, 30, 31, 32, and 33 are read and written into MIs 15, 16, and
17.
The Write operation copies data a vector of registers into the database.
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.
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
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
Export
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
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.
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
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
System Integers
# Description Comments
SI 0 Scan Time, mSec
SI 6 Current key pressed
330
FAQs
11 Reply Busy
12 Reply No Dial
1 No Acknowledgement
2 CANbus OFF
10 0 (integer result)
331
VisiLogic Software Manual V330
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
S DW 0 10mS counter
S DW 3 2.5 mS counter
Watch Folders
332
FAQs
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...
334
FAQs
Ctrl + O.
The Open dialog box appears. Select the file you want to open.
Saving a Project
Saving a Project
Downloading/Uploading a Project
The Download process transfers your project from the PC to the controller.
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:
Watch Folders
336
FAQs
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
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.
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 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.
341
VisiLogic Software Manual V330
Go To Label
To find Labels, use Go To Label<Alt> + <Right/Left arrow> and List of
Labels <Ctrl> + <L> utility.
342
FAQs
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.
343
VisiLogic Software Manual V330
You can also copy and paste text to and from other Windows applications.
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:
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.
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.
Memory Double
Words
System Double
Words
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.
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 .
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.
350
FAQs
351
VisiLogic Software Manual V330
PC Modem Setup
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.'
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
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
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.
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)
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.
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
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.
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.
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 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 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
1. Select PID Scan from the FBs menu, then place the function in the net.
2. The Select Operand and Address box opens; link operands to the PID parameters.
361
VisiLogic Software Manual V330
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.
362
FAQs
Reserved 2 This parameter is reserved for a feature that will be added in the
future.
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(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
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.
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....
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.
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
364
FAQs
2. Hold the Shift button and click on the last net in the range that you want to
copy.
365
VisiLogic Software Manual V330
Press the Delete button on your computer keyboard; the net is deleted and all of the
nets in your project move up.
To shrink a net to its minimum height, double-click the net's left-hand rail.
366
FAQs
The Ladder menu contains two options that enable you to resize nets throughout a project.
367
VisiLogic Software Manual V330
-or-
Select Cut or Copy from the Edit menu.
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.
370
FAQs
-or-
Select Cut or Copy from the Edit menu.
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:
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.
-or-
Select Paste from the Edit menu.
Delete a Comment
374
FAQs
2. Select Delete.
-or-
Press the Delete button on your PC's keyboard.
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
375
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.
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.'
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
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.
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.
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)
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.
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
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
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
381
VisiLogic Software Manual V330
-or-
Select Cut or Copy from the Edit menu.
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.
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.
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
3. Link operands using the Select Operand and Address dialog box shown below.
Click on the elements outlined in blue for more information.
384
FAQs
Operand Descriptions
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.
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.
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.
386
FAQs
Use Search: Symbolic Name to find operands by description. Within the Select Operand
box, this is activated via <Ctrl> + <L> .
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.
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.
388
FAQs
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.
389
VisiLogic Software Manual V330
390
FAQs
The Call menu's functions enable you to set the sequence in which your program runs.
391
VisiLogic Software Manual V330
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
392
FAQs
393
VisiLogic Software Manual V330
Open a Subroutine
394
FAQs
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
396
FAQs
Network Operands
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
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.
398
FAQs
Versions Used
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
Store Direct allows you to write a value contained in an operand or constant into another
operand.
2. Select Store Direct, then place the Store Direct function in the desired net.
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.
To enable times and dates for tasks or programs to be set from the controller keypad, you:
401
VisiLogic Software Manual V330
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.
403
VisiLogic Software Manual V330
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
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.
405
VisiLogic Software Manual V330
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.
407
VisiLogic Software Manual V330
6. Create a field and define the End Time Variable, linking it to MI 31.
408
FAQs
Month Variable
You must create variables that enable times and dates to be set from the controller
keyboard.
Setting Jumps
4. Open Display Select Day and Date,click on the first Jump Condition, and select SB
30..
409
VisiLogic Software Manual V330
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.
This example shows you how to build a ladder net that drives a coil:
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.
6. Enlarge the net, place and link a coil, then use the Connect Elements Tool to draw
lines between the elements.
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.
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.
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.
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.
412
FAQs
Constant Value #
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.
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.
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
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 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 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.
1. Select PID Scan from the FBs menu, then place the function in the net.
417
VisiLogic Software Manual V330
2. The Select Operand and Address box opens; link operands to the PID parameters.
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.
Reserved 2 This parameter is reserved for a feature that will be added in the
future.
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(I): MI This is the Integral component of the PID function, calculated by the
Integral controller.
Value
419
VisiLogic Software Manual V330
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.
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
The Shift function may be performed on values contained in the following operands:
421
VisiLogic Software Manual V330
Rotate
The Rotate function moves the bits in an integer to the left or to the right.
The Rotate function may be performed on values contained in the following operands:
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.
422
FAQs
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.
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.
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
Open a Display
Delete/Clear a Display
424
FAQs
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.
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.
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.
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.
426
FAQs
427
VisiLogic Software Manual V330
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
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.
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.
429
VisiLogic Software Manual V330
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
431
VisiLogic Software Manual V330
Fonts
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
434
FAQs
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.
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.
437
VisiLogic Software Manual V330
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.
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
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
441
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
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.
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
How do I...
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.
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
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.
This type of variable displays a different image on the controller's LCD screen according to
the status of a bit operand.
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.
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
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.
After you have inserted Variables into a display, they are shown with that display in the
Project tree.
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.
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.
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.
452
FAQs
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
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
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.
455
VisiLogic Software Manual V330
456
FAQs
Number Variable
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 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
459
VisiLogic Software Manual V330
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.
461
VisiLogic Software Manual V330
462
FAQs
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
Note I/O Expansion Modules may require an adapter. Check with your distributor for
additional details.
465
VisiLogic Software Manual V330
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.
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
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.
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.
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.
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.
470
FAQs
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
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.
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
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.
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.
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.
476
FAQs
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.
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.
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.
478
FAQs
M90
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
The specifications below apply to RS485 ports for all Vision and M91 controllers.
Galvanic Isolation No
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.
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.
480
FAQs
Modems
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.
Modem status can be checked via the System Bits listed below.
SB Description
481
VisiLogic Software Manual V330
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
SMS messaging.vlp
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.
484
FAQs
485
VisiLogic Software Manual V330
PC Modem Setup
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.
486
FAQs
In the SMS Configuration Phone Book, use a vector of registers to indirectly dial a number.
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.
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
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
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.
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.
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.
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 variable is refreshed in the Ladder application via MB 1000 Display String on HMI.
490
FAQs
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
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
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
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.
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:
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.
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
If a short circuit is detected on either an expansion or snap-in I/O module, SB 5 turns ON.
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.)
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.
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.
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.
502
Index
What to do
Compile
When you compile your program, you can see any errors in the Output Window.
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.
504
Index
Error
NAN Not a Number, special notation for undefined floating point number.
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.
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.
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
505
VisiLogic Software Manual V330
10 SC receiving TimeOut
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
Incorrect baud The bridge's RS232 port's baud rate cannot be set
rate below 9600.
0 No Errors
1 Illegal Function
4 Master--Time Out
5 No Communication
6 Mismatched Unit ID
7 Mismatched Command
8 Length of message
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.
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
508
Index
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.
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.
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.
PUK number needed 5 The SIM card is locked due to too many
attempts to enter an incorrect PIN number.
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 can be checked via the System Bits listed below.
SB Description
510
Index
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
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
11 Reply Busy
12 Reply No Dial
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
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
9 (Send only)Either the phone number or the SMS message is in the incorrect
format and may not be transmitted
512
Index
SDW Description
Note The modem driver does not need to be installed in order to access the modem via
Hyperterminal.
Modem Connections
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.
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
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.
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
Once the modem is successfully initialized, you can use Hyperterminal to initialize the
modem to SMS mode.
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.
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:
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.
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
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.
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
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
529