Professional Documents
Culture Documents
Tool
Warranty, Liability and Support
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
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
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
Table 2-2
Copyright Siemens AG 2006 All rights reserved
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
org 3
dod 6
internet 1
enterprise 1
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved
ad 4196
adProductMibs 1
simaticNet 1
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.
Figure 3-1
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
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.
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
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
Figure 4-3
Properties of the
Controls
Name of the
OPC Server
23577797_IWLAN_SNMPClient_Excel_DOKU_V10_e.doc
Copyright Siemens AG 2006 All rights reserved
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
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
figuration
7. Please save your configura- Do not close the SIMATIC Manager as the project
tion. will have to be loaded later.
5.3 Operation