Visilogic руководство по программированию pdf

Page 1: VisiLogic - Ladder Programming

V

SOFTWARE

MANUAL

VISILOGIC: LADDER PROGRAMMING

V230-21-G23 Rev: 3:00

RE

AL

ER NGRev: 3:00

Page 2: VisiLogic - Ladder Programming

The information in this document reflects products at the date of printing. Unitronics reserves the right, subject to all applicable laws, at any time, at its sole discretion, and without notice, to discontinue or change the features, designs, materials and other specifications of its products, and to either permanently or temporarily withdraw any of the forgoing from the market.

All information in this document is provided «as is» without warranty of any kind, either expressed or implied, including but not limited to any implied warranties of merchantability, fitness for a particular purpose, or non-infringement. Unitronics assumes no responsibility for errors or omissions in the information presented in this document. In no event shall Unitronics be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever arising out of or in connection with the use or performance of this information.

The tradenames, trademarks, logos and service marks presented in this document, including their design, are the property of Unitronics (1989) (R»G) Ltd. or other third parties and you are not permitted to use them without the prior written consent of Unitronics or such third party as may own them.

Page 3: VisiLogic - Ladder Programming

Table of Contents Ladder Editor …………………………………………………………………………….. 1

Ladder Logic ………………………………………………………………………………….. 3 Ladder Net ……………………………………………………………………………………. 3 Placing a Ladder Element in a Net ……………………………………………………….. 4 Placing a Function in a Net ………………………………………………………………… 5 Delete Elements …………………………………………………………………………….. 6 Change Element Type ………………………………………………………………………. 6 Connecting Ladder Elements and Functions ……………………………………………. 7 Changing an Element’s Operand …………………………………………………………. 8 Import-Export Operand Descriptions ……………………………………………………. 8 Nets: Sizing and Resizing ………………………………………………………………….. 9 Collapse, Expand Nets ……………………………………………………………………… 9 Adding and Inserting Nets ……………………………………………………………….. 10 Move, Copy, & Paste Nets ……………………………………………………………….. 11 Move, Copy & Paste Elements …………………………………………………………… 13 Move, Copy, & Paste between Projects ……………………………………………….. 14 Deleting Nets ………………………………………………………………………………. 16 Comments Tool ……………………………………………………………………………. 18 Open a Subroutine ………………………………………………………………………… 20 Name-Rename Modules and Subroutines …………………………………………….. 20

Modules, Subroutines, Labels & Jumps …………………………………………… 21 Protecting Subroutines …………………………………………………………………… 21 Import/Export Subroutines ………………………………………………………………. 23

Program Control and Sequencing ………………………………………………….. 27 PLC Program Scan…………………………………………………………………………. 27 Disable-Enable Nets ………………………………………………………………………. 28 Calls, Jumps, and Labels …………………………………………………………………. 28 Labels & Jumps …………………………………………………………………………….. 28 Call Subroutine …………………………………………………………………………….. 32 Subroutine: Return ……………………………………………………………………….. 34 Interrupt Routines …………………………………………………………………………. 35 Stop Mode Subroutine ……………………………………………………………………. 37

Ladder Elements and Functions List ……………………………………………….. 39 Contacts ………………………………………………………………………………… 44

Direct Contacts …………………………………………………………………………….. 44 Inverted Contacts …………………………………………………………………………. 46 Positive Transition Contact ( Rise ) …………………………………………………….. 46 Negative Transition Contact …………………………………………………………….. 49

Coils ……………………………………………………………………………………… 50 Direct Coil …………………………………………………………………………………… 50 Inverted Coil ……………………………………………………………………………….. 51 Reset Coil …………………………………………………………………………………… 51 Set Coil ……………………………………………………………………………………… 51 Toggle Coil ………………………………………………………………………………….. 52

Operands ……………………………………………………………………………….. 52

Page 4: VisiLogic - Ladder Programming

Operand Types and Symbols ……………………………………………………………. 52 X Operands (Enhanced only) ……………………………………………………………. 53 System Operands …………………………………………………………………………. 54 Network Operand Types and Symbols …………………………………………………. 54 Linking Operands to Elements ………………………………………………………….. 54 Operand Addressing ………………………………………………………………………. 54 Power-up Values …………………………………………………………………………… 55 Constant Values # ………………………………………………………………………. 55 Constant Value Operands ………………………………………………………………… 55 Memory Bits (MB) ………………………………………………………………………… 56 Inputs (I) …………………………………………………………………………………… 56 Outputs (O)………………………………………………………………………………… 56 Timers (T) …………………………………………………………………………………… 56 Counters (C) ……………………………………………………………………………….. 60 Memory Integers (MI) ………………………………………………………………….. 61 Memory Long Integer (ML) ……………………………………………………………… 61 Double Word (DW) ………………………………………………………………………. 61 Memory Floating Point Integer (MF) ………………………………………………….. 61 X Operands (Enhanced only) ……………………………………………………………. 62 System Operands (SI) (SL) (SB) (SDW) ……………………………………………… 62

Logic Functions ………………………………………………………………………… 98 AND ………………………………………………………………………………………….. 98 OR ……………………………………………………………………………………………. 99 XOR ………………………………………………………………………………………… 101 Shift ………………………………………………………………………………………… 103 Rotate ……………………………………………………………………………………… 103

Vector: Bit to Numeric, Numeric to Bit …………………………………………… 104 Bit to Numeric ……………………………………………………………………………. 104 Numeric to Bit ……………………………………………………………………………. 104 Test Bit …………………………………………………………………………………….. 105 Set/Reset Bit ……………………………………………………………………………… 105 RS-SR Flip-Flop ………………………………………………………………………….. 106 RLO to Bit …………………………………………………………………………………. 106

Binary Numbers ………………………………………………………………………. 107 Compare Functions ………………………………………………………………….. 110

Greater Than ……………………………………………………………………………… 111 Greater or Equal to ……………………………………………………………………… 111 Equal ……………………………………………………………………………………….. 112 Not Equal ………………………………………………………………………………….. 113 Less or Equal to ………………………………………………………………………….. 113 Less Than …………………………………………………………………………………. 114 Within Range ……………………………………………………………………………… 115

Math Functions ……………………………………………………………………….. 115 Multiple Input Values in Math Functions …………………………………………….. 116 Add …………………………………………………………………………………………. 117 Divide ………………………………………………………………………………………. 118 Multiply ……………………………………………………………………………………. 118 Subtract …………………………………………………………………………………… 119 Modulo …………………………………………………………………………………….. 119

Page 5: VisiLogic - Ladder Programming

Linearization, Vector Linearization ……………………………………………………. 120 Factor ………………………………………………………………………………………. 125 Formula: Build Your Own ………………………………………………………………. 126 Power ………………………………………………………………………………………. 127 Square Root ………………………………………………………………………………. 128 Increment/Decrement ………………………………………………………………….. 129 Float Functions …………………………………………………………………………… 129

Store and Load Functions …………………………………………………………… 134 Reset Numeric ……………………………………………………………………………. 134 Store Direct Function ……………………………………………………………………. 135 Store Indirect Function …………………………………………………………………. 136 Store Timer/Counter Preset ……………………………………………………………. 137 Store Timer/Counter: Current Value …………………………………………………. 137 Load Indirect Functions …………………………………………………………………. 137 Load Timer/Counter Preset …………………………………………………………….. 138 Load Timer/Counter: Current Value ………………………………………………….. 138 Load Timer Bit Value ……………………………………………………………………. 139 BCD to NUM, Num to BDC ……………………………………………………………… 139 Fill Direct ………………………………………………………………………………….. 140 Step in Range …………………………………………………………………………….. 140

Vector Operations ……………………………………………………………………. 142 Vector Copy ………………………………………………………………………………. 142 Vector: Load ……………………………………………………………………………… 143 Vector: Store……………………………………………………………………………… 144 Vector: Find ………………………………………………………………………………. 145 Vector: Fill ………………………………………………………………………………… 146 Vector: Copy ……………………………………………………………………………… 149 Vector: Compare ………………………………………………………………………… 150 Vector: Bit to Numeric, Numeric to Bit ………………………………………………. 152 Load Timer Bit Value ……………………………………………………………………. 153 Vector: Get Max………………………………………………………………………….. 154 Vector: Get Min ………………………………………………………………………….. 154 Vector: Copy Memory …………………………………………………………………… 155 Vector: Shift Left ………………………………………………………………………… 156 Vector: Swap Bytes ……………………………………………………………………… 157 Vector: Sort ………………………………………………………………………………. 158 Vector: Struct …………………………………………………………………………….. 159

Strings …………………………………………………………………………………. 160 Strings: Num to ASCII, ASCII to Num ………………………………………………. 161

Time to ASCII …………………………………………………………………………. 164 Strings: Transpose ………………………………………………………………………. 164 Strings: Display RTC (ASCII) ………………………………………………………….. 165 Strings: IP to ASCII …………………………………………………………………….. 166 Mac Address to ASCII …………………………………………………………………… 167 String to ASCII …………………………………………………………………………… 167 Strings: Section Operations ……………………………………………………………. 168 Set String Library ……………………………………………………………………….. 169

Utils Menu ……………………………………………………………………………… 169 HMI-Ladder: Load HMI Display: Functions ………………………………………….. 170

Page 6: VisiLogic - Ladder Programming

HMI-Ladder: Draw Pixel/Line ………………………………………………………….. 171 HMI-Ladder: Clear Rectangle (Standard Vision only) …………………………….. 173 HMI-Ladder: Previous Var (Standard Vision only) …………………………………. 173 Inverse Var/Hide Var (Standard Vision Only) ………………………………………. 174 HMI-Ladder: Previous Var (Standard Vision only) …………………………………. 175 Refresh HMI Display …………………………………………………………………….. 177 PTO Functions: Simple Motion Control ………………………………………………. 177 Alarms: Ladder Functions ………………………………………………………………. 184 Clock Functions ………………………………………………………………………….. 185 Immediate Elements ……………………………………………………………………. 205 On-Line Test Mode (Debug) functions ……………………………………………….. 212 Idle …………………………………………………………………………………………. 214 BackUp Security (Enhanced Vision only) ……………………………………………. 214 UniVision Licensing ………………………………………………………………………. 215

Data Table Functions ………………………………………………………………… 218 Data Tables, Read/Write ……………………………………………………………….. 218 Data Tables: Find Row, Find Row Extended ………………………………………… 225 Data Tables: Clear, Row, Column, Table ……………………………………………. 226 Data Table to Data Table: Copy ………………………………………………………. 227

SD Ladder Functions ………………………………………………………………… 228 SD System Operands …………………………………………………………………… 230 Set SD Card Password ………………………………………………………………….. 233 SD Card: Folder Report Function ……………………………………………………… 235 SD Card and Data Table Functions (Ladder) ……………………………………….. 236 SD Card and Trends …………………………………………………………………….. 245 SD Card: Data to Excel …………………………………………………………………. 246 SD Block Functions………………………………………………………………………. 250 SD File Functions ………………………………………………………………………… 253 SD: Safely Remove ……………………………………………………………………… 260

SD: Cloning via Ladder ……………………………………………………………… 261 COM Functions ……………………………………………………………………….. 264 FBs Library …………………………………………………………………………….. 264

Index ………………………………………………………………………………………. 268

Page 7: VisiLogic - Ladder Programming

VisiLogic: Ladder Programming

Page 8: VisiLogic - Ladder Programming

Page 9: VisiLogic - Ladder Programming

Ladder Logic VisiLogic: Ladder Programming

VisiLogic: Ladder Programming 1

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

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

Use the Ladder Editor to:

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

Jumps and Labels. Place Comments on Ladder nets.

Ladder elements and functions may be dragged and dropped between nets. Hotkeys are also available for easy programming. To start the Ladder Editor

Click the Ladder button on the toolbar.

Page 10: VisiLogic - Ladder Programming

Ladder Editor Ladder Logic

2 VisiLogic: Ladder Programming

Page 11: VisiLogic - Ladder Programming

Ladder Logic Ladder Editor

VisiLogic: Ladder Programming 3

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.

Ladder Net A Ladder net is the smallest division of a ladder diagram.

The Ladder diagram contains a left and right rail. Between these rails, the control application is arranged in nets. A net contains a row of Ladder elements that drive a coil.

Each net must contain only one rung.

Power flows through the ladder elements in a net from left to right.

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 displays an error message at compilation.

Page 12: VisiLogic - Ladder Programming

Ladder Editor Placing a Ladder Element in a Net

4 VisiLogic: Ladder Programming

Placing a Ladder Element in a Net 1. Select any type of Ladder element by:

Clicking its icon on the Ladder toolbar, -or-

Selecting it from the Ladder menu, -or-

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

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

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

below.

Page 13: VisiLogic - Ladder Programming

Placing a Function in a Net Ladder Editor

VisiLogic: Ladder Programming 5

Placing a Function in a Net 1. Select any type of Ladder function by:

Selecting it from the Ladder toolbar

,-or-

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

selecting the function.

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

Page 14: VisiLogic - Ladder Programming

Ladder Editor Delete Elements

6 VisiLogic: Ladder Programming

Delete ElementsSelect the desired element(s), then

Select Cut. or Copy from the Edit menu.

-or-

Click the Delete button on the toolbar. -or Right-click the Element, then select Delete from the menu.

Change Element Type

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

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

Page 15: VisiLogic - Ladder Programming

Connecting Ladder Elements and Functions Ladder Editor

VisiLogic: Ladder Programming 7

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.

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

Connecting Elements

Page 16: VisiLogic - Ladder Programming

Ladder Editor Changing an Element’s Operand

8 VisiLogic: Ladder Programming

Changing an Element’s Operand To edit an element’s operand:

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

Import-Export Operand Descriptions You can export operand descriptions to Excel or other .csv editor, edit them, then import them back into VisiLogic via the Import-Export Operands Description on the Edit menu.

Page 17: VisiLogic - Ladder Programming

Nets: Sizing and Resizing Ladder Editor

VisiLogic: Ladder Programming 9

Nets: Sizing and Resizing To shrink a net to its minimum height, double-click the net’s left-hand rail.

Nets can also be manually resized.

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

Collapse, Expand Nets You can collapse and expand individual nets by clicking the button in the upper left corner of the net. To expand all nets at once, click the Ladder menu and select Expand All Nets.

Page 18: VisiLogic - Ladder Programming

Ladder Editor Adding and Inserting Nets

10 VisiLogic: Ladder Programming

Adding and Inserting Nets To add a net to the bottom of your Ladder:

Select the Append Nets icon from the Insert menu;three nets are added to the bottom of the Ladder application. .

To insert a Ladder net:

1. On the Ladder toolbar, click on the Insert Net icon ; your cursor

changes into cross-hairs .

2. Click on a net; the new net is inserted above the net you clicked on.

Page 19: VisiLogic - Ladder Programming

Move, Copy, & Paste Nets Ladder Editor

VisiLogic: Ladder Programming 11

Move, Copy, & Paste Nets

1. Select the desired net(s).

2. Select the desired operation.

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

3. Place the elements in the net.

Page 20: VisiLogic - Ladder Programming

Ladder Editor Move, Copy, & Paste Nets

12 VisiLogic: Ladder Programming

-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.

Page 21: VisiLogic - Ladder Programming

Move, Copy & Paste Elements Ladder Editor

VisiLogic: Ladder Programming 13

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.

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

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

Move, Copy & Paste Elements Ladder elements and functions may also be dragged and dropped between nets.

Page 22: VisiLogic - Ladder Programming

Ladder Editor Move, Copy, & Paste between Projects

14 VisiLogic: Ladder Programming

1. Select the desired element(s).

2. Select the desired function.

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

3. Place the elements in the net.

-or- Select Paste from the Edit menu.

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

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

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

Page 23: VisiLogic - Ladder Programming

Move, Copy, & Paste between Projects Ladder Editor

VisiLogic: Ladder Programming 15

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.

Page 24: VisiLogic - Ladder Programming

Ladder Editor Deleting Nets

16 VisiLogic: Ladder Programming

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 Select the desired nets.

• To select one net , click on the left rail of a net to select it; the rail in that net turns grey.

Page 25: VisiLogic - Ladder Programming

Deleting Nets Ladder Editor

VisiLogic: Ladder Programming 17

1. To select more than one net, select the first net by clicking on the left net bar.

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

to delete.

Page 26: VisiLogic - Ladder Programming

Ladder Editor Comments Tool

18 VisiLogic: Ladder Programming

3. 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 above program nets. Comments can be written directly into the Comment pane, or written in Notepad and pasted into the pane.

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

Insert a comment:

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

.-or- Select Insert Comment from either the Insert or Ladder menu. -or- Right-click on the Ladder, and then select Insert Comment.

2. Click on a net; a Comment field opens in the net you clicked.

3. Type text in the field.

Page 27: VisiLogic - Ladder Programming

Comments Tool Ladder Editor

VisiLogic: Ladder Programming 19

Move, Copy, and Paste Comments: 4. Select the Comment.

5. Place the Comment in the net.

-or- Select Paste from the Edit menu.

Delete a Comment 1. Select the Comment.

Page 28: VisiLogic - Ladder Programming

Ladder Editor Open a Subroutine

20 VisiLogic: Ladder Programming

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

Open a Subroutine To open a Subroutine for editing:

Double-click in the Project Explorer tree, -or- Right-click the Subroutine in the Project Explorer tree, then select Open, —

or- Right-click a Call Subroutine element to access the targeted subroutine.

Name-Rename Modules and Subroutines

Page 29: VisiLogic - Ladder Programming

Protecting Subroutines Modules, Subroutines, Labels & Jumps

VisiLogic: Ladder Programming 21

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

Note • Within the program tree, elements are presented alphabetically. This

does not affect the order in which the program runs. • 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.

Protecting Subroutines You can create a Ladder Password, then apply it to protect multiple subroutines and hide their content. When a subroutine is protected, a user cannot export/import it. In addition, the user cannot open, copy, or print it without supplying the password.

Creating and Using a Password 1. To create a password, select File>Set Ladder Password; then fill in the

password field.

Page 30: VisiLogic - Ladder Programming

Modules, Subroutines, Labels & Jumps Protecting Subroutines

22 VisiLogic: Ladder Programming

2. To apply the password to a subroutine, right-click the subroutine’s name in the Project Navigation window, then select Set as Protected; a small padlock icon is displayed nest to the subroutine’s name. You can also right-click a module’s name and select Protect All Subroutines in Module.

Note • Protection is applied after VisiLogic (not just the project) is closed and

reopened.

3. To remove protection from a subroutine, right-click the protected subroutine’s name, then select Set AS Unprotected; the padlock icon disappears.

You can remove protection from a module in the same way.

Page 31: VisiLogic - Ladder Programming

Import/Export Subroutines Modules, Subroutines, Labels & Jumps

VisiLogic: Ladder Programming 23

Note • The same password may be used for different projects.

Deleting a Ladder Password 1. To delete a Ladder password from a project, select File>Unset Ladder

Password.

Import/Export Subroutines You can export Subroutines and save them as .vlx files, then import them into other projects. You can import/export single Subroutines, or all of the subroutines in a Module. Note that you cannot export Subroutines from the Main Module.

Exporting a single Subroutine

1. Right-click the desired Subroutine and select Export Subroutine, -or- select Export Subroutine from the Project menu; the Select Subroutine box opens.

2. Select the desired subroutine, then save it to the desired folder.

Exporting all of the Subroutines in a Module

1. Right-click the desired module and select Export All Subroutines.

Page 32: VisiLogic - Ladder Programming

Modules, Subroutines, Labels & Jumps Import/Export Subroutines

24 VisiLogic: Ladder Programming

2. Save the .vlx file to the desired folder.

Note that when you import this .vlx file, all of the Subroutines it contains will be imported.

Import

1. Right-click a module name and select Import Subroutine, -or- Select Import Subroutine from the Project menu; the Open box appears.

2. Select the desired subroutine, then save it to the desired folder.

Import/Export is subject to the limitations below.

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.

Page 33: VisiLogic - Ladder Programming

Import/Export Subroutines Modules, Subroutines, Labels & Jumps

VisiLogic: Ladder Programming 25

If the selection contains an FB operation related to an FB Configuration, and is imported into an application containing an FB Configuration of the same name, the links will be retained. If, for example, you export a subroutine containing an SMS Send FB linked to SMS Configuration ‘Denmark’ and then import this subroutine into another application containing an SMS Configuration ‘Denmark’, the SMS Send FB will automatically link to ‘Denmark’.

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.

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.

Page 34: VisiLogic - Ladder Programming

Modules, Subroutines, Labels & Jumps Import/Export Subroutines

26 VisiLogic: Ladder Programming

Note that the following symbols cannot be used in subroutine names: / \ | * : ! » < > . In addition, please note that a name may not include a period followed by a space (for example My. Subroutine). When importing/exporting from older VisiLogic programs containing such symbols, they will be automatically replaced by underscore characters.

Page 35: VisiLogic - Ladder Programming

PLC Program Scan VisiLogic: Ladder Programming

VisiLogic: Ladder Programming 27

Program Control and SequencingTo control the Ladder program flow sequence and avoid loops, use the Call Subroutine function to conditionally call subroutines. Within a subroutine, you control the sequence by conditionally skipping over nets using Labels and Jump to Label functions. This enables you to shorten the program scan time.

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

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

Note • If a subroutine does not run, the coils in that subroutine will not be

updated. For example, Subroutine 4 contains . If MB0 is turned ON in Subroutine 1, but Subroutine 4 is not called, O0 is not updated. The order in which I/Os are updated depend on the PLC program scan.

• Some FBs require Configuration, such as SMS. The FB Configuration should be placed in the first subroutine of the main program module. If a Configuration is in a subroutine that is not called into the program, linked FBs will not be processed even if the activating condition for that FB has been turned ON.

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

PLC Program Scan A scan is a complete execution of the controller’s entire program. The scan cycle is performed continuously.

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

• The scan time is stored in SI 0 Scan Time, Resolution: Units of 1 mSec.

Page 36: VisiLogic - Ladder Programming

Program Control and Sequencing Disable-Enable Nets

28 VisiLogic: Ladder Programming

Disable-Enable Nets Disabling a net causes the program scan to skip over it.

To disable a net, right-click the left-hand Ladder rail and select the Disable option from the menu. The disabled net rail is colored green.

To re-enable the net, right-click the left hand Ladder rail of the disabled net and select Enable.

Calls, Jumps, and Labels The Call menu functions are located on the Utils menu. They enable you to set the

sequence in which your program runs.

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

Page 37: VisiLogic - Ladder Programming

Labels & Jumps Program Control and Sequencing

VisiLogic: Ladder Programming 29

Using Labels

1. Place a Label in a net.

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

3. Place a Jump after the condition

Page 38: VisiLogic - Ladder Programming

Program Control and Sequencing Labels & Jumps

30 VisiLogic: Ladder Programming

.

Page 39: VisiLogic - Ladder Programming

Labels & Jumps Program Control and Sequencing

VisiLogic: Ladder Programming 31

Page 40: VisiLogic - Ladder Programming

Program Control and Sequencing Call Subroutine

32 VisiLogic: Ladder Programming

Renaming Labels

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

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.

Page 41: VisiLogic - Ladder Programming

Call Subroutine Program Control and Sequencing

VisiLogic: Ladder Programming 33

Using Call Subroutine

Page 42: VisiLogic - Ladder Programming

Program Control and Sequencing Subroutine: Return

34 VisiLogic: Ladder Programming

Accessing a Call Subroutine Target

Subroutine: Return A subroutine runs until it reaches a Subroutine Return function, the function then causes the program to jump back to the previous subroutine. The program returns to the same point from it exited.

Page 43: VisiLogic - Ladder Programming

Interrupt Routines Program Control and Sequencing

VisiLogic: Ladder Programming 35

Using Subroutine Return

Interrupt Routines Interrupt routines cause:

Page 44: VisiLogic - Ladder Programming

Program Control and Sequencing Interrupt Routines

36 VisiLogic: Ladder Programming

A program to stop immediately, whenever the interrupt is activated, even if the program is in the middle of scanning a net in another subroutine.

A jump to the Interrupt subroutine. An Interrupt subroutine must have the exact name shown in the examples below.When the interrupt routine is finished, the program returns to where it was interrupted, and continues from that point until the next Interrupt arrives.

Interrupt routines are generally used with Immediate elements, for example to turn an output ON in case of an alarm or emergency. To call an interrupt routine:

1. Include an Interrupt subroutine of the correct name in your program; the subroutine is executed automatically when the condition for calling it is filled.

Note •

If the name of the subroutine is incorrect, the subroutine will not function as an Interrupt routine.

• Interrupt features are not supported by the V120-12 series.

Sample applications showing how to use Interrupt routines in conjunction with Immediate elements may be located in :::\ ProgramFiles\Unitronics\VisiLogic\Examples.

2.5 mS Interrupt Routine This function is timed-based. Call it by naming a subroutine _Interrupt 2.5 mS

Including an _Interrupt 2.5 mS subroutine in the Ladder application causes:

The program scan to pause every 2.50 mSec. A jump to the subroutine named _Interrupt 2.5 mS

Note that the interrupt routine should be as short as possible, and must not exceed approximately 0.5 mSec.

When the interrupt routine is finished, the program returns to where it was interrupted, and continues from that point until the next Interrupt arrives.

Note • The Subroutine _Interrupt 2.5 mS will run for the first time after the first Ladder scan is run.

Page 45: VisiLogic - Ladder Programming

Stop Mode Subroutine Program Control and Sequencing

VisiLogic: Ladder Programming 37

1.25 mS Interrupt Routine This function is supported by Enhanced Vision models only. Call it by naming a subroutine _Interrupt 1.25 mS It functions exactly like the 2.5mS Interrupt routine described above.

Interrupt HSC This function is called according to the current value of a high-speed counter. The program stops immediately and executes the subroutine when the Counter Value reaches the Counter Target Value.

The interrupt function is included in the program by naming a subroutine _Interrupt x,x where the first x is the high-speed counter, and the second x is the reload. These subroutines must be named in accordance with your Hardware Configuration as:

_Interrupt HSC 0,1 _Interrupt HSC 2,3 _Interrupt HSC 4,5

When the interrupt routine is finished, the program returns to where it was interrupted, and continues from that point until the next Interrupt arrives.

Stop Mode Subroutine If you include the exact name of the subroutine: _ RUN_TO_STOP_ in your program, this subroutine will run a single time when the PLC enters Stop Mode.

Note the related SBs:

SB 301 PLC exits Stop and returns to Run Mode; turns ON for 1 scan

Page 46: VisiLogic - Ladder Programming

Program Control and Sequencing Stop Mode Subroutine

38 VisiLogic: Ladder Programming

SB 302 Stop Mode ON, turns ON when entering Stop Mode, OFF when exits to Run Mode

Note • If the name of the subroutine is incorrect, the subroutine will not run when the PLC is in Stop mode.

• The PLC enters Stop mode at the end of the program scan. When the PLC exists Stop Mode, it will start a program scan.

• This features is not supported by the V120-12 series.

Page 47: VisiLogic - Ladder Programming

Stop Mode Subroutine Ladder Elements and Functions List

VisiLogic: Ladder Programming 39

Ladder Elements and Functions ListContacts

Direct Contact (NO)

Inverted Contact (NC)

Positive Transition (Rise)

Negative Transition (Fall)

Immediate: Read Physical Input

Immediate: Update High-speed Input

Coils

Direct Coil

Inverted (negated) Coil

Set Coil

Reset Coil

Toggle Coil

Immediate: Write to Output

Compare

Greater Than

Greater/Equal

Equal

Not Equal

Less/Equal

Less Than

Within Range

Math

Add

Subtract

Multiply

Divide

Page 48: VisiLogic - Ladder Programming

Ladder Elements and Functions List Stop Mode Subroutine

40 VisiLogic: Ladder Programming

Modulo

Linearization, vector

Factor

Power

Square Root

Increment/Decrement

Floats

Basic: Store Direct,Add, Sub, Mul, Div, Abs

Extended: Square Root, Power, Exp, LN, Log10, A Mul (10^B)

Trig: Sin, Cos, Tan, ArcSin, ArcCos, ArcTan, Degrees, Radians

Compare: Greater Than, Greater Equal, Equal, Not Equal, Less Equal, Less Than

Convert: A+B/n, INV (A+B/n)

Logic

AND

OR

XOR

Shift Left/Right

Rotate Left/Right

Bit Set/Reset

Bit Test

RS-SR Flip-Flop

RLO to Bit

Clock

Time

Day Of Week

Day Of Month

Month

Year

UTC (Universal Time) functions

Page 49: VisiLogic - Ladder Programming

Stop Mode Subroutine Ladder Elements and Functions List

VisiLogic: Ladder Programming 41

Store

Reset Numeric

Store Direct Function

Store Indirect Function

Store Timer/Counter Preset

Load Indirect Functions

Load Timer/Counter Preset

Store Time/Counter: Current Value

Load Timer/Counter: Current Value

Load Timer Bit Value

BCD to NUM, Num to BDC

Fill Direct

Vector Copy

Step in Range

Vector

Load

Load Timer Bit Value

Store

Find

Fill / Fill Offset

Copy / Copy Offset

Compare / Compare Offset

Bit to Numeric, Numeric to Bit

Get Max

Get Min

Vector: Copy Memory

Shift Byte Left

Calls

Jump to Label

Load HMI Display

HMI Display Loaded

Page 50: VisiLogic - Ladder Programming

Ladder Elements and Functions List Stop Mode Subroutine

42 VisiLogic: Ladder Programming

Load Last HMI Display

Call Subroutine

Subroutine Return

Strings

Num to ASCII, ASCII to NumI

Display RTC (ASCII

Time to ASCII

Timer

IP to ASCII

Mac Address to ASCII

Transpose

Strings: Section Operations

Set String Library

Strings:Text Library to ASCII

COM

Set PLC Name

Set PLC ID Number

COM Port: Init

Dial and Hang-up

Last Call (CLIP): Identifying Callers

Ethernet TCP/IP

Send e-mail

CANopen

CANbus UniCAN

CANbus, Layer 2

DF1 (Slave, AB Protocol)

HMI

Load HMI Display Function

HMI-Ladder: Draw Pixel/Line

HMI-Ladder: Clear Rectangle

HMI-Ladder: Previous Var

Inverse Var/Hide Var

Data Tables

Read/Write

Page 51: VisiLogic - Ladder Programming

Stop Mode Subroutine Ladder Elements and Functions List

VisiLogic: Ladder Programming 43

Direct Read/Write

Data Tables: Clear Table

Data Tables: Find Row

Page 52: VisiLogic - Ladder Programming

Contacts Direct Contacts

44 VisiLogic: Ladder Programming

SD Card functions

Set SD Card Password

SD Card: Folder Report Function

SD Card and Data Table Functions (Ladder)

SD Card: Data to Excel

SD File Functions

SD Block Functions

Immediate Elements Immediate: Read Physical Input

Immediate: Update High-speed Input

Immediate: Write to Output

Immediate: Write to Physical Analog Output

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

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 Inputs 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.

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

Page 53: VisiLogic - Ladder Programming

Direct Contacts Contacts

VisiLogic: Ladder Programming 45

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.

Page 54: VisiLogic - Ladder Programming

Contacts Inverted Contacts

46 VisiLogic: Ladder Programming

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

Memory Bit System Bit Network System Bit Network System Input Output Timer

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

An emergency light contains an example of an Inverted Contact.

Normally, there is power flow through the emergency light’s Inverted Coil and the light stays off.

During an electric power outage, the power flow through the Inverted Coil stops and the emergency light comes on.

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

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

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

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

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

Memory Bit System Bit Output Timer Counter

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

Page 55: VisiLogic - Ladder Programming

Positive Transition Contact ( Rise ) Contacts

VisiLogic: Ladder Programming 47

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 is re-activated when the linked signal turns from OFF to ON.

Note • Execution time for Positive and Negative Transition contacts is considerably greater than the execution time for direct and indirect contacts. However, you can decrease the amount of transitional contacts in your program.

Decreasing Number of Transitional Contacts

You can use the coil of a bit operand to save the positive transition of a contact, and then use the direct contact of the operand in your program.

You can use the Direct Contact of SB 13 instead of using the Positive Transition Contact of SB 3, and the Direct Contact of SB 15 instead of using the Positive Transition Contact of SB 7. SB 3 is a pulse generator, with a cycle time of 1 second and a duty cycle of 50% (0.5 seconds ON, 0.5 seconds OFF). SB 13 is the Positive Transition (rising edge) contact of SB 3. SB 7 is a also a pulse generator, with a cycle time of 0.1 second. SB 15 is the Positive Transition (rising edge) contact of SB 7.

Page 56: VisiLogic - Ladder Programming

Contacts Positive Transition Contact ( Rise )

48 VisiLogic: Ladder Programming

Rise/Fall Usage Summary

The maximum number of Rise/Fall elements that is allowed in a project depends on the controller model. To ascertain how many elements of each type are in the project, use the Rise/Fall utility on the View menu. The sum of the results must not exceed:

V570 – 1024 (0…1023) V350 – 1024 ( 0…1023) V130 – 512 ( 0…511) V2xx – 256 ( 0…255)

If a program exceeds this number, Error 1017 results. However, in certain cases, the actual compiled number of Rise/Fall elements is greater than the total that is shown in the Summary. Examples are shown below.

Example 1

Example 2

Page 57: VisiLogic - Ladder Programming

Negative Transition Contact Contacts

VisiLogic: Ladder Programming 49

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

Memory Bit System Bit Network System Bit

Page 58: VisiLogic - Ladder Programming

Coils Direct Coil

50 VisiLogic: Ladder Programming

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.

Note • Execution time for Positive and Negative Transition contacts is considerably greater than the execution time for direct and indirect contacts. However, you can decrease the amount of transitional contacts in your program.

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. Coil types include:

Direct Coil Inverted Coil Set Coil Reset Coil Toggle Coil

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

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

Page 59: VisiLogic - Ladder Programming

Inverted Coil Coils

VisiLogic: Ladder Programming 51

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..

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

Memory Bit System Bit Output Timer

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

To place a coil in a Ladder net:

1. Click a Coil icon on the toolbar.

2. Move your cursor to the desired location in the net, then click.

3. The coil drops into place.

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

Page 60: VisiLogic - Ladder Programming

Operands Toggle Coil

52 VisiLogic: Ladder Programming

Output 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.

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

Toggle Coil A toggle coil changes its state when it is activated. You can link it to any of the following bit operands:

Memory Bit Output

Toggle Coil is fast;the execution time is shorter that Reset Coil.

An example of a toggled coil is an light switch. When you turn on a light, it stays lit until you toggle it; it then turns off. The light stays off until you toggle it back on.

OperandsLadder 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.

Note that there are differences between Standard and Enhanced Vision Divisions.

To View Operand Lists 1. Select the Operand tab at the bottom of the Output Window; the operands

are displayed.

2. Click an operand type in the left pane; a list of that operand type is displayed.

Note that you can edit values and descriptions in the Output Window.

Operand Types and Symbols Type Symbol Q’ty

Standard+ V130

Q’ty Enhanced

Value Address Range Standard

Address Range Enhanced

Input I 544 Bit I0-I543

Output O 544 Bit O0-O543

Timer T 192 384 32-bit T0-T191 T0-T383

Counters (C)

c 24 32 16-bit C0-C24 C0-C31

Memory Bit

MB 4096 8192 Bit MB0-MB4095 MB0-MB8191

Memory Integer

MI 2048 4095 16-bit MI0-MI2047 MI0-MI4094

Page 61: VisiLogic - Ladder Programming

X Operands (Enhanced only) Operands

VisiLogic: Ladder Programming 53

Memory Long Integer

ML 256 512 32-bit ML0-ML255 ML0-ML511

Double Word (unsigned)

DW 64 256 32-bit DW0-DW63 DW0-DW255

Memory Floating Point Integer

MF 24 64 32 MF0-MF24 MF0-MF63

Constant Value # Dynamic Dynamic

X Operands (Enhanced only) X Operands are processed within the CPU’s RAM memory. Use them in subroutines where scan time is critical, as for example during Interrupt Routines.

Note that X Operand values are not retained, meaning that they are not backed up by battery.

Type Symbol Quantity Value Address Range

X Bit XB 1024 Bit XB0-XB1023

X Integer XI 512 16-bit XI0-XI511

X Long Integer XL 256 32-bit XL0-XL255

X Double Word (unsigned) XDW 64 32-bit XDW0-XDW63

Page 62: VisiLogic - Ladder Programming

Operands System Operands

54 VisiLogic: Ladder Programming

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 Word (unsigned SDW 64 32-bit

Network Operand Types and Symbols If a controller is networked, the following operands are accessible to other controllers:

Type Symbol Quantity Value Address Range Network System Bit NSB 8 Bit SB200-SB207

Network Input NI 17 Bit I0-I16

Network System Integer NSI 2 16-bit SI200-SI201

Linking Operands to Elements When you place a Ladder element or function on a net, the Select Operand and Address dialog box opens. All of the operands and operand types that are displayed in the Select Operand and Address dialog box are applicable to the element or function that you have 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.

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

For example:

MB 10 — «10» is the address of the MB Operand MI 35 — «35» is the address of the MI Operand T 12 — «12» is the address of the Timer Operand

You can also assign descriptions to the operands you use in your application.

Page 63: VisiLogic - Ladder Programming

Power-up Values Operands

VisiLogic: Ladder Programming 55

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

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

You can assign Power-up Values in the:

Select Operand and Address Dialog Box Check the box next to the plug-shaped icon. This enables you to enter a value in the Power-up value fill-in field.

Operand View Window

1. Select the Operand tab at the bottom of the screen.

2. Click on the Operand type to display the list of operands.

3. Enter Power-up values in the column headed by the Power-up icon.

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

To use a Constant Value in your program, select the Constant option in the Select Operand and Address dialog box and enter a number. You can also select the unsigned integer option. When entering the value, you can toggle to Hex via <CTRL> + <H>.

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

1. Select the Constant tab in the Output Window; the list of Constant Values opens.

2. Enter a Description and a Value; note the Unsigned option.

Page 64: VisiLogic - Ladder Programming

Operands Memory Bits (MB)

56 VisiLogic: Ladder Programming

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.

Memory Bits (MB) Memory Bits are bit operands ( 0 or 1).

There are 4096 MBs, address MB 0 — MB 4095.

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

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

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

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

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

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

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

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

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

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

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

Page 65: VisiLogic - Ladder Programming

Timers (T) Operands

VisiLogic: Ladder Programming 57

Timer Bit Value: A timer is scanned as a bit data type (scan for OFF, scan for ON). The result of the scan is dependent on the timer type.

Timer Preset Value. A running timer always decrements (counts down)from the Preset Value. The Preset Values are loaded for all timers at power up. The Preset Value is also loaded into the Current Value when the timer is reset.

Timer Current Value. The current value of the timer is dependent on the timer type.

All timer types are activated by a rising transition edge, OFF to ON. The condition you use to activate the timer should be scanned only once per PLC program scan

TD- Timer: On Delay

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

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

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

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

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

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

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

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

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

Page 66: VisiLogic - Ladder Programming

Operands Timers (T)

58 VisiLogic: Ladder Programming

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.

Page 67: VisiLogic - Ladder Programming

Timers (T) Operands

VisiLogic: Ladder Programming 59

TE Timer: Extended Pulse

When the timer’s Start Condition rises, and the Bit Value is OFF, the timer’s Preset Value is loaded into the timer’s Current Value. The timer begins to run and the Bit Value turns ON.

If the timer’s Start Condition remains ON during subsequent PLC cycles, the Current Value of the timer continues to decrement. However, if the timer’s Start Condition rises before the timer has decremented to its Preset Value, the timer reloads the Preset Value into the Current Value, and again begins to decrement. Note that a falling Start condition does not affect the timer.

When the timer has decremented to 0 the timer’s Bit Value turns OFF. Note that when the timer has finished running, its Current Value is 0.

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

When the timer’s Reset Condition falls while the timer’s Start Condition is ON, the timer stops. When the Start condition rises, the timer begins to run, counting down from the Preset Value, 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.

Page 68: VisiLogic - Ladder Programming

Operands Counters (C)

60 VisiLogic: Ladder Programming

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

• The maximum amount of time that you can set a timer for is 99 hours, 59 minutes, and 59.99 seconds.

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

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

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

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

A counter counts rising-edge pulses.

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

Note • Counter values can be 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.

Page 69: VisiLogic - Ladder Programming

Memory Integers (MI) Operands

VisiLogic: Ladder Programming 61

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

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

There are 2048 MIs (Address MI 0 — MI 2047).

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

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

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

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

Double Word (DW) Double Words are 32-bit unsigned integer operands, maximum value 4,294,967,295.

There are 64 Double Words, address DW0 to DW63.

Memory Floating Point Integer (MF) Floating point integers are 32-bit integer operands that may be signed or unsigned, with a range of -3.402E37 to -1.176E-35 for negative numbers, and +1.176E-35 to +3.402E37 for positive numbers.

There are 24 MFs (MF 0 — MF23).

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

Page 70: VisiLogic - Ladder Programming

Operands X Operands (Enhanced only)

62 VisiLogic: Ladder Programming

X Operands (Enhanced only) X Operands are processed within the CPU’s RAM memory. Use them in subroutines where scan time is critical, as for example during Interrupt Routines.

Note that X Operand values are not retained, meaning that they are not backed up by battery.

Type Symbol Quantity Value Address Range

X Bit XB 1024 Bit XB0-XB1023

X Integer XI 512 16-bit XI0-XI511

X Long Integer XL 256 32-bit XL0-XL255

X Double Word (unsigned) XDW 64 32-bit XDW0-XDW63

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

System Operands are used by the controller’s operating system to manage certain functions and values. Many System Operands are linked to fixed parameters and are read-only, such as SB 2 Power-up bit, which turns ON for a single cycle whenever the controller powers up.

Other System Operands can be written to by the program, or via INFO Mode. For example, to calculate the current internal temperature of the controller, you can turn on SB 14; the controller will then write the current temperature into SI 14, which is read only.

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.

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.

• All SBs and SIs which do not have descriptions are reserved for use by the system.

System Bits

General, SBs 0-15# Description Turns ON when: Turns OFF

when: Reset by:

Page 71: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 63

SB 0 Always 0 Never Always SB 1 Always 1 Always Never SB 2 Power-up bit Power-up occurs, for 1

scan

Note that SB2 is limited to 800 instances per program. You can use SB2 to drive MBs and use those in your program. If you are using Enhanced Vision, note that XBs are initialized at powerup. 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 Battery needs to be replaced, or RAM has failed

Battery and RAM are functioning

Reset by user: via info, or Communication

SB 10 Float Error By OS when the result of a float operation is an illegal float value. Error code is in SI440.

By user, or at power-up.

SB 11 User Stack Overflow SB 13 ON at Rising Edge of SB3

(1sec pulse) Turns ON when SB3, 1 second pulse, rises

OS

SB 14 Calculate current controller temperature (not supported by V120/130/350)

By user. When SB 14 turns ON, the value in SI 14, Current Controller Temperature updates.

By OS OS

SB 15 ON at Rising Edge of SB7 (100 mS pulse)

Turns ON when SB7, 100mS second pulse, rises

OS

Touchscreen models only (V280), SBs 16-17, 20-22# Description Turns ON when: Turns OFF when: Reset by: SB 16 Touchscreen

Active Touchscreen is actually being touched Note that the touch property must be assigned to a variable. If this property is assigned, touching the variable activates it, causing it to be marked by the blinking cursor.

The screen is not being touched.

OS

SB 17 Enable/Disable Touch-screen indication, Message Board function

User turns ON to enable a message to be handwritten on the touch-screen with a stylus

User turns it off. User

SB 22 Enable Virtual Keypad (Relevant only to Standard Vision + Touchscreen, not Enhanced))

ON by default in Touchscreen-only models (V290). Causes a Virtual Touchscreen to be shown on screen when the user touches a display entry variable. . In Touchscreen + HMI keypad models (V280), user turns ON to enable Virtual keypad. When ON, the normal alphanumeric keypad is suspended.

Off by default in all models with physical; keypad May be turned OFF by user.

User/ OS

Enable all HMI keys during Keypad Entry, SB 23# Description Turned ON Turned Off Comments SB 23 Enable all HMI

keys during By program or user

Off by default. Once turned ON, must be

By default, an active Keypad Entry variable suspends the

Page 72: VisiLogic - Ladder Programming

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

64 VisiLogic: Ladder Programming

Keypad Entry turned OFF by program or user.

normal activity of keypad keys. This means that the following SBs do not rise during keypad entry: SB 40-49, 51, 52, 55, & 56. Turning SB 23 enables the SBs to rise during keypad entry.

# Description Turned ON Turned Off Comments SB 23 Enable all HMI

keys during Keypad Entry

By program or user

Off by default. Once turned ON, must be turned OFF by program or user.

By default, an active Keypad Entry variable suspends the normal activity of keypad keys. This means that the following SBs do not rise during keypad entry: SB 40-49, 51, 52, 55, & 56. Turning SB 23 enables the SBs to rise during keypad entry.

Initialize and Reset PLC, SB 24# Description Turned ON Turned Off Comments SB 23 Enable all HMI

keys during Keypad Entry

By program or user

Off by default. Once turned ON, must be turned OFF by program or user.

By default, an active Keypad Entry variable suspends the normal activity of keypad keys. This means that the following SBs do not rise during keypad entry: SB 40-49, 51, 52, 55, & 56. Turning SB 23 enables the SBs to rise during keypad entry.

# Description Turned ON Turned Off Comments SB 24 Initialize and

Reset PLC By program or user

Off by default. Once turned ON, must be turned OFF by program or user.

Set this to cause PLC to reset, and to initialize all operands to 0. Note that SB 300 performs Reset only.

HMI Display tasks, SBs 26-34SB25 Use operand

value as Index of HMI variable

User User Enables a variable to be indirectly addressed

SB 26 Exiting OS Draw Mode (ON for 1 cycle after OS draw)

By OS Turns ON for a single cycle when SB 28 turns OF. This happens at the following times:

When the PLC exits Info ModeRises the cycle after a Display is entered. When Virtual Keypad mode exits.

By OS OS Draw Mode means that the controller’s Operating System takes control of the LCD screen:

During Info Mode When a Display is entered When the Virtual Keypad (touch-screen models) is displayed

SB 27 Disable all keypad automation (touch-screen + keyboard models only, V280)

By program If SB 22 is ON, SB 27 turns ON automatically

By program If SB 27 is ON when a Display is shown:

The user cannot navigate through the variables using the Enter or Right-arrow keys. No Keypad Entry Variable will be marked by the blinking cursor. In this case, a variable may be

Page 73: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 65

activated by: � Touch (V280 only)—assuming

it has been assigned the Touch property.

� By writing the variable ID # into SI 250, either via Info or Online mode.

SB 28 LCD: controlled by OS (OS drawing on LCD)

By OS at entry to drawing mode, remains ON during the drawing task:

Info Mode. Rises when a Display is entered. When the V290 enters Virtual Keypad mode and displays the virtual keypad on the LCD

By OS when the OS exits the drawing mode:

PLC exits Info Mode. After a Display is entered. When Virtual Keypad mode exits.

Any Ladder- drawn elements (ex. Draw Axis, Trends, Draw Pixel/Line), are cleared when SB 28 turns ON; the programmer may use the Negative Transition of SB 28 to refresh these elements on the LCD.

SB 29 HMI keypad entriescomplete, reload vars (Relevant for non touch-screen models: V120, V230,V260)

By program By OS Turn SB 29 ON after data is keyed into any variable, to enable the user to skip keying in data for the remaining variables in the current display. When SB 29 is ON:

No cursor blinks on screen. The current values of all variables is loaded on screen.

SB 30 Keypad Vars Locked (Standard: OS turns ON after entries complete (Enhanced: User turns ON/OFF) (Relevant for non touch-screen models: V120, V230,V260)

Standard Vision By OS, after all HMI keypad entries are complete By SB29 turning ON By program

Enhanced Vision (non touch-screen)

Turned ON by User

When a Display is entered By turning SB31 ON When SB 27 and 29 turn OFF When keypad entry variable is touched

Use SB 30 to run ladder tasks that require data entered via keypad.

When a variable is active, pressing the Enter button on the keypad signals that the user has finished entering the value. When the Enter button has been pressed for each variable in the current display, SB 30 turns ON.

Note • To immediately re-enable data entry (restore cursor) turn SB31 ON

SB 31 Refresh current LCD screen display variables (Relevant for non touch-screen models: V120, V230,V260)

By program By OS Restores the Display cursor, re-activates all keypad entry variables in the current Display.

SB 32 HMI keypad entry in progress

By OS By OS This turns ON automatically when the blinking cursor is on an active variable.

SBs 33 and 34 function when an HMI Display that calls a subroutine is loaded/unloaded from the display screen. Note • ASCII String Display: In cases where a Display contains a Display ASCII String Variable, and the linked subroutine contains the Display String ‘trigger’ MB, reset this MB when the Display unloads by using the falling edge of SB 34. SB 33 Load Display with

linked Call Subroutine

By OS By OS When a Display containing a Call Subroutine starts loading, SB 33 turns ON for a single scan cycle the

Page 74: VisiLogic - Ladder Programming

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

66 VisiLogic: Ladder Programming

first time the linked subroutine runs. Use this SB to initialize operands in the HMI subroutine.

SB 34 UnLoad Display with linked Call Subroutine

By OS By OS When a Display containing a Call Subroutine starts unloading, SB 34 turns ON for a single scan cycle the last time the linked subroutine runs.

SB 36 INFO mode By OS, Remote Access, or program

Turns OFF when user exits Info Mode

SB 37 Exclude last Display from FIFO

By Remote Access, or program

OS Enables user to skip going back to certain Displays.

SB 38 Invert Touchscreen element pixels (Text, images)

By program By program If a Touchscreen text or image element is touched and this bit is on, the pixels in the element reverse color.

SB 110

Draw: Out of Range

The OS attempts to draw a line or pixel outside of the legal limits of the controller’s LCD.

At the beginning of every cycle

OS

SB 250

Keypad entry within limits

By OS By OS » The current Display is either re-called or changed, or » At the beginning of the next program cycle.

Turns ON for one scan when the entered value is within the Min/Max limits set in the variable’s parameters.

SB 251

Keypad entry exceeds limits

By OS By OS » The current Display is either re-called or changed, or » At the beginning of the next program cycle.

Is ON when the entered value is within the Min/Max limits. Note • When this SB is ON, the blinking cursor remains on the active variable even after the user presses Enter.

# Description Turns ON when: Turns OFF when:

Reset by:

SB 26 Exiting OS Draw Mode (ON for 1 cycle after OS draw) OS Draw Mode means that the controller’s Operating System takes control of the LCD screen:

During Info Mode When a Display is entered When the Virtual Keypad (touch-screen models) is displayed When ‘Symbols’ are displayed during Keypad Entry.

Turns ON for a single cycle when SB 28 turns OFF. This happens at the following times:

When the PLC exits Info Mode. Rises the cycle after a Display is entered. When Virtual Keypad mode exits. After ‘Symbols’ are displayed during Keypad Entry.

At all other times

OS

SB 27 Enter Display without active Keypad Entry Variables If SB 27 is ON when a Display is

By program By program

Page 75: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 67

shown: The user cannot navigate through the variables using the Enter or Right-arrow keys. No Keypad Entry Variable will be marked by the blinking cursor. In this case, a variable may be activated by: � Touch (V280 only)—

assuming it has been assigned the Touch property.

� By writing the variable ID # into SI 250, either via Info or Online mode.

SB 28 LCD controlled by OS (OS drawing) OS Draw Mode means that the controller’s Operating System takes control of the LCD screen:

During Info Mode When a Display is entered When the Virtual Keypad (touch-screen models) is displayed When ‘Symbols’ are displayed during Keypad Entry.

ON when the PLC is in Info Mode. ON when ‘Symbols’ are displayed during Keypad Entry. Rises when a Display is entered. In V290, which uses a virtual screen keyboard, SB 28 is always ON.

PLC exits Info Mode After a Display is entered.

OS

SB 29 Current keypad entry sets SB 30 (HMI keypad entries complete) Turn SB 29 ON after data is keyed into any variable, enabling the user to skip keying in data for all of the variables on-screen. Also refreshes all Display variables on-screen

By program By program OS

SB 30 HMI keypad entries completed When a variable is active, pressing the Enter button on the keypad signals that the user has finished entering the value. Note • Turning this SB OFF, via SB31, enables the variables to be reactivated.

Turns ON when: Turns ON when: When the Enter button has been pressed for each Variable, SB 30 turns ON. By program By SB29, by program

Turns OFF when:

SB31 turns ON When PLC is initialized

OS

SB 31 Refresh current LCD screen display variables

Turning this ON reloads the display, initializing all Keypad Entry variables.

OS

SB 32 HMI keypad entry in progress OS SBs 33 and 34 function when an HMI Display that calls a subroutine is loaded/unloaded from the display screen. Note • ASCII String Display: In cases where a Display contains a Display ASCII String Variable, and the linked subroutine contains the Display String ‘trigger’ MB, you can reset this MB when the Display unloads by using the falling edge of SB 34. SB 33 Load Display with linked Call

Subroutine — Use this SB to initialize operands in the HMI subroutine. — Do not link this SB to a positive or negative transitional contact.

When a Display containing a Call Subroutine starts loading, SB 33 turns ON for a single scan cycle the first time the linked subroutine runs.

OS

SB 34 UnLoad Display with linked Call Subroutine

When a Display containing a Call Subroutine starts

OS

Page 76: VisiLogic - Ladder Programming

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

68 VisiLogic: Ladder Programming

unloading, SB 34 turns ON for a single scan cycle the last time the linked subroutine runs.

OnLine Test SB 35# Description Turns ON when: Turns OFF

when: Reset by:

SB 35 OnLine Test Point During OnLine mode, Single Scan, when more than 1 instance of OnLine Test Point is activated (receives RLO).

One or none instances are activated

INFO mode, SB 36# Description Turned ON Turned Off Comments SB 36 INFO mode By OS, Remote

Access, or programTurns OFF when user exits Info Mode

Delay time to enter Info Mode is 4 seconds, may be modified via SI 50

Exclude last Display from FIFO,SB 37# Description Turned

ON Turned Off

Comments

SB 37 Exclude last Display from FIFO

By program

By program Enables user to skip going back to certain Displays

Invert Touchscreen element pixels, SB 38# Description Turned

ON Turned Off

Comments

SB 38 Invert Touchscreen element pixels (Text, images)

By program

By program If a Touchscreen text or image element is touched and this bit is on, the pixels in the element reverse color.

FLASH Memory Access, SB 39# Description Turned

ON Turned Off

Comments

SB 39 FLASH on LCD, Display not Refreshed (V570, 290-C,530)

FLASH memory is on screen

By OS

Keypad keys, SBs 40-72Note that the presence of function keys is model-dependant. # Description Turns ON when: Turns OFF

when: Reset by:

SB 40 Key: # 0 Key is pressed/held down

Key is released

OS 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

Page 77: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 69

SB 51 Left Arrow SB 52 Right Arrow SB 53 ENTER SB 54 <i> (ON when in Info mode, may be

turned ON in order to enter Info, via Remote Access or user program)

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

Disable HMI cursor blinking SB 73Note that the presence of function keys is model-dependant. # Description Turns ON when: Turns OFF

when: Reset by:

SB 73

Disable HMI cursor blinking (Turn ON to disable blinking)

By user program By user program

By user program

Download Complete, SB 75# Description Turns ON when: Turns OFF

when: Reset by:

SB 75

Download Complete, PLC and HMI applications

When Download is finished, Turns ON for single scan ; PLC can then run application

The scan after Download ends

OS

Keypad Entry: Focus (V130), SB 76# Description Turns ON when: Turns OFF

when: Reset by:

SB 76

Keypad Entry: Focus (V130) If SB 76 is OFF after Keypad Entry, the user must use the arrow keys to move to the next variable in the Variable Tab Order If SB 76 is ON, the user moves to the next variable by pressing the Enter button twice: — Once to ‘approve’ the value — Once to jump to and open the next variable for data entry. To enable the user to press Enter once, to both jump to and to automatically open the next variable for data entry, turn ON both SB76 and SB108 (Press «Enter» 1x) Note that the user can press ESC to exit keypad entry mode.

By user By user By user, or at Power-up

Page 78: VisiLogic - Ladder Programming

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

70 VisiLogic: Ladder Programming

Modem ‘busy’ status, (Color only) SB 77-79Each port is linked to an SB indicating modem communication status. These can be used as a condition to sending new messages. # Description Turns ON

when: Turns OFF when: Reset by:

SB 77 Modem ‘Busy’: COM Port 1 Port is busy transmitting or receiving

Port is free OS SB 78 Modem ‘Busy’: COM Port 2 SB 79 Modem ‘Busy’: COM Port 3

COM Port/Modem initialization, SBs 80-85Each port is linked to 2 SBs indicating COM Port/Modem initialization status following COM Init. Both SBs are initialized to OFF by the OS, at Power-up and at the beginning of COM Init process. When COM Init is complete, one is ON, the other OFF. # DescriptionSB 80 Modem Initialized: COM Port 1 Example: COM Port 1SB 81 COM Port/Modem Initialization

Failed: COM Port 1 SB 80 SB

81

SB 82 Modem Initialized: COM Port 2 0 0 After Power-up, before COM Init SB 83 COM Port/Modem Initialization

Failed: COM Port 2 0 1 Modem Initialization attempt failed,

Modem is not initialized SB 84 Modem Initialized: COM Port 3 1 0 Modem Initialization attempt

succeeded, Modem is initialized. SB 85 COM Port/Modem Initialization

Failed: COM Port 3 1 1 Not possible

Modem connection status, SB 86-88Each port is linked to an SB indicating modem connection status. These can be used in conjunction with SBs 132-137, which indicate indicating whether incoming or outgoing data is flowing through the port, to troubleshoot problems as shown in the Help topic Modem Troubleshooting. # Description Turns ON

when: Turns OFF when: Reset by:

SB 86 Modem Connection Status: COM Port 1

PLC receives ‘Connect’ string from modem

Hang-up PLC receives string ‘No Carrier’ PLC receives break signal

OS, at Power-up

SB 87 Modem Connection Status: COM Port 2

SB 88 Modem Connection Status: COM Port 3

I/O Expansion Modules, SB 91See Help topic Detecting short-circuited end devices # Description Turns ON when: Turns OFF

when: Reset by:

SB 91 I/O Exp. Module—Command buffer is full

ON when commands cannotbe sent to the I/O module.

OFF when commands can be sent to the I/O module.

GPRS modem connected, SB 100

# Description Turns ON when: Turns OFF when:

Reset by:

SB 100 GPRS modem connected

Call Remote device begins. GPRS incoming call is answered.

End Session succeeds. Disconnect from Network succeeds.

OS

Page 79: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 71

MODBUS Read Long: SB 102# Description Turns ON when: Turns OFF when: Reset by: SB 102 MODBUS Read

long: Transpose 16 bits of 32-bit long

By User program • By default • By User Program

User

Press «Enter» 1x (V130) SB 108 # Description Turns ON when: Turns OFF

when: Reset by:

SB 108

Press «Enter» 1x (V130) If BOTH SB76 and SB108 are ON, after entering a keypad value, the user needs to press Enter only once, to approve the value, and to automatically jump to and open the next variable for data entry. Note that the user can press ESC to exit keypad entry mode.

By user By user By user

Draw: Out of Range SB 110

# Description Turns ON when: Turns OFF when:

Reset by:

SB 110 Draw: Out of Range The OS attempts to draw a line or pixel outside of the legal limits of the controller’s LCD.

At the beginning of every cycle

OS

Keypad keys, letter/number order, V130 SB115Each one of the V130 keypad keys 2 to 9 are marked with both letters and numbers. For example, Key 2 is marked with the numeral 2, and by the letters abc. By default, at keypad entry, the a single keypress enters ‘2’, two key presses enter ‘a’, three enter ‘b’, and so on. In order to cause the letter ‘a’ to be selected by a single keypress, turn SB 115 ON. This

reverses the number-letter order to letter number, and in the case of Key 1, reverses number-symbol to symbol-number. # Description Turns ON : Turns OFF : Reset by: SB 115 V130 only. Reverse key

letter/number order User Program Default.

User Program User

Save Trends to SD Card, SB 116-119When you save a Trend to an SD card, each time you start and stop the save, another segment is added to the .utr file. # Description Turns ON : Turns OFF : Reset by: SB 116 SD Trends to SD: Set

to Overwrite .utr User application User

application User

Use these to control the display of Trend segments on the HMI screen. Use the inverted contact of SB119 as a condition. SB 117 SD Trends: Jump to

next segment User application User

application User

SB 118 SD Trends: Jump to previous segment

User application User application

User

SB 119 SD Trends: System busy — Draw Trend is gathering data

User application User application

User

DTR/DSR signals, SBs 120-125SBs 120-125 register the signals that each port receives from the DTR and DSR pins of a

Page 80: VisiLogic - Ladder Programming

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

72 VisiLogic: Ladder Programming

serial communication cable. The DTR SBs 120, 122, and 124 are also used by the OS to control the DTR signal during RS485 serial communications, and during GPRS communications using the Sony Ericsson GPRS modem. # Description Turns ON

when: Turns OFF when:

Reset by:

SB 120 DTR COM Port 1 (signal output from PLC)

DTR signal present

DTR signal absent

OS, may also be reset by user

SB 121 DSR COM Port 1 (signal input to PLC)

DSR signal present

DSR signal absent

OS

SB 122 DTR COM Port 2 (signal output from PLC)

DTR signal present

DTR signal absent

OS, may also be reset by user

SB 123 DSR COM Port 2 (signal input to PLC)

DSR signal present

DSR signal absent

OS

SB 124 DTR COM Port 3 (signal output from PLC)

DTR signal present

DTR signal absent

OS, may also be reset by user

SB 125 DSR COM Port 3 (signal input to PLC)

DSR signal present

DSR signal absent

OS

COM SBs 132-137Each port is linked to 2 SBs indicating when incoming or outgoing data is flowing through the port. To troubleshoot problems, use these in conjunction with the Modem Connection Status SBs 86-88, as shown in the topic Modem Troubleshooting. # Description Turns ON

when: Turns OFF when: Reset by:

SB 132 COM Port 1, Data Transmission

During data send When data is not being sent

OS

SB 133 COM Port 2, Data Transmission

SB 134 COM Port 3, Data Transmission

SB 135 COM Port 1, Data Receive During data reception

When data is not being received

OS SB 136 COM Port 2, Data Receive SB 137 COM Port 3, Data Receive

Remote Access — Read Only, SB140# Description Turns ON : Turns OFF : Reset by: SB 140 Remote Access — Read

Only User application When ON, PLC ignores requests from Remote Access and Remote Operator

User application

User

Ethernet-enabled controllers only, SBs 141-176# Description Turns ON

when: Turns OFF when:

Reset by: Comments

SB 141

Ethernet: Card Exists

Ethernet card is found

No Ethernet card is installed

When the Ethernet: Card Initialization FB runs, the PLC checks whether an Ethernet card is installed.

SB 142

Ethernet: Card Initialized

Ethernet card initialization succeeds

Ethernet card initialization fails

SB 143

Ethernet: Socket 0 Initialized

Socket 0 initialization succeeds

Socket 0 initialization fails

SB 144

Ethernet: Socket 1 Initialized

Socket 1 initialization succeeds

Socket 1 initialization fails

SB Ethernet: Socket Socket 2 Socket 2

Page 81: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 73

145 2 Initialized initialization succeeds

initialization fails

SB 146

Ethernet: Socket 3 Initialized

Socket 3 initialization succeeds

Socket 3 initialization fails

SB 147

Ethernet: Socket 0 Connected

Connection established via Socket 0

Socket 0 is free SBs 147-150 turn ON when:

• Link exists • Ethernet Card

initialization complete

• Socket initialization complete

• Hardware TCP/IP Socket state is Connection Established

SB 148

Ethernet: Socket 1 Connected

Connection established via Socket 1

Socket 1 is free

SB 149

Ethernet: Socket 2 Connected

Connection established via Socket 2

Socket 2 is free

SB 150

Ethernet Status: Socket 3 Connected

Connection established via Socket 3

Socket 3 is free

SB 151

Ethernet Link: Communication established

A link exists (cable plugged in)

No link exists (cable disconnected)

This refers to the physical Ethernet cable

SB 152

Ethernet Link: 10baseT

When a 10baseT link is detected, during data transmit/ receive.

When a 10baseT link is not detected, during data transmit/ receive.

SB 153

Ethernet Link: 100baseT

When a 100baseT link is detected, during data transmit/ receive.

When a 100baseT link is not detected, during data transmit/ receive.

SB 154

Ethernet: data collision

More than one device is transmitting data over the Ethernet network

One or no devices are transmitting data over the Ethernet network

SB 155

Ethernet: Socket 0 Send in Progress

Data is being transmitted via Socket 0

Data is not being transmitted via Socket 0

SB 156

Ethernet: Socket 1 Send in Progress

Data is being transmitted via Socket 1

Data is not being transmitted via Socket 1

SB 157

Ethernet: Socket 2 Send in Progress

Data is being transmitted via Socket 2

Data is not being transmitted via Socket 2

SB 158

Ethernet: Socket 3 Send in Progress

Data is being transmitted via Socket 3

Data is not being transmitted via Socket 3

SB 159

Enable Unicast, Socket 0

Turn ON (ON by default) to enable Socket 0 for Unicast

Turn OFF to disable Socket 0 for Unicast

SB 162

Ethernet Reconnect parameters saved

Page 82: VisiLogic - Ladder Programming

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

74 VisiLogic: Ladder Programming

SB 163

Connection is Closed (Socket 0)

By OS, when connection is closed

SB turns ON when Close Connection is performed. This is after Transmit / Receive buffers are empty or 1-second timeout has passed. Socket is initialized.

SB 164

Connection Closed (Socket 1)

By OS, when connection is closed

SB 165

Connection Closed (Socket 2)

By OS, when connection is closed

SB 166

Connection Closed (Socket 3)

By OS, when connection is closed

SB 167

Ethernet Critical error

Turns ON at critical error

OS reads Ethernet card registers to SI 300 — 427, then re-initializes the card. User must reset PLC

SB 168

Enable «Link lost» auto recover

Automatically retry link

Do not automatically retry (default)

SB 168 should be turned ON at power-up. It is OFF by default to preserve backwards compatibility with applications created previous to OS 4.70 B14. If SB 168 is ON, when the Ethernet link fails, the OS saves the Ethernet parameters and resets: • SB 142 Card Initialized • SBs 143-146 Socket initialized (Sockets 0-3) • SBs 147-150 Socket connected (Sockets 0-3) When the Ethernet link is reestablished, the O/S performs CARD INIT and SOCKET INIT for all 4 sockets according to the saved parameters.

SB 169

Automatic reconnect requested, in progress (Socket 0)

At Ladder TCP — Used as internal flags by O/S in order to perform auto reconnect (user parameters SI 107 – 110)

SB 170

Automatic reconnect requested, in progress (Socket 1)

SB 171

Automatic reconnect requested, in progress (Socket 2)

SB 172

Automatic reconnect requested, in progress (Socket 3)

SB 173

Automatic reconnect

Page 83: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 75

requested (Socket 0)

SB 174

Automatic reconnect requested (Socket 1)

SB 175

Automatic reconnect requested (Socket 2)

SB 176

Automatic reconnect requested (Socket 3)

Received message is invalid, SBs 180-182When SBs180-182 turns ON, the STX, ETX, or checksum of the received message was incorrect. SB Description Turns ON when: Turns OFF when: 180 COM1 Received Message Invalid,

STX/ETX/Checksum (V570, 290-C,130)

Received message is invalid

Another message is received

181 COM2 Received Message Invalid, STX/ETX/Checksum (V570, 290-C,130)

182 COM3 Received Message Invalid, STX/ETX/Checksum (V570, 290-C,130)

SMS message transmission status, SBs 184-185Standard Vision DivisionControllers in this division can only support a single modem. You can connect a modem to any COM port. However, note that SB 184 TX Success and SB 185 TX Failed indicate message transmission status regardless of the actual COM port connected to the modem. Enhanced Vision DivisionControllers in this division can support a modem on each COM port. Each port is linked to a Succeed and Fail SB: COM1: SB 184 and SB 185, COM2: SB186 and SB 187, COM3: SB 188 and SB 189.

Each port has a Succeed and Fail SB. When the Send process begins from a particular COM port, for each and every message, both the Succeed and Fail SB turn OFF. If the message is sent successfully, the bit turns ON, indicating the success or failure of that message. If the message fails, when TimeOut is exceeded or because the modem reports an error, the bit remains OFF. Operands that are linked by the user to SMS FBs may be found in the topic SMS Operands. SB Description Turns ON when: Turns OFF when: 184 SMS: Transmission Succeeded,

COM1 (ACK) Transmission succeeds Transmission begins

185 SMS: Transmission Failed, COM1 (NACK)

Transmission fails

186 SMS: Transmission Succeeded, COM2 (ACK)

Transmission succeeds

187 SMS: Transmission Failed, COM2 (NACK)

Transmission fails

188 SMS: Transmission Succeeded, COM3 (ACK)

Transmission succeeds

189 SMS: Transmission Failed, COM3 (NACK)

Transmission fails

SMS messages: Write to Vector SBs 198-199Use these together with SI 198 and 199 to write incoming SMS messages to a vector of operands. This does not affect the function of the SMS message function blocks.

Page 84: VisiLogic - Ladder Programming

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

76 VisiLogic: Ladder Programming

# Description Turns ON when: Turns OFF when:

Reset by:

SB 198 SMS Arrived, Record the Received SMS Message Length in SI 198

If SB 199 is set, , SB 198 is set when a message is received

User Program User Program

SB 199 Save SMS to Memory Vector

User Program

CANbus, SBs 200-215, 236-237The function of some operands depends on whether the CANbus network is defined as CANbus ISC or UniCAN.

When using CANbus ISC To learn how to use these operands to communicate data, check the topic CANbus Networking. # Description Turns ON

when: Turns OFF when:

Reset by:

SB 200 CANbus Network operand SB 201 CANbus Network operand SB 202 CANbus Network operand SB 203 CANbus Network operand SB 204 CANbus Network operand SB 205 CANbus Network operand SB 206 CANbus Network operand SB 207 CANbus Network operand SB 208 CANbus Network operand SB 209 CANbus Network operand SB 210 CANbus Network operand SB 211 CANbus Network operand SB 212 CANbus Network operand SB 213 CANbus Network operand SB 214 CANbus Network operand SB 215 CANbus Network operand SB 236 CANbus Network

communication error Error is fixed.

SB 237 CANbus Network disable

When using UniCAN

SB# Description Turned ON Turned Off Comments 200 Broadcast bit When UniCAN

broadcast MB is received whose status is ON.

When UniCAN broadcast MB is received whose status is OFF.

The user must initialize this SB

201 High Priority Send Buffer Status

When full When not full Use the negative transition of this SB as a Send UniCAN condition for High Priority messages

202 Low Priority Send Buffer Status

When full When not full Use the negative transition of this SB as a Send UniCAN condition for Low Priority messages

203 UniCAN Broadcast in Progress

When data is being sent

When data is not being sent

Use the negative transition of SB 203 as a Send Broadcast condition,

Page 85: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 77

SD Card, SBs 217-219# Description Turns ON when: Turns OFF when: Reset

by: SB 217

SD Card Present An SD Card is in the slot, and is formatted to FAT32

SD Card is not found, or is incorrectly formatted

OS

SB 218

SD Card Write Enabled Write is enabled: the card’s write-protect lock is off

Write is disabled: the card’s write-protect lock is on

OS

SB 219

SD FIFO Empty (SD Card may be Ejected)

Power-up No SD Card is in Slot No SD requests exist

There are no SD requests pending, such as Data Table Copy/Log, Alarms, or from Info Mode

OS

CANopen, SBs 240-243SB# Description Turns ON when: Turns OFF when: Reset

by: SB 240 CANopen: Configuration

downloaded The CANopen Configuration FB is downloaded to the PLC

No CANopen Configuration is present

PLC

SB 241 CANopen: Configured CANopen Configuration was successful

CANopen Configuration failed

PLC

SB 242 CANopen: SDO in Progress SDO is busy transferring data

SDO is not in progress PLC

SB 243 CANopen: SDO transfer failed

SDO data transfer fails SDO transfer begins PLC

Keypad entry, SBs 250-251To learn how to use these operands to communicate data, check the topic Limit Keypad Entry. # Description Turns ON when: Turns OFF

when: Reset by:

SB 250 Keypad entry within limits (Relevant for Standard Vision and non touch-screen models: V120, V230,V260)

Turns ON for one scan when the entered value is within the Min/Max limits set in the variable’s parameters.

• The current Display is either re-called or changed, or • At the beginning of the next program cycle.

SB 251 Keypad entry exceeds limits (Relevant for Standard Vision and non touch-screen models: V120, V230,V260)

Is ON when the entered value is within the Min/Max limits. Note • When this SB is ON, the blinking cursor remains on the active variable even after the user presses Enter..

• The current Display is either re-called or changed, or • At the beginning of the next program cycle.

SMS ASCII, SB 279# Description Turns ON when: Turns OFF

when: Reset by:

SB 279 Send SMS messages in ASCII format

User Program Should be turned ON at power-up, before Com Init.

User Program User Program

SMS Force SMS Display, SB 280# Description Turns ON when: Turns OFF Reset by:

Page 86: VisiLogic - Ladder Programming

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

78 VisiLogic: Ladder Programming

when: SB 280 Force Message

Display on Cell Phone

User Program Should be turned ON at power-up, before Com Init.

User Program User Program

CANopen Buffer Management SB 284-293 Use a Negative Transition contact of the appropriate SB as a Send condition. # Description Turns ON when: Turns OFF when: Reset

by: SB 284 Send PDO1 Buffer is full: SI 212 =8 Number of messages in buffer is less

than maximum PLC

SB 285 Send PDO2 Buffer is full: SI 213 =8 SB 286 Send PDO3 Buffer is full: SI 214 =8 SB 287 Send PDO4 Buffer is full: SI 215 =8 SB 288 RTR PDO1 Buffer is full: SI 216 =12SB 289 RTR PDO2 Buffer is full: SI 217 =12SB 290 RTR PDO3 Buffer is full: SI 218 =12SB 291 RTR PDO4 Buffer is full: SI 219 =12SB 292 Send NMT MC Buffer is full: SI 221 =8 SB 293 Send RTR

NMT Buffer is full: SI 222 =12

Reset PLC, SB 300# Description Turns ON

when: Turns OFF when:

Reset by:

SB 300 Reset PLC Note that SB24 performs Reset + Init.

By program or Remote Access

Reset is run OS

Backup Security PLC, SB 303 # Description Turns ON

when: Turns OFF when:

Reset by:

SB 303 Backup Security in Memory (values stored for SB 314 Block PC access to PLC, SI[253] Info Password value, SI [50] Info Mode press time)

By program or Remote Access

Reset is run OS

Buzzer, SBs 310, 311# Description Turns ON

when: Turns OFF when:

Reset by:

SB 310 Buzzer Turn this ON to sound a buzzer Buzzer included only in Touch-screen only models

By user By user User

SB 311 Buzzer — Screen Touch Turn this ON to cause a keypad touch (both HMI keypad and Virtual keypad) to sound a buzzer in relevant models

By user, ON by default in V290/280

By user User

Backup security. SB 314 # Description Turns ON

when: Turns OFF when: Reset by:

SB 314 Blocks PC access to PLC By user By user User

Page 87: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 79

(VisiLogic, RA, etc. ) (Default)

SD File Utilities, SBs 324-29SB 324

SD: Open File (Read to SD) (Status messages in SI 67)

When Ladder function SD File: Open successfully activates a file for Read

When Ladder function SD File: Close finishes closing an open file and SB 327 (EOF) turns ON

OS. At Power-up and at SD File: Close

SB 325

SD File: Read Chunk in Progress (a Chunk is 512 bytes long)

When the Ladder function SD: Get Next File Chunk is reading a chunk into a vector

When the Ladder function SD: Get Next File Chunk has finished reading the chunk

OS. At Power-up

SB 326

SD Read File: End Of File (EOF, entire file has been read)

When the When the Ladder function SD: Get Next File Chunk reads the final Chunk

When the last chunk has been read, and when Ladder function SD File: Close start

OS. At Power-up and at SD File: Close

SB 327

SD: Open File (Write to SD) (Status messages in SI 67)

When Ladder function SD File: Open successfully activates a file for Write on a SD card

SB 328

SD File: Write Chunk in Progress (a Chunk is 512 bytes long)

When the Ladder function SD: Get Next File Chunk is writing a chunk into a vector

SB329 SD Write File: End Of File (EOF, entire file has been read)

When the When the Ladder function SD: Get Next File Chunk writes the final Chunk

Break from External Device, SBs 330-332Each COM port is linked to an SB that monitors communication signal breaks. Note # Description Turns ON when: Turns OFF when: Reset

by: SB 330

Break from External Device, COM Port 1

PLC receives break from external device

PLC has finished processing tasks related to break. If no messages are received after the break, the PLC resets the SB after 5 seconds. Each message received causes the PLC to wait for 40 seconds before resetting the SB.

OS

SB 331

Break from External Device, COM Port 1

SB 332

Break from External Device, COM Port 1

GPRS status, SBs 334-336Each COM port is linked to an SB indicating GPRS communication status. These can be used as a condition to sending new messages. # Description Turns ON

when: Turns OFF when: Reset by:

SB 334 GPRS ‘Active’: COM Port 1 Port is transmitting or receiving GPRS signals

Port is free OS SB 335 GPRS ‘Active’: COM Port 2 SB 336 GPRS ‘Active’: COM Port 3

Break from Modem, SBs 337-339

# Description Turns ON when: Turns OFF when: Reset by:

SB 340

Log to SD in Progress Row is being copied from DT to SD Card

When copy is complete OS

SB Copy Data Table from Entire Data Table is being When the Write process OS

Page 88: VisiLogic - Ladder Programming

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

80 VisiLogic: Ladder Programming

341 PLC to SD in Progress copied from DT to SD Card is complete

SB 342

Copy Data Table from SD to PLC in Progress

Entire Data Table is being copied from SD Card to DT

When the Write process is complete

SD Card DT and Log Functions, SBs 340-342SB 340

Log to SD in Progress Row is being copied from DT to SD Card

When copy is complete OS

SB 341 Write Data Table from PLC to SD in Progress

Entire Data Table is being copied from DT to SD Card

When the Write process is complete

OS

SB 342 Read Data Table from SD to PLC in Progress

Entire Data Table is being copied from SD Card to DT

When the Write process is complete

OS

SD Card DT and Log Functions, SBs 343-345SB 343

File Report in Progress

While Report process is in progress

When the Report is complete

OS

SB 344 Write delimited line to SD in Progress

While line is being written When the Write process is complete

OS

SB 345 Read Data Table from SD to PLC in Progress

Entire Data Table is being copied from SD Card to DT

When the Write process is complete

SD Card Data Block Functions, SBs 346-49SB 346

SD Data Block 0 Busy When a Write or Read utility is being run on a Data Block

When no utility is running

OS

SB 347 SD Data Block 1 Busy SB 348 SD Data Block 2 Busy SB 349 SD Data Block 3 Busy

SD Card Alarms to SD, SB 352# Description Turns ON when: Turns OFF when: Reset

by: SB 352 SD: Enable writing

Alarm History to SD Turned ON by user. Causes the PLC to write entire Alarm History to the SD Card

Off by default. PLC stores Alarm History to memory.

At Power-up, or by user

SD Card Delete File, SB 358SB 358

SD: Delete File in Progress

ON when function is busy

OFF when function is not busy

OS

SD Card File Info, SB 359SB 359

SD: File Info function in Progress

ON when function is busy

OFF when function is not busy

OS

SD Card Clone in Progress, SB 366SB 366

SD Clone in Progress Note that the process can take from several seconds to several minutes.

Turns ON when a Clone file is being created OR installed

Turns OFF : • When Cloning process is complete • Power up • SB 217 SD Card Present turns ON

OS

Page 89: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 81

Data Tables, SB 500# Description Turns ON when: Turns OFF

when: Reset by:

SB 500 User RAM overlap warning

When the application requests more memory than the PLC currently has free:

Function Blocks memory requirements may have exceeded free memory. Data Table requirements exceed free memory. During DT Write: If the value of the pointer to DT is greater than the number of DT lines

Requirements fall with memory capacity

PLC initialization When a password is assigned to a VisiLogic project

Utility Error SB 399# Description Turns ON when: Turns OFF

when: Reset by:

SB 399 Ladder utility failure

A Ladder utility fails to function. When SB399 is ON, the number of the failed utility is found in SI 26

At Power-up User Program

Retain Inputs Forced Value, SB 501# Description Turns ON

when: Turns OFF when:

Reset by:

SB 501 Retain Inputs Forced Value after power failure Set SB 501at power-up to retain the state of inputs that are forced to 0 or 1 when the power is turned off. Reset SB 501at power-up to initialize forced inputs

By User By User User, or when PLC is initialized

System Integers

General, SIs 0-14# Description Value Comments SI 0 Scan Time, Resolution:

Units of 1 mSec Updated by the controller at the end of every scan.

A scan is a complete execution of the controller’s entire program: reading inputs, executing the Ladder program, updating the outputs, running the HMI program,and processing communications. Scan time depends on the size and complexity of the application. Check the topic Program Sequencing: Modules, Subroutines, Labels & Jumps.

SI 6 Current key pressed

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

Relevant for V120, V130, V280, V290. LCD contrast is set for V230, V260 via potentiometer.

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

To learn how to use this operand, check the topic Assigning a Unit ID number

SI 9 LCD Backlight intensity 0 — 0ff Note that this is relevant for CSTN

Page 90: VisiLogic - Ladder Programming

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

82 VisiLogic: Ladder Programming

1 — On (low intensity) (V230 only) 2 — On (max. intensity) — Default

displays only.

SI 14 Current controller temperature (not supported by V120/130/350)

Includes decimal point. For example, if the value is 245, the actual value is 24.5. The value in SI14 is only updated when SB 14 is turned ON by the user.

Ladder Utility Failure Indication, SI 26# Description Value Comments 26 Ladder Utility

Failure IndicationCheck table below When SB 399 is ON, and any Ladder utility fails, SI

26 contains the utility number. Any time a utility fails, SI 26 is overwritten. Note that resetting SB 399 initializes SI 26.

Function Value Math: Linearization 1 Math: Factor 2 Vector: Fill 3Logic: Shift Right 4 Logic: Shift Left 5 Logic: Rotate Right 6 Logic: Rotate Left 7 Vector: Bit to Numeric 8 Vector: Numeric to Bit 9 the function Config 10 Math: Power 11 Math: Square Root 12 Vector: Get Minimum (value in vector) 13 Vector: Get Maximum (value in vector) 14 Vector: Find Bit (in vector) 15 Vector: Copy 16 COM: Init function 17 Logic: Test Bit (in vector) 18 Logic: Set Bit (in vector) 19 Logic: Reset Bit (in vector) 20 Vector: Load 21 Vector: Store 22 Vector: Compare 23 Vector: Compare (Offset) 24 Vector: Copy (Offset) 25 Vector: Fill (Offset) 26 Data Tables: Read 27 Data Tables: Write 28 Data Tables: Read Line 29 Data Tables: Write Line 30 HMI: Display Loaded 31 HMI: Load Last HMI Display 32 /*EthernetUtils.OnlyfortheV200Series*/ TCP/IP COM Init 33 TCP/IP Socket Init 34 Connect: TCP 35 Close: TCP 36 Math: Float Trig SIN 37 Math: Float Trig COS 38 Math: Float Trig TAN 39 Math: Float Trig ASIN 40 Math: Float Trig ACOS 41

Page 91: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 83

Math: Float Trig ATAN 42 Math: Float Extended EXP 43 Math: Float Extended LN 44 Math: Float Extended LOG10 45 Math: Float Extended Power 46 Math: Float Extended Square root 47 Math: Float Basic Add 48 Math: Float Basic Subtract 49 Math: Float Basic Multiply 50 Math: Float Basic Divide 51

Math: Float Convert A+B/n 52 Math: Float Convert A+B/n (decimal) 53 Math: Float Convert Inverse (A+B/n) 54 Math: Float Convert Inverse (A+B/n) (decimal) 55 Math: Float Basic ABS 56 Math: Float Trig Degrees 57 Math: Float Trig Radians 58 Math: Float Compare Greater Than 59 Math: Float Compare Greater Equal 60 Math: Float Compare Equal 61 Math: Float Compare Not Equal 62 Math: Float Compare Less Than 63 Math: Float Compare Less than Equal 64 Float Store 65 COM: Dial 66 COM: Hangup 67 Strings: Transpose 68 Vector: Copy Memory 70 Strings: Num to ASCII 71 HMI: Draw Pixel 73 HMI: Draw Line 74 Logic: RS FlipFlop 75 Logic: SR FlipFlop 76 Time To ASCII 77 Clear Table Row column, Clear All DB 78 Online Point 79 Vector: Shift 80 Data Table: Find 81 Math: Float Compare In Range 82 Vector:Load Timer Scan Bit 83

More: Immediate Read Physical Input 84 Immediate: Write to Physical Output Digital or Analog 85 More: Immediate Update Physical High-speed Input 86

Strings: IP to ASCII 87 COM: Set PLC Name 88 Data Table: Find Extended 89 HMI: Clear Rectangle 90 More: Debug Interval Start 91 More: Debug Interval End 92 Strings: Time to ASCII 93 Store: Num to BCD 94 Store: BDC to Num 95 Clock: RTC to UTC 96 Clock: UTC to RTC 97

Math: Linearize Vector 98

Data Table: Read Line 99

Page 92: VisiLogic - Ladder Programming

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

84 VisiLogic: Ladder Programming

Data Table: Write Line 100 Immediate: Write to Physical Analog Output 101 Com TCP/IP RFC 1305 102 Math: Formula 103

String: ASCII to Num 104 Data Table: Copy Row 105 Data Table: Copy Column 106 Strings: MAC Address to ASCII 107 Vector: Struct 108 Com: Send UniCAN 109 Data Table: Clear Row 110 Data Table: Clear Column 111 Com: UniCAN Check Alive 112 Com: UniCAN Broadcast 113 Vector: Swap Bytes 114 Com: UniCAN Message Arrived 115 Logic: RLO to Bit 117 Vector: Sort 118 Com: CANopen Configuration 119 Com: CANopen Send PDO 120 Com: CANopen Send RTR PDO 121 Com: CANopen Send SDO 122 Com: CANopen Send NMT Control 123 Com: CANopen Send NMT Node Guard 124 Com: CANopen Send Synch 125 Com: CANopen 126 Com: CANopen Send Download STR 127 Com: CANopen Send Upload STR 128 Vector: String Length 129 HMI: Is HMI Last Displayed 130 Com: TCP Send RAW UDP 131 Com: TCP Receive RAW UDP 132 Com: CAN Layer 2 Send 133 Com: CAN Layer 2 Receive 134

Last Call Received I o135 More: Idle 136

Alarms: Show Groups 137 Alarms: Show Alarms 138

Strings: Set String Library 139

Strings: Timer to ASCII 140 Strings: Lib.Str. to ASCII 141 Vector: Toggle Bit in Vector 142 Vector: Toggle Bit in Vector 143 Step In Range 144 Strings to ASCII 145

Strings: to NUM 145 Strings: remove 146 Strings: insert 147 Strings: left 148 Strings: right 149 Strings: middle 150 Strings: find_in_str 151 COM: Set PLC Network ID 152 Strings: Timer to ASCII 153 HMI: Refresh HMI Display 154 Data Tables: Read/Write Column 155

Page 93: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 85

Reserved 156 SD: Write DT to SD .udt 158 SD: Log DT row to SD 159 Email 160 Alarms: Clear History Buffer 161 COM: Send TCP RAW 162 COM: Scan TCP RAW 163 SD: Set SD Password 164 String: Replace STR A with STR B 165 SD: Save Trend to SD 166 SD: Stop Trend to SD 167 SD: Read from .udt SD to DT 168 Immediate: Frequency Measurement based on HSC 169 Reserved 170 Immediate: Stop Frequency Measurer 171 Immediate: Reset HSC 172 COM: CANopen: Map register bytes 173 SD: Read SD.udt to Data Table 174 CAN J1939: Config 175 CAN J1939: Activate cyclic send 177 CAN J1939: Send pgn 178 Data Tables: Read row 179 Data Tables: Write row 180 COM: TCP/IP: Ping 181 SD: Read SD Block (udb) to Operand Vector 182 SD: Write from Operand Vector to SD Block (udb) 183 SD: Create Block 184 SD: File Read: Open 185 S SD: File Read: Next Chunk 186 SD: File Read: Close 187 CAN J1939: Request PGN Data 188 COM: Df1 Scan 189 COM: SNMP Trap 190 SD: Create Delimited Line 191 SD Write: open file 192 SD Write: read file 193 SD Write: close file 194 SD: Write Delimited Line 195 SD Folder Report: Number of Files 196 SD File: Delete file 197 SD: Write DT to SD .udt 198 SD: Log DT row to SD 199 SD Files: File Info 200 SD Data Tables: Search .udt for key 201 COM: Telegram parser 202 COM: CANLayer2 ScanEx 203 COM: Set SNMP community name 204 Backup security operands 205 SD: Safely Remove 206 SD: Clone 207 COM: DNS Resolver 208 Data Tables: Delete Rows 209 SD: Rename SD File 210

Real Time Clock, SIs 30-37# Description Value Comments SI 30 Current second 0-59 According to RTC SI 31 Current time 24 hour clock:

14:59 = 1459 SI 32 Current date 12/07 = 12th of July

Page 94: VisiLogic - Ladder Programming

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

86 VisiLogic: Ladder Programming

SI 33 Current year 2007=2007 SI 34 Current day of week 1-7 SI 35 Current hour 0-23 SI 36 Current minute 0-59 SI 37 Current day of month 30 = 30th day of month

Touch Coordinates, SIs 40, 41# Description Value Comments SI 40 Touchscreen is being

touched- X coordinates If the screen is touched, SI 40 shows the current location on the X axis.

When the screen is not touched, SI 40 = -1

SI 41 Touchscreen is being touched-Y coordinates

If the screen is touched, SI 41 shows the current location on the Y axis.

When the screen is not touched, SI 41 = -1

Keypad Entry Out of Limits, SI 45# Description Value Comments SI 45 Numeric Key Entry Out

of Limit — Counter of Attempts

Counts the number of failed attempts to enter a value, such as a password

Enhanced Vision only If a Legal Entry bit is defined, SB 94 does not turn ON if the entered value is out of range. The keypad stays on screen until a legal value is entered. You can use SI 45 in conjunction with a Compare function to exit the variable.

Refresh HMI, Buttons, Frame, Text , SI 46# Description Value Comments SI 46 Refresh HMI Buttons,

Frame, Text Units 10 msec, redraws these items in current display to reflect changes

Select Touch Keyboard Type (enhanced only), SI 49# Description Value Comments SI 49 Select Touch

Keyboard Type 0, 1, 257 See the topic Vision Controller Divisions, Special

Issues, Virtual Keypads: Enhanced Touchscreen Models

INFO delay time, SI 50# Description Value Comments SI 50 INFO delay time Default by O/S

(every power up) = 4 seconds

Units: seconds Legal values: 0, 3 to 20 If you force or store ‘0’ into equal Zero INFO is disabled For V290 Touching the <i\> key on the touch screen starts Info Mode Touching a legal Ladder application variable clears the INFO time

SI 51 Info Mode, Serial COM Monitor: # of messages not displayed

Number of messages not displayed. Initialized every time the Monitor is entered

When entering the monitor, the display must synchronize with the actual messages in real time. This SI contains the number of messages that are not displayed before synchronization is complete.

email Limit File Attachment Size, SI 58 # Description Value Comments SI 58 email: Limit File

Attachment Size 1=1024 bytes Power-up default is 1

Maximum per attachment = 10 (10 MB)

Page 95: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 87

Note that the file size must not be changed while the Send is in Progress.

Max number of *.udt files saved to SD, SI 63-64# Description Value Comments SI 63 Maximum number of

Trend files that can be saved (read-only)

0-64 The maximum amount of Trend files (*.udt files) in a single folder is 64. The value in SI 63 shows the number of remaining *.utr files; if 5 *.utrt files exist, SI 64 = 59

Initialized at Power-up Updated when:SB 217 is ON and SB 341 turns ON

SI 64 Maximum number of DT files that can be saved (read-only)

0-64 The maximum amount of Trend files (*.udt files) in a single folder is 64. The value in SI 64 shows the number of remaining *.udt files; if 5 *udt files exist, SI 64 = 59

Initialized at Power-up Updated when:SB 217 is ON and SB 341 turns ON

SD Card Status Messages, SI 66# Description Value Comments SI 66 SD Card Status

Messages This SI is a bitmap; a bit turns ON to indicate status.

All bits OFF – No errors Bit 1 – Read: End Of File indication Bit 2 – Can’t open file Bit 3– Error while writing to a file Bit 4 – Error while reading from a file Bit 5 – Failed to close a file Bit 6 – SD is full Bit 7 – Path not found Bit 14 — Turns ON when SD is inserted into slot and PLC runs checks, turns OFF when SB 217 turns ON

Initialized at Power-up. While the application is running, the user application must reset the bits.

SD Card Read/Write Files, SIs 67, 68# Description Value Comments SI 67 SD Card, Read Files:

Status Value 0= No error 1= No SD card in Slot 2= Vector is not long enough to contain data (may be at upper address limit of that data type) 3= Path to SD file not found 4=Another file is currently open 5 = File is closed 6 = Busy: previous request in progress 7 = File Open Error

SI 67 reports status for the following SD File utilities:

• Read SD File: Open • Read Next File Chunk • Read SD File: Close

Page 96: VisiLogic - Ladder Programming

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

88 VisiLogic: Ladder Programming

8 = Read Error 9 = File Close error

SI 68 SD Card, Write Files: Status

Value 0 = No error 1 = No SD card in Slot 2 = Vector is not long enough to contain data (may be at upper address limit of that data type) 3 = Path to SD file not found 4 = Another file is currently open 5 = File is closed 6 = File Open error 7 = Write Error 14 = File Close error

SI 68 reports status for the following SD File utilities:

• Write SD File: Open • Write Next File Chunk • Write SD File: Close

SD Card File Open Time, SI 69# Description Value Comments SI 69 SD Card: File Open Time

(may signal file fragmentation)

Time required to open SD files, in units of 10mSec.

Each time a file is opened, the OS updates this value. A typical first write (open + write) =approx. 500mSec, typical first read (open + read)= approx. 60mSec Over time, this may increase due to file fragmentation. If the time becomes to great, the card should be reformatted Reset at Power-up and when SD card is removed.

SD Trend Status, SIs 160-167# Description Value Comments SI 160 SD Trend 1 status This SI is a bitmap; a bit

turns ON to indicate status when the function Start Saving Trend to SD runs.

All bits OFF – No errors Bit 4 – Start Saving Trend is in progress for another Trend Bit 7 – This Trend does not exist (may result when an MI is used to provide the Trend number, and the value points to a non-existent Trend) Bit 8 – Start Saving Trend is in progress for this Trend Bit 9 – Start Saving Trend failed

SI 161 SD Trend 2 status SI 162 SD Trend 3 status SI 163 SD Trend 4 status SI 164 SD Trend 5 status SI 165 SD Trend 6 status SI 166 SD Trend 7 status SI 167 SD Trend 8 status

SD DT blocks to/From SD, SIs 330 -333# Description Value Comments SI SD: Write DT from PLC When the application runs Initialized at Power-up

Page 97: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 89

330 to SD — Total Amount of Data to be Copied (blocks of 512 bytes)

the function Copy Data Table to SD, SI 330 shows the total number of blocks of data to be copied from the PLC.

SI 331

SD: Write DT from PLC to SD — Remaining Amount (blocks not yet copied)

Shows how many blocks of data remain to be copied. The value increases by 1 each time a block is copied.

Initialized: When the PLC begins to copy a new block of data to the SD cardAt Power-up.

SI 332

SD: Read DT SD to PLC -Total Amount of Data to be Copied (blocks of 512 bytes)

When the application runs the function Copy Data Table to PLC, SI 332 shows the total number of blocks of data to be copied from the SD.

Initialized at Power-up

SI 333

SD: Read DT from SD to PLC — Remaining Amount (blocks not yet copied)

Shows how many blocks of data remain to be copied. The value increases by 1 each time a block is copied.

Initialized: When the PLC begins to copy a new block of data from the SD card At Power-up.

FLASH Storage, SI 72# Description Value Comments SI 72 FLASH Storage

Bitmap (V570, 290-C)

A bit is on when data is present Bit 0 = Data backup from RAM to FLASH Bit 1 = Upload data (.vlp in PLC can be uploaded) Bit 2-7 = Internal Bits 8-15 = String storage The SI is updated by the OS after every download.

FLASH informations is divided into sections. The status the bits shows if data is stored in these sections. Relevant to V570, V290-C.

Alarms: Status, SI 74# Description Value Comments SI 74 Alarms Utility,

General Status A bit is on when data is present Initialized at power-up Bit 0 = Alarm Version in OS does not match VisiLogic version Bit 1 = No Alarms defined Bit 2 = Internal error Bit 8 = History buffer full

Operand assignment error, SI 75# Description Value Comments SI 75 Operand

assignment error 0 = no error Any other value = Error

Number of functions assigned operands that are of illegal address or type. Relevant to V570, V290-C.

Number of Alarms in History, SI 76# Description Value Comments SI 76 Number of Alarms

currently in History Buffer

Shows the number of Alarms in the PLC memory buffer

COM Port: Port/Modem Status, Error codes, SIs 80-85Each COM Port is linked to 2 SIs; their values and messages are indicated below. SI 80 Modem Status: COM

1Error (SI 81,83,85,) Status ( SI 80,

Page 98: VisiLogic - Ladder Programming

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

90 VisiLogic: Ladder Programming

SI 81 Error Code: COM 1 82, 84) Value Message Value Message 0 No error 0 Modem Idle 1 TimeOut exceeded: no reply 1 Initialization in Progress 2 Reply Error 2 Initialization OK 3 Wrong PIN number 3 Initialization Failed 4 Registration failed 4 Modem Connected 5 PUK number needed 5 Hang-up in progress 10 COM Busy 6 Dial in progress 11 Reply Busy 12 Reply No Dial

15 Attempted Initialization during active break signal. Note that a port cannot be initialized while the break signal is active

16 Error in reply to PIN number 17 Check: CREG failed 18 Check: CREG timeout 19 Check: slots timeout 20 Check: Format timeout

SI 82 Modem Status: COM 2

SI 83 Error Code: COM 2 SI 84 Modem Status: COM

3SI 85 Error Code: COM 3

Max. Delay between characters, MODBUS + Modem, SI 100SI Description Value 100 Maximum Time

Delay between characters (units 2.5ms) MODBUS + Modem

When MODBUS (Serial) is configured, the MODBUS function checks SI 100. If SI 100 = 1, a time interval of up to 2.5 msecs is permitted between characters, if SI 100 contains 2, the permitted interval is 5 msecs ( n x 2.5 =interval). Note that: — The power-up value is 1, — the application must update SI 100 before the MODBUS configuration is activated.

Ethernet-enabled controllers only, SIs 101-148# Description Value Comments SI 101 TCP/IP retries base time out Legal values are

1 to 10, units of 100 msec (1 stands for 100 msec etc.) Default value is 200 msec.

Same value is for ALL 4 sockets Requires CARD INIT Illegal value request will be rejected (no change)

SI 102 Retries count Legal values are from 1 to 50 Default value is 6

Illegal value request will be rejected (no change)

SI 103 TCP/IP Connection Keep Alive (Socket 0)

Units of 100 msec Note- When value is ‘0’, the function is disabled

Enables the PLC to disconnect if there is no communication from the connected device.

When TCP/IP connection is established (SI 145-148 = 6) check data transport (SDW 14 – 21). If no data transport occurred during the defined time – perform ‘Socket Init’.

SI 104 TCP/IP Connection Keep Alive (Socket 1)

SI 105 TCP/IP Connection Keep Alive (Socket 2)

SI 106 TCP/IP Connection Keep Alive (Socket 3)

Page 99: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 91

Data Transport counter is SDW 38 SI 107 TCP/IP Keep Master

Connection (Socket 0) Units of 100 msec Note- When value is ‘0’, the function is disabled

Enables the PLC to reconnect the connect when there is no communication from the connected device for the defined time.

Note that the value per socket should be higher the regular “keep alive” (SI 103 – 106) Counter of the operation in SDW 45

SI 108 TCP/IP Keep Master Connection (Socket 1)

SI 109 TCP/IP Keep Master Connection (Socket 2)

SI 110 TCP/IP Keep Master Connection (Socket 3)

SI 140 Ethernet Send has failed, per socket ( bitmap)

Bit is ON when Send is not successful

Bitmap: | UDP S3 | UDP S2 | UDP S1 | UDP S0 | TCP S3 | TCP S2 | TCP S1 | TCP S0 |

SI 141 Ethernet Socket 0: Protocol Type

0=PC application (default) 1=MODBUS

(Read-only) Sockets are set to Protocol Type 0 by default. Activating MODBUS Configuration changes the Protocol Type to 1.

SI 142 Ethernet Socket 1: Protocol Type

SI 143 Ethernet Socket 2: Protocol Type

SI 144 Ethernet Socket 3: Protocol Type

Parameter Function SI Value Message S1 145 Socket 0: Status 0 Initialized to UDP, status: Closed SI 146 Socket 1: Status 2 Initialized to TCP, status: Listen SI 147 Socket 2: Status 14 Initialized to UDP, status: Ready SI 148 Socket 3: Status 15 Initialized to UDP, status: Engaged in

Transmit/Receive

GSM Cellular Modem, GSM Signal Quality, SI 185, 188, 191SI Description Value 185 GSM Signal Quality

(V120/230/260/280/290-BW)

The value is written during COM Init of the GSM modem. The value is updated whenever the user uses the GSM Signal Quality FB. A value of -1(FFFF) signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem.

188 GSM Signal Quality COM2 (V570, 290-C)

191 GSM Signal Quality COM3 (V570, 290-C)

SMS messages: Write to Vector SIs 198-199Use these together with SB 198 and 199 to write incoming SMS messages to a vector of operands. This does not affect the function of the SMS message function blocks. SI# Description Value Comments SI 198 Received SMS

Message Length Shows the length of the message in bytes

The data remains until the vector is overwritten

SI 199 SMS to Memory Vector — start of vector

The SMS message data is written starting from this address

To write to a vector of XIs, enter a negative value)

CANBUS, SIs 200-201, 236-237, 240-243The function of some operands depends on whether the CANbus network is defined as CANbus ISC, CANopen or UniCAN.

When using CANopen

SI# Description Value Comments SI 211 CANopen: Number of

received messages Shows the number of received messages in the Receive buffer

Maximum number of messages=128

Page 100: VisiLogic - Ladder Programming

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

92 VisiLogic: Ladder Programming

(except for SDOs) SI 212 CANopen: Number of Send

PDO1 Shows the number of PDO1 messages currently in the PDO1 Send buffer

SI 213 CANopen: Number of Send PDO2

Shows the number of PDO2 messages currently in the PDO2 Send buffer

SI 214 CANopen: Number of Send PDO3

Shows the number of PDO3 messages currently in the PDO3 Send buffer

SI 215 CANopen: Number of Send PDO4

Shows the number of PDO4 messages currently in the PDO4 Send buffer

SI 216 CANopen: Number of Send RTR PDO1

Shows the number of RTR PDO1 messages currently in the PDO1 Send buffer

SI 217 CANopen: Number of Send RTR PDO2

Shows the number of RTR PDO2 messages currently in the PDO2 Send buffer

SI 218 CANopen: Number of Send RTR PDO3

Shows the number of RTR PDO3 messages currently in the PDO3 Send buffer

SI 219 CANopen: Number of Send RTR PDO4

Shows the number of RTR PDO4 messages currently in the PDO4 Send buffer

SI 220 CANopen: Number of Send SDOs

Shows the number of SDO messages currently in the Send buffer

SI 221 CANopen: Number of Send NMTs

Shows the number of NMT module control messages currently in the NMT Send buffer

SI 222 CANopen: Number of Send RTR NMTs

Shows the number of RTR NMT messages currently in the Send buffer

SI 223 CANopen: Send Buffer full (per type)

The bits in this register represent the different Send buffers (except for SDOs)

Maximum number of messages per buffer=8

When a bit is ON, the corresponding buffer is full. High byte:| — | — | — | — | — | — | -| NMT mc | Low byte: | PDO | -| RCV NMT | RCV PDO4| RCV PDO3 | RCV PDO2 | RCV PDO1 | RCV Emergency |

SI 224 CANopen: Number of received SDO messages

Shows the number of received SDOs currently in the Receive buffer

SI 225 CANopen: SDO status The status codes are given below.

Value Message 0 No error 1 PLC in STOP mode 2 CANopen not configured, SB 241 is not set (after configuration) 3 Remote ID is 0 4 Maximum SDO Upload length set to 0 5 SDO in Progress; Download/Upload started while SB242 is ON 6 SDO in Progress Error; SB242 turned OFF during data transfer (system problem) 7 Illegal Operands used in SDO data transfer 8 Number of operands in data type exceeded 9 Process buffer not cleared before SDO Send (system problem) 10 Response Timeout exceeded 11 Receive Error 12 Reserved by CIA 13 Receive Buffer full; more than 127 segments in a block (system problem)

Page 101: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 93

14 Receive Error Toggle bit ON (error in domain segment) 15 Receive domain segment Abort; error code given in SDW 34 16 Byte number error 17 Number of bytes is zero 18 Number of bytes exceeds the maximum upload length 19 Machine State error (system problem) 20 Receive Error in block size transferred from the remote device 21 Send Timeout exceeded 22 Sequence error in the number of segments in block transfer 23 CRC error, block transfer

When using CANbus ISC SI 200 CANbus Network operand

SI 201 CANbus Network operand SI 236 CANbus Network

communication error code Value Message

1 No Acknowledgement 2 CANbus OFF 4 CANbus Warning error 10 ISC receiving TimeOut

SI 237 CANbus Network: failed unit ID

SI 240 SIs 240-243 comprise a bitmap indicating which unit is in error. If, for example, the network includes unit ID numbers 8, 9 and 13, and PLC #9 cannot be accessed, then the ninth bit in SI240 will turn ON. When the error is fixed, the bit falls to OFF

SI 241 SI 242 SI 243

When using UniCAN

SI# Description Comments 200 When a UniCAN Broadcast message is received,

SI 200 contains the ID number of the sending unit.

The user must initialize these SIs

201 When a UniCAN Broadcast message is received, SI 201 contains the value of the MI that is broadcast.

202 Number of Send messages waiting in High Priority buffer

Automatically updates

203 Number of Send messages waiting in Low Priority buffer

204 Number of Received messages waiting in buffer240 These provide a bitmap of controllers 1-60 in

the UniCAN network. When the controller receives a message, the appropriate bit turns ON. These bits are reset by the Answer Received function.

241 242 243

X,YCoordinates, Num Keypad/Alarm screen, SI 244, 245# Description Value Comments SI 244

V1040, X Coordinates, Num Keypad/Alarm screen

Enter the X value to alter the location of these elements on the screen.

Values remain until changed by user

SI 445

V1040, Y Coordinates, Num Keypad/Alarm screen

Enter the Y value to alter the location of these elements on the screen.

Values remain until changed by user

HMI Displays, SIs 249-252SI 249

Last Active Keypad Entry Variable

Contains the ID number of the last active variable.

SI 250 Currently active keypad Currently active keypad entry, read/write.

Page 102: VisiLogic - Ladder Programming

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

94 VisiLogic: Ladder Programming

entry, read/write When either SB 250′ Keypad Entry Within Limits’ or SB251 ‘Keypad Entry Exceeds Limits’ turn ON, the index number of the variable is stored here. As you navigate between variables, as for example with the right-left arrow keys, SI 250 will show only the numbers of variables that have not been completed. Note • A value of -1 indicates that, in this particular display, the user has pressed Enter for all the Keypad Entry variables in the Display.

SI 251 Previous HMI Display Number

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

Info Mode, SI 253SI 253 Password: Info Mode Note that at every power-up, the default password to Info

Mode, 1111, is restored. To maintain a different password after power-up, use SB 2-Power-up as a condition to store the desired password value into SI 253. The password may also be modified by accessing the controller via VisiLogic, then running On-line Test mode and changing the value. This value will be erased at power-up.

Messages Received Counters, SI 274-276SI 274 COM1, Received Message

Counter Counts received messages, increments after message is validated. Initialized by OS at power-up SI 275 COM2, Received Message

Counter SI276 COM3, Received Message

Counter

Float Errors SI 440SI 440 General Error

SB 10 turns on when a Float Erro occurs.

Value Message 3 7FFF or 8000 (integer result)FFFF or 0000(unsigned integer result) 4 +INF or -INF (float result) 5 0.0 (float result) 7 +INF or -INF or NaN (float result) 9 NAN (float result) 10 0 (integer result) 11 Floating point stack underflow 12 Floating point stack overflow

OS Information SI 497, 498SI 497 Firmware Build Number Contains the build number of the OS currently in

the controller. (V120, V230, V260, V280, V290 BW)

SI 498 Firmware Version Number Contains the version number of the OS currently in the controller.(V120, V230, V260, V280, V290 BW)

System Long Integers SL 4 Divide Remainder (signed divide function)

System Double Words # Description Value Comments SDW 0 10mS counter SDW 2 SDW 2 Cycle Counter Increments by 1 every program

cycle SDW 3 2.5 mS counter

SDW 4 Divide Remainder Unsigned divide function SDW 5 Expansion module

Page 103: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 95

short circuit bitmap SDW 6 Snap-in module short

circuit bitmap

SDW 9 Unique PLC ID number (All Visions)

Each PLC has its own unique ID number

Use SDW9 (unique PLC number) to restrict a program to a particular PLC.

SDW 10 Keypad entry variable value

When a keypad entry variable value is entered, this SDW 10 holds the value.

SDW 13 Phone number of last received SMS

last 9 digits

SDW 14 Socket 0: Number of sent transmissions

Updated after each data transmission via Socket 0

SDW 15 Socket 1: Number of sent transmissions

Updated after each data transmission via Socket 1

SDW 16 Socket 2: Number of sent transmissions

Updated after each data transmission via Socket 2

SDW 17 Socket 3 : Number of sent transmissions

Updated after each data transmission via Socket 3

SDW 18 Socket 0: Number of received transmissions

Updated after each data packet received via Socket 0

SDW 19 Socket 1: Number of received transmissions

Updated after each data packet received via Socket 1

SDW 20 Socket 2: Number of received transmissions

Updated after each data packet received via Socket 2

SDW 21 Socket 3: Number of received transmissions

Updated after each data packet received via Socket 3

SDWs that are common to UNICAN and CANopen change function, according to the CANbus type selected in the COM Init function.

SDW 7 UniCAN, CANbus ISC Error

If not 0, contact technical support

CANopen: Number of failed Send attempts

Number of times that data send failed

SDW 8 CANopen: Number of failed Sync attempts

Number of times that send SYNC failed

SDW 56 UniCAN Send message counter

Is initialized when CANbus Port Init runs, then increments at every UniCAN Send.

Note that only messages sent from a UniCAN Send are counted

CANopen: PDO Send Counter

Byte structure: PDO4 | PDO3 | PDO2 | PDO1

SDW 57 UniCAN Receive message counter

Is initialized when CANbus Port Init runs, then increments at every UniCAN Receive.

Note that only messages received from a UniCAN Send are counted, not Broadcast messages or Check if Alive responses.

CANopen: NMT/SDO Send Counter

High bits: NMT Low bits: SDO

SDW 29 CANopen: Bus is OFF Counter

Number of times bus was OFF

SDW 30 Variable display bitmap, 0=Normal, 1=Inverse (or negative)

The value is checked when a display is entered. It is initialized to 0: — At Power-up. — When the program exits the Display.

When a bit is ON, the corresponding variable is displayed in inverted (negative) color; black pixels are changed to white and white to black.

SDW 31 Hide Var The value is checked when a display is entered. It is initialized to 0 at: — Power-up. — When the program exits the Display.

When a bit is ON, the corresponding variable is hidden

SDW 33 CANopen: SDO Number of Bytes

SDO upload: number of bytes received

Page 104: VisiLogic - Ladder Programming

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

96 VisiLogic: Ladder Programming

SDO download: number of bytes sent

SDW 34 CANopen: Abort Code in SDO Abort

Value Message 0503 0000h Toggle bit not alternated 0504 0000h SDO protocol timed out 0504 0001h Client/server command specifier not valid or unknown 0504 0002h Invalid block size (block mode only) 0504 0003h Invalid sequence number (block mode only) 0504 0004h CRC error (block mode only) 0504 0005h Out of memory 0601 0000h Unsupported access to an object 0601 0001h Attempt to read a write only object 0601 0002h Attempt to write a read only object 0602 0000h Object does not exist in the object dictionary 0604 0041h Object cannot be mapped to the PDO 0604 0042h The number and length of the objects to be mapped would

exceed PDO length 0604 0043h General parameter incompatibility reason 0604 0047h General internal incompatibility in the device 0606 0000h Access failed due to a hardware error 0607 0010h Data type does not match, length of service parameter does

not match 0607 0012h Data type does not match, length of service parameter too

high 0607 0013h Data type does not match, length of service parameter too

low 0609 0011h Sub-index does not exist 0609 0030h Invalid value for parameter (upload only) 0609 0031h Value of parameter written too high (upload only) 0609 0032h Value of parameter written too low (upload only) 0609 0036h Maximum value is less than minimum value 060A 0023h Resource not available: SDO connection 0800 0000h General error 0800 0020h Data cannot be transferred or stored to the application 0800 0021h Data cannot be transferred or stored to the application

because of local control 0800 0022h Data cannot be transferred or stored to the application

because of the present device state 0800 0023h Object dictionary dynamic generation fails or no object

dictionary is present (e.g. object dictionary is generated from file and generation fails because of a file error)

0800 0024h No data available

SDW 36 CANopen: Bus OFF error Value Message 0 No error 1 Stuff Error: More than 5 equal bits in a sequence have occurred in a part of

a received message where this is not allowed 2 Form Error: Wrong format in fixed format part of a received frame 3 AckError: The message this CAN controller transmitted was not

acknowledged by another node 4 Bit1Error: During the transmission of a message (with the exception of the

arbitration field), the device wanted to send a recessive level (“1”), but the monitored bus value was dominant

5 During busoff recovery this is set each time a sequence of 11 recessive bits is monitored. This enables the CPU to monitor the proceeding of the busoff

Page 105: VisiLogic - Ladder Programming

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

VisiLogic: Ladder Programming 97

recovery sequence (indicates that the bus is not stuck at dominant or continuously disturbed

6 CRC Error: The received CRC check sum is incorrect 7 Unused code: may be written by the CPU to check for updates

SDW 37 MODBUS Slave: Receive Counter (Bitmap)

Increments a 4-bit field each time a slave receives data

High — >low: | Eth port 3| Eth port 2| Eth port 1| Eth port 0| |spare| | com 3| com 2| com 1|

SDW 38 TCP/IP Keep Alive counter

Increments a 8-bit field each time the O/S initializes the socket due to ‘Keep Alive’ (SI 103-106)

| Eth port 3| Eth port 2| Eth port 1| Eth port 0|

SDW 39 Ethernet general critical error

8-bit counters Bits 24-31: «Ethernet card init” – if the MS Byte (xxx.yyy.zzz.kkk, MS means the xxx part) of the IP/ SUBNET/ GATEWAY is zero – do not init the Ethernet. Bits 16-23: Check once in second if local IP SUB and GATEWAY are ok. Cause set of SB 167. Bits 8-15: TCP (connect) & UDP (send) IP is defined – Read HW remote IP to verify. Case verifies failed: Ignore connect or send. Bits 0-7: While getting message from socket – if the high part of the remote IP high is zero. Cause set of SB 167

SDW 42 100mS Timer Counter, Stable

Counts number of pulses Updates at beginning of program scan only

SDW 43 10mS Timer Counter, Stable

Counts number of pulses Updates at beginning of program scan only

SDW 44 2.5mS Timer Counter, Stable

Counts number of pulses Updates at beginning of program scan only

SDW 45 TCP/IP Keep Master Connection

Increments a 8-bit field each time the O/S initializes the socket due to ‘Keep Alive’ (SI 107-110)

| Eth port 3| Eth port 2| Eth port 1| Eth port 0|

SDW 59 SD Card: Free space (bytes)

Capacity given in 512-byte chunks. The value is written when SB 217 turns ON, and is updated at each write operation. The operand is reset when SB 217 turns OFF.

Initialized at Power-up.

SDW 60 Info Error Status Error Indication SDW 63 Firmware version and

Build number Contains the version number of the OS currently in the controller

Relevant for V570, V290 Color

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

SI Description 86 Modem Connection Status: COM 1 87 Modem Connection Status: COM 2 88 Modem Connection Status: COM 3

Page 106: VisiLogic - Ladder Programming

Logic Functions AND

98 VisiLogic: Ladder Programming

Logic FunctionsFunction blocks are provided for:

Bit Test Set/Reset Bit AND OR XOR Shift Rotate Convert Test Bit RS-SR Flip-Flop RLO to Bit

The internal operation of a function block is transparent to the user. You select input operands; the result is automatically output by the function block.

The input values in a logic function may be:

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

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

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

AND The AND logic function evaluates the state of two integers.

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

If input A and B is false (logic 0), then the output C will be false (logic 0). If either input A or B is false (logic 0) — the output C will be false (logic

0).

The input values in an AND function may be:

Page 107: VisiLogic - Ladder Programming

OR Logic Functions

VisiLogic: Ladder Programming 99

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

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

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).

Page 108: VisiLogic - Ladder Programming

Logic Functions OR

100 VisiLogic: Ladder Programming

The input values in an OR function may be:

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

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

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

Page 109: VisiLogic - Ladder Programming

XOR Logic Functions

VisiLogic: Ladder Programming 101

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

The input values in a XOR function may be:

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

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

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

Page 110: VisiLogic - Ladder Programming

Logic Functions XOR

102 VisiLogic: Ladder Programming

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

Page 111: VisiLogic - Ladder Programming

Shift Logic Functions

VisiLogic: Ladder Programming 103

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

Shift Right

Operand A: contains the value to be shifted. Operand B: contains the number of bits to be shifted (one or more). Operand C: contains the resulting value. Operand D: shows the status of the final (last) bit in the integer after the

operation.

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

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

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

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

Operand A: contains the value to be rotated.

Operand B: contains the number of bits to be rotated.

Page 112: VisiLogic - Ladder Programming

Vector: Bit to Numeric, Numeric to Bit Bit to Numeric

104 VisiLogic: Ladder Programming

Operand C: contains the resulting value. Operand D: shows the status of the final bit in the integer after the

operation.

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

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

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

Vector: Bit to Numeric, Numeric to BitUse these functions to convert an array of bit values to a numeric value, or a numeric value to an array of bits.

The functions are located on the Vector menu.

Bit to Numeric Operand A: contains the Start Address for the array of bits to be

converted. Operand B: is the start of the vector that will contain the converted value.

Take care in addressing operands, since the converted value may not fit into a single register; the function will overwrite as many consecutive registers as it requires to convert the value.

Operand C: contains the length of the bit array that will be converted.

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

Page 113: VisiLogic - Ladder Programming

Test Bit Vector: Bit to Numeric, Numeric to Bit

VisiLogic: Ladder Programming 105

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

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

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

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

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

will be stored.

Note that the maximum number of bits in the vector is 255, 16 MIs or 8 double registers. 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 register, and set it.

Reset Bit enables you to select a bit within a register, and reset it.

Page 114: VisiLogic - Ladder Programming

Vector: Bit to Numeric, Numeric to Bit RS-SR Flip-Flop

106 VisiLogic: Ladder Programming

Operand A, Start of Vector, is the register in which the function will set/rest the bit.

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

Note that the maximum number of bits in the vector is 255, 16 MIs or 8 double registers. The functions are located under the Logic menu on the Ladder toolbar.

RS-SR Flip-Flop The RS and SR Flip-Flop functions are located on the Logic menu. These functions compare the logic state of two inputs, and use the result to determine an output result in accordance with the tables shown below.

RS Flip-Flop SR Flip-Flop

RLO to Bit The PLC Ladder program is based on whether or not there is power flow through the logic rung. When there is power flow, the RLO, Result of Logical Operation, is positive, or ON. At the left-hand ladder rail, there is always power flow; therefore the RLO at the rail may be considered as ON. When there is no power flow, the RLO is negative, or OFF.

Page 115: VisiLogic - Ladder Programming

RLO to Bit Binary Numbers

VisiLogic: Ladder Programming 107

RLO to Bit takes the status of the RLO and stores it in a register bit according to the desired offset.

The rung in the following figure is shown in Online Test mode, showing the power flow in red. The Compare operation (MI1>MI2) in the rung is true. Therefore power flows through the rung, and the RLO is positive (ON). The state of the RLO is stored in MI 3, at an offset of 2 bits, in the third bit of MI 3. The bit turns ON, and MI 3 contains 4.

In the following figure, the Compare operation is false. Therefore power does not flow through the rung, and the RLO is negative (OFF). The state of the RLO is stored in MI 3, at an offset of 2 bits, in the third bit of MI 3. The bit turns OFF, and MI 3 contains 0.

Note that the maximum number of bits in the vector is 255, 16 MIs or 8 double registers.

Binary NumbersMemory Integers and System Integers are 16-bit binary numbers. You enter decimal numbers into Memory Integers and System Integers. The program

Page 116: VisiLogic - Ladder Programming

Binary Numbers RLO to Bit

108 VisiLogic: Ladder Programming

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, etc} were chosen for use with logical OR to evaluate keypad input numbers in the following example.

Page 117: VisiLogic - Ladder Programming

RLO to Bit Binary Numbers

VisiLogic: Ladder Programming 109

Page 118: VisiLogic - Ladder Programming

Compare Functions RLO to Bit

110 VisiLogic: Ladder Programming

Compare FunctionsA compare function compares two values according to the type of function you select.

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

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

There are 7 types of Compare Functions:

Greater Than Greater Than or Equal To Equal To Not Equal To Less Than or Equal To Less Than Within Range

Note•

The Vector menu includes a Compare Vector function.

These values may be compared:

Memory Integer (MI)

Page 119: VisiLogic - Ladder Programming

Greater Than Compare Functions

VisiLogic: Ladder Programming 111

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

Counter

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

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

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

According to the above example:

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

Note•

Greater and Less Than function blocks do not give an output when input A equals input B.

These values may be compared:

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

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

Page 120: VisiLogic - Ladder Programming

Compare Functions Equal

112 VisiLogic: Ladder Programming

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.

According to the above example:

If MI 1 value is greater or equal to constant integer 35; then MB 50 will go to logic «1» (ON).

If MI 1 value is not greater or equal to constant integer 35; then MB 50 will go to logic «0» (OFF).

These values may be compared:

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

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

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

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

According to the above example:

Page 121: VisiLogic - Ladder Programming

Not Equal Compare Functions

VisiLogic: Ladder Programming 113

If MI 1 is equal to MI 3; then MB 55 will go to logic «1» (ON). If MI 1 is not equal to MI 3; then MB 55 will go to logic «0» (OFF).

These values may be compared:

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

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

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

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

According to the above example:

If MI 1 is not equal to MI 3; then MB 65 will go to logic «1» (ON). If MI 1 is equal to MI 3; then MB 65 will go to logic «0» (OFF).

These values may be compared:

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

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

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

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

Page 122: VisiLogic - Ladder Programming

Compare Functions Less Than

114 VisiLogic: Ladder Programming

According to the above example:

If MI1’s value is less than or equal to MI3’s value, then MB 51 will go to logic «1» (ON).

If MI1’s value is greater than or equal to MI3’s value, then MB 51 will go to logic «0» (OFF).

These values may be compared:

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

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

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

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

According to the above example:

If MI 1 value is less than constant integer 35; then MB 60 will go to logic «1» (ON).

Page 123: VisiLogic - Ladder Programming

Within Range Math Functions

VisiLogic: Ladder Programming 115

If MI 1 values is not less than constant integer 35; MB 60 will go to logic «0» (OFF).

These values may be compared:

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

Within Range The Within Range function checks if the value in input A is within the range of values between input B and input C.

When the function is activated:

If input A is within the range of values between input B and input C the output MB turns ON.

If input A is not within the range of values between input B and input C the output MB turns OFF.

Math FunctionsYou perform mathematical functions by placing math functions in a net. Math functions, located on the Math menu are provided for:

Increment/Decrement Addition Subtraction Multiplication Division Square Root Power Factor Linearization

Each type of math function can use up to 8 input values to compute a single sum.

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

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

Page 124: VisiLogic - Ladder Programming

Math Functions Multiple Input Values in Math Functions

116 VisiLogic: Ladder Programming

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

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

Counter

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

1. Click on the Math button on the Ladder toolbar. -or- Right-click on the Ladder to show the Ladder pop-up menu.

2. Select More…, then select the desired function type.

3. Click on the function with the desired number of input values.

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

automatically enlarges to fit the function

Page 125: VisiLogic - Ladder Programming

Add Math Functions

VisiLogic: Ladder Programming 117

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

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

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

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

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

Page 126: VisiLogic - Ladder Programming

Math Functions Divide

118 VisiLogic: Ladder Programming

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

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

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

T

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

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

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

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

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

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

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

Page 127: VisiLogic - Ladder Programming

Subtract Math Functions

VisiLogic: Ladder Programming 119

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

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

The input values in a Subtract function may be:

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

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

The function performs A-B=C.

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

Memory Integer (MI) Memory Long Integer (ML)

Page 128: VisiLogic - Ladder Programming

Math Functions Linearization, Vector Linearization

120 VisiLogic: Ladder Programming

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

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

This Modulo function divides the A input by the B input, and then store the remainder in the C output.

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

Linearization, Vector Linearization The Linearization functions, located on the Math menu, enable you to convert values. Use them, for example, to convert analog input values to a values in degrees Celsius.

Linearize a Single Value

This function linearizes a single source value, then stores it in the target register.

Page 129: VisiLogic - Ladder Programming

Linearization, Vector Linearization Math Functions

VisiLogic: Ladder Programming 121

If, for example, X1 and Y1 are 0, and X2=1023 while Y2=1000, the output value will be linearized as graphed. These values would cause:

An input of 5.0V to be converted to a digital value of 500.

A input of 10.0Vto be converted to a digital value of 1000.

Linearize a Vector of Values

This function linearizes a vector of source values, then stores the values in the target vector.

You can convert values contained in the following operand types:

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

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

Note • The X and Y values must not exceed the range of -2147483648 to +2147483647.

Known IssueNote that the Linearization function cannot be used in cases where one of the following is close to the value FFFFFFFF:

One of the inputs An intermediate calculation

In these cases, use the Formula function with the following equation:

Page 130: VisiLogic - Ladder Programming

Math Functions Linearization, Vector Linearization

122 VisiLogic: Ladder Programming

Linearizing Analog I/O values

Note•

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

Working within the 4-20mA range

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

10-bit Analog Input, V200-18-E1

12-bit Analog Output,IO-A14-AO2

12-bit Analog Input, IO-A14-AO2

Page 131: VisiLogic - Ladder Programming

Linearization, Vector Linearization Math Functions

VisiLogic: Ladder Programming 123

14-bit Analog Input, V120-12-UN2

Linearizing a PID Analog Output Value

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

Note•

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

Page 132: VisiLogic - Ladder Programming

Math Functions Linearization, Vector Linearization

124 VisiLogic: Ladder Programming

Linearizing a PID output-to-analog output

Working within the 4-20mA range

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

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

Page 133: VisiLogic - Ladder Programming

Factor Math Functions

VisiLogic: Ladder Programming 125

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

You can use the following operand types in this operation:

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

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

The example below shows a Factor function.

Page 134: VisiLogic - Ladder Programming

Math Functions Formula: Build Your Own

126 VisiLogic: Ladder Programming

Formula: Build Your Own The Formula function, located on the Math menu, enables you to apply mathematical operators to operand values, and then output the result to a register.

To create a formula, place the Formula function in the Ladder; the Edit formula box opens. You can type in constant numbers, parameters and operators. You can also select parameters and operators from the drop-down lists.

Note • The formula syntax conforms to normal mathematical notation.• With the exception of the — (minus) sign, binary operators cannot be

used to begin a formula. The other binary operators include Add [+[, Mul [*], Div [/], Parenthesis [( )], and Power. Unary operators, such as Sin, may be used to begin a formula.

You can create a parameter name using a mixture of characters and numbers.

Page 135: VisiLogic - Ladder Programming

Power Math Functions

VisiLogic: Ladder Programming 127

Note • A parameter name may not begin with a number or contain spaces. Use an underscore ( _ ) in place of spaces.

• A constant may not exceed the value of a MF or ML.• In the following cases, controller will process the formula using

floating registers: If the formula contains one or more floating operands. If a constant value in the formula is not a whole number If an operator, such as trigonometric operators, requires that

the PLC use a floating register to complete its operation.

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

You can use the following operand types in this operation:

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

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

The example below shows a Power function.

Page 136: VisiLogic - Ladder Programming

Math Functions Square Root

128 VisiLogic: Ladder Programming

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:

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

The example below shows a Square Root function.

Page 137: VisiLogic - Ladder Programming

Increment/Decrement Math Functions

VisiLogic: Ladder Programming 129

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

Increment increases the value in the selected operand by 1.

Decrement decreases the value in the selected operand by 1.

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

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.

Page 138: VisiLogic - Ladder Programming

Math Functions Float Functions

130 VisiLogic: Ladder Programming

Float Functions: Basic These are the basic Float functions:

Store Direct Stores a register value into an MF.

Add Adds two values and stores the result in an MF.

Sub Subtracts two values and stores the result in an MF.

Mul Multiplies two values and stores the result in an MF.

Div Divides two values and stores the result in an MF.

Abs Returns the absolute value of an MF or constant number. The absolute value of a number is the number without its sign.

If, for example, the input value is -2, the absolute number output by the Abs function will be 2.

Float Functions: Extended These are the extended Float functions:

Square root This function returns the square root of an input value. The input value serves as the radicand. The result is stored in an output MF.

Power Power uses 2 input values. Power raises an A input value by the power of a B (exponent) input value. The result is stored in an output MF, C

Exp Returns the value of the input number raised to the power of ‘e’. The constant e equals 2.71828182845904, the base of the natural logarithm.

EXP is the inverse of LN, natural log. If, for example, the value 1 is input to the Exp function, the output result is 2.718282. If the value 2 is input, the output result will be 7.389056.

LN Returns the natural logarithm of the input number, using base ‘e’. The constant e equals 2.71828182845904.

LN is the inverse of Exp. If, for example, the value 6 is input to the LN function, the output result is 1.791759. If the value 60 is input, the output result will be 4.094345.

Log10 Returns the logarithm of the input number, using base 10.

Page 139: VisiLogic - Ladder Programming

Float Functions Math Functions

VisiLogic: Ladder Programming 131

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.

If, for example, the A value is 3, and the B value is 2, the output value will be 300: 3(10^2). If A is 3 and B is 9, the result will be 3,000,000,000.

Float: Trig Functions These are the available Trigonometric functions:

Sin The function’s output is the sine of the input value.

Cos The function’s output is the cosine of the input value.

Tan The function’s output is the tangent of the input value.

ArcSin The function’s output is the inverse sine of the input value.

ArcCos The function’s output is the inverse cosine of the input value.

ArcTan The function’s output is the inverse tangent of the input value.

Degrees Converts the input value into degrees.

Radians Converts the input value into radians.

Float: Convert These are the Convert Float functions:

A+B/n This function takes 2 non-float values (whole numbers) and creates a single floating value. The two non-float values are added together; the A input, a whole number, is added to the B input, which is the fractional part of the number following the decimal point.

Page 140: VisiLogic - Ladder Programming

Math Functions Float Functions

132 VisiLogic: Ladder Programming

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, nequals 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. 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, nequals 1000; when an ML is selected, n equals 1,000,000.

Float: Compare Functions These are the Compare Float functions:

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

When the function is activated:

If input A is greater than input B, the output MB turns ON. If input A is not greater than input B, the output MB turns OFF.

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

When the function is activated:

If input A is greater than or equal to input B, the output MB turns ON.

Page 141: VisiLogic - Ladder Programming

Float Functions Math Functions

VisiLogic: Ladder Programming 133

If input A is not greater than or equal to input B, the output MB turns OFF.

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

When the function is activated:

If input A is equal to input B, the output MB turns ON. If input A is not equal to input B, the output MB turns OFF.

• Not Equal The Not Equal function evaluates input A to see if its integer value is not equal to input B.

When the function is activated:

If input A is not equal to input B, the output MB turns ON. If input A is equal to input B, the output MB turns OFF.

• Less Than or Equal To The Less Than or Equal To function compares input A to input B.

When the function is activated:

If input A is less than or equal to input B, the output MB turns ON. If input A is not less than or equal to input B, the output MB turns

OFF. • Less Than

The Less Than function compares input A to input B.

When the function is activated:

If input A is less than input B, the output MB turns ON. If input A is not less than input B, the output MB turns OFF.

• Within Range The Within Range function block checks if the value in input A is within the range of values between input B and input C.

When the function is activated:

If input A is within the range of values between input B and input C the output MB turns ON.

If input A is not within the range of values between input B and input C the output MB turns OFF.

Float Errors When an Float function error occurs, SB 10 Float Error turns on. This SB is reset by the user.

The error code is stored in SI 440 General Error. The codes are shown below.

Value Message Result 3 Integer Overflow 7FFF or 8000 (integer result)FFFF or 0000(unsigned integer result) 4 Floating Overflow +INF or -INF (float result) 5 Floating

Underflow 0.0 (float result)

7 Divide by Zero +INF or -INF or NaN (float result)

Page 142: VisiLogic - Ladder Programming

Store and Load Functions Reset Numeric

134 VisiLogic: Ladder Programming

9 Undefined Float NAN (float result) 10 Conversion Error 0 (integer result) 11 Floating point

Stack Overflow Floating point stack underflow

12 Floating point Stack Underflow

Floating point stack overflow

INF Infinite which is the largest absolute floating point number.

NAN Not a Number, special notation for undefined floating point number.

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

The available functions are listed below.

Reset Numeric Store Direct Function Store Indirect Function Load Indirect Functions Store Timer/Counter Preset Load Timer/Counter Preset Store Timer/Counter: Current Value Load Timer/Counter: Current Value Step in Range

Reset Numeric Reset Numeric allows you to initialize a register value to zero.

To use the function:

1. Click Store on the Ladder Toolbar.

Page 143: VisiLogic - Ladder Programming

Store Direct Function Store and Load Functions

VisiLogic: Ladder Programming 135

2. Select Reset Numeric, then place the function in the desired net. In the following picture, when MB 0 turns ON, MI 0 = 0.

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

To use the Store Direct function:

1. Click Store on the Ladder Toolbar.

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

net.

3. Enter the desired Operands and Addresses.

Page 144: VisiLogic - Ladder Programming

Store and Load Functions Store Indirect Function

136 VisiLogic: Ladder Programming

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

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

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

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

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

The value 5 will therefore be stored in MI 10.

Page 145: VisiLogic - Ladder Programming

Store Timer/Counter Preset Store and Load Functions

VisiLogic: Ladder Programming 137

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

Operand A: contains the value to be stored in the timer/counter. Operand B: this is the timer/counter to be preset.

Note

•The value that is stored in the Timer is broken down into units of 10 milliseconds. In the above example, if MI 13 is equal to 10120, the value stored into T1 will be 00:01:41.20.

Store Timer/Counter: Current Value You can store an operand or constant value into a current Timer or Counter value.

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

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 10120, the value stored into T1 will be 00:01:41.20.

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

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

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

Page 146: VisiLogic - Ladder Programming

Store and Load Functions Load Timer/Counter Preset

138 VisiLogic: Ladder Programming

2. Place the function in the desired net.

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

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

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

Operand A: this is the Timer/Counter preset value. Operand B: this is where the value will be stored.

Note • Timer value units are 10 milliseconds. In the above example, if TI is

equal to 1 minute, 41 seconds, and 20 deciseconds ( 00:01:41.20.), the value 10120 will be stored into MI 16.

Load Timer/Counter: Current Value You can load the current value of a Timer/Counter into an operand.

Page 147: VisiLogic - Ladder Programming

Load Timer Bit Value Store and Load Functions

VisiLogic: Ladder Programming 139

Operand A: this is the Timer/Counter current value. Operand B: this is where the value will be stored.

Note • Timer value units are 10 milliseconds. In the above example, if T0 is

equal to 1 minute, 41 seconds, and 20 deciseconds ( 00:01:41.20.), the value 10120 will be stored into MI 10.

Load Timer Bit Value You can use a Ladder condition to load the current bit value of a Timer into an MB. The input to the Load Timer Scan Bit function is the address of the timer within the Timer vector, and may be a constant or a value provided by a register.

BCD to NUM, Num to BDC You can convert a numeric value into a BCD or a BCD to a numeric value by using the appropriate function.

1. Select the function from the Store menu on the Ladder toolbar.

2. Place the function in the net.

3. Link the parameters to the desired operands.

Notes • This type of BCD may be used in seven-segment displays, composed of seven elements.

• The function does not support negative values.• Use ML or DW for large values.

Page 148: VisiLogic - Ladder Programming

Store and Load Functions Fill Direct

140 VisiLogic: Ladder Programming

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

Operand A: this is the operand which contains the value to be copied. Operand B: this is the first operand in the range. Operand C: this sets the length, meaning the number, of operands in that

range.

Step in Range Step in Range enables you to increment a value by a desired amount, to keep the incremented value within a desired range, and notifies you when the incremented value reaches the limit.

To use the function: 1. Click Compare on the Ladder Toolbar, then select Step in Range.

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A: Value to Increment/Decrement. This is the value that is incremented. Operand B: Result — Minimal Value. This is the lower value of the range. Operand C: Result — Maximal Value. This is the higher value of the range Operand D: Step. This is the value used for the step size Operand E: Roll. Turn ON to cause the function to continue to work once the function has been reached. Operand F: Count Up. Turn ON to increment Operand G: Count Down. Turn ON to decrement Operand H: Output, Limit Reached Notifier. This turns ON for one scan when: — Count UP is active, and the incremented value equals the Maximal value or — Count Down is active, and the decremented value equals the Minimal

Page 149: VisiLogic - Ladder Programming

Step in Range Store and Load Functions

VisiLogic: Ladder Programming 141

value The MB resets automatically when the value is not equal.

Notes • The step size is limited to the range of 1-1000.

• Value to Increment/Decrement, Minimal Value, and Maximal Value must be the same type of operand, signed or unsigned.

• If the initial value of the MI linked to Value to Increment fall outside of the range, the first time it is activated, the value will change to either: — match the Minimal Value — assuming the function is set to Count Up, or -match the Maximal Value, assuming the function is set to Count Down.

Example:

In the following picture:

MI 0 is the value to be incremented The range is 100 to 1000 The Step Size is 5 MI 0 is set to Count Up

The first time MB 5 rises, the value in MI 0 will jump to 100, which is the Minimal value. After this, each time the MB 5 rises, MI 0 will increment by 5, until it reaches 1000, turning MB 4 ON. Since Roll is ON, the function will begin to count again, this time from 99, MB 4 will then reset.

Page 150: VisiLogic - Ladder Programming

Vector Operations Vector Copy

142 VisiLogic: Ladder Programming

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

Bit to Numeric, Numeric to Bit Compare Copy Copy Memory Transpose Shift Byte Left Fill Find Get Max Get Min Load Load Timer Bit Value Store

Vector Copy 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.

Page 151: VisiLogic - Ladder Programming

Vector: Load Vector Operations

VisiLogic: Ladder Programming 143

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.

2. Place the function in the desired net.

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

Example: Registers

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

Example: Bit Operands

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

Note that:

Page 152: VisiLogic - Ladder Programming

Vector Operations Vector: Store

144 VisiLogic: Ladder Programming

If you link a bit operand to Operand A, the function will only allow you to link a bit operand to Operand C.

If you link a register to Operand A, the function will only allow you to link a register to Operand C.

If a double register (ML, SL, DW, SDW) is used as the source operand, and a single register (MI), is used as the target, only the first 16 bits will be loaded from the source into the target operand.

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

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

2. Place the function in the desired net.

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

Example: Registers

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

Example: Bit Operands

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

Page 153: VisiLogic - Ladder Programming

Vector: Find Vector Operations

VisiLogic: Ladder Programming 145

Note that:

If you link a bit operand to Operand A, the function will only allow you to link a bit operand to Operand C.

If you link a register to Operand A, the function will only allow you to link a register to Operand C.

If a double register (ML, SL, DW, SDW) is used as the source operand, and a single register (MI), is used as the target, only the first 16 bits will be loaded from the source into the target operand.

Vector: Find The Find function:

searches through a vector, locates either an integer value or the first bit of a desired status within

that vector, records the location of the operand containing the desired value.

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

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A, Locate Value in Vector, determines the value or bit status to be found. Operand B, Locate Start Address, determines from where the function begins to search. If you select MB 3, for example, the function will search through the MB vector, and will begin to search at MB #3. Operand C, Vector Length, determines the length of the vector to be searched. Operand D, Value’s Location, is where the function records the location of the operand—if the function finds the value. If the function does not find the value, a linked MI will contain the value -1; a long register will contain FFFFFFFF.

Example: Find Register Value

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

Page 154: VisiLogic - Ladder Programming

Vector Operations Vector: Fill

146 VisiLogic: Ladder Programming

containing 16 is recorded in MI 6. If the value is not found, MI 6 will contain -1.

Example: Find Bit Status

Below, if MB 0 is OFF, the function searches from O 6 to O 15. If a bit having OFF status is 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.

Vector: Fill Fill enables you to:

select an register, bit operand, or constant value, define a vector of operands,

Page 155: VisiLogic - Ladder Programming

Vector: Fill Vector Operations

VisiLogic: Ladder Programming 147

write the selected value into every operand within the vector. The function is located on the Vector menu.

Note • The first operand you select, Fill Value, determines the type of operands you can fill. For example, if you wish to initialize a vector of MBs, you must select the Direct tab, and then select an MB or an Output as the Fill Value. Selecting a register will enable you to write to registers, as will selecting the Const tab and entering a value.

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

2. Place the function in the desired net.

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

Example:

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

Page 156: VisiLogic - Ladder Programming

Vector Operations Vector: Fill

148 VisiLogic: Ladder Programming

Vector: Fill (Offset) Fill (Offset) enables you to:

Select an register, bit operand, or constant value, define a vector of operands that is offset from a selected start address, write the selected value into every operand within the vector.

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

Fill.

2. Place the function in the desired net.

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

Example:

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

Page 157: VisiLogic - Ladder Programming

Vector: Copy Vector Operations

VisiLogic: Ladder Programming 149

Vector: Copy Copy enables you to:

define a vector of operands, copy the values or bit status of each operand within that vector, write those values or status into a corresponding vector of operands of the

same length. The function is located on the Vector menu.

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

2. Place the function in the desired net.

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

Example:

Below, the values in MI 0 through 9 will be copied to MI 100 to 109.

Copy (Offset) Copy (Offset) enables you to:

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

copy the values or bit status of each operand within that range, define a target vector of operands that is offset from a selected start

address, write the source values or status into the target vector.

Page 158: VisiLogic - Ladder Programming

Vector Operations Vector: Compare

150 VisiLogic: Ladder Programming

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

2. Place the function in the desired net.

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

Example:

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

Vector: Compare Compare enables you to:

Define 2 vectors of operands, compare the values or bit status of each corresponding operand within

that range, record the location of the first set of unmatched values found.

The function is located on the Vector menu.

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

2. Place the function in the desired net.

Page 159: VisiLogic - Ladder Programming

Vector: Compare Vector Operations

VisiLogic: Ladder Programming 151

3. Link the desired Operands and Addresses. Operand A: this is the start address for the first vector of operands. Operand B: this is the start address for the second vector of operands. Operand C: this sets the length of both vectors. Operand D: this MB turns ON when the corresponding values in both vectors match, and turns OFF when corresponding operand values do not match. Operand E: this MI contains the location of the first set of unmatched operands in the vector. If all of the corresponding values match, the MI contains -1.

Example:

Below, the values in MI 10 through 13 will be compared to MI 3 through 6. MI 12 and MI 5 occupy corresponding locations in the their respective vectors. When the function finds that the values in MI 12 and MI 5 do not match, the function turns MB 1 turns OFF and stores the location of the operands into MI 100.

Compare (Offset) Compare (Offset) enables you to:

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

define a target vector of operands that is offset from a selected start address,

compare the values or bit status of each corresponding operand within that range,

record the location of the first set of unmatched values found.

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

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A: this is the start address for the first vector.

Page 160: VisiLogic - Ladder Programming

Vector Operations Vector: Bit to Numeric, Numeric to Bit

152 VisiLogic: Ladder Programming

Operand B: this is the offset from the start address. Operand C: this is the start address for the second vector. Operand D: this is the offset from the start address. Operand E: this is the vector length. Operand F: this MB turns ON when the corresponding values in both vectors match, and turns OFF when corresponding operand values do not match. Operand G: this MI contains the location of the first set of unmatched operands in the vector. If all of the corresponding values match, the MI contains -1.

Example:

Below, the values in MB 4 through MB 11 will be compared to MB 105 through MB 112. MB 12 and MB 110 occupy corresponding locations in the their respective vectors. When the function finds that the values in MB 12 and MB 110 do not match, the function turns MB 2 OFF and stores the location of the operands into MI 6.

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

The functions are located on the Vector menu.

Bit to Numeric Operand A: contains the Start Address for the array of bits to be

converted. Operand B: is the start of the vector that will contain the converted value.

Take care in addressing operands, since the converted value may not fit into a single register; the function will overwrite as many consecutive registers as it requires to convert the value.

Page 161: VisiLogic - Ladder Programming

Load Timer Bit Value Vector Operations

VisiLogic: Ladder Programming 153

Operand C: contains the length of the bit array that will be converted.

Numeric to Bit Operand A: contains the Address of the value to be converted. Operand B: contains the Start Address of the bit array that will contain the

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

converted value.

Load Timer Bit Value You can use a Ladder condition to load the current bit value of a Timer into an MB. The input to the Load Timer Scan Bit function is the address of the timer within the Timer vector, and may be a constant or a value provided by a register.

Page 162: VisiLogic - Ladder Programming

Vector Operations Vector: Get Max

154 VisiLogic: Ladder Programming

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

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

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

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

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

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

Page 163: VisiLogic - Ladder Programming

Vector: Copy Memory Vector Operations

VisiLogic: Ladder Programming 155

Vector: Copy Memory Copy Memory enables you to copy a vector of bytes from a vector of registers.

To use this function

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

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A: Start address for the source vector of registers. Operand B: Offset from the start address. Operand C: Start address for the target vector. Operand D: Offset from the start address. Operand E: The number of bytes to be copied from the source into the target vector.

Example:

Below, the values within DW 49 and 50 are copied into MIs 602, 603, 604, and 604.

Note • When an MI value is copied into a double register, the MI value will occupy the 2 low bytes of the double register.

Page 164: VisiLogic - Ladder Programming

Vector Operations Vector: Shift Left

156 VisiLogic: Ladder Programming

Vector: Shift Left Shift enables you to:

define a vector of operands, shift the bits or bytes within that vector left

To use this function

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

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A: this is the start address for the source vector. If you select MB or XB, the function will shift bits in the vector, if you select a register type, the function shifts bytes. Operand B: this is the number of bytes to shift.

Example:

The blue numbers in the figure below show the Online values within the controller. MI 3 is selected for the Shift function.

Page 165: VisiLogic - Ladder Programming

Vector: Swap Bytes Vector Operations

VisiLogic: Ladder Programming 157

Below, note the value of MI 3 and MI 4 after the Shift operation.

Repeating Shift leaves MI 3 empty.

Notes • This function cannot be performed on negative values.

Vector: Swap Bytes Swap Bytes allows you transpose the bytes within MIs, MLs, and DWs.

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

2. Place the function in the desired net.

3. Link the desired Operands and Addresses. Operand A determines the start of the register vector, Operand B whether 16 or 32- bits will be swapped, and Operand C the number of operands that will have their bytes swapped.

The examples below show how the function swaps bytes.

Page 166: VisiLogic - Ladder Programming

Vector Operations Vector: Sort

158 VisiLogic: Ladder Programming

4 MIs, 16-bits

4 MIs, 32-bits

2 DWs, 16-bits

2 DWs,32-bits

Vector: Sort Sort enables you to take a vector of values ( MI, ML, or DW) and:

sort them in ascending or descending order either copy the sorted values to a different destination or overwrite them

to the original vector.

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

Page 167: VisiLogic - Ladder Programming

Vector: Struct Vector Operations

VisiLogic: Ladder Programming 159

2. Place the function in the desired net.

3. Set Parameter A; link the desired Operand and Address for the MI, ML, or DW vector.

4. Set Parameter B; determine the vector length.

5. Select the Sort direction, Up or Down

6. Link the desired Operands and Addresses for the Vector Sort destination.

The examples below show the function directions.

Vector: Struct Struct enables you to collect values:

from a vector of memory operands ( MI, ML, or DW) to mixed data locations (MB, MI, ML, MF, I, O, DW), or,

from mixed data locations to a vector of memory operands.

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

2. Place the function in the desired net.

3. Link the desired Operand and Address for the MI, ML, or DW vector.4. Select the Copy Data Direction:

-from vector to mixed data locations, or -from mixed data locations to vector

5. Link the desired Operands and Addresses for the mixed memory locations.

The examples below show the function directions.

From Vector to Mixed Data Locations

Page 168: VisiLogic - Ladder Programming

Strings Vector: Struct

160 VisiLogic: Ladder Programming

From Mixed Data Locations to Vector

StringsString operations enable you to manipulate characters.

Time to ASCII Transpose Num to ASCII, ASCII to Num Display RTC (ASCII) IP to ASCII Mac Address to ASCII Strings: Section Operations Set String Library

Page 169: VisiLogic - Ladder Programming

Strings: Num to ASCII, ASCII to Num Strings

VisiLogic: Ladder Programming 161

Strings: Num to ASCII, ASCII to Num These functions are located on the String menu.

Num to ASCII You can convert a value to an ASCII string and display it by using the Num to ASCII function together with the ASCII String variable.

1. Select NUM to ASCII from the String menu on the Ladder toolbar.

2. Place the function in the net.

3. In the HMI Display, select ASCII String from the Text Variable menu.

When the program shown below is downloaded, turning MB 1000 ON will display the value on the Vision’s LCD.

.Notes • If the vector is not long enough, if for example you convert an ML

value of “123456” into ASCII and allow only 5 characters, the function returns a string of question marks (???????).

• Num to ASCII, floating value, is not supported by the V120-12 series.

Use this function to convert values, including Float values, to ASCII strings. Note that the vector length you set relates to the number of bytes

• Operand A: Start address for the source vector.

Page 170: VisiLogic - Ladder Programming

Strings Strings: Num to ASCII, ASCII to Num

162 VisiLogic: Ladder Programming

• Operand B: Set the vector length of resulting string (in bytes). Note that the vector must be long enough to contain the value.

• Operand C: Select the format, Decimal, Hex, Binary, or Float.

• Operand D: Select Leading

• Operand B: offset from the start address.

• Operand C: Start address for the target vector.

• Operand D: Leading Zeros

• Operand E: vector length.

ASCII to Num You can convert an ASCII string to a number value by using the ASCII to NUM function.

Operand A: Start address for the source vector. Operand B: Vector length Operand C: Start address for the destination vector. Operand D: Factor ( decimal point placement.

In the figure below, the value 234.555 is entered via keypad. The value is converted by the function; note that since the ASCII value is 234.555, the Factor is 1000.

Page 171: VisiLogic - Ladder Programming

Strings: Num to ASCII, ASCII to Num Strings

VisiLogic: Ladder Programming 163

.Notes • ASCII to Num, floating value, is not supported by the V120-12 series.

Page 172: VisiLogic - Ladder Programming

Time to ASCII Strings: Transpose

164 VisiLogic: Ladder Programming

Time to ASCIIYou can display a value as an ASCII string by using the Num to ASCII function together with the ASCII String variable.

1. Select Time to ASCII from the String menu on the Ladder toolbar.

2. Place the function in the net.

3. In the HMI Display, select ASCII String from the Text Variable menu.

When the program shown below is downloaded, turning MB 1000 ON will display the value on the Vision’s LCD.

.Note • If the vector is not long enough, if for example you convert

an ML value of “123456” into ASCII and allow only 5 characters, the function returns a string of question marks (???????).

Strings: Transpose Transpose enables you to ‘compress’ MI values into bytes, or ‘expand’ bytes into MIs:

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

Page 173: VisiLogic - Ladder Programming

Strings: Display RTC (ASCII) Time to ASCII

VisiLogic: Ladder Programming 165

Copy the low byte of each register within that range, Define a target vector of operands that is offset from a selected start

address. Select Conversion type:

MI to Byte (Compress) to write the low byte of each source register into the consecutive bytes of the target vector; thus the low bytes of 3 source registers will occupy 2 MIs. Byte to MI (Expand) to write the consecutive bytes of the source vector into the low byte of each target register, thus the bytes of 3 MIs will occupy the low bytes of 6 MIs.

Note • Transpose vector maximum:

MI to Bytes: 128 Bytes to MI 256

To use Transpose: 1. Click Strings on the Ladder Toolbar, then select Transpose.

2. Place the function in the desired net.

3. Select the type of function.

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

Example:

Below, the low bytes of MI 5, 6, and 7 are copied into the consecutive bytes of MI 18 and 19.

Strings: Display RTC (ASCII) You can display an RTC value as an ASCII string by using the RTC to ASCII function together with the ASCII String variable.

Page 174: VisiLogic - Ladder Programming

Time to ASCII Strings: IP to ASCII

166 VisiLogic: Ladder Programming

To use Display RTC:

1. Select RTC to ASCII from the String menu on the Ladder toolbar.

2. Place the function in the net, and select a display format; both European and American format are available.

3. In the HMI Display, select Display RTC from the Text Variable menu.

When the program shown below is downloaded, pressing key 1 on the Vision’s keypad will display the current time on the Vision’s LCD.

.

Strings: IP to ASCII You can save a value as an ASCII string by using the Num to ASCII function.

Notes • If the vector is not long enough, if for example you convert an ML value of “123456” into ASCII and allow only 5 characters, the function returns a string of question marks (???????).

• This feature is not supported by the V120-12 series.

Page 175: VisiLogic - Ladder Programming

Mac Address to ASCII Time to ASCII

VisiLogic: Ladder Programming 167

Mac Address to ASCII You can store a MAC address as an ASCII string by using the Mac to ASCII function.

Notes • The MAC address will only be shown if:The controller contains an Ethernet card

The Ethernet card has been initialized via a TCP/IP function. • This feature is not supported by the V120-12 series.

String to ASCII Use this function to convert a string to an ASCII value.

1. Select String to ASCII from the String menu on the Ladder toolbar, and place the function in the net.

2. Enter the string in the string field

3. Select the register that will contain the ASCII results. You can also use an offset.

When the function below runs, the values can be seen in the Memory window during Test Mode..

Page 176: VisiLogic - Ladder Programming

Time to ASCII Strings: Section Operations

168 VisiLogic: Ladder Programming

Strings: Section Operations String Section Operations work on parts of strings. To work with these functions, note the following general principles:

A String always ends with a NULL character. The string length (or offset to string) is measured in bytes (characters). Parameter A, String Address Source, is the String location. For example, if

the string is set to MI 8, the string address is equal to the address of MI 8—not to the content of MI 8.

Maximum string length is 512 bytes, 120 characters. The string cannot extend past the memory type domain (MI, DW, etc.). The string offset cannot exceed the string length.

Find String within String

Page 177: VisiLogic - Ladder Programming

Set String Library Utils Menu

VisiLogic: Ladder Programming 169

The function shows the location of the first occurrence of the sub string in the source string.

Parameter A: Str in Str: String to Search in Parameter B: Str in Str: String to Search For Parameter C: Str in Str: Offset in ‘Search IN’ vector (bytes) Parameter D: Str in Str: Location of found String (-1 = String not found) Set String Library

Use this function to switch String Libraries.

Utils MenuThis contains a variety of functions:

Calls, Jumps, and Labels

HMI

PTO

Alarms

Clock

Immediate

Debug

Idle

Backup Security

UniVision Licensing

Page 178: VisiLogic - Ladder Programming

Utils Menu HMI-Ladder: Load HMI Display: Functions

170 VisiLogic: Ladder Programming

HMI-Ladder: Load HMI Display: Functions These Ladder functions call HMI Displays. Use these functions to initially load the Display, and then to refresh it when your application requires, as, for example, when you want to update variable display. They are located on the Ladder toolbar, under the HMI menu.

Note • Load Display functions should not be placed directly on the Ladder rail, or called by conditions that continually call the Display when it is still loaded on the controller screen.

• You must use a transitional contact to activate a Load HMI Display or Load Last Display function.

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

Accessing a Load Display Target

Page 179: VisiLogic - Ladder Programming

HMI-Ladder: Draw Pixel/Line Utils Menu

VisiLogic: Ladder Programming 171

HMI Display Loaded This turns a linked MB ON when a specific Display begins loading.

Load Last Display

Loads the last Display loaded by the application. The function works according to LIFO list comprising the last 24 active Displays.

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

HMI-Ladder: Draw Pixel/Line These elements allow Ladder events to color pixels or draw lines on the controller’s LCD display.

Standard Vision

Both Draw Pixel and Draw line are located on the HMI toolbar.

Page 180: VisiLogic - Ladder Programming

Utils Menu HMI-Ladder: Draw Pixel/Line

172 VisiLogic: Ladder Programming

Draw Pixel enables you to color a single pixel located on the x,y axis.

Input Purpose Comments

Input A X location

Input B Y location

Input C Pixel color If the value of the linked bit is 1 (set), the pixel will be black, if 0 (reset), the pixel will be negative. SB 1 may used to color the pixel black, SB 0 to color it negative, or an MB may be used.

Draw line enables you to draw lines in different widths and formats.

Input Purpose Comments

Input A Start X location

Input B Start Y location

Input C End X location

Input D End y location

Input e Format Select line width: 1 to 4 pixels wide, and line style: solid, dot. or dash. Note that Color Visions support a width of up to 20 pixels

Input E Pixel color If the value of the linked bit is 1 (set), the line will be black, if 0 (reset), the line will be negative. SB 1 may used to color the line black, SB 0 to color it negative, or an MB may be used.

Page 181: VisiLogic - Ladder Programming

HMI-Ladder: Clear Rectangle (Standard Vision only)

Utils Menu

VisiLogic: Ladder Programming 173

HMI-Ladder: Clear Rectangle (Standard Vision only) This element allows Ladder events to ‘erase’ a rectangular area on the controller’s LCD display in response to a Ladder event. Clear Rectangle is located on the HMI toolbar.

The parameters below set the location and size of the rectangle.

Input Purpose

Input A Start X location

Input B Start Y location

Input C Width

Input D Height

HMI-Ladder: Previous Var (Standard Vision only) This element allows you to use Ladder events to page back through Keypad Entry Variables. Previous Var pages back according to the physical order of the variables on the LCD screen.

In the following figure, if Var 4 is the active variable, pressing F1 once activates Var 3, an additional press activates Var 2, then 1. If Var 1 is active, pressing F1 activates Var 4.

Page 182: VisiLogic - Ladder Programming

Utils Menu Inverse Var/Hide Var (Standard Vision Only)

174 VisiLogic: Ladder Programming

Inverse Var/Hide Var (Standard Vision Only) The Inverse Var function ‘inverts’ the color of a variable, meaning that black pixels are changed to white and white to black.

The Hide Var function hides a variable.

How Inverse/Hide works Each function is linked to its own SDW, Inverse Var to SDW 30, and Hide Var to SDW 31. The SDW provides a bitmap for the variables in the Display currently shown on the LCD.

Both functions work in the same way: by checking the value of the linked SDW when a Display is activated.

# Description Value Comments SDW 30 Variable display

bitmap, 0=Normal, 1=Inverse (or negative)

The value is checked when a display is entered. It is initialized to 0: — At Power-up. — When the program exits the Display.

When a bit is ON, the corresponding variable is displayed in inverted (negative) color; black pixels are changed to white and white to black.

SDW 31 Hide Var The value is checked when a display is entered. It is initialized to 0 at: — Power-up. — When the program exits the

When a bit is ON, the corresponding variable is hidden.

Page 183: VisiLogic - Ladder Programming

HMI-Ladder: Previous Var (Standard Vision only)

Utils Menu

VisiLogic: Ladder Programming 175

Display.

How to use Inverse\Hide 1. Link the Display containing the variables to the desired Subroutine as

shown below.

2. Place the Inverse\Hide Var function in a subroutine, not in the Main

routine Note • If the function is in the Main routine, it will not work correctly.

3. Select the desired variables.

Notes • The SDW bits are linked to the variable index number, which changes

when variables are added or deleted, as well as during copy/paste. If you edit the variables after inserting Inverse/Hide functions, check that the desired variables remain selected.

• The functions automatically update the variable view of whichever Display is currently on-screen.

HMI-Ladder: Previous Var (Standard Vision only) This element allows you to use Ladder events to page back through Keypad Entry Variables. Previous Var pages back according to the physical order of the variables on the LCD screen.

In the following figure, if Var 4 is the active variable, pressing F1 once activates Var 3, an additional press activates Var 2, then 1. If Var 1 is active, pressing F1 activates Var 4.

Page 184: VisiLogic - Ladder Programming

Utils Menu HMI-Ladder: Previous Var (Standard Vision

only)

176 VisiLogic: Ladder Programming

Page 185: VisiLogic - Ladder Programming

Refresh HMI Display Utils Menu

VisiLogic: Ladder Programming 177

Refresh HMI Display Run this function to redraw the current HMI display.

PTO Functions: Simple Motion Control You can implement motor control by controlling the high-speed outputs of certain Vision controllers using PTO functions, controlling up to three independent axes.

In this way you can, for example, build speed profiles that are appropriate for stepper motors. Note that the PTO control functions are open-loop, and do not rely on positional feedback.

Supported Modes: Pulse Uses a single high-speed output

Pulse + Direction Uses 2 high-speed outputs, one for the pulse, and the second to control direction

Clockwise/Counter Clockwise Uses 2 high-speed outputs, one for clockwise, the other for counter-clockwise

Channels and OutputsA Channel comprises the outputs that are required to implement a Mode.

The number of channels, the possible modes, and the outputs used to implement them vary from model to model. The following tables show the possible combinations, according to Vision model.

Notes • When an Output is not being used in a channel, it may be used as a general-purpose output (not high-speed)

Caution These functions are based on programming logic, and therefore do not have the safeguards generally provided by electro-mechanical controls. It is the user’s responsibility to implement those safeguards required by his system, such as override and/or emergency stop mechanism.

V130/V350-TR34

Channel Possible Mode Combinations

Channel 0 Pulse Pulse + Direction

Pulse + Direction

Pulse Clockwise/Counter Clockwise

Channel 1 Pulse Pulse + Direction

Pulse Pulse + Direction

Disabled

Page 186: VisiLogic - Ladder Programming

Utils Menu PTO Functions: Simple Motion Control

178 VisiLogic: Ladder Programming

Channel 2 Pulse Disabled Disabled Pulse Pulse

Channel Output used per Channel

Channel 0 Pulse (O0) Pulse (O0) +Direction (O2)

Pulse (O0) +Direction (O2)

Pulse (O0) Clockwise (O0) /Counter Clockwise (O1)

Channel 1 Pulse (O1) Pulse (O1) +Direction (O3)

Pulse (O1) Pulse (O1) +Direction (O3)

Disabled

Channel 2 Pulse (O2) Disabled Disabled Pulse (O2) Pulse (O2)

V130/V350-TRA22

The following table shows all of the possible PTO mode combinations for this model.

Channel Possible Mode Combinations

Channel 0 Pulse Pulse + Direction

Pulse + Direction

Pulse Clockwise/Counter Clockwise

Channel 1 Pulse Pulse + Direction

Pulse Pulse + Direction

Disabled

Channel Output used per Channel

Channel 0 Pulse (O0)

Pulse (O0) +Direction (O2)

Pulse (O0) +Direction (O2)

Pulse (O0) Clockwise (O0) /Counter Clockwise (O1)

Channel 1 Pulse (O1)

Pulse (O1) +Direction (O3)

Pulse (O1)

Pulse (O1) +Direction (O3)

Disabled

V130/V350-TR20, TR6

Channel Possible Mode Combinations

Channel 0 Pulse Pulse + Direction Clockwise/Counter Clockwise

Channel 1 Pulse Disabled Disabled

Channel Output used per Channel

Channel 0 Pulse (O0) Pulse (O0) +Direction (O1)

Clockwise (O0) /Counter Clockwise (O1)

Channel 1 Pulse (O1) Disabled Disabled

PTO Configuration In this function you select a Vision model, which determines the available Channels and Modes. Those not available are disabled.

Page 187: VisiLogic - Ladder Programming

PTO Functions: Simple Motion Control Utils Menu

VisiLogic: Ladder Programming 179

Parameter Name

Purpose

Vision Model Select the appropriate model

Channel A Channel comprises the inputs used to carry out the PTO function, and determines their function

Mode The possible modes are: • Pulse • Pulse + Direction • Clockwise/Counter Clockwise

The tables in the previous section give all possible combinations and output assignments, based on model.

Switch Switch reverses the tasks of the PTO outputs that are assigned to the channel in modes Pulse + Direction or CW/CCW. This can be helpful to fix cases where the output wiring is reversed.

Unit PTO functions rely on Units. This is where you determine the number of pulses per Unit. Note that neither values for Unit nor Pulses per Unit may exceed 1000 Note — To control your output using straight frequency, set 1 pulse = 1 unit. Calculate Frequency to Units according to the following

Page 188: VisiLogic - Ladder Programming

Utils Menu PTO Functions: Simple Motion Control

180 VisiLogic: Ladder Programming

Status Messages

0 — No error 1 — Invalid configuration data 2 — VisiLogic/OS mismatch; this OS version 3 — Vision outputs do not support function 4 — Invalid structure 5 — Invalid configuration channel 6 — Unit or Pulse per Unit exceed limits (1-1000) 7 — Channel already initialized 8 — Currently in motion ( function cannot be performed during acceleration or deceleration)

Success Bit Turns ON when the Status MI =0

Set Profile Use Set Profile to define the motion profile for a particular Channel in the configuration.

RangesNote the minimum and maximum ranges for your motion profile.

Minimum Maximum5 Hz 15 kHz10 Hz 20 kHz305 Hz 133 kHz610 Hz 200 kHz

Parameter Name

Purpose

Page 189: VisiLogic - Ladder Programming

PTO Functions: Simple Motion Control Utils Menu

VisiLogic: Ladder Programming 181

Channel Select the relevant channel

Start/ Stop Velocity

These parameters determine the limits of the motion profile for the channel. Note that the resolution of velocity is according to the units set in the PTO Configuration.

Maximum Velocity

Acceleration Time (mS)

Deceleration Time (mS)

Jerk Factor Controlling for jerk influences the shape of your motion curve. Legal values are from 1 to 16, where 1=trapezoidal curve and 16 =perfect S.

Status Messages

0 — OK 1 — Invalid configuration data 2 — Currently in motion ( function cannot be performed during acceleration or deceleration) 3 — Invalid channel 4 — PTO Configuration block does not exist 5 — Out of range 6 — Maximum value is out of range

Success Bit Turns ON when the Status MI =0

PTO Move In this function you determine the parameters of movement.

Parameter Name

Purpose

Channel Select the relevant channel

Page 190: VisiLogic - Ladder Programming

Utils Menu PTO Functions: Simple Motion Control

182 VisiLogic: Ladder Programming

Movement Type

This sets the type of movement: • Absolute Position

This causes movement to the exact position requested, without considering the current position.

• Relative Position Here the movement is relative to the current position.

Velocity Note that the resolution of velocity is according to the units set in the PTO Configuration

Target Position

Sets the desired goal

Status Messages

0 — Idle / OK 1 — Configuration data is invalid 2 — Invalid channel 3 — Channel not initialized, or Vision outputs do not support function 4 — Absolute Movement cannot be performed 5 — Currently in motion ( function cannot be performed during acceleration or deceleration)

Success Bit Turns ON when the Status MI =0

PTO Stop Use this to stop movement

Parameter Name

Purpose

Channel Select the relevant channel

PTO Stop • Immediate Intended to cause an immediate, emergency stop with no regard for position or any other parameter (requires parameter reset)

• Normal Stops motion according to the rate of deceleration set in the PTO Configuration.

Status Messages

0 — Idle / OK 1 — Already stopped 2 — Invalid channel 3 — Channel isn’t initialized 4 — unknown command

Success Bit Turns ON when the Status MI =0

Page 191: VisiLogic - Ladder Programming

PTO Functions: Simple Motion Control Utils Menu

VisiLogic: Ladder Programming 183

Read Status Use this to ascertain the current position.

Parameter Name

Purpose

Channel Select the relevant channel

Current Position

Use these as a reference for Move functions Note that the resolution of velocity is according to the units set in the PTO Configuration

Velocity

In Progress This turns Off after the values have been read.

Status Messages

0 — Idle / OK 1 — Currently in motion ( function cannot be performed during acceleration or deceleration) 2 — Channel is not configured 3 — Invalid channel 4 — Read Timeout

Success Bit Turns ON when the Status MI =0

PTO Set Home Use this to set a Home position for Move operations set to Absolute Position

Page 192: VisiLogic - Ladder Programming

Utils Menu Alarms: Ladder Functions

184 VisiLogic: Ladder Programming

Parameter Name

Purpose

Channel Select the relevant channel

Offset: PTO Set Home

The channel uses this value to set the reference point for the next move operation. If, for example, the Absolute target is set to 600, and the Offset to 200, the channel will move to 400.

Status Messages

0 — OK 1 — invalid channel 2 — precondition error 3 — Channel is currently accelerating or decelerating ( Movement can only be performed when system is Idle of in steady state)

Success Bit Turns ON when the Status MI =0

Alarms: Ladder Functions The Alarms displays are shown according to the Ladder application. When the Ladder application calls the Alarms, the displays will only appear if the Alarms are Active.

The functions are located on the Alarms menu in the Ladder toolbar.

Show GroupsThis function shows the Alarms in Group display, according to the number in the MI Group ID to Start From.

Note that the status MI will read 0 if no such group exists.

Show AlarmThis function can show a specific display for a specific Alarm. You can show the Alarm in the Alarms in Group display, or go directly to the Alarm Details or History.

Page 193: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 185

Clear History BufferUse this function to erase the Alarm History. 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 UTC (Universal Time) functions

Setting a Clock Function’s Time or Date Direct Clock function:

The time or date of a Direct Clock function is set within the function you place in your program.

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

UTC (Universal Time) Functions VisiLogic offers the following UTC functions:

Clock menu UTC to RTCThe value in a DW is converted to a real-time clock format. Sending the value to SI 30 will set the controller’s RTC by automatically overwriting SIs 30-34.

Page 194: VisiLogic - Ladder Programming

Utils Menu Clock Functions

186 VisiLogic: Ladder Programming

RTC to UTCSelecting SI 30 will convert the RTC value into a DW.

Com>TCP/IP menu

RFC-1305Retrieves, via Ethernet UDP, the current time from a PC UTC server. This may be used to synchronize a Vision RTC with UTC.

HMI Clock Variables

Clock Display Variable, UTCThis may be set as read only, or as a Keypad Entry variable used to set the RTC.

Note • Note that these functions use the DW as a 32-bit binary number containing the UTC value in seconds, where 1900-01-01 = 00:00.00 UTC. Vision controllers support a range from 2004 to 2024.

• Since the DW is the value in seconds, you can perform time value calculations. For example, you can convert the RTC values to DWs, then calculate the difference in order to figure a time interval.

About Universal Time ( RFC-868, RFC-1305)

Both protocols use a standardized data format that refers to UTC (Coordinated Universal Time), and to no other time zones. They are used to synchronize timekeeping among a set of distributed time servers and clients.

RFC-868

The controller sends the time request and receives the response via TCP/UDP port 37. The protocol uses a 32-bit binary number (seconds since 1900-01-01 00:00.00 UTC). This base will serve as the standard until time stamp 4294967295, which will be on 2036-02-07 06:28.14 UTC.

The protocol cannot estimate network delays or report additional information.

RFC-1305

The controller sends the time request and receives the response from the PC server via UDP port 123.

RFC-1305 uses NTP ( network time protocol), a very sophisticated protocol between NTP servers and multiple peers, based on unicast and multicast addressing. A NTP timestamps is represented as a 64-bit unsigned fixed-point number (seconds since 1900-01-01 00:00.00 UTC). The integer part is in the first 32 bits and the fraction part of the second is in the last 32 bits. The maximum number is 4294967295 seconds with a precision of about 200 picoseconds.

Page 195: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 187

UTC: Setting/Synchronizing the Real Time Clock (RTC) via LadderVia VisiLogic’s UTC functions, you can set the Real Time Clock (RTC) within an Ethernet-enabled Vision controller. Via Ethernet, you can:

Synchronize the RTC’s of networked Vision controllers (RFC-868). Synchronize the RTC of a controller to a PC server. (RFC-1305)

Using RFC-868 to synchronize networked controllersWhen a Vision receives a TCP request via Port 37, the Vision ‘server’ automatically sends its RTC time value to the requesting client device.

In the Vision ‘server’ :

1. Initialize the TCP/IP card and initialize a socket to TCP, Local Port 37, Slave as shown in the following figure.

When a Vision receives a TCP request via Port 37, the Vision automatically sends its RTC time value to the requesting client device.

In a Vision requesting the time:

1. Initialize the TCP/IP card and initialize a socket to TCP, Master.

2. Place a TCP/IP Connect function, set to Remote Port 37, as shown in the following figure.

When a Vision receives data via TCP request through Port 37, the Vision automatically sets its RTC, writing this value to all RTC SIs, 30 to 34.

Using RFC-1305 to synchronize a Vision’s RTC to a UTC PC serverWhen a UTC PC server receives a UDP request via Port 123, the server automatically sends the time value to the requesting client device.

Page 196: VisiLogic - Ladder Programming

Utils Menu Clock Functions

188 VisiLogic: Ladder Programming

To request the data from the server, use the RFC-1305 function, located in Com>TCP\IP.

1. Initialize the TCP/IP card and initialize a socket to UDP.

2. Place the RFC-1305 function in the net, entering the PC server’s IP address and the socket set in Socket Init. Note that the Protocol type and Port are set by default.

To write the time value received from the server into the controller and set the RTC, use the UTC to RTC function, located in Clock> UTC.

1. Link a positive transition contact to the RFC-1305 Function in Progress MB

2. Place a UTC to RTC function as shown in the following figure. Storing the UTC Resulting Value into SI 30 automatically writes the appropriate UTC values into all RTC SIs, 30 to 34, setting the RTC.

Clock: Direct Function Example This example shows you how to build a ladder net that drives a coil:

between the hours 9:00 am and 6:00 PM. Monday through Friday beginning on the 15th day of a month, until and including the 24th in the years 2000 and 2001

Remember that the elements must touch to enable power flow to the coil.

1. Place a Direct Time Function in the net.

Page 197: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 189

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.

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

5. Select Year, then enter the year.

Page 198: VisiLogic - Ladder Programming

Utils Menu Clock Functions

190 VisiLogic: Ladder Programming

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

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

Place Clock function blocks in the Ladder. Create HMI Displays that include keypad-entry Time Function Variables.

This type of Variable accepts a time value that is entered via the controller keyboard, storing the number in the linked operand.

This example shows you how to build a ladder net that drives a coil according to the time and date, and how to build the HMI Displays, add the required Variables and jump between Displays.

Building the Ladder

1. Place an Indirect Time Function in the net.

2. Link an operand. The Time function requires two consecutive MIs; the

second is automatically assigned by the program. These 2 MIs define a time range. The first MI sets the Start Time for the function, the second

Page 199: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 191

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.

4. Link an operand.

Page 200: VisiLogic - Ladder Programming

Utils Menu Clock Functions

192 VisiLogic: Ladder Programming

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

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

bitmap.

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

Page 201: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 193

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.

You build the net using Indirect Time functions.

Building the HMI Displays

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

Page 202: VisiLogic - Ladder Programming

Utils Menu Clock Functions

194 VisiLogic: Ladder Programming

Start & End Time Variables1. Open the HMI Display editor.

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

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

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

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

Page 203: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 195

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

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

Page 204: VisiLogic - Ladder Programming

Utils Menu Clock Functions

196 VisiLogic: Ladder Programming

This Display is complete.

Day of Week & Day of Month Variables1. Create and name a new display; Select Day and Date.

2. Draw a text box, entering the text Select Day.

3. Draw another text box, entering the text Select Date.

4. Create a field to hold the Select Day Variable.

5. Define this variable as Day of Week, and link it to MI 32.

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

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

This Display is complete.

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

2. Draw a text box, entering the text Select Month.

Page 205: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 197

3. Create a field to hold the Select Month Variable.

4. Define this variable as Month, and link it to MI 34.

This Display is complete.

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

Setting Jumps

1. Open Display Start and End Time.

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

3. Click on Display, and select Display 2.

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

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

Set the Jump from Display 3 according to your requirements.

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

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

Day of the Month-Direct and Indirect

Day of the Week-Direct and Indirect

Page 206: VisiLogic - Ladder Programming

Utils Menu Clock Functions

198 VisiLogic: Ladder Programming

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

Direct Day of the Month:

According to the above example:

On the 1st, 3rd, 5th and 7th the function block’s output will be logic «1» (ON).

On the other days of the month the function block’s output will be logic «0» (OFF).

Indirect Day of the MonthIndirect 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).

Setting Day of Month via Controller KeypadPlace an Indirect Day of Month clock function in the Ladder.

Page 207: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 199

Create HMI Displays that include keyboard-entry variables. This type of variable accepts a number entered via the controller keyboard, and stores the number in a linked operand, ML or SL.

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

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

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

Direct Day of the Week:

T

According to the above example:

On Monday, Tuesday, Wednesday, Thursday, and Friday the function block’s output will be logic «1» (ON).

On Saturday and Sunday the function block’s output will be logic «0» (OFF).

Page 208: VisiLogic - Ladder Programming

Utils Menu Clock Functions

200 VisiLogic: Ladder Programming

Indirect Day of the WeekIndirect 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).

Setting Day of Week via Controller KeypadPlace an Indirect Day of Week function in the Ladder.

Create HMI Displays that include keyboard-entry variables. This type of variable accepts a number entered via the controller keyboard, and stores the number in a linked MI, SI, ML or SL.

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

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

Page 209: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 201

Clock: Month-Direct/Indirect The Month function block is used for monthly time functions.

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

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

Indirect Month FunctionIndirect 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).

Setting Month via Controller KeypadPlace an Indirect Month function in the Ladder.

Page 210: VisiLogic - Ladder Programming

Utils Menu Clock Functions

202 VisiLogic: Ladder Programming

Create HMI Displays that include keyboard-entry variables. This type of variable accepts a number entered via the controller keyboard, and stores the number in a linked MI, SI, ML or SL.

Up and Down scroll arrow keys for scrolling through the months

+/- keys for selecting the desired months enter key for confirming selection

The Indirect Month function values are entered into a 12-bit bitmap in the linked MI. The MI value shown below contains the decimal value 3591 (hexadecimal E07). According to these values:

During the months of January, February, March, October, November, and December the function block will go to logic «1» (ON).

During the months of April, May, June, July, August, and September the function block will go to logic «0» (OFF).

Clock: Time, Direct/Indirect The Time function block is used for 24 hour time functions.

Page 211: VisiLogic - Ladder Programming

Clock Functions Utils Menu

VisiLogic: Ladder Programming 203

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

According to the above example:

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

Page 212: VisiLogic - Ladder Programming

Utils Menu Clock Functions

204 VisiLogic: Ladder Programming

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

The Indirect Time function is linked to two consecutive registers. The values are read as hexadecimal (BCD). According to the figure shown below:

Between the hours of 7:30 and 11:59 P.M., the FB’s output will be logic «1» (ON).

At all other times, the FB’s output will be logic «0» (OFF).

Setting Time (Hour) via Controller KeypadPlace an Indirect Time clock function in the Ladder.

Create HMI Displays that include keyboard-entry variables. This type of variable accepts a number entered via the controller keyboard, and stores the number in a linked register.

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

The number keys. The <Enter> key to confirm the entry.

Page 213: VisiLogic - Ladder Programming

Immediate Elements Utils Menu

VisiLogic: Ladder Programming 205

Clock: Year, Direct/Indirect The Year function block is used for yearly time functions.

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

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

According to the above example:

Between the years 2002 — 2005, power will flow through the function.

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

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

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

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

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

Up and Down scroll arrow keys to scroll through the years Enter key to select the desired year

Immediate Elements Immediate elements are located on the Utils> Immediate menu. They are supported by Snap-in I/O modules.

Page 214: VisiLogic - Ladder Programming

Utils Menu Immediate Elements

206 VisiLogic: Ladder Programming

Generally, I/Os values are read and written to according to the PLC program scan.

Immediate elements immediately update the current value of I/Os—without regard to the program scan. This enables you:

Write values to inputs, and use the new input value to execute the rest of the PLC program.

Turn outputs ON, as for example in an emergency routine. If your program requires you to immediately update an I/O value, use Immediate elements in conjunction with Interrupt routines.

Immediate: Read Physical Input Read Physical Input is located on the More> Immediate menu. Use this element to immediately read the current status of a physical, hardwired input and use the new input status to execute the PLC program.

Ordinarily, a PLC program scan runs like this:

When the program encounters Read Physical Input, the program immediately reads the physical PLC input, updates the PLC memory, and executes the rest of the program using the new input data.

To use Read Physical Input, place it in a net after an activating condition and select the desired input.

Note • Within a net, Read Physical Input should stand alone except for its

Page 215: VisiLogic - Ladder Programming

Immediate Elements Utils Menu

VisiLogic: Ladder Programming 207

activating condition.

Immediate: Write to Physical Analog Output Write to Physical Analog Output is located on the More> Immediate menu. This element can be used to immediately write a value into a physical, hardwired output—without regard to the program scan.

This function is generally included in an Interrupt routine, for example to turn an output ON in case of an alarm or emergency.

Note • Within a net, Write to Physical Analog Output should stand alone .

Immediate: Write to Output Write to Output is located on the More> Immediate menu. This element can be used to immediately update the status of a physical, hardwired output.

Page 216: VisiLogic - Ladder Programming

Utils Menu Immediate Elements

208 VisiLogic: Ladder Programming

Ordinarily, a PLC program scan runs like this:

When the program encounters Write to Output, the program immediately writes the physical PLC output, then executes the rest of the program.

To use Write to Output, place it in a net after an activating condition and select the desired output.

Note • This function is not supported for outputs located on I/O Expansion modules.

• Within a net, Write to Output should stand alone except for its activating condition.

• If, after Write to Output has been executed, the same output is updated as the rest of the program runs, the last update is the one written to the PLC memory at the end of the program scan.

Immediate: Update High-speed Input Update High-Speed Input is located on the More> Immediate menu. Use this element to immediately update the current value of a physical, hardwired high-speed input—without regard to the program scan—and use the new input value to execute the PLC program.

Page 217: VisiLogic - Ladder Programming

Immediate Elements Utils Menu

VisiLogic: Ladder Programming 209

When the program encounters Update High-Speed Input, the program immediately compares the actual, current input value against the value in the MI linked to the input.

If the values are not equal, the MI is updated with the current input value; the rest of the program executes according to the new input data.

To use Update High-Speed Input, place it in a net after an activating condition and select the desired input.

Note • Within a net,Update High-Speed Input should stand alone except for

its activating condition.

Page 218: VisiLogic - Ladder Programming

Utils Menu Immediate Elements

210 VisiLogic: Ladder Programming

Immediate: HSC Freq. Measurement Utilities HSC Frequency Measurement Utilities are three functions located on the More> Immediate menu. Together, you can use them to monitor a high-speed counter as a frequency value, and reset it if the changing frequency deviates from a set value.

The frequency can be measured from 0.25 Hz up to the maximum frequency that the PLC can read.

Note • These utilities are compatible:with Enhanced Vision controllers only.

with High-Speed Inputs (Reload)

Page 219: VisiLogic - Ladder Programming

Immediate Elements Utils Menu

VisiLogic: Ladder Programming 211

Frequency Measurement based on HSC

This element registers the frequency of the high-speed counter at each scan, and checks it against the frequency of the previous scan. If the change (delta) is greater than desired, the function sets an MB.

To use this function, place it in a net after an activating condition and select the desired high-speed counter. Once the function is activated, it continues to run until it is stopped by the application.

Input Type Description Comments A Constant High-speed counter This is the actual counter the function

monitors B MB, XB,

SB Type of Deviation (0 = Percent, 1 = # of pulses)

You can use either a percentage, or in .01Hz resolution by the ‘C’ input). Percentage: the range is 1 to 1000, where 1000 is 10 times the previous measured value # of Pulses: in 0.01Hz. ( 100 is equal to 1Hz)

C MI, XI Permissible Deviation from previous value (default 20)

This is the legal ‘Delta’; the difference between the current value and the previous value that was read.

D MI, XI Reserved, future use HSC Freq. Measurement

Output Type Description Comments E MB, XB HSC Freq. Measurement: within

permissible deviation Turns OFF when the between the current value and the previous value exceeds the permissible deviation.

F MI, Xi HSC Freq. Measurement: Status Messages

• 0 — Valid data • 1 — No signal for time at least twice the permissible deviation (value in operand C). • 2 – Signal came after more than 2 sec (Less than 0.5Hz) • 4 – Higher frequency measured than the PLC can run • 8 — The change in frequency is bigger than the value in operand C • 10 — Reserve for system error

G DW, XDW

HSC Freq. Measurement: Result, in 0.01 Hz

The frequency value

Page 220: VisiLogic - Ladder Programming

Utils Menu On-Line Test Mode (Debug) functions

212 VisiLogic: Ladder Programming

H DW, XDW

HSC Freq. Measurement: actual HSC value

This is the number of pulses from the counter

I MI, XI HSC Freq. Measurement: function’s Reload Value

This is the actual high-speed counter’s Reload value

J MI, XI Reserved, future use HSC Freq. Measurement

Stop Frequency Measurement

Use this function to stop the Frequency Measurement based on HSC function.

Reset HSC

Use this function to initialize the high-speed counter value.

On-Line Test Mode (Debug) functions You can use the On-line Point and Interval utilities on the Utils> Debug menus to test your project. For more information, refer to the manual VisiLogic – Utilities.

To test a project, first establish PC-PLC communications by connecting the controller to the PC with the MJ10-22-CS25 programming (communication) cable. Note that the V1040 supports download via a USB (Type A to mini-B) cable. COM port 1 function is suspended when the USB port is physically connected to a PC.

Note • You can also use Remote Access to establish a communication line via modem or network.

Once you have established communications, download the project and click the On-Line Test button. The Online Test toolbar opens, enabling you to:

Switch between Run and Stop modes. Use Single Scan to run a single cycle of the ladder program for debugging

purposes. You can stop the scan cycle at any point by placing OnLine Test Points, located on the More menu, in the Ladder.

Page 221: VisiLogic - Ladder Programming

On-Line Test Mode (Debug) functions Utils Menu

VisiLogic: Ladder Programming 213

When the scan reaches an OnLine test point that is active (receives RLO), Online Test freezes, enabling you to check element status and values, including Timer values, at that point during Ladder execution. Note that if more than one OnLine test point is activated, SB 35 turns ON. Measure the time interval between 2 points in the Ladder application, by placing Start and End Interval elements, located on the More menu, anywhere in the application. The time interval, units of 10 micro-seconds, is stored in the DW linked to the End Interval element. Note that Interval elements should not be placed in Interrupt routines.

Open Remote Access to debug remote controllers via network or modem connections.

In Online Test mode, you can view the power flow, and view and force operand values and element status. You can also select a controller that is directly

Page 222: VisiLogic - Ladder Programming

Utils Menu Idle

214 VisiLogic: Ladder Programming

connected to the PC, or a PLC’s network ID # if the PC is linked to a CANbus or RS485 network.

Force I/0, by right-clicking the operand and setting the desired state

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

Idle Place Idle anywhere in a Ladder program to completely stop the program scan for a specific number of micro-seconds.

All action is suspended, including I/O updates. Idle is located on the More menu,.

BackUp Security (Enhanced Vision only)

This Ladder function is located on the Utils menu. Use it to store the following values in the controller’s memory:

SB314 «Pcom block» operand SI 253 Info Password value

Page 223: VisiLogic - Ladder Programming

UniVision Licensing Utils Menu

VisiLogic: Ladder Programming 215

SI 50 Info press time Note that if such a backup exists, SB 303 will be ON.

UniVision Licensing You can create a PLC license number and burn it into a secured, hidden sector in the PLC.

You can then use this license in your Ladder to control how your program functions.

To license the PLC, use the UniVision Licensing function on the Utils menu may be used in conjunction with the UniVision Licensing stand-alone utility, which may be freely downloaded from http://unitronics.com/Content.aspx?page=Downloads

The result of the License operation can then be used to activate or deactivate different sections of your application.

The UniVision Licensing utility enables you to create two kinds of licenses:

• One that licenses the program, but that is not bound to a particular PLC • One that licenses the program, and incorporates a specific PLC ID

number. This type will only license the specific PLC it is generated for. Note that you can use this type to license a remote end user’s PLC.

Generate and burn a license, without PLC ID number

1. In the UniVision Licensing utility, click on the first tab, Programmer: Create & Burn License.

Page 224: VisiLogic - Ladder Programming

Utils Menu UniVision Licensing

216 VisiLogic: Ladder Programming

2. Enter the key number. This is the first part of the license (input A).

3. Enter the values for Data1, Data2, and Data3. This is the second part of the license (input B).

4. You can use the Generate buttons to create these values. The fact that there are 3 values enables you to create levels of access.

5. Establish a communication connection to the PLC, and press Burn License to PLC.

Generate and burn a license comprising a PLC Unique ID numberIn this case, you must establish a communication link with the specific PLC which is to be licensed, and generate a KeyGen number. The KeyGen number encrypts the PLC’s Unique ID Number. You use this number to generate the license, which is specific to that PLC. This license number will not work in any other PLC.

Providing a license to a remote customerNote that you can send the UniVision Licensing utility to a customer. The customer can email you the KeyGen number; you use this to generate the license number and send it back to the customer, who can then license the PLC.

First, get the KeyGen number:

1. In the UniVision Licensing utility, click the Customer:Get License tab.

2. Establish a communication connection to the PLC.

Page 225: VisiLogic - Ladder Programming

UniVision Licensing Utils Menu

VisiLogic: Ladder Programming 217

3. Click Generate, and then the Copy button.

Next, generate the license:

4. Paste the value into the KeyGen field, and fill in the Key and Data values

5. Click Generate License, and then the Copy button..

Now, license the PLC:

Page 226: VisiLogic - Ladder Programming

Data Table Functions Data Tables, Read/Write

218 VisiLogic: Ladder Programming

6. Paste the number into the Customer License field, and press Send License to PLC to burn it to the PLC.

Data Table FunctionsFor information regarding Data Tables, refer to the manual VisiLogic – Utilities.

Data Tables, Read/Write Read enables you to copy values from a Data Table to PLC operands.

Write functions enables you to copy operand values from a PLC to Data Tables.

Read/Write functions are located on the Data Tables menu.

Note • The maximum number of operands of any type for a Read/Write operation is 128.

Rows

Read RowUse the Read function to select Data Table rows and read their data into PLC memory operands. Values are read from the Data Table into the operands that are linked to it in the Read function. Note that the number of rows read cannot exceed the number of rows that are in the Data Table.

Page 227: VisiLogic - Ladder Programming

Data Tables, Read/Write Data Table Functions

VisiLogic: Ladder Programming 219

Write RowUse the Write function to select PLC memory operands and read their data into Data Table rows.

Values are read from the PLC into the Data Table cells that are linked to it in the Write function.

Note that you provide a Start Address for the PLC memory operands; the Write function will take a vector of operands that will fit the number of rows in the Data Table.

Page 228: VisiLogic - Ladder Programming

Data Table Functions Data Tables, Read/Write

220 VisiLogic: Ladder Programming

Writing to flash via ladder

Columns Note • ‘Part of Project’ Data cannot be included in Write Column functions.

• Not all Data Types are supported:Unsupported types: Boolean, Byte, String, all ‘Address of’ types.

Supported Data Types: Integer (16-bit), Long, Float, Timer (32 bit)

• When longer data types are copied to shorter data types, the longer values are truncated.

• When shorter data types are copied to longer types, each source value is copied to the lower bytes of the destination.

Supported Read Write Data Table

PLC Operand

Read Write Result

Page 229: VisiLogic - Ladder Programming

Data Tables, Read/Write Data Table Functions

VisiLogic: Ladder Programming 221

Byte Integer 1 Byte is read into the first 8 bits of Integer (LSB).

The first 8 bits of the Integer are written into a Byte. The last 8 bits of the Integer (MSB) are discarded.

Byte Long Integer

Integer Integer

Integer Long Integer

1 Integer is read into the first 16 bits of a Long.

The first 16 bits of the Long are written into an Integer. The last 16 bits of the Long are discarded.

Long Integer

Integer First 16 bits of Long are read into an integer. The last 16 bits of the Long are discarded.

An Integer is written into the first 16 bits of a Long.

Long Integer

Long Integer

Timer Timer

Float Float

Read Column A column 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, according to FIFO.

Write Column PLC operands are the source for the Write function. Values are read into the Data Table cells that are linked to it in the Write function. Values are read from the operands into the Data Table according to FIFO.

Page 230: VisiLogic - Ladder Programming

Data Table Functions Data Tables, Read/Write

222 VisiLogic: Ladder Programming

Read/Write Direct These operations access the values in the database without reference to table structure

Database: Read DirectThe Read Direct operation copies data from the data tables into a vector of registers within the controller.

1. Select Direct: Read from the Data Tables menu.

2. Place the function in the desired net.

3. Link the desired Operands and Addresses.

Operands A & B determine the data’s destination —to where the data

from the data table will be copied.

Operand A: sets the register type for the target vector and the start

register.

Operand B: determines the offset, in registers, from the start register.

Operands C, D, & E determine the data’s source —from where in the

data table the data will be copied.

Operand C: contains the start byte of the source vector within the data

table.

Operand D: determines the offset, in bytes, from the start register.

Operand E: determines the length of the source vector.

Page 231: VisiLogic - Ladder Programming

Data Tables, Read/Write Data Table Functions

VisiLogic: Ladder Programming 223

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,

10 bytes of data will be copied from the data table into 5 MIs, 2 bytes

into each MI.

If Operand A is linked to a double register; ML or DW; and Operand E

contains 2, 8 bytes of data will be copied into 2 double register.

Read Example

Below, database bytes 28, 29, 30, 31, 32, and 33 are read and written into MIs 15, 16, and 17.

Database: Write DirectThe Write operation copies data a vector of registers into the database.

1. Select Data Block Read from the Data Tables menu.

2. Place the function in the desired net.

3. Link the desired Operands and Addresses.

Operands A & B determine the data’s source —from which registers the

data will be copied.

Operand A: sets the register type for the target vector and the start

register.

Page 232: VisiLogic - Ladder Programming

Data Table Functions Data Tables, Read/Write

224 VisiLogic: Ladder Programming

Operand B: determines the offset, in registers, from the start register.

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.

Page 233: VisiLogic - Ladder Programming

Data Tables: Find Row, Find Row Extended Data Table Functions

VisiLogic: Ladder Programming 225

Data Tables: Find Row, Find Row Extended Find Row and Find Row Extended are located on the Data Tables menu. These functions search through a data table, comparing the input value with the values in the data table.

Find Row: If a matching value is found, the number of the row is stored in the output value.

Find Row Extended: This function enables you to search for more than one value. The number of the row containing all of the values is stored in the output value.

Parameter Purpose

Page 234: VisiLogic - Ladder Programming

Data Table Functions Data Tables: Clear, Row, Column, Table

226 VisiLogic: Ladder Programming

Name

Table Click on the drop-down arrow to select a table from the project, then click the desired column. The number of bytes in the column of the linked data table define the length of the input vector.

Limit Rows Check this option to limit the number of rows the function will search.

Start Address The length of the input vector is determined by the number of bytes in the selected data table column. If, for example, the column contains 6 bytes, the vector will be 3 MIs long. Note that a string must end with a null (0) character.

Found Row If a matching value is found, the number of the row is stored in the output value. Note that: — if the value is not found, -1 will be the value returned by the function. — if the row is not found, if, for example, the number given for the first row is higher than the number given for the last row, the value will be -2.

Data Tables: Clear, Row, Column, Table These functions are located in the Data Tables menu. Clear enables you to use a Ladder condition to delete values in a particular table.

Clear Row Select the desired Data Table. You can determine which row will be cleared either by entering the row number, or linking to an MI address containing the row number.

Clear Column

Select the desired Data Table to display its columns. You determine which column will be cleared by clicking it.

Page 235: VisiLogic - Ladder Programming

Data Table to Data Table: Copy Data Table Functions

VisiLogic: Ladder Programming 227

Clear Table Select the desired Data Table. When the function is activated, all of the tables values will be cleared.

Data Table to Data Table: Copy These functions enable you to transfer values within the same or between different Data Tables. They are located on the Data Tables menu.

Copy Rows Select the source table and target table, and make the appropriate selections.

Copy Column

Note that the columns you select must have the same structure.

Page 236: VisiLogic - Ladder Programming

SD Ladder Functions Data Table to Data Table: Copy

228 VisiLogic: Ladder Programming

SD Ladder FunctionsUse the SD ladder functions to read and write data to and from an SD card.

The functions are located on the SD menu on the Ladder toolbar.

If you include SD functions in your application, build a net that uses SB 217 to check that the SD card is in the PLC and correctly formatted, and SB 218 to check that the card is write-enabled, if it contains a write-protection tab

SD card Functions

Category Purpose FunctionsSD Password

Use this to guard SD data. Set SD Card Password

Folder Report

Reports the number of files currently in an SD folder, and

Folder Report Function

Page 237: VisiLogic - Ladder Programming

Data Table to Data Table: Copy SD Ladder Functions

VisiLogic: Ladder Programming 229

the number of files can still be created in that folder.

SD Data Table

Use these to read and write data between Data Tables and SD card.

Log Data Table Row to SD Card Copy PLC Data Table to SD Copy SD to PLC Data Table Find Index or Tag in .udt

SD Trend Record an entire or partial trend to a .utr file in the SD card Trends folder

Save Trend to SD CardStop Saving Trend to SD

SD Excel Use Create Excel Line to pull numeric data or text strings from the PLC and use delimiters to structure a line; then use the function Write Delimited Line to create an Excel file on an SD Card. The functions can create .csv and .txt lines

Create Excel Delimited Line Write Excel Delimited Line to SD

Data Blocks

Use these to create data storage areas in the SdBLocks folder on a SD card. SD Data Blocks may reach a total of 4G, or a single Block may be up to 4G. A Data Block comprises Sub-Blocks of 512 Bytes

Create SD BlockRead from SD Block to Vector Write from Vector to SD Block

Data Files Use Windows Explorer to store any type of file onto an SD card, such as .html or .jpg. The SD File Functions enable your Ladder application to read and write these files in ‘chunks’ of 512 bytes. You can also use these functions to pull data from the PLC and create files on the SD card.

SD File: OpenRead/Write next Chunk SD File: Close Delete SD File SD File Info Rename SD File

Safely Remove SD

Use this to ascertain when an SD card may be safely removed from the PLC

Remove SD

Clone to/from SD

Use this to clone a complete PLC and application, Data Tables, or operand values from a PLC or install such clone files to a PLC of the

Clone to/from SD

Page 238: VisiLogic - Ladder Programming

SD Ladder Functions SD System Operands

230 VisiLogic: Ladder Programming

same model

SD System Operands # Description Turns ON when: Turns OFF when: Reset by:SB 217 SD Card Present An SD Card is in the slot,

and is formatted to FAT32

SD Card is not found, or is incorrectly formatted

OS

SB 218 SD Card Write Enabled

Write is enabled: the card’s write-protect lock is off

Write is disabled: the card’s write-protect lock is on

OS

SB 219 SD FIFO Empty (SD Card may be Ejected)

Power-up No SD Card is in Slot No SD requests exist

There are no SD requests pending, such as Data Table Copy/Log, Alarms, or from Info Mode

OS

SBs 324-29 are linked to the SD File utilities.SB 324 SD: Open File (Read

to SD) (Status messages in SI 67)

When Ladder function SD File: Open successfully activates a file for Read

When Ladder function SD File: Close finishes closing an open file and SB 327 (EOF) turns ON

OS. At Power-up and at SD File: Close

SB 325 SD File: Read Chunk in Progress (a Chunk is 512 bytes long)

When the Ladder function SD: Get Next File Chunk is reading a chunk into a vector

When the Ladder function SD: Get Next File Chunk has finished reading the chunk

OS. At Power-up

SB 326 SD Read File: End Of File (EOF, entire file has been read)

When the When the Ladder function SD: Get Next File Chunk reads the final Chunk

When the last chunk has been read, and when Ladder function SD File: Close start

OS. At Power-up and at SD File: Close

SB 327 SD: Open File (Write to SD) (Status messages in SI 67)

When Ladder function SD File: Open successfully activates a file for Write on a SD card

SB 328 SD File: Write Chunk in Progress (a Chunk is 512 bytes long)

When the Ladder function SD: Get Next File Chunk is writing a chunk into a vector

SB329 SD Write File: End Of File (EOF, entire file has been read)

When the When the Ladder function SD: Get Next File Chunk writes the final Chunk

SB 340 Log to SD in Progress Row is being copied from DT to SD Card

When copy is complete OS

SB 341 Write Data Table from PLC to SD in Progress

Entire Data Table is being copied from DT to SD Card

When the Write process is complete

OS

SB 342 Read Data Table from SD to PLC in Progress

Entire Data Table is being copied from SD Card to DT

When the Write process is complete

OS

SB 343 File Report in Progress

While Report process is in progress

When the Report is complete

OS

SB 345 Email Send in Progress

ON when function is busy

SB 344 Write delimited line to SD in Progress

While line is being written When the Write process is complete

OS

SB 346 SD Data Block 0 Busy

When a Write or Read utility is being run on a Data Block

When no utility is running OS

SB 347 SD Data Block 1 Busy

SB 348 SD Data Block 2 Busy

Page 239: VisiLogic - Ladder Programming

SD System Operands SD Ladder Functions

VisiLogic: Ladder Programming 231

SB 349 SD Data Block 3 Busy

SB 352 SD: Enable writing Alarm History to SD

Turned ON by user to write Alarm History to SD Card

Off by default. Causes the PLC to write Alarm History to the PLC

At Power-up, or by user

SB 358 SD: Delete File in Progress

ON when function is busy OFF when function is not busy

OS

SB 359 Folder Report Function in Progress

ON when function is busy OFF when function is not busy

OS

SB 366 Clone in Progress (Process can take from several seconds to several minutes)

ON when function is busy OFF when function is not busy

OS

# Description Value Comments SI 63 Maximum number of

Trend files that can be saved (read-only)

0-64 The maximum amount of Trend files (*.utt files) in a single folderis 64. The value in SI 634shows the number of remaining *.utr files; if 5 *.utr files exist, SI 64 = 59

Initialized at Power-up Updated when:SB 217 is ON and SB 341 turns ON

SI 64

Maximum number of DT files that can be saved (read-only)

0-64 The maximum amount of Data Table files (*.udt files) in a single folder is 64. The value in SI 634shows the number of remaining *.udt files; if 5 *udt files exist, SI 64 = 59

Initialized at Power-up Updated when:SB 217 is ON and SB 341 turns ON

SI 66 SD Card Status Messages

This SI is a bitmap; a bit turns ON to indicate status.

All bits OFF – No errors Bit 1 – Read: End Of File indication Bit 2 – Can’t open file Bit 3– Error while writing to a file Bit 4 – Error while reading from a file Bit 5 – Failed to close a file Bit 6 – SD is full Bit 7 – Path not found Bit 14 — Turns ON when SD is inserted into slot and PLC runs checks, turns OFF when SB 217 turns ON

Initialized at Power-up. While the application is running, the user application must reset the bits.

SI 67 SD Card, Read Files: Status

Value 0= No error 1= No SD card in Slot 2= Vector is not long enough to contain data (may be at upper address limit of that data type) 3= Path to SD file not found 4=Another file is currently open 5 = File is closed 6 = Busy: previous request in progress 7 = File Open Error 8 = Read Error 9 = File Close error

SI 67 reports status for the following SD File utilities:

• Read SD File: Open • Read Next File Chunk • Read SD File: Close

SI 68 SD Card, Write Files: Value SI 68 reports status for the

Page 240: VisiLogic - Ladder Programming

SD Ladder Functions SD System Operands

232 VisiLogic: Ladder Programming

Status 0 = No error 1 = No SD card in Slot 2 = Vector is not long enough to contain data (may be at upper address limit of that data type) 3 = Path to SD file not found 4 = Another file is currently open5 = File is closed 6 = File Open error 7 = Write Error 14 = File Close error

following SD File utilities: • Write SD File: Open • Write Next File Chunk • Write SD File: Close

SI 69 SD Card: File Open Time (may signal file fragmentation)

Time required to open SD files, in units of 10mSec.

Each time a file is opened, the OS updates this value. A typical first write (open + write) = approx. 500mSec, typical first read (open + read)= approx. 60mSec Over time, this may increase due to file fragmentation. If the time becomes to great, the card should be reformattedReset at Power-up and when SD card is removed.

SI 76 SI 76 Number of Alarms currently in History Buffer

Shows the number of Alarms in the history buffer.

If SB 352 SD: Write Alarm History to SD is ON, the Alarms in the buffer are automatically written to the SD card. Initialized by the user, or when the PLC is initialized.

SI 160 SD Trend 1 status This SI is a bitmap; a bit turns ON to indicate status when the function Start Saving Trend to SD runs.

All bits OFF – No errors Bit 4 – Start Saving Trend is in progress for another Trend Bit 7 – This Trend does not exist (may result when an MI is used to provide the Trend number, and the value points to a non-existent Trend) Bit 8 – Start Saving Trend is in progress for this Trend Bit 9 – Start Saving Trend failed

SI 161 SD Trend 2 status SI 162 SD Trend 3 status SI 163 SD Trend 4 status SI 164 SD Trend 5 status SI 165 SD Trend 6 status SI 166 SD Trend 7 status SI 167 SD Trend 8 status

SI 330 SD: Write DT from PLC to SD — Total Amount of Data to be Copied (blocks of 512 bytes)

When the application runs the function Copy Data Table to SD, SI 330 shows the total number of blocks of data to be copied from the PLC.

Initialized at Power-up

SI 331 SD: Write DT from PLC to SD — Remaining Amount (blocks not yet copied)

Shows how many blocks of data remain to be copied. The value increases by 1 each time a block is copied.

Initialized: When the PLC begins to copy a new block of data to the SD card At Power-up.

SI 332 SD: Read DT SD to PLC -Total Amount of Data to be Copied (blocks of 512 bytes)

When the application runs the function Copy Data Table to PLC, SI 332 shows the total number of blocks of data to be copied

Initialized at Power-up

Page 241: VisiLogic - Ladder Programming

Set SD Card Password SD Ladder Functions

VisiLogic: Ladder Programming 233

from the SD. SI 333 SD: Read DT from SD to

PLC — Remaining Amount (blocks not yet copied)

Shows how many blocks of data remain to be copied. The value increases by 1 each time a block is copied.

Initialized: When the PLC begins to copy a new block of data from the SD card At Power-up.

# Description Value Comments

SDW 59

SD Card: Free space (bytes)

Capacity given in 512-byte chunks. The value is written when SB 217 turns ON, and is updated at each write operation. The operand is reset when SB 217 turns OFF.

Initialized at Power-up.

PLC Name If you apply a PLC name, the PLC writes this name to the files it creates on the SD Card.

HMI Progress Bar You can use SI 330 and SI 331 to create a progress bar on an HMI display that shows when the PLC is writing data to the SD; and SI 332 and SI333 to show data being written from the SD to the PLC. To create a progress bar, use the elements shown in the following image. Note that the PLC copies data at a rate of .5k per second. This means that a PLC requires approximately 24 seconds to transfer a Data Table comprising 120k to an SD card.

Removing the SD Card To indicate that the SD card may be safely removed, you can link an HMI element to SB 219 SD FIFO Empty (SD Card may be Ejected).

Set SD Card Password You can guard the SD card with a password.

Note that when the PLC is in Information Mode, a user can only download data to an SD card:

If the SD is guarded with a password. If the user can supply the password. The only exception is Firmware,

which may be downloaded without password. Note • The SD Password is case-sensitive

Page 242: VisiLogic - Ladder Programming

SD Ladder Functions Set SD Card Password

234 VisiLogic: Ladder Programming

The maximum Password length is 8 bytes. Each register byte contains one character.

1. Place a Set SD Password function in the Ladder; you can either directly assign a text password, or provide it via MI.

Page 243: VisiLogic - Ladder Programming

SD Card: Folder Report Function SD Ladder Functions

VisiLogic: Ladder Programming 235

SD Card: Folder Report Function Use this Function to see:

The number of files are currently in an SD folder The number of files can still be created in that folder

Notes • The function reports only on the types of files that are linked to a particular folder. For example, each Data Table folder (DT) may contain a maximum of 64 .udt files. If Folder Report is set to DT folders, it only reports the number of .udt file. If there are other file types present in the folder, they are ignored.

• If there are fewer files than the maximum allowed, but the SD card capacity is exceeded, SI 66 will indicate SD Card Full.

• Use SB 343,SD: File Report in Progress, as a condition to running the function

Parameter Name Purpose

Input SD Folder: Select SD Folder

Either select a folder, or link an operand. To use an operand value to access folders, use the numbers shown in Select SD Folder; where ‘1’ will access the main DT folder, and ‘101 will access folder DT2.

Output

Number of files currently in Folder

The number of files currently in Folder (max = 64 per folder)

Number of Files that may

The number of files that may still be created (max = 64 per folder)

Page 244: VisiLogic - Ladder Programming

SD Ladder Functions SD Card and Data Table Functions (Ladder)

236 VisiLogic: Ladder Programming

still be created

Folder Report: Status Operand

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the SD card is idle • Bit 1 — SD Card internal error • Bit 2 — SD file is incorrect type • Bit 3 — There is no SD card in the slot • Bit 4 — The SD card has failed (Check SI 66) • Bit 5 — Path not found

Folder Report: Success Bit

Turns ON when the Report is complete. It remains ON until it is reset by the application, or until the application calls the function.

Note SB 359: Folder Report Function in Progress (ON when function is busy)

SD Card and Data Table Functions (Ladder) These functions enable you to:

Log a single row of data from a Data Table into a .ulg file located on the SD card

Write all or part of a Data Table into a .udt file located on the SD card Read all or part of an SD card .udt file to a Data Table Search for tagged sections in a .udt file

If a Data Table is marked as Part of Project, you cannot copy it or log lines from it to an SD card.

# Description Value Comments

SI 64 Maximum number of DT files that can be saved (read-only)

0-64 The maximum amount of Trend files (*.udt files) in a single folder is 64. The value in SI 634shows the number of remaining *.udt files; if 5 *udt files exist, SI 64 = 59

Initialized at Power-up Updated when:SB 217 is ON and

SB 341 turns ON

Log Data Table Row to SD Card

1. To log a row from a Data Table, build a net that includes the function SD> Write Log Line to SD. Use SB 340 to ensure that the PLC is not currently logging a row to the SD card. When the application writes this type of data to the SD card, it creates a single file called UNILOG.ulg in the LOG folder, and then appends each new line from the selected Data Table to this log file.

Page 245: VisiLogic - Ladder Programming

SD Card and Data Table Functions (Ladder) SD Ladder Functions

VisiLogic: Ladder Programming 237

Page 246: VisiLogic - Ladder Programming

SD Ladder Functions SD Card and Data Table Functions (Ladder)

238 VisiLogic: Ladder Programming

Parameter Name

Purpose

Source Selects the Data Table you want to log from.

Row index Determines which row in the table will be logged.

Status messages

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

All bits OFF – No errors, and the SD card is idle Bit 1 – The SD card was formatted in an SD Tools version that is not compatible with the VisiLogic application in the PLC. or VisiLogic version is not compatible with the PLC OS. Check to see if you need to update versions. Bit 2 – The data in the SD is not compatible with the data in the Data Table Bit 3 – Data checksum error Bit 4 – Failed to open file Bit 5 — Failed to write to the SD file Bit 6 — Failed to close file Bit 7 — In progress Bit 8 — No SD card found Bit 9 — SD error, check SI 66 for error message Bit 10 – Requested Data Table does not exist

Success Bit Turns ON when the data is successfully written to the SD card. It remains ON until it is reset by the application, or until the application calls the function.

Data Table To / From SD Card The Ladder function DT to SD creates .udt files and saves them in the main DT folder or in one of four sub-folders. DT1, DT2, DT3, DT4. Each folder can contain 64 files, for a total of 320 .udt files.

Page 247: VisiLogic - Ladder Programming

SD Card and Data Table Functions (Ladder) SD Ladder Functions

VisiLogic: Ladder Programming 239

Write Data Table to SD (Copy DT to SD)

1. To copy an entire or partial Data Table, build a net that includes the function SD> Write DataTable to SD. Use an inverted contact of SB 341 to ensure that the PLC is not currently writing to the SD card.

2. Set the options to copy all or part of a Data Table. When the application writes this type of data to the SD card, it creates a file with the extension .udt in the selected DT folder.

Parameter Name

Purpose

Source: Data Table to copy

Selects the Data Table you want to write from.

Copy options Select to copy all or part of a Data Table. Selecting Copy enables the Start Row and Number of Rows parameters.

Target: SD Folder This is where the .udt file will be stored on the SD card. You can select the folder, or provide the Folder number via register. Values point to folders as follows: 1=the main DT folder, 100=DT1, 101=DT2, 102=DT3, and 103=DT4.

.udt File Name Can be up to 8 characters long, and may be provided by constant text or register. Note that if the name comes from an MI, the function copies a vector 8 bytes long, or until it finds a ‘null’ character.

Overwrite/Append If the function finds a .udt file in that folder of the same name, • Selecting Overwrite replaces the file. • Selecting Append adds the new data to the existing .udt file. You can

assign a unique name (DT Tag) to each appended section, marking the sections for later use in your program. The Tag may contain up to 16 characters.

Status messages This MI is a bitmap; a bit turns ON to indicate status.

Page 248: VisiLogic - Ladder Programming

SD Ladder Functions SD Card and Data Table Functions (Ladder)

240 VisiLogic: Ladder Programming

The MI is initialized when the function starts.

All bits OFF – No errors, and the SD card is idle Bit 1 – The SD card was formatted in an SD Tools version that is not compatible with the VisiLogic application in the PLC. or VisiLogic version is not compatible with the PLC OS. Check to see if you need to update versions. Bit 2 – The structure of the .udt file and the Data Table are not identical Bit 3 – Data checksum error. Please send application and any related information to [email protected]. Bit 4 – Failed to open file Bit 5 — Failed to read from file Bit 6 — Failed to close file Bit 7 — In progress Bit 8 — No SD card found Bit 9 — SD error, check SI 66 for error message Bit 10 – Requested Data Table does not exist

Success Bit Turns ON when the data is successfully written to the SD Card. It remains ON until it is reset by the application, or until the application calls the function.

Note • The maximum number of Data Table files that can be created in a folder SD card is 64, including the main DT folder.

Read .udt file from SD to PLC Data Table (Copy SD >DT)

1. To copy .udt data from an SD card into a Data Table, build a net that includes the function SD> Copy Data to PLC Data Table. Use an inverted contact of SB 342 to ensure that the PLC is not reading writing from the SD card. Note that in order to copy data, the Data Table structure in both PLC and SD card must be identical: equal number of rows, equal numbers of columns, and column data types.

Parameter Purpose

Page 249: VisiLogic - Ladder Programming

SD Card and Data Table Functions (Ladder) SD Ladder Functions

VisiLogic: Ladder Programming 241

Name

Select SD Folder

This is where the source .udt file is on the SD Card. You can select the folder, or provide the Folder number via register. Values point to folders as follows: 1=the main DT folder, 100=DT1, 101=DT2, 102=DT3, and 103=DT4.

File Name The Table Name can be up to 8 characters long, and may be provided by constant text or register.

Read Options If the .udt file contains appended sections, you can search for a Numeric or Text Tag.

Target: Data Table

Click on the drop-down arrow to select a Data Table in the project. The Table Name can be up to 8 characters long, and may be provided by constant text or register. Note that if the name comes from an MI, the function copies a vector 8 bytes long, or until it finds a ‘null’ character.

Status Operand

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• Bit 1 – The SD card was formatted in an SD Tools version that is not compatible with the VisiLogic application in the PLC. or VisiLogic version is not compatible with the PLC OS. Check to see if you need to update versions.

• Bit 2 – The data in the SD is not compatible with the data in the Data Table

• Bit 3 – Data checksum error • Bit 4 – Failed to open file • Bit 5 — Failed to read from file • Bit 6 — Failed to close file • Bit 7 — In progress (SB 342 ON) • Bit 8 — No SD card found (SB217 (ON) • Bit 9 — SD error, check SI 66 for error message • Bit 10 – Requested Data Table does not exist

Success Bit Turns ON when the data is successfully read. It remains ON until it is reset by the application, or until the application calls the function.

Search .udt for Tag or Index#

If a .udt file was created using appended sections, you can search it for the index number or tag name.

Use an inverted contact of SB 342 to ensure that the PLC is not reading writing from the SD card.

Page 250: VisiLogic - Ladder Programming

SD Ladder Functions SD Card and Data Table Functions (Ladder)

242 VisiLogic: Ladder Programming

Parameter Name

Purpose

Select SD Folder

This is where the source .udt file is on the SD Card. You can select the folder, or provide the Folder number via register. Values point to folders as follows: 1=the main DT folder, 100=DT1, 101=DT2, 102=DT3, and 103=DT4.

File Name The Table Name can be up to 8 characters long, and may be provided by constant text or register.

Tag Type Search for a Numeric or Text Tag.

Table

Click on the drop-down arrow to select a Data Table in the project. The Table Name can be up to 8 characters long, and may be provided by constant text or register. Note that if the name comes from an MI, the function copies a vector 8 bytes long, or until it finds a ‘null’ character.

Status Operand

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• Bit 1 – The SD card was formatted in an SD Tools version that is not compatible with the VisiLogic application in the PLC. or VisiLogic version is not compatible with the PLC OS. Check to see if you need to update versions.

• Bit 2 – The data in the SD is not compatible with the data in the Data Table

• Bit 3 – Data checksum error • Bit 4 – Failed to open file • Bit 5 — Failed to read from file • Bit 6 — Failed to close file • Bit 7 — In progress (SB 342 ON) • Bit 8 — No SD card found (SB217 (ON) • Bit 9 — SD error, check SI 66 for error message • Bit 10 – Requested Data Table does not exist

Page 251: VisiLogic - Ladder Programming

SD Card and Data Table Functions (Ladder) SD Ladder Functions

VisiLogic: Ladder Programming 243

Success Bit Turns ON when the tag is found. It remains ON until it is reset by the application, or until the application calls the function.

Import data from an SD card into a PLC Data TableThis imports data from a Data Table on the SD card into a Data Table in the PLC.

The Data Tables must be identical. In order to ensure this, follow the recipe below.

1. Open the Data Table, and click Export the Data Table Structure to convert the table to an .xml file.

2. From the VisiLogic Tools menu, open SD Tools.

3. From the SD Tools Tools menu, open DB Tools.

4. Navigate to and select the .xml file.

5. SD Tools opens the file for editing.

Page 252: VisiLogic - Ladder Programming

SD Ladder Functions SD Card and Data Table Functions (Ladder)

244 VisiLogic: Ladder Programming

6. Click on table cell to edit the values.

7. From the File menu, select Build DT for PLC.

8. Copy the resulting .udt file to the SD card, and then place it in the PLC.

Page 253: VisiLogic - Ladder Programming

SD Card and Trends SD Ladder Functions

VisiLogic: Ladder Programming 245

9. Build a net including the SD utility DT to PLC.

When the Program runs, it will copy the values from the Data Table on the SD card into the PLC Data Table cells.

SD Card and Trends Use the Start Saving Trend to SD to record an entire or partial trend; and Stop Saving Trend to halt the recording process. When the application writes this type of data to the SD card, it creates a file with the extension .utr in the Trends folder. Each time you start and stop saving the Trend, the application adds a new segment to the file.

Parameter Name

Purpose

Source Trend Number

Click on the drop-down arrow to select a Trend in the project.

Target SD .utr file

Link an operand to provide a file name. Note that you MUST provide a file name. If the linked register is empty, the Trend will not be recorded to the SD. This is where the .udt file will be stored on the SD card. You can select the folder, or provide the Folder number via register. Values point to folders as follows: 1=the main DT folder, 100=DT1, 101=DT2, 102=DT3, and 103=DT4.

Status Operand

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• Bit 1 – The SD card was formatted in an SD Tools version that is not

Page 254: VisiLogic - Ladder Programming

SD Ladder Functions SD Card: Data to Excel

246 VisiLogic: Ladder Programming

compatible with the VisiLogic application in the PLC. or VisiLogic version is not compatible with the PLC OS. Check to see if you need to update versions.

• Bit 2 – The data in the SD is not compatible with the data in the Data Table

• Bit 3 .-.Data checksum error • Bit 4 – Failed to open file • Bit 5 — Failed to read from file • Bit 6 — Failed to close file • Bit 7 — In progress • Bit 8 — No SD card found • Bit 9 — SD error, check SI 66 for error message

Success Bit Turns ON when the data is successfully written to the PLC Data Table. It remains ON until it is reset by the application, or until the application calls the function.

Displaying the saved Trend You can display Trend curves directly from a .utr file by using the HMI element Trend from SD.

Link SBs 117 and 118 with HMI buttons to enable users to jump between segments. Use the inverted contact of SB119 as a condition as shown below.

When you save a Trend to an SD card, each time you start and stop the save, another segment is added to the .utr file. # Description Turns ON : Turns OFF : Reset by: SB 116 SD Trends to SD: Set

to Overwrite .utr User application User

application User

Use these to control the display of Trend segments on the HMI screen. Use the inverted contact of SB119 as a condition. SB 117 SD Trends: Jump to

next segment User application User

application User

SB 118 SD Trends: Jump to previous segment

User application User application

User

SB 119 SD Trends: System busy — Draw Trend is gathering data

User application User application

User

SD Card: Data to Excel You can write PLC data to Excel files an the SD card using the functions Create Delimited Line to structure a line, and Write Delimited Line to send it to a specified Excel file on an SD Card.

Note that the main EXCEL folder and subfolders EXCEL0, EXCEL1, EXCEL2, EXCEL3 can each contain 64 files, for a total of 320 .csv files.

Create Delimited Line Use this function to select PLC data, including numeric data and text strings, structure it, and save the resulting line to a vector of operands.

Page 255: VisiLogic - Ladder Programming

SD Card: Data to Excel SD Ladder Functions

VisiLogic: Ladder Programming 247

Defining a Line

Each row in the table displayed under Input will be a cell in the Excel line.

1. Click the Add Row icon to open the Excel Field dialog box.

2. Click a tab to select the type of data.

3. Click the Delimiter cells to select a Delimiter character that is different from the default.

Page 256: VisiLogic - Ladder Programming

SD Ladder Functions SD Card: Data to Excel

248 VisiLogic: Ladder Programming

4. Add and delete row by using the icons at the top of the function

Type Parameter Purpose

Source: Define Data

Field Use this to specify data for a cell in the Excel line.

Delimiters Control characters that delimit the data for that cell

Target: Data Buffer

SD: Start of Vector, Create .csv Line

Select the operand that will be start of the vector the function uses to store the data selected for the line, plus its delimiters. Use this operand for the function Write Delimited Line

SD: Max Vector Length, Create .csv Line (bytes)

Sets the maximum length of the vector in bytes.

SD: Final # of bytes, Create .csv Line

Reports the actual number of bytes sent to the vector

Status SD: Create .csv Line Status Messages

This is a bitmap; a bit turns ON to indicate status. It is initialized when the function starts.

• Bit 1 — The line is truncated • Bit 2 — Fail to open the file. • Bit 3 — Fail to write the file • Bit 4 — SD full • Bit 5 — No SD card (SB [217]) • Bit 6 — Path not found • Bit 7 — Unknown error — please check SI 66

Page 257: VisiLogic - Ladder Programming

SD Card: Data to Excel SD Ladder Functions

VisiLogic: Ladder Programming 249

Write Delimited Line Use Write Delimited Line to pull the data from the vector used by Create Delimited, and use it to write to (or create) an Excel file in this folder, or in one of four sub-folders.

Notes • Write Delimited Line pulls data from the vector in chunks of 512 bytes, and writes this entire 512 bytes to the SD card. Write Delimited line is not linked in any way to Create Delimited Line. In Create Delimited Line, the parameters SD: Max Vector Length and SD: Final # of bytes, do not influence Write Delimited line.

• Use SB 344,Write delimited line to SD in Progress, as a condition to running the function.

Type Parameter Purpose

Source Start of Vector

Use the operand that is the Start of Vector for the Create Delimited Line function.

Target Select SD folder

This is where the line will be stored on the SD card. You can select the folder, or provide the Folder number via register. Values point to folders as follows: 10=the main Excel folder, 1000= Excel1, 1001= Excel2, 1002= Excel3, and 1003= Excel4.

File Name Either enter a name, or link an operand to provide a file name. Note that you MUST provide a file name. If the linked register is empty, the file will not be created to the SD. If the folder does not contain a file of that name, the function will create one.

File Extension

Select .txt or csv

Status SD: Write .csv Line Status Messages

This is a bitmap; a bit turns ON to indicate status. It is initialized when the function starts.

• Bit 1 — Wrong data

Page 258: VisiLogic - Ladder Programming

SD Ladder Functions SD Block Functions

250 VisiLogic: Ladder Programming

• Bit 2 — Fail to open the file. • Bit 3 — Fail to write the file • Bit 4 — SD full • Bit 5 — No SD card (SB [217]) • Bit 6 — Path not found • Bit 7 — Unknown error — please check SI 66

Success Bit Turns ON when line is successfully written

SD Block Functions SD Data Blocks are data storage files in the SdBLocks folder on a SD card.

SD Data Blocks may reach a total of 4G, or a single Block may be up to 4G. A Data Block comprises Sub-Blocks of 512 Bytes. The SD Block functions enable you to read/write blocks of raw data between operands and these files.

SD Data Block Functions Create SD Block

Creates an SD Data Block in the SdBLocks folder. Read from SD Block to Vector

Reads a specified Sub-Block from a specified Data Block to an operand vector that is 512 bytes long.

Write from Vector to SD Block Writes 512 bytes from an operand vector to a specified Sub-Block in a Data Block

Create SD BlockUse this function to:

Create an SD Data Block. You can create up to 4 SD Data Block: Block0.udb, Block1.udb, Block2.udb, and Block3.udb

Specify the number of Sub-Blocks it contains. Enlarge an existing block.

You can also specify the number of Sub-Blocks the block will contain. This may be used to enlarge the Block by appending Sub-Blocks.

Page 259: VisiLogic - Ladder Programming

SD Block Functions SD Ladder Functions

VisiLogic: Ladder Programming 251

Parameter Purpose

SD Block number Select the Block number, 0-3, or use an operand to assign a number at run time.

Sub-Blocks Use this to specify the number of Sub-blocks in the Data Block.

Overwrite/Append If this function finds an existing SD Block of this number, you can overwrite it or append these Sub-Blocks. Selecting Append enlarges the SD Block by adding Sub-blocks.

Status Operand This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the SD card is idle • Bit 1 – The SD card is busy. • Bit 2 – No SD card found, or the card is locked (Write-enable OFF) • Bit 6 — Internal error

Success Bit Turns ON when the Block is created. It remains ON until it is reset by the application, or until the application calls the function.

Read from Vector to SD Block

Parameter Purpose

SD Block number

Select the Block number, 0-3, or use an operand to assign a number at run time.

Target Sub-Block (location in Block): Vec->SD.udb

The data will be written to this sub block. The number is the sequential number of the sub-block in the .udb file.

Source: Start of Vector

Select the operand that is the start of the 512-byte long vector that provides the data that is written to the .udb file.

Page 260: VisiLogic - Ladder Programming

SD Ladder Functions SD Block Functions

252 VisiLogic: Ladder Programming

(512 bytes): Vec->SD

Status Messages

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the SD card is idle • Bit 1 – The SD card is busy. • Bit 2 – No SD card found, or the card is locked (Write-enable OFF) • Bit 3 .-.There are less than 512 bytes in this vector (can happen if the

start of the vector is too close to the end of the operand address range) • Bit 4 – The SD Data Block number is invalid (valid numbers are 0-3. This

error may result when using indirect addressing) • Bit 5 — SD card function was called while the SD is busy • Bit 6 — Internal error • Bit 7 — Data Block size exceeds 4G • Bit 8 — SD card is full •

Bits 10-13 can occur because the SD card does not have an SD_Blocks folder, or because a file of that name has not been created in the SD_Blocks folder.

• Bit 10 — Can’t open file/path not found • Bit 11 — Error while writing to a file/path not found • Bit 13 — Failed to close a file/path not found • Bit 14 — Create SD Block: Do not overwrite is selected, but the number of

Sub-blocks is less than the number of sub-blocks already in the Data Block

Success Bit Turns ON when the data is successfully written to the Block. It remains ON until it is reset by the application, or until the application calls the function.

Write from SD Block to Vector

Parameter Purpose

SD Block number

Select the Block number, 0-3, or use an operand to assign a number at run time.

Source Sub-Block (location in Block): SD.udb-> Vec

This is the sequential number of the sub-block in the .udb file.

Page 261: VisiLogic - Ladder Programming

SD File Functions SD Ladder Functions

VisiLogic: Ladder Programming 253

Target: Start of Vector: SD.udb-> Vec

The function will write 512 bytes of data to the PLC, starting with this operand.

Status Messages

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the SD card is idle • Bit 1 – The SD card is busy. • Bit 2 – No SD card found, or the card is locked (Write-enable OFF) • Bit 3 .-.There are less than 512 bytes in this vector (can happen if the

start of the vector is too close to the end of the operand address range) • Bit 4 – The SD Data Block number is invalid (valid numbers are 0-3. This

error may result when using indirect addressing) • Bit 5 — SD card function was called while the SD is busy • Bit 6 — Internal error • Bit 8 — SD card is full • Bit 9 — Read: End Of File indication

Bits 10-13 can occur because the SD card does not have an SD_Blocks folder, or because a file of that name has not been created in the SD_Blocks folder.

• Bit 10 — Can’t open file/path not found • Bit 12 — Error while reading from a file/path not found • Bit 13 — Failed to close a file/path not found

Success Bit Turns ON when the data is successfully written to the Block. It remains ON until it is reset by the application, or until the application calls the function.

SD File Functions You can use Windows Explorer to store any type of file onto an SD card, such as .html or .jpg. The SD File Functions enable your Ladder application to read and write these files in ‘chunks’ of 512 bytes.

Note • These functions can only run on files that observe the 8.3 naming convention; the file name cannot exceed 8 characters, and the file extension cannot exceed three.

Using SD File Functions Each read or write operation requires three functions: Open File, Read or Write, and Close File. The functions are located on SD>SD File Utilities.

Open SD File Note that there are separate Open File functions for both Read and Write. Open File must be used to activate the correct file in the correct folder before running a read or write function.

Read Next Chunk Reads a specified file from a specified folder to an operand vector in ‘chunks’ that are 512 bytes long.

Write Next Chunk Writes data chunks 512 bytes from an operand vector to a specified file on the SD card.

Page 262: VisiLogic - Ladder Programming

SD Ladder Functions SD File Functions

254 VisiLogic: Ladder Programming

Close File. There are separate Close File functions for both Read and Write.

The examples below show the functions and the System operands required to run read and write operations.

Read File: Example Note the use of SBs 324, 325, and 326. These enable the Read Next Chunk function to continue reading data chunks until it has completed reading the entire file.

Page 263: VisiLogic - Ladder Programming

SD File Functions SD Ladder Functions

VisiLogic: Ladder Programming 255

Write File: Example Functions

Read From SD File: Open

Parameter Purpose

Select Folder Select the folder, or use an operand to assign a number at run time using the following values: Alarms: 0 • DT main folder: 1 • DT1–4: 101 to 103 • Log: 3 • System: 4 •User_app: 5 • Trends main folder — 600 • Trends1-4: 600 to 603 • SdBLocks: 9 •Excel main folder: 100 • Excel1-4: 1000 to 1003 • Web: 11

File name Either enter the file name, or provide it via operand.

File size When the function runs, this reports the size of the file, in bytes.

Read File: Get Next Chunk

Parameter Purpose

Read: File Chunk Buffer

This the start of the vector that holds the data read from the file. This vector is 512 bytes long.

Read: File Chunk Length

This shows the length of the chunk that is currently read. Note that the final chunk, containing the last of the file data, will generally be LESS than 512 bytes.

Page 264: VisiLogic - Ladder Programming

SD Ladder Functions SD File Functions

256 VisiLogic: Ladder Programming

Read File: CloseRun this when entire files has been read.

Write From SD File: Open

Parameter Purpose

Select Folder Select the folder, or use an operand to assign a number at run time using the following values: Alarms: 0 • DT main folder: 1 • DT1–4: 101 to 103 • Log: 3 • System: 4 •User_app: 5 • Trends main folder — 600 • Trends1-4: 600 to 603 • SdBLocks: 9 •Excel main folder: 100 • Excel1-4: 1000 to 1003 • Web: 11

File name Either enter the file name, or provide it via operand. Note that: -If the file does not exist on the SD -and the SD card is Write-enabled the function will create the file.

File size When the function runs, this reports the size of the file, in bytes.

Write File: Get Next Chunk

Page 265: VisiLogic - Ladder Programming

SD File Functions SD Ladder Functions

VisiLogic: Ladder Programming 257

Parameter Purpose

Write: File Chunk Buffer

This the start of the vector that holds the data that will be written to the file. The function takes 512 bytes of data.

Write: File Chunk Length

Enter the number of bytes to be written to the SD file.

Write File: CloseRun this when entire files has been written.

Delete File Use this to delete any file on the SD card

Note • These functions can only run on files that observe the 8.3 naming convention; the file name cannot exceed 8 characters, and the file extension cannot exceed three.

• Use SB 358, Delete File in Progress, as a condition to running the function

Parameter Purpose

Select Folder Select the folder, or use an operand to assign a number at run time using the following values: Alarms: 0 • DT main folder: 1 • DT1–4: 101 to 103 • Log: 3 • System: 4 •User_app: 5 • Trends main folder — 600 • Trends1-4: 600 to 603 • SdBLocks: 9 •Excel main folder: 100 • Excel1-4: 1000 to 1003 • Web: 11

File name Either enter the file name, or provide it via operand. Note that: -If the file does not exist on the SD

Page 266: VisiLogic - Ladder Programming

SD Ladder Functions SD File Functions

258 VisiLogic: Ladder Programming

-and the SD card is Write-enabled the function will create the file.

Status Messages

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the SD card is idle • Bit 1 – SD Card internal error. • Bit 2 – Delete Failed • Bit 3 — No SD card found, or the card is locked (Write-enable OFF) • Bit 5– Path not found • Bit 7 — The SD card has failed (Check SI 66)

Success Bit

Turns ON when the data is successfully written to the Block. It remains ON until it is reset by the application, or until the application calls the function.

SD File Information

Use this function to check if a specific file is located in a specific SD folder, and get specific file details.

Note • Use SB 359, File Info function in Progress, as a condition to running the function

Parameter Purpose

Select Folder Select the folder, or use an operand to assign a number at run time using the following values: Alarms: 0 • DT main folder: 1 • DT1–4: 101 to 103 • Log: 3 • System: 4 •User_app: 5 • Trends main folder — 600 • Trends1-4: 600 to 603 • SdBLocks: 9 •Excel main folder: 100 • Excel1-4: 1000 to 1003 • Web: 11

File name Either enter the file name, or provide it via operand.

Status Messages

This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

Page 267: VisiLogic - Ladder Programming

SD File Functions SD Ladder Functions

VisiLogic: Ladder Programming 259

• All bits OFF – No errors, and the SD card is idle • Bit 1 – SD Card internal error. • Bit 2 – Cannot read file • Bit 3 — No SD card found, or the card is locked (Write-enable OFF) • Bit 4– The SD card has failed (Check SI 66) • Bit 5 — Path not found

Success Bit

Turns ON when the data is successfully written to the Block. It remains ON until it is reset by the application, or until the application calls the function.

Page 268: VisiLogic - Ladder Programming

SD Ladder Functions SD: Safely Remove

260 VisiLogic: Ladder Programming

Rename SD File Use this to rename any file on the SD card.

System Operands

SD: Safely Remove Use SD: Safely Remove to prevent the card from being physically removed while an SD function is in progress.

When SD: Safely Remove is called, it:

Checks to see if any SD functions are running.

If so, Safe to Remove indicates which function is active via the Status DW.

It allows a current task to be completed, but prevents new ones from starting.

When the SD card is completely free, the Safe to Remove bit turns ON. This must be reset by the user.

Page 269: VisiLogic - Ladder Programming

SD: Safely Remove SD: Cloning via Ladder

VisiLogic: Ladder Programming 261

The Status DW is a bitmap. Bits and their indications are shown in the following table. When a bit is ON, the related function is active.

Bit Function 0-5 (reserved)

6 Start Saving to SD is running: SD Trend 8 7 Start Saving to SD is running: SD Trend 7 8 Start Saving to SD is running: SD Trend 6 9 Start Saving to SD is running: SD Trend 5 10 Start Saving to SD is running: SD Trend 4 11 Start Saving to SD is running: SD Trend 3 12 Start Saving to SD is running: SD Trend 2 13 Start Saving to SD is running:SD Trend 1 14 HMI function Trend from SD 15 SD File Info 16 Delete SD File 17 Folder Report: Number of Files 18 Create Excel Delimited Line 19 SD File Utilities: SD File Write 20 SD File Utilities: SD File Read 21 SD Block Utilities: Read/Write to Block 3 22 SD Block Utilities: Read/Write to Block 2 23 SD Block Utilities: Read/Write to Block 1 24 SD Block Utilities: Read/Write to Block 0 25 HMI Variable SD Browser 26 PC Utility is communicating with SD 27 Information Mode is accessing SD 28 SD Data Table Utilities: Log DT Row 29 SD Data Table Utilities: Read from DT /Search DT for Tag or Index 30 SD Data Table Utilities: Write to DT 31 Alarm History is being logged to SD

SD: Cloning via LadderSD Clone functions can:

Create compressed data files and store them on an SD card. Upload compressed files from an SD card to a PLC.

You can ‘clone’ a complete PLC or data using the SD Ladder functions

These Ladder functions are parallel to the actions you can carry out via Information Mode.

Notes • The SD Card password and the Clone File password must be identical.

• You can use Unitronics’ SD Card Explorer, included in the SD Card Suite, to access SD card files and either upload them to a PC for viewing and editing, or transfer them into another PLC’s SD card.

This function must be used with a negative transition element.

Page 270: VisiLogic - Ladder Programming

SD: Cloning via Ladder SD: Safely Remove

262 VisiLogic: Ladder Programming

Parameter Purpose

Direction Clone To SD: Creates a compressed data file in the correct SD card folder Clone From SD: Installs a compressed data file from an SD card folder into the PLC

File Type Select Direct or Constant. If you select Direct, the value in the register determines the data file that the function creates/installs according to the following legend: 2 = Full Data Table (*.fdt files) 4 = Firmware (*.Oxx files: .O13, .O35, or .O57) 5 = User Application (+VLP if exists) (*.vxx files: .V13, .V35, .V57) 7 — Full cloning (DT, Firmware, UA, Operands)(*.Cxx) .C13, .C35, or C57) 8 = Operands (*.Dxx files: .D13, .D35, .D57) Note that the file extension numbers relate to the Vision model: .x13 =V130, .x35 =V350, .x57 =V570

File Name This is limited to 8 characters. The file extension is automatically assigned by the PLC according to the file type.

If you are cloning an OS or a ‘Full Clone’, the file name MUST be exactly 8 characters long.

Status This MI is a bitmap; a bit turns ON to indicate status. The MI is initialized when the function starts.

• All bits OFF – No errors, and the process is idle • Bit 1 – No SD card found, or the card is locked (Write-enable OFF) • Bit 2 – Clone utility busy • Bit 3 -File type not found (*.FDT,*.Oxx,*.Vxx,*.Dxx,*.Cxx) • Bit 4– Incompatible Boot Version/Firmware/Clone file • Bit 5 — Internal use • Bit 6- Timeout exceeded • Bit 7 — — Safe to Remove Bit is ON • Bit 8 — Path not found (Install Clone) • Bit 9 — Password error

Page 271: VisiLogic - Ladder Programming

SD: Safely Remove SD: Cloning via Ladder

VisiLogic: Ladder Programming 263

Success Bit

Turns ON when the data is successfully written to the SD. It remains ON until it is reset by the application, or until the application calls the function.

SB 366: Clone in Progress. Note that the process can take from several seconds to several minutes.

The following nets show the conditions required to run the function.

Page 272: VisiLogic - Ladder Programming

COM Functions

264 VisiLogic: Ladder Programming

COM FunctionsFor information regarding COM functions, please refer to the VisiLogic – Communications manual.

FBs LibraryWhen you install VisiLogic, the program also installs a Function Block (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.

For specific information, refer to the manual VisiLogic – Function Blocks.

Note • You must use a condition (RLO) to activate any FB that requires

Configuration in your application, such as MODBUS or SMS.

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

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

Which FBs are installed in your library. Which FB versions are installed, which versions are used in the

open project, and to manage FB versions. FB memory usage.

Page 273: VisiLogic - Ladder Programming

FBs Library

VisiLogic: Ladder Programming 265

Page 274: VisiLogic - Ladder Programming

FBs Library

266 VisiLogic: Ladder Programming

Versions Used

Updating FB versions

Standard Vision: 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.

Enhanced Vision: FB libraries are updated as part of OS releases. When you update the OS, FBs are automatically updated as well.

Page 275: VisiLogic - Ladder Programming

FBs Library

VisiLogic: Ladder Programming 267

FBs List MODBUS, serial

MODBUS, IP

SMS Messaging

GPRS

Remote PLC DataCom

Communication Protocol

TCP/IP Communication Protocol

PID FB

Drum

Events

MB as PWM

Loadcell

Filter

Accelerate

Fast Response

Draw Axis

BAS

Trends

If your project is configured to Vision controllers that do not support HMI object Trend graphs, the Trend objects will not be displayed in the Project Navigation Window. These controllers include V120/230/260/280/290 (monochrome). In these models, the Trends (Legacy) Function Block may be used.

Trends (Legacy) Function Block

Page 276: VisiLogic - Ladder Programming

Index VisiLogic: Ladder Programming

VisiLogic: Ladder Programming 268

Index 22.5 ……………………………… 35, 205 AAdd ………………………………….. 117

Add (math) ………………………. 117 Add net ……………………………. 10

Addressing Operands ……………… 54 Analog I/Os

Analog Input …………………….. 205 Configuring I/O Expansion Modules

………………………………….. 205 Hardware Configuration ……….. 205

AND function …………………… 39, 98 ASCII ……………………………….. 167 ASCII String 160, 161, 164, 165, 167 Bbackup ……………………………… 214 Binary Numbers ……………. 107, 139 Bit ………………. 51, 56, 62, 105, 107

Bit Functions … 104, 105, 145, 146, 152

Memory Bits (MB) ……………….. 56 System Bits (SB) ………………… 62

CCalendar functions ……………….. 185 Call ………………………………. 28, 32 Casting ………………………. 131, 155 Change Element Type………………. 6 Change Element’s Operand ……….. 8 Clock ………………………………… 185 clone ………………………………… 261 Coil …………….. 6, 39, 44, 50, 51, 52 Comment ……………………………. 18 Compare ….. 39, 110, 111, 113, 115,

132, 150 Compile ……………………………….. 7 Connect ……………………………….. 7 Connecting Ladder Elements ……… 7 Constant Values ……………………. 55 Contacts .6, 39, 44, 46, 49, 206, 208 Controller ……………………………. 55 Convert MB to MI ……. 104, 142, 152 Convert MI to MB ……. 104, 142, 152 coordinated universal time ……… 185 Copy & Paste …………………… 11, 13 Copying Values .. 104, 142, 143, 144,

145, 146, 149, 150, 152, 154, 155, 164

Counter …………… 60, 137, 138, 205

Counter Values ……………….. 60, 138 Create ………………………………. 131 Cut & Paste …………………. 6, 11, 13 CY …………………………………… 205 DData Blocks …………………. 250, 253 Data Tables 218, 225, 226, 227, 236,

246, 253 Database, read/write . 142, 218, 227,

236 Dates …………………… 185, 188, 190 Debug ………………………………. 212 Decimal ………………………. 129, 131 Delete…………………………….. 6, 16 Descriptions …………………………. 52 Digital I/Os ………………………… 205 Direct Clock function ………. 185, 188 Direct Coil …………………………… 50 Direct Contact ………………………. 44 Direct Month Function …………… 201 Display text messages ………….. 165 Displaying Values ………….. 164, 165 Displays ………… 164, 170, 173, 174 Divide ………………….. 116, 118, 119 Double Word ………………………… 61 DW ……………………………………. 61 EEdit …………………………………. 6, 8 Edit values …………………………… 52 Elapsed ………………………………. 56 Element …… 4, 6, 8, 39, 52, 54, 206 Element’s Operand ………………….. 8 Enable Start Time ………………… 190 Equal …………………………. 112, 113 Ethernet ……………………………. 167 Excel………………………………8, 246 FFactor ………………………………. 125 Fall edge …………………………….. 49 files …………………………… 250, 253 Fill vector ……………… 140, 142, 146 Find …………………………………. 145 Find Bit …………………………….. 145 Find Value …………………… 142, 145 Flash ………………………………… 218 Float ………………………………….. 61 Float functions .. 129, 130, 131, 132,

133 Flow ………………………………….. 27

Page 277: VisiLogic - Ladder Programming

Index

VisiLogic: Ladder Programming 269

Force I/O …………………………… 212 Force Input ………………………… 212 Force Output ………………………. 212 Function ….. 1, 5, 28, 34, 39, 54, 98,

106, 110, 115, 116, 129, 130, 131, 132, 133, 134, 139, 153, 156, 164, 167, 169, 173, 174, 175, 185, 190, 208, 261, 264

GGet Max ……………………… 142, 154 Get Min ………………………. 142, 154 Graphs ……………………………… 171 Greater Than ………………………. 111 Hhide ………………………………….. 21 High Speed Input …………………. 208 High Speed Output (HSO) .. 177, 207 High-Speed Counter ………… 35, 210 HMI ………… 170, 171, 173, 175, 190

HMI keypad entries completed . 190 Hour …………………………………. 202 HTML …………………………. 250, 253 II/Os ……………… 205, 206, 207, 208 idle ………………………………….. 214 IEC 1131-3 …………………………… 3 Immediate …. 27, 35, 205, 206, 207,

208, 210 Import/Export ……………………… 23 Indirect Clock function ……. 185, 190 Indirect Time Function ……. 190, 202 Input …………………….. 56, 205, 206 Insert ………………………………… 10 Insert comments …………………… 18 Insert net ……………………………. 10 Integer, Constant ………………….. 55 Interrupt …….. 27, 35, 205, 207, 214 Interrupt HSC ………………… 35, 205 Inverted Coil ……………………….. 51 Inverted Contact …………………… 46 JJumps ……………………………….. 28 KKeypad Entry ………………………. 190 LLabels………………………………… 28 Ladder 1, 3, 4, 5, 18, 21, 27, 34, 39,

106, 119, 173, 175, 210, 212, 236 Ladder Diagram ……………………… 3 Ladder element… 6, 39, 54, 250, 253 Ladder Logic ………………………….. 3 Ladder Modules ……………………. 27

Ladder Net ……………………. 3, 9, 28 Ladder rail …………………………….. 3 Latched ………………………………. 51 Less Than ……………………. 113, 114 Lexical Search ………………………. 54 Linearization ………………………. 120 Link …………………………………… 54 List ……………………………………. 52 Load Functions .. 134, 137, 138, 142,

143, 170 Log ……………………………. 236, 253 Logic ….. 98, 99, 103, 104, 106, 140,

142, 152 Loops ……………………………..27, 28 MMath Functions .. 115, 116, 117, 118,

119, 120, 125, 126, 127, 128, 129, 154

MB-Memory Bits ………………..52, 56 Memory …………………………….. 218 Memory Float ……………………….. 61 MI-Memory Integers …………..52, 61 ML-Memory Long Integers ……52, 61 Modules ………………………….. 1, 27 Month …………… 188, 190, 198, 201 Month Variable ……………………. 190 Move …………………………… 16, 155

selected nets ……………………… 16 Move Elements ……………………… 13 Multiple Input Values ……………. 116 Multiply ………………………. 116, 118 NNegative Transition Contact ……… 49 Nets…. 1, 3, 4, 5, 6, 7, 9, 10, 18, 28,

44, 50, 52 Network ……………………………… 52 New net ……………………………… 10 NI ……………………………………… 52 Not Equal ………………………….. 113 Notepad ……………………………… 18 NSI-Network System Integer ……. 52 Numeric ……………………………. 161 OOFF ……………….. 44, 46, 50, 51, 56 ON…………………. 44, 46, 50, 51, 56 Online point ……………………….. 212 O-Output …………………………….. 56 Operand ….. 8, 39, 52, 54, 55, 61, 62 Operand Address …………………… 54 Operand Description ………………… 8 Operand types ………………….52, 61 OR …………………………………….. 99

Page 278: VisiLogic - Ladder Programming

Index

270 VisiLogic: Ladder Programming

Outputs ……………………….. 56, 207 PPassword ……………………………. 21 Paste …………………………….. 11, 13 Placing function blocks ……….. 5, 115 Positive Transition Contact ………. 46 Power ………………………… 3, 7, 127

flow ………………………………….. 7 Power-up Values ………………. 55, 62 Preset Value ………………………… 56 Program Flow ………………….. 27, 28 Program Sequence ……… 27, 28, 205 Project ………………………………. 212 PTO ………………………………….. 177 PWM-Pulse Width Modulation …… 177 RRails ………………………………….1, 3 RAM …………………………………. 218 Recipes ……………………………… 225 Reload ………………………………. 205 Reset ………………………………… 134 Reset coil ……………………………. 51 Resizing ……………………………….. 9 RFC 1305 …………………………… 185 RLO ………………………………….. 106 Rotate ………………………………. 103 RTC Real-Time-Clock .. 165, 185, 205 Rung …………………………………1, 3 SSB-System Bit …………………. 52, 62 Scan ……………………… 27, 212, 214 SD ….. 235, 236, 246, 250, 253, 261 SDW ………………………………….. 62 SDW-System Double Word ………. 52 security ……………………….. 21, 214 Select ……………………………. 52, 54 Shift ………………………….. 103, 156 Signed …………………………… 55, 61 Single scan ………………………… 212 SI-System Integer ……………. 52, 62 Sizing ………………………………….. 9 SL-System Long Integer …….. 52, 62

Snap-in I/O Module ……………….. 56 Square root ……………………….. 128 Store Functions … 39, 131, 134, 135,

136, 137, 138, 139, 140, 142, 144 String . 160, 164, 165, 167, 168, 169 Subroutine

Return ……………………………… 34 Subroutines 1, 20, 21, 23, 27, 32, 34 Subtract function …………… 116, 119 Symbols ……………………………… 52 System Operands ………………….. 62 TTest …………………………………. 105 Test mode …………………………. 212 Text Variable ……………………… 165 Time ………………………………… 164 Time function block ……………… 202 Timers ……… 56, 137, 138, 139, 153 Toggle………………………………… 52 Trig functions ……………………… 131 Triggering signal ……….. 46, 49, 205 Troubleshooting ……………. 133, 212 UUnlatch ………………………………. 51 Unsigned …………………… 52, 55, 61 UTC …………………………………. 185 utility ………………….. 8, 28, 35, 214 VValues …………………………….52, 55 Variable Types ……………………. 165 Variables ……….. 173, 174, 175, 190 Vector Copy …………………. 142, 149 Vector operations …… 120, 139, 143,

144, 145, 146, 149, 150, 153, 155, 156, 157, 158, 161, 164

View Window ……. 52, 55, 56, 61, 62 WWeek …………………………. 188, 199 XXOR …………………………………. 101 YYear …………………………………. 205

  • VISILOGIC

    SOFTWARE MANUAL

    FUNCTION BLOCKSV230-21-G23 Rev: 3:00

    RE

    AL

    CKSev: 3:00

  • The information in this document reflects products at the date
    of printing. Unitronics reserves the right, subject to all
    applicable laws, at any time, at its sole discretion, and without
    notice, to discontinue or change the features, designs, materials
    and other specifications of its products, and to either permanently
    or temporarily withdraw any of the forgoing from the market.

    All information in this document is provided «as is» without
    warranty of any kind, either expressed or implied, including but
    not limited to any implied warranties of merchantability, fitness
    for a particular purpose, or non-infringement. Unitronics assumes
    no responsibility for errors or omissions in the information
    presented in this document. In no event shall Unitronics be liable
    for any special, incidental, indirect or consequential damages of
    any kind, or any damages whatsoever arising out of or in connection
    with the use or performance of this information.

    The tradenames, trademarks, logos and service marks presented in
    this document, including their design, are the property of
    Unitronics (1989) (R»G) Ltd. or other third parties and you are not
    permitted to use them without the prior written consent of
    Unitronics or such third party as may own them.

  • Table of Contents VisiLogic Function Blocks
    …………………………………………………………………..
    6

    MODBUS (Serial)
    ………………………………………………………………………….
    10

    MODBUS (Serial) Overview
    ……………………………………………………………………..
    11 MODBUS: Configuration
    …………………………………………………………………………
    15 MODBUS: ScanEX and Scan
    …………………………………………………………………….
    17 Read Coils (1)
    ……………………………………………………………………………………..
    18 Read Inputs
    (2)……………………………………………………………………………………
    19 Read Holding Registers (3)
    ……………………………………………………………………..
    20 Read Float Registers (3)
    …………………………………………………………………………
    21 Read Input Registers (4)
    ………………………………………………………………………..
    22 Read Float Registers (4)
    …………………………………………………………………………
    23 Force Coil (5)
    ………………………………………………………………………………………
    24 Preset Holding Register (6)
    ……………………………………………………………………..
    25 Loopback Test (8)
    ………………………………………………………………………………..
    26 Force Coils (15)
    ……………………………………………………………………………………
    27 Preset Holding Registers (16)
    …………………………………………………………………..
    28 Preset Float Registers (16)
    ……………………………………………………………………..
    29 Read/Write from Data Tables
    …………………………………………………………………..
    30 Read/Write Mixed Data via MODBUS
    ………………………………………………………….
    33 Configuring a MODBUS slave
    device…………………………………………………………..
    35 Slave Addressing
    ………………………………………………………………………………….
    36 MODBUS via GSM or Standard Modem
    ………………………………………………………. 41
    MODBUS Status Operands
    ………………………………………………………………………
    42

    MODBUS (IP)
    ………………………………………………………………………………
    45

    MODBUS IP Overview
    ……………………………………………………………………………
    46 MODBUS: Configuration
    …………………………………………………………………………
    49 MODBUS: ScanEX and Scan
    …………………………………………………………………….
    52 Read Coils (1)
    ……………………………………………………………………………………..
    53 Read Inputs
    (2)……………………………………………………………………………………
    54 Read Holding Registers (3)
    ……………………………………………………………………..
    55 Read Flat Registers (3)
    ………………………………………………………………………….
    56 Read Input Registers (4)
    ………………………………………………………………………..
    57 Read Float Registers (4)
    …………………………………………………………………………
    58 Force Coil (5)
    ………………………………………………………………………………………
    59 Preset Holding Register (6)
    ……………………………………………………………………..
    60 Loopback Test (8)
    ………………………………………………………………………………..
    61 Force Coils (15)
    ……………………………………………………………………………………
    62 Preset Holding Registers (16)
    …………………………………………………………………..
    63 Preset Float Registers (16)
    ……………………………………………………………………..
    64 Read/Write Mixed Data via MODBUS
    ………………………………………………………….
    65 Read/Write from Data Tables
    …………………………………………………………………..
    67 Configuring a MODBUS slave
    device…………………………………………………………..
    71 Slave Addressing
    ………………………………………………………………………………….
    72

    SMS Messaging
    …………………………………………………………………………….
    79

  • SMS Messaging Overview
    ……………………………………………………………………….
    80 SMS: Scan
    ………………………………………………………………………………………….
    89 SMS: Send
    …………………………………………………………………………………………
    91 SMS Variables
    ……………………………………………………………………………………..
    94 SMS: Check GSM Signal Quality
    ……………………………………………………………….
    96 Send SMS messages from a GSM cell phone
    ……………………………………………….. 97 SMS
    Operands
    …………………………………………………………………………………….
    99

    GPRS
    ……………………………………………………………………………………….
    102

    GPRS Overview
    ………………………………………………………………………………….
    103 GPRS Configuration
    …………………………………………………………………………….
    107 GPRS Register to Network
    …………………………………………………………………….
    108 GPRS Run
    …………………………………………………………………………………………
    109 Start Call, End Call
    ……………………………………………………………………………..
    110 Listen /Stop Listening to Remote Device
    …………………………………………………… 111
    Unregister from Network
    ………………………………………………………………………
    112 Check Signal Quality
    ……………………………………………………………………………
    113 GPRS Operands & Status Messages
    …………………………………………………………
    114

    PLC DataCom
    …………………………………………………………………………….
    116

    PLC DataCom Overview
    ………………………………………………………………………..
    117 PLC DataCom: Configuration
    ………………………………………………………………….
    120 Master Data
    Request……………………………………………………………………………
    124 Update
    …………………………………………………………………………………………….
    125 DataCom Data Synchronization
    ………………………………………………………………
    126 PLC DataCom Status Messages
    ………………………………………………………………
    127

    Protocol FB, Serial
    ……………………………………………………………………….
    128

    Protocol FB (Serial) Overview
    …………………………………………………………………
    129 Protocol: Configuration
    ………………………………………………………………………..
    134 Protocol: Scan
    …………………………………………………………………………………..
    135 Protocol: Send
    …………………………………………………………………………………..
    139 Protocol: Copy Buffer Contents
    ………………………………………………………………
    143 Protocol: Reset Buffer
    ………………………………………………………………………….
    146 Variables
    ………………………………………………………………………………………….
    147 Checksum Configuration
    ……………………………………………………………………….
    154 Protocol Status Operands and Messages
    …………………………………………………… 159
    Examples
    …………………………………………………………………………………………
    160

    Protocol FB (TCP/IP)
    …………………………………………………………………….
    168

    Protocol FB (TCP/IP) Overview
    ……………………………………………………………….
    169 Protocol TCP/IP: Configuration
    ……………………………………………………………….
    171 Protocol TCP/IP: Scan
    ………………………………………………………………………….
    173 Protocol TCP/IP: Send
    ………………………………………………………………………….
    177 Variables
    ………………………………………………………………………………………….
    178 Protocol TCP/IP Status Messages
    …………………………………………………………….
    185

    PID
    …………………………………………………………………………………………
    187

    PID Overview
    …………………………………………………………………………………….
    188 PID Configuration
    ……………………………………………………………………………….
    190 Run Auto-Tune
    …………………………………………………………………………………..
    192 Run PID
    …………………………………………………………………………………………..
    193

  • Pause Integral & Derivative Calculation
    ……………………………………………………. 194
    Read Control Components
    …………………………………………………………………….
    195 Error Integral
    …………………………………………………………………………………….
    196 General Background: How PID Works
    ……………………………………………………… 197
    PID Status Messages
    …………………………………………………………………………..
    201 PID Tips
    …………………………………………………………………………………………..
    202

    Drum Sequencer
    …………………………………………………………………………
    206

    Drum Sequencer Overview
    ……………………………………………………………………
    207 Drum Sequencer: Configuration
    ……………………………………………………………..
    209 Drum Sequencer: Jump to Step
    ……………………………………………………………..
    210

    Events
    ……………………………………………………………………………………..
    211

    Events Overview
    ………………………………………………………………………………..
    212 PWM
    ………………………………………………………………………………………..
    219

    PWM FB Overview
    ………………………………………………………………………………
    220 Loadcell
    ……………………………………………………………………………………
    222

    Loadcell Overview
    ………………………………………………………………………………
    223 Advanced Loadcell Functions
    ………………………………………………………………….
    237

    Filter
    ……………………………………………………………………………………….
    248

    Filter Overview
    …………………………………………………………………………………..
    249 Accelerate
    …………………………………………………………………………………
    252

    Accelerate Overview
    ……………………………………………………………………………
    253 Configuration
    …………………………………………………………………………………….
    254 Increment/Decrement
    ………………………………………………………………………….
    255

    Fast Response
    ……………………………………………………………………………
    256

    Fast Response Overview
    ……………………………………………………………………….
    257 Fast Response: Configuration
    …………………………………………………………………
    264 Fast Response: Set Mode
    ……………………………………………………………………..
    265 Fast Response: Set Counter
    …………………………………………………………………..
    267 Fast Response: Scan
    ……………………………………………………………………………
    268

    BAS (Building Automation Systems)
    ………………………………………………… 269

    BAS, CSI Overview
    ……………………………………………………………………………..
    270 Configuration
    …………………………………………………………………………………….
    271 Open Session
    …………………………………………………………………………………….
    273 Scan
    ……………………………………………………………………………………………….
    274 Read, Write Inputs: Digital or Analog I/Os
    ………………………………………………… 275

    Draw Axis
    …………………………………………………………………………………
    277

    Draw Axis Overview
    …………………………………………………………………………….
    278 Configuration
    …………………………………………………………………………………….
    279 Draw
    ………………………………………………………………………………………………
    282
    Clear……………………………………………………………………………………………….
    283

  • VisiLogic Function Blocks 6

    VisiLogic Function Blocks

  • VisiLogic Function Blocks 7

    When you install VisiLogic, the program also installs a Function
    Block (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.

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

  • VisiLogic Function Blocks

    8 VisiLogic — Function Blocks

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

    Which FBs are installed in your library. Which FB versions are
    installed, which versions are used in the open

    project, and to manage FB versions. FB memory usage.

    Versions Used

  • VisiLogic Function Blocks 9

    Updating FB versions Standard Vision: 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.

    Enhanced Vision: FB libraries are updated as part of OS
    releases. When you update the OS, FBs are automatically updated as
    well.

    FBs List MODBUS, serial

    MODBUS, IP

    SMS Messaging

    GPRS

    Remote PLC DataCom

    Communication Protocol

    TCP/IP Communication Protocol

    PID FB

    Drum

    Events

    MB as PWM

    Loadcell

    Filter

    Accelerate

    Fast Response

    Draw Axis

    BAS

    Trends

    If your project is configured to Vision controllers that do not
    support HMI object Trend graphs, the Trend objects will not be
    displayed in the Project Navigation Window. These controllers
    include V120/230/260/280/290 (monochrome). In these models, the
    Trends (Legacy) Function Block may be used.

    Examples

    Sample applications may be found in the VisiLogic Examples
    folder, located on the VisiLogic Help menu. This folder contains
    field-tested VisiLogic (.vlp) sample applications.

  • VisiLogic Function Blocks 10

    MODBUS (Serial)

  • MODBUS (Serial) Overview MODBUS (Serial) Overview

    VisiLogic Function Blocks 11

    MODBUS (Serial) OverviewConverting Projects: Vision
    Divisions

    The memory structure of Standard Vision controllers is different
    from that of Enhanced. Note that if you convert projects, you must
    make changes according to the information given in the Slave
    Address tables.

    MODBUS enables you to establish master-slave communications
    between Unitronics PLCs and any connected device that supports the
    MODBUS protocol. Any controller in the network may function as
    either master or slave using any of the controller’s existing COM
    Ports.

    Within a MODBUS network, you can use standard MODBUS commands to
    read and write bit and register data; you can also read and write
    data to Vision controller Data Tables.

    Unitronics currently supports RTU (binary) transmission
    mode.

    Using MODBUS: Unitronics’ PLCs, Master — Slave Before using a
    MODBUS operation in your application, you must:

    Synchronize the communication port settings of master and slave
    devices. This is done by placing COM Port Init FBs, set with
    identical parameters, in the ladder application of both master and
    slave.

    Include at least 1 MODBUS Configuration FB in the ladder
    application of both master and slave. The port you select must be
    the same port selected in the COM Port Init FB.

    The condition that activates the Configuration must turn ON for
    a single program cycle (positive transition recommended). However,
    the MODBUS Configuration must be scanned during every program
    cycle—after the Configuration is activated. One way to ensure this
    is by placing the Configuration in the first subroutine of the main
    module.

    Enable slave devices to be accessed by placing a Scan_EX FB in
    the slave’s Ladder application.

    The figure below shows the elements required to carry out a Read
    Coils Operation.

  • VisiLogic Function Blocks MODBUS (Serial) Overview

    12 VisiLogic — Function Blocks

    Note that the operand addresses in slave PLCs are indirect
    addresses (pointers).

    Using MODBUS: Accessing PLC data via SCADA/OPC server The PC
    master can access data within the PLC via the addresses given in
    the Slave Addresses Table.

    The PLC slave’s Ladder application must include the
    following:

  • MODBUS (Serial) Overview MODBUS (Serial) Overview

    VisiLogic Function Blocks 13

    A COM Port Init FB.

    A MODBUS Configuration FB. Within the Configuration, the port
    you select must be the same port selected in the COM Port Init FB.
    Note The condition that activates the Configuration must turn ON
    for a single program cycle (positive transition recommended).
    However, the MODBUS configuration must be scanned during every
    program cycle—after the Configuration is activated. One way to
    ensure this is by placing the configuration in the first subroutine
    of the main module.

    A Scan_EX FB

    Note The operand addresses in slave PLCs are indirect addresses
    (pointers).

    Note that it is possible to broadcast to the MODBUS network by
    writing to Slave ID # 0. To do this indirectly addressing the Slave
    ID to a register, and write 0 to that register.

    Slaves: Consecutive References Whether the MODBUS master is a
    Unitronics PLC or another device, if the master application size
    and system requirements allow, it is recommended to add a delay
    between consecutive references to slaves according to the table
    below.

  • VisiLogic Function Blocks MODBUS (Serial) Overview

    14 VisiLogic — Function Blocks

    Delay (msec) between consecutive references to slaves; Minimum
    Baud rate = 9600

    Minimum RecommendedJazz 20 40M90/M91 15 30V120, V2xx 10 20V130 5
    10V350, V570 0 5

    FB Operations

    Operations are grouped under MODBUS on the FB’s menu. M O D B U
    S : C o n f i g u r a t i o n

    M O D B U S : S c a n

    M O D B U S : R e a d Co i l s ( 1 )

    M O D B U S : R e a d I n p u t s ( 2 )

    R e a d H o l d i n g R e g i s t e r s ( 3 )

    R e a d F l o a t R eg i s t e r s ( 3 )

    R e a d I n p u t R e g i s t e r s ( 4 )

    R e a d F l o a t I n p u t R eg i s t e r s ( 4 )

    F o r c e C o i l ( 5 )

    P r e s e t H o l d i n g R e g i s t e r ( 6 )

    L o o p b a c k T e s t ( 8 )

    F o r c e C o i l s ( 1 5 )

    P r e s e t H o l d i n g R e g i s t e r s ( 1 6 )

    P r e s e t F l o a t R e g i s t e r s ( 1 6 )

    R e a d / W r i t e M i x ed D a t a

    R e a d / W r i t e t o D a t a T a b l e s

  • MODBUS: Configuration MODBUS: Configuration

    VisiLogic Function Blocks 15

    MODBUS: ConfigurationA MODBUS Configuration FB must be included
    in both master and slave Ladder applications as shown below.

    Parameter Type Function

    Port Number Constant Click the drop-down arrows to view
    available ports; click the port you want to use.

    Network ID Constant This number identifies the device on the
    network. You can either assign an ID via an MI, or directly via a
    constant number. The unit ID range is from 0-255. Do not assign the
    same ID number to more than one device.

    Time out Constant or MI

    This is the amount of time a master device will wait for an
    answer from a slave. Time out units are defined in 10 msecs; a Time
    out value of 100 is equal to 1 second.

    Retries Constant or MI

    This is the number of times a device will try to send a
    message.

    Function in Progress

    MB This bit is ON when MODBUS is active. Use this as a condition
    bit for MODBUS operations to avoid communication conflicts.

    Note Indirectly addressed parameters in a MODBUS Configuration
    FB are only read when the Configuration is called. Since a
    Configuration is generally called as a power-up task, if, for
    example Retries has been indirectly addressed, and the linked MI is
    updated, the new value will not be read into the Configuration. The
    value will only be updated until the Configuration is called.

    While a master attempts to send a command, the Function In
    Progress bit is ON. The number of attempts that the master will
    make is the number in Retries +1, where ‘1’ is the initial access
    attempt.

    When a master attempts to access a slave device, and the slave
    does not answer, the Function In Progress bit will turn ON. This
    bit will

  • VisiLogic Function Blocks MODBUS: Configuration

    16 VisiLogic — Function Blocks

    remain on according to the following:(the number of retries + 1)
    x (Time Out), where ‘1’ is the initial access attempt. Note that
    the Time Out parameter is in units of 10 msec.

    The Ladder application below enables the controller act as a
    MODBUS master and read coils in a slave PLC. The Scan_EX operation
    shown below enables the controller to also act as a slave.

    Status Operands

    When you place MODBUS operations in your application (Force,
    Read, Preset, and Loopback commands), you link operands that show
    the status of MODBUS sessions. Use these to troubleshoot
    problems.

  • MODBUS: ScanEX and Scan MODBUS: ScanEX and Scan

    VisiLogic Function Blocks 17

    MODBUS: ScanEX and ScanScan_EX enables a master device to access
    a slave PLC. A Scan_EX must be included in the slave
    application.

    Note Scan_Ex is recommended for new applications.

    About Scan and Scan_EX

    MODBUS Versions previous to V2.01 offered only the Scan FB. Scan
    is still supported for older, working applications. When MODBUS
    operations accessed double registers (5100 addresses and higher),
    using odd addresses, such as 5101, there were incompatibility
    issues.

    When ScanEX receives an input parameter in the 32-bit range (for
    example, 5100{ML}), it automatically takes double-register values.
    If, for example, ScanEX receives a Read Register (6) request for
    5100, it returns the values in 5100 and 5101. If, however, ScanEX
    receives Read Register (6) request for 5101, it returns Status
    Message #2— since 5101 provides the ‘high’ bytes of the 32-bit
    register, it is not a legal address.

  • VisiLogic Function Blocks Read Coils (1)

    18 VisiLogic — Function Blocks

    Read Coils (1)Use this command to read the status of a selected
    group of coils and write them into a vector. The coil’s status is
    written into a vector of MBs in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the slave device containing the coils to be read (data
    source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of coils to be read (data source). Note
    Check topic Slave Address Tables

    Read: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Master: Start of Vector

    MB This is the start of a vector of MBs that will contain the
    coils’ status in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read Inputs (2) Read Inputs (2)

    VisiLogic Function Blocks 19

    Read Inputs (2)

    Use this command to read the status of a selected group of
    inputs in a slave device and write them into a vector. The inputs’
    status is written into a vector of MBs in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the slave device containing the inputs to be read
    (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of inputs to be read (data source). Note
    Check topic Slave Address Tables

    Read: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Master: Start of Vector

    MB This is the start of a vector of MBs that will contain the
    inputs’ status in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read Holding Registers (3)

    20 VisiLogic — Function Blocks

    Read Holding Registers (3)Use this command to read the values of
    a selected group of registers in a slave PLC and write them into a
    defined vector of registers in the master.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the registers to be read (data
    source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read Float Registers (3) Read Float Registers (3)

    VisiLogic Function Blocks 21

    Read Float Registers (3)Use this command to read the values of a
    selected group of floating point registers in a slave device and
    write them into a defined vector of registers in the master. Values
    after the decimal point are rounded to the nearest whole value.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the registers to be read (data
    source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number. You
    can transpose 16 bits of a 32-bit double register value by turning
    SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by
    default, and must be reset by the user program.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read Input Registers (4)

    22 VisiLogic — Function Blocks

    Read Input Registers (4)Use this command to read the values of a
    selected group of registers in a slave PLC and write them into a
    defined vector of registers in the master.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the registers to be read (data
    source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read Float Registers (4) Read Float Registers (4)

    VisiLogic Function Blocks 23

    Read Float Registers (4)Use this command to read the values of a
    selected group of floating point registers in a slave device and
    write them into a defined vector of registers in the master. Values
    after the decimal point are rounded to the nearest whole value.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the registers to be read (data
    source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number. You
    can transpose 16 bits of a 32-bit double register value by turning
    SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by
    default, and must be reset by the user program.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Force Coil (5)

    24 VisiLogic — Function Blocks

    Force Coil (5)Use this command to force the status of a selected
    coil in a slave PLC. The coil’s status is forced according to the
    status of a selected MB in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the coil to be forced (data
    source).

    Slave Address Const, MI, ML, DW

    The address of the coil to be forced (data target). Note Check
    topic Slave Address Tables

    Value to Force M, SB, I, O,T

    This MB is located in the master PLC; this MB contains the
    status to be forced ( data source). If, for example, the status of
    this MB is OFF, the status of the coil in the slave will be forced
    to OFF. Note A MODBUS command cannot read/write more than 1900 bit
    operands at one time. In addition, 0 is not a legal length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Preset Holding Register (6) Preset Holding Register (6)

    VisiLogic Function Blocks 25

    Preset Holding Register (6)Use this command to preset the value
    of a single register in a slave PLC. The value is set in a register
    contained in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the register to be preset
    (target).

    Slave: Operand Address

    Const, MI, ML, DW

    The address of the register to be preset (target). Note Check
    topic Slave Address Tables

    Value to Preset Constant, MI, SI, ML, SL, DW, SDW or T

    This is the address of the register containing the value in the
    master PLC (source). This value will be written into the slave’s
    register, the register that is to be preset.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Loopback Test (8)

    26 VisiLogic — Function Blocks

    Loopback Test (8)Use this command to send a test message to a
    slave device and receive Acknowledgements when communications are
    functioning properly.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device to be checked.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Force Coils (15) Force Coils (15)

    VisiLogic Function Blocks 27

    Force Coils (15)Use this command to force the status of a
    selected group of coils in a slave PLC. The coils’ status is forced
    according to the status of a group of MBs in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the slave device containing the coils to be forced
    (target).

    Slave:Start of Vector

    Const, MI, ML, DW

    The start of the vector of coils to be forced (data target).
    Note Check topic Slave Address Tables

    Master: Start of Vector

    MI, SB, I, O,T

    This is the start of a vector of MBs that will contain the
    coils’ status in the master (data source).

    Force: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Preset Holding Registers (16)

    28 VisiLogic — Function Blocks

    Preset Holding Registers (16)Use this command to preset the
    value of a group of registers in a slave PLC. The values are set in
    a vector of registers contained in the master PLC.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the registers to be preset
    (target).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be preset (target). Note
    Check topic Slave Address Tables

    Master: Start of Vector

    Constant, MI, SI, ML, SL, DW, SDW or T

    This is the start of a vector of MIs that will contain the
    registers’ values in the master (data source).

    Preset: Vector Length

    Const, MI, ML, DW

    The length of the vector of registers in both master and slave.
    Note A MODBUS command cannot read more than 124 16-bit integers, 62
    double registers, or 64 float registers at one time. In addition, 0
    is not a legal length. If, within the Slave: Start of Vector
    parameter, the selected register type is a 32-bit double register
    (slave addresses 5100 and greater)the preset vector length must be
    doubled as well. If, for example: — Slave: Start of Vector
    parameter is set to 6300, and — You wish to preset 4 registers, for
    a total of 16 bytes — You must set the Preset Vector length to 8.
    Note that this means that, in these cases, the Preset: Vector
    Length parameter will always be an even number.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Preset Float Registers (16) Preset Float Registers (16)

    VisiLogic Function Blocks 29

    Preset Float Registers (16)Use this command to preset the value
    of a group of floating point registers in a slave PLC. The values
    are set in a vector of registers contained in the master PLC.
    Values after the decimal point are rounded to the nearest whole
    value.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the device containing the register to be preset
    (target).

    Slave: Start of Vector

    Const, MI, ML, DW

    The address of the register to be preset (target). Note Check
    topic Slave Address Tables

    Master: Start of Vector

    MI, SI, ML, SL, DW, SDW or T

    This is the address of the register containing the value in the
    master PLC (source). This value will be written into the slave’s
    register, the register that is to be preset.

    Preset: Vector Length

    Const, MI, ML, DW

    The length of the vector of registers in both master and slave.
    Note A MODBUS command cannot read more than 124 16-bit integers, 62
    double registers, or 64 float registers at one time. In addition, 0
    is not a legal length. If, within the Slave: Start of Vector
    parameter, the selected register type is a 32-bit double register
    (slave addresses 5100 and greater)the preset vector length must be
    doubled as well. If, for example:

    — Slave: Start of Vector parameter is set to 6300, and — You
    wish to preset 4 registers, for a total of 16 bytes — You must set
    the Preset Vector length to 8. Note that this means that, in these
    cases, the Preset: Vector Length parameter will always be an even
    number.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read/Write from Data Tables

    30 VisiLogic — Function Blocks

    Read/Write from Data TablesUse these commands to access the
    bytes in Vision data tables without reference to table
    structure.

    Please note that this is not a standard MODBUS function.
    Read/Write from Data Tables is compatible with Unitronics’ Vision
    PLC data tables only .

    To determine the byte number of a data table cell, hold the
    cursor over the data table cell. A Tooltip opens, displaying the
    byte number.

    Note A MODBUS command cannot read/write more than 242 DT bytes
    at one time.

    In addition, 0 is not a legal length.

    Read from Data Table Below, a MODBUS master reads data tables in
    Slave ID 1. Bytes 24-43 are read from Slave 1 into bytes 140-159 in
    the master’s data tables.

  • Read/Write from Data Tables Read/Write from Data Tables

    VisiLogic Function Blocks 31

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the slave device containing the coils to be read (data
    source).

    Slave: DT Start of Vector

    Const, MI, ML, DW

    The start of the vector of bytes to be read (data source).

    Slave: DT Offset in Vector

    Const, MI, ML, DW

    Offset from the Slave: DT Start of Vector

    Master: DT Start of Vector

    Const, MI, ML, DW

    This is the start of a vector of bytes that will contain the
    data read from the slave.

    Master: DT Offset in Vector

    Const, MI, ML, DW

    Offset from the Master: DT Start of Vector

    Read: DT Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 242 DT bytes at one time. In addition, 0 is not a legal
    length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read/Write from Data Tables

    32 VisiLogic — Function Blocks

    Write to Data Table Below, a MODBUS master writes to data tables
    in Slave ID 1. Bytes 140-159 are written from the master into bytes
    24-43 in the slave’s data tables.

    Parameter Type Function

    Slave ID Constant or MI

    The ID of the slave device to which the data will be written
    (data target).

    Slave: DT Start of Vector

    Const, MI, ML, DW

    The start of the vector of bytes to be written into (data
    target).

    Slave: DT Offset in Vector

    Const, MI, ML, DW

    Offset from the Slave: DT Start of Vector

    Master: DT Start of Vector

    Const, MI, ML, DW

    This is the start of a vector of bytes, in the master, that will
    contain the data to be written to the slave (data source)

    Master: DT Offset in Vector

    Const, MI, ML, DW

    Offset from the Master: DT Start of Vector

    Read: DT Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 242 DT bytes at one time. In addition, 0 is not a legal
    length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Messages.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read/Write Mixed Data via MODBUS Read/Write Mixed Data via
    MODBUS

    VisiLogic Function Blocks 33

    Read/Write Mixed Data via MODBUSThe Read/Write Mixed Data
    function enables you to combine Read & Write operations in a
    single MODBUS command, transferring data between master and slave
    controllers, without using standard MODBUS commands and addressing
    conventions.

    This is not a standard MODBUS function. Read/Write Mixed Data is
    compatible with Unitronics’ Vision controllers only .

    Note that this function is compatible with O/S 401 and higher,
    and is not supported for V120-12-xxx.

    Each function can contain both Read and Write Mix Requests. Each
    request may be for a different data type. Your data request must
    include:

    Master and Slave operand addresses Length of vector Direction:
    Read or Write

    After you add a request, the OK button is disabled. Click the
    Compile button to see current buffer status; if the buffer contains
    less than the maximum number of bytes, the OK is enabled.

  • VisiLogic Function Blocks Read/Write Mixed Data via MODBUS

    34 VisiLogic — Function Blocks

    Read Write Limitations Only the following data types may be used
    in Mixed Data requests: MI, ML, DW, MB, I and O.

    Registers: may only be read/written to the same data type.

    Booleans: Inputs cannot be written to.

    Booleans, Read Write Registers, Read WriteI MB, O MI MIO MB, O
    ML MLMB MB, O DW DW

    Send / Receive Buffers The function uses two buffers, Send and
    Receive. Each buffer can contain a maximum of 500 bytes.

  • Configuring a MODBUS slave device Configuring a MODBUS slave
    device

    VisiLogic Function Blocks 35

    Configuring a MODBUS slave deviceThe Ladder section below shows
    what elements are necessary to enable a master device to read from
    a slave. Note that the MODBUS Scan_EX operation should not be
    performed during the initial program scan.

    Note that you must use a condition (RLO) to activate the MODBUS
    Configuration and SCAN _EX.

  • VisiLogic Function Blocks Slave Addressing

    36 VisiLogic — Function Blocks

    Slave AddressingMonochrome / Color PLCs

    The memory structure of monochrome screen PLCs is different from
    that of color screen PLCs. This is why each series has its own
    slave addressing scheme.

    Note The slave addresses given for the monochrome series are
    decimal values.

    The slave addresses given for the color series are hexadecimal
    values.

    Slave Addresses Standard Vision Division

    Coils MODBUS Command Number

    Pointer Value From:

    Operand type Read Write

    0000 MB 0-2999 #01 Read Coils #15 Force Coils

    3000 SB #15 Force Coils

    4000 I (read-only) Read-only

    5000 O #15 Force Coils

    6000 T (read-only) Read-only

    7000 C (read-only) Read-only

    8000 MB 3000-4095

    Note Note that in order to access MBs 3000-4095, you address as
    follows:

  • Slave Addressing Slave Addressing

    VisiLogic Function Blocks 37

    to access MB 3012, request slave address 8012.

    Registers MODBUS Command Number

    Pointer Value From:

    Operand type

    Register size

    Read Write

    0000 MI 16 bit # 03 Read Holding Registers

    # 16 Preset Holding Registers

    4000 SI 16 bit

    5100 ML 32 bit

    6100 SL 32 bit

    6300 MDW 32 bit

    6700 SDW 32 bit

    6900 Timer preset

    32 bit

    7300 Timer current

    32 bit

    7700 MF 32 bit

    7800 Counter Preset

    16 bit

    7900 Counter Current

    16 bit

    Enhanced Vision Series

    Coils MODBUS Command Number

    Pointer Value From (hex):

    Operand type Read Write

    0000h MB 0 #01 Read Coils #15 Force Coils

    3000h XB #15 Force Coils

    4000h O #15 Force Coils

    5000h SB Read-only

    6000h I (read-only) #15 Force Coils

    7000h T (read-only) Read-only

    8000h C (read-only) Read-only

  • VisiLogic Function Blocks Slave Addressing

    38 VisiLogic — Function Blocks

    Registers MODBUS Command Number

    Pointer Value From (hex):

    Operand type Register size Read Write

    0000h MI 16 bit # 03 Read Holding Registers

    # 16 Preset Holding Registers

    3000h XI

    9000h SI 16 bit

    5000h XL

    6000h XDW

    7000h ML 32 bit

    A000h SL 32 bit

    8000h MDW 32 bit

    B000h SDW 32 bit

    C000h Timer preset 32 bit

    D000h Timer current 32 bit

    4000h MF 32 bit

    E000h Counter Preset 16 bit

    F000h Counter Current

    16 bit

    Examples The examples below show that:

    MODBUS addressing systems start at 1. Vision addressing starts
    at 0.

    Bit Operands

    Read a 10-bit vector of inputs in a slave Vision controller,
    starting at Input 20, via Read Coils (MODBUS COMMAND #1)

    Vision PLC as the MODBUS master to Monochrome PLC In VisiLogic’s
    Read Coils FB, set the Slave: Start of Vector parameter to 4020
    (DEC), and the Read: Vector Length parameter to 10. Within the
    slave Vision controller, VisiLogic will read I 20 — I 29.

    Vision PLC as the MODBUS master to Color PLC In VisiLogic’s Read
    Coils FB, set the Slave: Start of Vector parameter to 6014h (HEX),
    and the Read: Vector Length

  • Slave Addressing Slave Addressing

    VisiLogic Function Blocks 39

    parameter to 10. Within the slave Vision controller, VisiLogic
    will read I 20 — I 29.

    SCADA as the MODBUS master to Monochrome PLC In the SCADA
    application, set the Slave: Start of Vector parameter to
    34021(30001 + 4000 + 20), and the Read: Vector Length to 10,
    enabling the Master device to read I 20 — I 29 within the slave
    Vision controller. SCADA as the MODBUS master to Color PLC Convert
    the HEX address to DEC In the SCADA application, set the Slave:
    Start of Vector parameter to 54597(24576 (6000h) + 20), and the
    Read: Vector Length to 10, enabling the Master device to read I 20
    — I 29 within the slave Vision controller.

    Write a 3-bit vector of outputs in a slave Vision controller,
    starting at Output 8, via Force Coils (MODBUS COMMAND #15)

    Vision PLC as the MODBUS master to Monochrome PLC In VisiLogic’s
    Force Coils FB, set the Slave: Start of Vector parameter to 5008,
    and the Force: Vector Length parameter to 3. Within the slave
    Vision controller, the master will force the status of O 8 — O
    10.

    Vision PLC as the MODBUS master to Color PLC In VisiLogic’s
    Force Coils FB, set the Slave: Start of Vector parameter to 4008h
    (HEX), and the Force: Vector Length parameter to 3. Within the
    slave Vision controller, the master will force the status of O 8 —
    O 10.

    SCADA as the MODBUS master to Monochrome PLC In the SCADA
    application, set the Slave: Start of Vector parameter to 35009
    (30001 + 5000 + 8) and the Force: Vector Length parameter to 3,
    enabling the Master device to write to O 8 — O 10 within the slave
    Vision controller. SCADA as the MODBUS master to Color PLC Convert
    the HEX address to DEC. In the SCADA application, set the Slave:
    Start of Vector parameter to 46393 (30001 + 16384(4000h) + 8) and
    the Force: Vector Length parameter to 3, enabling the Master device
    to write to O 8 — O 10 within the slave Vision controller.

    Registers

    Read a 9-register long vector of 16-bit integers in a slave
    Vision controller, starting at MI 32, via Read Holding Registers
    (MODBUS COMMAND #03)

  • VisiLogic Function Blocks Slave Addressing

    40 VisiLogic — Function Blocks

    Vision PLC as the MODBUS master In VisiLogic’s Read Holding
    Registers FB, set the Slave: Start of Vector parameter to 32, and
    the Read: Vector Length parameter to 9. Within the slave Vision
    controller, VisiLogic will read MI 32 — MI 41. SCADA as the MODBUS
    master In the SCADA application, set the Slave: Start of Vector
    parameter to 40033 (40001 + 0000 + 3), and the Read: Vector Length
    parameter to 9, enabling the Master device to read MI 32 — MI 41
    within the slave Vision controller.

    Note If, within the Slave: Start of Vector parameter, the
    selected register type is a 32-bit double register (slave addresses
    5100 and greater) the preset vector length must be doubled as well.
    If, for example in the VisiLogic Preset Holding Registers FB:

    Slave: Start of Vector parameter is set to 6300, and You wish to
    preset 4 registers, for a total of 16 bytes You must set the Preset
    Vector length to 8.

    Note that this means that, in these cases, the Preset: Vector
    Length parameter will always be an even number.

    Read a 9-register long vector of 32 -bit integers in a slave
    Vision controller, starting at SL 32, via Preset Holding Registers
    (MODBUS COMMAND #16)

    Vision PLC as the MODBUS master In VisiLogic’s Preset Holding
    Registers FB, set the Slave: Preset Vector parameter to 6132, and
    the Read: Vector Length parameter to 18 ( 2×9, in order to fit the
    32-bit SL registers ). Within the slave Vision controller,
    VisiLogic will read SL 32 — SL 41. SCADA as the MODBUS master In
    the SCADA application, set the Slave: Start of Vector parameter to
    406133, and the Read: Vector Length parameter to 18, enabling the
    Master device to read SL 32 — SL 41 within the slave Vision
    controller.

    Write a 6-register long vector of 16-bit integers in a slave
    Vision controller, starting at MI 32, via Preset Holding Registers
    (MODBUS COMMAND #16)

    Vision PLC as the MODBUS master In VisiLogic’s Preset Holding
    Registers FB, set the Slave: Start of Vector parameter to 32, and
    the Preset: Vector Length parameter to 6. Within the slave Vision
    controller, VisiLogic will write to MI 32 — MI 37. SCADA as the
    MODBUS master In the SCADA application, set the Slave: Start of
    Vector parameter to 40033, and the Read: Vector Length parameter to
    6, enabling the Master device to write to MI 32 — MI 37 within the
    slave Vision controller.

  • MODBUS via GSM or Standard Modem MODBUS via GSM or Standard
    Modem

    VisiLogic Function Blocks 41

    MODBUS via GSM or Standard Modem

    Note When MODBUS (Serial) is configured to a port linked to a
    modem, the MODBUS function checks SI 100 Maximum Time Delay between
    characters (units 2.5ms) MODBUS + Modem. If SI 100 = 1, a time
    interval of up to 2.5 msecs is permitted between characters, if SI
    100 contains 2, the permitted interval is 5 msecs ( n x 2.5 =
    interval. Note that the application must update SI 100 before the
    MODBUS configuration is activated.

  • VisiLogic Function Blocks MODBUS Status Operands

    42 VisiLogic — Function Blocks

    MODBUS Status OperandsAll of the Status operands linked to
    MODBUS FBs should be assigned Power-up Values; bits should be
    reset, and registers initialized to 0.

    MODBUS: Configuration FB Status Operand All MODBUS operations
    run through a MODBUS configuration placed in the master device’s
    program.

    Function in Progress Shows status of master’s MODBUS
    Configuration

    MB Turns ON when: A master Vision

    initiates MODBUS communication.

    Remains ON during the MODBUS session.

    Turns OFF when The MODBUS: Configuration is

    activated. An answer is received from a

    slave. The TimeOut defined in the

    Configuration is exceeded. Certain Status Messages are

    given

    MODBUS Operation Status Operands When you place MODBUS
    operations in your application (Force, Read, Preset, and Loopback
    commands), you link the operands below. These show the status of
    MODBUS sessions.

    Status Messages Shows status of master’s data requests and the
    replies the master receives from the slaves

    MI Automatically initialized to 0 when MODBUS operation is
    activated.

    Updated at the end of each attempt to communicate via
    MODBUS.

    Indicates status of MODBUS communications, according to the
    table below. Note that the current value always shows the most
    recent status.

    # Status Message

    0 Status OK

    1 Unknown Command Number This is received from the slave
    device.

    2 Illegal Data Address Master: an invalid address is found by
    the master before a data request is sent to a

    slave. This may result, for example, when an MI is used to
    provide vector length. Slave: The slave notifies the master that
    the data request command includes invalid

    addresses. Slave—ScanEX: When ScanEX receives an input
    parameter in the 32-bit range (for

    example, 5100{ML}), it automatically takes double-register
    values. If, for example, ScanEX receives a Read Register(6) request
    for 5100, it returns the values in 5100 and 5101. If, however,
    ScanEX receives Read Register(6) request for 5101, it returns Error
    #2— since 5101 provides the ‘high’ bytes of the 32-bit register,
    it is not a legal address.

    3 Slave to Master: Illegal Data Type Quantity Number of operands
    requested by user exceeds the maximum Note A MODBUS command cannot
    read more than 124 16-bit integers, 62 double registers, 62 float
    registers, or 1900 bit operands at one time. In addition, 0 is not
    a legal vector length.

  • MODBUS Status Operands MODBUS Status Operands

    VisiLogic Function Blocks 43

    4 Master—Time Out This occurs if the master has been waiting
    for a slave response for an amount of time exceeding the Time-out
    set in the Configuration. If this error occurs, check Time Out,
    Baud Rate, and Distance

    5 No Communication The MODBUS session cannot be established.

    Note Messages 4 & 5. TimeOut and Number of Retries are
    defined in the Configuration. ARetry is an attempt to establish a
    MODBUS session. If, for example, TimeOut is defined as 2 seconds,
    and number of Retries as 3: — the controller will try to establish
    the session once, and will continue to try for 2 seconds. — If the
    first attempt fails, the Status Message value will be 4, Master
    TimeOut. -The controller will try twice more, for a total of 3
    retries over 6 seconds. — If all attempts fail, the Status Message
    value will be 5.-If any attempt succeeds, the Status Message will
    be 0.

    * 6 Master-slave data incorrectly synchronized

    * 7 Master-slave data incorrectly synchronized

    8 Master to application: Illegal Data Type Quantity Number of
    operands requested by user exceeds the maximum permitted for that
    FB operation in the master. Note A MODBUS command cannot read more
    than 124 16-bit integers, 62 double registers, 62 float registers,
    or 1900 bit operands at one time. In addition, 0 is not a legal
    vector length.

    9 Slave ID =0 An attempt does to communicate with Slave ID
    0.

    10 Incorrect CRC

    * 11 Master-slave data incorrectly synchronized

    * Messages 6, 7, and 11mean that the master has found
    incompatible elements in the data sent between master and
    slave.

    Total Sessions DW This is the total number of times the master
    PLC attempts to access the slave device, whether the attempt is
    successful or not, including Retries. Note that this is a simple
    incremental counter. This must be initialized by the user, by
    storing 0 into the

    selected DW.

    Acknowledgements DW This is the number of times the slave device
    answers. This must be initialized by the user, by storing 0 into
    the

    selected DW.

  • VisiLogic Function Blocks MODBUS Status Operands

    44 VisiLogic — Function Blocks

    Time Out, Baud Rate, and Distance

    The default Time Out set in the Configuration is one second. In
    certain cases, the length of the network may cause this to be
    exceeded. You can calculate a Time Out value by using the following
    formula, and use it in the Configuration.

    SI Description Value

    100 Maximum Time Delay between characters (units 2.5ms) MODBUS +
    Modem

    When MODBUS (Serial) is configured to a port linked to a modem,
    the MODBUS function checks SI 100. If SI 100 = 1, a time interval
    of up to 2.5 msecs is permitted between characters, if SI 100
    contains 2, the permitted interval is 5 msecs ( n x 2.5 =interval.
    Note that: — The power-up value is 1, — the application must update
    SI 100 before the MODBUS configuration is activated.

  • VisiLogic Function Blocks 45

    MODBUS (IP)

  • VisiLogic Function Blocks MODBUS IP Overview

    46 VisiLogic — Function Blocks

    MODBUS IP Overview Converting Projects: Vision Divisions

    The memory structure of Standard Vision controllers is different
    from that of Enhanced. Note that if you convert projects, you must
    make changes according to the information given in the Slave
    Address tables.

    If your controller comprises an Ethernet card, you can use
    MODBUS IP commands with any connected device that supports the
    MODBUS protocol.

    Within a MODBUS network, you can use standard MODBUS commands to
    read and write bit and register data; you can also read and write
    data to Vision controller Data Tables.

    Any controller in the network may function as either master or
    slave.

    Unitronics currently supports both TCP and UDP, as explained in
    the topic About Ethernet. This topic also contains general
    information about Ethernet, IP addressing, sockets, and ports.

    Specific information on implementing Ethernet is provided in the
    topic Using Ethernet.

    Using MODBUS Before using a MODBUS IP operation in your
    application, you must:

    Assign IP addresses to both master and slave devices. This is
    done by placing Ethernet Card Init FBs in the ladder application of
    both master and slave.

    Include at least 1 MODBUS Configuration FB in the ladder
    application of both master and slave.

    The condition that activates the Configuration must turn ON for
    a single program cycle (positive transition recommended) However,
    the MODBUS configuration must be scanned during every program
    cycle—after the Configuration is activated. One way to ensure this
    is by placing the configuration in the first subroutine of the main
    module.

    Enable slave devices to be accessed by placing a Scan FB in the
    slave’s Ladder application.

    The figure below shows the elements required to carry out a Read
    Coils Operation.

  • MODBUS IP Overview MODBUS IP Overview

    VisiLogic Function Blocks 47

    Note that the operand addresses in slave PLCs are indirect
    addresses (pointers).

    Note that a MODBUS master can broadcast to the MODBUS network by
    writing to Slave ID # 0. To do this, indirectly address the Slave
    ID to a register, and write 0 to that register.

  • VisiLogic Function Blocks MODBUS IP Overview

    48 VisiLogic — Function Blocks

    FB Operations

    MODBUS IP Operations are located on the FBs menu.

    M O D B U S : C o n f i g u r a t i o n

    M O D B U S : S c a n

    M O D B U S : R e a d Co i l s ( 1 )

    M O D B U S : R e a d I n p u t s ( 2 )

    R e a d H o l d i n g R e g i s t e r s ( 3 )

    R e a d F l o a t R eg i s t e r s ( 3 )

    R e a d I n p u t R e g i s t e r s ( 4 )

    R e a d F l o a t I n p u t R eg i s t e r s ( 4 )

    F o r c e C o i l ( 5 )

    P r e s e t H o l d i n g R e g i s t e r ( 6 )

    F o r c e C o i l s ( 1 5 )

    P r e s e t H o l d i n g R e g i s t e r s ( 1 6 )

    P r e s e t F l o a t R e g i s t e r s ( 1 6 )

    R e a d / W r i t e M i x ed D a t a ( n o n — s t a n d a r d
    MO D B U S c o m m a n d )

    R e a d / W r i t e t o D a t a T a b l e s

    M O D B U S S t a t u s O p e r a n d s

  • MODBUS: Configuration MODBUS: Configuration

    VisiLogic Function Blocks 49

    MODBUS: ConfigurationA MODBUS Configuration FB must be included
    in both master and slave Ladder applications as shown below. MODBUS
    IP Operations are located on the FBs menu.

    Parameter Type Function

    Port Number Constant Click the drop-down arrows to view
    available ports; click the port you want to use.

    Network ID Constant This number identifies the device on the
    network. You can either assign an ID via an MI, or directly via a
    constant number. The unit ID range is from 0-255. Do not assign the
    same ID number to more than one device.

    Time out Constant or MI

    This is the amount of time a master device will wait for an
    answer from a slave. Time out units are defined in 10 msecs; a Time
    out value of 100 is equal to 1 second.

    Retries Constant or MI

    This is the number of times a device will try to send a
    message.

    Function in Progress

    MB This bit is ON when MODBUS is active. Use this as a condition
    bit for MODBUS operations to avoid communication conflicts.

    Note Indirectly addressed parameters in a MODBUS Configuration
    FB are only read when the Configuration is called. Since a
    Configuration is generally called as a power-up task, if, for
    example Retries has been indirectly addressed, and the linked MI is
    updated, the new value will not be read into the Configuration. The
    value will only be updated

  • VisiLogic Function Blocks MODBUS: Configuration

    50 VisiLogic — Function Blocks

    until the Configuration is called.

    While a master attempts to send a command, the Function In
    Progress bit is ON. The number of attempts that the master will
    make is the number in Retries +1, where ‘1’ is the initial access
    attempt.

    When a master attempts to access a slave device, and the slave
    does not answer,- the Function In Progress bit will turn ON. This
    bit will remain on according to the following: (the number of
    retries + 1) x (Time Out), where ‘1’ is the initial access attempt.
    Note that the Time Out parameter is in units of 10 msec.

    Vision Slaves In order to access Vision Controllers as slave
    devices and implement MODBUS commands, you must enter the IP
    addresses of the slave devices in the MODBUS IP configuration. This
    means that you must first assign IP addresses to each slave. This
    is done via the Ethernet Card Init FB, which must be configured as
    described in the topic Using_Ethernet.

    Note Slave IP addresses can also be linked to 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

  • MODBUS: Configuration MODBUS: Configuration

    VisiLogic Function Blocks 51

    will be 192.198.192. 45.

    The Ladder application below enables the controller act as a
    MODBUS master and read coils in a slave PLC. The same PLC can also
    act as a slave, if a Scan_EX operation is included in the
    application.

    Status Operands

    When you place MODBUS operations in your application (Force,
    Read, Preset, and Loopback commands), you link operands that show
    the status of MODBUS sessions. Use these to troubleshoot
    problems.

  • VisiLogic Function Blocks MODBUS: ScanEX and Scan

    52 VisiLogic — Function Blocks

    MODBUS: ScanEX and ScanScan_EX enables a master device to access
    a slave PLC. A Scan_EX must be included in the slave application.
    MODBUS IP Operations are located on the FBs menu.

    Note Scan_Ex is recommended for new applications.

    About Scan and Scan_EX

    MODBUS Versions previous to V2.01 offered only the Scan FB. Scan
    is still supported for older, working applications. When MODBUS
    operations accessed double registers (5100 addresses and higher),
    using odd addresses, such as 5101, there were incompatibility
    issues.

    Scan_EX is recommended for new applications.

    When ScanEX receives an input parameter in the 32-bit range (for
    example, 5100{ML}), it automatically takes double-register values.
    If, for example, ScanEX receives a Read Register(6) request for
    5100, it returns the values in 5100 and 5101. If, however, ScanEX
    receives Read Register(6) request for 5101, it returns Status
    Message #2— since 5101 provides the ‘high’ bytes of the 32-bit
    register, it is not a legal address.

  • Read Coils (1) Read Coils (1)

    VisiLogic Function Blocks 53

    Read Coils (1)Use this command to read the status of a selected
    group of coils and write them into a vector. The coil’s status is
    written into a vector of MBs in the master PLC. MODBUS IP
    Operations are located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the slave device containing the coils to be
    read (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of coils to be read (data source). Note
    Check topic Slave Address Tables.

    Read: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Master: Start of Vector

    MB Shows a message number. To check status and diagnose errors,
    check the MODBUS Status Operands.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read Inputs (2)

    54 VisiLogic — Function Blocks

    Read Inputs (2)Use this command to read the status of a selected
    group of inputs in a slave device and write them into a vector. The
    inputs’s status is written into a vector of MBs in the master PLC.
    MODBUS IP Operations are located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the slave device containing the inputs to be
    read (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of inputs to be read (data source). Note
    Check topic Slave Address Tables.

    Read: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Master: Start of Vector

    MB This is the start of a vector of MBs that will contain the
    inputs’ status in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read Holding Registers (3) Read Holding Registers (3)

    VisiLogic Function Blocks 55

    Read Holding Registers (3)Use this command to read the values of
    a selected group of registers in a slave PLC and write them into a
    defined vector of registers in the master. MODBUS IP Operations are
    located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the registers to be read
    (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables.

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read Flat Registers (3)

    56 VisiLogic — Function Blocks

    Read Flat Registers (3) Use this command to read the values of a
    selected group of floating point registers in a slave device and
    write them into a defined vector of registers in the master. Values
    after the decimal point are rounded to the nearest whole value.
    MODBUS IP Operations are located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the registers to be read
    (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables.

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number. You
    can transpose 16 bits of a 32-bit double register value by turning
    SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by
    default, and must be reset by the user program.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Read Input Registers (4) Read Input Registers (4)

    VisiLogic Function Blocks 57

    Read Input Registers (4)Use this command to read the values of a
    selected group of registers in a slave PLC and write them into a
    defined vector of registers in the master. MODBUS IP Operations are
    located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the registers to be read
    (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables.

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Read Float Registers (4)

    58 VisiLogic — Function Blocks

    Read Float Registers (4)Use this command to read the values of a
    selected group of floating point registers in a slave device and
    write them into a defined vector of registers in the master. Values
    after the decimal point are rounded to the nearest whole value.
    MODBUS IP Operations are located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the registers to be read
    (data source).

    Slave: Start of Vector

    Const, MI, ML, DW

    The start of the vector of registers to be read (data source).
    Note Check topic Slave Address Tables.

    Read: Vector Length

    Const, MI, ML, DW

    The vector length Note A MODBUS command cannot read more than
    124 16-bit integers, 62 double registers, or 64 float registers at
    one time. In addition, 0 is not a legal length. If, within the
    Slave: Start of Vector parameter, the selected register type is a
    32-bit double register (slave addresses 5100 and greater)the preset
    vector length must be doubled as well. If, for example: — Slave:
    Start of Vector parameter is set to 6300, and — You wish to preset
    4 registers, for a total of 16 bytes — You must set the Preset
    Vector length to 8. Note that this means that, in these cases, the
    Preset: Vector Length parameter will always be an even number. You
    can transpose 16 bits of a 32-bit double register value by turning
    SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by
    default, and must be reset by the user program.

    Master: Start of Vector

    MI This is the start of a vector of MIs that will contain the
    registers’ values in the master (data destination).

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Force Coil (5) Force Coil (5)

    VisiLogic Function Blocks 59

    Force Coil (5)Use this command to force the status of a selected
    coil in a slave PLC. The coil’s status is forced according to the
    status of a selected MB in the master PLC. MODBUS IP Operations are
    located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the coil to be forced
    (data source).

    Slave Address Const, MI, ML, DW

    The address of the coil to be forced (data target). Note Check
    topic Slave Address Tables.

    Value to Force M, SB, I, O,T

    This MB is located in the master PLC; this MB contains the
    status to be forced (data source). If, for example, the status of
    this MB is OFF, the status of the coil in the slave will be forced
    to OFF. Note A MODBUS command cannot read/write more than 1900 bit
    operands at one time. In addition, 0 is not a legal length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Preset Holding Register (6)

    60 VisiLogic — Function Blocks

    Preset Holding Register (6)Use this command to preset the value
    of a single register in a slave PLC. The value is set in a register
    contained in the master PLC. MODBUS IP Operations are located on
    the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device containing the register to be
    preset (target).

    Slave: Operand Address

    Const, MI, ML, DW

    The address of the register to be preset (target). Note Check
    topic Slave Address Tables

    Value to Preset Constant, MI, SI, ML, SL, DW, SDW or T

    This is the address of the register containing the value in the
    master PLC (source). This value will be written into the slave’s
    register, the register that is to be preset.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • Loopback Test (8) Loopback Test (8)

    VisiLogic Function Blocks 61

    Loopback Test (8)Use this command to send a test message to a
    slave device and receive Acknowledgements when communications are
    functioning properly. MODBUS IP Operations are located on the FBs
    menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the device to be checked.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands.

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Acknowledgements DW This is the number of times the slave device
    answers.

  • VisiLogic Function Blocks Force Coils (15)

    62 VisiLogic — Function Blocks

    Force Coils (15)Use this command to force the status of a
    selected group of coils in a slave PLC. The coils’ status is forced
    according to the status of a group of MBs in the master PLC. MODBUS
    IP Operations are located on the FBs menu.

    Parameter Type Function

    Slave ID Constant or MI

    The IP address of the slave device containing the coils to be
    forced (target).

    Slave:Start of Vector

    Const, MI, ML, DW

    The start of the vector of coils to be forced (data target).
    Note Check topic Slave Address Tables.

    Master: Start of Vector

    MI, SB, I, O,T

    This is the start of a vector of MBs that will contain the
    coils’ status in the master (data source).

    Force: Vector Length

    Constant or MI

    The vector length. Note A MODBUS command cannot read/write more
    than 1900 bit operands at one time. In addition, 0 is not a legal
    length.

    Status Messages MI Shows a message number. To check status and
    diagnose errors, check the MODBUS Status Operands

    Total Sessions DW This is the number of times the master PLC
    will attempt to access the slave device. Note that this is a simple
    incremental counter. Initialize it by storing 0 into the selected
    DW.

    Ac

1 SOFTWARE MANUAL VISILOGIC — GETTING STARTED V G23 Rev: 3:00

2 The information in this document reflects products at the date of printing. Unitronics reserves the right, subject to all applicable laws, at any time, at its sole discretion, and without notice, to discontinue or change the features, designs, materials and other specifications of its products, and to either permanently or temporarily withdraw any of the forgoing from the market. All information in this document is provided «as is» without warranty of any kind, either expressed or implied, including but not limited to any implied warranties of merchantability, fitness for a particular purpose, or noninfringement. Unitronics assumes no responsibility for errors or omissions in the information presented in this document. In no event shall Unitronics be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever arising out of or in connection with the use or performance of this information. The tradenames, trademarks, logos and service marks presented in this document, including their design, are the property of Unitronics (1989) (R»G) Ltd. or other third parties and you are not permitted to use them without the prior written consent of Unitronics or such third party as may own them.

3 Table of Contents VisiLogic Overview… 5 Minimizing EMI: System Design Guidelines… 8 Devices Emitting high EMF… 8 Wiring Separation… 8 Enclosing and Earthing… 8 I/O Wiring: General Guidelines… 9 Signal (Communication, I/O) Line Filtering… 9 Wiring Power for I/O Expansion Modules Power-line Filtering Connect the EX-A1 Communication Cable Getting Started Hardware Configuration Ladder Editor HMI Display Editor About the HMI Display and Keypad Variables Quick Navigation Downloading/Uploading a Project On-Line Test Mode (Debug) Information Mode COM Ports and Data Communications About Modems Hardware Configuration I/O Expansion Modules Snap-in I/O Expansion Modules Configuring a High-Speed Counter Configuring a High-speed Output (PWM) Configuring an Analog Input Analog Filters, PLC Configuring an Analog Output Analog I/O Ranges Working with Analog I/O Values Configuring Digital Inputs Configuring Digital Outputs Assign a Description to Multiple Operands Controller Settings Vision Communication PC Settings Communication and OS-Controller Menu Run, Reset, Initialize Get COM Parameters and PLC status Downloading an OS Check CANbus Network Status Remote Access Remote Access: Accessing a PLC via PC… 64

4 Utilities Utilities: an Overview Tools Creating Project files (.dvi,.vdf,.urc,.ura) Project Properties Digital Signatures Operand View Hotkeys: Quick Editing Watch Folders Memory Tab Find (& Replace) Search: Symbolic Name Deleted Unreferenced Operands Print Project System Images Converting Projects Import/Export Subroutines Verify Project Compile Project Optimizer Log Show STL Power-up Modes: Trouble-shooting Memory Allocation Appendix A: Troubleshooting Detecting Short-circuited End Devices Positive Transition Contact ( Rise ) I/O Expansion Module Errors Analog Input Values: Out of Range Compile Compatibility: HW, OS, SW Updating Project Versions Why does the Controller display the ‘Restart’ message? HMI Element Resizing/Rotating Limitations Blank Corner in HMI Display Float Errors Changing Panel Types: Conflicts Insufficient Flash Memory Error: User Memory Overlap Replacing or Removing the Battery Appendix B: Vision Controller Divisions Index

5 VisiLogic Overview VisiLogic: Getting Started VisiLogic: Getting Started VisiLogic: Getting Started 3

6 VisiLogic Overview If you are new to VisiLogic, please start with this manual. Here, you can learn the basics of the VisiLogic software environment. These concepts are important even if you have experience programming other controllers. The subjects introduced here are covered in depth in the VisiLogic Software Manual Series. The Series includes the following manuals in pdf format: VisiLogic: Getting Started This provides a general overview of the VisiLogic environment, Hardware Configuration, Controller Settings, Remote Access, Utilities, and Tools, as well appendices on Troubleshooting and Vision Controller Divisions VisiLogic: Ladder Application Programming Includes a section on Getting Started with Ladder, as well as separate sections on program calls and Ladder functions. VisiLogic: HMI Application Programming VisiLogic: Communications VisiLogic: Utilities 4 VisiLogic: Getting Started

7 VisiLogic Overview VisiLogic Overview VisiLogic is the software tool you use to create control projects for Vision controllers. After you plan the control task, use VisiLogic to write, debug, and download the PLC control and HMI applications into the controller. The PLC application is your control, or automation application. You write the PLC application using the Ladder Editor. The HMI application configures the operating panel’s function. You use the HMI Editor to create the Displays that are shown on the controller’s screen. Displays tell your operators what to do. You can have your operators log in with a password, enter setpoints and other data, and instruct the operator what to do in case of a system problem or alarm. A Display can contain both text and images. Text and images can be both fixed and/or variable. Variables are inserted into a Display to: Show run-time values as integers Represent run-time values with either text, images, or bar graphs Show text messages that vary according to runtime conditions Enable an operator to enter data using the Vision’s alphanumeric keypad Editors You use different editors to create your control project: Hardware Configuration 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 Explorer. Language Interface VisiLogic supports a number of interface languages. You can change the interface language by selecting Languages from the VisiLogic View menu. Hardware Configuration VisiLogic offers an integral Hardware Configuration module. 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. After you select the Snap-in or Expansion I/O modules connected to the controller, you can configure inputs: analog, digital, and high-speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital, and PWM high-speed outputs. Ladder Modules and Subroutines VisiLogic is a modular program that you build using Modules and Subroutines. 5 VisiLogic: Getting Started

8 VisiLogic Overview Operand View and Watch Folders VisiLogic allows you to view operands and their contents according to type and whether or not they are in use. You can also group related operands according to functions in Watch Folders. Vision Controller Divisions There are two major Vision divisions, Standard and Enhanced. Each division supports different HMI features and Ladder functions. For more information, refer to Appendix B: Vision Controller Divisions. VisiLogic Examples When you install VisiLogic, an Examples folder is created on your hard disk, containing field-tested VisiLogic (.vlp) sample applications. You can copy these sample applications and adapt them for your own use—if, for example, an application is written for the V120, you can select the V230 via Hardware Configuration. Help Forums The Unitronics forums are located at Note that you can search the forums without subscribing, but that you must subscribe in order to post a question. Help Use the VisiLogic Help System to learn how to use the software and answer your questions. The VisiLogic Software Manuals are based on content from the Help system, and are intended for users who prefer to learn from printed documentation. However, please note that the Help system always contains the most updated content. 6 VisiLogic: Getting Started

9 VisiLogic Overview Live Update from the Web Live Update is available from the Help menu. To start Update, select a subject and follow the on-screen instructions. Note After downloading FBs, you must close and then restart VisiLogic. The new FBs will appear on the FBs menu. Check the topic FB Library for more information. After downloading a new Operating System to your PC, you must install it in the controller. Connect the controller to your PC, then open Communication and OS from the Connection menu. The new Operating system will appear in the Install Operating System tab. Select Download to begin the installation process. VisiLogic: Getting Started 7

10 Devices Emitting high EMF Minimizing EMI: System Design Guidelines Minimizing EMI: System Design Guidelines Before you design your control system, please read the following guidelines: Unitronics products are designed to operate in a typical industrial environment. These guidelines show you how to design your system for optimal performance in noisy environments. After installation, check your system periodically, in particular after installing new machinery close to the system. Devices Emitting high EMF High voltage, high current, and high frequency circuits such as high voltage / high current power supplies, high power converters and amplifiers, contactors and solenoids, motors and motor-drives may cause severe electro-magnetic disturbances that may affect the operation of other nearby computerized devices such as PLCs or I/O modules. Such high voltage, high current, and high frequency circuits should not share the same cabinet with PLCs or I/O modules. If this is unavoidable, within the cabinet, either: 1. Physically separate these sources from PLCs and I/O modules with large metal earthed plates. Such a plate should be large enough to partition the cabinet into two cubicles. 2. Separate these sources and their cabling from PLCs and I/O modules as described in the section Wiring Separation. Wiring Separation Use separate wiring ducts for each of the following groups: 1. Digital inputs, digital outputs, 24VDC (power supply for the PLC and I/O Expansion Modules), communications, analog inputs, and analog outputs. 2. Lines that are connected to the power grid, 230/115, 24VAC, all AC lines such as motor driver outputs, noisy DC lines such as DC servo drives and motors. Separate these groups by at least 10cm (4″). If this is not possible, cross the ducts at a 90 angle. Enclosing and Earthing 1. It is recommended to install the PLC and I/O modules in a closed metallic cabinet. This will significantly improve interference immunity. 2. Make sure that the cabinet and cabinet door are properly earthed. Please refer to the cabinet manufacturer instructions for proper installation and earthing. 3. When you earth devices, minimize wire impedance by using a wire that is as short and thick as possible, 3.3mm 2 (12 AWG), up to 10cm long recommended. Connect the line to nearest possible grounding point in the cabinet, preferably a grounding plate or the cabinet body. Be sure to remove any paint or other non-conductive coating between the wire terminal and metal as this may cause poor conduction. 8 VisiLogic: Getting Started

11 Minimizing EMI: System Design Guidelines I/O Wiring: General Guidelines I/O Wiring: General Guidelines 1. Route each I/O signal / signal-group along with a dedicated common wire (e.g. 0V). This serves as a signal return path and increases interference immunity. Connect common wires at the respective common pins of the module where the specified I/O port is located. Please refer to the module installation guide for details. 2. For all types of analog and high-speed I/Os: 3. Use shielded twisted pair cable 4. Do not use the shield as a signal or as a return conductor 5. Ground the shield at the closest grounding point to the I/O port, preferably a grounding plate or the cabinet body. This connection method usually gives the best interference immunity. However, in some cases, grounding the shield at both ends of the cable is preferable. In this case, be sure that both points have the same potential in order to eliminate ground currents through the shield. 6. Route those signals separately from high voltage / high current and AC wiring, as explained in the section Wiring Separation. Signal (Communication, I/O) Line Filtering Some environments may induce greater EMI than the typical industrial environment. Extra power and/or signal line filtering may improve the system s immunity to EMI. If signal-line filtering is required, please use the following guidelines in addition to the guidelines provided by the filter manufacturer: 1. Place the filter as close as possible to the target device(s); maximum wire length is 10 cm. 2. Signal lines can be filtered using rounded ferrite cores. To maximize their effect, wind the wire through the ferrite core multiple times to attentuate high frequencies as shown below. 3. Always pass both the signal and signal return wires thru the ferrite core. If multiple I/O lines share the same common return wire, pass all of these I/O lines and their return wire through the same ferrite core. VisiLogic: Getting Started 9

12 Wiring Power for I/O Expansion Modules Minimizing EMI: System Design Guidelines Wiring Power for I/O Expansion Modules The examples below are based on the EX-A1. 1. If the power-supply is closer to the PLC than it is to the module s power supply (EX-A1): — Create 0V and 24V junctions at the PLC respective terminals (see the following figure) and directly connect the PLC main supply lines to the EX- A1. — Continue daisy-chaining the supply lines to the expansion I/O units. Please ensure that the wire segment which carries the 0V between the EX-A1 and the PLC does not branch. When the power-supply is near the PLC, connect the PLC first as shown in the next figure. 1. If the power-supply is closer to the EX-A1 than it is to the PLC: — Create 0V and 24V junctions at the EX-A1 respective terminals (see the following figure) and directly connect the EX-A1 main supply lines to the PLC. — Split the supply lines at the EX-A1 terminals and continue daisy-chaining them to the expansion I/O units. Please ensure that the wire segment which carries the 0V between the EX-A1 and the PLC does not branch. When the power-supply is near the EX-A1, connect the EX-A1 first as shown in the next figure. 10 VisiLogic: Getting Started

13 Minimizing EMI: System Design Guidelines Power-line Filtering Power-line Filtering Some environments may induce greater EMI than the typical industrial environment. Extra power and/or signal line filtering may improve the system s immunity to EMI. If power-line filtering is required, please use the following guidelines in addition to the guidelines provided by the filter manufacturer: 1. Use of power-line filters that comprise an earthing terminal is recommended. Ground the filter earth terminal as explained in the section Enclosing and Earthing. 2. Place the filter as close as possible to the target device(s). The maximum wire length is 10 cm. 3. When using the EX-A1 expansion adapter: 4. Place one filter for both the PLC and the EX-A1 as instructed below. Please note that you must use a single line filter for both the PLC and EX-A1. 5. If the power-supply is closer to the PLC than it is to the EX-A1: — Install and connect the power-line filter as close as possible to the PLC. The maximum wire length is 10 cm. Please refer to the filter manufacturer documentation for installation information. — Create 0V and 24V junctions at the PLC respective terminals (see the following figure) and directly connect the PLC main supply lines to the EX- A1. — Continue daisy-chaining the supply lines to the expansion I/O units. Please ensure that the wire segment which carries the 0V between the EX-A1 and the PLC does not branch. When the power-supply is near the PLC, connect the PLC first as shown in the next figure. VisiLogic: Getting Started 11

14 Connect the EX-A1 Communication Cable Minimizing EMI: System Design Guidelines 1. If the power-supply is closer to the EX-A1 than it is to the PLC: — Install and connect the power-line filter as close as possible to the EX- A1. The maximum wire length is 10 cm. Please refer to the filter manufacturer documentation for installation information. — Create 0V and 24V junctions at the EX-A1 respective terminals (see the following figure) and directly connect the EX-A1 main supply lines to the PLC. — Split the supply lines at the EX-A1 terminals and continue daisy-chaining them to the expansion I/O units. Please ensure that the wire segment which carries the 0V between the EX-A1 and the PLC does not branch. When the power-supply is near the EX-A1, connect the EX-A1 first as shown in the next figure. Connect the EX-A1 Communication Cable 1. Note that the communication cable is ended by RJ45 plugs. The plug comprising a yellow-green grounding wire must be connected to the PLC as shown in the following figure. 2. This yellow-green wire must be grounded to the metal door panel or cabinet body (which must be also well grounded) using a screw. There cannot be any paint or other non-conductive coating between the wire 12 VisiLogic: Getting Started

15 Minimizing EMI: System Design Guidelines Connect the EX-A1 Communication Cable terminal and metal as this may cause poor conduction. DO NOT extend the wire. VisiLogic: Getting Started 13

16 Hardware Configuration Getting Started Getting Started Hardware Configuration Hardware Configuration opens automatically when you first create a new project. In order to open Hardware Configuration in an existing project, either select Hardware Configuration from the View menu or click the button on the toolbar. Click on the appropriate icon to select the model Vision, the Snap-in I/O module, and any I/O Expansion modules required by your application. After you select the Snap-in or Expansion I/O modules connected to the controller, you can configure inputs: analog, digital, and high-speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital, and PWM high-speed outputs. Note You must select the correct Vision model and Snap-in I/O modules before downloading your project. To avoid exceeding the I/O capacity of your controller, check the I/O report at the bottom of the Hardware Configuration window. Ladder Editor Use the VisiLogic 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. 14 VisiLogic: Getting Started

17 Getting Started Ladder Editor In a Ladder diagram, the contacts represent input conditions. They lead power from the left Ladder rail to the right rail. This is why the first element in a net must always touch the left rail. Coils represent output instructions. In order for output coils to be activated, the logical state of the contacts must allow the power to flow through the net to the coil. This is why the elements in a net must be connected. Each net must contain only one rung. Use the Ladder Editor to: Place and connect Ladder Elements. Apply Compare, Math, Logic, Clock, Store, and Vector functions. Insert Function Blocks (FBs) into your program. Build program Modules and Subroutines, and use internal Subroutine Jumps and Labels. Place Comments on Ladder nets. Ladder elements and functions may be dragged and dropped between nets. Hotkeys are also available for easy programming. To start the Ladder Editor Click the Ladder button on the toolbar. For complete information, please refer to the.pdf manual: VisiLogic: Ladder Application Programming VisiLogic: Getting Started 15

18 HMI Display Editor Getting Started HMI Display Editor Use the HMI Display Editor to create the Displays that the controller shows on its screen after the program is downloaded. When you click on HMI in the Project Explorer tree, a Display replica opens. The 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. If the project is based on a touch-screen controller, you can also assign touch properties to on-screen objects. Variables are inserted into a Display to: Show run-time values as integers Represent run-time values with either text, images, or bar graphs Show text messages that vary according to runtime conditions. For complete information, please refer to the.pdf manual: VisiLogic: HMI Application Programming The features in the HMI editor are determined by the controller type selected in Hardware Configuration. The next image is from a project based on a Enhanced Vision controller comprising a color touch screen. 16 VisiLogic: Getting Started

19 Getting Started About the HMI Display and Keypad Color and Enhanced Vision When, in Hardware Configuration, you select an Enhanced or Color Vision, the HMI editor changes accordingly and shows additional options such as Frame and Button. About the HMI Display and Keypad All Vision controllers offer an integrated HMI operating panel that includes an LCD screen and a keypad. The screen size, type and keypad vary. Exact specifications regarding Vision operating panels are included in the user’s manuals. ‘Touchscreen’ controllers There are different types of Vision touch-screen models: Monochrome LCD + HMI function keypad and virtual keypad Maximum number of displays: 255 Maximum number of variables per display: 24 In these models, activate the virtual keypad by turning SB 22 Enable Virtual Keypad ON. This must be done at power-up, or before entering a Display containing a keypad variable. In addition, the Keypad entry variable must be assigned a Touch Property. Monochrome LCD + Virtual keypad only Maximum number of displays: 255 Maximum number of variables per display: 24 In these models, the virtual keypad opens whenever the user touches a keypad entry variable that is currently displayed on the screen. VisiLogic: Getting Started 17

20 Variables Getting Started Note that to enter Information Mode, you touch the touchscreen in an area that is not occupied by a Keypad Entry variable or other screen object that has been assigned a Touch Property. Color Touchscreen LCD+ virtual keypad only Maximum number of displays: 1024 Maximum number of variables per display: 255 The virtual keypad functions in the same way as in monochrome models. 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. The maximum number of variables per display depends on the Vision controller division. Standard Vision: supports up to 24 variables Enhanced Vision: supports up to 255 variable 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 Variable. Note that for some types of variables, the type of controller selected in Hardware Configuration may determine some of the variable’s properties. For 18 VisiLogic: Getting Started

21 Getting Started Variables example, touch-screen models enable you to assign Touch Properties to onscreen objects. The next image shows a binary variable used in a V120 project. The next image shows numeric variable options for touch-screen color models. These enable you to assign Touch Properties to on-screen objects, and offer options for depth and color. VisiLogic: Getting Started 19

22 Variables Getting Started Hide Causes the object/text to disappear from view Suspends any touch properties Disable ‘Greys’ a button object Suspends any touch properties Marking View Changes the color of the button to dark blue background, white inverse text Does not affect touch properties Keypad OK Turns ON when Keypad Entry value is within legal limits Turns OFF when Keypad Entry value exceeds legal limits After you have inserted Variables into a display, they are shown with that display in the Project tree. 20 VisiLogic: Getting Started

23 Getting Started Quick Navigation 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. 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. VisiLogic: Getting Started 21

24 Downloading/Uploading a Project Getting Started 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. Forward-Backward Use the arrows to scroll through the program areas you have visited during the session. The Find utility also enables you to easily locate, directly open, and edit most program elements. In addition, you can right-click many program elements to open a shortcut menu. Downloading/Uploading a Project The Download process transfers your project from the PC to the controller. You can download a project via a direct PC-PLC connection, or via modem. Enhanced Vision controllers also support download via Ethernet and CANbus bridge. 1. Connect the controller to the PC with the MJ10-22-CS25 programming (communication) cable. Note that the V1040 supports download via a USB (Type A to mini-b) cable. COM port 1 function is suspended when the USB port is physically connected to a PC. 22 VisiLogic: Getting Started

25 Getting Started Downloading/Uploading a Project 2. Click Download on the Standard toolbar, or select an option from the Connection>Download menu. 3. The downloading process begins. Note that Build> Build All should be done before download, in order to locate project errors. Note Use Remote Access to establish a communication line via modem or network. Download options Vision controllers contain two types of memory: RAM (Random Access Memory) The controller uses RAM memory to run the application, make calculations, and manipulate data. RAM memory is volatile. This means that it requires power in order to maintain stored data. Data stored in RAM: The application, operand values, variable values, and Data Table sections that are not marked Part of Project. This data, as well as the RTC, is backed up by the battery. FLASH (Flash Erasable Programmable Read-Only Memory) The controller uses FLASH memory for data storage. and to store backup applications. FLASH memory is ‘non-volatile’. It does not require power in order to maintain stored data. Data stored in FLASH: Data Table sections that are marked Part of Project and Back-up applications, including applications that can be uploaded. Backing up your application In order to make sure that your PLC can recover its application in the even of total power loss—including battery failure—you must back up your complete application in the FLASH memory. To do this, use one of the following options from the Connection>Download menu, which differ according to the Vision Division you controller belongs to: VisiLogic: Getting Started 23

26 Downloading/Uploading a Project Getting Started Standard Vision: Download (Ctrl + D) Enhanced Vision: Download All & Burn (Alt + Ctrl + A) Creating an Upload application file If the PLC contains an upload file, you can upload and edit it using VisiLogic. To create an upload file, use one of the following options from the Connection>Download menu: Standard Vision: Download (Ctrl + D) Enhanced Vision: Burn ‘Upload Project’ (Alt + Ctrl + B) Note Reset Controller at Download When you edit a project and download it to a controller that already contains this project, the controller may require reset after download. Reset is required when changes are made to: Hardware Configuration Data Table structure References to an HMI Display that does not exist in the project In the following cases, the controller may request reset If many changes have been made to subroutines or Displays. Changes in Power-up values Option Comment Keystroke Download When you download an edited application to the PLC,select this option to download changes alone. If there are many changes, the PLC may request Reset. Standard Vision:This option burns an Upload file to the PLCs’ FLASH memory. Ctrl + D Enhanced Vision: This option does not burn an Upload file to FLASH To create an upload file, select the option Burn ‘Upload Project’ (color only) (Alt + Ctrl + B) Stop-Download- Run (Standard only) Automatically returns PLC to RUN mode after download. If there are many changes, the PLC may request Reset. Alt + Ctrl + D Stop-Download- Reset Forces Reset after download. Alt + Ctrl + R Download All & Burn (Enhanced only) Back ups the new application in the PLCs’ FLASH memory. Forces Reset after download. Alt + Ctrl + A Burn ‘Upload Project’ (Enhanced only) Enables the entire project to be uploaded from the Vision PLC. Forces Reset after download. Alt + Ctrl + B Download and See topic Download and Create Download file. none 24 VisiLogic: Getting Started

27 Getting Started Downloading/Uploading a Project Create Download file To upload a project from a controller: 1. Connect the controller to the PC. 2. Select Upload icon from the Connection menu; the Vision Communication PC Settings window opens. 3. Select the connection type and click Exit; the uploading process begins. Upload copies the complete project from the controller into the PC. Via Project Properties, you can apply upload and download options: Assign a project password. Password protection requires users to enter a password before uploading a project to a PC. Prevent project upload. Note Security restriction: if a PLC operator enters a wrong password 9 times, the PLC automatically disables program upload for that program. Resetting the PLC will enable you to try another 9 times. The limit set on password entry is intended to provide an additional layer of security. For example, this can prevent a hacking script from entering a networked PLC, since the number of attempts is limited and such a script would not reset the PLC. Why can’t I upload a project from the PLC? Project upload may have been disabled. In this case, the controller displays the following message at upload: «This project cannot be uploaded because: — the option ‘Burn Upload Project’ was not selected when the project was downloaded, or — due to incomplete data in the PLC», and upload fails. You are not entering the correct Upload password set in the Project Properties of this project. Are USB port adapters available? If your PC contains only USB ports, and your OPLC does not offer a USB port, you can connect a Unitronics OPLC via a compatible, external USB-to-serial converter. Unitronics offers a USB-to-serial converter that has been tested for compatibility with OPLC controllers. This converter can be ordered from local Unitronics distributor, using part number MJ10-22-CS35. VisiLogic: Getting Started 25

28 On-Line Test Mode (Debug) Getting Started On-Line Test Mode (Debug) To test a project, first establish PC-PLC communications by connecting the controller to the PC with the MJ10-22-CS25 programming (communication) cable. Note that the V1040 supports download via a USB (Type A to mini-b) cable. COM port 1 function is suspended when the USB port is physically connected to a PC. Note You can also use Remote Access to establish a communication line via modem or network. Once you have established communications, download the project and click the On-Line Test button. The Online Test toolbar opens, enabling you to: Switch between Run and Stop modes. Use Single Scan to run a single cycle of the ladder program for debugging purposes. You can stop the scan cycle at any point by placing OnLine Test Points, located on the More menu, in the Ladder. When the scan reaches an OnLine test point that is active (receives RLO), Online Test freezes, enabling you to check element status and values, including Timer values, at that point during Ladder execution. Note that if more than one OnLine test point is activated, SB 35 turns ON. Measure the time interval between 2 points in the Ladder application, by placing Start and End Interval elements, located on the More menu, anywhere in the application. The time interval, units of 10 micro-seconds, is stored in the DW linked to the End Interval element. Note that Interval elements should not be placed in Interrupt routines. 26 VisiLogic: Getting Started

29 Getting Started On-Line Test Mode (Debug) Open Remote Access to debug remote controllers via network or modem connections. In Online Test mode, you can view the power flow, and view and force operand values and element status. You can also select a controller that is directly connected to the PC, or a PLC’s network ID # if the PC is linked to a CANbus or RS485 network. VisiLogic: Getting Started 27

30 Information Mode Getting Started Force I/0, by right-clicking the operand and setting the desired state Note The controller can send and receive SMS messages when the controller is in Test mode. 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 controller s 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. Viewing data does not affect the controller s program. Performing actions, such as initializing the controller, can influence the program. Note that when you use Information Mode, the keyboard is dedicated to that purpose. The keys return to normal application functions when you exit Information Mode. Entering Information Mode 1. To enter Information mode: -Non-touchscreen models: press the <i> key on the Vision s keyboard. -Touchscreen models: touch the screen in an area that is not occupied by a Keypad Entry variable or other screen object that has been assigned a Touch Property. Maintain contact for several seconds 2. The controller enters Information Mode and requests a password. 3. Enter your password. The default password is Note that at every power-up, this password is restored. To maintain a different password after power-up, use SB 2-Power-up as a condition to store the desired password value into SI 253. To change the password, access the controller via VisiLogic, then run Online Test mode and changing the value. This value will be erased at power-up. 4. The controller enters Information Mode, showing the first category, Data Types. Use the <Enter> key to enter a category. 28 VisiLogic: Getting Started

31 Getting Started Information Mode 5. Press the <ESC> key to exit a category, and to exit Information mode. The controller will block entry into Information mode until the correct password has been entered. This is why you must record any password you set for your controller. The data in Information Mode is arranged in Categories. Each Category contains several Subjects. You navigate Information Mode by using the keyboard buttons. To exit Information mode, press the <ESC>button on the Vision s keyboard. Each press returns one level up. Press the number of times necessary to exit. Notes When you reenter Information Mode, the controller will return to the last Category viewed. Info System Operands # Description Turned ON Turned Off Comments Turns ON when SB 36 INFO mode Info Mode is Turns OFF when Delay time to enter Info Mode is 4 entered by OS, user exits Info seconds, may be modified via SI 50 Remotee Access, Mode or program # Description Value SI 50 INFO Mode: Entry Delay Time Default by O/S (every power up) = 4 seconds Comments Units: seconds. Legal values: 0, 3 to 20. If you force or store ‘0’ into equal Zero INFO is disabled. For V290 Touching the <i\> key on the touch screen starts Info Mode Touching a legal Ladder application variable clears the INFO time. SI 253 Password: Info Mode Note that at every power-up, the default password to Info Mode, 1111, is restored. To maintain a different password after power-up, use SB 2- Power-up as a condition to store the desired password value into SI 253. The password may also be modified by accessing the controller via VisiLogic, then running On-line Test mode and changing the value. This value will be erased at power-up. VisiLogic: Getting Started 29

32 Information Mode Getting Started The categories of available information depend on the controller model. The table below shows the basic categories of information. Category Subject Possible Actions Data Types Memory Bits View bit status System Bits Change bit status (Set/Reset) Memory Integers System Integers Memory Longs System Longs View integer/long integer/double word value. Change values Toggle Base: view the value in decimal or hexadecimal form. Memory Double Words System Double Words Inputs View input status. Force input status to 1 (FR1) or 0 (FR0). Forced values stay in effect until Normal mode (NRM) is selected, or until the controller is initialized or reset. Note Forced values do influence your program. This can be useful in testing the effect of an input condition on an output status. Outputs View output status. Force output status to 1 (FR1) or 0 (FR0). Note that forced output values do not affect your program. Set/Reset output status. Timers Enter a Preset Timer value. View the current timer value and status by selecting the R.T. option. TCP/IP (Standard Vision, Visible when Ethernet card is installed) Enables you to view and edit IP address and socket settings. System Model & O/S Ver Check the controller s model number and operating system version. Check whether the controller is in Run or Stop mode. Working Mode Check whether the controller is in Run or Stop 30 VisiLogic: Getting Started

33 Getting Started Information Mode 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 controller s keyboard. Unit ID The Unit ID number identifies a networked controller. You can: Change the ID number. The new ID number will remain in effect until the controller is reset. Burn the ID number into the controller s FLASH memory. This is a permanent change. Serial Port 1 Serial Port 2 View and edit communication settings. Select to Change or Burn the new settings. Ethernet (Enhanced Vision, if an Ethernet card is installed) Enables you to view and edit IP address, Socket settings, and other TCP/IP settings. Monitor Communications (Enhanced only) This is a built-in communications ‘sniffer’ Touch screen models: select Serial or Ethernet, then press Monitor. Note the button that allows you to toggle between Hex and ASCII Non-touch screen models: Select Communication, then select Serial or Ethernet> COM Buffer. Use F2 to toggle between Hex and ASCII. In addition, press Enter, and then the Down key to toggle between. Tx and Rx. CANbus Built-in CANbus communications ‘sniffer’ Change the CANbus baud rate. Touchscreen (Touchscreen models only) Enables you to calibrate the touchscreen, if it is not responding accurately to screen taps. SD Card (Enhanced Division) Removable memory storage Enables you to upload and download VisiLogic applications, OS firmware, and Data Table data from/to an SD card. You can use these features to ‘clone’ a PLC application. Function Reserved for VisiLogic: Getting Started 31

34 COM Ports and Data Communications Getting Started Block future use Hardware Configuration Check if I/O Expansion Modules are installed. Note that I/O Expansion Modules are represented by letters. Identical module types are represented by identical letters as shown below. Shows if an I/O module is short-circuited. COM Ports and Data Communications Information regarding the communications features of specific Vision models is available from your local Unitronics distributor, or Below is a general description of Vision communication features. For details, refer to the VisiLogic — Communications manual. Com Ports Serial CANbus Ethernet 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 built into specific controller models. Ethernet ports are available by separate order. 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. Standard programming cables do not provide connection points for pins 1 and 6. Initializing COM ports Serial and CANbus communication ports must be initialized in your control program using the COM Init FB, located on the FB’s menu. The Ethernet port must be initialized using the Ethernet Card Init FB, located under Ethernet on the FB’s menu. Data Communications Options 32 VisiLogic: Getting Started

35 Getting Started About Modems Data Communications include all of the options shown below: CANbus Modems, Landline and GSM/GPRS GPRS Ethernet DF1 Slave (Allen-Bradley) RS232 RS485 Options Communication FBs SMS messaging GPRS MODBUS (serial) MODBUS IP (Ethernet) Communications Protocol FB PC-Vision communications PC-Modem Configuration Remote Access: Accessing a PLC via PC Accessing a Networked PLC via PC SD Card Remote Access SD Card Explorer About Modems Unitronics’ controllers can be hooked up to PSTN (landline), or GSM/GPRS modems via the RS232 COM port. Unitronics provides kits that comprise modems that have been tested by Unitronics and are supported for use with Vision, Jazz, and M90/91 PLCs. Before you can use modems in your application, you must use Modem Services to initialize both the PC and PLC-side modems. This process is referred to as ‘Prepare Modem’. Modem services Modem Services is located on the Connections menu. To use Modem Services, connect the modem to a PC, using the cable supplied by the modem manufacturer. You can then initialize the modem. Once you have connected initialized modems to your PC and PLC, you can use Modem Services to establish communications with a remote PLC. PC-side Modems You can use a PC modem to access a remote, modem-linked controller and perform any task, just as you would if the PLC were directly connected to your PC. For example, you can: Dial a remote PLC modem and receive calls from a PLC. Download, upload, and edit the controller program via the modem connection. VisiLogic: Getting Started 33

36 About Modems Getting Started Run Online test mode. Download an OS to the controller via modem. Use OnLine test and Information Mode to troubleshoot problems in remote controllers and applications. Read and write data to/from controllers via Remote Access or Unitronics’ communication.dll utilities. Receive and send SMS messages via SMS options. 34 VisiLogic: Getting Started

37 Getting Started About Modems PLC-side modems Via modem, a Vision controller can communicate data using: MODBUS (serial) commands. VisiLogic’s Communication Protocol FB, which enables Vision controllers to communicate data with most external serial devices, such as bar-code readers and frequency converters, via their proprietary protocols. SMS messages. The SMS FB enables text messages, including variable data, to be sent and received via GSM modems. via GPRS (Enhanced Vision only). GPRS cellular network, to transmit IP packets of data. Modem Tips Notes 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. If calls are routed via a switchboard, note that the switchboard settings may interfere with communications. Consult with your switchboard provider. 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 the PLC modem does not answer before the 3 seconds have elapsed, the S7=30 parameter is exceeded, and the PC modem returns the No Carrier error. 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. Standard Vision Division Controllers in this division can only support a single modem. You can connect a modem to any COM port. However, note that SB 184 TX Success and SB 185 TX Failed indicate message transmission status regardless of the actual COM port connected to the modem. Enhanced Vision Division Controllers in this division can support a modem on each COM port. Each port is linked to a Succeed and Fail SB: COM1: SB 184 and SB 185, COM2: SB186 and SB 187, COM3: SB 188 and SB 189. VisiLogic: Getting Started 35

38 About Modems Getting Started When working with V570 and V290 (color): Set the baud rate in both Modem Services and in COM Init to In addition, run the Prepare PLC Modem procedure with the baud rate set to Com Init: — Select Ignore Break — Time Out Reply: set to a minimum of 6 seconds. Known compatibility issue: Sony Ericsson Modems. Unitronics products are compatible with the following Sony Ericsson Modems: Model GT47 R5xxxx and higher Model GM29 R6xxxx and higher Unitronics cannot guarantee compatibility with other models, such as Sony Ericsson Modem model GM29 R4xxxx. 36 VisiLogic: Getting Started

39 I/O Expansion Modules Hardware Configuration Hardware Configuration Hardware Configuration opens automatically when you first create a new project. In order to open Hardware Configuration in an existing project, either select Hardware Configuration from the View menu or click the button on the toolbar. Click on the appropriate icon to select the model Vision, the Snap-in I/O module, and any I/O Expansion modules required by your application. After you select the Snap-in or Expansion I/O modules connected to the controller, you can configure inputs: analog, digital, and high-speed counter/shaft-encoder/frequency measurers and PT100; and outputs: analog, digital, and PWM high-speed outputs. Note You must select the correct Vision model and Snap-in I/O modules before downloading your project. To avoid exceeding the I/O capacity of your controller, check the I/O report at the bottom of the Hardware Configuration window. I/O Expansion Modules Vision controller are compatible with I/O Expansion modules. There are three ways to integrate them into the system: Locally, via an EX-A1 adapter connected to the controller’s I/O Expansion port A Vision controller can support up to 8 local I/O Expansion Modules 37 VisiLogic: Getting Started

40 I/O Expansion Modules Hardware Configuration connected to the I/O Expansion port. Remotely, via an EX-RC1 connected to the controller’s CANbus port. Directly to the controller’s I/O Expansion port, using an EX90-DI8-RO8 stand-alone I/O Expansion module. Note that only a single EX90-DI8-RO8 can be connected to the controller. Check with your distributor for additional details. Configuring I/O Expansion Modules Use Hardware Configuration to add modules and configure the I/Os, and to remove modules from the system. The I/O Report at the bottom of the screen tracks the I/O capacity of the system. Note Most I/O Expansion Modules require an adapter. Check with your distributor for additional details. Addressing I/Os on Expansion Modules Inputs and outputs located on I/O expansion modules are assigned addresses that comprise a letter and a number. The letter indicates whether the I/O is an input (I) or an output (O). The number indicates the actual physical location of the I/O. This number relates to both the position of the expansion module in the system, and to the position of the I/O on that module. Expansion modules are numbered from 0-7 as shown in the figure below. 38 VisiLogic: Getting Started

41 Hardware Configuration I/O Expansion Modules The formula that is used to calculate the number of the I/O is: 32 + x 16 + y, where X is the number representing the location of the module s location (0-7) and Y is the number of the input or output on that specific module (0-15). Examples Input #3, located on module #2, will be addressed as I = Output #4, located on module #3, will be addressed as O = Remote I/Os The EX-RC1 enables you to distribute I/O Expansion Modules throughout your system. The adapter is connected to a master PLC by UniCAN, Unitronics proprietary CANbus protocol, and functions as a slave device within that network. Each adapter may be connected to up to 8 I/O expansion modules. The network may include up to 60 devices. The EX-RC1 is run by a factory-installed VisiLogic application. You can upload this application and tweak it to adapt it to your system. Note that the adaptor has the ability to auto-detect digital I/O Expansion modules that are connected via CANbus. This means that if your system includes only digital I/O Expansion Modules, you do not have to define the Hardware Configuration. VisiLogic: Getting Started 39

42 I/O Expansion Modules Hardware Configuration If, however, your system includes analog modules, you must upload the VisiLogic application from the EX-RC1 and define the Hardware Configuration. The EX-RC1 network ID number is determined by DIP switch settings, and cannot be changed by the software application. The switch setting represents the ID number as a binary value as shown in the following figures. Unit ID Settings Configuring a PT100 Input 40 VisiLogic: Getting Started

43 Hardware Configuration I/O Expansion Modules High-Speed Counters: I/O Expansion Modules Certain digital inputs on certain I/O Expansion Modules are high-speed inputs that can be used as a 16-bit high-speed counter of the following types: High-Speed CounterUses the high-speed counter input alone, without reset. High-Speed Counter with ResetUses the High-Speed counter input and the next-to-last digital input as the counter’s reset. Note that Reset occurs during Active High. Frequency MeasurerCounts the number of pulses over the selected period of time (sample rate): 100 msec, 500 msec, or 1000 msec (1 second), expressing the number in Hertz. For example, 155 pulses counted over 500 msec is equal to 310Hz. Configuring a High-Speed Counter The linked operand contains the counter value which is current at the last program scan. Use this operand in your program like any other. VisiLogic: Getting Started 41

44 Snap-in I/O Expansion Modules Hardware Configuration Snap-in I/O Expansion Modules Configuring Snap-in I/O Modules High-Speed Counters: Snap-in I/O Modules Certain digital inputs on Snap-in I/O Modules are high-speed inputs that can be used as a 32-bit high-speed counter of the following types: High-Speed CounterUses the high-speed counter input alone, without reset. High-Speed Counter with ReloadUses the High-Speed counter input and an additional digital input as the counter’s reset. You can select whether Reload occurs at Active High, when the pulse is at the positive level, or Active Low, when the pulse is at the negative level. Note that you cannot set the Reload input to Frequency Measurement. Frequency MeasurerCounts the number of pulses over the selected period of time (sample rate): 100 msec, 500 msec, or 1000 msec (1 second), expressing the number in Hertz. For example, 155 pulses counted over 500 msec is equal to 310Hz. Shaft EncoderNote that pnp shaft-encoder devices may be used. 42 VisiLogic: Getting Started

45 Hardware Configuration Snap-in I/O Expansion Modules 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. VisiLogic: Getting Started 43

46 Snap-in I/O Expansion Modules Hardware Configuration High-Speed Counter: Reload Reload enables you to immediately load 0 into a high-speed counter when the counter value reaches a target value. Note that you cannot set the Reload input to Frequency Measurement. Stepper via High-speed Output (V570/V1040 only) If you are using a V570 or V1040 with any model Snap-in I/O module, VisiLogic 7.00 or higher and the OS released with that version, you can use specific high-speed outputs to control stepper motors. Note that any acceleration and deceleration that is needed to arrive at Target safely and accurately must be implemented in your Ladder application. Configuring the HSO 1. Click the Output line and select High Speed Outputs (Step Control). 2. The Select Operand and Address dialog box appears five successive times, allowing you to link operands for Frequency, Duty Cycle, Run, Current Position, and Target Position. 44 VisiLogic: Getting Started

47 Hardware Configuration Snap-in I/O Expansion Modules Parameter Type Function Frequency MI, ML, DW Note that F=1/T, where T is the duration time of a complete cycle. Frequency settings differ from npn to pnp output type. npn: You can use a value of 0, or a value from Hz ( 50kHz). pnp: You can use a value of 0, or a value from HZ. Other frequency values are not supported. Duty Cycle MI, ML, DW The ratio of the «on» period of a cycle to the total cycle period. This value may be from , 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. 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. If values out of range enter the Duty Cycle and Frequency operands, the output turns OFF and remains OFF until the values re-enter the range. Run MB Changes the operating mode of the output from normal output mode to HSO mode: 0 (SET)=Normal Mode, 1 (RESET): HSO Mode. Current Position DW This is the current location of the stepper. Target DW This is the location you want the stepper to move to. VisiLogic: Getting Started 45

48 Configuring a High-Speed Counter Hardware Configuration Acceleration and Deceleration If your application requires acceleration/decelerat ion as is shown in the accompanying figure, you can control the speed of movement via the Ladder application. To see how, check the sample application Stepper Control. Configuring a High-Speed Counter Certain digital inputs on both Snap-in I/O and I/O Expansion modules can be used as high-speed counters in the following modes: High-Speed counter High-Speed counter with Reset Shaft encoder Frequency Measurer Note When you select High-Speed Counter with Reset, the controller uses an additional input for reset; shaft encoders also require the use of two inputs. High-speed counters are built into the hardware, you define them as part of the controller’s hardware configuration by first selecting the counter type and then linking it to an operand that contains the counter value. Compare Functions and Counter Values The high-speed counter value is read once during every program scan. For this reason, do not use the Equal (=) function together with high-speed counter values. If the counter does not reach the value required by the Equal function during the actual program scan, the function cannot register that the value has been reached. Use functions Greater Than Or Equal To ( ) and Lesser Than Or Equal To ( ). Configuring a High-speed Output (PWM) You can use certain outputs as High-speed Outputs (HSO) via PWM (Pulse Width Modulation). When you select a High Speed Output in the Hardware, the Select Operand and Address dialog box appears three successive times, allowing you to link operands for the following values: Duty Cycle The ratio of the «on» period of a cycle to the total cycle period. This value may be from , and is expressed as a percentage. 46 VisiLogic: Getting Started

49 Hardware Configuration Configuring a High-speed Output (PWM) 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 npn to pnp output type. npn: You can use a value of 0, or a value from Hz ( 50kHz). pnp: You can use a value of 0, or a value from HZ. Other frequency values are not supported. 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, the output turns OFF and remains OFF until the values re-enter the range. Configuring the HSO VisiLogic: Getting Started 47

50 Configuring a High-speed Output (PWM) Hardware Configuration Note V120: The same MI sets Frequency for both outputs. 48 VisiLogic: Getting Started

51 Hardware Configuration Configuring an Analog Input Configuring an Analog Input Before you can use an analog input in your program, you must link it to an operand. An analog input value can be contained in an MI, ML, or DW. Analog Filters, PLC Analog filter options, defined in Hardware Configuration, are available in Vision120, V E3B, and certain I/O expansion models that offer analog inputs, such as the IO-ATC8. Note that 10-bit inputs do not offer filters. Using a filter can help protect your system from fluctuating input readings. The filter processes values on a FIFO (First In First Out) basis. The filtering process is run after each new analog reading. Values can be processed further via the Filter FB. The Filter field, shown below, is activated after you define the analog input. VisiLogic: Getting Started 49

52 Analog Filters, PLC Hardware Configuration Notes Details regarding an I/O’s specific resolution, conversion methods, and rates are given in the technical specifications supplied with Unitronics’ controllers and I/O modules. When you configure an analog input for use with the PID function, ensure best results by using the highest strength filter. Filter Types Low Calculates the average of the last two readings Medium Takes the last 4 readings, eliminates the lowest and highest values, then calculates the average of the 2 remaining values. High Takes the last 8 readings, eliminates the two lowest and the tow highest values, then calculates the average of the 4 remaining values. 50 VisiLogic: Getting Started

53 Hardware Configuration Configuring an Analog Output Configuring an Analog Output Analog I/O Ranges Note that devices used in conjunction with the controller must be calibrated according to the available range. Below, Range refers to the value contained by the register that is linked to the I/O in Hardware Configuration. Model number Resolution Range V E1 (Snap-in I/O module) V R1, V R2C M90 controllers (analog input) M91-19-R1, M91-19-R2, R2C V UN2 M90-19-UN2 M91-19-TC2 10 bit (0-10V, 0-20mA, 4-20mA) 14 bit (0-10V, 4-20mA) Temperature , 1024 units (except at 4-20mA) 204 to 1024, 820 units (at 4-20mA) , units (except at 4-20mA) , units (at 4-20mA) VisiLogic: Getting Started 51

54 Analog I/O Ranges Hardware Configuration ranges appear in the following table IO-AI4-AO2 Input Output 12 bit (0-10V, 0-20mA, 4-20mA) 12 bit +sign ( ±10V, 0-20mA, 4-20mA) , 4096 units (except at 4-20mA) 819 to 4095, 3277 units (at 4-20mA) (except at4-20ma) 819 to 4095, 3277 units (at 4-20mA) Model number Type Input ranges Analog Value V UN2 M90-19-UN2 M91-19-TC2 mv -5 to 56mV -500 to 5600 TC type B 200 to 1820 C (300 to 3276 F) 2000 to (3000 to 32760) E -200 to 750 C (-328 to 1382 F) to 7500 (-3280 to 13820) J -200 to 760 C (-328 to 1400 F) to 7600 (-3280 to 14000) K -200 to 1250 C (-328 to 2282 F) to (-3280 to 22820) N -200 to 1300 C (-328 to 2372 F) to (-3280 to 23720) R -0 to 1768 C (-32 to 3214 F) -0 to (-32 to 32140) S -0 to 1768 C (-32 to 3214 F) -0 to (-32 to 32140) T -200 to 400 C (-328 to 752 F) -200 to 4000 (-3280 to 7520) IO-PT4-50 to 460 C -500 to 4600 C 52 VisiLogic: Getting Started

55 Hardware Configuration Working with Analog I/O Values Working with Analog I/O Values Analog values can be converted to physical values, for example Engineering Units (EU) such as degrees Celsius, by using the Linearization FB. Note Analog I/O values are contained in the register that you link to the I/O in Hardware Configuration. Linearizing an Analog Input Value VisiLogic: Getting Started 53

56 Working with Analog I/O Values Hardware Configuration Linearizing an Analog Output Value Working within the 4-20mA range Available ranges, according to controller and I/O module, are shown in the topic Analog I/O ranges. Note that devices used in conjunction with the controller must be calibrated accordingly. In the examples below, the analog device is a pressure transducer; values are therefore translated to millibars. 10-bit Analog Input, V E1 12-bit Analog Input, IO-A14-AO2 54 VisiLogic: Getting Started

57 Hardware Configuration Configuring Digital Inputs 12-bit Analog Output, IO-A14-AO2 14-bit Analog Input, V UN2 Configuring Digital Inputs Note PNP/NPN must be set within the hardware, as explained in the technical specifications supplied with the I/O module. The program settings do not influence the actual hardware input setting. VisiLogic: Getting Started 55

58 Configuring Digital Outputs Hardware Configuration You can also assign a single description to a several lines. Configuring Digital Outputs Digital Outputs may be Relay or Transistor type. Note PNP/NPN must be set within the hardware, as explained in the technical specifications supplied with the I/O module. The program settings do not influence the actual hardware input setting. 56 VisiLogic: Getting Started

59 Hardware Configuration Assign a Description to Multiple Operands You can also assign a single description to a several lines. Assign a Description to Multiple Operands To assign a Description to multiple operands, select a range of operands by dragging your cursor across them, then type a description and click OK. You can also copy and paste text to and from other Windows applications. VisiLogic: Getting Started 57

60 Vision Communication PC Settings Controller Settings Controller Settings Vision Communication PC Settings This defines the connection VisiLogic will use when downloading a program or carrying out other communication tasks. To display the current communication settings, select Communication & OS from the Connection menu. Note that you can cause the Unit ID# to be permanently assigned to the project via Project Properties. Select Connection Type PC COM Parameters Communicate with OPLC Vision OPLC Information If your Vision contains an Ethernet port, you can select the TCP/IP options. Serial is the default communication mode; note that if you select TCP/IP and close the project, the setting reverts to Serial. Port, Retries and Time-Out are the communication settings between VisiLogic and the controller. Note If you are working with a network, the TimeOut should be greater than 1 second. If you are working with a GPRS modem, set the TimeOut to its maximum of 10 seconds. Use these options to communicate with networked controllers. Direct Connection: select this to communicate with any controller that is connected to your PC via the download cable, including a network bridge. Within Network:select this to communicate with a controller that is integrated into a network, then select the controller’s ID number Note ID numbers 1-63 are reserved for controllers linked via CANbus; ID numbers are reserved for controllers networked via RS485. Using this range of ID numbers prevents a polled controller from attempting to act as a CANbus bridge, preventing it from attempting to locate the requested controller. Click Get OPLC Information to display information about the controller you have selected in Communicate with OPLC. 58 VisiLogic: Getting Started

61 Controller Settings Communication and OS-Controller Menu Communication and OS-Controller Menu Via this menu, you can Set PC communication parameters (non-modem) to enable PC-PLC communication. Reset and initialize a PLC, enter Stop and Run modes, get RTC values as well as reset the RTC. Get COM Parameters and PLC status. Install an Operating System (O/S) in a PLC Check Network Status Run, Reset, Initialize When you click one of the buttons shown in the figure below, your PC will access the controller selected in Communicate with OPLC. Set RTC Get Vision RTC Current Values Run Stop Reset Reset & Initialize These are the values of your PC’s clock. Click Set RTC to import these values into the RTC of the controller. Click to view the current PLC settings Click to run the current program in the PLC. Click to stop the current PLC program. Click to reset the PLC, and reinstall any values preset in the program, such as Timers. Click to reset, reinstall any preset values, and initialize all memory operands VisiLogic: Getting Started 59

62 Get COM Parameters and PLC status Controller Settings Get COM Parameters and PLC status Select Get to view communication parameters and PLC status in the controller you are currently communicating with. This is the controller selected in Communicate with OPLC. Downloading an OS In many cases, you must update the controller’s Operating System, or OS, before you can take advantage of newly released Vision and VisiLogic features. You can download an OS, via a direct PC-PLC connection, or via modem. Enhanced Vision controllers also support download via Ethernet and CANbus bridge. Note You cannot download an OS via a network connection. To download an OS via a direct PC-PLC connection: 1. Connect the controller to the PC with the MJ10-22-CS25 programming (communication) cable. In the case of the V1040, the USB cable may be used. Note -The controller’s COM Port 1 must be directly connected to the PC via the programming cable. Only COM Port 1 can be used to download an OS. In the case of the V1040, note that COM port 1 function is suspended when the USB port is physically connected to the PC. -Direct Connection must be selected in Communicate with OPLC. 2. Open Connection>Communication & OS, and then click the fourth tab to open Install Operating System. 3. Click Check to enable VisiLogic to establish communications with the PLC and check the version of the OS currently installed in the PLC; after the check is complete, VisiLogic displays the OS version currently installed in 60 VisiLogic: Getting Started

63 Controller Settings Downloading an OS the PLC as shown below. 4. To install the OS, click Download; OS installation begins. 5. If you are connected to a Vision Color Series model such as the V570, a wizard opens and guides you through the steps. Note that the Advanced button enables you to download separate OS sections; this feature is intended for use by advanced users only. Note By default, OS version shows the most recent OS version released with your version of VisiLogic. To check if more recent OS versions are available, run Live Update from the Web. Note that Live update does not install the new operating system, which must be installed as described above. You can also install an older OS version by selecting an OS version via the drop-down arrow, and then clicking Download. System Fonts are used by the controller to show system messages that are not part of your program, such as a message that the controller is in Stop Mode. These fonts are part of the OS, and do not need to be downloaded separately. The first number in the OS number is the main version number, followed by the sub-version and Build number. You can check to see if new OS versions have been released using Live Update, via Help>Check for Updates>Operating System. Application Version Mismatch (Err — Old Topic) After OS download, the PLC may display one of these messages. This message appears when base versions of the OS and of VisiLogic do not match, for example, OS version 3.5x / VisiLogic version 3.6x, or from OS 4.5x to VisiLogic 4.0x. This means there is an incompatibility between the VisiLogic version of the project in the controller and the OS. VisiLogic: Getting Started 61

64 Check CANbus Network Status Controller Settings This error can generally be resolved by downloading a new VisiLogic project updating the current project to the most recent version of VisiLogic. You can also update the project currently in the PLC by uploading it, updating it, and then downloading it to the PLC. Known Issue, Vision 120 Known issue: A power failure during OS download causes V120 models, installed with bootstrap (firmware)1.30 and lower, to enter bootstrap mode. The V120 will not be able to exit Bootstrap mode until it is physically turned off, and then powered on. Downloading an OS via Modem By following the recommendations given below, you can successfully download an OS to a Vision controller via modem. Download via modem is supported by OS V3.70, B50 and higher. In order to download an OS via modem: 1. Prepare and connect the PLC-side modem as described in the topic PLCside Modems, in the section ‘How to enable a controller to communicate via landline or GSM/GPRS modems’. These procedures initialize the modem with the parameters required to download an OS. 2. Connect the modem to COM port 1 on the PLC. If power failures occur, or if the modem communication link is broken, the OS download stops. Controllers V230, 260, and 280 can recover without any intervention; as can V120 controllers installed with bootstrap Version 1.30 or higher. However, a V120 controller installed with bootstrap versions lower than 1.30 may require physical power-up (must be turned off, and then powered on.) In all cases, it is recommended that someone be next to the PLC during the OS download in order to attend to any potential problems. The PC-side and PLC-side modems must use the initialization defaults: baud rates must be set to 9600; and COM Init set to ATS0=1. Once the PC-PLC modem connection has been established, proceed according to the instructions in Downloading an OS. Modem Tips To avoid compatibility problems, use modems produced by the same manufacturer and of the same model. This is due to lack of standardization between modem manufacturers, which may result in communication conflicts. Check CANbus Network Status The network status is checked via the bridge. Access Check Network Status by opening the Connection menu, selecting Communication & OS, then clicking the network tab. 62 VisiLogic: Getting Started

65 Controller Settings Check CANbus Network Status VisiLogic: Getting Started 63

66 Remote Access: Accessing a PLC via PC Remote Access Remote Access Remote Access: Accessing a PLC via PC Use VisiLogic to activate access a remote Vision controller and: Download and upload projects Remotely operate the controller’s HMI through your PC Run On-Line Test mode on the remote controller Run Information Mode. You can access: Stand-alone controllers that are directly connected to the PC via a cable. Controllers within a CANbus or TCP/IP network Either stand-alone or networked controllers via GSM or landline modem. Note In addition to using VisiLogic to access a remote Vision, Unitronics provides a stand-alone utility called Remote Access. This utility can also access Unitronics M90/91 and Jazz controllers. It may be freely downloaded from Accessing a PLC via VisiLogic Before you can access a controller, you must establish a communication link: Direct Connection: PC-Controller 1. Connect your PC to any controller using the programming cable supplied with the controller kit. In the case of the V1040, the USB cable may be used; note that COM port 1 function is suspended when this port is physically connected to a PC 64 VisiLogic: Getting Started

67 Remote Access Remote Access: Accessing a PLC via PC Accessing a Networked Controller 1. Connect your PC to any controller in the network using the programming cable supplied with the controller kit. Note Different PCs can access a network at the same time, using different controller units as bridges. However, 2 different PCs cannot simultaneously access the same controller unit. 2. Select a networked controller by opening Communication & OS from the Connection menu, and then entering the Unit ID number. VisiLogic: Getting Started 65

68 Remote Access: Accessing a PLC via PC Remote Access Accessing a Controller via Modem 1. Prepare and connect your PLC-side modem as described in the topic PLCside Modems, in the section ‘How to enable a controller to communicate via landline, GSM/GPRS modem’. 2. Prepare the PC-side modem as described in the topic PC-Side Modems (Modem Services), in the section ‘How to Configure a PC-side Modem’. 3. Via Connection>Modem Services, dial the remote PLC’s controller to establish the data link. 4. Select a connection type using the drop-down selection box on the toolbar. 5. Click the On-line Test mode button or press <F9> to enter On-Line Test mode; the left Ladder rail turns red and real-time values are displayed in the Output window. 6. Click the Remote Access button on the On-line Test toolbar to display the remote controller on your PC screen. You can toggle the controller image on and off using <Shift>+<F9>. 66 VisiLogic: Getting Started

69 Remote Access Remote Access: Accessing a PLC via PC 7. Remotely operate the controller’s HMI by using: — Your PC keyboard, pressing arrow, alphanumeric, and function keys <F1> to <F8>). Note that the Vision <ESC> key is the <E> key on the PC keyboard — Your mouse to click keypad keys on the Remote Access image on the PC screen. In the case of touch-screen models, you can also click on-screen objects. To enter Information Mode, press the <i> key on your PC keyboard, or by clicking it on-screen with your cursor. VisiLogic: Getting Started 67

70 Remote Access: Accessing a PLC via PC Remote Access Remote Access options Use the options to set display options and refresh rate. Note The Zoom option can be activated only if you select Hide Keys. Zoom cannot be used with or V280 controllers. Improving Remote Access run times: Cache files enable Displays to load more quickly. These files enable Remote access to refer to HMI elements stored in the PC, instead of taking them from the PLC. If you have been provided with a static HMI file, select it to improve Remote Access run times. Monochrome Vision only To use a temporary memory cache during a session, select Project> Cache from the Build menu. The HMI cache files are in.ura format. To create a.ura file containing static displays, select Export Displays to 68 VisiLogic: Getting Started

71 Remote Access Remote Access: Accessing a PLC via PC Color Vision only The static HMI files are in.urc format. Such files can be created in Remote Access by selecting the option Create Fonts and Images (*.urc) from PLC shown in the following figure. The.urc file may include either fonts, images, or both. However, note that if the.urc file does not include graphics, Remote Access will not display images. Note When Remote Access creates a.urc file, the Vision enters ‘System Mode’; the PLC continues running while displaying a system image. The HMI application is not visible. In addition, note that an interruption in communications may leave the PLC inaccessible. In this case, the PLC may require reset, which requires an operator to be physically present near the PLC. VisiLogic: Getting Started 69

72 Utilities: an Overview Utilities Utilities Utilities: an Overview Vision controllers offer a broad range of utilities. Some utilities are internal to VisiLogic, some are provided by external software tools that may be freely downloaded from the Unitronics website. This section describes general functionality. For complete information, refer to the manual VisiLogic Utilities. VisiLogic Utilities SD Cards Enhanced Vision controllers support SD cards. The V570 supports standardsized SD cards; V130, V350 and V1070 support micro SD cards. In the V570 series, the slot is located at the top of the controller; in V130, V350 and V1070 the slot is located on the right side. What can I do with an SD card? «Clone» a complete PLC, via Information mode or via SD Clone Ladder elements. SD Ladder Functions enable you to read/write data between an SD Card and PLC memory operands, including blocks of file data, Data Tables, and Trend data. Store Alarms History on SD. Use Information Mode or SD Clone Ladder elements to upload/download OS firmware and compressed VisiLogic Applications, Data Tables, and operand values to/from an SD card, and to backup and even completely ‘clone’ a PLC. Use Unitronics’ SD Card Explorer, included in the SD Card Suite, to transfer SD files from PLC to PC—or, if the PLC comprises an Ethernet card, send files via attachment. View and execute files on the PLC display via the HMI element SD Browser. Host complex Web pages using the program in the.zip file located at: Use the tools in SD Card Suite to: — Format the SD Card. — Convert, view, and read/write the data to/from PC. — Export that data to Excel or as an.csv file. — Remotely view, open, copy, or delete SD card files via serial, CANbus, or Ethernet. This standalone software is available from: 70 VisiLogic: Getting Started

73 Utilities Utilities: an Overview Data Tables You can store data into the Data Table memory section of your controller, then access the data in accordance with program requirements. They are useful in implementing Program Recipes, a collection of ingredients or values that are used to prepare a batch of product or to perform a specific task. Data Tables can be used to contain parameters for pre-programmed recipes.vision controllers can contain up to 120K of Data Tables (RAM); Data Tables (that are marked Part of Project) can take up to 192K (Flash) in V230/260/280/290. You create tables in VisiLogic, define their structure, then download them to the controller. Data within the tables can be copied and pasted to and from third-party tools such as Excel. You can also store Data Tables or log lines from them onto SD Cards. Note Data Tables are based on bytes, not on registers. Data Table sections that are marked Part of Project: the data are downloaded with the project, and burned into the Flash memory. You can use this feature to preserve certain, unchanging data, such as lists of names or recipe data. A Data Table marked as Part of Project cannot be copied to an SD card. Data tables consist of columns and rows. VisiLogic: Getting Started 71

74 Utilities: an Overview Utilities String Library Use String Library to store text strings within the controller’s FLASH memory, and then display them on the controller’s LCD. You can, for example, organize text into different String Libraries for example, separate libraries for Spanish, English and Italian pull strings into HMI objects, and then switch libraries to change the display language. These strings can be displayed in the following HMI elements: Frame Button Fixed Text String Libraries also provide the text for Alarms, and can be used in Trend Curve Properties. There are: 16 String Libraries containing up to 1024 strings each. You can change the library default names. Via String Library> File, you can opt to use only 4 or 8 libraries; in this case the total number per library is 2,046 strings. Note that each library contains sections in the 3,000 range, that are greyed’; these are reserved for system use. Each string can contain up to 128 characters. The total memory capacity for all String Libraries is 64K. This feature is not available in Standard Vision controllers. How String Library works Only one library is active at a time. This means that at any given time, all elements that pull text from a library are using the same library. However, each HMI element may be linked to a different line ID # within that String Library. In the following figure, the buttons are linked to different text lines. Each time a different String Library is called, the button text changes. 72 VisiLogic: Getting Started

75 Utilities Utilities: an Overview Alarms An Alarm is an event that is reported to the machine operator via a set of built-in displays. The event is a change in the Alarm s Trigger condition, which may be linked to either a Boolean or a numeric value. An Alarm can: Show Alarm status Report the event to the machine operator Provide instructions Require operator action Play an active role in the conditions enabling the running of the process In VisiLogic, you use the Alarm Configuration utility to create Alarms and set their features. The Ladder application determines when the Alarms are displayed on the controller s screen. Vision controllers support Alarms according to the following table: Vision Type Number of Alarms Number of Alarms in History V V V Alarms may be divided into up to 16 groups, per application. While the Alarms displays are on the screen, the PLC application continues to run. This includes both the Ladder, including subroutines, and the HMI application. This means that the current HMI display, the one on the screen when the PLC enters Alarms, may not be the same one displayed when the PLC exits Alarms. VisiLogic: Getting Started 73

76 Utilities: an Overview Utilities Note This feature is not available in Standard Vision controllers. Web Server Enhanced Vision controllers can host web pages. The controller must comprise a TCP/IP port, and must be connected to an Ethernet network. If the controller contains web pages, a remote user can enter the IP address of the controller into a web browser and view the pages. You can also host complex Web pages using the program in the.zip file located at: Unitronics’ Software Utilities These utilities can be freely downloaded from Remote Operator Remote Operator enables you to use a PC to view and work with a remote controller’s HMI panel. You can define any number of controllers, then open multiple sessions to view them simultaneously, while docking or cascading windows according to your preferences. During a session, the remote controller is displayed, on-line, on your PC screen. You can press keypad keys and touch-screen objects of: Stand-alone controllers that are directly connected to the PC via a cable. Controllers within a network. Devices with IP addresses, via Ethernet. This utility can be used with Vision, M90/91, and Jazz controllers Remote Access: Stand alone Utility: The stand-alone utility Remote Access runs independently of all other software, and can access Vision, M90/91, and Jazz controllers. In addition to using any supported communication channel to remotely access the controller and its HMI display, the Remote Access package includes additional utilities: UniDownloader Designer Operand Access Data Tables SD Suite The SD Card Suite contains several applications that you need to work with SD cards: Tools Includes the Card Formatter (note that a card must be formatted before use), the HTML Compiler for webpages served from the SD, and the Fill Time Calculator which enables you to determine how long your application will take to fill up the SD Card. 74 VisiLogic: Getting Started

77 Utilities Utilities: an Overview SD Card Explorer Use a PC to access, read and write files on an SD Card that is installed in a Vision controller SD Card Manager Import SD files: Trends, Logs, Alarms, and Data Tables, view them, and export them to Excel or.csv files. Data Tables Editor View, export, and edit Data Table files. DataXport DataXport creates logs of run-time or stored data from Data Tables and operand regions within Unitronics PLCs. DataXport saves the data logs in.ulp format. You can open these data logs using DataXport’s companion application, DataXls, and then export the data to Excel files.. Via DataXport, you can: Log data according to a date/time-based schedule. Simultaneously log data from one or more Unitronics PLCs. Access PLCs and log data via a direct, network, or modem connection. UniOPC Server UniOPC Server (Unitronics OPC Server) enables you to read and write data between Unitronics PLCs and applications that support OPC, such as SCADA programs. UniOPC Server is compliant with the OPC Foundation’s Data Access Custom Interface Standards through to Version UniOPC Server runs independently of other Unitronics software. UniDDE UniDDE (Unitronics Dynamic Data Exchange) enables you to read and write data between Unitronics PLCs and applications that support DDE, such as Excel. Although it is installed as part of the VisiLogic Setup, UniDDE runs independently of other Unitronics software. UniVision Licensing You can create a PLC license number and burn it into a secured, hidden sector in the PLC. You can then use this license in your Ladder to control how your program functions. VisiLogic: Getting Started 75

78 Creating Project files (.dvi,.vdf,.urc,.ura) Tools Tools Creating Project files (.dvi,.vdf,.urc,.ura) Project files contain application data in compressed format. There are several kinds of files. Clone Files: These can contain complete applications in compressed format, including Ladder and HMI applications and OS. Clone files are very convenient for OEMs, or for those wanting to ‘Clone’ a PLC and its application. These files can be created in VisiLogic as well as via SD Clone Ladder functions or in Information mode. Project Files: UniDownloader Designer These files include both the Ladder and HMI applications, Data Tables, and an Upload file. -Standard Vision:.dvi files -Enhanced Vision:.vdf Note that the DownLoader files you create here are compatible with UniDownloader and later; provide your users with the correct UniDownloader version. Cache files: Remote Access and Remote Operator These are compressed HMI Displays. They improve Remote Access reaction times, and must be used to display graphic images when using Remote Operator. — Monochrome Vision (.ura files) A.ura cache file enables Remote Operator to load Displays more quickly. Note that V130, which loads displays quickly, does not use.ura files.) — Color Vision (.urc files). If a.urc is not used, images are not displayed and fonts may be distorted. A cache file includes fonts, and can include images. If the file does not include images, a red ‘X’ displays in place of graphics. To create Project files: 1. Click on the Project menu and select Create Project files. 2. Select the appropriate tab and follow the on-screen directions. 76 VisiLogic: Getting Started

79 Tools Creating Project files (.dvi,.vdf,.urc,.ura) Notes.cxx Files PLC Unique ID Each PLC has a unique ID number, which is shown in SDW9. Use this number to restrict a program to a particular PLC. Password: This is assigned to the SD Card via the Set SD Card Password function. Both the controller you use to make the download file (source), and the controller that is installed with the file (target) should be installed with the same OS Version. To avoid errors in the file, the creation process must run smoothly, without being aborted or affected by PC faults. Checking the integrity of the.dvi file Although you do not need to have Remote Access installed on your PC in order to create.dvi files, you need to install it in order to check.dvi files. 1. After you have created the.dvi file, save the project from which it was downloaded. 2. Open a new, empty project and download it to the controller. 3. Start Remote Access and select the appropriate Vision model. 4. Click on the Project Downloader which is located on the Remote Access Tools menu. VisiLogic: Getting Started 77

80 Project Properties Tools 5. Navigate to the.dvi file and download it into the controller. 6. Reopen the original Ladder project used to create the.dvi file. 7. Select Verify from the Controller menu; the Verify process will compare the project in your PC with the.dvi application installed in the controller. If the Verify process is successful, the.dvi file is valid. UniDownloader Designer The UniDownloader package enables you to build a complete, compressed project and send it anywhere to be installed in a PLC using a standalone downloader. Your end user will be able to download the application, but will not be able to view or modify it. The tool can download applications and OS. The package comprises the UniDownload Designer, located on the Tools menu, and the UniDownloader, available as a separate download from To learn about UniDownloader, click on the Tools menu in VisiLogic, U90 Ladder, or Remote Access, select UniDownloader Designer, and then access the UniDownloader Designer Help. Project Properties This is located on the Project menu. Click on the tabs to view and edit the various properties. General (includes Project Password) 78 VisiLogic: Getting Started

81 Tools Project Properties Note Password security restriction: if a PLC operator enters a wrong password 9 times, the PLC automatically disables program upload for that program. Resetting the PLC will enable you to try another 9 times. The limit set on password entry is intended to provide an additional layer of security. For example, this can prevent a hacking script from entering a networked PLC, since the number of attempts is limited and such a script would not reset the PLC. Download VisiLogic: Getting Started 79

82 Project Properties Tools Parameters Function Disable Project upload If you select this, no user will be able to upload the project from the PLC, even with a password. Rebuild, then Download Select this if the project was originally created in another VisiLogic version. Warn about Vision 120 Snap-in conflicts This option is checked by default, causing, VisiLogic to issue a compilation warning message if the Vision120 selected in Hardware Configuration is different from the one to which you are downloading. Uncheck this option to disable such warnings. Compiled Ladder Allocation If your application requires, you can select this option and enter a different amount. Back up and Restore PLC RAM Data Backup a project together with all of the current values in Data Tables and all memory operand values. If this option is selected: At project upload, the PC will upload all of the current values in Data Tables and all operands—except for system operands. To back up system operand values, store them to memory operands. At project download, the PC will download the complete project, including all of the current values in Data Tables and all memory operands. Note that this option is not part of the project. It affects all the projects downloaded from the PC. Save Unit ID in Project When you select the Save Unit ID option, the ID number of the controller selected in Connection>Communication & OS>Vision-PC Communication Settings is saved together with the project. You will not be able to download the project to another controller until the number is changed. Display OnLine Tools Keeps the Test Tool bar from being displayed during Test Mode. Check Digital Signature Select this to check the digital signature of the project in a PLC every time PC- PLC connection is established. 80 VisiLogic: Getting Started

83 Tools Project Properties Ladder Parameters Function Auto-extend Adds 5 grid points to each net, following the bottom edge of the lowest Ladder element. Mouse wheel, Scroll Bar Resolution Customizes resolution of Page Up / Page Down. Auto Horizontal, Auto Vertical Placing Defines the number of grid points that activate auto-snap. Auto-snap causes an element that is placed in the Ladder to snap to the output of the previous element in the rung. Hot keys Link frequently used functions to short-cut keys. VisiLogic: Getting Started 81

84 Digital Signatures Tools Color You can assign any color to show power flow during Test mode. Digital Signatures View Digital Signatures by clicking the View menu and selecting Show Signature Log. This project security feature can enable Vision PLCs to meet standards in niche industries such as pharmaceuticals. The log: Records changes made in a project. 82 VisiLogic: Getting Started

85 Tools Operand View Tracks the last projects downloaded to a PLC. Enables you to save the signature log within a VisiLogic project. Compares the signature of the project to the signature of the last project that was downloaded to the PLC. Operand View Use the Operands tab in the Output Window to see if operands and I/Os are used in a program, assign power-up and preset values, view current values when you run Test mode, change formats, assign descriptions (symbols), and view and edit Watch Folders. You can also view Project Optimizer results. VisiLogic: Getting Started 83

86 Hotkeys: Quick Editing Tools Hotkeys: Quick Editing VisiLogic offers keyboard shortcuts for a number of tasks, including Ladder editing. You can also assign certain tasks to keys F3 and F4 via Program Properties. Note Selected Ladder elements can be moved within a net via the keyboard arrows. Task Ladder Pressing the appropriate key attaches the element to the cursor; click to drop it into the net. Once a Ladder element is placed in the net, the user can typed the operand name and number, for example SB41, and then press Enter. Note Selecting an element and pressing < Fn> attaches the new element to the one selected. Hotkeys Insert Direct ( N.O.) Contact <F5> Insert Indirect N.C.) Contact <F6> Insert Positive Transition Contact <F7> Insert Negative Transition Contact <F8> Insert Direct Coil <Shift> + <F5> Insert Indirect Coil <Shift> + <F6> Insert Set Coil <Shift> + <F7> Insert Reset Coil <Shift> + <F8> Within Operand Address Box Get Next Address <Ctrl> + <N> Symbolic Search <Ctrl> + < L> Go to Label This enables to you skip from label to label. Note that labels can be used both as bookmarks as well as to cause program jumps. Toggle to Hex (when entering Constant value) Next Label Previous Label <Ctrl> + <H> <Alt> + <Right Arrow> <Alt> + <Left Arrow> Open Label Navigation <Alt> + < L> Help Open Help <F1> Project New Project <Ctrl> + <N> Open Project Print Project <Ctrl> + <O> <Ctrl> + <P> Exit Project <Alt> + < Q> Edit Select All <Ctrl> + <A> Find <Ctrl> + <F> View Toggles Show/Hide Project Explorer <Ctrl> + <R> Show/Hide Ladder <Ctrl> + <Alt> + < L> Show/Hide HMI Display Editor Show/Hide Output Window Show/Hide Comments <Ctrl> + <Alt> + <H> <Ctrl> + <W> <Alt> + <C> 84 VisiLogic: Getting Started

87 Tools Watch Folders Connection Online Test <F9> Download Upload <Ctrl> + <D> <Ctrl> + <U> Verify <Ctrl> + < Y> Remote Access (During Online Test) <Shift> + <F9> HMI Show Grid <Ctrl> + <G> HMI Variables Zoom Approve a Variable (when required links are filled) <Ctrl> + <I> <Ctrl> + <Enter> + <Enter> Watch Folders Watch Folders enable you to: Arrange related groups of operands in folders. Name the folders. View these operands in the tabbed Output Window at the bottom of the screen. If you are connected to a PLC, you can enter On-line Test Mode to see real-time operand values. To view a Watch folder, click the Watches tab at the bottom of the screen, then select the desired folder. Edit the folder by right-clicking a line, then selecting the appropriate function. Adding Operands to a Watch Folder from a net To add a single operand to a Watch folder, right-click it in the Ladder or in the Operand Output Window. VisiLogic: Getting Started 85

88 Memory Tab Tools To add all of the operands within a net to a Watch folder, right-click the left-hand rail of the desired net. Memory Tab Memory enables you to view a vector according to the length you set and in ASCII, HEX, Binary, or Decimal format. 1. Click on the ‘Memory’ tab in the Output Window at the bottom of the VisiLogic screen. 2. Right-click in the window to add rows. 86 VisiLogic: Getting Started

89 Tools Find (& Replace) 3. Click in the Operand column to link operands. 4. Click in the Length column to assign a vector. 5. Click in the Size column to select 8, 16, 32 bits. 6. Click in the Format column to select ASCII, Binary, Hex, Decimal. 7. Enter Online Test Mode. When ASCII is the selected format, you can click a line and force a string to the vector. Note that to force the value, you must click the ‘eyeglass’ symbol in the On-line window. Find (& Replace) Highlight an operand or Ladder Element and press <Ctrl> + <F>; the results will be displayed in the Output window at the bottom of the screen. Highlighting a function and pressing <Ctrl> + <F> will open a dialog box, enabling you to select the desired operand. In addition, right-clicking most program elements will display the Find button. In addition, VisiLogic offers the following Find functions: Find Use Find to locate operands, labels, subroutines and Displays. VisiLogic: Getting Started 87

90 Find (& Replace) Tools You can also right-click an element or subroutine to display the Find icon on the rightclick menu. Notes Labels: Clicking on a found ‘Label’ will list the Jump to Label linked to that label in the Output Window. Find Element The Find Element utility enables you quickly locate any element that is used in a project. 1. Select Find Element from the Edit menu; the utility opens. 2. Click the desired element type in the left pane, then select the element from the right and click OK. You can select more than one element by holding the CTRL key down and clicking the desired elements. Find & Replace Operand The Find & Replace Operand utility enables you quickly replace any operand or vector of operands that is used in a project. 1. Select Replace Operand from the Edit menu; the Replace utility opens. 2. The Select Operand box opens; select the Source and Target operands. 3. To restrict the Replace operation to a specific subroutine, click the Subroutine field to open the selection box, then click the desired subroutine. 4. To replace a vector, enter its length. 5. To copy the operand descriptions, power-up values, and formats, select Copy Properties; select Clear Source to remove these from the source operands. 6. Click OK; the operands are replaced. In the following figure, running the Replace function replace all instances of MB 100 in the Subroutine Fault Message with the operand I VisiLogic: Getting Started

91 Tools Find (& Replace) Find FB Find FB enables you to locate the FBs in your project. Find Font This enables you to find fonts used in HMI Displays. VisiLogic: Getting Started 89

92 Find (& Replace) Tools Finding a Load Display Target 90 VisiLogic: Getting Started

93 Tools Find (& Replace) Finding a Call Subroutine Target Go To Label To find Labels, use Go To Label <Alt> + <Right/Left arrow> and List of Labels <Ctrl> + <L> utility. Find Constant Value To find Constant values, either: Click on the Constant, then press <Ctrl> + <F>; the results appear in the Output window. VisiLogic: Getting Started 91

94 Search: Symbolic Name Tools Start Find, select the Constant tab and enter the value, then press OK ; the results appear in the Output window. Search: Symbolic Name Use Search: Symbolic Name to find operands by description. Within the Select Operand box, this is activated via <Ctrl> + < L>. 92 VisiLogic: Getting Started

95 Tools Deleted Unreferenced Operands Deleted Unreferenced Operands To help manage your project, you can delete unreferenced operands. Print Project Print Project is located on the Project menu. Via the Print dialog box, you can print various aspects of your project. Print Preview is also offered. VisiLogic: Getting Started 93

96 System Images Tools System Images You can customize your application by replacing system images, such as the Unitronics’ Splash Screen, and the Unitronics’ icon that appears in Information mode, with you own custom images. 1. On the Project menu, click System images. 2. Click on the desired image, click on Replace Image, and navigate to your custom image.. 94 VisiLogic: Getting Started

97 Tools Converting Projects Notes You can restore default System Images by clicking on the appropriate button You can replace the virtual keypad images; however note that the touch locations for the keys will not be changed from the default. Converting Projects If you open a project based on a Vision with a monochrome LCD screen, VisiLogic provides the following utilities on the Project menu: Convert to V130 Use to convert a project based on the V120 to V130. Monochrome to Color Use to any project based on a monochrome LCD to color, such as V290 to V570. Import/Export Subroutines You can export Subroutines and save them as.vlx files, then import them into other projects. You can import/export single Subroutines, or all of the subroutines in a Module. Note that you cannot export Subroutines from the Main Module. Exporting a single Subroutine 1. Right-click the desired Subroutine and select Export Subroutine, -orselect Export Subroutine from the Project menu; the Select Subroutine box opens. 2. Select the desired subroutine, then save it to the desired folder. VisiLogic: Getting Started 95

98 Import/Export Subroutines Tools Exporting all of the Subroutines in a Module 1. Right-click the desired module and select Export All Subroutines. 2. Save the.vlx file to the desired folder. Import Note that when you import this.vlx file, all of the Subroutines it contains will be imported. 1. Right-click a module name and select Import Subroutine, -or- Select Import Subroutine from the Project menu; the Open box appears. 2. Select the desired subroutine, then save it to the desired folder. 96 VisiLogic: Getting Started

99 Tools Import/Export Subroutines Import/Export is subject to the limitations below. 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 an FB operation related to an FB Configuration, and is imported into an application containing an FB Configuration of the same name, the links will be retained. If, for example, you export a subroutine containing an SMS Send FB linked to SMS Configuration ‘Denmark’ and then import this subroutine into another application containing an SMS Configuration ‘Denmark’, the SMS Send FB will automatically link to ‘Denmark’. 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. 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. VisiLogic: Getting Started 97

100 Verify Project Tools In this way, VisiLogic maintains the integrity of the links between Jumps and their corresponding Labels. Note that the following symbols cannot be used in subroutine names: / \ * :! » < >. In addition, please note that a name may not include a period followed by a space (for example My. Subroutine). When importing/exporting from older VisiLogic programs containing such symbols, they will be automatically replaced by underscore characters. Verify Project The Verify utility shows the differences between the project open in your PC and the program currently installed in the controller. To use Verify: 1. Connect your PC it to the controller using a program download cable 2. Select Verify from the Connection menu. Verify marks different sections with an, as shown below. 98 VisiLogic: Getting Started

101 Tools Compile Compile To test your project, compile it. 1. Select Compile from the Build menu. 2. After compiling the project, VisiLogic displays errors in the Output Window. Clicking the Compile tab displays the last compiled results. Compilation Error Message #37 Message # 37 is displayed when a V xx is selected in the project’s Hardware Configuration, and the project contains a function that is not supported by that model. Project Optimizer Run the Optimizer to view a list possible improvements that you can make in your project. In the results window, double click a line to jump to the appropriate location in the project. VisiLogic: Getting Started 99

102 Log Tools Log To view a log of events, click the Log tab at the bottom of the Output Window. 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. Power-up Modes: Trouble-shooting You can force the controller to boot up into Bootstrap(OS, BIOS) or Stop mode (hard reset) by turning on the power supply while pressing specific keypad keys. 100 VisiLogic: Getting Started

103 Power-up Modes: Trouble-shooting Tools V350/290/530/ 570/V1040 (touchscreen) V280 V230/260 V120/130 EX-RC1 Possible Actions Features Mode Turn the PLC off. Enter Bootstrap mode by touching the screen and maintaining contact while turning the power on. Bootstrap version V2.00 and up — If no action is taken, the PLC enters Run mode after several seconds. <I> + <Right Arrow> <I> + <Right Arrow> <I> + <ESC> Move all DIP switches to 1 -Via Vision Communication PC Settings, you can: Check which OS is currently installed in the controller. The controller’s LCD is on. PC-PLC communications are enabled, but PC must b t d t COM 1. Bootstrap Turn the PLC off. Enter Bootstrap mode by touching the screen and maintaining contact while turning the power on. Enter Stop mode by pressing the screen once. Note Visions embedded <I> <I> <I> Move all DIP switches to As above, but all Info mode actions are supported. Exit Stop Mode by entering Information As in Bootstrap, but Info mode can be entered. Stop (O/S) <I> + <Right Arrow> + <+/ > <I> + <ESC> + <+/-> Contrast range is 0-100, this option automatically sets Contrast to 50. Bootstrap, default LCD contrast <I> + <+/-> <I> + <+/-> Contrast range is 0-100, this option sets Contrast to 50. Stop (O/S, default LCD contrast 101 VisiLogic: Getting Started

104 Memory Allocation Tools Memory Allocation You can check the flash memory requirements of a project via Projected Memory Allocation, which is located on the Build menu. You can also view the current allocated flash memory of a controller via PLC Flash Memory Allocation, which is located on the Connection menu. Note Vision uses dynamic memory allocation. 102 VisiLogic: Getting Started

105 Tools Memory Allocation Ladder Code Capacity The table below shows how much memory is allocated for the Ladder code; note that an additional sector comprising double that amount is allocated for compiled Ladder code. Controller Model Ladder Code Compiled Ladder Code Total V230, V260, V280 64K 128K 320K V120 32K 64K 192K During download, Ladder code is compiled into machine code. The compiled code may exceed the memory that is allocated for compiled Ladder code. If the allocated memory is exceeded, the message below will appear at download. Note If the second download attempt is not successful, the message will be displayed again. If this occurs, contact technical support. VisiLogic: Getting Started 103

106 Detecting Short-circuited End Devices Appendix A: Troubleshooting Appendix A: Troubleshooting Detecting Short-circuited End Devices The controller can detect short circuits in end devices (loads) that are connected to transistor outputs located on snap-in or expansion I/O modules. If a short circuit is detected on either an expansion or snap-in I/O module, SB 5 turns ON. If the short circuit is located on an: I/O expansion module, the location is indicated in SDW 5. Snap-in I/O module, the LSB in SDW 6 turns ON. SDW 5 provides a bitmap. Each I/O expansion module included in your controller’s hardware configuration is assigned a number, 0-7, according to its place in that configuration. In the bitmap, bits 0-7 correspond to these place numbers. In the bitmap below, short circuits have been detected in devices that are connected to expansion modules 1 and 3. SDW 5 Please note that although an SW is 32 bits long, only 16 bits are shown below. Positive Transition Contact ( Rise ) A Positive Transition Contact gives a single one-shot pulse when the bit operand it is linked to rises from OFF (logic 0) to ON (logic 1).A Negative Transition Contact gives a single one-shot pulse when the bit operand it is linked to falls from ON (logic 1) to OFF (logic 0). You can link them to any of the following bit operands: Memory Bit System Bit Output Timer Counter 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. 104 VisiLogic: Getting Started

107 Appendix A: Troubleshooting Positive Transition Contact ( Rise ) At the end of a scan, the Positive Transition Contact is reset to ON (logic 1). The Positive Transition Contact is re-activated when the linked signal turns from OFF to ON. Note Execution time for Positive and Negative Transition contacts is considerably greater than the execution time for direct and indirect contacts. However, you can decrease the amount of transitional contacts in your program. Decreasing the Number of Transitional Contacts You can use the coil of a bit operand to save the positive transition of a contact, and then use the direct contact of the operand in your program. You can use the Direct Contact of SB 13 instead of using the Positive Transition Contact of SB 3, and the Direct Contact of SB 15 instead of using the Positive Transition Contact of SB 7. SB 3 is a pulse generator, with a cycle time of 1 second and a duty cycle of 50% (0.5 seconds ON, 0.5 seconds OFF). SB 13 is the Positive Transition (rising edge) contact of SB 3. SB 7 is a also a pulse generator, with a cycle time of 0.1 second. SB 15 is the Positive Transition (rising edge) contact of SB 7. Rise/Fall Usage Summary The maximum number of Rise/Fall elements that is allowed in a project depends on the controller model. To ascertain how many elements of each type are in the project, use the Rise/Fall utility on the View menu. The sum of the results must not exceed: V ( ) VisiLogic: Getting Started 105

108 Positive Transition Contact ( Rise ) Appendix A: Troubleshooting V ( ) V ( 0 511) V2xx 256 ( 0 255) If a program exceeds this number, Error 1017 results. However, in certain cases, the actual compiled number of Rise/Fall elements is greater than the total that is shown in the Summary. Examples are shown below. Example 1 Example VisiLogic: Getting Started

109 Appendix A: Troubleshooting Positive Transition Contact ( Rise ) VisiLogic: Getting Started 107

110 I/O Expansion Module Errors Appendix A: Troubleshooting I/O Expansion Module Errors An interruption in communication between an I/O expansion module and controller can cause the controller to enter Stop Mode, and an Expansion Error message to be displayed on the controller s LCD. This error results when: 1. The module was connected at power-up. 2. The communication between module and controller was interrupted for more than 200 milliseconds. Interruptions may occur if the connecting cables are disconnected, or may result from signal interference (noise). Note When a controller enters stop mode, the program stops running and all outputs within the system are initialized. This includes on-board outputs, outputs located on Snap-in I/O modules, and outputs located I/O expansion modules. What to do Check that the cables are connected and in proper order. Remedy signal interference. Such an error may also result from a hardware malfunction. If the RUN LED on the expansion module blinks, check the documentation supplied with the expansion module to see if a hardware error is indicated. To exit Stop Mode, reset the controller either by turning it off and on, or by entering Information Mode, and then selecting System>Working Mode> Reset. Analog Input Values: Out of Range Expansion modules If an expansion module’s analog input is receiving current or voltage in excess of the absolute maximum rating, the corresponding Out Of Range indicator lights up. IO-AI4-AO2 Analog value: from 0 to 4095 (12 bit). If the analog input is: below 0V/0mA, then the analog value will be 0. above 10V/20mA (about 2% above the full scale), then the analog value will be IO-ATC8 Analog value: from 0 to (14 bit). If the analog input is: slightly below 0V/0mA (about 0.5% below 0V/0mA), then the analog value will be -1. slightly above 10V/20mA (about 0.5% above the full scale), then the analog value will be If the analog input is greatly below or above of the analog input range,but still within the range of the absolute maximum rating, then the analog value will be VisiLogic: Getting Started

111 Appendix A: Troubleshooting Compile Vision models V R1, V R2C, V E1, V E1B and V E2B Analog value: from 0 to 1023 (10 bit). If the analog input is: Below 0V/0mA, then the analog value will be 0. Above 10V/20mA (about 2% above the full scale), then the analog value will be V UN2, V UA2 Analog value: from 0 to (14 bit). If the analog input is: Slightly below 0V/0mA (about 0.5% below 0V/0mA), then the analog value will be -1. Slightly above 10V/20mA (about 0.5% above the full scale), then the analog value will be Greatly below or above of the analog input range, but still in the range of the absolute maximum rating, then the analog value will be Note that the absolute maximum rating of the analog inputs for all the units is +/- 15V. Compile To test your project, compile it. 1. Select Compile from the Build menu. 2. After compiling the project, VisiLogic displays errors in the Output Window. Clicking the Compile tab displays the last compiled results. Compilation Error Message #37 Message # 37 is displayed when a V xx is selected in the project’s Hardware Configuration, and the project contains a function that is not supported by that model. VisiLogic: Getting Started 109

112 Compatibility: HW, OS, SW Appendix A: Troubleshooting Compatibility: HW, OS, SW Both the OS that runs the PLC and your current software version must support the hardware, such as I/O Expansion Modules, that you use in your applications. Note that there is a list of OS changes in the Downloads Section of the Unitronics web site: Hardware V E4XB Supported by OS Supported by VisiLogic Version Version 4.00 Build V120-2-R34 V4.50 B V xxx Unsupported Features These are older V120 models which cannot support certain recent features. These features are supported by the V xxx series. V xxx is no longer supported, in released version VisiLogic 4.7.4, OS 470 (06), and later. Unsupported Feature FBs FB features Trends Draw Axis Accelerate Remote PLC DataCom GPRS BAS Protocol: floating values MODBUS: Read/write mixed data commands, Read/write tables Communications Ladder Functions UNICAN DataCom Data Tables: Find Row Extended, Read/write Column, Copy Row and Copy column, Clear Row and Clear Column Vector: Struct, Swap bytes, Sort, Copy memory (MF) Math: Formula Vector: Linearization Store: BCD to Num, Num to BCD 110 VisiLogic: Getting Started

113 Appendix A: Troubleshooting Compatibility: HW, OS, SW Strings: Mac address to ASCII, Time to ASCII, ASCII to Num, Logic, RLO to Bit, Set/Reset Bit (SI, SL, SDW) More: Immediate: Write to Physical Analog Output, Debug: Interval HMI Previous Variable, Clear rectangle HMI Features General features COM Port 2 SBs SIs Clock variable-utc Enter ASCII String via Keypad Shape Graphs Draw Static Axis Moving image Interrupt: High speed counter, Interrupt 2.5mSec Does not support a baud rate of bps SB13, ON at Rising Edge of SB3 (1sec pulse) SB15, ON at Rising Edge of SB7 (100mS pulse) SB23, Enable all HMI keys during Keypad Entry SB26, Exiting OS Draw Mode (ON for 1 cycle after OS draw) SB27, Enter Display without active Keypad Entry Variables SB29, Current keypad entry sets SB 30 (HMI keypad entries complete) SB36, INFO mode SB37, Exclude Last Viewed Display from FIFO SB38, Invert Touch screen element pixels (Text, images) SB54, Key <i> SB102, MODBUS Read Long: Transpose 16 bits of 32-bit long SB279, Send SMS message in ASCII format (ON sends ASCII) SB280, Force Message Display on Cell Phone SB300, Reset PLC SB501, Retain Inputs Forced Value after power failure SI40, Touch screen is being touched — X coordinates SI41, Touch screen is being touched -Y coordinates SI50, INFO delay time (default 4 seconds) VisiLogic: Getting Started 111

114 Updating Project Versions Appendix A: Troubleshooting Updating Project Versions Opening a project created in a previous version of VisiLogic enables you to update the project. Please note the following: If you open the project with the new version, but do not save it before closing it, no changes are made to your project. VisiLogic automatically creates a backup file of the project you are updating. This file is located in the project directory. This backup file does not have the.vlp (VisiLogic) file extension. In order to open the backup, you must change the file extension to.vlp. You can also save the original file by opening the project, and then performing File>Save As, assigning the new file a different name. In order to deliver a high level of service, Unitronics issues software service releases that fix known issues. However, in some cases, users develop workarounds for these issues. If you have developed a workaround in your project, and then update to a VisiLogic/OS version that fixes the original issue, your workaround may not function as you expect. Known Issues: Version Incompatibility Certain versions have changes that may impact on the running of an existing application if you update the OS in the PLC. V xxx is no longer supported, in released version VisiLogic 4.7.4, OS 470 (06), and later. Previous to Version Version 4.00, Build 00 Call Display function Any contact could be used to trigger a Call Display function to call and load a display. After Version A positive transition contact, or the rising edge of a contact such as SB 7 100mS Pulse is required to trigger a Call Display function. PID function VisiLogic versions older than 4.00 contained a PID function. This function has been replaced by the PID FB, which offers Auto-tune plus other advanced operations. If you open a project which implemented PID using the older PID, you will receive the following error message: «This project contains X number of outdated PID loops. Using outdated PID limits you to 4 PID loops. For more information, please click on the Help button below.» Although older projects will function, it is recommended that you update these projects, replacing the PID function with the PID FB. Please note that 112 VisiLogic: Getting Started

115 Appendix A: Troubleshooting Updating Project Versions V continues to support the older PID function, continues to support up to 18 PID loops, but does not support the PID FB. Set PLC Name function Set PLC Name was not required in TCP/IP applications. Version 4.00, Build 10 Set PLC Name is required in TCP/IP applications. Read \ Write Column Data Tables function The function was not FIFO-based. The function is now FIFO-based. If For example, assume the Data the Data Table has 10 rows, and the Table has 10 rows. If the Read Read Column function is pointing at Column function is pointing at Row Row Number 3, and the Number of Number 3, and the Number of Rows to be read is 10, the function Rows to be read is 10, the will read the last 7 rows of data, and function would read only 7 rows of also automatically read the top three data. rows, for a total of 10 rows of data. Version 4.00, Build 15 Display String function Any change in the status of the refresh bit could trigger Display String. Only the rising edge of the refresh bit can trigger Display String. Version 4.00, Build 22 MODBUS slave addressing As of this version, the Slave addressing scheme for Timer / Counter, Current and Preset, was changed. Version 4.00, Build 23 SB 250 Keypad entry within limits, SB 251 Keypad entry exceeds limits These SBs would turn ON, and remain ON. They would turn OFF only after the display was fully loaded. Touch-screen PLCs: Touch elements Bits related to touch-screen elements were not reset at power-up. Version 4.50 When: -a project containing graphics was originally written using a VisiLogic version lower than 4.00, -and then saved using a version between V4.0X -V4.50, -and then reopened in VisiLogic 4.50 or higher, certain images may not display correctly. Such images may have to be reinserted in order to ensure These SBs now turn OFF either when: The current Display is either recalled or changed, or At the beginning of the next program cycle. Bits related to touch-screen elements are now reset at powerup. VisiLogic: Getting Started 113

116 Updating Project Versions Appendix A: Troubleshooting correct display. Version 4.50, Build 02 Touch-screen PLCs: Display buzzer The buzzer would sound whenever any part of the screen was touched. Version 4.50, Build 06 Display jumps, SB 250 (V290 only) SB 250 could not be used to trigger Display jumps. FB Communication Protocol When messages were received, and data errors were discovered, the datacheck process stopped prematurely. Previous to Version Version 4.7.4, Build 06 Support for V xxx The buzzer now sounds only when touch-screen elements are touched. (V290 only) SB 250 can now trigger Display jumps. Now all messages are checked, regardless of whether any contain data errors. After Version As of this version V xxx is not supported, and does not appear in Hardware Configuration. If you want to edit an older application based on a V xxx, you can use the ‘VisiLogic Version Swapper’, which is part of the VisiLogic installation. The Swapper is located in the Unitronics directory, typically located at: Start>Programs>Unitronics>VisiLogic>VisiLogic Version Swapper. Previous to Version 7.00 CANopen compatibility break The CANopen System Operand addressing scheme changed as of VisiLogic version 7.00, OS 2.00 (Standard Division) OS 5.02 (Enhanced Division). You can choose to continue editing older applications using previous VisiLogic versions contained in the VisiLogic Version Swapper. Note that in this case the controller must use an older OS. However, if you choose to update the application and OS, note that you must change the system operands according to the following table. System Integers System Double Words Old New VisiLogic: Getting Started

117 Appendix A: Troubleshooting Why does the Controller display the ‘Restart’ message? Why does the Controller display the ‘Restart’ message? The most common reason for this event is a peak in electromagnetic (EMF) ‘noise’. This may result from contactors, power relays, solenoid valves, etc. switching on and off, as well as from power transformers and motor speed drivers. Recommendations Use different power supplies — highly recommended — one for the controller (CPU and inputs), and a different one for other electromagnetic devices; Use suppressors — reverse connected diodes for DC loads and RC filters for AC loads; Where possible, place the signal cables, including the 24V power supply, far away from power lines, especially from cables, coming in and out of motor drivers; If needed, use shielded cables for signals, including for 24 VDC and for power cables between the motor driver and the motor itself. Taking these precautions should help prevent ‘ Controller Restart’. If the problem persists, contact support@unitronics or your local Unitronics representative. HMI Element Resizing/Rotating Limitations Elements ‘grow’ down, and to the right. If resizing/rotating 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. When you open an element for editing, and then press OK, VisiLogic resizes the element. If the new size of the element causes Variable elements to collide, or any element to extend beyond the boundaries of the Display, VisiLogic displays an error message: ‘Operation Cannot Be Completed’. Note ‘Original size’ is the actual size of the element as it appears in the element’s ToolTip. VisiLogic: Getting Started 115

118 HMI Element Resizing/Rotating Limitations Appendix A: Troubleshooting 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. 116 VisiLogic: Getting Started

119 Appendix A: Troubleshooting Blank Corner in HMI Display Notes 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. Blank Corner in HMI Display While you download an application, a flashing square or box is present in the upper left-hand corner of the PLC display screen. When the PLC returns to Run mode, you may note that a small square in the upper left-hand corner of the screen is blank. This is part of the normal download process. The screen will recover as soon as the display is refreshed for any reason. 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 440 General Error. The codes are shown below. Value Message Result 3 Integer 7FFF or 8000 (integer result)ffff or 0000(unsigned integer result) Overflow 4 Floating +INF or -INF (float result) Overflow 5 Floating 0.0 (float result) Underflow 7 Divide by +INF or -INF or NaN (float result) Zero 9 Undefined NAN (float result) Float 10 Conversion 0 (integer result) Error 11 Floating point Floating point stack underflow Stack Overflow 12 Floating point Stack Underflow Floating point stack overflow INF Infinite which is the largest absolute floating point number. NAN Not a Number, special notation for undefined floating point number. Changing Panel Types: Conflicts If a project contains Displays, selecting a different panel type in your project’s Hardware Configuration may cause you to lose some of your Display elements and their properties. VisiLogic: Getting Started 117

120 Insufficient Flash Memory Appendix A: Troubleshooting If you select a smaller panel, some of the elements in your Displays may be too large. In this case, any variable, graphic, or text elements that extend beyond the edge of the screen will be deleted from your project, and may not be retrieved. In addition, note that all calendar variables will be deleted. Also, note that if you change from a touch panel to a non-touch panel, any ‘touch’ properties linked to on-screen objects will be deleted. Insufficient Flash Memory This error message is displayed when the PLC does not have sufficient memory to handle the current project. To see the memory requirements of the project, click the Events tab in the Output Window at the bottom of the screen. Error: User Memory Overlap This error generally results because the number of function blocks exceeds the PLC memory capacity. Please review your program, and consider making changes regarding FB operations. In most cases, this can be resolved by deleting a single function block Replacing or Removing the Battery After replacing the PLC battery, initialize the PLC via Info Mode Info>System>Working Mode> Init. Note When you replace the battery, you lose RAM values. Backing up the PLC RAM Unitronics Remote Access PC utility offers the tool ‘Backup PLC RAM’. Using this tool, you can read all PLC RAM values such as Data Tables and register values into an Excel file on your PC, and later write these Excel values back into the PLC’s RAM. Remote Access may be installed from the Setup CD, or downloaded from download.htm 118 VisiLogic: Getting Started

121 Replacing or Removing the Battery Appendix B: Vision Controller Divisions Appendix B: Vision Controller Divisions There are two major Vision divisions, Standard and Enhanced. HMI — Physical differences Division Series Display Keypad On-board I/Os Standard V120 Monochrome Built-in Built-in Vision V230, V260 Monochrome Built-in Via Snap-in I/O Modules V280, V530, Monochrome touchscreen Virtual Via Snap-in I/O Modules V290-BW Enhanced V130 Monochrome Built-in Built-in Vision V350 Color Virtual Built-in V570, V560, V290-C V » Color Touchscreen 10.4″ Color Touchscreen Virtual Virtual Via Snap-in I/O Modules Via Snap-in I/O Modules Communications MODBUS is fully supported by both divisions. However, slave addressing schemes differ. Refer to the MODBUS Help topic Slave Addressing. Modems Standard Vision Division Controllers in this division can only support a single modem. You can connect a modem to any COM port. However, note that SB 184 TX Success and SB 185 TX Failed indicate message transmission status regardless of the actual COM port connected to the modem. Enhanced Vision Division Controllers in this division can support a modem on each COM port. Each port is linked to a Succeed and Fail SB: COM1: SB 184 and SB 185, COM2: SB186 and SB 187, COM3: SB 188 and SB 189. General Features Division Download/Upload Alarms, String Library Standard A downloaded project: Not supported Vision is burned to PLC FLASH contains a Upload Enhanced Vision file Select Download options to: burn project to PLC FLASH burn an Upload file Fully supported Operands Fast Operands: Not supported More operands. Fast Operands: Fully supported 119 VisiLogic: Getting Started

122 Replacing or Removing the Battery Appendix B: Vision Controller Divisions HMI Features Division Displays HMI Objects Call Subroutine from Display Standard Vision 255 Does not support Trends HMI object You can link 1 subroutine to a Enhanced Vision 1024 Does not support: Moving Images Global Variables Display. You can link three subroutines to a Display: on load, during display, on unload. Color Vision Color Vision controllers belong to the Enhanced Division, and offer some additional HMI object properties. Division Standard Vision Color Enhanced Vision Additional HMI Shapes Trends Trend and Axis FBs Frame and Button Trends HMI Object Graphs LEDs, Thermometer Note Font Handler: Color Vision models, such as V570, use default system fonts. These fonts (which are highlighted in grey) contain a limited character set, and cannot be modified. To add a font that contains additional / multilingual characters, click on the Add New Font button.. Ladder Functions Functions Standard Enhanced Call Subroutine A single net can include 2 Call Subroutine functions A single net can include only 1 Call Subroutine function Load HMI Display A single net can include 2 Load HMI Display functions A single net can include only 1 Load HMI Display function Special Issues Virtual Keypads: Enhanced Touchscreen Models When you create a variable that requires the operator to enter data, you can select one of the three keypad types shown in the following table type. The type is reflected in SI 49. lue: SI VisiLogic: Getting Started

123 Appendix B: Vision Controller Divisions Replacing or Removing the Battery Project Conversion Projects may be converted from the: V120 to the V130 From monochrome to color Project>Convert Project to Color. Keypad Entry The following table shows differences between keypad entry variables. Feature Standard Enhanced Keypad Entry Variables Active Keypad Entry (SBs) Keypad Entry: Focus SB 250 HMI key entry within limits (Standard Vision only) SB 251 Keypad entry exceeds limits (Standard Vision only) SI 249 Last Active Keypad Entry Var (Standard Vision only) SI 250 Currently active keypad entry (read/write) (Standard Vision only) SDW 10 Keypad entry variable value SB 32 HMI Keypad Entry in Progress (Standard Vision) rises during keypad entry After Keypad Entry, the next variable set in Variable Tab Order automatically becomes active. SB 92 Keypad Entry in Progress (ON during entry) (Enhanced Vision) SB 93 Keypad Entry Var Activates (ON for 1 scan) (Enhanced Vision) SB 94 Keypad Entry Var Complete (ON for 1 scan) (Enhanced Vision) SI 45 Numeric Key Entry Out of Limit — Counter of Attempts (Enhanced Vision) (Counts the number of failed attempts to enter a value) If a Legal Entry bit is defined, SB 94 does not turn ON if the entered value is out of range. The keypad stays on screen until a legal value is entered. You can use SI 45 in conjunction with a Compare function to exit the variable. SB 92 HMI Keypad Entry in Progress (Enhanced Vision) rises during keypad entry If SB 76 is OFF after Keypad Entry, the user must use the arrow keys to move to the next variable. Turning SB 76 on causes the next variable set in Variable Tab Order to automatically VisiLogic: Getting Started 121

Unitronics constantly upgrade all of their software which falls into three distinct
areas, the Visilogic programming software, the PLC operating system and the software
utilities.  …See More
In broad terms it is safe to upgrade the Visilogics programming
software at any time, the newer versions are backward compatible with the PLC OS
and the user should not experience any issues with their application program.



This FULL programming Software is very powerful and Included in the price of any Unitronics PLC unit. The latest Visilogic can be Downloaded Here

Visilogic Programming Software


Unless there are specific features or fixes that the user needs it is not recommended
to upgrade the PLC operating system on a production machine, if the user is starting
a new project then it is appropriate to make sure the latest OS is used.  The
new PLC operating systems are downloaded via Visilogics, which checks to make sure
that any OS upgrades are compatible with the Visilogic version number performing
the upgrade.  PLC OS upgrades should always be made via the PLC Port 1 over
a serial link and not via TCPIP.  When a PLC OS is upgraded the process does
not overwrite the existing application program which will run when the upgrade is
complete.


It is possible at some point that new features in a later release of software might
prevent a PLC program from being compiled and downloaded, however, this would need
the addition of new PLC functions not present in the existing OS.  Some OS
changes have resulted in PLC operation being different (by default) to the previous
version, however, these changes can normally be reversed by turning on a designated
System bit (SB).  If the user has any doubts then it is possible to check what
upgrades and fixes have been made to the various versions, Unitronics publish version
change data which can be found on their website immediately under the links that
allow download of new versions.


It is also possible to have several versions of the Visilogic programming software
on one PC and then switch between the versions, there is a utility program called
the Visilogic Version Swapper to help with this.


The user should carefully consider the consequences of upgrading each software utility
depending on the utility function as these vary from simple data table uploads to
taking remote control of a plant. New versions should not be tested on production
machines.


As with all things good practice requires strong version control and risk analysis
before upgrading software, make sure you do not run Beta software on production
machines and
if in doubt — We are happy to help you out!

…See Less

Понравилась статья? Поделить с друзьями:
  • Сам диагност руководство
  • Shuai te er 15628 инструкция фонарик
  • Руководство по эксплуатации мазда демио скачать бесплатно
  • Уфсин россии по республике бурятия официальный сайт руководство
  • Варочная панель hansa инструкция 2 конфорки электрическая