Compute
Compute
1 2 3 4 5 6 7 8 9 A B C D E F G
Product Overview
SIMATIC
Setting Up Computing Software
Computing
Using Computing to Access Data Accessing the Process Data with the Data Control
User Manual
User Controls
This manual is part of the documentation package with order no: 6ES7 673-6CC01-8BA0
S7 Diagnostics Buffer Control (DBuffer) Designing Simple Process Forms with the WinAC SoftContainer Creating Tag Files with the TagFile Configurator Memory Areas of the S7 Controllers Properties and Methods Events Using the Computing Configuration Tool Using Computing with DCOM Guidelines for Programming with Computing Using Control Engine Strings
A5E00065508-04
Edition: 06/2000
Safety Guidelines
This manual contains notices which you should observe to ensure your own personal safety, as well as to protect the product and connected equipment. These notices are highlighted in the manual by a warning triangle and are marked as follows according to the level of danger:
! ! !
Danger
indicates that death, severe personal injury or substantial property damage will result if proper precautions are not taken.
Warning
indicates that death, severe personal injury or substantial property damage can result if proper precautions are not taken.
Caution
indicates that minor personal injury or property damage can result if proper precautions are not taken.
Note
draws your attention to particularly important information on the product, handling the product, or to a particular part of the documentation.
Qualified Personnel
Only qualified personnel should be allowed to install and work on this equipment. Qualified persons are defined as persons who are authorized to commission, to ground, and to tag circuits, equipment, and systems in accordance with established safety practices and standards.
Warning
This device and its components may only be used for the applications described in the catalog or the technical descriptions, and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. This product can only function correctly and safely if it is transported, stored, set up, and installed correctly, and operated and maintained as recommended.
Trademarks
SIMATICR, SIMATIC HMIR and SIMATIC NETR are registered trademarks of SIEMENS AG. Some of other designations used in these documents are also registered trademarks; the owners rights may be violated if they are used by third parties for their own purposes.
Copyright Siemens AG 19992000 All rights reserved The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.
Disclaimer of Liability We have checked the contents of this manual for agreement with the hardware and software described. Since deviations cannot be precluded entirely, we cannot guarantee full agreement. However, the data in this manual are reviewed regularly and any necessary corrections included in subsequent editions. Suggestions for improvement are welcomed.
Siemens AG Automation and Drives (A&D) Industrial Automation Systems (AS) Postfach 4848, D- 90327 Nrnberg Siemens Aktiengesellschaft
Index-2
Computing A5E0006550804
Preface
The Computing software uses the ActiveX (also known as OLE) technology of Microsoft to provide you with access to the data provided by your control engine. The Computing software consists of the following: S S A set of SIMATIC controls, which are ActiveX or OCX (OLE custom controls) controls for accessing control engines An OPC (OLE for process control) server that allows other OPC applications to access the data stored in the control engine (such as WinLC of WinAC Basis or the CPU 416-2 DP ISA of WinAC Pro) TagFile Configurator for creating tag files that allow symbolic addressing and remote access to multiple control engines A configuration tool for configuring remote access An OLE container (SoftContainer) for creating process forms with the SIMATIC controls
S S S
Note As used by the Computing software, the term control engine applies to a processor or program that manages and manipulates data which is used to control a process or machine. The control engine can be can be either software or hardware. WinAC Basis provides a Windows Logic Controller (WinLC) as its control engine, and WinAC Pro provides a slot PLC as its control engine. (The term slot PLC in the manual refers to a slot PLC such as CPU 4162 DP ISA or CPU 4162 DP ISA Lite. In the manual, the CPU4162 DP ISA Lite is treated identically to the CPU4162 DP ISA.) The ActiveX controls provided by Computing communicate with these control engines, as well as other SIMATIC S7 controllers.
Audience
This manual is intended for engineers, programmers, and maintenance personnel who have a general knowledge of programmable logic controllers (PLCs).
Computing A5E0006550804
iii
Preface
Other Manuals
You can find information in the online help for the Computing software. For additional information, refer to the following manuals:
Title System Software for S7-300 and S7-400 Program Design Programming Manual OPC Server Interface Manual Windows Logic Controller (WinLC) User Manual Content This manual provides basic information about the structure of the operating system and how to design a user program for WinLC. Use this manual when creating a user program with the STEP 7 automation software. This manual describes the browsable OPC server interface provided with the Computing software. This manual provides basic information about the performance characteristics and operation of the WinLC controller.
WinAC Controlling with This manual provides basic information about the performance CPU 4162 DP ISA characteristics and operation of the CPU 4162 DP ISA controller. Hardware and Installation Manual
iv
Computing A5E0006550804
Preface
Additional Assistance
If you have any questions not answered in this or one of the other STEP 7 manuals, if you need information on ordering additional documentation or equipment, or if you need information on training, please contact your Siemens distributor or sales office. To contact Customer Service for Siemens in North America: S Telephone: (609) 7346500 (609) 7343530 S E-mail: ISBU.Hotline@sea.siemens.com simatic.hotline@sea.siemens.com S Internet: http://www.aut.sea.siemens.com/winac/ http://www.aut.sea.siemens.com/simatic/support/index.htm http://www.ad.siemens.de/support/html_76/index.shtml http://www.sea.siemens.com/industrialsoftware/ To contact Customer Service for Siemens in Europe: S S S S Telephone: Fax: E-mail: Internet: ++49 (0) 911 895 7000 ++49 (0) 911 895 7001 simatic.support@nbgm.siemens.de http://www.ad.siemens.de/simaticcs
Computing A5E0006550804
Preface
vi
Computing A5E0006550804
Contents
1 Getting Started with Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 1.2 1.3 1.4 1.5 2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Sample I/O Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting Third-Party Controls to a Data Control . . . . . . . . . . . . . . . . . . . Using Computing with Microsoft Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the SoftContainer Provided by Computing . . . . . . . . . . . . . . . . . . . . . 1-1 1-2 1-4 1-12 1-15 1-19 2-1 2-2 2-4 2-6 3-1 3-2 3-3 3-5 3-7 4-1 4-2 4-4 4-5 4-6 5-1 5-2 5-3 5-4 5-9 5-13 5-15 5-16 5-17 5-19 5-23 5-28 5-29
mpiProduct Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 2.2 2.3 Product Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using an ActiveX Control to Access the Process Data . . . . . . . . . . . . . . . . Connecting to Your Process with the OPC Server . . . . . . . . . . . . . . . . . . . .
Setting Up Computing Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 3.3 3.4 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing and Uninstalling the Computing Software . . . . . . . . . . . . . . . . . . . Connecting Computing to a Slot PLC or Communications Card . . . . . . . .
Using Computing to Access Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 4.2 4.3 4.4 Accessing Data in Control Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing a Local Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing a Remote Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Communicating with Multiple Control Engines . . . . . . . . . . . . . . . . . . . . . . .
Accessing the Process Data with the Data Control . . . . . . . . . . . . . . . . . . . . . . . . 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 Connecting the SIMATIC Controls to the Control Engine . . . . . . . . . . . . . . Configuring the Connection Properties for the Data Control . . . . . . . . . . . Selecting the Control Engine for the Data Control . . . . . . . . . . . . . . . . . . . . Connecting the ActiveX Controls to the Control Engine . . . . . . . . . . . . . . . Filtering the Properties for the ActiveX Controls . . . . . . . . . . . . . . . . . . . . . Configuring Custom Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Connection Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample Program for Creating a Connection Table and an Event Table . . Sample Program for Responding to Events . . . . . . . . . . . . . . . . . . . . . . . . . Sample Programs for Reading and Writing Data . . . . . . . . . . . . . . . . . . . . . Sample Program for Reading and Writing Boolean Data . . . . . . . . . . . . . . Properties, Methods, and Events of the Data Control . . . . . . . . . . . . . . . . .
Computing A5E0006550804
vii
Contents
User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 Connecting the User Controls to the Process Data . . . . . . . . . . . . . . . . . . . Using the Property Pages of the Button Control . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Button Control . . . . . . . . . . . . . . . . . . . . . . . Events of the Button Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Property Pages of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . Events of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Codes for the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Property Pages of the Label Control . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Label Control . . . . . . . . . . . . . . . . . . . . . . . . Events of the Label Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Property Pages of the Slider Control . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . . Events of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-1 6-2 6-4 6-9 6-10 6-11 6-18 6-19 6-20 6-21 6-26 6-26 6-27 6-34 6-35 7-1 7-2 7-4 7-7 8-1 8-2 8-4 8-6 8-8 9-1 9-2 9-5 9-6 9-10 9-13 A-1 A-2 A-3 A-6
S7 Diagnostic Buffer Control (DBuffer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 7.2 7.3 Accessing the S7 Diagnostics Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the DBuffer Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the DBuffer Control . . . . . . . . . . . . . . . . . . . . . .
Designing Simple Process Forms with the SoftContainer . . . . . . . . . . . . . . . . . . 8.1 8.2 8.3 8.4 Starting the SIMATIC Computing SoftContainer . . . . . . . . . . . . . . . . . . . . . Creating a Process Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switching from Design Mode to Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . Saving Your Process Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Tag Files with the TagFile Configurator . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 9.2 9.3 9.4 9.5 Connecting to Multiple Control Engines over DCOM . . . . . . . . . . . . . . . . . . Using Symbols to Access Data in the Control Engine . . . . . . . . . . . . . . . . . Creating a Tag File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring a Tag File for Local or Remote Access to a Control Engine . Changing the Control Engine Symbol Name in the Tag File Editor . . . . . .
Memory Areas of the S7 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1 A.2 A.3 Memory Areas of S7 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the S7 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Descriptions of the S7 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viii
Computing A5E0006550804
Contents
Properties and Methods in work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.1 B.2 B.3 B.4 B.5 B.6 B.7 B.8 B.9 B.10 B.11 B.12 B.13 B.14 B.15 B.16 B.17 B.18 B.19 B.20 B.21 B.22 B.23 B.24 B.25 B.26 B.27 B.28 B.29 B.30 B.31 B.32 B.33 B.34 AboutBox Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Activated Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alignment Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appearance Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AutoConnect Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AutoConnectTimeout Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BackColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . bDiagBuffOK Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . bEngineConnected Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BorderStyle Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Caption Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connect Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ConnectName Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ConnectObject Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ControlEngine Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DataFormat Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DefaultDeadband Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DefaultUpdateRate Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Direction Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Disconnect Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayFormatButtons Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayHelpButton Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayHelpOnEventButton Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayLowerPanel Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayUpdateButton Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayUpperPanel Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DisplayValue Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Enabled Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EnableSort Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Factor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FalseCaption Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FalseColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FalsePicture Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Font Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-1 B-1 B-1 B-2 B-3 B-3 B-4 B-5 B-5 B-6 B-6 B-7 B-7 B-8 B-9 B-10 B-11 B-12 B-13 B-14 B-14 B-15 B-15 B-16 B-17 B-17 B-18 B-18 B-19 B-19 B-20 B-21 B-21 B-22 B-22
Computing A5E0006550804
ix
Contents
B.35 B.36 B.37 B.38 B.39 B.40 B.41 B.42 B.43 B.44 B.45 B.46 B.47 B.48 B.49 B.50 B.51 B.52 B.53 B.54 B.55 B.56 B.57 B.58 B.59 B.60 B.61 B.62 B.63 B.64 B.65 B.66 B.67 B.68 B.69
ForeColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FormatDisplay Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KnobHeight Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KnobPicture Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KnobWidth Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LargeChange Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Locked Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Max and Min Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MultipleEngines Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Offset Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PCName Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Picture Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PopUpHelp Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PopUpHelpOnEvent Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Precision Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PropertyChangedName Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PropertyChangedObject Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PushButton Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RawMax and RawMin Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ReadMultiVariables Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ReadVariable Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ScaleMode Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SelectEvent Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ShowErrorBoxes Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ShowMinMax Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SmallChange Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . StretchMode Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Style Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TagSource Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ticks Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TrueCaption Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TrueColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TruePicture Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Update Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-23 B-23 B-24 B-24 B-25 B-25 B-26 B-26 B-27 B-27 B-28 B-28 B-29 B-29 B-30 B-30 B-31 B-32 B-32 B-33 B-33 B-34 B-35 B-36 B-36 B-37 B-38 B-39 B-39 B-40 B-40 B-40 B-41 B-42 B-42
Computing A5E0006550804
Contents
Value Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WriteMode Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WriteNow Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WriteMultiVariables Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WriteVariable Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zeropad Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-43 B-43 B-44 B-44 B-45 B-45 C-1 C-1 C-1 C-1 C-2 C-2 C-3 C-4 C-5 C-6 C-7 C-8 C-9 D-1 D-2 D-5 D-6 D-7 E-1 E-2 E-4 E-14 E-20
Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.1 C.2 C.3 C.4 C.5 C.6 C.7 C.8 C.9 C.10 C.11 C.12 Change Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Click Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ConnectionError Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DblClick Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KeyDown Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KeyPress Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KeyUp Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MouseDown Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MouseMove Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MouseUp Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ValueChanged Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Computing Configuration Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D.1 D.2 D.3 D.4 Configuring the OPC Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting the Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting the Control Engine for Older Programs . . . . . . . . . . . . . . . . . . . . Setting up Communications Using the PG/PC Interface . . . . . . . . . . . . . . .
Using Computing with DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E.1 E.2 E.3 E.4 Using DCOM to Provide Remote Access . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Permissions for the Server Computer . . . . . . . . . . . . . . . . Configuring the Permissions for the Client Computer . . . . . . . . . . . . . . . . . Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Computing A5E0006550804
xi
Contents
Guidelines for Programming with Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . F.1 F.2 F.3 F.4 F.5 Guidelines for Third-Party Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Programming Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guidelines for Creating Custom ActiveX Controls . . . . . . . . . . . . . . . . . . . . Using a Custom ActiveX Control with a Data Control . . . . . . . . . . . . . . . . . Known Problems for Computing Version 3 . . . . . . . . . . . . . . . . . . . . . . . . . .
G Index
xii
Computing A5E0006550804
Contents
Figures 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9 1-10 1-11 1-12 1-13 1-14 1-15 1-16 1-17 1-18 1-19 1-20 1-21 1-22 2-1 2-2 2-3 3-1 4-1 4-2 4-3 4-4 5-1 5-2 5-3 5-4 5-5 5-6 5-7 5-8 5-9 5-10 5-11 5-12 5-13 6-1 6-2 6-3 6-4 6-5 6-6 6-7 6-8 Using Computing to Access Data in the Control Engine . . . . . . . . . . . . . . . Sample Program (Counters) for the Application Examples . . . . . . . . . . . Adding SIMATIC Controls to the VB Toolbox . . . . . . . . . . . . . . . . . . . . . . . . Sample I/O Panel Created in Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . Displaying the Expanded List of Properties . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Filter Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Properties to the Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applying the Filter to the Property List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Assigning a Variable in the Control Engine to a Property in a Control . . . Connecting the Data Control to a Control Engine . . . . . . . . . . . . . . . . . . . . Operating the Sample I/O Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the Data Control to the Visual Basic Toolbox . . . . . . . . . . . . . . . . . Assigning a Variable to the Caption Property of a VB Label Control . . . . . Connecting to the Control Engine (Label Control Example) . . . . . . . . . . . . Adding an Event Key to the Data Control . . . . . . . . . . . . . . . . . . . . . . . . . . . Assigning a Variable to an Event Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a SIMATIC Control into the SoftContainer . . . . . . . . . . . . . . . . . . Using the SoftContainer to Create a Sample I/O Panel . . . . . . . . . . . . . . . Connecting to the Control Engine (SoftContainer Example) . . . . . . . . . . . Assigning the Value Property to a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Display Properties of the Edit control . . . . . . . . . . . . . . . . . Placing the Container into Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the Process Data with Computing . . . . . . . . . . . . . . . . . . . . . . . . Applications Working with Many OPC Servers . . . . . . . . . . . . . . . . . . . . . . . Using the OPC Server to Access Your Process Data . . . . . . . . . . . . . . . . . Setting the PG/PC Interface for Slot PLC CPU 4162 DP ISA (local) . . . Accessing Data in Control Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing a Local Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing a Remote Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing Data in Several Remote Control Engines . . . . . . . . . . . . . . . . . . Using the Data Control for Connecting to a Control Engine . . . . . . . . . . . . Data Control Properties (General Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Properties (Engine Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting a Tag File for the Data Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . Direct Connection for a Local or a Remote Computer . . . . . . . . . . . . . . . . . Configuring DCOM for a Specific Control Engine . . . . . . . . . . . . . . . . . . . . Entering a Symbol for the Assigned Variable . . . . . . . . . . . . . . . . . . . . . . . . Browsing to a Symbol in the Tag File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Properties (Connections Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Properties (Connections Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Properties (Connections Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Properties (Events Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample Program for Responding to Events in the Control Engine . . . . . . Assigning Variables for a Button, Edit, Control . . . . . . . . . . . . . . . . . . . . . . Assigning Variables for the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Control Properties (General Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Control Properties (Picture Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Control Properties (Font Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Control Properties (Color Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Control Properties (Name Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit Control Properties (General Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 1-3 1-5 1-6 1-7 1-7 1-8 1-8 1-9 1-10 1-11 1-12 1-13 1-14 1-17 1-17 1-19 1-20 1-21 1-22 1-23 1-24 2-2 2-6 2-7 3-7 4-3 4-4 4-5 4-7 5-2 5-3 5-4 5-6 5-7 5-8 5-10 5-11 5-13 5-14 5-14 5-15 5-19 6-2 6-3 6-5 6-5 6-6 6-7 6-8 6-12
Computing A5E0006550804
xiii
Contents
Figures, continued 6-9 6-10 6-11 6-12 6-13 6-14 6-15 6-16 6-17 6-18 6-19 6-20 6-21 6-22 6-23 6-24 7-1 7-2 7-3 7-4 7-5 8-1 8-2 8-3 8-4 8-5 8-6 9-1 9-2 9-3 9-4 9-5 9-6 9-7 9-8 9-9 9-10 A-1 A-2 A-3 A-4 A-5 A-6 A-7 D-1 D-2 D-3 D-4 D-5 D-6 D-7 Edit Control Properties (Scaling Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit Control Properties (Font Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit Control Properties (Color Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit Control Properties (Name Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Label Control Properties (General Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Label Control Properties (Picture Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Label Control Properties (Font Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Label Control Properties (Color Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Label Control Properties (Name Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slider Control Properties (General Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Orientation of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elements of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slider Control Properties (Scaling Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slider Control Properties (Picture Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slider Control Properties (Color Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slider Control Properties (Name Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the diagnostics Buffer of an S7 Controller . . . . . . . . . . . . . . . . . Elements of the DBuffer Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Diagnostics Buffer Tab of the DBuffer Control . . . . . . . . . . . . . . . . . . . . . . Visibility Tab of the DBuffer Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DBuffer Control Properties (Name Tab) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Container with the Default Process Form . . . . . . . . . . . . . . . . . . . . . . . . . . . Elements of the Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a Control from the Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a Third-Party Control into the Process Form . . . . . . . . . . . . . . . . Changing the Container to Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Saving a Process Form for Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting to Multiple Control Engines over DCOM . . . . . . . . . . . . . . . . . . Creating a Tag File for Multiple Control Engines . . . . . . . . . . . . . . . . . . . . . Configuring the Data Control for Multiple Control Engines . . . . . . . . . . . . . Using Symbols to Access Data in the Control Engine . . . . . . . . . . . . . . . . . TagFile Configurator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a SIMATIC Program into the Tag File . . . . . . . . . . . . . . . . . . . . . . Inserting a New Control Engine into the Tag File . . . . . . . . . . . . . . . . . . . . . Configuring a Control Engine for Local Access . . . . . . . . . . . . . . . . . . . . . . Configuring a Control Engine for Remote Access . . . . . . . . . . . . . . . . . . . . Configuring a Control Engine for Remote Access . . . . . . . . . . . . . . . . . . . . Accessing Data by Byte, Word, and Double Word . . . . . . . . . . . . . . . . . . . . Accessing Data in an ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the DATE Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the DATE_AND_TIME Data Type . . . . . . . . . . . . . . . . . . . . . . . . Accessing STRING Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the TIME Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the TIME_OF_DAY (TOD) Data Type . . . . . . . . . . . . . . . . . . . . Configuring the OPC Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting the Language for the CPU Panel and Help Files . . . . . . . . . . . . Selecting the Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the PG/PC Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting the PG/PC Interface for PC Internal (local) . . . . . . . . . . . . . . . . . . . Setting the PG/PC Interface From the STEP 7 Computer . . . . . . . . . . . . . Setting the PG/PC Interface From WinLC . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 6-15 6-16 6-17 6-22 6-23 6-24 6-25 6-25 6-28 6-28 6-30 6-30 6-31 6-32 6-33 7-2 7-3 7-4 7-5 7-6 8-2 8-3 8-4 8-5 8-7 8-8 9-2 9-3 9-4 9-5 9-6 9-7 9-8 9-11 9-12 9-13 A-3 A-7 A-7 A-8 A-9 A-10 A-10 D-3 D-5 D-6 D-7 D-8 D-9 D-11
xiv
Computing A5E0006550804
Contents
Figures, continued E-1 E-2 E-3 E-4 E-5 E-6 E-7 E-8 E-9 E-10 E-11 E-12 E-13 E-14 E-15 E-16 E-17 E-18 F-1 Using SIMATIC Computing on a Single Computer . . . . . . . . . . . . . . . . . . . Using Computing over DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tasks for Configuring the DCOM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . Distributed COM Configuration Properties . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Default Access Permissions for DCOM . . . . . . . . . . . . . . . Changing the Access Permissions for Users or Groups . . . . . . . . . . . . . . . Configuring the Default Launch Permissions for DCOM . . . . . . . . . . . . . . . Changing the Launch Permissions for Users or Groups . . . . . . . . . . . . . . . Selecting the Running Class for DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the DCOM Access Permissions for the Server . . . . . . . . . . . . Changing the Access Permissions for Users or Groups . . . . . . . . . . . . . . . Configuring the DCOM Identity Permissions for the Server . . . . . . . . . . . . Tasks for Configuring the DCOM Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Distributed COM Configuration Properties . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Default Access Permissions for DCOM . . . . . . . . . . . . . . . Changing the Access Permissions for Users or Groups . . . . . . . . . . . . . . . Configuring the Default Launch Permissions for DCOM . . . . . . . . . . . . . . . Changing the Launch Permissions for Users or Groups . . . . . . . . . . . . . . . Connecting to the Control Engine (Scrollbar Control Example) . . . . . . . . . E-2 E-3 E-4 E-5 E-6 E-7 E-8 E-9 E-10 E-11 E-12 E-13 E-14 E-15 E-16 E-17 E-18 E-19 F-9
Computing A5E0006550804
xv
Contents
Tables 1-1 1-2 2-1 5-1 5-2 5-3 5-4 5-5 5-6 5-7 5-8 5-9 5-10 5-11 5-12 5-13 5-14 5-15 6-1 6-2 6-3 6-4 6-5 6-6 6-7 6-8 6-9 6-10 7-1 A-1 A-2 A-3 B-1 C-1 D-1 F-1 F-2 F-3 G-1 Assigning Sample Addresses to the SIMATIC Controls . . . . . . . . . . . . . . Assigning Sample Addresses to the SIMATIC Controls . . . . . . . . . . . . . . Standard Controls Provided by Computing . . . . . . . . . . . . . . . . . . . . . . . . . Sample Program for Manually Creating a Connection . . . . . . . . . . . . . . . . Sample Program for Manually Creating an Event . . . . . . . . . . . . . . . . . . . . Sample Program for Creating a Connection for Responding to Events . Sample Program for Responding to Events in the Control Engine . . . . . Other Subroutines for Running the Sample Program . . . . . . . . . . . . . . . . . Reading a Single Variable from the Control Engine . . . . . . . . . . . . . . . . . . Writing a Single Variable to the Control Engine . . . . . . . . . . . . . . . . . . . . . . Sample Program for Reading an Array of Variables . . . . . . . . . . . . . . . . . . Sample Program for Writing an Array of Variables . . . . . . . . . . . . . . . . . . . Reading Multiple Variables in the Control Engine . . . . . . . . . . . . . . . . . . . . Writing Multiple Variables to the Control Engine . . . . . . . . . . . . . . . . . . . . . Reading and Writing Multiple Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Data Control . . . . . . . . . . . . . . . . . . . . . . . . Events of the Data Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Control Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Button Control . . . . . . . . . . . . . . . . . . . . . . Events of the Button Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Size of Data Types for the Edit control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . Events of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Codes for the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Label Control . . . . . . . . . . . . . . . . . . . . . . . Events of the Edit Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . Events of the Slider Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Properties and Methods of the DBuffer Control . . . . . . . . . . . . . . . . . . . . . Memory Areas of the S7 controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Addressing the S7 Data Types and S7 Memory Areas . . . . . . . . . . . . . . . S7 Data Types as C or Visual Basic Data Types . . . . . . . . . . . . . . . . . . . . Settings for the Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCodes (Error Event Codes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OPC Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading and Writing a Changed Value of a Property . . . . . . . . . . . . . . . . . Sample Program for an ActiveX Control Used with Computing . . . . . . . . Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Identifying the Type of Control Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1-21 2-4 5-17 5-18 5-20 5-21 5-22 5-24 5-24 5-25 5-26 5-27 5-27 5-28 5-29 5-30 5-30 6-9 6-10 6-13 6-18 6-19 6-20 6-26 6-26 6-34 6-35 7-7 A-2 A-4 A-5 B-11 C-3 D-4 F-6 F-8 F-12 G-1
xvi
Computing A5E0006550804
Chapter Overview
The Computing software provides you with a variety of ways to access and to use data from a control engineer, such as an S7 CPU, the Windows Logic Controller (WinLC) of WinAC Basis, or a slot PLC such as the CPU 416-2 DP ISA of WinAC Pro. This chapter provides some easy programming examples to help you become familiar with the power and flexibility that can be achieved by using the ActiveX controls provided by SIMATIC Computing. You can find the sample programs in the following directory on the drive where you installed the Computing software: [C:]\Siemens\WinAC\Examples
Warning After you assign a variable to the Value property of a SIMATIC or a third-party ActiveX control, the control is able to access process data. When you change the value that is displayed in the control, you are changing the value in the actual process. Do not connect this example to a control engine that is connected to equipment. Altering process data can cause unpredictable process operation, and unpredictable process operation could result in death or serious injury to personnel, and/or damage to equipment. Exercise caution to ensure that you do not access any data that could cause process equipment to operate erratically. Always install a physical emergency stop circuit for your machine or process.
Description
Creating a Sample I/O Panel Connecting Third-Party Controls to a Data Control Using Computing with Microsoft Excel Using the SoftContainer Provided by Computing
Computing A5E0006550804
1-1
1.1
Overview
Computing allows you not only to access the data in the control engine, but also allows you flexibility in how you access the data and what you you can do with the data. The examples in this chapter show some of the ways you can use the ActiveX controls provided by Computing. As shown in Figure 1-1, this chapter provides samples of subroutines for the following applications: S Create a user interface: You can use a the SIMATIC control with a third-party container (such as Microsofts Visual Basic) to create an I/O interface panel. See Section 1.2. (You can use this panel to test the other sample programs in this chapter.) Use a standard ActiveX control: You can also use a standard control (such as a Label control from Visual Basic) to access data in the control engine. See Section 1.3. Load data from the control engine into standard software packages: You can load data into a Microsoft Office application (such as Microsofts Excel). See Section 1.4.
Instead of using the third-party container (Section 1.2), you can use the SoftContainer provided by Computing to create a simple I/O panel. See Section 1.5. You can find the sample programs in the following directory on the drive where you installed the Computing software: [C:]\Siemens\WinAC\Examples
I/O Panel
QB2
PS ON BATTF RUN-P CPU INTF RUN EXTF STOP BUSF1 BUSF2 FRCE RUN STOP MRES
OFF I 0.2
I 0.0
Label control
Excel
Figure 1-1
1-2
Computing A5E0006550804
Use STEP 7 to create and download this program to the control engine.
OB1 : Sample program Counters The application examples in the Getting Started chapter use this program. Create a STEP 7 project, enter the program, and download it to the control engine.
Network 1 : Add 1
If I0.0 is ON, increment MW0 by 1 and transfer the output to QB0
I0.0
M6.0
IN1
Network 2 : Subtract 2
If I0.1 is ON, decrement MW2 by 2 and transfer the output to QB1
I0.1
M6.1
IN1
Network 3 : Add 3
If I0.2 is ON, increment MW4 by 3 and transfer the output to QB2
I0.2
M6.2
IN1
Figure 1-2
Computing A5E0006550804
1-3
1.2
Caution Using the timer function improperly or using breakpoints in Visual Basic with Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process. Concerning VB timers: The Timer function in Visual Basic version 5 allows a timer to interrupt code in progress within the same thread, which can cause problems with potentially serious consequences. If you use VB timers with Computing, observe the following guidelines: S Always kill (disable) the timers in the Form_Unload subroutine. Otherwise, a timer can trigger an event while the VB program is shutting down; this condition could cause your computer or your application to crash, lock up, or to continue running invisibly. If you start your timer in the Form_Load subroutine, the timer event could occur before the other objects have been instantiated. In order to ensure that the objects have been properly instantiated, always start a timer in the Form_Load subroutine with a large interval (such as 1 or 2 seconds) to allow the objects to be properly instantiated. Subsequent timer intervals can be set to shorter intervals.
1-4
Computing A5E0006550804
Inserting the SIMATIC Controls into the Toolbox for Visual Basic
Use the following procedure to create the sample I/O panel: 1. Open a standard Visual Basic project: Select the File dialog box.
"
Select the Standard EXE icon and click on the Open button. 2. Select the Project " Components menu command to display the Components dialog box. 3. As shown in Figure 1-3, select the following SIMATIC controls in the Components dialog box: Data control (Siemens SIMATIC Data Control) Panel control (Siemens S7 Panel Control, which comes with WinLC or a slot PLC) Diagnostic Buffer (Siemens SIMATIC Diagnostic Buffer Control) User controls (Siemens SIMATIC UserControls) The icons for Button, Label, Slider, and Edit appear in the Icon tab. 4. Click on the Apply button. The SIMATIC controls that you selected appear in the toolbox for Visual Basic. Click on the OK button to close the Components dialog box.
Components Controls Designers Insertable Objects
Siemens S7 Panel Control Siemens SIMATIC Data Control Siemens SIMATIC Diagnostic Buffer Co Siemens SIMATIC User Controls Siemens_S7WCVB_Slider Siemens_T agFile_CfgCtrl Third-Party Control... Third-Party Control... Third-Party Control...
OK
Cancel
Apply
Figure 1-3
Computing A5E0006550804
1-5
I/O Panel
QB0 0 0
QB1 0
QB2
VB Label controls
Edit controls
OFF
OFF
OFF
Button controls
I 0.0
I 0.1
I 0.2
VB Label controls
Data control
Figure 1-4
1-6
Computing A5E0006550804
Engine
Connections
Events
Name
Assigned Variable:
Browse...
100 0
Add...
Delete
Apply
Help
Figure 1-5
Engine
Connections
Events
Name
Assigned Variable:
Add...
Delete
OK
Cancel
Apply
Help
Figure 1-6
5. As shown in Figure 1-7, enter the properties to display and click on the Add button. Use the Edit button to correct entries and the Delete button to remove entries.
Computing A5E0006550804
1-7
Engine
Events
Name
mode:
Cancel properties
Add...
OK
Cancel
Apply
Help
Figure 1-7
6. As shown in Figure 1-8, select the Apply filter to properties check box to display only the properties listed in the filter. You can use the Apply filter to properties check box to toggle the filter on and off.
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 Button1 Enabled Value Button2 Edit1 Edit1 Add... Delete Filter... Update rate (m Dead band: Automatic write mode: Apply filter to properties Browse... Engine Connections Events Name
Assigned Variable:
Click on the check box to toggle the property filter on and off
OK
Cancel
Apply
Help
Figure 1-8
1-8
Computing A5E0006550804
7. As shown in See Figure 1-9, select the Value property of the control.
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 Button1 Enabled Value Button2 Edit1 Edit1 Add... Delete Filter... OK Engine Connections
Select the Value property. After you select the Value property, Events N enter the memory location of the variable to be assigned to that Assigned Variable: property
i0.0 Browse...
100 0
Apply
Help
Figure 1-9
8. Refer to Table 1-1 and assign the variables (memory addresses in the control engine) to the SIMATIC controls. 9. Click on the Apply button to enter the assigned variables.
Table 1-1 Assigning Sample Addresses to the SIMATIC Controls Address QB0 QB1 QB2 I 0.0 I 0.1 I 0.2 Description Output value of first counter Output value of second counter Output value of third counter Enable bit for first counter Enable bit for second counter Enable bit for third counter
Computing A5E0006550804
1-9
Connect via Tag Source Tag Source Browse Direct Connect PC Name Control Engine wcS7=3
OK
Cancel
Apply
Help
Figure 1-10
1-10
Computing A5E0006550804
Note If the control engine (for example, WinLC or a slot PLC such as the CPU 416-2 DP ISA) is not active, the Data control cannot make a connection. Before setting Visual Basic into Run Mode, ensure that the control engine is running.
1. Select the File " Save Project menu command to save the program before switching Visual Basic from Design mode to Run mode. 2. Click on the Start icon or select the Run " Start menu command to switch Visual Basic from Design mode to Run mode to run the I/O panel program. 3. Click on the Button Control for I 0.0 to start the first counter. See Figure 1-11. The Button control changes color to show the state of I 0.0. The Edit Control for QB0 displays the counter value. 4. Click on the Button control for I 0.1 to start the second counter. See Figure 1-11. The Button control changes color to show the state of PI 0.1. The Edit control for QB1 displays the counter value. 5. Click on the Button control for I 0.2 to start the third counter. See Figure 1-11. The Button control changes color to show the state of I 0.2. The Edit control for QB2 displays the counter value.
I/O Panel
QB0 0 0
QB1 0
QB2
OFF
OFF
OFF
I 0.0
Click here to start the first counter Figure 1-11
I 0.1
I 0.2
Click here to start the second counter
Computing A5E0006550804
1-11
1.3
Siemens SIMATIC Data Control Siemens SIMATIC Diagnostic Buffer Siemens SIMATIC User Controls Siemens_S7WCVB_Slider Siemens_T agFile_CfgCtrl Third-Party Control... Third-Party Control... Third-Party Control... Third-Party Control...
OK
Cancel
Apply
Figure 1-12
1-12
Computing A5E0006550804
3. Insert a Data control onto the VB form. (For information about inserting controls onto the VB form, see Section 1.1.) 4. Insert a VB label on your form. Change the Border Style property to 1Fixed Single. 5. Select the Data control and click the right mouse button to bring up the pop-up menu. From the pop-up menu, select Properties to display the Properties dialog box for the Data control. 6. From the Properties dialog box, select the Connections tab. Click on the + symbol to expand the list of controls. 7. Select the Label1 control and click on its + symbol to expand its properties list. 8. Select the Caption property and enter QB0 in the Assigned Variable field. See Figure 1-13. Click on the Apply and OK buttons to enter the data and close the Properties dialog box.
Siemens SIMATIC DataControl Properties General Controls: Label1 Alignment Appearance BackColor BorderStyle Caption Enabled Font ForeColor Add... Delete Filter... Engine Connections Events Name
100 0
Select the Caption property and enter the QB0 in the Assigned Variable field.
OK
Cancel
Apply
Help
Figure 1-13
Computing A5E0006550804
1-13
Note If the control engine (for example, WinLC or a slot PLC such as the CPU 416-2 DP ISA) is not active, the Data control cannot make a connection. Before setting Visual Basic into Run Mode, ensure that the control engine is running.
Use the following procedure to configure the Data control for communicating with the control engine and for running the sample program. 1. Select the Engine tab to configure the control engine. See Figure 1-14. 2. Select the Direct Connect option and enter either WinLC or wcS7=3 (for a slot PLC such as the CPU 416-2 DP ISA) for the control engine. Click on the Apply button to enter the data, and then click on the OK button to close the dialog box. 3. Switch Visual Basic from Design mode to Run mode to run the sample program.
Siemens SIMATIC DataControl Properties General Engine Connections Events Name
Connect via Tag Source Tag Source Browse Direct Connect PC Name Control Engine wcS7=3
OK
Cancel
Apply
Help
Figure 1-14
1-14
Computing A5E0006550804
1.4
This example shows how to use events to call code to update your Excel cells. Events are a means of tying changing data to code within a VBA form.
Note You can also use the I/O Panel application to turn on the peripheral input bits of the sample program running in the control engine. See Section 1.2 for information about the I/O Panel application.
Toolbars
"
4. Click on the Design Mode icon in the Control toolbox to put the spreadsheet into Design mode. 5. Insert a Command Button control onto the spreadsheet by clicking on the Command Button icon in the Control toolbox and then clicking the left mouse button in an empty area of the spreadsheet. 6. Move or size the Command Button control as required.
Computing A5E0006550804
1-15
2. In the Toolbox window, click the right mouse button to bring up a pop-up menu and select the Additional Controls... menu command. (To display the Toolbox window, select the View " Toolbox menu command.) 3. Scroll through the list of controls and select the Siemens Data control (by selecting the check box). Click on the OK button to insert the Data control onto the toolbox. 4. Select the Data control icon in the Toolbox window and insert a Data control onto UserForm1. 5. Select the Data control and click the right mouse button to bring up the pop-up menu. From the pop-up menu, select the Properties menu command to display the properties for the Data control (S7Data1) in the Properties window. 6. In the Properties window for S7Data1, select the (Custom) property field and then click on the expansion button to display the Properties dialog box for the Data control.
1-16
Computing A5E0006550804
Siemens SIMATIC DataControl Properties General Keys: S7Soft1 S7Data1 Add Add a new key: QB0 Engine Connections Events
Select the Data control and click on the Add button to display the Assigned Varia Add dialog box. Enter QB0 in the Add new key field and click on the OK button.
Name
Add... OK Cancel
OK
Cancel
Apply
Help
Figure 1-15
3. In the Properties dialog box, enter memory address QB0 in the Assigned Variable field. See Figure 1-16. 4. Click on the Apply button to accept the assigned variable. Notice that the event key QB0 appears in boldface under S7Data1. 5. Enter new event keys for QB1 (memory address QB1) and QB2 (memory address QB2) by selecting S7Data1 again and repeating steps 2. and 3.
Siemens SIMATIC DataControl Properties General Keys: S7Soft1 S7Data1 QB0 Update rate (ms): Dead band: 100 0 Engine Connections Events Name
Enter QB0 in the Assigned Variable field and click on the Apply button.
OK
Cancel
Apply
Help
Figure 1-16
Computing A5E0006550804
1-17
3. Select S7Data1 from the drop-down list of the Object field. 4. For the S7Data1_ValueChanged event, enter the following program: Select Case Property Case QB0 Worksheets(Sheet1).Range(B1).Value = Value Case QB1 Worksheets(Sheet1).Range(B2).Value = Value Case QB2 Worksheets(Sheet1).Range(B3).Value = Value End Select 5. Close the Code window for the Data control and close UserForm1.
Note To exit Excel or to activate the Excel menus, you must first close UserForm1.
1-18
Computing A5E0006550804
1.5
S7Soft1
"
Design
Data1
Computing A5E0006550804
1-19
Repeat these steps to insert three Button controls and three Edit controls. (For more information about inserting controls into the SoftContainer, see Section 8.2.) Figure 1-18 shows a sample layout for the controls in the process form (S7Soft1).
S7Soft1
Data control
Edit controls
OFF
OFF
OFF
Button controls
Figure 1-18
1-20
Computing A5E0006550804
Connect via Tag Source Tag Source Browse Direct Connect PC Name Control Engine wcS7=3
OK
Cancel
Apply
Help
Figure 1-19
Computing A5E0006550804
1-21
Use the following procedure to connect the Value property of Button control Button1 to PI 0.0 in the control engine: 1. Select the Connections tab of the Properties dialog box for the Data control. 2. Click on the + beside SIMATIC Data1 (or double-click on SIMATIC Data1) to display the listing of the controls in the container. 3. Click on the + beside Button1 (or double-click on Button1) to display the properties for the Button control. See Figure 1-20. 4. Scroll down to and select (click on) the Value property. Notice that when you select the Value property, the Assigned Variable field becomes active. 5. As shown in Figure 1-20, enter i0.0 in the Assigned Variable field. (You can use either upper case or lower case for designating memory locations.) 6. Click on the Apply button to enter the data. Repeat this procedure for the other Button controls and the three Edit controls, entering the variables listed in Table 1-2. After you have configured the connections for all of the controls, click on the OK button to confirm the changes and close the Properties dialog box.
Engine
Connections
Events
Name
100 0
Add...
Delete
After you select the property from the hierarchy, enter the memory location of the variable to be assigned to that property
Apply
Help
Figure 1-20
1-22
Computing A5E0006550804
Note The Data type field of the Edit control determines the size of the data to be displayed.
Use the following procedure to configure the Edit control: 1. Select the Edit control (Edit1) and click the right mouse button (right-click) to display the shortcut menu. From the shortcut menu, select the Properties menu command for the Edit control to display the Properties dialog box. 2. Click on the arrow beside the Data Format field to display the drop-down menu. 3. Scroll to the entry for decimal and click on 2 wDecimal to display the value in binary format (0 or 1). See Figure 1-21. 4. Click on the Apply button to enter the data and click on the OK button to close the Properties dialog box. Repeat this procedure for the other Edit controls (Edit2 and Edit3).
Siemens_SIMA TIC_UserControls.Edit Properties General Scaling Font Color Name Enabled 2 wDecimal 3 1 wThreeD 1 wFixedSingle 0 wAutomatic Locked Zer
Select Decimal from the dropdown list box for Data Format
OK
Cancel
Apply
Help
Figure 1-21
Computing A5E0006550804
1-23
S7Soft1
"
Click on the Run button to switch the container from Design mode to Run mode.
OFF
OFF
OFF
Click on the Button control to change bit I 0.0 from 0 to 1 The Edit control shows changing counter value in QB0
1-24
Computing A5E0006550804
Product Overview
Chapter Overview
The Computing package provides a method for other software applications to access the process data of your application. The Computing software provides ActiveX controls that can be inserted in any software application that is an ActiveX control container, like Visual Basic or Visual C++. While the SIMATIC controls provided by Computing have been tested with other containers provided by other vendors, some third-party containers may not function as described in this document. Refer to Appendix F for guidelines about third-party containers and about using custom ActiveX controls with the Data control.
Warning When you change the value that is displayed in an ActiveX control, whether from Computing or from a third-party software application, you are changing the value in your actual process. Altering process data can cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Exercise caution to ensure that you do not modify, nor permit unauthorized persons to access, any data that could cause process equipment to operate erratically. Always install a physical emergency stop circuit for your machine or process.
Description
Using an ActiveX Control to Access the Process Data Connecting to Your Process with the OPC Server
Computing A5E0006550804
2-1
Product Overview
2.1
Product Overview
The Computing software application allows you to access the control engine of your process to monitor and modify the process data. Figure 2-1 shows how the Computing software can be used with several control engines, such as the Windows Logic Controller (WinLC), a slot PLC such as the CPU4162 DP ISA, or S7 systems. Depending upon the communications card in your PC, you can access S7 PLCs over an MPI, PROFIBUSDP, or Industrial Ethernet network. The Computing software allows you to use symbolic namesinstead of absolute addressesto access memory locations or control engines. These symbols are stored in a tag file, which is created automatically from the symbol table of the STEP 7 project.
Third-party control Button control Edit control Label control Slider control
OPC Client
WinAC
Data control
WinLC
Computing
Slot PLC
MPI Card
PROFIBUS Card
Distributed I/O
2-2
Computing A5E0006550804
Product Overview
As shown in Figure 2-1, Computing provides several methods for accessing the process data: S Computing provides standard ActiveX controls through the Data control that access the process data. You can use them with the Computing container provided by the Computing software, or you can insert these controls into containers of other software packages. Computing provides a diagnostics buffer of the S7 controllers. This buffer is a ring buffer that contains entries written by the operating system of the S7 controller. Each entry contains information about a specific diagnostic event. The DBuffer control allows your program to access the diagnostics buffer and display the events. Computing provides an OPC (OLE for Process Control) server that allows any OPC application to access data in the control device. Computing does not provide the OPC client application. The OPC server is based on the OLE/COM technology from Microsoft. For more information about OPC, refer to the OPC specification: OLE for Process Control Data Access Standard, version 2.0 from the OPC Foundation.
System Requirements
To run the Computing software, it is recommended that your computer meet the following criteria: S A personal computer (PC) with the following: Pentium processor running at 166 MHz or faster (recommended) 64 Mbytes RAM Microsoft Windows NT version 4.0 (or higher) with Service Pack 3 S S S A color monitor, keyboard, and mouse (or other pointing device) which are supported by Microsoft Windows NT A hard drive with 20 Mbytes of free space At least 1 Mbyte free memory capacity on drive C for the Setup program (Setup files are deleted when the installation is complete.)
The product has been tested, and operated successfully, on machines as slow as a 486 processor running at 66 MHz with 24 Mbytes RAM operating on a Windows NT platform. Computing has also been successfully tested on high-end PCs with dual Pentium processors.
Computing A5E0006550804
2-3
Product Overview
2.2
Button OFF
Slider
Provides access to memory locations in the control engine. You can access bytes, words, or double-words. Adjusting the value of the Slider control changes the data in the control engine.
2-4
Computing A5E0006550804
Product Overview
Standard Controls Provided by Computing, continued Representation Description Displays the diagnostics buffer of the controller. The DBuffer control connects directly to the controller: it does not use the Data control to make the connection.
Event ID:
Details on Event
Event X of Y
Format: Update
Text
Hex
Language
Caution Using the timer function improperly or using breakpoints in Visual Basic with Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process. Concerning VB timers: The Timer function in Visual Basic version 5 allows a timer to interrupt code in progress within the same thread, which can cause problems with potentially serious consequences. If you use VB timers with Computing, observe the following guidelines: S Always kill (disable) the timers in the Form_Unload subroutine. Otherwise, a timer can trigger an event while the VB program is shutting down; this condition could cause your computer or your application to crash, lock up, or to continue running invisibly. If you start your timer in the Form_Load subroutine, the timer event could occur before the other objects have been instantiated. In order to ensure that the objects have been properly instantiated, always start a timer in the Form_Load subroutine with a large interval (such as 1 or 2 seconds) to allow the objects to be properly instantiated. Subsequent timer intervals can be set to shorter intervals.
Computing A5E0006550804
2-5
Product Overview
2.3
OPC Server C
2-6
Computing A5E0006550804
Product Overview
Your OPC client connects to the OPC server object provided by Computing. This connection allows you to create and manipulate OPC group objects, which organize the data to be accessed. You can activate or deactivate a group as a unit, or you can subscribe to the list in a group of items so that you can be notified when the data change. (A group is a collection of items, like MB0.) Figure 2-3 shows the connection from the OPC client application through WinAC to the process data.
Third-party OPC client application Computing: OPCServer.WinAC WinAC Control engine Distributed I/O Figure 2-3 Using the OPC Server to Access Your Process Data
To access the OPC server and its contents, you must provide your OPC client with the name (ProgID, or programmatic identifier) of the server object. The name of the OPC server object that is provided by Computing is: OPCServer.WinAC For more information about the OPC server provided by Computing, refer to the OPC Server Interface Manual.
Computing A5E0006550804
2-7
Product Overview
2-8
Computing A5E0006550804
Chapter Overview
This chapter provides the following information: S S S S Section 3.1 lists the authorization requirements for installing and running the Computing software. Section 3.2 describes how to install the authorization. Section 3.3 describes how to install and uninstall the Computing software. Section 3.4 describes how to use the PG/PC Interface to connect Computing to a slot PLC or a communications card.
Section 3.1 3.2 3.3 3.4 Overview Authorization Installing and Uninstalling the Computing Software Connecting Computing to a Slot PLC or Communications card Description Page 3-2 3-3 3-5 3-7
Computing A5E0006550804
3-1
3.1
Overview
The Computing software provides ActiveX controls, which you can use to create a tailored view into your process. Computing lets you use any mix of S7 and third-party ActiveX controls not only to view, but also to modify, process data. Follow the guidelines below for authorization for your Computing software. S S S S For WinAC Basis, use the WinAC authorization For SIMATIC Net, use the SIMATIC Net authorization For upgrading WinAC Pro with Computing 3.0 standalone, use the Computing authorization For standalone, use the Computing authorization.
Note To run Computing on a different PC than the WinLC, you must purchase SIMATIC Computing standalone.
3-2
Computing A5E0006550804
3.2
Authorization
Computing requires a product-specific authorization (or license for use). The software is therefore copy-protected and can be used only if the relevant authorization for the program or software package has been found on the hard disk of the computer.
Note If you remove the authorization, Computing continues to operate; however, a notification message appears every six minutes to alert you that the authorization is missing.
Authorization Disk
An authorization diskette is included with the software. It contains the authorization and the program (AUTHORSW) required to display, install, and remove the authorization. There are separate authorization diskettes for each of the SIMATIC automation software products. You must install the authorization for each product as part of the installation procedure for that software.
Caution If improperly transferred or removed, the authorization for Computing may be irretrievably lost. The Readme file on the authorization diskette contains guidelines for installing, transferring, and removing the authorization for Computing. If you do not follow these guidelines, the authorization for Computing may be irretrievably lost. Losing the authorization would prohibit you from modifying any program that was downloaded to Computing and from downloading another program to the Computing. Read the information in the Readme file on the authorization diskette, and follow the guidelines in regard to transferring and removing the authorization.
Computing A5E0006550804
3-3
Note Always enter drive C as the destination drive for the authorization for Computing.
If you attempt to start Computing and there is no authorization available for the software, a message informs you of this. If you want to install the authorization, use the AUTHORSW program on the authorization diskette. This program allows you to display, install, and remove authorizations.
Removing an Authorization
If you should need to repeat the authorization, for example, if you want to reformat the drive on which the authorization is located, you must remove the existing authorization first. You need the original authorization diskette to do this. Use the following steps to transfer the authorization back to the authorization diskette: 1. Insert the original authorization diskette in your floppy disk drive. 2. Start the program AUTHORSW.EXE from the authorization diskette. 3. From the list of all authorizations on drive C, select the authorization to be removed. 4. Select the menu command Authorization
"
Transfer... .
5. In the dialog box, enter the target floppy drive to which the authorization will be transferred and confirm the dialog box. 6. The window with the list of authorizations remaining on the drive is then displayed. Close the AUTHORSW program if you do not want to remove any more authorizations. You can then use the diskette again to install an authorization. You must use the authorization diskette to remove any existing authorizations. If you need to remove Computing completely, you must remove the DP authorization. If a fault occurs on your hard disk before you can back up the authorization, contact your local Siemens representative.
3-4
Computing A5E0006550804
3.3
Note You must have administrator (ADMIN) privileges to install the Computing software.
Computing A5E0006550804
3-5
Your software will be better organized if you uninstall any older versions before installing the new version. Overwriting an old version with a new version has the disadvantage that if you then uninstall, any remaining components of the old version are not removed. If you uninstall the older version of Computing, you must reboot your computer before installing the new version.
3-6
Computing A5E0006550804
3.4
Note You can only view one slot PLC or one communications card at a time.
Follow these steps to configure Computing for communicating with a slot PLC or communication card: 1. From the Windows NT Start menu, select Start " Simatic PC Based Control " WinCP Configurator. 2. Select the the Connection tab, then click on the Setting the PG/PC Interface button. The PG/PC Interface dialog box appears.
Access Path Access Point of the Application: Computing > CPU4162 DP ISA card (local) Setting the PG/PC Interface (Standard for STEP 7) Access Path Access Point of Application: Interface Parameter Assignment Micro/WIN Used: >PC/PPI cable (PPI) (Standard for Micro/WIN) Properties... CP4162 DP ISA (local) Interface Parameter set used: MPIISAPC/PPI on board (MPI) Properties... cable (PPI) CP4162 DP ISA (local) MPIISA on board (PPI) CP5611 (PROFIBUS) MPIISA Card (PROFIBUS) Copy... PC Adapter (MPI) CP5412A2(MPI) Delete PC Adapter (PROFIBUS)PC/ Copy... CP5412A2(PROFIBUS) (Assigning Parameters to a PC/PPI Cable PPI cable (PPI) for a PPI Network) PC Internal (local) Interfaces Delete TCP/IP>3Com Etherlink III Adapter Install... Communication with WinAC components in this OK PG/PC) Interfaces Add/Remove: Select...
Cancel
Help
OK
Cancel
Help
Figure 3-1
Setting the PG/PC Interface for Slot PLC CPU 4162 DP ISA (local)
3. From the Access Point of Application drop-down list, select Computing. 4. Select the interface parameter from the parameter set that corresponds to your network communications path, for example CPU4162 DP ISA (local). The PLC or card you selected appears in the Access Point of the Application field (Figure 3-1).
Computing A5E0006550804
3-7
To set the Computing interface setting for a local slot PLC, select: COMPUTING > <cardname> (local) To set the Computing interface setting for an S7 system on a TCP/IP LAN, select: COMPUTING > <cardname> (TCP/IP) To set the Computing interface setting for an S7 system on an Industrial Ethernet network (ISO Transport protocol), select: COMPUTING > <cardname> (ISO Transport) To set the Computing interface setting for an S7 system on a PROFIBUS network, select COMPUTING > <cardname>(PROFIBUS).
3-8
Computing A5E0006550804
Chapter Overview
Computing allows you to access data from control engines (either WinLC of WinAC Basis, a slot PLC such as the CPU 4162 DP ISA of WinAC Pro, or other S7 PLCs. These control engines can be installed on the same computer as Computing, or Computing can use the local area network to access the control engine.
Note The term slot PLC in the manual refers to a slot PLC such as CPU 4162 DP ISA or CPU 4162 DP ISA Lite. In the manual, the CPU4162 DP ISA Lite is treated identically to the CPU4162 DP ISA.
Computing allows you to communicate across a local area network using Windows NTs Distributed Component Object Model (DCOM). You use DCOM to integrate distributed applications by way of a LAN. A distributed application consists of multiple processes or different computers that cooperate to accomplish a single task. Computing can also communicate with a local or remote control engine in an MPI, PROFIBUSDP, or H1 network. You can use the PG/PC Interface to set up connection with the control engine.
Section 4.1 4.2 4.3 4.4 Description Accessing Data in Control Engines Accessing a Local Control Engine Accessing a Remote Control Engine Communicating with Multiple Control Engines Page 4-2 4-4 4-5 4-6
Computing A5E0006550804
4-1
4.1
Computing provides SIMATIC controls that utilize Microsofts ActiveX technology to allow third-party applications (such as Microsofts Excel or Visual Basic) to access data in the control engine. In addition to these SIMATIC controls, Computing provides a server that allows other applications to use an OPC (OLE for Process Control) interface. Using a tag file, you can access the data symbolically on a PC where STEP 7 is not installed. The TagFile Configurator creates a tag file from the symbol table of STEP 7. The tag file also provides you with the capability to connect your application to more than one control engine simultaneously. (See Section 4.4.)
4-2
Computing A5E0006550804
Third-party applications
OPC Clients
STEP 7
Tag file
Optional
SIMATIC controls
OPC Server
Computing
PC 1
Control Engine Industrial Ethernet Figure 4-1 PROFIBUS WinLC CPU 416-2 DP ISA MPI Card
Computing A5E0006550804
4-3
4.2
Optional
I/O
Drain_Valve I 0.1
Figure 4-2
4-4
Computing A5E0006550804
4.3
Computing
STEP 7
Fill_Valve I 0.0
PC 1 Control Engine
I/O
Drain_Valve I 0.1
Network
Figure 4-3
Computing A5E0006550804
4-5
4.4
Note You can only view one slot PLC or one communication card at a time
By utilizing Microsofts DCOM technology and/or other Siemens networks, a tag file allows you to access a variety of control engines and applications throughout your local area network. As shown in Figure 4-4, a computer running Computing (PC 1) can use a tag file to access data in the control engines running on another computer (PC 2), as well as a third-party application (such as Microsofts Excel or Visual Basic). As with a single control engine (see Sections 4.2 and 4.3), the tag file also provides the capability for using symbols to access the data in the various control engines. See Appendix E for information about using DCOM to connect Computing to multiple control engines. For more information about tag files and the TagFile Configurator, see Chapter 9.
4-6
Computing A5E0006550804
Tag file
Control Engine
Network
Tag file
Computing
PC 2
Control Engine
I/O
Figure 4-4
Computing A5E0006550804
4-7
4-8
Computing A5E00065508-04
Chapter Overview
The Data control provides the connection between your ActiveX controls and the control engine (for example, WinLC or a slot PLC such as the CPU 416-2 DP ISA). The Data control has specific properties that you can configure: S For the SoftContainer provided by SIMATIC Computing: double-clicking on the Data control displays the Properties dialog box. This dialog box contains the following tabs: General, Engine, Connections, Events, and Name. For other container applications (such as Microsoft Visual Basic): access the properties as for any other control in that container (for example, by using the right mouse button). Open the context menu for the Data control by clicking the right mouse button and selecting the Properties menu command.
Section 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 Description Connecting the SIMATIC Controls to the Control Engine Configuring the Connection Properties for the Data Control Selecting the Control Engine for the Data Control Connecting the ActiveX Controls to the Control Engine Filtering the Properties for the ActiveX Controls Configuring Custom Events Creating a Connection Table Sample Program for Creating a Connection Table and an Event Table Sample Program for Responding to Events Sample Program for Reading and Writing Data Sample Program for Reading and Writing Boolean Data Properties, Methods, and Events of the Data Control Page 5-2 5-3 5-4 5-9 5-13 5-15 5-16 5-17 5-19 5-24 5-29 5-30
Computing A5E0006550804
5-1
5.1
Caution Failing to disable the timers in your program could cause timer-generated connections to remain connected, allowing these connections to continue to write data to the control engine. This could cause the control engine to operate erratically, which could potentially cause damage to equipment and injury to personnel. To ensure that all connections are disconnected when your program closes, always disable all timers before the End statement in the Form_Unload subroutine.
In order to access process data, the SIMATIC Computing controls (Button, Edit, Label, and Slider) must first establish a connection through the Data control. Figure 5-1 shows the relationship between the Data control and the other SIMATIC controls.
Note The Panel control (available with WinLC or a slot PLC) and the DBuffer control (for accessing the diagnostics buffer of S7 controllers) do not use the Data control for connecting to the control engine.
You use the Connections tab of the Data control to assign a variable (the memory location) to the Value property of each control. The Data control configures the control engine to check the memory locations of the assigned variables at a specified rate (in milliseconds). If there is a change in the value, the new value is written to the Data control. The Data control then writes the new value to the other controls.
Third-party control Button control Edit control Computing Label control Slider control Data control
OPC Client
OPC Server
Control engine (such as WinLC) Distributed I/O Figure 5-1 Using the Data Control for Connecting to a Control Engine
5-2
Computing A5E0006550804
5.2
AutoConnect: AutoConnect Timeout (ms): Default Update Rate (ms): Default DeadBand: Show Error Boxes: 100 100 0
OK
Cancel
Apply
Help
Figure 5-2
Computing A5E0006550804
5-3
5.3
Connection via Tag Source Tag Source Browse Direct Connection PC Name Control Engine WinLC
OK
Cancel
Apply
Help
Figure 5-3
A control engine may be either a slot PLC, such as the CP 416-2 DP ISA, an S7 CPU, or WinLC. The control engine strings for the Data Control are of two types: S S Direct to WinLC Over a Siemens network
The control engine string for a direct connection to WinLC is WinLC . It is a COM connection; you do not need to use the PG/PC Interface to configure it. Connections for the following network types are configured using the PG/PC Interface settings are as follows: S S S access to MPI network: COMPUTING> <cardname> (MPI) access to DP network: COMPUTING> <cardname> (PROFIBUS) access to H1 network: COMPUTING> TCP/IP> <cardname> (For access to the network, the NCM option package and STEP 7 v5 SP3 must be installed.)
5-4
Computing A5E0006550804
Note To use WinLC as a control engine, you must also set up the connection in WinLC. Refer to the chapter on connecting STEP 7 to WinLC or PLCs in the SIMATIC Windows Logic Controller (WinLC) Manual for directions.
The tag file also provides a completion aid for entering the symbols. For more information about tag files, see Chapter 9. For more information about connecting to multiple control engines, see Section 4.4. See Section 9.1 for information about using STEP 7 and the TagFile Configurator for connecting to remote control engines. Use the following procedure to connect the Data control to the control engine which is specified in a tag file: 1. Double-click on the Data control (or use the Edit " Properties menu command) to display the Properties dialog box for the Data control. 2. Click on the Engine tab to display the configuration choices. 3. Select the Connection via Tag Source option. 4. As shown in Figure 5-4, click on the Browse button and select the valid tag file (*.tsd). 5. Click on the Apply button to configure the Data control for using the specified tag file for connecting to the control engine.
Computing A5E0006550804
5-5
Connection via Tag Source Tag Source Browse Direct Connection PC Name Control Engine WinLC
Click on the Browse button to select a specific tag file for the SIMATIC controls
OK Cancel
Figure 5-4
Some strings have been simplified for easier entry, but Data Control will accept longer strings used by applications that were created with previous versions of Computing (for example, S7DosIntf\MPI=3).
5-6
Computing A5E0006550804
Direct Connection on a Local Computer Other ActiveX controls <local> Data control Control Engine
DCOM
Control Engine
Note When you configure the Data control to connect to a single (specific) control engine, you cannot connect a tag file. This means that you cannot use symbol names for the variables in the control engine. To use symbol names, select the option for connecting to multiple control engines and browse to a tag file that contains symbols for only one control engine.
Use the following procedure to configure the Data control for connecting to a specific control engine: 1. Double-click on the Data control (or use the Edit " Properties menu command) to display the Properties dialog box for the Data control. 2. Click on the Engine tab to display the configuration choices. 3. Select the Direct Connection option. See Figure 5-6. 4. To connect to a control engine on the local computer, enter <local> in the PC Name field. Note that you cannot access WinLC and a slot PLC simultaneously. To connect to a control engine on a remote computer: In the PC Name field, enter the network name of server computer (for example, PC_2). In the Control Engine field, enter the name of the control engine, such as WinLC or wcS7=3 (for a slot PLC such as the CPU 416-2 DP ISA of WinAC Pro).
Computing A5E0006550804
5-7
Select Direct Connection and enter the name of the server computer and the control engine
Browse
OK
Cancel
Apply
Help
Figure 5-6
Note To connect to a remote computer via LAN, you must have configured the different computers for DCOM. See Sections E.2 and E.3 for information about configuring the server and client computers for DCOM.
5-8
Computing A5E0006550804
5.4
Caution Using the timer function improperly or using breakpoints in Visual Basic with Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process. Concerning VB timers: The Timer function in Visual Basic version 5 allows a timer to interrupt code in progress within the same thread, which can cause problems with potentially serious consequences. If you use VB timers with Computing, observe the following guidelines: S Always kill (disable) the timers in the Form_Unload subroutine. Otherwise, a timer can trigger an event while the VB program is shutting down; this condition could cause your computer or your application to crash, lock up, or to continue running invisibly. If you start your timer in the Form_Load subroutine, the timer event could occur before the other objects have been instantiated. In order to ensure that the objects have been properly instantiated, always start a timer in the Form_Load subroutine with a large interval (such as 1 or 2 seconds) to allow the objects to be properly instantiated. Subsequent timer intervals can be set to shorter intervals.
Note Computing does not allow you to write to timers in the control engine.
Use the following procedure to assign a variable in the control engine to a property of the control: 1. On the Connections tab of the Data control, select (click on) the name of the property.
Computing A5E0006550804
5-9
2. In the Assigned Variable field, enter the memory address in the control engine:
Note If you have attached a tag file to the Data control, you can enter the symbols instead of the absolute addresses. You can also click on the Browse button to navigate to the symbol. Entering a . (dot or period) displays a list of valid tag files or symbols of each hierarchic level.
If you selected the Direct Connection option for the control engine (not using symbols), enter the absolute address (such as MB0) for the memory location in the control engine. See Appendix A for information about the data types and memory areas of the S7 controllers. If you selected the Connection via Tag Source option to use multiple control engines (but are not using symbols), and the absolute address (such as MB0) for the memory location in the default control engine. See Appendix A for information about the data types and memory areas of the S7 controllers. You can also append an absolute variable address to the symbolic name of a control engine (for example, ce1.mb0, ce2.mb0). See Using Absolute Addresses with a Tagfile in Section 9.3 for information about setting the default control engine. If you selected the Connection via Tag Source option to use symbols (regardless of whether you are connecting either to a single control engine or to multiple control engines) enter the symbolic address for the memory location (such as Start_Program). You can append the address to the symbolic name of the control engine (such as PC_2_WinLC ). 3. Click on the Apply button to assign the variable to the property.
Siemens SIMATIC DataControl Properties General Controls:
S7Data1
Engine
Connections
Events
Name
100
Add...
Delete
After you select the property from the hierarchy, enter the memory location of the variable to be assigned to that property
OK
Cancel
Apply
Help
Figure 5-7
5-10
Computing A5E0006550804
If you identified a tag source or file, you can browse to a symbol for the variable. Click on the Browse button (as shown in Figure 5-8) and select the variable from the symbols listed for the tag source or file. Select a symbol or tag and press Enter. (Figure 5-8 shows the property listing with a filter applied to display only the Enabled and Value properties. for more information about filtering the property listing, see Section 5.5.)
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 Button1 Enabled Value Button2 Edit1 Automatic writ Add... Delete Filter... Apply filter Update rate (ms): Dead band: 100 0 Browse... Engine Connections Events Name
Assigned Variable:
Click on the Browse button to find a specific symbol name in the tag file.
OK
Cancel
Apply
Help
Figure 5-8
Computing A5E0006550804
5-11
Adding a Connection
If you want to configure a connection for an ActiveX control before you place the control into your ActiveX container, you can use the Add button to add an instance of the control to the Controls list. Click on the Add button to specify the instance that you want to connect to the Data control. After you have added the ActiveX control instance to the Controls list, you can select the instance from the list, choose the Add button again and add any additional properties. For instance, you could add an Edit control instance to the connections list, and then add the Value property to the Edit control in order to assign a variable to the Edit control.
Deleting a Connection
If you remove a control from the ActiveX container, the connection remains configured in the Data control. This means that the next time you place a control of the same name into the container, the connection that you configured for the previous control of that name is automatically applied to the new control. For instance, if you remove a control called Edit1, and later insert a new Edit control, the default name for the new control is Edit1, and the new control inherits the existing Edit1 connection. Use the Delete button if you want to prevent new controls from inheriting a previously configured connection: from the Controls list, select the instance whose connection you want to delete, and click on the Delete button.
Note If you remove a control, or change your mind about adding a control after you have already configured a connection for it using the Add button, you can only delete the connection to it if there is no control in the ActiveX container that uses the name specified in the connection. Delete the connection before you add any other control that uses the name that is specified in the connection. You cannot use the Delete button to remove a connection to a control that is present in the ActiveX container.
5-12
Computing A5E0006550804
5.5
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 Button1 Button2 Edit1 Edit2 Dead band: 0 Update rate (ms): 100 Engine Connections Events Name
Assigned Variable:
OK
Cancel
Apply
Help
Figure 5-9
3. As shown in Figure 5-10, enter the properties to display and click on the Add button. Use the Edit button to correct entries and the Delete button to remove entries. 4. As shown in Figure 5-11, select the Apply filter to properties check box to display only the properties listed in the filter. Use the Apply filter to properties check box to toggle the filter on and off.
Computing A5E0006550804
5-13
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 But But Edi Edi Add... Add... OK Edit Delete Cancel 0 Engine Connections Events Name
mode:
properties
OK
Cancel
Apply
Help
Figure 5-10
Siemens SIMATIC DataControl Properties General Controls: S7Soft1 S7Data1 Button1 Enabled Value Button2 Edit1 Edit1 Add... Delete Filter... Update rate (m Dead band: Automatic write mode: Apply filter to properties Browse... Engine Connections Events Name
Assigned Variable:
Click on the check box to toggle the property filter on and off
OK
Cancel
Apply
Help
Figure 5-11
5-14
Computing A5E0006550804
5.6
Add...
Delete
OK
Cancel
Apply
Help
Figure 5-12
Adding an Event
The Add button allows you to add user-specified events for controller value changes. You can write your own code to handle the event by handling the ValueChanged event of a Data control. Select a Data control from the expandable list under the Keys field and click on the Add button; then type any name you choose for the event (for example, OverflowWarning). Next, type a variable in the Assigned Variable field to identify the process value that causes the event to be fired. Figure 5-12 shows an sample event that has been added. A change in the value of M17.3 calls the event handler for the Data control. The input to the event handler is the text string OverflowWarning.
Deleting an Event
To delete a user-specified event, expand the list under Keys, select the desired event, and click on the Delete button.
Computing A5E0006550804
5-15
5.7
When you use the Properties dialog box to configure the Data control, the Data control automatically creates a connection table. You can also create a program to manually create connection tables. See Section 5.8 for a sample program for manually creating a connection table.
5-16
Computing A5E0006550804
5.8
Note Instead of creating a connection table, consider using the read and write methods for the Data control (ReadVariable, ReadMultipleVariables, WriteVariable, and WriteMultipleVariables). These methods allow you to access more data with just one line of code.
Table 5-1 shows sample Visual Basic code for a Label control called lblChange in your form to MW2 in the control engine. The value stored in MW2 displays as the caption in the label control.
Table 5-1
Visual Basic Code Dim ControlTable (4) As String Define a ControlTable ControlTable ControlTable ControlTable connection table for lblChange (0) = Caption Property (1) = MW2:WORD Source (memory location) (2) = 100 Update rate (3) = 0.0 Dead band
Attach the connection table to S7Data1 S7Data1.ConnectObject lblChange, ControlTable Connect to the control engine S7Data1.Connect Connects to the control engine
Computing A5E0006550804
5-17
Table 5-2
Visual Basic Code Dim controlTable(4) AS String Define the event keys ControlTable(0)=M0_0 ControlTable(1)=M0.0 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_1 ControlTable(1)=M0.1 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_2 ControlTable(1)=M0.2 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_3 ControlTable(1)=M0.3 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_4 ControlTable(1)=M0.4 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_5 ControlTable(1)=M0.5 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_6 ControlTable(1)=M0.6 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_7 ControlTable(1)=M0.7 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) End Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand
5-18
Computing A5E0006550804
5.9
Start Events
Figure 5-13
Caution Failing to disable the timers in your program could cause timer-generated connections to remain connected, allowing these connections to continue to write data to the control engine. This could cause the control engine to operate erratically, which could potentially cause damage to equipment and injury to personnel. To ensure that all connections are disconnected when your program closes, always disable all timers before the End statement in the Form_Unload subroutine.
Computing A5E0006550804
5-19
Table 5-3
Visual Basic Code Dim controlTable(4) AS String Define the event keys ControlTable(0)=M0_0 ControlTable(1)=M0.0 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_1 ControlTable(1)=M0.1 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_2 ControlTable(1)=M0.2 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_3 ControlTable(1)=M0.3 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_4 ControlTable(1)=M0.4 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_5 ControlTable(1)=M0.5 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_6 ControlTable(1)=M0.6 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) ControlTable(0)=M0_7 ControlTable(1)=M0.7 ControlTable(2)=500 ControlTable(3)=0 IResult=S7Data1.ConnectName(,ControlTable) End Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand Event Name Process Variable Update Rate DeadBand
5-20
Computing A5E0006550804
Table 5-4
Visual Basic Code Private Sub S7Data4_ValueChanged(ByVal Property As String, ByVal VarName As String, ByVal Value As Variant, ByVal Quality As Integer) Evaluates which event occurred Select Case Property Case M0_0 If Value = True Then Light(0).FillColor = vbGreen Else Light(0).FillColor = vbRed End If Case M0_1 If Value = True Then Light(1).FillColor = vbGreen Else Light(1).FillColor = vbRed End If Case M0_2 If Value = True Then Light(2).FillColor = vbGreen Else Light(2).FillColor = vbRed End If Case M0_3 If Value = True Then Light(3).FillColor = vbGreen Else Light(3).FillColor = vbRed End If Case M0_4 If Value = True Then Light(4).FillColor = vbGreen Else Light(4).FillColor = vbRed End If Case M0_5 If Value = True Then Light(5).FillColor = vbGreen Else Light(5).FillColor = vbRed End If Case M0_6 If Value = True Then Light(6).FillColor = vbGreen Else Light(6).FillColor = vbRed End If Event M0_0 turns Light(0) green
Computing A5E0006550804
5-21
Table 5-4
Case M0_7 If Value = True Then Light(7).FillColor = vbGreen Else Light(7).FillColor = vbRed End If End Select End Sub
Running the Sample Program (Generating the Events in the Control Engine)
Table 5-5 provides sample Visual Basic code for changing the value stored in MB0. Changing the value of MB0 then causes the control engine to generate the events defined in the connection table (Table 5-3). S S The command button (cmdStartEvents) starts or stops the timer (Timer1). The timer (Timer1) reads the value stored in MB0 of the control engine, increments the value, and writes the new value back to the control engine.
The changed value of MB0 causes the control engine to generate the events.
Caution Failing to disable the timers in your program could cause timer-generated connections to remain connected, allowing these connections to continue to write data to the control engine. This could cause the control engine to operate erratically, which could potentially cause damage to equipment and injury to personnel. To ensure that all connections are disconnected when your program closes, always disable all timers before the End statement in the Form_Unload subroutine.
5-22
Computing A5E0006550804
Table 5-5
Visual Basic Code Private Sub cmdStartEvents_Click() If cmdStartEvents.Caption = Start Events Then Timer1.Enabled = True cmdStartEvents.Caption = Stop Events Else Timer1.Enabled = False cmdStartEvents.Caption = Start Events End If End Sub Private Sub Timer1_Timer() Dim mb0 As Variant Dim my_state As Long S7Data4.ReadVariable MB0, mb0, my_state, 0 If mb0 < 254 Then mb0 = mb0 + 1 Else mb0 = 0 End If Label2.Caption = mb0 S7Data4.WriteVariable MB0, mb0, 0 End Sub
Computing A5E0006550804
5-23
5.10
Caution Using the timer function improperly or using breakpoints in Visual Basic with Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process. Concerning VB timers: The Timer function in Visual Basic version 5 allows a timer to interrupt code in progress within the same thread, which can cause problems with potentially serious consequences. If you use VB timers with Computing, observe the following guidelines: S Always kill (disable) the timers in the Form_Unload subroutine. Otherwise, a timer can trigger an event while the VB program is shutting down; this condition could cause your computer or your application to crash, lock up, or to continue running invisibly. If you start your timer in the Form_Load subroutine, the timer event could occur before the other objects have been instantiated. In order to ensure that the objects have been properly instantiated, always start a timer in the Form_Load subroutine with a large interval (such as 1 or 2 seconds) to allow the objects to be properly instantiated. Subsequent timer intervals can be set to shorter intervals.
5-24
Computing A5E0006550804
Table 5-6
Visual Basic Code Private Sub ReadSingleRealVariable Dim rc As Long Dim name_s As String Dim value_v As Variant Dim state_l As Long Dim timeout_l As Long Read one Real (floating point) value name_s = MD0:REAL timeout_l = 0 rc = S7Data3.ReadVariable(name_s, value_v, state_l, timeout_l) Display the value and return code in a List Box ListBox1.Clear ListBox1.AddItem RetCode = & Hex(rc) ListBox1.AddItem & name_s & = & value_v ListBox1.AddItem State = & Hex(state_l) End Sub
Table 5-7
Visual Basic Code Private Sub WriteSingleRealVariable Dim rc As Long Dim name_s As String Dim value_v As Variant Dim timeout_l As Long Write one Real (floating point) value name_s = MD0:REAL value_v = (Rnd * 1000) timeout_l = 100 rc = S7Data3.WriteVariable(name_s, value_v, timeout_l) Display the value and return code in a List Box ListBox1.Clear ListBox1.AddItem Wrote & name_s & = & value_v ListBox1.AddItem Return Code = & Hex(rc) End Sub
Computing A5E0006550804
5-25
Note Read and write STRING or CHAR data as Visual Basic BSTR data. Do not use an array of CHAR to emulate a STRING. Use one BSTR for each STRING or CHAR, regardless of the length of the data being accessed. For example: S To access CHAR[50] (which designates 50 bytes or 50 characters), use a BSTR of up to 50 bytes and not 50 individual BSTRs. S To access STRING[50] (which designates a string of 50 characters), use a BSTR of up to 50 bytes and not 50 BSTRs.
Table 5-8
Visual Basic Code Private Sub ReadArrayOfReals Dim rc As Long Dim name_s As String Dim value_v As Variant Dim state_1 As Long Dim timeout_l As Long Randomize Read an array of Real (floating point) values name_s = MD0:Real[3] timeout_l = 0 rc = S7Data3.ReadVariable(name_s, value_v, state_1, timeout_l) Display the values ListBox1.Clear ListBox1.AddItem ListBox1.AddItem value_v(2) ListBox1.AddItem End Sub and return codes for the array in a List Box Return Code = & Hex(rc) name_s & = & value_v(0) & & value_v(1) & State = & Hex(state_1)
5-26
Computing A5E0006550804
Note Read and write STRING or CHAR data as Visual Basic BSTR data. Do not use an array of CHAR to emulate a STRING. Use one BSTR for each STRING or CHAR, regardless of the length of the data being accessed. For example: S To access CHAR[50] (which designates 50 bytes or 50 characters), use a BSTR of up to 50 bytes and not 50 individual BSTRs. S To access STRING[50] (which designtes a string of 50 characters), use a BSTR of up to 50 bytes and not 50 BSTRs.
Table 5-9
Visual Basic Code Private Sub WriteArrayOfReals Dim rc As Long Dim name_s As String Dim timeout_l As Long Dim value_b(2) As Byte for byte write Dim value_w(2) As Integer for word write Dim value_r(2) As Single for real write Read an array of Real (floating point) values name_s = MD0:REAL[3] value_r(0) = (Rnd * 1000) value_r(1) = (Rnd * 1000) value_r(2) = (Rnd * 1000) timeout_l = 100 rc = S7Data3.WriteVariable(name_s, value_r, timeout_l) Display the values ListBox1.Clear ListBox1.AddItem ListBox1.AddItem ListBox1.AddItem ListBox1.AddItem End Sub and return codes for the array in a List Box Return Code = & Hex(rc) Wrote MD0:REAL[0] = & value_r(0) Wrote MD0:REAL[1] = & value_r(1) Wrote MD0:REAL[2] = & value_r(2)
Computing A5E0006550804
5-27
5-28
Computing A5E0006550804
5.11
rc = S7Data1.ReadMultiVariables(mybools, vals_v, states_v) End Sub Private Sub Write_Booleans() Dim mybools(7) As String Dim myvals(7) As Variant Dim states_v As Variant Dim rc As Long mybools(0) = m0.0 mybools(1) = m0.1 mybools(2) = m0.2 mybools(3) = m0.3 mybools(4) = m0.4 mybools(5) = m0.5 mybools(6) = m0.6 mybools(7) = m0.7 myvals(0) myvals(1) myvals(2) myvals(3) myvals(4) myvals(5) myvals(6) myvals(7) = = = = = = = = False False False False False False False False
Computing A5E0006550804
5-29
5.12
B-31
B-44 B-45
5-30
Computing A5E0006550804
Computing A5E0006550804
5-31
5-32
Computing A5E0006550804
User Controls
Chapter Overview
Computing provides ActiveX User controls for accessing process data. You use the Properties dialog box of the Data control to establish a connection between the user control and the control engine. Each control has a properties dialog box for defining the performance of the control. S S S S Button control allows you to turn individual bits of memory on and off. Edit control provides access to the memory locations of the control engine. Label control allows you to display a constant string. Slider control provides an interface for monitoring and modifying analog variables.
Section 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6-21 6.10 6.11 6.12 6.13 6.14 Description Connecting the User Controls to the Process Data Using the Property Pages of the Button Control Properties and Methods of the Button Control Events of the Button Control Using the Property Pages of the Edit Control Properties and Methods of the Edit Control Events of the Edit Control Error Codes for the Edit Control Using the Property Pages of the Label Control Properties and Methods of the Label Control Events of the Label Control Using the Property Pages of the Slider Control Properties and Methods of the Slider Control Events of the Slider Control Page 6-2 6-4 6-9 6-10 6-11 6-18 6-19 6-20 6-21 6-26 6-26 6-27 6-34 6-35
Computing A5E0006550804
6-1
User Controls
6.1
Note In order to connect the control to actual process data, you must establish a connection through the Data control.
Engine
Connections
Events
Name
100 0
Add...
Delete
Filter...
OK
Cancel
Apply
Help
Figure 6-1
6-2
Computing A5E0006550804
User Controls
As an option, Computing allows you to specify a data type when you assign a variable to one of the properties of a SIMATIC control. You define the data type by entering the absolute address for the memory location, followed by a colon (:) and then the data type. Be careful in assigning data types. If you are connecting an Edit control, the values for some S7 datatypes will not display properly unless the datatype you assign matches the Data Format field in the Edit Control properties box. For example, you can define an assigned variable as a REAL data type by entering MD100:real when you assign the variable, but you must be sure to set the Data Format field in the Edit Control properties box to Real.
Engine
Connections
Events
Name
100 0
Add...
Delete
OK
Cancel
Apply
Help
Figure 6-2
Computing A5E0006550804
6-3
User Controls
6.2
Defining the Caption and Enabling the Control (Using the General Tab)
The General tab of the Properties dialog (see Figure 6-3) allows you to define the two captions for the Button control: S S S S S Alignment determines the alignment of the text (left, center, or right). TrueCaption: Enter the text to be displayed in the control when the bit is true (equal to 1 or on). FalseCaption: Enter the text to be displayed in the control when the bit is false (equal to 0 or off). Style determines the style (standard or graphical) for the control. Graphical style means that a bitmap is used. Appearance: If you set this property to 3D, the control will have a three-dimensional appearance. (You must also set the border style to Fixed Single to enable the three-dimensional appearance.) The other option is Flat, which displays a two-dimensional, rectangular border around the control. BorderStyle: If you set this property to Fixed Single, the control is displayed with a rectangular border; if you set the property to None, no border will be displayed. StretchMode determines the stretch mode of the graphical element for the control. Enabled checkbox determines whether the Button responds to events. It does not generate events while disabled. The default setting for this option is enabled (selected). Locked checkbox determines whether the control is in a read only state. In locked state, you cannot change any values. Pushbutton determines whether or not the control functions like a pushbutton. It determines the operation mode of the control: if set to True or 1, the True value is retained as long as the Button control is pressed (mouse down).
S S
S S
6-4
Computing A5E0006550804
User Controls
Alignment: TrueCaption: FalseCaption: Style: Appearance: BorderStyle: StretchMode: ON OFF 1 wGraphical 0 wFlat 0 wNone 1 wResizeImage OK Cancel Apply Help Enabled: Locked PushButton
Figure 6-3
Defining the Picture of the Button Control (Using the Picture Tab)
The Picture tab of the Properties dialog (see Figure 6-4) allows you to browse to a picture for the two states of the Button control. Select the Off state (FalsePicture) or the On state (TruePicture) and then click on Browse to select the picture to be displayed for that state. You can use any pictures for the On and Off states, but graphics are only allowed if 1 wGraphical is selected in the Style field of the General tab. Prefined bitmaps are provided in WinAC\WinCP\bitmaps.
Siemens_SIMA TIC_UserControls.Button Properties General Picture Properties: FalsePicture TruePicture Font Color Name Preview:
Browse...
Clear
OK
Cancel
Apply
Help
Figure 6-4
Computing A5E0006550804
6-5
User Controls
Defining the Typeface of the Button Control (Using the Font Tab)
The Font tab of the Properties dialog (see Figure 6-5) allows you to define the typeface and size for the text on the Button control: S S S Font: select the typeface for the text from a list of standard typefaces. Size: select the point size or enter a specific point size for the text. Effects: select other typographical options (boldface, italic, underline, or strike-through).
The Sample Text field displays the selection of the Font property.
Siemens_SIMA TIC_UserControls.Button Properties General Picture Properties: Font Font Color Name Font: MS Sans Serif Effects Bold Italic Underline Strikeout Size: 8.25
OK
Cancel
Apply
Help
Figure 6-5
Defining the Color of the Button Control (Using the Color Tab)
The Color tab of the Properties dialog (see Figure 6-6) allows you to define the colors for the two states, and for the text of the Button control. You can choose from a palette of standard colors, or you can create custom colors. S S You select the Off state (FalseColor) or the On state (TrueColor) and then select the color to be displayed for that state from the color palette. You can also define the ForeColor which is the color used to display text in an object.
6-6
Computing A5E0006550804
User Controls
Note FalseColor and TrueColor can be changed only if you have selected Style: Standard on the General tab, but ForeColor (Text color) can be changed for both Style: Standard and Style: Graphical.
Siemens_SIMA TIC_UserControls.Button Properties General Picture Properties: FalseColor ForeColor TrueColor Font Color Name Color Set: Standard Colors Color Palette: Gray Green Magenta Red Edit Custom Color...
OK
Cancel
Apply
Help
Figure 6-6
Computing A5E0006550804
6-7
User Controls
Control Name:
Button1
OK
Cancel
Apply
Help
Figure 6-7
6-8
Computing A5E0006550804
User Controls
6.3
Property or Method AboutBox method Alignment property Appearance property BorderStyle property Enabled property FalseCaption property FalseColor property FalsePicture property
PushButton property
B-32
StretchMode property Style property TrueCaption property TrueColor property TruePicture property
Value property
B-43
Computing A5E0006550804
6-9
User Controls
6.4
Event Change event Click event Error event KeyDown event KeyPress event KeyUp event MouseDown event MouseMove event MouseUp event
Note In order to connect the Edit control to actual process data, you must establish a connection through the Data control.
6-10
Computing A5E0006550804
User Controls
6.5
Computing A5E0006550804
6-11
User Controls
Using the check boxes on the General tab, you can define other operations for the control: S Enabled checkbox determines whether the control responds to events. It does not generate events while disabled. The default setting for this option is enabled (selected). Locked: When you enable this option, the control becomes a read-only display: you can view the value in the memory location of the control engine, but you cannot change the values from this control. The default setting for this option is disabled (not selected). Zero Pad: When you enable this option, the Edit control fills out the data type by inserting zeroes (0) to the left of the value. The default setting for this option is disabled (not selected).
Siemens_SIMA TIC_UserControls.Edit Properties General Scaling Alignment: 2 wReal 3 1 wThreeD 1 wFixedSingle 0 wAutomatic Font Color Name Enabled Locked Zeropad
OK
Cancel
Apply
Help
Figure 6-8
6-12
Computing A5E0006550804
User Controls
Table 6-3
Size of Data Types for the Edit control Setting 0 1 2 3 4 5 6 7 8 Size 1 bit 1 byte 1 byte 2 bytes 4 bytes 4 bytes 4 bytes 2 bytes 2 bytes Single bit value Unsigned single-byte value Unsigned two-byte value Signed two-byte integer value Unsigned four-byte value (default) Signed four-byte integer value Signed four-byte real (floating-point) value Unsigned two-byte value Unsigned two-byte value Description
Data Type Boolean Byte Word Integer Double Word Double Integer Real Timer Counter
No scaling of the data: If you choose the default, the Display Value shows a Max of 100 and a Min of 0. Scaling by formula: If you choose to scale by formula, you enter the following information: S S Factor represents a percentage of change (scaling factor) from the value in the control engine to the value in the Edit control. Offset represents a fixed value to be added to the scaled result before being displayed.
The Edit control uses the following formula to calculate the scaled value: (Value Factor) + Offset = Display Value where: Value = the value stored in the control engine Factor = the scaling factor Offset = the offset factor Display Value = the value displayed in the Edit control When the Edit control writes data to the control engine, the inverse of the formula is used to scale the value.
Computing A5E0006550804
6-13
User Controls
Scaling by range: If you choose to scale by range transformation, you specify the upper (RawMax) and lower (RawMin) values for a source range (for the value in the control engine) and for a destination range (for the value displayed in the Edit control or Display). The Edit control then transforms the value from one range into the equivalent value for the other range.
Siemens_SIMA TIC_UserControls.Edit Properties General Scaling Font Color Name
OK
Cancel
Apply
Help
Figure 6-9
These ranges define only the relationship between the data in the control engine and the data in the Edit control: if the value is above or below the ranges entered for the transformation, the transformation uses the formula to extrapolate the scaled value. The upper and lower limits are not minimum and maximum values for the data: there is no limit checking with the scaling factors.
6-14
Computing A5E0006550804
User Controls
The Sample Text field displays the selection of the Font property.
Siemens_SIMA TIC_UserControls.Edit Properties General Scaling Properties: Font Font Color Name Font: MS Sans Serif Effects Bold Italic Underline Strikeout Size: 8.25
OK
Cancel
Apply
Help
Figure 6-10
Computing A5E0006550804
6-15
User Controls
Defining the Color of the Edit Control (Using the Color Tab)
The Color tab of the Properties dialog (see Figure 6-11) allows you to define the colors for the two states, and for the text of the Edit control. You select the Property (Back Color or ForeColor) and then select the color to be displayed for that property from the color palette. You can choose from a palette of standard colors, or you can create custom colors.
Note BackColor and ForeColor can be changed only if you have selected Style: Standard on the General tab, but ForeColor (Text color) can be changed for both Style: Standard and Style: Graphical.
Siemens_SIMA TIC_UserControls.Label Properties General Scaling Properties: BackColor ForeColor Font Color Name Color Set: Standard Colors Color Palette: Magenta Red White Yellow Edit Custom Color...
OK
Cancel
Apply
Help
Figure 6-11
6-16
Computing A5E0006550804
User Controls
Control Name:
Edit1
OK
Cancel
Apply
Help
Figure 6-12
Computing A5E0006550804
6-17
User Controls
6.6
Property or Method AboutBox method Alignment property Appearance property BackColor property BorderStyle property DataFormat property DisplayValue property Enabled property Factor property
Max property
B-26
Min property
B-26
Offset property
B-27
B-30 B-32
RawMin property
B-32
B-34 B-43
6-18
Computing A5E0006550804
User Controls
Table 6-4
Properties and Methods of the Edit Control, continued Description Selects whether to write new values automatically or manually Writes the value of the Value property Determines whether the displayed number is padded with zeroes (to the left of the value) to the size of the data type Page B-43 B-44 B-45
6.7
Event Change event Click event DblClick event Error event KeyDown event KeyPress event KeyUp event MouseDown event MouseMove event MouseUp event
Computing A5E0006550804
6-19
User Controls
6.8
6-20
Computing A5E0006550804
User Controls
6.9
Defining the Label and Enabling the Control (Using the General Tab)
The General tab of the Properties dialog (see Figure 6-13) allows you to define the presentation of the Label control. S Alignment defines how the value will be displayed in the Label control: aligned to the left side of the field, centered in the field, or aligned to the right side of the field. Caption specifies the text that is displayed by the control. If the caption is attached to a process value, the process value is displayed instead. Style determines the style (standard or graphical) for the control. Appearance defines the way the control looks. If you set this property to 3D, the control will have a three-dimensional appearance. (You must also set the border style to Fixed Single to enable the three-dimensional appearance.) The other option is Flat, which displays a two-dimensional, rectangular border around the control. Border Style defines whether a border is displayed. If you set this property to Fixed Single, the control is displayed with a rectangular border; if you set the property to None, no border will be displayed. StretchMode determines the stretch mode of the graphical element for the control. Enabled checkbox determines whether the Label responds to events. It does not generate events while disabled. The default setting for this option is enabled (selected).
S S S
S S
Computing A5E0006550804
6-21
User Controls
Alignment: Caption: Style: Appearance: Borderstyle: StretchMode: Label 1 wGraphical 0 wFlat 0 wNone 1 wResizeImage Enabled:
OK
Cancel
Apply
Help
Figure 6-13
Defining the Picture of the Label Control (Using the Picture Tab)
The Picture tab of the Properties dialog (see Figure 6-14) allows you to browse to a picture for the Label control. You select Picture and then click on Browse to select the picture to be displayed for that state. Note that the Picture property can be used only if you have selected Style: Graphical on the General tab. Prefined bitmaps are provided in WinAC\WinCP\bitmaps.
Siemens_SIMA TIC_UserControls.Label Properties General Picture Properties: Picture Text Font Color Name Preview:
Browse...
Clear
OK
Cancel
Apply
Help
Figure 6-14
6-22
Computing A5E0006550804
User Controls
Defining the Typeface of the Label Control (Using the Font Tab)
The Font tab of the Properties dialog (see Figure 6-15) allows you to define the typeface and size for the labels of the Label control: S S S Font: select the typeface for the label from a list of standard typefaces. Size: select the point size for the label or enter a specific point size for the label. Effects: select other typographical options (boldface, italic, underline, or strike-through) for the label.
The Sample Text field displays the selection of the Font property.
Siemens_SIMA TIC_UserControls.Label Properties General Picture Properties: Font Font Color Name Font: MS Sans Serif Effects Bold Italic Underline Strikeout Size: 8.25
OK
Cancel
Apply
Help
Figure 6-15
Computing A5E0006550804
6-23
User Controls
Defining the Color of the Label Control (Using the Color Tab)
The Color tab of the Properties dialog (see Figure 6-16) allows you to define the colors for the background (BackColor) and for the text (ForeColor) of the Label control. You select the property (BackColor or ForeColor) and then select the color to be displayed for that property from the color palette. You can choose from a palette of standard colors, or you can create custom colors.
Note ForeColor (Text color) can be changed for both Style: Standard and Style: Graphical, but the background color (BackColor) may be hidden by the bitmap picture of the label in certain stretchmodes.
Siemens_SIMA TIC_UserControls.Label Properties General Picture Properties: BackColor ForeColor Font Color Name Color Set: Standard Colors Color Palette: Gray Green Magenta Red Edit Custom Color...
OK
Cancel
Apply
Help
Figure 6-16
6-24
Computing A5E0006550804
User Controls
Control Name:
Label1
OK
Cancel
Apply
Help
Figure 6-17
Computing A5E0006550804
6-25
User Controls
6.10
Property or Method AboutBox method Alignment property Appearance property BackColor property BorderStyle property Caption property Enabled property Font property ForeColor property Picture property StretchMode property Style property
6.11
Event Change event Click event DblClick event Error event MouseDown event
6-26
Computing A5E0006550804
User Controls
Table 6-8
Events of the Edit Control, continued Description Occurs when the mouse cursor moves over the control Occurs when a mouse button is released while the mouse cursor is over the control Page C-7 C-8
6.12
Computing A5E0006550804
6-27
User Controls
Using the check boxes on the General tab, you can define other operations for the control: S S Show Min. and Max Value check box determines whether the minimum and maximum values are displayed. Enabled checkbox determines whether the control responds to events. It does not generate events while disabled. The default setting for this option is enabled (selected). Locked checkbox determines whether the control is in a read only state. In locked state, you cannot change any values.
Siemens_SIMA TIC_UserControls.Slider Properties General Scaling Picture Color Name
Style Direction
1 wGraphical 0 wHorizontal
Ticks:
10
OK
Cancel
Apply
Help
Figure 6-18
100
Horizontal
0 100
Vertical
Figure 6-19
6-28
Computing A5E0006550804
User Controls
No scaling of the data: If you choose the default, the Display Value shows an Max Value of 100 and a Min Value of 0. Scaling by formula: If you choose to scale by formula, you enter the following information: S S Factor represents a percentage of change (scaling factor) from the value in the control engine to the value in the Slider control. Offset represents a fixed value to be added to the scaled result before being displayed.
The Slider control uses the following formula to calculate the scaled value: (Value Factor) + Offset = Display Value where: Value = the value stored in the control engine Factor = the scaling factor Offset = the offset factor Display Value = the value displayed in the control
Computing A5E0006550804
6-29
User Controls
When the Slider control writes data to the control engine, the inverse of the formula is used to scale the value. Scaling by range: If you choose to scale by range transformation, you specify the upper (RawMax) and lower (RawMin) values for a source range (Value fields) and for a destination range (Display Value field ). The Slider control then transforms the value from one range into the equivalent value for the other range. These ranges define only the relationship between the data in the control engine and the data in the Slider control: if the value is above or below the ranges entered for the transformation, the transformation uses the formula to extrapolate the scaled value. The upper and lower limits are not minimum and maximum values for the data: there is no limit checking with the scaling factors. Figure 6-20 shows the display values of the Slider control.
Ticks (unit markings) Min
0 100
Max
Figure 6-20
0 wNoScaling Scaling Formula 255 0 Value x Factor: 1 + Offset: 1 100 0 = Display Value
OK
Cancel
Apply
Help
Figure 6-21
6-30
Computing A5E0006550804
User Controls
Defining the Picture of the Slider Control (Using the Picture Tab)
The Picture tab of the Properties dialog (see Figure 6-14) allows you to select the pictures for the Slider control. You select KnobPicture and then click on Browse to select the picture (graphic) used for the indicator on the control. Next, select Picture and then click on Browse to select the picture (graphic) used for the control. Prefined bitmaps are provided in WinAC\WinCP\bitmaps.
Note Picture can be changed only if you have selected Style: Graphical on the General tab, but KnobPicture can be changed for both Style: Standard and Style: Graphical.
Siemens_SIMA TIC_UserControls.Slider Properties General Scaling Properties: KnobPicture Picture Picture Color Name Preview:
Browse...
Clear
OK
Cancel
Apply
Help
Figure 6-22
Computing A5E0006550804
6-31
User Controls
Defining the Color of the Slider Control (Using the Color Tab)
The Color tab of the Properties dialog (see Figure 6-11) allows you to define the two colors (BackColor and ForeColor) and for the text of the Slider control. You select the Property (Back Color or ForeColor) and then select the color to be displayed for that property from the color palette. You can choose from a palette of standard colors, or you can create custom colors. S S BackColor defines the background color of the control. ForeColor defines the color used to display text and graphics in an object.
Siemens_SIMA TIC_UserControls.Slider Properties General Scaling Properties: BackColor ForeColor Picture Color Name Color Set: Standard Colors Color Palette: Gray Green Magenta Red Edit Custom Color...
OK
Cancel
Apply
Help
Figure 6-23
Note BackColor can be changed only if you have selected Style: Standard on the General tab, but ForeColor can be changed for both Style: Standard and Style: Graphical.
6-32
Computing A5E0006550804
User Controls
Control Name:
Slider1
OK
Cancel
Apply
Help
Figure 6-24
Computing A5E0006550804
6-33
User Controls
6.13
Property or Method AboutBox method BackColor property Direction property Display Value property Enabled property Factor property
ForeColor property KnobHeight property KnobPicture property KnobWidth property LargeChange property
Locked property
B-26
Max property
B-26
Min property
B-26
Offset property
B-27
6-34
Computing A5E0006550804
User Controls
Table 6-9
Properties and Methods of the Slider Control, Fortsetzung Description Specifies the scaling mode to be used for scaling values Specifies whether the control displays the range (minimum and maximum) of values Determines the style (standard or graphical) of the control Determines how far the slider indicator moves when the control has focus and you press the up/down or right/left arrow keys Determines the stretch mode of the graphic element for the control Sets the number of ticks (unit markers) Contains the value that is linked to the control engine Page B-34 B-36 B-39 B-37
Property or Method ScaleMode property ShowMinMax property Style property SmallChange property
6.14
Computing A5E0006550804
6-35
User Controls
6-36
Computing A5E0006550804
The diagnostics buffer of the S7 controllers is a ring buffer that contains entries written by the operating system of the S7 controller. Each entry contains information about a specific diagnostic event. These events are displayed in the order in which they are generated, with the most recent event listed first. The DBuffer control allows your program to access the diagnostics buffer and display the events. For more information about the diagnostics buffer, refer to the online help for the STEP 7 programming software and to the documentation for the S7 controllers.
Description Using the S7 Diagnostics Buffer Configuring the DBuffer Control Properties, Methods, and Events of the DBuffer Control
Computing A5E0006550804
7-1
7.1
If you enable the control to sort the events, you can use the buttons in the upper panel to sort the events by the type of event (either the description or by the hexadecimal event ID) or by the sequence that the event occurred (which is determined by the time and date when the event was generated). The DBuffer control does not use the Data control to access the control engine. You configure the properties of the DBuffer control for the control engine and for other properties.
Application program
STEP 7 (optional) Provides online help for the selected diagnostics event
S7 controller Diagnostics buffer Stores the events and associated data which were generated as the S7 controller executes the user program Figure 7-1 As the user program executes, events are written to the diagnostics buffer
Note The DBuffer does not automatically read and update the diagnostic buffer in the controller: the user must manually request an update by clicking on the Update button.
7-2
Computing A5E0006550804
As shown in Figure 7-2, the DBuffer control provides the following elements: S Upper panel: lists the events of the diagnostics buffer of the controller, including the number (starting with the most recent), the date and time of the diagnostic event, and a short description. Lower panel: provides a detailed description of a selected event listed in the upper panel. This information includes the name and event number of the event, additional description (such as the address of the instruction that caused the event), and the current event state. Update button: reads the diagnostics buffer and updates the information displayed by the control. The DBuffer control does not automatically read the S7 diagnostics buffer and update the events. Language: selects the language (German, English, French, Italian, or Spanish) for the descriptions of the events. The language of the column headings and the buttons (German, English, or French) is selected by the Panel control or the container. Help on Event button: displays the STEP 7 online help for the selected diagnostic event.
No. 1
Date M/d/yy
Upper panel: displays the listing of events Short description of the event Event Lower panel: provides a detailed description of the selected event
Details on Event
Event X of Y
Detailed description of the selected diagnostic event Selects whether the event in the lower panel is identified by a textual description or hexadecimal values Displays the online help for the diagnostics event (from STEP 7)
Format:
Text
Hex
Help on Event
Update
Language
English
Reads the diagnostics buffer and updates the events Figure 7-2 Elements of the DBuffer Control
Computing A5E0006550804
7-3
7.2
S S
Diagnostic Information Display Language Current Setting in Registry Specify a Control Engine For Connection Control Engine: WinLC
Connection Status:
Connection Test
OK
Cancel
Apply
Help
Figure 7-3
7-4
Computing A5E0006550804
Figure 7-4 shows Visibility tab of the Properties dialog box for the DBuffer control. With this tab, you can select the various elements of the DBuffer control to be displayed: S Display Upper Panel: When selected, this property (DisplayUpperPanel) displays the upper panel of the diagnostic buffer. This panel displays the listing of the diagnostic buffer. Display Lower Panel: When selected, this property (DisplayLowerPanel) displays the lower panel of the diagnostic buffer. This panel provides the detailed description about the selected event. Display Format Buttons: When selected, this property (DisplayFormatButtons) displays format buttons for selecting whether the data for the event is displayed as text or as a hexadecimal value. Display Help-On-Event Button: When selected, this property (DisplayHelpOnEvent) displays the Help on Event button that allows the user to get online help for the selected diagnostic event. (STEP 7 must be installed on the same computer as the DBuffer control.) Display Help Button: When selected, this property (DisplayHelpButton) displays the Help button that allows the user to get online help about the DBuffer control. Display Update Button: When selected, this property (DisplayUpdateButton) displays the Update button that reads the diagnostic buffer in the S7 controller.
OK
Cancel
Apply
Help
Figure 7-4
Computing A5E0006550804
7-5
Control Name:
DBuffer1
OK
Cancel
Apply
Help
Figure 7-5
7-6
Computing A5E0006550804
7.3
Property or Method bDiagBuffOK property bEngineConnected property ControlEngine property DisplayFormatButtons property DisplayHelpButton property DisplayHelpOnEventButton property DisplayLowerPanel property DisplayUpdateButton property DisplayUpperPanel property EnableSort property
FormatDisplay property PopUpHelp method PopUpHelpOnEvent method SelectEvent method Update method
Computing A5E0006550804
7-7
7-8
Computing A5E0006550804
Chapter Overview
Computing provides an OLE container application (SoftContainer) for receiving and displaying the data from the control engine. Using this container, you can insert your own third-party controls or the SIMATIC controls into a process form. This chapter provides information about inserting and positioning the controls in the container. For more information about the specific SIMATIC controls, refer to the following chapters: S S S For information about the Data control, see Chapter 5. For information about the diagnostic buffer control (DBuffer), see Chapter 7. For information about the other SIMATIC controls (Button control, Edit control, Label control and Slider control), see Chapters 6, 7, 8 and 9.
Section 8.1 8.2 8.3 8.4 Description Starting the Computing SoftContainer Creating a Process Form Switching from Design Mode to Run Mode Saving Your Process Form Page 8-2 8-4 8-6 8-8
Computing A5E0006550804
8-1
8.1
S S
Toolbar
S7Soft1
"
Displays the name of the selected control Allows you to select a specific control from a list of controls in the process form
Status bar
8-2
Computing A5E0006550804
By selecting several controls, you can use the information in the status bar to adjust the size or position of the controls. You can turn the status bar and the snap grid on or off: S S To enable the snap grid, select the View " Snap Grid menu command. The snap grid is enabled when the menu displays a check mark. To display the status bar, select the View " Status Bar menu command. The status bar is displayed when the menu displays a check mark.
Design
Data1
248, 109
24 x 26
Name of the control selected Figure 8-2 Elements of the Status Bar
Computing A5E0006550804
8-3
8.2
S7Soft1
"
Design
Data1
248, 109
8-4
Computing A5E0006550804
2. As shown in Figure 8-4, select the custom or third party control to be added to the process form. (You can add the control to the toolbar of the SoftContainer by selecting the Add control to toolbar check box. This allows you to use the icon in the toolbar for inserting the control into the process form.) 3. Click on the OK button and insert the control into the process form.
Insert Control
Siemens_SIMA TIC_DataControl Siemens_SIMA TIC_DBuffer.DBuffer Siemens_SIMA TIC_UserControls.Butto Siemens_SIMA TIC_UserControls.Label Siemens_SIMA TIC_UserControls.Slide Third-Party Control... Third-Party Control...
Select (click on) the third-party or custom control. Select the check box to add the control to the toolbar of the SoftContainer. Click on the OK button to insert the control.
Figure 8-4
Note The Diagnostic Buffer control does not use Data control to connect to the PLC.
Computing A5E0006550804
8-5
8.3
Warning After you connect a SIMATIC or a third-party control to your process data by assigning a variable to its Value property, any changes that you make to the value displayed in the control are immediately applied to your process data. Altering process data can cause unpredictable equipment operation, which could result in death or serious injury to personnel, and/or damage to equipment. Do not perform the exercises in this chapter when your control engine is connected to a real process. These exercises are for practice only. Do not modify any data that could cause process equipment to operate erratically. Always install a physical emergency stop circuit for your machine or process.
Note The controls must have an active control engine (such as WinLC) in order to access the process data. Be sure that the control engine is running before you switch the SoftContainer from Design mode to Run mode.
8-6
Computing A5E0006550804
Use the following procedure to change the operating mode of the container: 1. Make certain that the control engine (such as WinLC) is running. For information about starting the control engine, refer to the process formation for the control engine. 2. Click on the Run button to change from Design mode to Run mode. See Figure 8-5. The status bar shows that the container is in Run mode. Notice that the Data control becomes invisible in Run mode. In Run mode, you can use the controls to monitor or to modify the values stored in the control engine. To return to Design mode, click on the Design button.
S7Soft1
"
OFF
100
24
Computing A5E0006550804
8-7
8.4
File name:
S7Soft1
Save Cancel
Figure 8-6
8-8
Computing A5E0006550804
The TagFile Configurator creates tag files that allow you to use symbols for the memory locations being accessed in the control engine. The tag file provides a source of symbolic information for memory locations and control engines. Linking to a tag file allows you to use symbolic names instead of absolute addresses when assigning variables in the Data control. Multiple STEP 7 programs can be mapped into a single tag file, with each program providing access to a different computer and control engine. This allows Computing to access data from different computers and control engines simultaneously. Using a tag file also enables the completion aid in the Data control: entering a . (dot or period) displays a list of valid tag files or symbols. You can also click on the Browse button to navigate to the symbol.
Description Connecting to Multiple Control Engines over DCOM Using Symbols to Access Data on Multiple Control Engines Creating a Tag File Configuring a Tag File for Local or Remote Access to a Control Engine Changing the Control Engine Symbol Name in the Tag File Editor
Computing A5E0006550804
9-1
9.1
Note To maintain the name of a remote computer within a STEP 7 project, create a station name in STEP 7 with the following components: S @ (Starting the station name with @ signals the TagFile Configurator that this station name refers to a remote computer.)
WinLC
PC 2
PC 1 Computing
DCOM
WinLC
PC 3
Figure 9-1
9-2
Computing A5E0006550804
The TagFile Configurator creates a tag file that provides a source of symbolic information for the memory locations and control engines. The tag file contains the following information: S Computer name: identifies the computer where the control engine resides, either the local computer or a networked computer. If you configured the station name in STEP 7 to begin with an @ symbol, the TagFile Configurator recognizes the station name as a DCOM address name for the computer that is running the control engine. Control engine: identifies the control engine to be accessed by the Data control. This information typically comes from the CPU configured in STEP 7. For example, WinLC (for WinLC), wcS7=3 (for a slot PLC such as the CPU 416-2 DP ISA), or wcS7=xx,a,b (for other PLCs on the network, where xx is the node address of the PLC, a is the rack number, and b is the slot number). See Appendix G for more information about control engine strings.
Save As... menu command to save (and rename) the tag file.
STEP 7
SIMATIC Projects My_Drain @PC 3 WinLC Drain
Figure 9-2
Computing A5E0006550804
9-3
Note You must have configured the different computers for DCOM. See Sections E.2 and E.3 for information about configuring the server and client computers for DCOM. For additional information about DCOM, refer to the online help for Windows NT.
Connection via Tag Source Tag Source C:\SIEMENS\ WINAC\WinCP\tag_file Browse Direct Connection PC Name Control Engine
Browse to the tag file that contains the programs for the different control engines
OK
Cancel
Apply
Help
Figure 9-3
9-4
Computing A5E0006550804
9.2
Note The TagFile Configurator must be running on a computer that also has STEP 7 installed in order for you to insert STEP 7 programs for using symbolic addresses. (STEP 7 does not have to be installed for you to insert a control engine without symbolic information into the tag file.) To use the tag file with a Data control, the tag file must reside on a computer that can be accessed by the Data control.
STEP 7
SIMATIC Projects Master_Mixer @PC_2 WinLC Mixer Tag File Control Engine Symbol PC_2_WinLCV3.0 STEP 7 Path WinLCV3\@PC_2\WinLCV3.0\Mixer Computer Name PC_2
WinLC
PC 2
Figure 9-4
The tag file includes the following elements: S Control engine: identifies the control engine to be accessed by the Data control. This information typically comes from the PLC configured in STEP 7. See Appendix G for more information about control engine identifiers. Computer name: identifies the computer where the control engine resides, either the local computer or a networked computer. If you configured the station name in STEP 7 to begin with an @ symbol, the TagFile Configurator recognizes the station name as a DCOM address name for the computer that is running the control engine.
Computing A5E0006550804
9-5
9.3
The TagFile Configurator is opened with a new (empty) file. Figure 9-5 shows the TagFile Configurator with an empty tag file open. You insert STEP 7 programs and control engines into the tag file.
Tag File Configurator File Insert Control Engine View Options Window Help Use the Insert menu to insert a STEP 7 program or a control engine into the tag file
Control Engine S7 Path PC Name Time Stamp Instance Name
TagSource 1
3/2/99
4:14 PM
Figure 9-5
TagFile Configurator
9-6
Computing A5E0006550804
Use the following procedure to create a tag file with symbolic data: 1. Select the Insert " Program menu command to display the SIMATIC Program(s) browser. See Figure 9-6. 2. Click on the + to open the project, station, CPU, and program to be inserted in the tag file. See Figure 9-6. 3. Click on the > button (or double-click on the program) to add the program to the tag file. 4. Click on the OK to complete the operation. After you have inserted the program into the tag file, you can edit the Control Engine and Computer Name fields. If you change your symbol table in STEP 7, you can also update your tag file by using the the Control Engine " Update menu command. The configurator uses the program path to update the symbols for the control engine.
SIMATIC Program(s) Available Program(s) SIMATIC Projects Counters S7_ZEBRA PC Station(1) CPU314(1) S7-Program(1) UserTest COM_SFB ProcessDemo ControlDemo Sample Available Program(s) Program Program Path
-->
Remove
OK
Cancel
Help
Figure 9-6
Computing A5E0006550804
9-7
Inserting a Control Engine without STEP 7 Symbols into the Tag File
STEP 7 does not have to be installed for you to insert a control engine without symbolic information into the tag file. You must use absolute addresses when accessing data in these control engines.
Note Do not use these characters in the Control Engine name field: / , \ These characters are invalid and are not supported by this software.
Use the following procedure to insert a control engine without STEP 7 symbols: 1. Select the Insert " Control Engine menu command to display the Control Engine Configuration dialog box. See Figure 9-7. 2. Enter the name of the computer where the control engine resides. If the control engine is to be accessed over a local area network (DCOM), enter the DCOM address for the computer in the Computer Name field. Otherwise, use the default address of the local computer (<local>). See Section 9.4 for information about configuring the control engine for local or remote access. 3. Enter the control engine to be accessed. For example, WinLC (for WinLC), wcS7=3 (for a slot PLC such as the CPU 416-2 DP ISA), or wcS7=xx,a,b (for other PLCs on the network, where xx is the node address of the PLC, a is the rack number, and b is the slot number). See Appendix G for more information about control engine identifiers. 4. Enter a symbolic name for the control engine. The name defaults to the computer name plus the control engine identifier, for example <local>_WinLC. 5. Click on the OK button to enter the control engine into the tag file.
Control Engine Configuration Computer Name
<local>
Control Engine WinLC Control Engine Symbol <local>_WinLC OK Cancel
Enter the name of the control engine and click on the OK button
Help
Figure 9-7
9-8
Computing A5E0006550804
Computing A5E0006550804
9-9
9.4
9-10
Computing A5E0006550804
1. Open the tag file and select the control engine. (For information about creating or opening a tag file, see Section 9.3.) 2. Select the Control Engine " Edit menu command to display the Control Engine Configuration dialog box. 3. As shown in Figure 9-8, enter <local> or clear the field in the Computer Name field. If you leave the field empty, <local> is inserted automatically. 4. Click on the OK button to configure the control engine for local access. When the Computing application uses the tag file to access the control engine, it connects to the control engine on the local computer.
Control Engine Configuration Computer Name <local> Control Engine
Enter <local> or leave the field clear in the Computer Name field to designate the control engine for local access. Click on the OK button to enter the change.
OK
Cancel
Help
Figure 9-8
Computing A5E0006550804
9-11
WinLC
Control Engine Symbol PC_2_WinLC OK Cancel Help
Figure 9-9
9-12
Computing A5E0006550804
9.5
Changing the Control Engine Symbol Name in the Tag File Editor
You can change the symbol name in the tag file editor: 1. Open the tag file and select the control engine. (For information about creating or opening a tag file, see Section 9.3.) 2. Select the Control Engine " Edit menu command to display the Control Engine Configuration dialog box. 3. As shown in Figure 9-10, enter the name of the control engine symbol in the Control Engine Symbol field. For example, the name of the control engine symbol shown in Figure 9-10 could be changed to PC2WinLC. 4. Click on the OK button to change the control engine symbol name. To rename the control engine, change the name in the Control Engine Symbol field. To reassign the symbol, change the name in the Control Engine field.
Control Engine Configuration Computer Name PC 2 Control Engine WinLC Control Engine Symbol PC_2_WinLC OK Cancel Help
Enter the name of the control engine symbol. Click on the OK button to enter the change.
Figure 9-10
Computing A5E0006550804
9-13
9-14
Computing A5E0006550804
Overview
Computing provides access to the process data within the control engine, such as an S7 programmable logic controller (PLC). Using the SIMATIC Data Control, you identify the memory area to be accessed. For more information about the memory areas, refer to the System Software for S7-300 and S7-400 Program Design Programming Manual or to the online help for STEP 7.
Description Memory Areas of S7 Controllers Accessing the S7 Data Types Descriptions of the S7 Data Types
Computing A5E0006550804
A-1
A.1
Table A-1
Process-image output
A-2
Computing A5E0006550804
A.2
16 15
Computing also allows you to specify a data type when you assign a variable to one of the properties of a control. You define the data type by entering the absolute address for the memory location, followed by a colon (:) and the data type. For example, you can define an assigned variable as a REAL data type by entering MD100:real when you assign the variable. If you do not specify a data type, Computing uses the default data types listed in Table A-2. You can also access data stored in arrays or strings. For example, to access an the second value in a one-dimensional array of REAL data, enter MD100:real[2].
Note You can access most of the S7 data types from other applications without having to provide any external interpretation of the data. These include BOOL, BYTE, CHAR (character), WORD, DWORD, INT (integer), DINT (double integer), and REAL (floating point). Some of the S7 data types are specific to SIMATIC products: DATE, S5TIME, TIME, TIME_OF_DAY (TOD), and DATE_AND_TIME. The SIMATIC Number control automatically transforms these data types; however, if you access these S7-specific data types with other controls, you must also manually transform the data. Refer to the descriptions of these data types that follow Table A-2.
Computing A5E0006550804
A-3
Table A-2
Addressing the S7 Data Types and S7 Memory Areas Address PABx (SIMATIC) PQBx (International) PAWx (SIMATIC) PQWx (International) PADx (SIMATIC) PQDx (International) PEBx (SIMATIC) PIBx (International) PEWx (SIMATIC) PIWx (International) PEDx (SIMATIC) PIDx (International) Ax.y (SIMATIC) Qx.y (International) ABx (SIMATIC) QBx (International) BYTE (default), CHAR WORD (default), INT, DATE, S5TIME DWORD (default), DINT, REAL, TOD, TIME BOOL (default) BYTE (default), CHAR WORD (default), INT, DATE, S5TIME DWORD (default), DINT, REAL, TOD, TIME BOOL (default) BYTE (default), CHAR WORD (default), INT, DATE, S5TIME DWORD (default), DINT, REAL, TOD, TIME BOOL (default) BYTE (default), CHAR WORD (default), INT, DATE, S5TIME DWORD (default), DINT, REAL, TOD, TIME BOOL (default) DWORD (default), DINT, REAL, TOD, TIME BYTE (default), CHAR WORD (default), INT, DATE, S5TIME DWORD (default), DINT, REAL, TOD, TIME Valid Data Type BYTE (default), CHAR WORD (default), INT, DATE, S5TIME
Memory Area
Peripheral Output
Peripheral Input
Output
AWx (SIMATIC) QWx (International) ADx (SIMATIC) QDx (International) Ex.y (SIMATIC) I x.y (International) EBx (SIMATIC) IBx (International)
Input
EWx (SIMATIC) IWx (International) EDx (SIMATIC) IDx (International) Mx.y MBx
Bit Memory
A-4
Computing A5E0006550804
Table A-2
Addressing the S7 Data Types and S7 Memory Areas, continued Address Tx Zx (SIMATIC) Cx (International) INT (default) INT (default) Valid Data Type
Table A-3 lists the S7 data types and the corresponding data types for C and Visual Basic.
Table A-3 S7 Data Types as C or Visual Basic Data Types C Data Type VT_ARRAY VT_BOOL VT_UI1 VT_BSTR VT_DATE VT_DATE VT_I4 VT_DATE VT_CY1 VT_I2 VT_R4 VT_I4 VT_BSTR VT_I4 VT_DATE VT_I4 VB Data Type Not applicable Boolean Byte String Date Date Long Date Currency1 Integer Single Long String Long Date Long
S7 Data Type ARRAY BOOL (Boolean) BYTE CHAR (character) DATE DATE_AND_TIME DINT (double integer) DT (date and time) DWORD (double word) INT (integer) REAL S5TIME STRING TIME TOD (time of day) WORD
1
If you are reading DWORD data to Excel, you must reformat the data type for the Excel file or cell from General to the Number data type. Otherwise, Excel formats the S7 DWORD data into a monetary value, using the Currency data type for Excel.
Computing A5E0006550804
A-5
Caution Using the timer function improperly or using breakpoints in Visual Basic with Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process. Concerning VB timers: The Timer function in Visual Basic version 5 allows a timer to interrupt code in progress within the same thread, which can cause problems with potentially serious consequences. If you use VB timers with Computing, observe the following guidelines: S Always kill (disable) the timers in the Form_Unload subroutine. Otherwise, a timer can trigger an event while the VB program is shutting down; this condition could cause your computer or your application to crash, lock up, or to continue running invisibly.
S If you start your timer in the Form_Load subroutine, the timer event could occur
before the other objects have been instantiated. In order to ensure that the objects have been properly instantiated, always start a timer in the Form_Load subroutine with a large interval (such as 1 or 2 seconds) to allow the objects to be properly instantiated. Subsequent timer intervals can be set to shorter intervals.
A.3
A-6
Computing A5E0006550804
1,1 1,2 ARRAY [1..2,1..3] INT 1,3 2,1 2,2 2,3 Figure A-2 Accessing Data in an ARRAY
To read an array from the control engine, use the ReadVariable property of the Data control. For example, the following code reads a one-dimensional array of integers (starting at MW0) into an array named MyVariant:
S7Data1.ReadVariable(MW0:INT[100], MyVariant, MyState, MyTimeout)
Use the following code reads a one-dimensional array of 100 bits (starting with M0.0) into an array named MyVariant:
S7Data1.ReadVariable(M0.0:[100], MyVariant, MyState, MyTimeout)
Refer to Section 5.11 for a sample program that reads and writes arrays.
Sign: always positive (0) Figure A-3 Accessing the DATE Data Type
Computing A5E0006550804
A-7
Byte 6
A-8
Computing A5E0006550804
Note Read and write STRING or CHAR data as a Visual Basic BSTR data. Do not use an array of CHAR to emulate a STRING. Use one BSTR for each STRING or CHAR, regardless of the length of the data being accessed. For example: S To access CHAR[50] (which designates 50 bytes or 50 characters), use a BSTR of up to 50 bytes and not 50 individual BSTRs. S To access STRING[50] (which designates a string of 50 characters), use a BSTR of up to 50 bytes and not 50 individual BSTRs.
As shown in Figure A-5, the memory that is allocated for a string includes a header (2 bytes) which include the following information: S S The first byte stores the maximum length of memory for the string (the default value is 256 bytes). The second byte stores the actual amount of memory used for the string.
Byte 0: Maximum number of bytes allowed for the string (default is 256) Byte 1: Actual number of bytes used by the string
Byte 0
15... ...8 7...
Byte 1
...0
0
15...
0 0
1 1
0 0
0 0
0 0
0 0
1
...8
0
7...
0 0
1 1
0 0
0 0
1 1
1 1
1
...0
Byte 2
Character 1
Byte 3
Character 2
Figure A-5
Computing A5E0006550804
A-9
0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1
0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1
Sign: always positive (0) Figure A-7 Accessing the TIME_OF_DAY (TOD) Data Type
A-10
Computing A5E0006550804
B.1
AboutBox Method
Applies to: Button, Edit, Label, Slider This method displays the About message box for the control. Syntax: object.AboutBox The AboutBox method has these parts: Part object Description An object expression that evaluates to an object in the Applies To list.
B.2
Activated Property
Applies to: Data This property allows you to specify whether or not all connections are activated. Syntax: object.Activated [= value] The Activated property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object can respond to user-generated events.
Computing A5E0006550804
B-1
The settings for value are: Setting True False Description (default) All connections are activated. All connections are deactivated.
B.3
Alignment Property
Applies to: Button, Edit, Label This property specifies the alignment of the text of the control. Syntax: object.Alignment [= value] The Alignment property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the alignment.
The settings for value are: Setting 0 or Left 1 or Right 2 or Center Description (Default for Edit Control) Left-aligned. Right-aligned. (Default for Button and Label Controls) Centered.
B-2
Computing A5E0006550804
B.4
Appearance Property
Applies to: Button, Edit, Label If this property is set to ThreeD (1) and the BorderStyle property is set to Fixed Single (1), then the Appearance property draws controls with three-dimensional effects. If the property is set to Flat (0), a flat border will surround the controls rectangle.
Note This property only has an effect if the BorderStyle property is set to Fixed Single (1).
Syntax: object.Appearance [= value] The Appearance property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the appearance of object.
The settings for value are: Setting 0 or Flat 1 or ThreeD Description Paints the controls and forms without visual effects. (Default) Paints the controls with three-dimensional (3-D) effects.
B.5
AutoConnect Property
Applies to: Data This property allows you to specify whether or not the configured connections are established at runtime. Syntax: object.AutoConnect [= value]
Computing A5E0006550804
B-3
The AutoConnect property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A boolean expression that specifies whether object can respond to user-generated events.
The settings for value are: Setting True False Description (default) All configured connections will be established at runtime. The connections will be established with a call to the Connect method.
Note If you explicitly call the Connect method within your program, disable the AutoConnect property for the Data control. This helps to ensure that the Data control does not connect unexpectedly to the control engine.
B.6
AutoConnectTimeout Property
Applies to: Data This property allows you to specify a timeout. After the time specified, the Data control issues a call to its Connect method if the AutoConnect property is set to True. The value can also be specified at the General Property Tab. Syntax: object.AutoConnectTimeout [= value] The AutoConnectTimeout property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value of the type Long, which states the timeout in milliseconds.
B-4
Computing A5E0006550804
B.7
BackColor Property
Applies to: Edit, Label, Slider This property returns or sets the background color of the control. Syntax: object.BackColor [= color] The BackColor property has these parts: Part object color Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the background color of an object.
The settings for color are: Setting Standard Colors Windows System Colors Description Colors specified by using the RGB Color palette Colors specified by system color constants (depending on the container); for example, colors listed in the Visual Basic (VB) object library in the Object Browser
B.8
bDiagBuffOK Property
Applies to: DBuffer This read-only property verifies whether there is a connection to the diagnostics buffer of the S7 control engine. Syntax: object.bDiagBuffOK [= value] The bDiagBuffOK property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether there is a connection to the diagnostic buffer of the S7 control engine.
Computing A5E0006550804
B-5
The settings for value are: Setting True False Description The connection to the diagnostic buffer has been verified and is active. (default) There is no connection to the diagnostic buffer.
B.9
bEngineConnected Property
Applies to: DBuffer This read-only property verifies that the control has established a connection with an S7 control engine. Syntax: object.bEngineConnected [= value] The bEngineConnected property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object is connected to an S7 control engine.
The settings for value are: Setting True False Description The connection to the S7 control engine has been verified and is active. (default) There is no connection to the S7 control engine.
B.10
BorderStyle Property
Applies to: Edit, Button, Label If the property has the value 1Fixed Single, the control is surrounded by a rectangular border. If the property has the value 0wNone, no border will be displayed.
B-6
Computing A5E0006550804
Note This property determines whether the Appearance property has any effect.
Syntax: object.BorderStyle [= value] The BorderStyle property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the border style.
The settings for value are: Setting 0 or None 1 or FixedSingle Description (Default) No border or border-related elements A fixed, single-line border
B.11
Caption Property
Applies to: Label This property specifies the text that is displayed by the control. Syntax: object.Caption [= value] The Caption property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A String value that specifies the text of the label.
B.12
Connect Method
Applies to: Data This method establishes all configured connections.
Computing A5E0006550804
B-7
Note If your subroutine accesses the Data control programmatically, always disconnect from the control engine (using a Disconnect method) in the Form_Unload subroutine. In addition, disable the AutoConnect property for the Data control if you explicitly call the Connect method within your program. This helps to ensure that the Data control does not connect unexpectedly to the control engine.
Syntax: result = object .Connect The Connect method has these parts: Part object result Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs.
B.13
ConnectName Method
Applies to: Data This method establishes connections for the object that is specified by the name of the object on the form. If your subroutine accesses the Data control programmatically, always disconnect from the control engine (using a Disconnect method) in the Form_Unload subroutine. In addition, disable the AutoConnect property for the Data control if you explicitly call the Connect method within your program. This helps to ensure that the Data control does not connect unexpectedly to the control engine.
Note A programmer who uses Visual Basic (or a similar programming language) would use the ConnectName method, while a programmer who uses Visual C (or a similar programming language) would use the ConnectObject method.
B-8
Computing A5E0006550804
The ConnectName method has these parts: Part object result ConnectedObject Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs. A String expression that evaluates to the name of an object that should be connected. If this parameter is set to an empty String, the control generates the ValueChanged event if a connected variable changes. (optional) Specifies a connection table. If this parameter is omitted, the control reads the ConnectionTable property of the ConnectedObject. The connection table is declared as an array. Each element in the array has the following parts:
ConnectionTable
S S S S
Name of the element (such as Value) Memory location (such as MW100) Update rate or time-out value (in ms) Deadband value
For more information about the connection table, see Section 5.7.
Note If the ConnectedObject and ConnectionTable parameters are both omitted, an error is reported.
B.14
ConnectObject Method
Applies to: Data This method establishes connections for a specified object which was declared in the program. If your subroutine accesses the Data control programmatically, always disconnect from the control engine (using a Disconnect method) in the Form_Unload subroutine. In addition, disable the AutoConnect property for the Data control if you explicitly call the Connect method within your program. This helps to ensure that the Data control does not connect unexpectedly to the control engine.
Computing A5E0006550804
B-9
Note A programmer who uses Visual Basic (or a similar programming language) would use the ConnectName method, while a programmer who uses Visual C (or a similar programming language) would use the ConnectObject method.
Syntax: result = object.ConnectObject ConnectedObject, ConnectionTable The ConnectObject method has these parts: Part object result ConnectedObject Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs. A String expression that evaluates to the name of an object that should be connected. If this parameter is set to an empty String, the control generates the ValueChanged event if a connected variable changes. (optional) Specifies a connection table. If this parameter is omitted, the control reads the ConnectionTable property of the ConnectedObject. The connection table is declared as an array. Each element in the array has the following parts:
ConnectionTable
S S S S
Name of the element (such as Value) Memory location (such as MW100) Update rate or time-out value Deadband value
Note If the ConnectedObject and ConnectionTable parameters are both omitted, an error is reported.
B.15
ControlEngine Property
Applies to: Data, DBuffer This property stores the pathname or identification of the control engine connected to the control. See Appendix G for more information about control engine strings.
B-10
Computing A5E0006550804
Syntax: object.ControlEngine [= value] The ControlEngine property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A String that specifies the pathname or identification of the control engine to be accessed by object.
B.16
DataFormat Property
Applies to: Edit This property defines the storage type used for converted values. If you are using a data format for displaying a value which is too large, the value will be truncated.
Note This property determines whether the Precision property has any effect.
Syntax: object.DataFormat [= value] The DataFormat property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the data format, as described in Table B-1.
Settings for the Data Format Setting 0 1 2 3 4 5 Bit value Any bit, byte, word, dword, int or dint value Any byte, word, dword, int or dint value Any byte, word, dword, int or dint value Any byte, word, dword, int or dint value Any byte, word, dword, int or dint value Description
Table B-1
Computing A5E0006550804
B-11
Table B-1
Settings for the Data Format Setting 6 7 8 9 10 11 12 13 Description 4-byte floating point value 2-byte signed integer value 2-byte signed integer value Signed integer value (IEC Time) Signed integer value (IEC Date) Signed integer value (IEC Time) 1byte ASCII character String of characters
Note If the data size configured to be accessed in the control engine is larger than the data being displayed in the Edit control and the value of the data from the PLC is larger than can be displayed by the data format, the value is displayed with ... preceding it. Before the value can be changed from the Edit Control, the ... preceding the value must be deleted. When a value is written from the Edit Control to the PLC with this configuration, the amount of data written to the PLC corresponds to the data size configured in the Data Control. Therefore, caution must be taken that memory locations are not changed inadvertently.
B.17
DefaultDeadband Property
Applies to: Data This property allows you to specify the dead band used by the Data control, if no dead band is specified in the connection table.
Note If you specify a dead band (such as 10) for a bit variable (such as M15.5), the control engine will not transmit a changed value for that bit.
B-12
Computing A5E0006550804
The DefaultDeadband property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value of the type Single, which must not be negative.
B.18
DefaultUpdateRate Property
Applies to: Data This property allows you to specify the update rate used by the Data control, if no update rate is specified in the connection table.
Note For WinLC, the minimum default update rate is 0. For CPU 416-2 DP ISA, the minimum default update rate is 100 ms.
Syntax: object.DefaultUpdateRate [= value] The DefaultUpdateRate property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value of type Long.
The settings for value are: Part 0 >0 Description All changes of the connected variable are reported immediately. Changes of the connected variable are reported after this timeout.
Computing A5E0006550804
B-13
B.19
Direction Property
Applies to: Slider This property sets the orientation (horizontal or vertical) of the SIMATIC control. Default is 0 wHorizontal. Syntax: object.Direction [= value] The Direction property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the orientation.
The settings for value are: Setting 0 1 Description (Default) wHorizontal wVertical
B.20
Disconnect Method
Applies to: Data This method releases all established connections.
Note If your subroutine accesses the Data control programmatically, always disconnect from the control engine (using a Disconnect method) in the Form_Unload subroutine. In addition, disable the AutoConnect property for the Data control if you explicitly call the Connect method within your program. This helps to ensure that the Data control does not connect unexpectedly to the control engine.
B-14
Computing A5E0006550804
The Disconnect method has these parts: Part object result Description An object expression (identifier for the specific SIMATIC control) that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs.
B.21
DisplayFormatButtons Property
Applies to: DBuffer This property allows you to show or hide the format buttons (Text or Hexadecimal). Syntax: object.DisplayFormatButtons [= value] The DisplayFormatButtons property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the buttons.
The settings for value are: Setting True False Description (default) The Text and Hexadecimal (Hex) buttons are displayed. The Text and Hexadecimal (Hex) buttons are not displayed.
B.22
DisplayHelpButton Property
Applies to: DBuffer This property allows you to show or hide the button for displaying the online help for the control. Syntax: object.DisplayHelpButton [= value]
Computing A5E0006550804
B-15
The DisplayHelpButton property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the button.
The settings for value are: Setting True False Description (default) The button for the online help of object is displayed. The button is not displayed.
B.23
DisplayHelpOnEventButton Property
Applies to: DBuffer This property allows you to show or hide the button for displaying the online help for the selected diagnostic event. Syntax: object.DisplayHelpOnEventButton [= value] The DisplayHelpOnEventButton property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the button.
The settings for value are: Setting True False Description (default) object displays the button for the online help of the selected diagnostic event. The button is not displayed.
B-16
Computing A5E0006550804
B.24
DisplayLowerPanel Property
Applies to: DBuffer This property allows you to show or hide the lower panel of the diagnostics buffer. Syntax: object.DisplayLowerPanel [= value] The DisplayLowerPanel property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the button.
The settings for value are: Setting True False Description (default) object displays the lower panel of the diagnostic buffer. The lower panel is not displayed.
B.25
DisplayUpdateButton Property
Applies to: DBuffer This property allows you to show or hide the button for updating the control by reading the entries of the diagnostics buffer of the control engine. The control reads the diagnostics buffer only when an update is requested. Syntax: object.DisplayUpdateButton [= value] The DisplayUpdateButton property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the button.
Computing A5E0006550804
B-17
The settings for value are: Setting True False Description (default) object displays the button for updating the diagnostic events. The button is not displayed.
B.26
DisplayUpperPanel Property
Applies to: DBuffer This property allows you to show or hide the upper panel of the diagnostics buffer. Syntax: object.DisplayUpperPanel [= value] The DisplayUpperPanel property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the button.
The settings for value are: Setting True False Description (default) object displays the upper panel of the diagnostics buffer. The upper panel is not displayed.
B.27
DisplayValue Property
Applies to: Edit, Slider This property is a variant which returns the scaled value for the control. Syntax: object.DisplayValue [= value]
B-18
Computing A5E0006550804
The DisplayValue property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Variant that specifies the value of the control.
B.28
Enabled Property
Applies to: Button, Edit, Label, Slider When this property is True, the control reacts on changes of the Value property and fires events. If this property is False, then the control is disabled and does not react on changes in the Value property and does not fire any event (except the error event). Syntax: object.Enabled [= boolean] The Enabled property has these parts: Part object boolean Description An object expression that evaluates to an object in the Applies To list. A boolean expression that specifies whether object can respond to user-generated events.
The settings for boolean are: Setting True False Description (Default) Allows the object to respond to events Prevents object from responding to events
B.29
EnableSort Property
Applies to: DBuffer This property allows you to determine whether the user can cause the entries to be sorted. When this property is enabled, the user clicks on a column heading and the entries are sorted according to that column.
Computing A5E0006550804
B-19
Syntax: object.EnableSort [= value] The EnableSort property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that enables or disables the sorting of the columns in the upper panel of the diagnostics buffer.
The settings for value are: Setting True Description (default) The entries in the upper panel of the diagnostics buffer are sorted when the user clicks on a column heading. The sorting of entries is disabled.
False
B.30
Factor Property
Applies to: Edit, Slider The Factor and Offset properties specify the scaling factor and the offset used when the scale-by-formula option has been enabled.
Note The ScaleMode property must be set to wByFormula (1) for the Factor and Offset properties to have any effect.
You can use a formula to scale the value. In the following formula, Value is similar to the contents of the Value property if the control is connected to the control engine; Factor is the value of the Factor property; Offset is the value of the Offset property; and DisplayValue is also the contents of the Text property. Value * Factor + Offset = DisplayValue Syntax: object.Factor [= value]
B-20
Computing A5E0006550804
The Factor property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A floating-point value that defines the factor for the scaling formula.
Note The default value of the factor is 1.0, and the default value of the offset is 0.0.
B.31
FalseCaption Property
Applies to: Button This property determines the text that is displayed in the control when the Value property is False (equal to 0, or Off). Syntax: object.FalseCaption [= string] The FalseCaption property has these parts: Part object string Description An object expression that evaluates to an object in the Applies To list. Text that determines the active or inactive text of the control
B.32
FalseColor Property
Applies to: Button This property determines the color of the control when the Value property is False (equal to 0, or Off). Syntax: object.FalseColor [= color]
Computing A5E0006550804
B-21
The FalseColor property has these parts: Part object color Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the background or foreground colors of an object.
The settings for value are: Setting Standard Colors Windows System Colors Description Colors specified by using the RGB Color palette Colors specified by system color constants (depending on the container); for example, colors listed in the Visual Basic (VB) object library in the Object Browser
B.33
FalsePicture Property
Applies to: Button This property returns or sets the inactive (off, false, etc.) picture displayed on the control. Syntax: object.FalsePicture [= picture] The FalsePicture property has these parts: Part object picture Description An object expression that evaluates to an object in the Applies To list. A picture that determines the image of an object.
B.34
Font Property
Applies to: Button, Edit, Label This property returns a Font object for the main font of the control. Syntax: object.Font [= font]
B-22
Computing A5E0006550804
The Font property has these parts: Part object font Description An object expression that evaluates to an object in the Applies To list. A value that returns or sets the font used for the control.
B.35
ForeColor Property
Applies to: Button, Edit, Label, Slider This property returns or sets the foreground color used to display text and graphics in an object. Syntax: object.ForeColor [= color] The ForeColor property has these parts: Part object color Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the foreground colors of object.
The settings for color are: Setting Standard Colors Windows System Colors Description Colors specified by using the RGB Color palette Colors specified by system color constants (depending on the container); for example, colors listed in the Visual Basic (VB) object library in the Object Browser
B.36
FormatDisplay Property
Applies to: DBuffer This property allows you to change the format of the additional information of a selected diagnostic event. Syntax: object.FormatDisplay [= value]
Computing A5E0006550804
B-23
The FormatDisplay property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object displays the information for the diagnostic event as text or hexadecimal values.
The settings for value are: Setting True False Description (default) The information for the diagnostic event is displayed as text The information is displayed as hexadecimal numbers
B.37
KnobHeight Property
Applies to: Slider This property determines the height of the indicator displayed by the control. Syntax: object.KnobHeight [= single] The KnobHeight property has these parts: Part object single Description An object expression that evaluates to an object in the Applies To list. A value that determines the height of the indicator.
B.38
KnobPicture Property
Applies to: Slider This property determines the picture (graphic) used for the indicator on the control. Syntax: object.KnobPicture [= picture]
B-24
Computing A5E0006550804
The KnobPicture property has these parts: Part object picture Description An object expression that evaluates to an object in the Applies To list. A picture that determines the image for the indicator.
B.39
KnobWidth Property
Applies to: Slider This property determines the width of the indicator displayed by the control. Syntax: object.KnobWidth [= single] The KnobWidth property has these parts: Part object single Description An object expression that evaluates to an object in the Applies To list. A value that determines the width of the indicator.
B.40
LargeChange Property
Applies to: Slider This property determines how far the slider indicator moves when the control has focus and you press the Page Up or Page Down key. The Value property is increased by LargeChange if you press the Page Up key or click to the right of (above) the indicator. It is decreased by LargeChange if you press the Page Down key or click to the left of (below) the indicator. Syntax: object.LargeChange [= value] The LargeChange property has these parts: Part object value Description An object expression (identifier for the specific SIMATIC control) that evaluates to an object in the Applies To list. A value or constant that determines the amount of change.
Computing A5E0006550804
B-25
B.41
Locked Property
Applies to: Button, Edit, Slider If the control is locked it is in a read-only state. The user is unable to change any values, but the current value is still displayed. By default the control is not in locked mode, so you can enter numbers. Syntax: object.Locked [= boolean] The Locked property has these parts: Part object boolean Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether the control can be edited.
The settings for boolean are: Setting True Description You can scroll and highlight the text in the control, but you cannot edit it. Changes to the Value property will be reflected. This means that the control still shows values in the PLC, but the user is unable to change them. (Default) You can edit the text in the control.
False
B.42
B-26
Computing A5E0006550804
B.43
MultipleEngines Property
Applies to: Data This property specifies whether the control connects to a specific control engine or connects simultaneously to several control engines. See Appendix G for more information about control engine strings. Syntax: object.MultipleEngines [= value] The MultipleEngines property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether object connects to one or to several control engines.
The settings for value are: Setting True False Description object connects to more than one control engine simultaneously. (default) object connects only to the control engine specified in the ControlEngine property.
B.44
Offset Property
Applies to: Edit, Slider The Factor and Offset properties specify the scaling factor and the offset used when the scale-by-formula option has been enabled.
Note The ScaleMode property must be set to wByFormula (1) for the Factor and Offset properties to have any effect.
You can use a formula to scale the value. In the following formula, Value is similar to the contents of the Value property if the control is connected to the control engine; Factor is the value of the Factor property; Offset is the value of the Offset property; and DisplayValue is also the contents of the Text property. Value * Factor + Offset = DisplayValue
Computing A5E0006550804
B-27
Syntax: object.Offset [= value] The Offset property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A floating-point value that defines the factor or the offset for the scaling formula.
Note The default value of the factor is 1.0, and the default value of the offset is 0.0.
B.45
PCName Property
Applies to: Data This property selects the name of a remote computer (PC) in order to connect to a control engine over a network, such as a local area network (LAN). See Appendix G for more information about control engine strings. Syntax: object.PCName [= value] The PCName property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A String that specifies the pathname or identification of the remote computer (PC) for the connection.
B.46
Picture Property
Applies to: Slider, Label This property determines the picture (graphic) used for the control. Syntax: object.Picture [= picture]
B-28
Computing A5E0006550804
The Picture property has these parts: Part object picture Description An object expression that evaluates to an object in the Applies To list. A picture that determines the image of the object.
B.47
PopUpHelp Method
Applies to: DBuffer This method displays the online help for the S7 control. Syntax: result = object.PopUpHelp The PropertyChangedObject method has these parts: Part object result Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs.
B.48
PopUpHelpOnEvent Method
Applies to: DBuffer This method displays the online help for the selected diagnostics event. Syntax: result = object.PopUpHelpOnEvent The PropertyChangedObject method has these parts: Part object result Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs.
Computing A5E0006550804
B-29
B.49
Precision Property
Applies to: Edit This property is available if the DataFormat is set to Real (6) (data type with precision). In that case you can change the precision (number of digits behind the decimal point) of the number. The number will be rounded at the specified precision.
Note The DataFormat property must be set to Real (6) before this property can have an effect.
Syntax: object.Precision [= value] The Precision property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. An integer value that defines the precision of the number. The default precision is 3.
B.50
PropertyChangedName Method
Applies to: Data This method notifies the Data control that the value of a property of a connected control, referenced by the name of the object in the form, has changed. The Data control reads the value from the property and writes it to the data source.
Note A programmer who uses Visual Basic (or a similar programming language) would use the PropertyChangedName method, while a programmer who uses Visual C (or a similar programming language) would use the PropertyChangedObject method.
B-30
Computing A5E0006550804
The PropertyChangedName method has these parts: Part object result ConnectedObject Property Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs. A String expression that evaluates to the name of the connected control whose property has changed. A String value with the name of the property that has changed.
B.51
PropertyChangedObject Method
Applies to: Data This method notifies the Data control that the value of a property of a connected control (an object which was declared in the program) has changed. The Data control reads the value from the property and writes it to the data source.
Note A programmer who uses Visual Basic (or a similar programming language) would use the PropertyChangedName method, while a programmer who uses Visual C (or a similar programming language) would use the PropertyChangedObject method.
Syntax: result = object.PropertyChangedObject ConnectedObject, Property The PropertyChangedObject method has these parts: Part object result ConnectedObject Property Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs. A String expression that evaluates to the name of the connected control whose property has changed. A String value with the name of the property that has changed.
Computing A5E0006550804
B-31
B.52
PushButton Property
Applies to: Button Determines the operation mode of the control: if set to True or 1, the Value property is inverted as long as the Button control is pressed (MouseDown event) Syntax: object.PushButton [= boolean] The PushButton property has these parts: Part object boolean Setting True False Description An object expression that evaluates to an object in the Applies To list. An boolean expression that specifies the operation mode of the control. Description The button is pressed; the Value property is inverted. (default) The button is not pressed.
B.53
Note The ScaleMode property must be set to wByRange or wScaleNone before these properties can have an effect.
When you use a range transformation to scale the value, you specify a source range (for the values in the control engine) and a destination range (for the values that are displayed by the control). The values of one range will be transformed to the other range. The source and destination ranges define a ratio for the transformation; they do not define upper or lower limits. A value can be larger or smaller than the range; the transformation will use the two ranges to extrapolate the other value.
B-32
Computing A5E0006550804
Syntax: object.RawMax [= value] object.RawMin [= value] The RawMin and RawMax properties have these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the maximum or minimum raw value of the control.
B.54
ReadMultiVariables Method
Applies to: Data This method reads the status of the connected variables in the control engine. Syntax: result = object.ReadMultiVariables (VarNames, VarValues, States) The ReadMultiVariables method has these parts: Part object VarNames VarValues States result Description An object expression that evaluates to an object in the Applies To list. A Variant that specifies the array of variables (memory locations) to be read from the control engine. A Variant that contains an array of the corresponding values of the specified variables in the control engine. A Variant that contains an array of the quality code (Long) for each of the variables. A Long value that indicates whether an error has occurred. The result is zero if no error occurs.
B.55
ReadVariable Method
Applies to: Data This method reads the status of one specific variable in the control engine.
Computing A5E0006550804
B-33
Syntax: result = object.ReadVariable (VariableName, Value, State, TimeOut ) The ReadVariable method has these parts: Part object VariableName Value State TimeOut Description An object expression that evaluates to an object in the Applies To list. A String expression that specifies the variable (memory location) in the control engine to be read. A Variant value containing the content of the specified variable in the control engine. A Long value that provides the quality code for the variable. A Long value that determines the length of time (in ms) before generating a time-out error. (Not applicable for this release). For the current release, this value should always be 0. A Long value that indicates whether an error has occurred. The result is zero if no error occurs.
result
B.56
ScaleMode Property
Applies to: Edit, Slider This property specifies the scaling mode to be used for scaling values. The values can also be specified at the Scaling property tab. There are three choices for scaling mode: S Scaling by formula (1wByFormula): Value * Factor + Offset = DisplayValue where: Value is similar to the contents of the Value property if the control is connected to the control engine; Factor is the value of the Factor property; Offset is the value of the Offset property; and DisplayValue is the contents of the Text property. S Scaling by range transformation (2wByRange): you specify a source range (of PLC values) and a destination range (of displayed values), and the values of the one range are transformed to the other range.
B-34
Computing A5E0006550804
Note The Scale Mode property determines whether the RawMax, RawMin, Factor, and Offset properties have any effect.
Syntax: object.ScaleMode [= value] The ScaleMode property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the kind of scaling.
The settings for value are: Setting wNoScaling (0) wByFormula (1) wByRange (2) Description (default) No scaling Use the formula containing the factor and offset to scale the value Use the range transformation method to scale the value
B.57
SelectEvent Method
Applies to: DBuffer This method selects a specific diagnostic entry in the upper panel of the control. Syntax: result = object.SelectEvent EventNumber The SelectEvent has these parts: Part object result EventNumber Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs. An integer that evaluates to the number (event ID) of the diagnostic event.
Computing A5E0006550804
B-35
B.58
ShowErrorBoxes Property
Applies to: Data This property specifies whether to display the default error boxes when there is a user-generated error. Every time an error occurs, an Error event will be generated. If the ShowErrorBoxes property is enabled (selected), a default error message box will be displayed. All errors on connections are reported by the Connection Error event.
Note Computing provides error messages in English only. If you want to display messages in other languages, you must disable (deselect) the ShowErrorBoxes option and write program code to react on the error event.
Syntax: object.ShowErrorBoxes [= value] The ShowErrorBoxes property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether the control displays error boxes.
The settings for value are: Setting True False Description (default) The control shows the default error boxes. The error boxes are hidden.
B.59
ShowMinMax Property
Applies to: Slider This property specifies whether the control displays the range (minimum and maximum) of values. Syntax: object.ShowMinMax [= boolean]
B-36
Computing A5E0006550804
The ShowMinMax property has these parts: Part object boolean Description An object expression that evaluates to an object in the Applies To list. A Boolean expression that specifies whether the control displays the range of values.
The settings for boolean are: Setting True False Description (default) The control displays the minimum and maximum vales. The control does not display the range of values.
B.60
SmallChange Property
Applies to: Slider This property determines how far the indicator moves when the control has focus and you press the up/down or right/left arrow keys. The Value property is increased by SmallChange if you press the right (or up) arrow key. It is decreased by SmallChange if you press the left (or down) arrow key. Syntax: object.SmallChange [= value] The SmallChange property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the amount of change
Computing A5E0006550804
B-37
B.61
StretchMode Property
Applies to: Button, Slider, Label This property returns or sets the stretch mode (centered, resize image, resize frame, smart tile or tile) of the control. This property can only be used if the Style property is set to 1 wGraphical. Syntax: object.StretchMode [= value] The StretchMode property has these parts: Part object value Description The identifier for the specific control A constant that determines the stretch mode, as described in Settings
The settings for value are: Setting 0 1 2 3 Description wCentered The bitmap is centered in the control.
wResizeImage (Default) The bitmap is resized (stretched or shrunk) to fit the control. wResizeFrame The frame of the control is resized to the size of the bitmap. wSmartTile The bitmap is expanded to fit the control by replicating adjacent rectangles. This setting works best with a singlecolor bitmap with a border. wTile The bitmap, if smaller than the control, is duplicated and tiled to fill the control.
B-38
Computing A5E0006550804
B.62
Style Property
Applies to: Button, Slider, Label This property returns or sets the style (standard or graphical) of the control. Syntax: object.Style [= value] The Style property has these parts: Part object value Description The identifier for the specific control A constant that determines the style, as described in Settings
The settings for value are: Setting 0 1 Description wStandard (uses internal drawing methods) wGraphical (Default) (uses bitmaps)
B.63
TagSource Property
Applies to: Data This property identifies the source of symbolic information to be used when assigning variables and identifying control engines. The source can be a tag file. See Appendix G for more information about control engine strings. Syntax: object.TagSource [= value] The TagSource property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A String that identifies the pathname to the source (such as a tag file) of symbolic information to be used when configuring the control for variables and control engines.
Computing A5E0006550804
B-39
B.64
Text Property
Applies to: Edit This property determines the text displayed by the control. Syntax: object.Text [= value] The Text property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A String value that specifies the text to be displayed by the control.
B.65
Ticks Property
Applies to: Slider This property sets the number of ticks, or unit markers, of the control. For example, if Ticks = 10, the scale of the control will be divided into 10 sections. Syntax: object.Ticks [= value] The Ticks property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the number of unit markers to be displayed.
B.66
TrueCaption Property
Applies to: Button This property determines the text that is displayed in the control when the Value property is True (equal to 1, or On). Syntax: object.TrueCaption [= string]
B-40
Computing A5E0006550804
The TrueCaption property has these parts: Part object string Description An object expression that evaluates to an object in the Applies To list. Text that determines the active or inactive text of the control
B.67
TrueColor Property
Applies to: Button This property determines the color of the control when the Value property is True (equal to 1, or On). Syntax: object.TrueColor [= color] The TrueColor property has these parts: Part object color Description An object expression that evaluates to an object in the Applies To list. A value or constant that determines the background or foreground colors of an object, as described in Settings
The settings for value are: Setting Standard Colors Windows System Colors Description Colors specified by using the RGB Color palette Colors specified by system color constants (depending on the container); for example, colors listed in the Visual Basic (VB) object library in the Object Browser
Computing A5E0006550804
B-41
B.68
TruePicture Property
Applies to: Button This property returns or sets the active (on, true, etc.) picture displayed on the control. Syntax: object.TruePicture [= picture] The TruePicture property has these parts: Part object picture Description An object expression that evaluates to an object in the Applies To list A picture that determines the image of an object
B.69
Update Method
Applies to: DBuffer This method reads the diagnostic buffer of the control engine and updates the information displayed in the control. result = object.Update Syntax: The Update method has these parts: Part object result Description An object expression that evaluates to an object in the Applies To list. A long value that indicates whether an error has occurred. The result is zero if no error occurs.
B-42
Computing A5E0006550804
B.70
Value Property
Applies to: Button, Edit, Slider This property should be linked, using the DATA Control to a value in the PLC. It is bindable. Edit Control The value property is a a variant which returns/sets the (unscaled) value of the control. Button Control The value property reflects the state of the button. Slider Control The value property reflects the position of the Slider Control indicator.
Note If the value of the Value property changes, the Change event will be generated.
Syntax: object.Value [= value] The Value property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A Variant that specifies the value of the control.
B.71
WriteMode Property
Applies to: Edit This property determines how the control responds when the user enters a new value. If the write mode is set to Automatic (0), the value (if valid) is written automatically into the Value property (and to the control engine). If the write mode is Manual (1), the value is not written to the value property unless your program code calls the method Write at the control. Syntax: object.WriteMode [= value]
Computing A5E0006550804
B-43
The WriteMode property has these parts: Part object value Description An object expression that evaluates to an object in the Applies To list. A value or constant that specifies whether the control automatically passes entered values to the Value property.
The settings for value are: Setting Automatic (0) Manual (1) Description (default) Automatically passes the new (input) value to the Value property Does not write the new (input) value unless the control processes a Write method
B.72
WriteNow Method
Applies to: Edit This method issues a value changed for the Value property of the control. You must use this method only if the WriteMode property is set to Manual (1). Syntax: object.WriteNow The WriteNow method has these parts: Part object Description An object expression that evaluates to an object in the Applies To list.
B.73
WriteMultiVariables Method
Applies to: Data This method writes new values for several variables in the control engine. Syntax: result = object.WriteMultiVariables (VarNames, VarValues, States) The WriteMultiVariables method has these parts:
B-44
Computing A5E0006550804
Description An object expression that evaluates to an object in the Applies To list. A Variant that specifies the array of variables (memory locations) in the control engine. A Variant that contains an array of the corresponding values to be written to the specified variables. A Variant that contains an array of the quality code (Long) for each of the variables. A Long value that indicates whether an error has occurred. The result is zero if no error occurs.
B.74
WriteVariable Method
Applies to: Data This method writes a new value to a specific variable in the control engine. Syntax: result = object.WriteVariable (VariableName, Value, TimeOut ) The WriteVariable method has these parts: Part object VariableName Value TimeOut Description An object expression that evaluates to an object in the Applies To list. A String expression that specifies the variable (memory location) in the control engine. A Variant value containing the content to be written to the specified variable in the control engine. A Long value that determines the length of time (in ms) before generating a time-out error. (Not applicable for this release). For the current release, this value should always be 0. A Long value that indicates whether an error has occurred. The result is zero if no error occurs.
result
B.75
Zeropad Property
Applies to: Edit This property determines whether the number displayed by the control is padded with zeros (to the left of the value) to the size of the data type.
Computing A5E0006550804
B-45
Syntax: object.Zeropad [= value] The ZeroPad property has these parts: Part object value Description An object expression (identifier for the specific SIMATIC control) that evaluates to an object in the Applies To list. A Boolean expression that specifies whether or not the displayed number is filled with leading zeros.
The settings for value are: Part True False Description Fills the number with leading zeros to the size specified by the DataType property. (default) Does not fill the number with leading zeros.
B-46
Computing A5E0006550804
Events
C.1
Change Event
Applies to: Button, Edit, Label, Slider This event occurs when the value of the Value property changes. Either the control engine or the S7 control object can change the value in the Value property. Syntax: Change()
C.2
Click Event
Applies to: Button, Edit, Label, DBuffer, Slider This event occurs when a mouse button is pressed and released while the mouse cursor is over the control. Syntax: Click()
Note To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events. If there is code in the Click event, the DblClick event will never trigger, because the Click event is the first event to trigger between the two. As a result, the mouse click is intercepted by the Click event, so the DblClick event does not occur.
C.3
ConnectionError Event
Applies to: Data This event occurs when an error on a connection occurs. Syntax: ConnectionError(State As Long, ConnectedObject As Object, _ Property As String, Variable As String)
Computing A5E0006550804
C-1
Events
The ConnectionError event has these parts: Part State ConnectedObject Property Variable Description A long value with the state of the connection An object expression that evaluates to the connected object A string value with the name of the property A string value with the name of the connected variable
C.4
DblClick Event
Applies to: Edit, Label, Slider This event occurs when a mouse button is double-clicked while the cursor is over the control. Syntax: DblClick()
Note To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events. If there is code in the Click event, the DblClick event will never trigger, because the Click event is the first event to trigger between the two. As a result, the mouse click is intercepted by the Click event, so the DblClick event does not occur.
C.5
Error Event
Applies to: Button, Edit, Label, Slider This event occurs when the control encounters an error. Syntax: Error(long SCode, BSTR lpszDescription, BSTR IpszHelpFileName, _ long nHelpId) The Error event has these parts: Part SCode lpszDescription Description See Table C-1 String with a description of the error condition
C-2
Computing A5E0006550804
Events
Description Name of the Help file in which the error is described Help topic ID with a description of the error
SCodes (Error Event Codes)
Name wFACTOR_ZERO wRAWMINMAX wMINMAX wLARGECHANGE_ZERO wTICKS_ZERO_100 wKNOBHEIGHT_ZERO wKNOBWIDTH_ZERO wSMALLCHANGE_ZERO wRAWMIN_SCALEMODE wRAWMAX_SCALEMODE wEDIT_OUT_OF_RANGE wEDIT_WRONGVALUE wBIGFONT wPREC_RANGE
Value 0xC0040002 0xC0040006 0xC0040009 0xC004000A 0xC004000C 0xC004000E 0xC0040010 0xC0040012 0xC0040014 0xC0040015 0xC0040016 0xC0040017 0xC0040018 0xC004001A
Description Factor: Must not be zero. RawMin mustbe less than RawMax. Min must be less than Max. Large Change: Must be greater than zero and less than... Ticks: Must be a number between 1 and 100. Knob Height: Must be greater than zero. Knob Width: Must be greater than zero. Small Change: Must be greater than zero and less than... RawMin may only be set if ScaleMode is wByRange. RawMax may only be set if ScaleMode is wByRange. Value out of range. A wrong value has been set. Warning: Font size is too big. Precision: Must be a number between 0 and 7.
C.6
KeyDown Event
Applies to: Button, Edit, Slider This event occurs when the user presses a key while the control has the focus. See also the KeyUp Event. Syntax: KeyDown(long KeyID, long Shift) The KeyDown event has these parts:
Computing A5E0006550804
C-3
Events
Part KeyID
Description Key code, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key) To specify key codes, use the constants in the Visual Basic (VB) object library in the Object Browser.
Shift
An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys have been pressed. For example, if both CTRL and ALT are pressed, the value of shift is 6.
Use the KeyDown and KeyUp event procedures if you need to respond to both the pressing and releasing of a key. KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: keycode, which indicates the physical key (thus returning A and a as the same key) and shift, which indicates the state of shift+key and therefore returns either A or a. If you need to test for the shift argument, you can use the shift constants that define the bits within the argument. The constants have the following values: S S S vbShiftMask (1): SHIFT key bit mask vbCtrlMask (2): CTRL key bit mask vbAltMask (4): ALT key bit mask
The constants act as bit masks that you can use to test for any combination of keys. You test for a condition by first assigning each result to a temporary integer variable and then comparing Shift to a bit mask. Use the And operator with the Shift argument to test whether the condition is greater than 0, indicating that the modifier was pressed.
C.7
KeyPress Event
Applies to: Button, Edit, Slider This event occurs when an ANSI key is pressed and released while the control has the focus. Syntax: KeyPress (long keyAscii) The KeyPress event has these parts:
C-4
Computing A5E0006550804
Events
Part keyAscii
Description ASCII key code of the pressed key, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key)
C.8
KeyUp Event
Applies to: Button, Edit, Slider This event occurs when a key is released while the control has the focus. Syntax: KeyUp(long KeyID, long Shift) The KeyDown event has these parts: Part KeyID Description Key code, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key) To specify key codes, use the constants in the Visual Basic (VB) object library in the Object Browser. Shift An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys have been pressed. For example, if both CTRL and ALT are pressed, the value of shift is 6. Use KeyDown and KeyUp event procedures if you need to respond to both the pressing and releasing of a key.
Computing A5E0006550804
C-5
Events
KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: keycode, which indicates the physical key (thus returning A and a as the same key) and shift, which indicates the state of shift+key and therefore returns either A or a. If you need to test for the shift argument, you can use the shift constants which define the bits within the argument. The constants have the following values: S S S vbShiftMask (1): SHIFT key bit mask vbCtrlMask (2): CTRL key bit mask vbAltMask (4): ALT key bit mask
The constants act as bit masks that you can use to test for any combination of keys. You test for a condition by first assigning each result to a temporary integer variable and then comparing Shift to a bit mask. Use the And operator with the Shift argument to test whether the condition is greater than 0, indicating that the modifier was pressed.
C.9
MouseDown Event
Applies to: Button, Edit, Label, Slider This event occurs when a mouse button is pressed while the mouse cursor is over the control. Syntax: MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, _ OLE_YPOS_PIXELS y) The MouseDown event has these parts:
C-6
Computing A5E0006550804
Events
Part Button
Description An integer that identifies the button that was pressed to cause the event The button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Only one of the bits is set, indicating the button that caused the event.
Shift
An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released A bit is set if the key is down. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. The shift argument indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of shift would be 6.
x, y
returns a number that specifies the current location of the mouse pointer
C.10
MouseMove Event
Applies to: Button, Edit, Label, Slider This event occurs when the mouse cursor moves over the control. Syntax: MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, _ OLE_YPOS_PIXELS y)
Computing A5E0006550804
C-7
Events
The MouseMove event has these parts: Part Button Description An integer that identifies the button that was pressed to cause the event The button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Only one of the bits is set, indicating the button that caused the event. Shift An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released A bit is set if the key is down. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. The shift argument indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of shift would be 6. x, y returns a number that specifies the current location of the mouse pointer
C.11
MouseUp Event
Applies to: Button, Edit, Label, Slider This event occurs when a mouse button is released while the mouse cursor is over the control. Syntax: MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, _ OLE_YPOS_PIXELS y)
C-8
Computing A5E0006550804
Events
The MouseUp event has these parts: Part Button Description An integer that identifies the button that was pressed to cause the event The button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Only one of the bits is set, indicating the button that caused the event. Shift An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released A bit is set if the key is down. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. The shift argument indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of shift would be 6. x, y returns a number that specifies the current location of the mouse pointer
C.12
ValueChanged Event
Applies to: Data This event occurs when the value of a connected variable changes and no connected event was specified on the call to the Connect method. A ValueChangedEvent can also be configured using the Events Property Tab. Syntax: ValueChanged(Property As String, Variable As String, Value as _ Variant, Quality as Integer) The ValueChanged event has these parts: Part Property Variable Value Quality Description A string value with the name of the property A string value with the name of the connected variable A variant with the new value of Variable Returns an integer with the quality of the new value
Computing A5E0006550804
C-9
Events
C-10
Computing A5E0006550804
Chapter Overview
The Computing Configuration tool allows you to direct communications to a control engine. You can also use the tool to choose a language for for the Computing Software, to set up the OPC server, or to connect applications generated from older versions of Computing that did not support tag files.
Note You can have only one control engine active at a time. Instead of reconfiguring the Data Control in your program, you can use the configuration tool to change the control engine for the connection.
Description Configuring the OPC Connection Selecting the Language Selecting the Control Engine for Older Programs Setting Up Communications Using the PG/PC Interface
Computing A5E0006550804
D-1
D.1
D-2
Computing A5E0006550804
3. To use symbols for accessing data in the control engine or to access multiple control engines, select the Connection via Tag Source option and enter the name of the tag file. (Click on the Browse button to browse to the tag file.) 4. Click on the Apply button to enter the data, and click on the OK button to close the dialog box.
Computing Configuration
OPC Language Computing Connection
Browse..
Control Engine
OK Figure D-1
Cancel
Apply
Help
Computing A5E0006550804
D-3
Table D-1
Description The value of one or more parameters was not valid. This is generally used in place of a more specific error where it is expected that problems are unlikely or will be easy to identify (for example. when there is only one parameter). There is not enough memory to complete the requested operation. This can happen any time the server needs to allocate memory to complete the requested operation. The server does not support the requested data rate, but will use the closest available rate. A value passed to WRITE was accepted, but was clamped. An invalid handle was passed. A duplicate parameter was passed where one is not allowed. The server does not support the specified local ID. The server cannot convert between the passed or requested data type and the canonical data type for this item. The requested operation cannot be performed on a public group. The access rights for the item do not allow the operation. The item definition does not exist within the address space of the server. This can also occur on an exiting item if the item is deleted on-line from the server address space by some external operation. The item definition does not conform to the syntax of the server. The filter string is not valid. The access path of the item is not known to the server. A value passed to WRITE is out of range. A group with a duplicate name already exits in the server.
0x8007000E
E_OUTOFMEMORY
D-4
Computing A5E0006550804
D.2
Language english
Select the language for the menus and help files of the SIMATIC Computing applications.
OK Figure D-2
Cancel
Apply
Help
Selecting the Language for the CPU Panel and Help Files
Computing A5E0006550804
D-5
D.3
Note This page only provides backward compatibility with applications generated from older Computing versions that did not support tagfiles. If you are using tagfiles, you do not need to use this page.
1. Use the Start menu (Start " Simatic " PC Based Control " Computing Configuration ) to open the Computing Configuration tool. 2. Click on the Computing tab. 3. As shown in Figure D-3, select the control engine: Click on the WinLC option to select the WinLC control engine. Click on the CPU416-2 DP ISA option to select the CPU 416-2 DP ISA control engine. Click on the MPI option and enter an MPI address to select a PLC on the MPI network as the control engine. 4. Click on the OK button to select the control engine. (Click on the Undo button to reset the control engine.)
Computing Configuration
OPC Language Computing Connection
S WinLC (WinAC Basis) S CPU 416-2 DP ISA (WinAC Pro) S MPI (other PLCs on the MPI network)
This page only provides backward compatibility with Computing applications generated from older versions that did not support tagfiles. If tagfiles are used, this is not needed.
OK Figure D-3
Cancel
Apply
Help
D-6
Computing A5E0006550804
D.4
OK Figure D-4
Cancel
Apply
Help
Computing A5E0006550804
D-7
Access Path Access Point of Application: (Standard for Micro/WIN) S7ONLINE (STEP 7) >PC Internal (local) Setting the PG/PC Interface Access Path Access Point of Application: Micro/WIN >PC/PPI cable (PPI) Interface Parameter set used: (Standard for Micro/WIN) Properties... PC Internal (local) Interface Parameter set used: MPIISAPC/PPI on board (MPI) Properties... cable (PPI) CP5611 (MPI) MPIISA on board (PPI) CP5412A2(PROFIBUS) MPIISA Card (PROFIBUS) Copy... PC Internal (local) PC Adapter (MPI) Delete PC Adapter (PROFIBUS)PC/ TCP/IP>3Com Etherlink III Adapter Copy... (Assigning Parameters to a PC/PPI Cable PPI cable (PPI) for a PPI Network) Interfaces Delete Install...
Cancel
Help
Select...
OK
Cancel
Help
Figure D-5
D-8
Computing A5E0006550804
From the computer on which STEP 7 resides, follow these steps to configure STEP 7 for communicating with WinLC on a remote computer: 1. Access the interface configuration tool from SIMATIC Manager through Options " Set the PG/PC Interface.
Setting the PG/PC Interface
Access Path Access Point of Application: (Standard for STEP 7) S7ONLINE (STEP 7) > CP5412A2(PROFIBUS) Setting the PG/PC Interface Access Path Access Point of Application: Interface Parameter set used: Micro/WIN >PC/PPI cable (PPI) (Standard for Micro/WIN) Properties... CP5412A2(PROFIBUS) Interface Parameter set used: MPIISAPC/PPI on board (MPI) Properties... cable (PPI) MPIISA on board (PPI) CP5611 (MPI) MPIISA Card (PROFIBUS) CP5611 (PROFIBUS) Copy... PC Adapter (MPI) CP5412A2(MPI) Delete PC Adapter (PROFIBUS)PC/ Copy... (Assigning Parameters to a PC/PPI Cable CP5412A2(PROFIBUS) PPI cable (PPI) for a PPI Network) PC Internal (local) Interfaces Delete TCP/IP>3Com Etherlink III Adapter Install...
(Configuration of your Communication Processor Cancel OK CP 5412 (A2) for a PROFIBUS network) Interfaces Add/Remove:
Help
Select...
OK
Cancel
Help
Figure D-6
2. From the Access Point of Application drop-down list, select S7ONLINE (STEP7). 3. Select the interface parameter from the parameter set that corresponds to your network communications path. S S For MPI communication, select the MPI interface, for example, CP5611 (MPI). For PROFIBUSDP communication, select the PROFIBUSDP interface, for example, CP5412A2(PROFIBUS). The WinLCs PROFIBUS card must be properly configured through Setting the PG/PC Interface before WinLC is visible to other PGs on the PROFIBUSDP network (S7ONLINE (STEP7) > Profibus.... It must be set for PG is the only master on the bus. S For Industrial Ethernet communication, select the TCP/IP interface, for example, TCP/IP > 3Com Etherlink III Ada... You must have the NCM Options package for H1 communication and STEP 7 V5 SP3.
Computing A5E0006550804
D-9
Note NetPro cannot reconfigure the MPI or H1 addresses or the bus parameters of a WinLC from a different computer. The required CP cards are not controlled by WinLC. This can only be done via the local Setting the PG/PC Interface application. The PROFIBUS node address and bus parameters can be reconfigured remotely. The WinLC is the master of its own PROFIBUS I/O card.
From the computer on which WinLC resides, the communication path(s) to networks with computer(s) running STEP 7 must be configured. Ten access points are installed by WinLC. Each access point can point to one of the installed interfaces. Example: WinLC_0 > none WinLC_1 > CP5412A2 (PROFIBUS) WinLC_2 > none WinLC_3 > none WinLC_4 > none WinLC_5 > none WinLC_6 > CP5611 (PROFIBUS) WinLC_7 > none WinLC_8 > none WinLC_9 > none
In this example, the WinLC 3.0 can be accessed through two cards at the same time. The WinLC cannot be reached through cards that are not assigned to an access point.
D-10
Computing A5E0006550804
To configure one of the access points, follow these steps: 1. Access the interface configuration tool through WinLC. Use (CPU " Setting the PG/PC Interface.
Setting the PG/PC Interface
Access Path Access Point of Application: (Standard for STEP 7) WinLC_1 > CP54212A2 (PROFIBUS) Setting the PG/PC Interface Access Path Access Point of Application: Interface Parameter set used: Micro/WIN >PC/PPI cable (PPI) (Standard for Micro/WIN) Properties... CP54212A2(PROFIBUS) Interface Parameter set used: MPIISAPC/PPI on board (MPI) Properties... cable (PPI) CP5611 (MPI) MPIISA on board (PPI) MPIISA Card (PROFIBUS) CP5412A2(PROFIBUS) Copy... PC Internal (local) PC Adapter (MPI) Delete PC Adapter (PROFIBUS)PC/ TCP/IP>3Com(Assigning Etherlink III Adapter Copy... Parameters to a PC/PPI Cable PPI cable (PPI) for a PPI Network) Interfaces Delete Install...
(Parameter assignment of yourOK communications Cancel processor CP54212A2 for a PROFIBUS network) Interfaces Add/Remove
Help
Select..
OK
Cancel
Help
Figure D-7
2. From the Access Point of Application drop-down list, select WinLC_0. 3. Select the interface parameter from the parameter set that corresponds to your network communications path, for example CP5412A2 (PROFIBUS). Repeat steps 2 and 3 as needed to configure each access point used to communicate to a network.
Note The cyclic distribution of PROFIBUS bus parameters cannot be performed by WinLC.
Computing A5E0006550804
D-11
D-12
Computing A5E0006550804
Chapter Overview
The Computing software allows you to communicate across networks using Windows NTs Distributed Component Object Model (DCOM). You can use DCOM to integrate distributed applications by way of a network. A distributed application consists of multiple processes or different computers that cooperate to accomplish a single task. DCOM is a set of Microsoft concepts and program interfaces in which client program objects can request services from server program objects on other computers in a network. The Component Object Model (COM) provides a set of interfaces that allow clients and servers to communicate within the same computer (running Windows 95 or Windows NT).
Note The control engine must be installed on the server computer. If you plan to use the SIMATIC controls provided with Computing to access the control engine, install the Computing software on both the server computer and the client computer.
Description Using DCOM to Provide Remote Access Configuring the Permissions for the Server Computer Configuring the Permissions for the Client Computer Troubleshooting
Computing A5E0006550804
E-1
E.1
Third-party control SIMATIC Button control SIMATIC Number control SIMATIC Slider control
DCOM Components
PC 1
MPI server
WinLC
MPI Card
I/O
I/O
MPI = n
Figure E-1
You can also utilize Microsofts DCOM technology to create a network of computers that cooperate to provide the control system for a machine or process. Figure E-2 shows how one computer running an application that uses ActiveX controls (from Computing) can use DCOM to communicate with a different computer that uses WinLC (or other S7 PLCs) to control a process. The Windows NT operating system provides a configuration tool (dcomcnfg) for setting up your DCOM network. Use this tool to configure the server and client computers. For information about configuring the server computer, see Section E.2; for information about configuring the client computer, see Section E.3.
E-2
Computing A5E0006550804
Third-party control SIMATIC Button control SIMATIC Number control SIMATIC Slider control
DCOM Components
PC 1
Client
Network
DCOM Components
MPI server
PC 2
WinLC
MPI Card
I/O
I/O
Server
MPI = n
Figure E-2
Note You install the WinAC authorization on the server computer; you install the SIMATIC Computing authorization on the client computer. If you want to run SIMATIC Computing on a PC other than the PC running WinLC, then you must purchase SIMATIC Computing standalone. For more information about installing an authorization, see Section 3.2.
Computing A5E0006550804
E-3
E.2
Caution Granting permission to access applications on a computer allows other users to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Configure the identity permissions for the running class Figure E-3 Tasks for Configuring the DCOM Server
E-4
Enable Distributed COM on this computer Default Distributed COM communication properties The Authentication Level specifies security at the packet level. Default Authentication Level: Connect
The Impersonation Level specifies whether applications can determine who is calling them, and whether the application can do operations using the clients identity. Default Impersonation Level: Identify
OK Figure E-4
Cancel
Apply
Computing A5E0006550804
E-5
Click on the Edit Default button to allow remote users to access the computer
Default Access Permissions You may edit who is allowed to access applications that do not provide their own settings.
Edit Default...
Default L You may provide th
Type Type of of Access: Access: OK Figure E-5 Cancel Add... Remove Remove Help
3. Click on the Add button to display the Add Users and Groups dialog box and change the security settings for access to the server. See Figure E-6. 4. From the Names field, select Everyone (or the appropriate subset of users) and click on the Add button. 5. Select INTERACTIVE and click on the Add button. 6. Select SYSTEM and click on the Add button.
E-6
Computing A5E0006550804
Select the user groups to be allowed access, such as Everyone, Interactive, and System. Click on the Add button to add the groups to the permission list.
Add Add
Add Names:
Show Users
Members... Members...
Search...
OK Figure E-6
Cancel
Help
7. Click on the OK button to enter these changes to the Registry Value Permissions dialog box. 8. Click on the OK button of the Registry Value permissions dialog box to enter the changes to the default access permissions. The Registry Value permissions dialog box closes and displays the Distributed COM Configuration Properties dialog box (Figure E-5).
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Computing A5E0006550804
E-7
Default Access Permissions You may edit who is allowed to access applications that do not provide their own settings.
Ed Click on the Edit Default button to allow remote users to launch applications on this computer
Default Launch Permissions You may edit who is allowed to launch applications that do not provide their own settings.
Click on the Add button to change the security settings Type of Access: Access: Type of OK Figure E-7 Cancel Add... Remove Remove Help
3. In the Names field of the Add users and Groups dialog box (Figure E-8), select Everyone (or the appropriate subset of users) and click on the Add button.
E-8
Computing A5E0006550804
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Select the user groups to be allowed access, such as Everyone, Interactive, and System. Click on the Add button to add the groups to the permission list.
Add Add
Add Names:
Show Users
Members... Members...
Search...
OK Figure E-8
Cancel
Help
4. Select INTERACTIVE and click on the Add button. 5. Select SYSTEM and click on the Add button. 6. Click on the OK button to enter these changes to the Registry Value Permissions dialog box. 7. Click on the OK button of the Registry Value permissions dialog box to enter the changes to the default access permissions. The Registry Value permissions dialog box closes and displays the Distributed COM Configuration Properties dialog box.
Computing A5E0006550804
E-9
Select Running Class and click on the Properties button to configure the properties of the running class
E-10
Computing A5E0006550804
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Use the following procedure to configure the access permissions for the running class: 1. Click on the Security tab of the Running Class Properties dialog box. 2. Select Use custom access permissions and click on the Edit button. See Figure E-10. 3. If Everyone (or the appropriate subset of users) is not shown in the Permissions dialog Name list, click on the Add button to display the Add Users or Groups dialog box. See Figure E-11.
Running Class Properties
General Security Identity
Use default access permissions Use custom access permissions You may edit who can access this application.
Use default launch permissions Use custom launch permissions You may edit who can launch this application.
Select Use custom launch permissions and click on the Edit button to ensure that the correct set of users is allowed access to the server
Edit...
Use default configuration permissions Use custom configuration permissions You may edit who can change the configuration information for this application.
Edit...
OK Figure E-10
Cancel
Apply
Computing A5E0006550804
E-11
4. Use the Add Users and Groups dialog (Figure E-11) to add users/groups as required. 5. Click on the OK button to return to the Running Class Properties dialog box.
Add Users and Groups
List Names From: Names: Domain Admins Designated administrators of the domain All domain guests All domain users All users Users accessing this object locally The operating system NTnet
Add Add
Add Names:
Show Users
Members... Members...
Search...
Ensure that the correct groups of users are allowed access to the server
OK Figure E-11
Cancel
Help
E-12
Computing A5E0006550804
If the control engine is not running as an NT service, select The interactive user
Which user account do you want to use to run this application? The interactive user The launching user This user User: Password: Confirm Password: NTnet/NDS1910
The The System System Account Account (services (services only) only)
OK Figure E-12
Cancel
Apply Apply
Computing A5E0006550804
E-13
E.3
Note You do not configure the running class properties for the client computer. You define the running class on the server computer. See Figure E-9.
Configure the permissions for launching applications on the client Figure E-13 Tasks for Configuring the DCOM Client
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
E-14
Computing A5E0006550804
Enable Distributed COM on this computer Default Distributed COM communication properties The Authentication Level specifies security at the packet level. Default Authentication Level: Connect
The Impersonation Level specifies whether applications can determine who is calling them, and whether the application can do operations using the clients identity. Default Impersonation Level: Identify
OK Figure E-14
Cancel
Apply
Computing A5E0006550804
E-15
Click on the Edit Default button to allow remote users to access the computer
Default Access Permissions You may edit who is allowed to access applications that do not provide their own settings.
Edit Default...
Default Launch Permissions You may Registry Value Permissions provide th Registry Value: DefaultAccessPermission Owner: FrM2001 (F Marc) Name: Default C You may e configurat and adjus
Type of Access: Access: Type of OK Figure E-15 Cancel Add... Remove Remove Help
3. Click on the Add button to display the Add Users and Groups dialog box and change the security settings for access to the server. See Figure E-16. 4. From the Names field, select Everyone (or the appropriate subset of users) and click on the Add button. 5. Select INTERACTIVE and click on the Add button. 6. Select SYSTEM and click on the Add button.
E-16
Computing A5E0006550804
Add Add
Add Names:
Show Users
Members... Members...
Search...
Select the user groups to be allowed access, such as Everyone, Interactive, and System. Click on the Add button to add the groups to the permission list.
Type of Access: Allow Access
OK Figure E-16
Cancel
Help
7. Click on the OK button to enter these changes to the Registry Value Permissions dialog box. 8. Click on the OK button of the Registry Value permissions dialog box to enter the changes to the default access permissions. The Registry Value permissions dialog box closes and displays the Distributed COM Configuration Properties dialog box (Figure E-15).
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Computing A5E0006550804
E-17
Default Access Permissions You may edit who is allowed to access applications that do not provide their own settings.
Ed Click on the Edit Default button to allow remote users to launch applications on this computer
Default Launch Permissions You may edit who is allowed to launch applications that do not provide their own settings.
Edit Default...
Default C Registry Value Permissions You may configurat and adjust Registry Value: DefaultAccessPermission
Click on the Add button to change the security settings Type Type of of Access: Access: OK Figure E-17 Cancel Add... Remove Remove Help
3. In the Names field of the Add users and Groups dialog box (Figure E-18), select Everyone (or the appropriate subset of users) and click on the Add button.
E-18
Computing A5E0006550804
Caution Granting permission to access applications on a computer allows other users (such as Everyone) to start and stop programs or to access files on your computer. Granting unlimited access to everyone on the network could cause problems from either innocent or malicious interference. Always limit access to those users who are required to use the applications or files on the computer.
Add Add
Add Names:
Show Users
Members... Members...
Search...
Select the user groups to be allowed access, such as Everyone, Interactive, and System. Click on the Add button to add the groups to the permission list.
Type of Access: Allow Access
OK Figure E-18
Cancel
Help
4. Select INTERACTIVE and click on the Add button. 5. Select SYSTEM and click on the Add button. 6. Click on the OK button to enter these changes to the Registry Value Permissions dialog box. 7. Click on the OK button of the Registry Value permissions dialog box to enter the changes to the default access permissions. The Registry Value permissions dialog box closes and displays the Distributed COM Configuration Properties dialog box.
Computing A5E0006550804
E-19
E.4
Troubleshooting
This section provides suggestions for some of the problems that could occur with DCOM. For more information, refer to the Microsoft online product support (www.microsoft.com).
Problems with Reading and Writing Data between Two Computers over DCOM
Situation: you are running Computing on the client computer (PC1) and are connected over DCOM to WinLC on the server (PC2). You expect to read and write data between the two computers, but data updates from WinLC on PC2 do not occur. Possible explanation: PC1 was not configured to allow PC2 to send update messages to PC1. Possible solution: 1. Run the DCOM configuration tool (dcomcnfg) on PC1. 2. Click on the Default Security tab. 3. Click on the Edit Default button for Default Access Permissions to display the Registry Value Permissions dialog box. 4. Click on the Add button to display the Add Users and Groups dialog box and change the security settings for access to the server. 5. From the Names field, select Everyone and click on the Add button. 6. Click on the OK button to enter these changes to the Registry Value Permissions dialog box. 7. Click on the OK button to enter the changes to the default access permissions.
E-20
Computing A5E0006550804
Chapter Overview
The SIMATIC Data control can be used not only with other SIMATIC ActiveX controls, but also with other third-party or custom ActiveX controls. To work with a custom ActiveX control, the Data control requires that the control provide a minimum of code to respond to changes in the assigned variable. When you write programs that use the SIMATIC controls provided by the Computing software to access the control engine, be aware of the programming guidelines, especially those in regard to the use of timers in your code. The Computing software provides a container (SoftContainer) for the SIMATIC controls and other ActiveX controls. You can also use other containers, such as Visual Basic, with the SIMATIC Controls. In order to use the SIMATIC controls in another container, the container must support the extended controls. If the container does not support these functions, you must supply program code to perform these functions.
Description Guidelines for Third-Party Containers Programming Guidelines Guidelines for Creating Custom ActiveX Controls Using a Custom ActiveX Control with a Data Control Known Problems for Computing Version 3
Computing A5E0006550804
F-1
F.1
The extended control of the container must also support a Name property. The SoftContainer provided with the Computing software supports extended controls, as does Microsofts Visual Basic. Containers from other vendors (such as Borlands Delphi version 3.0) do not support extended controls. The Siemens customer support center can help determine if your container supports the extended control functions. If your container does not support the extended control functions, you must provide program code to perform these functions. Contact the Siemens customer support center for sample code that performs the extended control functions.
OLE Containers
Computing is an open system that may be used with OLE containers and controls from a variety of vendors. The SIMATIC controls have been tested with the following containers: S S S S S Microsoft Visual Basic 5.0 Microsoft Visual Basic 6.0 Microsoft Visual Basic for Applications (VBA) for the Microsoft Office 97 applications Microsoft Visual C++ of Microsoft Visual Studio 5.0 and 6.0 SoftContainer installed with the Computing software.
Some other containers from other vendors (such as Borland Delphi 3.0) do not support all the necessary ActiveX interfaces to support the property browsing functions of the Data control to other controls. For these containers, you must write additional code in your program to support the Microsoft extended controls functions for containers.
F-2
Computing A5E0006550804
Refer to the Documentation (Especially to the List of Known Problems) for Any Third-Party OLE Container
When using the SIMATIC controls within a third-party container, please refer to the list of known problems for that container. For example: under some conditions, Visual Basic 5.0 can cause an exception when closing. This will not affect the operation of Computing.
Computing A5E0006550804
F-3
F.2
Programming Guidelines
The following guidelines relate specifically to Visual Basic; however, they can also apply to other programming languages.
Caution Using the timer function improperly or using breakpoints with your subroutines that access Computing can cause problems that could potentially cause your computer or application to crash or lock up. Depending on the configuration, this could cause the application to lose communication with the control engine. This could cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Always install a physical emergency stop circuit for your machine or process.
F-4
Computing A5E0006550804
Computing A5E0006550804
F-5
F.3
Table F-1
Public Property Get Value() As Long Value = Object1.Value End Property Public Property Let Value(ByVal New_Value As Long) Object1.Value() = New_Value PropertyChanged Value End Property Private Sub Value_Change() PropertyChanged Value End Sub
F-6
Computing A5E0006550804
F.4
Computing A5E0006550804
F-7
Table F-2
Visual Basic Code Public Property Get Value() As Integer Value = HScroll1.Value End Property Public Property Let Value (ByVal New_Value As Integer) HScroll1.Value = New_Value PropertyChanged Value End Property Public Sub HScroll1_Change() Value = HScroll1.Value End Sub
Adding the Custom Control to a Program Using the SIMATIC Data Control
1. Open a new VB project: Use the File " Add Project menu command to display the Add Project dialog box, then select the Standard EXE icon and click on the Open button. Visual Basic opens a new project with an empty form in the Object window. The Project directory area now lists two projects: Project1 contains UserControl1, and Project2 contains Form1. 2. Select the UserControl1 icon in the toolbox and insert it onto Form1 of Project2. 3. Add the Siemens SIMATIC Data control to the toolbox. For information about adding controls to the VB toolbox, see Section 1.1 and Figure 1-12. 4. Select the Data control icon in the toolbox and insert it onto Form1 of Project2. 5. Select the Data control and click the right mouse button to bring up the pop-up menu. From the pop-up menu, select Properties to display the Properties dialog box for the Data control. 6. From the Properties dialog box, select the Connections tab. Click on the + symbol to expand the list of controls. 7. Select the UserControl1 control and click on its + symbol to expand its properties list. 8. Select the Value property and enter QB0 in the Assigned Variable field. See Figure 1-13. Click on the Apply and OK buttons to enter the data and close the Properties dialog box.
F-8
Computing A5E0006550804
Note If the control engine (for example, WinLC or a slot PLC such as the CPU 416-2 DP ISA) is not active, the Data control cannot make a connection. Before setting Visual Basic into Run Mode, ensure that the control engine is running.
Use the following procedure to configure the Data control for communicating with the control engine and for running the sample program. 1. Select the Engine tab to configure the control engine. See Figure F-1. 2. Select the Direct Connect option and enter either wcS7=3 (case sensitive) for a slot PLC such as the CPU 416-2 DP ISA or WinLC as the control engine. (See Appendix G for the correct string for other control engines.) Click on the Apply button to enter the data, and then click on the OK button to close the dialog box. 3. Switch Visual Basic from Design mode to Run mode to run the sample program.
Siemens SIMATIC Data Control Properties General Engine Connections Events Name
Connect via Tag Source Tag Source Browse Direct Connect PC Name Control Engine WinLC
OK
Cancel
Apply
Help
Figure F-1
Computing A5E0006550804
F-9
F.5
Computing will not allow you to write data to the peripheral outputs (PQ) when the control engine is in STOP mode.
F-10
Computing A5E0006550804
Error Codes in Computing Version 2.0.1 and 3.0 Are Not Compatible with Version 1.2 or Version 1.1
Warning Failing to correctly handle error conditions in your program can cause unpredictable process operation, which could result in death or serious injury to personnel, and/or damage to equipment. Ensure that any programs written to handle errors from earlier versions of Computing (versions 1.1 or 1.2) have been updated for the error codes returned by version 2.0.1 and 3.0 of Computing. Exercise caution to ensure that you do not modify, nor permit unauthorized persons to access, any data that could cause process equipment to operate erratically. Always install a physical emergency stop circuit for your machine or process.
Many of the error codes returned by Computing have been changed for version 3.0 and 2.0.1. Programs written for earlier versions of Computing may not respond correctly to error conditions and must be updated.
Computing A5E0006550804
F-11
Error Condition Write to a read-only DB Wrong variable name Out-of-range memory area (for example, mb40000)
F-12
Computing A5E0006550804
Computing A5E0006550804
F-13
F-14
Computing A5E0006550804
Overview
Control engine strings are used in the Data Control, the Tag File Configurator, and the OPC and Diagnostic Buffer control. The control engine string identifies the location of the control engine from the STEP 7 project.
Note From one PC, you can access only one slot PLC or one S7 network at a time.
The syntax of the control engine string depends upon the control engine type and the network being used. For example, in the formula wcS7=xx,a,b wcS7 is an S7 CPU on an S7 network; xx, a, and b define the location of the CPU (xx is the node address of the CPU, a is the rack number, and b is the slot number).
Note Rack and slot number are optional, but if the rack number is specified, the slot number is mandatory. If nothing is specified, the module or CPU is accessed directly.
Computing A5E0006550804
G-1
To access the CPU4162 DP ISA through a TCP/IP LAN, enter the name of the PC where the CPU resides into the PCName property (the Computer Name field of the TagFile Configurator) as one word, with no spaces. To access a slot PLC through an S7 network, see Control Engine Settings on a SIMATIC Network below. On an S7 network, the rack/slot address of the slot PLC must be 0,3.
G-2
Computing A5E0006550804
To access an S7 system on a TCP/IP LAN, use the formula wcIP=xxx.xxx.xxx.xxx,a,b where xxx.xxx.xxx.xxx is the TCP/IP address, a is the rack number, and b is the slot number. Note that: S S S The TCP/IP address is four decimal numbers separated by periods. The rack number is 0 to 7 decimal. The slot number is 0 to 31 decimal.
If the slot PLC is on the same computer as the Computing software, set the PG/PC Interface to COMPUTING><Ethernet cardname>(TCP/IP). To access an S7 system on an Industrial Ethernet, use the formula wcMAC=xx.xx.xx.xx.xx.xx,a,b where xx.xx.xx.xx.xx.xx is the MAC address, a is the rack number, and b is the slot number. Note that: S S S The TCP/IP address is six decimal numbers separated by periods. The rack number is 0 to 7 decimal. The slot number is 0 to 31 decimal.
If the slot PLC is on the same computer as the Computing software, set the PG/PC Interface to COMPUTING><Ethernet cardname>(ISO Transport). If the communications card is installed on a different PC than Computing, enter the name of the PC into the PC Name Property (the Computer Name field of the Tag File Configurator), as one word with no spaces, (for example, PC_2). Example: You wish to access an S7315 CPU (always in slot 2) with a node address of 5. S S S To access the CPU through an S7 network, the control string is wcS7=5 (,0,0) To access the CPU through an Industrial Ethernet, the control string is
wcMAC=a.b0.12.ff.3.2d,0,2
Note Note that on an S7 network, the rack/slot address of WinLC is always 0,2. The rack/slot address of a slot PLC such as the CPU 41162 DP ISA is 0,3.
Computing A5E0006550804
G-3
G-4
Computing A5E0006550804
Index
A
AboutBox method, B-1 Absolute addresses in tag file, 9-9 replacing symbols, 5-11 Accessing data connect/disconnect, B-4, B-8, B-9, B-14, F-5 separate Data control, F-4 Accessing memory areas, SIMATIC controls, 5-15-12 Accessing memory areas (S7) ActiveX controls Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 memory areas of the S7 controllers, A-2 OPC controls, 2-62-9 Accessing process data, 2-32-5 ActiveX controls Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 memory areas of S7 controllers, A-2 OPC controls, 2-62-9 SIMATIC controls, 5-15-12 Accessing the OPC server, 2-7 Activated property, B-1 ActiveX controls See also ActiveX or Computing Button, 6-46-8 Button control description, 6-4 toolbar button, 6-4 connecting to control engine, 5-9 creating custom control, F-6F-10 creating process form, 8-48-6 ActiveX controls (continued) custom controls, F-7F-10 Data description, 5-1 toolbar button, 5-1 Data control error codes, 5-30 events, 5-30 Edit control description, 6-11 toolbar button, 6-11 filtering properties, 5-13 Label, 6-216-25 Label control description, 6-21 toolbar button, 6-21 properties Button control, 6-26-6 Data control, 5-295-30 sample program I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 SoftContainer, 1-191-25 STEP 7 program, 1-3 sample uses, 1-2 sharing data among applications, 2-3, 2-42-6 Slider control, description, 6-27 SoftContainer operating mode, 8-68-8 overview, 8-28-4 with SIMATIC controls, 5-15-12 Adding connection, to Data control, 5-12 Alignment property, B-2 Appearance property, B-3 ARRAY data type, A-6A-8 Assigning a variable, from Visual Basic, 1-6
Computing A5E0006550804
Index-1
Index
Authorizing the Computing software, 3-2, 3-33-5 procedure, 3-4 See also README.TXT on the authorization disk guidelines, 3-4 removing the authorization, 3-4 running without authorization, 3-4 transferring the authorization, 3-4 AUTHORS.EXE Computing authorization, 3-33-5 installation (WinAC Computing), 3-5 removing the Computing authorization, 3-4 transferring the Computing authorization, 3-4 AutoConnect property, B-3 AutoConnectTimeout property, B-4
B
BackColor property, B-5 bDiagBuffOK property, B-5 bEngineConnected property, B-6 BorderStyle property, B-6 BSTR, A-9 Button control, 2-4 description, 2-4, 6-4 events, 6-10 Change, C-1 Click, C-1 Error, C-2 KeyDown, C-3 KeyPress, C-4 KeyUp, C-5 MouseDown, C-6 MouseMove, C-7 MouseUp, C-8 methods, AboutBox, B-1
Button control (continued) properties, 6-26-6 Alignment, B-2 Appearance, B-3 BorderStyle, B-6 Enabled, B-19 FalseCaption, B-21 FalseColor, B-21 FalsePicture, B-22 Font, B-22 ForeColor, B-23 Locked, B-26 PushButton, B-32 StretchMode, B-38 Style, B-39 TrueCaption, B-40, B-42 TrueColor, B-41 Value, B-43 properties and methods, 6-9 toolbar button, 6-4
C
Caption properties, B-7 Change event, C-1 Connect method, B-7 Changing the language, D-5 CHAR data type, A-9 use BSTR (Visual Basic), A-9 Click event, C-1 Client application (OPC), 2-3, 2-62-8 connecting to Computing, 2-62-7 server interfaces, 2-7 server name, 2-7 Communicating, local and remote (DCOM), 4-14-7 client and server, E-1E-21 Component Object Model (COM) client and server, E-1E-21 local and remote, 4-14-7 Computer requirements, 2-3
Index-2
Computing A5E0006550804
Index
Computing Button control description, 6-4 properties, 6-26-6 toolbar button, 6-4 computer requirements, 2-3 configuration tool, D-6 Data description, 5-1 toolbar button, 5-1 Data control error codes, 5-30 events, 5-30 properties, 5-295-30 Edit control, description, 6-11 Edit control object, toolbar button, 6-11 error codes, Data, 5-30 events, Data, 5-30 installation authorization, 3-33-5 copy-protection, 3-33-5 procedure, 3-53-7 removing the authorization, 3-4 system requirements, 2-3 transferring the authorization, 3-4 Label control description, 6-21 toolbar button, 6-21 memory requirements, 2-3 OPC controls, 2-72-9 server object, 2-7 operating system requirements, 2-3 product overview, 2-12-8 properties Button, 6-26-6 Data, 5-295-30 removing the authorization, 3-4 S7 memory areas, A-2 SIMATIC controls Button, 6-46-8 Data control, 5-15-12 description, 2-42-6 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 Slider control, description, 6-27 SoftContainer, 8-1 system requirements, 2-3 transferring the authorization, 3-4
Configuration tool, selecting local control engine, D-6 Connecting to data via Data control, 2-42-6 Connecting to data via OPC, 2-62-8 Connection table Data control, 5-16 sample program, 5-17 ConnectionError event, C-1 error codes (Data control), 5-30 ConnectName method, B-8 ConnectObject method, B-9 Control engine access, 2-32-6 accessing data, 4-24-6 changing name in tag file, 9-13 configuring for local access, 9-11 configuring for remote access, 9-12 connecting ActiveX controls, 5-9 connecting over DCOM, 5-6, 9-2 connecting SIMATIC controls, 5-2 effect of scan cycle on inputs and outputs, A-2 identification in tag file, G-1 local, 4-4 memory areas of S7 controllers, A-2 OPC access, 2-6 OPC connection, D-2 OPC controls, 2-62-8 multiple, 4-6 remote, 4-5 selecting for Data control, 5-4 selecting local control engine, D-6 SIMATIC controls, 5-15-12 Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 tag files, 9-1 Control engine strings, PG/PC Interface, 5-4 ControlEngine property, B-10 Controller. See Control engine Copy-protection, 3-33-5 removing the authorization, 3-4 transferring the authorization, 3-4 Counters, S7 memory area, A-2 CPU memory areas of S7 controllers, A-2 PC requirements, 2-3 CPU 4162 DP ISA. See Control engine Custom events, 5-15 Customize, changing the language, D-5
Computing A5E0006550804
Index-3
Index
D
Data, 2-4 accessing with Computing, 2-32-5 ActiveX control objects Button, 6-26-6 Data, 5-15-13 memory areas of S7 controllers, A-2 OPC controls, 2-62-8 sharing among applications, 2-32-5 SIMATIC controls, 5-15-12 Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 Data control, 2-3 adding an event, 5-15 configuring connection properties, 5-3 configuring for multiple control engines, 9-29-4 configuring for single control engine, 5-6 connection table, 5-16 connections, 5-9 containers, F-2 custom ActiveX controls, F-6F-10 description, 2-4, 5-1 error codes, 5-305-32 events, 5-30 ConnectionError, C-1 ValueChanged, C-9 methods, 5-29 Connect, B-7 ConnectName, B-8 ConnectObject, B-9 Disconnect, B-14 PropertyChangedName, B-30 PropertyChangedObject, B-31 properties, 5-295-30 Activated, B-1 AutoConnect, B-3 AutoConnectTimeout, B-4 ControlEngine, B-10 DefaultDeadband, B-12 DefaultUpdateRate, B-13
Data control properties (continued) MultipleEngines, B-27 PCName, B-28 ReadMultiVariables, B-33 ReadVariable, B-33 ShowErrorBoxes, B-36 TagSource, B-39 WriteMultiVariables method, B-44 WriteVariable method, B-45 sample program I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 SoftContainer, 1-191-25 STEP 7 program, 1-3 selecting control engine, 5-4 SoftContainer operating mode, 8-68-8 overview, 8-28-4 process form, 8-48-6 toolbar button, 5-1 Databases, sharing data via OPC, 2-6 DataType property, B-11 DATE data type, A-7 DblClick event, C-2 DBuffer control, 7-27-6 configuring, 7-4 description, 2-3, 7-1 methods, 7-7 properties, 7-77-8 DCOM client and server, E-1E-21 configuration editor, E-4, E-14 local and remote, 4-14-7 client configuuration, E-14E-19 server configuuration, E-4E-13 troubleshooting, E-20 DefaultDeadband property, B-12 DefaultUpdateRate property, B-13 Deinstall, 3-6 See also Uninstalling Deleting a connection, 5-12 Diagnostics buffer, DBuffer control, 7-2 Direction property, B-14 Disconnect method, B-14 DisplayFormatButtons property, B-15 DisplayHelpButton property, B-15 DisplayHelpOnEventButton property, B-16 DisplayLowerPanel property, B-17 DisplayUpdateButton property, B-17 DisplayUpperPanel property, B-18
Index-4
Computing A5E0006550804
Index
DisplayValue property, B-18 Distributed applications (DCOM) configuring server and client, E-1E-21 local and remote, 4-14-7 Distributed Component Object Model (DCOM) See also DCOM client and server, E-1E-21 local and remote, 4-14-7
E
Edit control, 2-4 description, 2-4, 6-11 error codes, 6-20 events, 6-19 Change, C-1 Click, C-1 DblClick, C-2 Error, C-2 KeyDown, C-3 KeyPress, C-4 KeyUp, C-5 MouseDown, C-6 MouseMove, C-7 MouseUp, C-8 methods, AboutBox, B-1 properties Alignment, B-2 Appearance, B-3 BackColor, B-5 BorderStyle, B-6 DisplayValue, B-18 Enabled, B-19 Factor, B-20 Font, B-22 ForeColor, B-23 Locked, B-26 Max and Min, B-26 Offset, B-27 Precision, B-30 RawMax, B-32 RawMin, B-32 ScaleMode, B-34 Text, B-40 Value, B-43 WriteMode, B-43 WriteNow method, B-44 Zeropad, B-45 properties and methods, 6-18 toolbar button, 6-11 Effect of S7 scan cycle on inputs and outputs, A-2
Emergency stop circuit, 1-1, 2-1, 8-6 Enabled property, B-19 EnableSort property, B-19 English, changing to, D-5 Error codes Data control, 5-30 Edit control, 6-20 Error event, C-2 Event table, sample program, 5-18 Events adding to Data control, 5-15 Button control, 6-10 Change, C-1 Click, C-1 ConnectionError, C-1 Data control, 5-30 DblClick, C-2 DBuffer control, 2-3, 7-1 Edit control, 6-19 Error, C-2 KeyDown, C-3 KeyPress, C-4 KeyUp, C-5 Label control, 6-26 MouseDown, C-6 MouseMove, C-7 MouseUp, C-8 sample program, 5-195-22 Slider control, 6-35 ValueChanged, C-9 Example connection table program, 5-17 event response program, 5-195-22 event table program, 5-18 read/write Boolean data, 5-28 read/write data, 5-23 sample program, 1-2 Examples custom ActiveX control, F-7F-10 I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 read/write with Data control, F-6 SoftContainer, 1-191-25 STEP 7 program, 1-3
F
Factor property, B-20 FalseCaption property, B-21 FalseColor property, B-21 FalsePicture property, B-22
Computing A5E0006550804
Index-5
Index
Font property, B-22 ForeColor property, B-23 FormatDisplay property, B-23 French, changing to, D-5
G
German, changing to, D-5 Guidelines accessing PI and PQ memory, A-2 accessing STRING and CHAR data (BSTR), A-9 connect/disconnect, B-4, B-8, B-9, B-14, F-5 containers, F-2 custom ActiveX controls, F-7F-10 Data control for critical data, F-4 effect of scan cycle on inputs and outputs, A-2 emergency stop circuit, 1-1, 2-1, 8-6 sample programs I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 SoftContainer, 1-191-25 STEP 7 program, 1-3 using Visual Basic timers, A-6, F-4 WinLC authorization, 3-3 See also README.TXT on the authorization disk
Installation authorization, 3-33-5 copy-protection, 3-33-5 removing the authorization, 3-4 transferring the authorization, 3-4 installation and removal, 3-53-7 installing the Computing authorization, 3-4 guidelines, 3-4 See also README.TXT on the authorization disk removing the authorization, 3-4 system requirements, 2-3 transferring the authorization, 3-4 Integrating distributed applications (DCOM) client and server, E-1E-21 local and remote, 4-14-7
K
KeyDown event, C-3 KeyPress event, C-4 KeyUp event, C-5 KnobHeight property, B-24 KnobPicture property, B-24 KnobWidth property, B-25
L
Label control description, 6-21 events, 6-26 Change, C-1 Click, C-1 DblClick, C-2 Error, C-2 MouseDown, C-6 MouseMove, C-7 MouseUp, C-8 methods, AboutBox, B-1
I
Inputs, PI and I memory areas of S7 controllers, A-2 Inputs and outputs, S7 controllers, A-2 Inputs of S7 controllers accessing PI memory, A-2 effect of scan cycle on inputs and outputs, A-2
Index-6
Computing A5E0006550804
Index
Label control (continued0 properties Alignment, B-2 Appearance, B-3 BackColor, B-5 BorderStyle, B-6 Caption, B-7 Enabled, B-19 Font, B-22 ForeColor, B-23 StretchMode, B-38 Style, B-39 properties and methods, 6-26 toolbar button, 6-21 Language selection, for WinAC, D-5 LargeChange property, B-25 Locked property, B-26
Monitoring and modifying data memory areas of S7 controllers, A-2 OPC controls, 2-62-8 SIMATIC controls, 5-15-12 Button, 6-46-8 Edit, 6-116-22 error codes (Data), 5-30 events (Data), 5-30 Label, 6-216-25 Slider, 6-276-29 MouseDown event, C-6 MouseMove event, C-7 MouseUp event, C-8 MultipleEngines, B-27
N
Name of the OPC server object, 2-7 Network communications, local and remote, 4-14-7 client and server, E-1E-21
M
Max and Min properties, B-26 Megahertz (MHz), system requirements, 2-3 Memory areas of S7 controllers OPC controls, 2-62-8 reference, A-2 SIMATIC controls, 5-15-12 Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29 Memory bits, S7 memory area (M), A-2 Memory requirements, 2-3 Methods AboutBox, B-1 Connect, B-7 ConnectName, B-8 ConnectObject, B-9 Data control, 5-29 DBuffer control, 7-7 Disconnect, B-14 examples, 5-245-30 PopUpHelp, B-29 PopUpHelpOnEvent, B-29 PropertyChangedName, B-30 PropertyChangedObject, B-31 ReadMultiVariables, B-33 ReadVariable, B-33 S7DiagBF control, SelectEvent, B-35 WriteMultiVariables method, B-44 WriteNow, B-44 WriteVariable method, B-45 MHz, system requirements, 2-3
O
Off-the-shelf applications, OPC controls, 2-6 Offset property, B-27 OLE See also Computing, OCX, or OPC OLE for Process Control. See OPC OPC controls, 2-62-8 OPC specification, 2-6, 2-7 SIMATIC controls, 5-15-12 Button, 6-4 Edit, 6-116-22 Label, 6-21 Slider, 6-276-29 SoftContainer, 8-1 OPC, 2-62-8 client application, 2-3, 2-7 group object, interfaces, 2-7 interfaces of the group object, 2-7 interfaces of the server object, 2-7 name of the server object, 2-7 OPC specification, 2-6, 2-7 server object, 2-3 interfaces, 2-7 name, 2-7 sharing data among applications, 2-32-5, 2-7 used with Computing, 2-32-5, 2-7 using the Data control, 2-3
Computing A5E0006550804
Index-7
Index
Processor (CPU), PC requirements, 2-3 Product overview, 2-32-5 OPC (Ole for Process Control), 2-62-8 ProgID, 2-7 Programmable Logic Controller (PLC). See Control engine Programmatic identifier, 2-7 Programming connect/disconnect, B-4, B-8, B-9, B-14, F-5 container guidelines, F-2 custom ActiveX controls, F-7F-10 Data control for critical data, F-4 S7 data types in VB and C, A-5 P sample programs PCName property, B-28 I/O panel, 1-41-10 Pentium, system requirements, 2-3 Microsoft Excel, 1-151-19 Performance other controls (VBScrollbar), 1-121-15 connect/disconnect, B-4, B-8, B-9, B-14, SoftContainer, 1-191-25 F-5 STEP 7 program, 1-3 Data control for critical data, F-4 timers, F-4 Peripheral input and output areas of S7 Properties controllers, reference, A-2 AboutBox method, B-1 Personal computer (PC), system requirements, Activated, B-1 2-3 Alignment, B-2 PI and PQ memory areas, A-2 Appearance, B-3 Picture property, B-28 AutoConnect, B-3 PopUpHelp method, B-29 AutoConnectTimeout, B-4 PopUpHelpOnEvent method, B-29 BackColor, B-5 Precision property, B-30 bDiagBuffOK, B-5 Procedures bEngineConnected, B-6 accessing the OPC server object, 2-7 BorderStyle, B-6 authorizing the Computing software, 3-4 Caption, B-7 See also README.TXT on the Connect method, B-7 authorization disk ConnectName method, B-8 adding an authorization, 3-4 ConnectObject method, B-9 guidelines, 3-4 ControlEngine, B-10 authorizing the software, removing an DataType, B-11 authorization, 3-6 DefaultDeadband, B-12 authorizing the WinLC software, removing DefaultUpdateRate, B-13 an authorization, 3-4 Direction, B-14 installing the Computing software, 3-5 Disconnect method, B-14 removing the authorization, 3-4 DisplayFormatButtons, B-15 uninstalling the software, 3-6 DisplayHelpButton, B-15 Process data DisplayHelpOnEventButton, B-16 accessing, 2-32-5 DisplayLowerPanel, B-17 OPC, 2-62-8 DisplayUpdateButton, B-17 SIMATIC controls, 5-15-12 DisplayUpperPanel, B-18 Button, 6-46-8 DisplayValue, B-18 Data, 5-15-13 Enabled, B-19 Edit, 6-116-22 EnableSort, B-19 Label, 6-216-25 Factor, B-20 Slider, 6-276-29 Operating system requirements, 2-3 Outputs, Q and PQ memory areas of S7 controllers, A-2 Outputs of S7 controllers accessing PQ memory, A-2 effect of scan cycle on inputs and outputs, A-2 Overview Computing, 2-32-5 OPC controls, 2-3, 2-62-8 SIMATIC controls, 2-32-5
Index-8
Computing A5E0006550804
Index
Properties FalseCaption, B-21 FalseColor, B-21 FalsePicture, B-22 FomatDisplay, B-23 Font, B-22 ForeColor, B-23 KnobHeight, B-24 KnobPicture, B-24 KnobWidth, B-25 LargeChange, B-25 Locked, B-26 Max and Min, B-26 MultipleEngines, B-27 Offset, B-27 PCName, B-28 Picture, B-28 PopUpHelp method, B-29 PopUpHelpOnEvent method, B-29 Precision, B-30 PropertyChangedName method, B-30 PropertyChangedObject method, B-31 PushButton, B-32 RawMax, B-32 RawMin, B-32 ReadMultiVariables method, B-33 ReadVariable method, B-33 ScaleMode, B-34 SelectEvent method, B-35 ShowErrorBoxes, B-36 ShowMinMax, B-36 SIMATIC control properties Button, 6-26-6 Data control, 5-295-30 DBuffer control, 7-77-8 SmallChange, B-37 StretchMode, B-38 Style, B-39 TagSource, B-39 Text, B-40 Ticks, B-40 TrueCaption, B-40, B-42 TrueColor, B-41 Update method, B-42 Value, B-43 WriteMode, B-43 WriteMultiVariables method, B-44 WriteNow method, B-44 WriteVariable method, B-45 Zeropad, B-45
Properties and methods Button control, 6-9 Edit control, 6-18 Label control, 6-26 Slider control, 6-34 PropertyChangedName method, B-30 PropertyChangedObject method, B-31 PushButton property, B-32
R
RAM, system requirements, 2-3 RawMax property, B-32 RawMin property, B-32 Readme file, guidelines for WinLC authorization, 3-3 ReadMultiVariables method, B-33 ReadVariable method, B-33 Removing the Computing authorization, 3-33-5 Removing the Computing software, 3-6 Removing the WinLC authorization, guidelines, 3-3 See also README.TXT on the authorization disk Requirements, computer, 2-3 Design mode, 8-7 SoftContainer, 8-68-8 Run mode, SoftContainer, 8-68-8 Run mode (SoftContainer), appearance of the Data control, 5-1
S
S5TIME data type, A-8 S7 controllers memory areas, A-2 OPC controls, 2-62-8 scan cycle, A-2 SIMATIC controls Button, 6-46-8 Edit, 6-116-22 Label, 6-216-25 Slider, 6-276-29
Computing A5E0006550804
Index-9
Index
S7 data types ARRAY, A-6A-8 DATE, A-7 in Visual Basic and C, A-5 S5TIME, A-8 STRING, A-9 TIME, A-10 TIME_OF_DAY, A-10 S7DiagBF control events, Click, C-1 properties bDiagBuffOK, B-5 bEngineConnected, B-6 ControlEngine, B-10 DisplayFormatButtons, B-15 DisplayHelpButton, B-15 DisplayHelpOnEventButton, B-16 DisplayLowerPanel, B-17 DisplayUpdateButton, B-17 DisplayUpperPanel, B-18 EnableSort, B-19 FormatDisplay, B-23 PopUpHelp method, B-29 PopUpHelpOnEvent method, B-29 SelectEvent method, B-35 Update method, B-42 Sample programs custom ActiveX control, F-7F-10 I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 read/write with Data control, F-6 SoftContainer, 1-191-25 STEP 7 program, 1-3 ScaleMode property, B-34 Scan cycle of S7 controllers, A-2 SelectEvent method, B-35 Client configuration (DCOM), E-14E-19 Server configuration (DCOM), E-4E-13 Server object (OPC), 2-3, 2-62-7 interfaces, 2-7 server name, 2-7 Setting the language, D-5 Setup program authorization, 3-33-4 memory requirements, 2-3
Sharing data among applications OPC controls, 2-32-5, 2-62-8 OPC specification, 2-6, 2-7 SIMATIC controls, 2-3, 5-15-12 ShowErrorBoxes property, B-36 ShowMinMax property, B-36 SIMATIC controls Button, 6-46-8 Button control description, 6-4 toolbar button, 6-4 Data description, 5-1 toolbar button, 5-1 Data control, 5-1 DBuffer, description, 2-3, 7-1 DBuffer control, 2-3, 7-1 Edit, 6-116-22 Edit control description, 6-11 toolbar button, 6-11 Label, 6-216-25 Label control description, 6-21 toolbar button, 6-21 properties, Activated, B-1 sharing data among applications, 2-3 Slider, 6-276-29 Slider control, description, 6-27 used with Computing, 2-3 Slider control, 2-4 description, 2-4, 6-27 events, 6-35 Change, C-1 Click, C-1 DblClick, C-2 Error, C-2 KeyDown, C-3 KeyPress, C-4 KeyUp, C-5 MouseDown, C-6 MouseMove, C-7 MouseUp, C-8
Index-10
Computing A5E0006550804
Index
Slider control (continued) methods, AboutBox, B-1 properties BackColor, B-5 Direction, B-14 DisplayValue, B-18 Enabled, B-19 Factor, B-20 ForeColor, B-23 KnobHeight, B-24 KnobPicture, B-24 KnobWidth, B-25 LargeChange, B-25 Locked, B-26 Max and Min, B-26 Offset, B-27 Picture, B-28 RawMax, B-32 RawMin, B-32 ScaleMode, B-34 ShowMinMax, B-36 SmallChange, B-37 StretchMode, B-38 Style, B-39 Ticks, B-40 Value, B-43 properties and methods, 6-34 Slot PLC. See Control engine SmallChange property, B-37 SoftContainer, 8-18-7 creating a process form, 8-28-4 icons, 8-28-4 operating mode, 8-68-8 overview, 8-28-4 process form, 8-48-6 sample program, 1-191-25 toolbars, 8-28-4 Software installation Computing authorization, 3-33-5 installing and uninstalling, 3-53-7 removing the Computing authorization, 3-33-5 transferring the Computing authorization, 3-33-5 Software PLC. See Control engine Specifications OLE for Process Control, 2-6, 2-7 system requirements, 2-3 Spreadsheets, sharing data via OPC, 2-6 StretchMode property, B-38 STRING data type, A-9 use BSTR (Visual Basic), A-9
Style property, B-39 Switching SoftContainer modes, 8-7 System requirements, 2-3
T
Tag File, and Data Control, 5-5 Tag file components, 9-5 configuring for local or remote access, 9-10 control engine without symbols, 9-8 creating, 9-6 inserting program or control engine, 9-7 multiple control engines, 4-6, 9-3 remote control engine, 4-5 Tag files, local and remote control engines, 4-14-7 TagFile Configurator, 9-19-7 using symbols, 9-5 TagSource property, B-39 Technical information, OLE for Process Control, 2-6, 2-7 Text property, B-40 Third-party ActiveX control, 2-3, 2-42-6, 8-58-7 OPC controls, 2-62-8 Third-party containers, F-2F-4 Ticks property, B-40 TIME data type, A-10 TIME_OF_DAY data type, A-10 Timers, S7 memory area, A-2 Transferring the Computing authorization, 3-33-5 Transferring the WinLC authorization, guidelines, 3-3 See also README.TXT on the authorization disk Troubleshooting DCOM, E-20 no valid authorization, 3-3 TrueCaption property, B-40, B-42 TrueColor property, B-41
U
Uninstalling the Computing software, 3-6 Update method, B-42
V
Value property, B-43
Computing A5E0006550804
Index-11
Index
ValueChanged event, C-9 Visual Basic BSTR for STRING and CHAR data, A-9 connect/disconnect, B-4, B-8, B-9, B-14, F-5 container guidelines, F-2 custom ActiveX controls, F-6F-10 sample program, F-7F-10 Data control for critical data, F-4 data types, A-5 sample programs I/O panel, 1-41-10 Microsoft Excel, 1-151-19 other controls (VBScrollbar), 1-121-15 SoftContainer, 1-191-25 STEP 7 program, 1-3 timers (guidelines), A-6, F-4 Visual Basic example, read/write data, 5-23
W
Warnings emergency stop circuit, 1-1, 2-1, 8-6 Visual Basic timers, A-6, F-4 WinAC\Default, D-6 Windows Logic Controller (WinLC). See Control engine WinLC, options, language, D-5 WriteMode property, B-43 WriteMultiVariables method, B-44 WriteNow method, B-44 WriteVariable method, B-45
Z
Zeropad property, B-45
Index-12
Computing A5E0006550804
To SIEMENS ENERGY & AUTOMATION INC ATTN: TECHNICAL COMMUNICATIONS M/S 519 3000 BILL GARLAND ROAD PO BOX 1255 JOHNSON CITY TN USA 376051255
Please check any industry that applies to you: r r r r r r r Automotive Chemical Electrical Machinery Food Instrument and Control Non-electrical Machinery Petrochemical r r r r r r Pharmaceutical Plastic Pulp and Paper Textiles Transportation Other ___________________________
Computing A5E0006550804
Remarks Form Your comments and recommendations will help us to improve the quality and usefulness of our publications. Please take the first available opportunity to fill out this questionnaire and return it to Siemens.
Please give each of the following questions your own personal mark within a range from 1 (very good) to 5 (very poor). 1. 2. 3. 4. 5. Do the contents meet your requirements? Is the information you need easy to find? Is the text easy to understand? Does the level of technical detail meet your requirements? Please rate the quality of the graphics and tables.
Additional comments: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Computing A5E0006550804