You are on page 1of 28

Getting started

with Allen Bradley (Modbus) and Whzan

Document version: Whzan version: Release date

1.00 Beta 1 September 2010

Copyright 2010, Whzan. All rights reserved. No part of this document may be reproduced or transmitted, in any form or by any means, without the prior written permission from Solcom Limited.

Getting started with Allen Bradley (Modbus) and Whzan

Setting up an Allen Bradley (Modbus) link with Whzan


The process is easy, but involves several key stages which we will describe in this document. Once you have worked through this stage then you will be ready to explore the more advanced features of Whzan.

Prerequisites
To start this you will need the following: 1) An Allen Bradley (Modbus) PLC, in this example we are going to use a MicroLogix 1500. 2) PLC programming software, we are using RSLogix 500 from Rockwell Automation. 3) A Windows XP or later PC with internet access and connection to your device or emulator.

Document Version 1.00

Whzan 2010

Page 2

Getting started with Allen Bradley (Modbus) and Whzan

Getting Started with Whzan


First you will need an account, so go to the main whzan.com site and click register.

Its all the normal stuff, you will have to provide a valid email as its used to activate your account. The country is needed for VAT purposes and you must accept our terms and conditions in order to proceed. There is no charge for the Beta period, or for the free trial. Once you have registered with a username and password, wait for the email to arrive with a link to activate your account.

Document Version 1.00

Whzan 2010

Page 3

Getting started with Allen Bradley (Modbus) and Whzan

Set the Allen Bradley PLC Program for Testing


Whilst waiting for the activation email, lets look at the Allen Bradley PLC programming. Whatever you might eventually want to do with the program its easiest to test that everything is working on the Whzan link by starting a new program. I am assuming that you know enough to get the PLC programing tool up and going, if not use the help file in the PLC software. The basic steps are:

1) Launch the RSLogix 500 software. 2) Choose the controller type you have. In the example we have a Micrologix 1500 LSP. 3) Connect to the PLC. In the example we use RSLinx.

Document Version 1.00

Whzan 2010

Page 4

Getting started with Allen Bradley (Modbus) and Whzan

4) Select Controller Channel Configuration and set the driver to Modbus RTU Slave. Set the file numbers for Coils, Contacts, Input Registers and Holding Registers. The screen would look something like the one below:

Document Version 1.00

Whzan 2010

Page 5

Getting started with Allen Bradley (Modbus) and Whzan

5) Use the memory addresses contained within the files entered in step 4 in your PLC application. The screen would look like that below:

Once complete, write this program to the PLC controller and start it in run mode.

Document Version 1.00

Whzan 2010

Page 6

Getting started with Allen Bradley (Modbus) and Whzan

Download the Whzan Gateway


Back to Whzan, you need the program that forms the link between Whzan and the Allen Bradley (Modbus) PLC. In Whzan these are called Gateways. The Allen Bradley (Modbus) Gateway is available from our shop as a free download:

Click on the link to download the Gateway and follow the instruction process, we havent listed every step here as its self-explanatory and may be subject to change (as is the Shop format). The installation program will be digitally signed by Solcom Limited to ensure that it has not been tampered with. The installation has two components, this is necessary so that the Gateway program can run without any person being logged in to Windows. Part 1) a Windows service program that runs in the background. It connects to the PLC and to Whzan. Periodically it checks Whzan to see if there have been any changes in Whzan data that is linked to the Gateway, if there are the PLC will be updated. It also periodically checks the PLC to see if anything has changed and will update Whzan accordingly. Being a Windows service, it will start

Document Version 1.00

Whzan 2010

Page 7

Getting started with Allen Bradley (Modbus) and Whzan

when the PC powers up and normally run until it shuts down. There is nothing to see or change with the service as this is defined in the second part below. Part 2) a Gateway Manager program, this is used to tell the service what data to read/write and how that data maps to datapoints in Whzan. The manager need only run to set the system up, but you can leave it in the notification area and it will give you status updates.

Document Version 1.00

Whzan 2010

Page 8

Getting started with Allen Bradley (Modbus) and Whzan

Install the Whzan Gateway


A few more simple steps and it will soon be running. The Gateway Manager needs to know your Whzan account and a name for this Gateway. The Whzan account name is required to enable the Gateway to create and access Whzan datapoints as you define the local configuration. The Gateway name is used to store your settings and a special status datapoint in Whzan is created for the Gateway (this datapoint continuously updates displaying the time in which the Gateway last connected with Whzan). Be sure to think of a suitable name because you cant change it later. A PIN number is provided as a confirmation tool to ensure that your personal Gateway has access to your Whzan account. . Click Register with Whzan when done and you will get a link to the Whzan website for confirmation.

Document Version 1.00

Whzan 2010

Page 9

Getting started with Allen Bradley (Modbus) and Whzan

Authorize the Whzan Gateway


Enter the PIN number and click Allow Access to enable your Gateway Manager to setup your datapoints.

Once you have permitted access, return back to the Gateway Manager and it will check that it has permission to access and update data within your account. Thats all of the administration done; now as you tell the Gateway Manager about new data it will be created within Whzan where you can use it in both graphics and displays.

Document Version 1.00

Whzan 2010

Page 10

Getting started with Allen Bradley (Modbus) and Whzan

Map Whzan Datapoints on to Allen Bradley I/O


Once the Gateway is registered, the Manager will show a screen similar to that below, we suggest you leave the properties as they are for the time being. Right click on your Gateway tree and select Add Device.

This brings up the screen where we get to define a Modbus Device. Note that you can have more than one device connected. So when you have added a new device use the right hand property fields to update the information about it. Ensure that the device name is appropriate as there will be a status datapoint created within Whzan.

Document Version 1.00

Whzan 2010

Page 11

Getting started with Allen Bradley (Modbus) and Whzan

The initial screen format is shown below. Give the new device a name and description.

Select the required interface type (serial transmission protocol is the default) and enter your interface parameters. For this demo also make the device read/write.

Document Version 1.00

Whzan 2010

Page 12

Getting started with Allen Bradley (Modbus) and Whzan

After setting up the device as described, the screen should look like this:

Notice that the tree view of the Device has two entries, from Device and to Device. These refer to data exchanges from the Device to Whzan and vice versa. Note that these disappear if you make the device read only. Right click the from Device branch and select the option to add a new numeric datapoint to get to the screen shown below:

Document Version 1.00

Whzan 2010

Page 13

Getting started with Allen Bradley (Modbus) and Whzan

This brings up the screen where we get to add real datapoints mapped to the controller. Note that you can have more than one device connected. So if you add a new device use the right hand property fields to update the information about it. Ensure that the device name is appropriate as there will be a status datapoint created within Whzan. Using the properties fields update the datapoint information, the fields are described in the dialogue. Be sure to construct a naming convention before embarking as good naming will help as your system grows. For the demonstration we suggest you read an Output Holding Register with an address offset of zero (0) into a Whzan numeric datapoint called FromOHR000 and another FromOHR001 with address offset of one (1), see below:

Document Version 1.00

Whzan 2010

Page 14

Getting started with Allen Bradley (Modbus) and Whzan

Notes: Some devices will use or show offsets as hexadecimal, Whzan just uses decimal. Also offsets can be shown with a real address rather than an offset, whereas Whzan will refer to the OHR as starting from 0. If you want to get individual bits from the device, the Whzan gateway permits you to select individual bits from an Ethernet word for Whzan Boolean datapoints and a bit range for Whzan numeric datapoints. So a Boolean in Whzan might come from OHR 15 bit 7 for example or a numeric come from OHR 26 bits 4 10. More than one Whzan Datapoint can use the same device address location. Finally the Gateway manager permits the application of a linear calibration to the data in the form of y = mx + c for numeric data types. It is important to set the Whzan Min and Max values to the maximum possible range because Whzan implements these limits across the system.

Document Version 1.00

Whzan 2010

Page 15

Getting started with Allen Bradley (Modbus) and Whzan

Defining datapoints that are updated in the other direction uses a very similar process but using the To Device tree. For test purposes I have defined the following: Direction Whzan Datapoint Name Offset Bit(s) Scale Factor Offset 0 1 0 1 0-15 0-15 0-15 0-15 1 1 1 1 0 0 0 0

From Device FromOHR000 FromOHR001 To Device ToOHR000 ToOHR001

Note that with that with this arrangement anything we output will be read back.

Similarly using other registers in the Modbus device is just a matter of selecting the appropriate table. Above shows the view of our tree populated with the four datapoints.

Document Version 1.00

Whzan 2010

Page 16

Getting started with Allen Bradley (Modbus) and Whzan

How to Display Data in Whzan


On to the last tasks, setting up a display graphic (mimic) in Whzan. Open the editor in My Whzan as shown below:

Document Version 1.00

Whzan 2010

Page 17

Getting started with Allen Bradley (Modbus) and Whzan

Next click Create New Mimic to create an empty graphics file.

Update the new mimic properties, i.e. give it a name and description then click edit. You will start off with a blank page.

Document Version 1.00

Whzan 2010

Page 18

Getting started with Allen Bradley (Modbus) and Whzan

Using the Text tool, drag-out a text object. You will see the text Enter your text here, this is for fixed text items, you can change it to say FromOHR000 to keep track of the text, but we want the value displayed to come from the Device. Update the font size to 18 or so to make it clearer.

Document Version 1.00

Whzan 2010

Page 19

Getting started with Allen Bradley (Modbus) and Whzan

We entered the text FromOHR000 and then clicked on the orange binding button to the right of the text field in the Text Properties section; you will see a screen like that below:

In this case we want to display the numeric datapoint the system will read from the Output Holding Register location 0 as a text string so click the String from numeric tab and select our datapoint with name ending FromOHR000 from the list using the Insert Datapoint button.

Document Version 1.00

Whzan 2010

Page 20

Getting started with Allen Bradley (Modbus) and Whzan

Click OK to complete the data binding and return to the mimic editor screen. Repeat the process (or copy and paste) for FromOHR001 perhaps putting that to the right of the first text field. Remember to update the datapoint name bound to the second text object to the datapoint with name ending FromOHR001.

Document Version 1.00

Whzan 2010

Page 21

Getting started with Allen Bradley (Modbus) and Whzan

The mimic will then look like this:

Now lets add a control on the mimic to set the Whzan datapoints that will get written to the Output Holding Register locations 0 and 1. These are the datapoints ending in ToOHR000 and ToOHR001. As they are numeric we will use a slider control, these are called Widgets and can be selected with the Widget browser on the left side of the editor.

Document Version 1.00

Whzan 2010

Page 22

Getting started with Allen Bradley (Modbus) and Whzan

In this case we will use a simple linear slider, select the Widget Browser, Category Sliders and click on the Linear Slider as shown below:

Click the Use Now button on the right and return to the Editor.

Document Version 1.00

Whzan 2010

Page 23

Getting started with Allen Bradley (Modbus) and Whzan

The slider will be the selected drawing object on the canvas below the two text objects, so drag out a pair of sliders like this:

Document Version 1.00

Whzan 2010

Page 24

Getting started with Allen Bradley (Modbus) and Whzan

Next we need to be able to set the ToDevice Datapoints from these slider values, so we select the first slider and pick the Datapoint ending ToOHR000 from the property Datapoint To Set on the right.

Set the maximum value to 100 as well.

Document Version 1.00

Whzan 2010

Page 25

Getting started with Allen Bradley (Modbus) and Whzan

Repeat for the other Slider and use the second output Datapoint name ending in ToOHR001. To ensure that we can tell the difference between Datapoints set the slider range maximum to 1000. It should look like this:

Select the Home tab (if its not selected) at the top of the screen and click on the save icon (you might want to save periodically in any case if you have a poor internet connection). Ensure nothing is selected (i.e. click on the blank canvas) and then click the View Live button top right.

Document Version 1.00

Whzan 2010

Page 26

Getting started with Allen Bradley (Modbus) and Whzan

A new window will open and you will see your two sliders with a value (initially they will be 0.00) above them. Now we will go through a sequence to show that things are working. Both at zero:

Move the first slider quickly to the half way (50%) position to change the value being output to the register OHR000. The appearance will at first be this: First slider at 50%

After you release the slider (mouse up) the viewer will send an update to Whzan and the datapoint ToOHR000 will be set to 50 (depending upon your slider position accuracy). On the next refresh cycle (usually 10 seconds) the Modbus Gateway will check Whzan and discover that the value has changed. The updated value will then be written to the Modbus OHR location 0 by the Gateway. The Gateway will subsequently read the same address location and find the updated value mapped to the datapoint FromOHR000 which in turn will get updated in Whzan. The next refresh of the mimic viewer will see the update of the text field on the screen.

Document Version 1.00

Whzan 2010

Page 27

Getting started with Allen Bradley (Modbus) and Whzan

This can be repeated on the second slider, but because the scale is 0 1000 the 50% mark will be 500. The settled state for both at 50% is as follows:

Finally move both sliders to 100% and wait for the input datapoints to catch up.

That covers the basic steps from setting up a PLC through to creating the first mimic with live data. Once confidence has been gained, try using more than one PLC or device, other Whzan graphic shapes and dynamic effects and Whzan Boolean datapoints.

Document Version 1.00

Whzan 2010

Page 28

You might also like