You are on page 1of 15

Tool for Communication

Monitoring of Industrial Wireless LAN


Connections via SNMP OPC Server and Excel

Tool
Warranty, Liability and Support

IWLAN Monitoring Entry-ID: 23577797

Note The function examples do not purport to cover all details or variations in
equipment, nor do they provide for every possible contingency. The func-
tion examples do not represent customer-specific solutions. They are
only intended to provide support for typical applications. You are respon-
sible for ensuring that the described products are correctly used. These
functional examples do not relieve you of the responsibility in safely and
professionally using, installing, operating and servicing equipment. In
using these functional examples, you recognize that Siemens cannot be
made liable for any damage/claims beyond the liability clause described.
We reserve the right to make changes to these function examples at any
time without prior notice. If there are any deviations between the recom-
mendations provided in these application examples and other Siemens
publications e.g. catalogs the contents of the other documents have
priority.
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

Warranty, Liability and Support


Copyright Siemens AG 2006 All rights reserved

We accept no liability for information contained in this document.


Any claims against us - based on whatever legal reason - resulting from the
use of the examples, information, programs, engineering and performance
data etc., described in this application example shall be excluded. Such an
exclusion shall not apply in the case of mandatory liability, e.g. under the
German Product Liability Act (Produkthaftungsgesetz), in case of intent,
gross negligence, or injury of life, body or health, guarantee for the quality
of a product, fraudulent concealment of a deficiency or breach of a condi-
tion which goes to the root of the contract (Wesentliche Vertragspflichten).
However, claims arising from a breach of a condition which goes to the root
of the contract shall be limited to the foreseeable damage which is intrinsic
to the contract, unless caused by intent or gross negligence or based on
mandatory liability for injury of life, body or health. The above provisions do
not imply a change in the burden of proof to your detriment.
Copyright 2006 Siemens A&D. It is not permissible to transfer or
copy these Function Examples or excerpts of them without first hav-
ing prior authorization from Siemens A&D in writing.
For questions about this document, please use the following e-mail ad-
dress:
mailto:csweb@ad.siemens.de

V1.0 01.07.2006 2/15


Foreword

IWLAN Monitoring Entry-ID: 23577797

Foreword
The function examples are fully functional and tested automation solutions
based on A&D standard products for simple, fast and inexpensive imple-
mentation of automation tasks within automation technology. Each of these
function examples covers a frequently occurring subtask of a typical cus-
tomer problem in automation technology. Apart from a list of all required
hardware and software components and a description of the way they are
connected to each other, the function examples include the tested and
commented code. This ensures that the functionalities described here can
be reset in a short period of time and thus also be used as basis for individ-
ual expansions.

Table of Contents
Table of Contents ......................................................................................................... 3
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

1 Automation Problem ....................................................................................... 4


Copyright Siemens AG 2006 All rights reserved

2 Required Hardware and Software Components........................................... 5


2.1 Products ............................................................................................................ 5
2.2 Configuration software/tools.............................................................................. 5
3 General Basics ................................................................................................ 6
3.1 Basics of SNMP ................................................................................................ 6
3.2 OPC Basics....................................................................................................... 8
4 Function Principle of the Excel Worksheet .................................................. 9
4.1 Status Worksheet Description ........................................................................ 9
4.2 The OPC Data Control .................................................................................... 10
4.3 Accessing the SNMP Variables ...................................................................... 11
5 Installation and Operation of the Tool ........................................................ 12
5.1 Download ........................................................................................................ 12
5.2 Installation of the Tool ..................................................................................... 12
5.3 Operation ........................................................................................................ 15

V1.0 01.07.2006 3/15


Automation Problem

IWLAN Monitoring Entry-ID: 23577797

1 Automation Problem
Overview
In industrial environments such as warehouses, slag heaps or general di-
rectional radio distances the signal quality of WLAN connections can chan-
ge significantly in the space of a minute. Therefore, in order to be able to
make statements on the long-term availability and robustness of a radio
field, it is helpful to log fluctuations of the signal strength of the radio field.

Automation Solution
The functional example introduced here illustrates a simple way to record
the signal strengths from up to 4 clients logged in at a SCALANCE W788
access point. By means of SNMP, information is read from the access point
and displayed on an Excel worksheet. For that, the tool on hand uses the
SIMATIC NET SNMP OPC server with an Excel worksheet with the OPC
Data Control as an OPC client.
The following figure schematically shows the solution described:
Figure 1-1
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

IWLAN AP

IWLAN Client1

IWLAN Client2

IWLAN Client3

IWLAN Client4

V1.0 01.07.2006 4/15


Required Hardware and Software Components

IWLAN Monitoring Entry-ID: 23577797

2 Required Hardware and Software Components


2.1 Products
Table 2-1

Component Qty. MLFB Note


Wireless LAN Access Point 1 6GK5788-1ST00-2AA6
SCALANCE W788-1pro
Field PG or equal PC 1 6ES7 711-xxxxx-xxxx Configuration com-
with Ethernet card puter
Link to PG con-
figurator
Wireless LAN Client Module 1 6GK5744-1ST00-2AA6 optional
SCALANCE W744-1pro
Standard ITP cable (RJ45) 1

2.2 Configuration software/tools


23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

Table 2-2
Copyright Siemens AG 2006 All rights reserved

Component Qty. MLFB Note


SIMATIC STEP 7 1 6ES7810-4CC08-0YA5 Or higher
Version 5.3 + SP3
SIMATIC NET Edition 2005 1 6GK1704-1LW63-3AA0 OPC server, OPC
Data Control
SIMATIC NET SNMP OPC server 1 6GK1706-1NW63-3AA0 SW included in
license SIMATIC NET
Microsoft Office 2003 Can be ordered via
Microsoft

V1.0 01.07.2006 5/15


General Basics

IWLAN Monitoring Entry-ID: 23577797

3 General Basics
3.1 Basics of SNMP

What is SNMP?
SNMP- Simple Network Management Protocol - is a UDP-based protocol
for monitoring and controlling network components such as routers, servers
and switches. The SNMP protocol operates according to the client-server
model. Like a software, SNMP agents run on the network components to
be managed, which act as servers, and provide elements via the device
configuration. These elements are managed in one data structure called
Management Information Base (MIB). The management station (client)
contacts the active agents and requests their MIB information.
Figure 3-1
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

SNMP works with five commands which can be executed between the
SNMP manager and SNMP agent.
Table 3-1
Command Application
GetRequest The manager requests an update of a table entry
GetNextRequest The manager requests the next table entry
GetResponse The agent responds to the managers request
SetRequest The manager changes data on the device to be managed
Trap The agent informs the manager about unusual events

V1.0 01.07.2006 6/15


General Basics

IWLAN Monitoring Entry-ID: 23577797

Management Information Base- MIB


The MIB is a standardized data structure consisting of different SNMP vari-
ables. These variables are organized in the form of a tree structure whose
branches are addressed either by numbers or, alternatively, by code desig-
nation.
Figure 3-2

ccitt iso 1 Joint-iso-ccitt

org 3

dod 6

internet 1

directory mgmt experimental private 4

enterprise 1
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

ad 4196

adProductMibs 1

simaticNet 1

iScalanceW = 1.3.6.1.4.1.4196.1.1.4 iHub iScalanceW 4

The MIB files for the SNMP capable SIMATIC products are located at
%ProgrammFiles%\Siemens\Step7\S7DATA\snmp\mib

Device Profiles
A device profile includes the paths of the SNMP variables from the MIB to
be read by the SNMP OPC server. Device profiles have already been
defined at %ProgrammFiles%\Siemens\Step7\S7DATA\snmp\profile for
SIMATIC devices which have special SNMP agents (e.g. SCALANCE,
OSM, ESM, CPs). The SNMP OPC server additionally includes an MIB
compiler, which is used to adapt existing device profiles or to create new
profiles in the SIMATIC manager. The following figure shows a section of
the device profile created for this application.

V1.0 01.07.2006 7/15


General Basics

IWLAN Monitoring Entry-ID: 23577797

Figure 3-1

3.2 OPC Basics

What is OPC?
OPC is a software interface independent of manufacturer based on
COM/DCOM which enables data exchange between hardware and soft-
ware also of different manufacturers. Under the OPC Foundation, a group
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

of large manufacturers sharing interests, four OPC specifications have


Copyright Siemens AG 2006 All rights reserved

evolved.
Table 3-2
Interface Application
OPC Data Access (DA) Access to process data
OPC Alarm& Events (A&E) Interface for event-based information
including acknowledgement
OPC Historical Data Access (HDA) Functions for archived data
OPC Data eXchange (DX) Server to server cross communication.

This example uses exclusively the OPC Data Access interface.


OPC is a client/server architecture. Manufacturers of modules providing
process data provide an OPC server to their modules which interfaces to
the respective data source. An OPC client contacts the server and reads or
writes the data.

SNMP OPC Server


The SNMP OPC server of SIMATIC NET allows a simple access to SNMP-
capable devices via the OPC interface by compiling OPC into SNMP or
vice versa. This allows SNMP-capable network components to be managed
in any OPC client system.

V1.0 01.07.2006 8/15


Function Principle of the Excel Worksheet

IWLAN Monitoring Entry-ID: 23577797

4 Function Principle of the Excel Worksheet


Description
In order to be able to process recordings of the radio signals for an Excel
evaluation, the Excel workbook 23577797_SNMP-OPC_AP-Analyse.xls is
provided. It contains the Status Excel worksheet.

4.1 Status Worksheet Description

The spreadsheet consists of two sections - the operating panel and the
logging area. It uses OPC Data Control for communicating with the OPC
server. The following figure shows the structure of the spreadsheet.
Figure 4-1
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

The Operating Panel


The operating panel has four buttons and two input boxes as ActiveX con-
trols. The individual buttons have the following tasks:
Clear log for deleting the logging
Start log or Stop log for starting/stopping the logging
Set Mark for setting a mark on a line
Single Step for logging line by line
The individual input boxes have the following tasks:
Cycletime for setting the update time in seconds
Max Logs defines the maximum number of lines in the protocol

The Logging Area


In the logging area, the MAC addresses, the signal strengths in percent, the
status and the data rate in Mbit/s of the first four WLAN clients are logged
cyclically via the respective calls of the OPC interface of the SNMP OPC
server. The SNMP OPC server forwards them then as SNMP jobs to the
access point.

V1.0 01.07.2006 9/15


Function Principle of the Excel Worksheet

IWLAN Monitoring Entry-ID: 23577797

4.2 The OPC Data Control

Description
The centrally most important control is the SIMATIC NET OPC Data Con-

trol , which establishes the connection to the SIMATIC NET OPC ser-
ver. This control is invisible during the program run and also in the devel-
opment view in Excel.

Code Extract
The following figure shows an extract of the Visual Basic Code. Here, the
Data Control is requested to read variables from the OPC server.
Figure 4-2
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

Configuration of the OPC Data Control


The OPC Data Control is integrated into the development environment to-
gether with the other controls. Here, the Data Control can be configured via
dialog.
The following figure shows an extract of the development view on the Excel
worksheet, which illustrates the user-defined configuration dialog of the
OPC Data Control.

V1.0 01.07.2006 10/15


Function Principle of the Excel Worksheet

IWLAN Monitoring Entry-ID: 23577797

Figure 4-3

Properties of the
Controls

Invisible OPC Data


Control on the
Excel Sheet

Name of the
OPC Server
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

4.3 Accessing the SNMP Variables

Process Sequences
The process variables are requested from the SNMP OPC server via OPC
Data Control. The SNMP OPC server compiles the request into SNMP,
reads the SNMP variables from the access point using the exact path data
specification in the device profile and compiles them back into the structure
of an OPC item. Data Control accesses those variables and supplies the
other controls in accordance with the VBA program.

SNMP Variables
The following table lists the SNMP variables used for the first client.
Table 4-1
SNMP Variable Column Name in Excel Description
snScalanceWDevicesMAC.1 MAC address MAC address
snScalanceWDevicesState.1 Status Status of the client
snScalanceWDevicesRxSignal.1 Signal Radio signal strength in
percent
snScalanceWDevicesTxRate.1 rate Data transmission rate in
Mbit/s

V1.0 01.07.2006 11/15


Installation and Operation of the Tool

IWLAN Monitoring Entry-ID: 23577797

5 Installation and Operation of the Tool


5.1 Download

The software examples are available on the HTML page from which you
downloaded this document.
Clicking the link below directly displays the download page of this docu-
ment.
http://support.automation.siemens.com/WW/view/en/23577797
The download is a ZIP file which can be unzipped with any unzip program.
The ZIP file contains the following files:
Table 5-1
File Name Contents
23577797_IWLAN_SNMPClient_Excel.xls Excel workbook
snScalanceW.mib MIB file
SCALANCE_W.txt Profile file
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

mibcopy.bat Script for simplified


Copyright Siemens AG 2006 All rights reserved

copying of MIB and


profile into STEP7
file
23577797_IWLAN_SNMPClient_Excel_STEP7_CODE.zip STEP7 project

5.2 Installation of the Tool

Copying of MIB and Profile


Table 5-2
Step Instruction Note
1. Copy the MIB and profile file To do so, call the mibcopy.dat script by double-
into the STEP7 directory in clicking it. snScalance.mib and
question. SCALANCE_W.txt are copied automatically into
MIB: %Programm- the respective STEP7 directories.
Files%\Siemens\Step7\S7DA
TA\snmp\mib
Profile: %Programm-
Files%\Siemens\Step7\S7DA
TA\snmp\profile

V1.0 01.07.2006 12/15


Installation and Operation of the Tool

IWLAN Monitoring Entry-ID: 23577797

Configuring the OPC Server in STEP7


Table 5-3
Step Instruction Note
1. Open the SIMATIC Manager.
2. Retrieve the File -> retrieve (Datei -> Dearchi-
23577797_IWLAN_SNMPClie vieren)
nt_Excel_STEP7_CODE.zip
STEP7 project
3. Set your PG/PC interface to Options -> Set PG/PC Interface
PC internal (local) (Extras -> PG/PC Schnittstelle ein-
stellen)
4. Open the configuration of the
PC station
5. Open the properties page of
the OPC server in the configu-
ration and select the SNMP
tab.
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc

Click on Edit Plant Con-


Copyright Siemens AG 2006 All rights reserved

figuration

6. Open the Station name dialog


box by double-clicking the
Station line.
Change the IP address to that
of your access point. Click
Device profile in order to
select the device profile of your
access point (here:
SCALANCE_W.txt).
Acknowledge the dialog boxes
by clicking OK

7. Please save your configura- Do not close the SIMATIC Manager as the project
tion. will have to be loaded later.

V1.0 01.07.2006 13/15


Installation and Operation of the Tool

IWLAN Monitoring Entry-ID: 23577797

Configuring the Station Configuration Editor


Table 5-4
Step Instruction Note
1. Open the Station Configuration Editor. Start -> Station Configuration Editor
2. Enter the same name for the Station
Name PC station as in the STEP7
program.
In this example:
SIMATIC PC-Station(1)
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

3. Now insert an OPC server. To do so,


select the first line and click Add
The system displays the Add Compo-
nent dialog. Select OPC Server and
confirm this and the following dialog by
clicking OK.

4. The OPC Server has now been inte-


grated into the Station Configuration
Editor.
5. Close the Station Configuration Edi-
tor dialog box.

V1.0 01.07.2006 14/15


Installation and Operation of the Tool

IWLAN Monitoring Entry-ID: 23577797

Loading the PC Station


Table 5-5
Step Instruction Note
1. Change back to the hardware configu-
ration of the STEP7 program.
2. Load your configuration onto your
PC/PG.
3. Select the OPC server and the station
manager in the Select Target Module
dialog and click OK to confirm your
selection.
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved

4. The configuration is now saved on


your PC/PG.

5.3 Operation

Opening the Workbook


You can open the XLS workbook by double-clicking the above-mentioned
XLS file using a file browser. Alternatively, you can start MS Excel via the
MS Windows start button Start > Programs > Microsoft Office > Microsoft
Office Excel 2003.... Using the file command File > Open, you can select
your storage folder and open the above-mentioned XLS file. The safety
warning is confirmed by clicking the Enable macros pushbutton.

Starting the Logging Procedure


Start the recording of the radio signals of the clients using the Start log but-
ton.

Notes on Executing and Controlling the Application


If you have not set up your own IWLAN client, please make sure that
other WLAN devices are near. If no clients have logged in at the access
point, no values are displayed on the Excel spreadsheet.
If you are using a client, you can simulate a signal weakening by cover-
ing the antennas e.g. with a metallic object.

V1.0 01.07.2006 15/15

You might also like