DDE Server
DDE Server
Product Overview
1
DDE Concept 2
System Startup
4
DDE Server
Configuration and Administration Symbolic Addressing 5
Absolute Addressing 6
User Manual
Operating the DDE Server 7
Subsystem Declarations A
System Items and Non-System
Items B
Technical Data and Transfer
Formats C
C79000–G7076–C807–01
Version 2
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 The device/system may only be set up and operated in conjunction with this manual.
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 description, 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.
ii
Preface
The SIMATIC DDE The SIMATIC DDE Server is used universally to link automation components
Server to MS Windows applications. This means that a wide range of standard MS
Windows application programs is made available for integration into automa-
tion solutions.
Audience This manual is intended for persons who wish to use the DDE Server to link
automation components to MS Windows applications.
Overview of This manual discusses the concept, installation, and use of the SIMATIC DDE
Contents Server. Linking to MS Excel applications is illustrated by means of examples.
Overview of product and DDE concept (Chapters 1, 2, 5 and 6)
Installation (Chapters 3 to 4)
Using the DDE Server via the interactive interface (Chapters 7 to 8)
Commands (Chapter 9)
Examples of conversation with MS Excel (Chapter 10).
Reference information (Appendix)
B System Items and Non-System Items Supported by the DDE Interface . . . . . . . B-1
B.1 System Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2
B.2 Return Values of the RETURNMESSAGE System Item . . . . . . . . . . . . . . . B-3
B.3 Non*System Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5
C Technical Data and Transfer Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
C.1 Technical Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2
C.2 Data Transfer Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
C.2.1 CF_TEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
C.2.2 CF_BYTESTREAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-4
D DDE Block Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
D.1 Communication between Server and Application (O/I System) . . . . . . . . . D-2
D.2 Notes Common to All Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-3
D.3 DefineList Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-6
D.4 DeleteList Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-7
D.5 GetList Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-8
D.6 VarList Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-9
D.7 Result Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-10
E Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Product Overview 1
Overview By using the SIMATIC DDE Server, it is possible to integrate MS Windows
applications into an automation solution. The DDE access mechanism fea-
tured by Windows allows online reading from and writing to process vari-
ables.
1.1 Application
1
Automation Made possible by the DDE Server, integration of automation components
with Windows into the MS Windows environment presents you with the user interface with
which you are familiar. It puts you in a position to integrate standard applica-
tions for e×ample, MS Excel into automation solutions and thus drasti-
cally to cut the cost of software production.
MS Windows A wide variety of software packages based on the Windows 3.11 and Win-
standard dows 95 operating systems are available for PCs. The products on offer in-
applications clude tools for word processing, statistics, spreadsheets, database applica-
tions, quality assurance, process visualization, and production automation.
Most standard programs use a macro language in order to e×change data with
other programs by supporting the DDE mechanism.
Userown You can even integrate your own MS Windows applications that have been
MS Windows implemented in any programming language into automation solutions.
applications
Use the Windows DDEML application programming interface to implement
applications capable of DDE communication. See /4/ for descriptions of the
DDEML function calls.
These products differ by the hardware platform and by the operating system
used. They also offer different interfaces to access the automation systems.
SIMATIC PC This DDE Server runs on a PC with Windows 3.11. It can access up to 16
DDE Server automation systems of the following types
Windows 3.11
SIMATIC S5 automation systems with serial interface via the AS 511 and
RK 512 protocols.
SICOMP S5 Slot PLC (controller coprocessor for industrial PCs having
the functionality of a PLC) via the AS 511 protocol.
SIMATIC S7/M7 automation systems via the Multipoint Interface (MPI)
CPU FM
SIMATIC PC DDE Server
Windows 3.11
C Bus
DDE
MPI
SIMATIC S7/M7–400
AS 511 AS 511 RK 512
CPU FM
CPU CP 524/525
SICOMP S5
SlotPLC
SIMATIC M7 This DDE Server runs on a SIMATIC M7 CPU or FM with Windows 3.11. It
1 DDE Server can access up to 16 SIMATIC S7/M7 automation systems via via the Multi-
Windows 3.11 point Interface (MPI) and the communication bus (K bus).
SIMATIC S7/M7–300
CPU FM
C Bus
MPI MPI
S7/M7–400 S7/M7–400
SIMATIC M7 This DDE Server runs on a SIMATIC M7 FM 4564 with Windows 95. It
DDE Server can access up to 16 SIMATIC S7/M7 automation systems via via the Multi-
Windows 95 point Interface (MPI) and the communication bus (K bus).
K-Bus
S7/M7–400
S7/M7–300 K-Bus
DDE
MPI
Structure of DDE The structure of the DDE Server is the same in all three products. Only the
Server provided interface drivers and hence the possibly accessed automation sys- 1
tems are different. The following figure shows as an e×ample the structure of
the SIMATIC PC DDE Server Windows 3.11.
Device–dependent interface
Interface Driver
Application The MS Windows application accesses the Server via the DDE interface de-
fined in MS Windows.
DDE Server To be able to implement the link to a new automation system with utmost
flexibility, the DDE Server is divided into two parts:
DDE interface and general services
This module includes the DDE commands, the user interface, general
configuration, and variable and connection management.
Devicedependent interface
For every device type, the devicedependent interface consists of a
driver DLL used to adapt the automation system to the DDE interface.
Interface Driver The interface driver establishes the link to the automation system.
Separate interface drivers are not required if this part has already been imple-
mented in the devicedependent interface.
1.3 Functionality
1
All three types of SIMATIC DDE Server provide the same functionality, i.e.
communication services and administrative services.
Standard The DDE Server provides its services via the MS Windows standard graphi-
user interface cal user interface for PCs. The DDE Server thus opens up the Windows user
interface for SIMATIC M7 and PCbased automation solutions.
Server The application that responds to the requests for information from the client is
the server. The server is the passive partner in the conversation and responds
only to requests for information from the active partner, i.e. the client. From
the viewpoint of DDE, the SIMATIC DDE Server is always a server that pro-
vides services for a MS Windows application (client) when requested to do so.
Data can be exchanged on a onetime or on a continuous basis.
Possible Several clients can open connections to the SIMATIC DDE Server.
connections
A client can open more than one connection to the Server. The client can ac-
cess several variables per connec-
tion.
DDE Server
Conversation
procedure
A typical sequence of events in a DDE conversation is as follows: 2
1. The DDE client initiates a DDE conversation by opening a connection to
the Server. The DDE Server acknowledges opening of the DDE connection.
2. The applications exchange data.
3. The client or server terminates the DDE conversation.
Types of There are three different types of link: cold link, warm link, and hot link.
Link
Cold link OneTime reception of data following a onetime request from the cli-
ent or onetime data transfer by the client to the Server
Receive:
The client sends a request for data to the Server.
If the Server is in a position to provide these data, it sends them to the client. If
not, it sends a negative acknowledgment.
Requests by the client for information can be repeated as often as required for
other items until the client or Server closes the DDE connection.
A coldlink conversation is used to read variables. In the case of dynamically
changing data in an automation system, the client can request the same variable
time and time again to stay up to date. In this particular instance, depending on
the frequency of requests for information, there is no guarantee that all changes
to the variable will be detected. On the other hand, the majority of requests for
information would remain ineffective if data were to change only slowly. This
is the reason why DDE features more efficient types of conversation for dy-
namically changing data.
Send:
The client sends data to the Server on a onetime basis (poke).
Warm link Continuous reception of messages (as opposed to data) following a onetime
request from the client
This type of conversation is a combination of cold and hot links. Unlike the hot
2 link, however, the client does not receive updated data without first requesting
them. Its attention is simply drawn to the fact that data have changed. It is then
up to the client to decide if and when it fetches them from the Server.
This type of conversation is used when the client wishes to be informed about
an updated variable but wants to control data reception itself.
Addressing To request data from a Server, the client uses an address specification consist-
ing of three components:
2
service, topic, and item
From the specification made by the client, the Server determines the data and
transfers them to client in a DDE conversation.
Service The service component refers to the name of the DDE Server in the Windows
environment.
The SIMATIC DDE Server is always addressed as ddeplc.
Topic The topic component limits in the Server an area for those data which the cli-
ent wishes to access. The topic depends on the Server application.
With the SIMATIC DDE Server the two standard topics default and system
are supported.
default: With this topic the automation systems are addressed.
system: With this topic, general information about the DDE interface of the
SIMATIC DDE Server is transferred.
Note
The transfer of a blank string as a topic or a blank string as a service in open-
ing a DDE connection is responded to by the SIMATIC DDE Server with pos-
itive acknowledgments to each of its topics. It is now the duty of the DDE
client concerned to react to these acknowledgments and to close all unselected
DDE connections.
Item The item component is a data item that is defined in the Server. By means of
access to this data item, item values can be transferred from the client to the
Server and vice versa. The SIMATIC DDE Server supports the following stan-
dard types of items (for more information see Appendix B:
2 System items
With the system topic, the SIMATIC DDE Server supports items for re-
questing information about the DDE Servers internal states.
Nonsystem items
With the default topic, the SIMATIC DDE Server supports items for re-
questing information on data formats and items. These items build a subset
of the system items.
Also with the default topic the SIMATIC DDE Server supports the access
to user data, i.e. to variables of the automation and the execution of com-
mands and options (see Chapter 9).
Introduction This section describes the specific aspects of addressing in the SIMATIC DDE
Server. All the variables of automation systems are addressed with the default
2
topic. Commands and options can be executed with this topic as well.
Variables Variables correspond to SIMATIC S5/S7 address areas (data blocks, counters,
flags, etc.). You can access variables either by
freely selectable names if you have defined them in a symbol file (see Sym-
bolic Addressing; Chapter 5), or
their absolute address (See Absolute Addressing; Chapter 6).
Commands The SIMATIC DDE Server supports the execution of commands, e.g. for load-
ing a symbol file or for declaring a subsystem. Commands are always trans-
ferred at the item address component. The commands are described in Chap-
ter 9.
Options Options are used to set certain properties of the DDE conversation. They are
transferred in the topic address component with the default topic.
Note
The symbol file is not the symbol table known in STEP 7. It is an ASCII file
that contains the SIMATIC DDE Server’s own symbol information.
Absolute Clients can send the complete address of the requested data to the DDE Server.
addressing This means that you can also access data for which variables are not defined in
the symbol file. Clients opting for this absolute addressing then depend
heavily, however, on the address structure in the Programmable Logic Control-
ler.
Subsystems Every automation system that is addressed by the SIMATIC DDE Server is
referred to as a subsystem. Possible subsystems are:
SIMATIC S7/M7 automation systems
2 SIMATIC S5 Programmable Logic Controllers
SICOMP S5 SlotPLCs
test subsystem
(for testing the DDE Server without a link to a Programmable Logic Con-
troller ; addressed by the simulation driver).
The SIMATIC DDE Server always defines a default subsystem to which the
variables have been assigned as default settings.
Subsystems can be declared in the symbol file or by using a command.
3.1 Installation
Installation Start the installation program install.exe from the floppy disk under Windows.
During the installation process you can select the:
pathname of the directory to which all the files belonging to the DDE Ser-
ver are to be copied
language on the user interface (English or German)
Please see also the installation notes contained in the Product Information.
Default Setting Once installed, the SIMATIC DDE Server is set such that it can be quickly
started and tested without having to connect to a specific automation system.
Start the SIMATIC DDE Server using the simulation driver to check the instal-
lation and to become accustomed to the user interface and to the way in which
3
the DDE Server operates.
Starting the Under Windows 3.11: Activate the icon for the DDE Server in its program
DDE Server group
The test driver provides three variables that change with time. With applica-
tions that support DDE, you can read the values of these variables from the
DDE Server and thus check it out for correct functioning.
To check how the DDE Server functions, open a connection to an MS Win-
dows application that supports DDE for example, a MS Excel worksheet.
Variables
File: c:\simdde\plcsig.sig
Name:
Properties
sawtooth Copy
Type: Data block
array Data type: Short signed
sawtooth
Address:
triangle
Data block DB 1
Data word DW 2
Number of Links: 0
Subsystem: default
Value: 64
Change...
Close Help
To continue... Once you have become accustomed to the manner in which the DDE Server
functions in simulation mode, you can go on to startup of the Server with an
automation system.
What you To start up the SIMATIC DDE Server with a SIMATIC S7 or SIMATIC M7
need to do automation system, you must take the following action:
1. Set the default subsystem (optional).
2. Create a symbol file if you are going to use symbolic addresses (see Chap-
ter 5)
4 3. Start the SIMATIC DDE Server and applications.
4.1.1 Requirement
MPI or C Bus The SIMATIC M7 or the PC must be connected to the SIMATIC S7/M7 au-
Connection tomation system either:
via MPI or
via communication bus (C bus), if communication takes place within the
same SIMATIC station
Setting the MPI For the SIMATIC PC DDE Server Win 3.11 only: The interrupt which is used
Interrupt to address the MPI card must be set with the keyword HWINT_VECTOR in
the initialization file s7dpmpi.ini in the Windows directory under section
[S7MPISPC2].
[S7MPISPC2]
HWINT_VECTOR=11
Caution
! If a wrong interrupt number is set in the file s7dpmpi.ini, unexpected system
behavior can occur and the system may become inoperable. The effect de-
pends on the device this interrupt was assigned to.
Operating several The driver is capable of accessing up to 16 SIMATIC S7/M7 automation sys-
interfaces tems via MPI or K bus concurrently.
Every automation system forms a subsystem. Subsystems have to be made
known to the DDE Server by either
an entry on the symbol file, or
the susbsys command.
The subsystem entry in a symbol file is described in Appendix A; you will find
the subsys command in Chapter 9.
4.2 Operation with SIMATIC S5 PLC via Serial Interface AS 511 (for
SIMATIC PC DDE Server Windows 3.11 only)
What you To start up the SIMATIC PC DDE Server Windows 3.11 with a SIMATIC S5
need to do automation system, you must take the following action:
1. Install the hardware driver for communication with the automation system.
4.2.1 Requirement
Caution
! Observe the following with regard to the link between the serial interface of a
PC and the programmer interface of the SIMATIC S5 Programmable Logic
Controller: The programmer interface of the PLC is always a TTY interface. If
the serial interface of the PC (COM1 or COM2) is a V.24 (RS 232) interface,
you must use a V.24/TTY converter for the link. If you do not, damage to
your PC or PLC hardware will result.
We recommend:
PGCOM Cable, Art No. 9359 # 1534, AG(TTY)<=→PC(V24)
Basic approach To install the hardware driver, you have to enter a suitable line with a text edi-
tor in your winstart.bat file located in the Windows directory. The driver is
then automatically activated during MS Windows run up.
1. Open the winstart.bat file in your Windows directory. Create a new file if
one does not already exist.
2. Insert the line containing the statement for loading the driver into your
winstart.bat file. The syntax of the entry is described below.
Operating several The driver is capable of operating up to four serial interfaces concurrently.
interfaces I.e. you can connect a maximum of four automation systems using this driver.
Specify a /IOINT parameter for every interface:
1. First restart MS Windows for the changes you made to the winstart.bat file
to become effective.
2. Start the SIMATIC DDE Server.
3. Start your application(s).
What you need To start the SIMATIC PC DDE Server Windows 3.11 with a SIMATIC S5 Pro-
to do grammable Logic Controller via a CP 524 or CP 525 board and the computer
connection RK 512, you must take the following action:
1. Set the default subsystem (optional).
2. Create a symbol file if you are going to use symbolic addresses (see Chap- 4
ter 5).
3. Start the SIMATIC DDE Server and your applications.
4.3.1 Requirements
Operating several The driver is capable of operating up to four serial interfaces concurrently.
interfaces I.e. you can connect a maximum of four automation systems using this driver.
Every interface forms a subsystem. Subsystems have to be made known to the
DDE Server by either
S an entry in the symbol file, or
S the susbsys command.
For this you have to set the interrupt, baud rate, and IO addresses.
The subsystem entry in a symbol file is described in Appendix A; you will find
the subsys command in Chapter 9.
4.4 Operation with the SICOMP S5 SlotPLC (for SIMATIC PC DDE Server
Windows 3.11 only)
What you need to To start the SIMATIC PC DDE Server Windows 3.11 with a SICOMP S5
do SlotPLC, you must take the following action:
1. Install the hardware driver for communication with the SlotPLC.
2. Set the default subsystem (optional).
3. Create a symbol file if you are going to use symbolic addresses (see Chap-
4
ter 5).
4. Start the SIMATIC DDE Server and your applications.
4.4.1 Requirement
The SICOMP S5 SlotPLC board must be inserted and initialized (refer to the
SlotPLC manual /1/).
Basic procedure To install the hardware driver, you have to enter a suitable line with a text edi-
tor in your winstart.bat file located in the Windows directory. The driver is
then automatically activated during MS Windows run up.
1. Open the winstart.bat file in your Windows directory. Create a new file if
one does not already exist.
2. Insert the line containing the statement for loading the driver into your
winstart.bat file. The syntax of the entry is described below.
Note
Note, when you are setting parameters, that all values are interpreted as hexa-
decimal numbers.
Operating several The driver is capable of operating up to four SlotPLCs concurrently. I.e. you
SlotPLCs can connect a maximum of four automation systems using this driver.
Procedure To define the AS 511 interface of the SlotPLC as the default subsystem:
1. Start the DDE Server for example, by activating the appropriate icon on
the MS Windows user interface by double clicking.
2. In the menu bar of the DDE Server main window choose
Options Configuration...
The “Configuration“ dialog box is displayed. 4
3. Click on the drop button in the Drivers field and select the driver as511.drv
from the opened dropdown list. The name of the driver is then visible in
the viewing section.
4. Click on the OK button.
5. If you have changed the default DLL, exit from the DDE Server by choos-
ing File Exit and restart it.
1. First restart MS Windows for the changes you made to the winstart.bat file
to become effective.
2. Start the SIMATIC DDE Server.
3. Start your application(s).
Further For information on loading and changing symbol files please refer to Chapter 7
information or to the online help.
Filename The filename of a symbol file must have the extension ‘.sig‘.
5 For example, the simulation driver uses the supplied symbol file called
plcsig.sig. Three variables are defined in it: ‘triangle‘, ‘array‘ and ‘sawtooth‘.
Required To create a symbol file, you require the following information about the vari-
information ables, whose values are to be accessed using the DDE Server:
Names of the variables (freely selectable).
Data types of the variables (see Table 5-1 for valid types).
Corresponding addresses in the automation system.
Keywords Keywords must always be written with lowercase letters. The keywords on
the symbol file include the data types
float, long, short, byte, rbyte, lbyte, zeit, zaehler, merker, string
Note
The names of system items (see Appendix B) are not permitted as identifiers
in variable declarations.
5
Comments Comments on the symbol file are preceded as in the C programming lan-
guage by the string ‘/*‘ and terminated by ‘*/‘:
/* Comment */
Comments may be several lines long and located anywhere on the symbol file.
Syntax A declaration of a variable in the symbol file has the following simplified syn-
tax:
Data types of You can see the data types, their applications, and their length from the follow-
variables ing table.
* The rbyte and lbyte data types are the left and respectively right byte of a
value. They can be used only in address areas on which data words can be ad-
dressed * for example, in data blocks.
long The data type declares a 32-bit fixed-point variable, with or without sign.
Range of From To
Values
signed 2 147 483 648 2 147 483 647
unsigned 0 4 294 967 293
short The data type declares a 16-bit fixed-point variable, with or without sign.
Range of From To
5
Values
signed 32 768 32 767
unsigned 0 65 535
byte The data type declares an 8-bit fixed-point variable, with or without sign.
Range of From To
Values
signed 128 127
unsigned 0 255
rbyte and lbyte The data types address the less significant byte (rbyte) and the more signifi-
cant byte (lbyte) in a word. A word consists of two bytes. Both data types sup-
port 8-bit values, with or without sign.
The rbyte and lbyte data types can be used only in address areas on which data
words can be addressed for example, in data blocks.
Range of values: as for the byte data type
zeit The data type supports time specifications in string form and in xxx.y format:
xxx is the time value in a range from 0 to 255.
y is the resolution:
zaehler The zaehler data type declares a 16bit SIMATIC counter variable.
Range of values: 0 999
Variables of the zaehler type are BCD coded if CF_TEXT format is used. If
CF_BYTESTREAM format is used (refer to Appendix C.2.2), they are BCD
coded in all address areas except the address area Z (counter) where they are
binary coded. The memory areas are listed in Table 5-2, page 5-7.
merker The data type declares a 16-bit SIMATIC S5 bit memory variable.
string The data type declares a character string. The length of the string is specified
by means of a variable array (see further below). A single character is 8 bits
long.
Read-only By placing the keyword const before a variable type, you define a read-only
variables variable. Only read access to such variables is possible.
Example
const unsigned byte wz1=DB[10][1];
Arrays of variables You declare arrays of variables by specifying the array size in square brackets
following the name of the variable.
Arrays are not allowed for variables of the rbyte and lbyte types or for bit vari-
ables.
Example
short array[5]=DB[10][5];
5
This definition declares an array of length 5 in data block 10, from data word 5
onward. Every single item in a field is 2 bytes long (‘short‘ type).
Memory areas The authorized memory areas of an automation system (PLC) are shown in the
following table:
Times and counter values are stored in binary code in memory areas T and Z;
they are BCD coded in all other areas.
Address values Specify address values in square brackets directly following the memory
areas concerned:
short ein=E[10];
The variable ein denotes 2 bytes (short) in the process image input table from
the tenth byte onward.
Addressing The following table shows the methods of addressing in the different memory
methods areas.
Bit addressing In the areas DB, DX, DE, E, A, and M, you can address a bit within a variable.
This option is restricted to variables of types byte, lbyte and rbyte.
Specify immediately after the address value a dot, ‘.‘, and the number of the bit
you require.
The least-significant bit is No. 0, the most significant bit is No. 7.
Example
lbyte bit3=DB[10][5].3
The bit3 variable contains the value of the fourth bit in the left byte of data
word 5 in data block 10.
Read:
Variable value = 0 means bit is not set.
5
Variable value = 1 means bit is set.
Write:
Variable value = 0 means bit will be reset.
Variable value → 0 means bit will be set.
DB10
DW0
DW5 7 3 0 7 00
...
DW255
Not required if... If only one automation system is connected, there is no need for you to specify
a subsystem declaration. In this case the default subsystem defined in the
driver is used.
Required if... If several automation systems are connected, you have to specify an additional
address, i.e. the subsystem name. The subsystem name specifies the automa-
tion system from which the value of a variable originates. An automation sys-
tem is permanently assigned to a subsystem.
5
Example The driver for the serial interface, as511.drv, can serve several interfaces.
Precisely one automation system, which then forms a subsystem, is connected
to every serial interface.
Assigning to Every variable on the symbol file is assigned precisely to a subsystem. The
a subsystem following assignments are possible:
default subsystem
one subsystem for several variables
one subsystem for one variable
Default subsystem If a subsystem has not been specified on the symbol file, the ‘default‘ subsys-
tem defined in the driver is used.
For example, the ‘default‘ subsystem is assigned to the COM1 interface in the
case of the ‘as511.drv‘ driver.
Subsystem for A subsystem declaration applies to all the following definitions of variables on
several variables the symbol file until another subsystem is declared.
Subsystem for one You can also specify the subsystem as part of the address on the symbol file.
variable To do this, place the subsystem name in front of the usual address and separate
the address with a dot, ‘.‘:
unsigned short m11u_short=PLC1.DB[10][1];
The variable gets its value from subsystem PLC1, data block 10, data word 1.
Separator The different parts of the address string are separated by a semicolon ‘;‘.
Address Areas The OpType represents the address area. The address areas that are specifi-
(OpType) cally supported depend on the automation system addressed.
6 zb Counter
tb Times
bs* Operating system data area
as* Absolute addresses
OpNo, Start and You can see the authorized range of values of the address specifications, i.e.
Length op. no., start and length from the following table.
Note
The SIMATIC DDE Server does not check at runtime whether the specified 6
address areas do in fact exist on the automation system.
Subsystem name The subsystem name must be defined on the symbol file or be set by means of
a command (cf. Chapters 5 and 9).
If you do not specify a name with absolute addressing, the ‘default‘ subsystem
is used.
DDE icon Double-click the left mouse button on the DDE Server icon to activate it. The
DDE Server is started and uses the default symbol file.
Command line Choose in Program manager the “Run File“ function. A dialog box, in which
7 you can enter the pathname of the DDE Server and, optionally, a symbol file as
parameters, is then opened.
File Manager or Double-click on the file containing the symbol file (filename: *.sig) to open it.
Explorer The DDE Server is then started and uses the symbol file you selected.
Alternatively:
Open the executable file ddeplc.exe of the SIMATIC DDE Server in the File
Manager or the Explorer.
Starting under Click on the “Start” Button and select the DDE Server in its program group.
Windows 95
Start once only! The DDE Server can run only once under Windows. If you attempt to start the
DDE Server while it is running, a corresponding message is output to the
screen.
Automatic start If you continually need the SIMATIC DDE Server, copy the icon into the “Au-
tostart” group in MS Windows.
Set the Program Manager (File→Properties) so that the SIMATIC DDE Server
is started as an icon.
Precaution If you want to exit from the DDE Server while DDE conversations to other
applications are still open, a corresponding message box is displayed.
You then have two options of proceeding:
Cancel exiting from the Server (by clicking on the ‘Cancel‘ button), or
Close the connections and exit from the Server (by clicking on the ‘OK‘
button).
Dialog The procedure for when the main window of the SIMATIC DDE Server is
open on the screen is:
Choose the menu command File→Exit
If connections to other applications are still open, then the dialog box men-
tioned above is displayed. Otherwise you exit from the Server without any
other message or acknowledgement. 7
Icon The procedure for when the Server is running in the background, i.e. the
SIMATIC DDE Server icon is on the desktop, is:
1. Select the icon.
2. Choose ‘Close‘ on the drop-down menu.
Here again, the DDE Server displays a message box about any connections that
are still open.
Exiting from When you exit from Windows and the Server is still active, a message is dis-
Windows played if any connections are still open (as above). If not, you exit from the
Server without any message being displayed.
Menu Functions This section provides you with an overview of the menu functions of the DDE
Server. The uses of the individual functions will be described in the chapters
that follow. For more detailed information see the online help.
Once the Server has been started the main window is opened.
The menu bar contains four menus ‘File‘, ‘Options‘, ‘Status‘, and ‘Help‘.
Status When you choose this menu, you are provided with status information about
the Server, the current connections, and the variables, and you can manage
connections and variables.
Managing connections and variables is described in Sections 7.6 and 7.8.
Help At this stage you can call up general information on the DDE Server and the
Help system for the DDE Server.
Contents Contents of the online Help for the DDE Server
About... Release, year of release, and licensee of the
DDE Server are displayed.
Windows Help The DDE Server Help system makes use of the Windows online Help system.
system It features glossary-style and context-sensitive help.
The Help system runs in a separate window, thereby accessing the application-
specific help file, DDEPLC.HLP, in which the SIMATIC DDE Server Help
system is defined.
Call options You can use online Help in the following ways:
Activating Help in the menu bar of the main window
Using function keys
Pressing the Help button in dialog boxes.
Activating Procedure 7
Help→Contents
1. On the menu choose Help → Contents.
2. Select a keyword on the Contents topic.
Keywords are underlined. Once a keyword has been selected the text of the
corresponding explanation is displayed.
Note You can have the system directly display instructions on how to use the Help
system of MS Windows after it has been called:
1. Choose the question mark, ?, in the menu bar of the help window.
2. Choose How to Use Help on the drop-down menu.
Function Key F1 If you press the F1 key and the mouse pointer is located in the main window,
the Contents topic of the Help system for the SIMATIC DDE Server is dis-
played. At this stage you can call up further information on selecting a key-
word.
If you press the F1 key in a dialog box or when a menu is open, the Help text
for the current dialog box or selected menu item is displayed (context-sensitive
help).
Function key If you press the SHIFT F1 key in the main window of the SIMATIC DDE
SHIFT F1 Server, the shape of the cursor changes to a question mark. The next click
shows information on the item you selected.
Example:
If you make a selection as you normally would do after pressing SHIFT F1
in the menu bar of the DDE Server, information is displayed on the menu
item you selected.
You can exit from SHIFT F1 mode by pressing the ESC key.
The SHIFT F1 mode is not active in dialog boxes.
Help button All dialog boxes of the DDE Server contain a Help button. If you press this
button, a Help window containing advice on the input options for that dialog
box is opened.
Introduction The symbol file is an ASCII file in which the variables and subsystems for the
Server are defined. A symbol file is loaded each time the SIMATIC DDE
Server is started. While the DDE Server is running, you can, if necessary:
load a new symbol file or
modify the current one with an ASCII editor.
The functions for processing the symbol file are located in the ‘File‘ menu the
main window of the DDE Server.
Procedure
1. Choose the menu command File → Open. The customary Windows dialog
box appears for selecting a file.
2. Click on the file you require and then choose the OK button. If the file con-
taining the symbol file is not displayed, you must first change to the corre-
sponding directory.
Modifying the Cur- Symbol files are ASCII files that can be modified with any text editor. You can
rent Symbol File modify the current symbol file of the DDE Server by using a menu.
Procedure
1. Choose the menu command File → Edit. A text editor is then called for
modifying the symbol file.
Notepad – Plcsig.sg
File Edit Search ?
Note
Changing the name of the symbol file does not take effect in the DDE Server.
Please use the menu command File → Open, in order to load another symbol
file.
Introduction In this chapter you learn how to view the current connections and to release
selected connections.
Connections
default
Release
Close Help
Note
You can release no connection as long as hot or warm links are still active on
it. You must terminate these links in the client application first.
Procedure You can retrieve statistical information on dynamic data exchange (DDE) as
well as data on the Server configuration.
Choose the menu command Status→Server.
The status box of the DDE Server is displayed.
Server
DDE
Number of DDE Connections: 1
Sent DDE ACK: 365
Sent DDE NACK: 21
Sent DDE Data: 360
7 Not sent DDE Data: 0
Active DDE connections: 3
Configuration
Driver DLL test.drv
Language: ddeuk.dll
Close Help
Fields in the By using the status box, you can follow the most important counters of the
status box SIMATIC DDE Server in online mode. The status box contains two panels
‘DDE‘ and ‘Configuration‘. The fields in these two panels have the following
significance:
Field Description
DDE:
Number of DDE Connections: Number of open DDE connections.
Sent DDE ACK: Number of DDE ACK (positive ac-
knowledgment) messages sent by the
SIMATIC DDE Server.
Sent DDE NACK: Number of DDE NACK (negative
acknowledgment) messages sent by
the SIMATIC DDE Server.
Sent DDE Data: Number of sent DDE DATA mes-
Introduction All the variables declared in the symbol file can be comfortably managed on
the user interface. You can do the following:
Read the variables
Change the value of a variable
Copy the value of a variable to the clipboard
Name:
Properties
sawtooth Copy
Type: Data block
array Data type: Short signed
sawtooth
Address:
triangle
Data block DB 1
Data word DW 2
Number of Links: 0
Subsystem: default
Value: 64
Change...
Close Help
3. Once a variable has been selected, its name is displayed in the ‘Name‘
field. Information about this variable is displayed in the ‘Properties‘ field.
The fields display the following information:
The ‘File‘ field displays the pathname of the file containing the symbol file.
The ‘Name‘ field displays the name of the variable you selected.
The ‘Properties‘ field displays information about the variable.
The ‘Value‘ field shows the value of the variable at the time you selected it.
If you click again on the name of the variable on the list, its value is up-
dated.
Changing Procedure:
Variables
1. Open the ‘Variables‘ dialog box as described in the previous section.
2. Select a variable.
3. Click on the ‘Change...‘ button in the ‘Value‘ field.
The ‘Setting Values of Variables‘ dialog box is displayed:
Setting of variables
Variable: sawtooth
Value: 200
OK Cancel Help
Copying a Variable The ‘Copy‘ function lets you open DDE links to standard applications with a
minimum of effort.
Procedure:
1. Open the ‘Variables‘ dialog box as described in the previous section.
2. Select a variable.
3. Click on the ‘Copy‘ button. The free end of the link is now put on the Clip-
board. If you open the Clipboard, you will see the DDE address of the vari-
able, consisting of the server name (ddeplc), the topic (default) and the
name of the variable.
Clipboard
4. Select the position in your application at which you would like to insert the
variable for example, a worksheet cell in Excel.
5. Choose ‘Paste Link‘ in your application.
The link has now been opened (hot link), and the value of the variable in
the application is updated automatically.
Note
You should not make changes to the Server configuration until you have be- 8
come thoroughly familiar with dynamic data exchange (DDE) under MS
Windows.
Changes to the parameters in the Configuration dialog box are saved and act
as the new default configuration parameters the next time you start the DDE
Server.
Effect The entry in the ‘Polling‘field determines the time interval after which the
DDE Server reads in those variables from the automation system whose values
have to be updated and tests them for changes. If the variable in the connection
has changed since it was last read in, its current value is passed to the client
(warm or hot link).
Setting Procedure
1. Choose the menu command Options → Configuration. The “Configura-
tion” dialog box is displayed.
Configuration
Timer
Poll time in ms: 550
Protocol
8 X
Duplex–DDE Connection
Clipboard format check
Immediate report on variable changes
Driver
Default DLL: test.drv
OK Cancel Help
2. Enter a value for the polling cycle time in milliseconds in the correspond-
ing field.
Range: 55 ms to 65535 ms
Default setting: 550 ms
Note
If the polling time you select is too short, Windows system may come to a
standstill on account of excessive system load. The polling time must be
higher or equal to the minimum period of operator-interface cyclic-read jobs
supported by the automation system.
If the polling time you select is too long, changes to variables may be lost.
Why Duplex DDE This function affects handling of DDE ADVISE messages in a DDE conversa-
Connections tion. 8
Many DDE applications transfer internal variable values to DDE servers only
when they have been enabled to do just this by a DDE ADVISE request. For
such DDE applications, the SIMATIC DDE Server provides a duplex DDE
connection (duplex hot link), depending on the configuration.
A conversation conforming with the DDE protocol does not provide duplex
DDE connections. Duplex DDE connections represent a deviation from the
DDE protocol (see below).
Enable the duplex DDE connections only when your application requires it
(first try to do without duplex DDE connections). As a rule, do not select a
duplex DDE connection (default setting).
Range: yes/no
Default setting: no
When a duplex DDE connection has been set, the following deviation from the
DDE protocol applies:
The DDE Server answers a DDE ADVISE request from a DDE client with
a second DDE ADVISE request to the client.
If the DDE client accepts the DDE ADVISE request from the Server, this
means that a duplex hot link has been opened.
From this point of time onwards the DDE client and the SIMATIC DDE Server
keep each other automatically informed of any change to the variables speci-
fied in the DDE ADVISE request.
Note
This deviation from the protocol is not supported by all DDE-compatible ap-
plications. For example, MS Excel ignores a DDE ADVISE request by the
Server to the client.
Check Clipboard By deactivating the check, you can improve the performance of a DDE con-
8 Format versation.
With a DDE request, a client always transfers the Clipboard format of the mes-
sages sent as a parameter. The SIMATIC DDE Server supports only the
CF_TEXT and the CF_BYTESTREAM format. MS Excel, however, sends
requests with different Clipboard parameters including CF_TEXT. This
behavior has an adverse effect on DDE conversation performance since the
format is checked every time a DDE request is received and may be rejected.
If you de-activate Check Clipboard Format, the SIMATIC DDE Server im-
mediately returns the data without checking the format in CF_TEXT
format. CF_TEXT format is supported by most MS Windows applications.
Activate Check Clipboard Format if you wish to prevent invalid data for-
mats from being transferred. If the application does not detect CF_TEXT
format in returned data, reception of these DDE messages will be rejected.
If your application does detect CF_TEXT format, you can leave the format
check deactivated for performance reasons.
Range: yes/no
Default: yes (Check Clipboard Format on)
Note
A conversation using MS Excel macros works only if the Clipboard format
check has been activated.
Immediate For performance reasons, the SIMATIC DDE Server does not report changes
Reporting of to variables to a DDE client when the change to the variable (DDE POKE) has
Changes to occurred on the DDE channel of an existing link (DDE ADVISE) to the speci-
Variables fied variable.
To ensure that the DDE Server abides by the protocol, the “Immediate Re-
porting of Changes to Variables” option was added to the Configuration
dialog box.
If this option has been set on the configuration dialog box, changes to the value
of a variable for which there is a link (DDE ADVISE) are explicitly reported to
the writing DDE client (DDE DATA) after the variable has been changed on
the same DDE channel (DDE POKE).
If this option has not been set, changes to variables are reported only to DDE
clients linked to the variable, but not to the writing client. In this case, the ac-
knowledgment (DDE ACK) of the write instruction is confirmation for the
writing client of the variable having been changed.
Change this default setting only if your application requires it.
Range: yes/no
Default: no (no immediate reporting)
Overview of Trace With the Trace mechanism, you can log the values of variables and function
functions calls for test and troubleshooting purposes. You can call the following func-
tions by choosing Options in the menu bar of the main window:
Activate Trace
Reset Trace
Set Trace options
Requirement Before activating Trace, you should first set the Trace configuration options.
Procedure You can set the log format and the name of the Trace file using the user inter-
face.
1. Choose Options→Trace.
The ‘Trace‘ dialog box is displayed.
Trace
Trace Items
DDE
PLC
Trace Format
Date
Time
Handles
8 Trace Output
File \ddeplc.trc
OK Cancel Help
2. Enable or disable the options you require (toggle function). Enabled op-
tions are selected by checking the check boxes. The functions are described
below.
3. Then close the dialog box by clicking on the ‘OK‘ button. The changes you
made to the Trace configuration will then become effective.
DDE Trace Items Enable ‘Trace Items DDE‘ if you require all DDE messages to be logged.
PLC Trace Items Enable ‘Trace Items PLC‘ if you require all the requests of the automation
system and their acknowledgments to be logged.
Date Enable ‘Trace Format Date‘ if you require the Trace output to include the
Trace Format date.
Time Enable ‘Trace Format Time‘ if you require the Trace output to include the
Trace Format time of day.
Handles Enable ‘Trace Format Handles‘ if you require the Trace output to include all
Trace Format the Windows handles of the DDE client and the DDE Server.
Trace Output Enable ‘Trace Output File‘ if you require the complete Trace text to be writ-
ten to the specified file. The Trace file is an ASCII file that can be inspected
with a text editor. You can change the pathname of this file, too.
The pathname is dimmed if the Trace output is disabled.
Note
You cannot switch to the Trace output File if the Trace is active. You can open
a new file only after deactivating and then re-activating the Trace (see below).
Caution
! The trace information is appended to the Trace file as long as the Trace is ac-
tive. The contents of the Trace file is deleted only when the Trace is reset.
Do not allow the Trace file to grow too large.
(Refer to ‘Resetting Trace‘)
8 Trace is reset, and the complete contents of the Trace file are deleted.
9.1 Commands
poll With this command you can set or retrieve the polling cycle time for the cur-
rent connection.
For setting the polling cycle time, you have to pass the time value in ms as an
argument. The syntax is as follows:
poll=time
The time parameter may assume values ranging from 55 ms to 65 535 ms. (55
ms is the lowest timer unit in MS Windows). The value is rounded off to the
9 next integer multiple of the polltime value set by the menu Options → Config-
uration
If you specify 0 as the value, polling is disabled for that connection. Changes
to variables in existing hot and warm links can no longer be reported to the
client.
For retrieving the current polling cycle time, the poll command without argu-
ment must be executed with the DdeRequest call.
absolut Sets reporting of values of the variable in every polling cycle or retrieves the
current setting.
For setting the reporting of variables, the syntax is as follows:
absolut=value
The command causes the SIMATIC DDE Server to report the value of a vari-
able to the client in every polling cycle for warm and hot links, even if it has
not changed. In the case of writing with 0 as a value, this characteristic is reset.
A value not equal to 0 enables the characteristic.
For retrieving the current setting, the absolut command without argument must
be executed with the DdeRequest call.
load (path) With this command you can load a symbol file. To do this, you have to specify
the complete pathname of the file containing the symbol file.
Example
Load a symbol file using Excel macros:
=POKE (ChanNum;”&load(c:\simdde\signew.sig)”;A4)
(in this case the third argument ‘A4‘ is not evaluated)
or
=EXECUTE(char;”load(c:\simdde\signew.sig)”)
subsys arguments With this command you can declare a subsystem. The parameters are the same
as for the subsystem declaration on the symbol file.
Example
Declare the subsystem with Excel macros:
=POKE (ChanNum;”&subsys (plc1, par1, par2,par3,par4,as511.drv)”;A4)
or
=EXECUTE(ChanNum;”subsys (plc1, par1, par2,par3,par4,as511.drv)”)
Note
The subsystem declared in this manner is not significant in respect of the vari-
ables on the symbol file. You can specify it only in absolute addresses.In the
9
examples above the third argument ‘A4‘ of the POKE macro is not evaluated.
Command Names To distinguish them from variables of the same name, commands are always
prefixed by an ampersand ‘(&)‘.
Examples and You can execute DDE commands by using the function calls DdeExecute
Return Values DdeAdvise and DdePoke. The following table shows examples of the function
calls and their return values.
9 rw_buffer = Actual
setting
load
Load symbol file rw_bool = DdeExecute(..., ”load(c:\plcn.sig)”) rw_bool= True/False
rw_bool = DdeAdvise(..., ”&load(c:\plcn.sig)”,...)
rw_bool = DdePoke(...,”&load(c:\plcn.sig)”,...)
rw_int = DDERequest(...,”&load(c:\plcn.sig)”,rw_buffer”,...) rw_int = Number of
bytes
rw_buffer = Name of
the actual symbol file
subsys
Declare a subsystem rw_bool = DdeExecute(...,”subsys(as1,0,2,0,0,mpi.drv)”) rw_bool= True/False
rw_bool = DdeAdvise(...,”&subsys(as1,0,2,0,0,mpi.drv)”,...)
rw_bool = Depone(...,”&subsys(as1,0,2,0,0,mpi.drv)”,...)
rw_int = DDERequest(..., ”&subsys(as1,0,2,0,0,mpi.drv)”, rw_int = 0
rw_buffer,...)
rw_buffer = empty
You can retrieve the result of the command execution by using the system item RETURNMESSAGE.
9.2 Options
Options define certain characteristics of the DDE connection. They are passed
at the second addressing level (default).
10
Macro language All common Windows applications support DDE. The description of the DDE
protocol, however, defines only the parameters of the DDE commands, not
the macro language for calling the DDE commands. This is the reason why
the commands differ from one application to another.
The user interface of the SIMATIC DDE Server consequently defines only the
significance of the individual DDE parameters for the SIMATIC DDE Server.
10 By way of the macro language of MS Excel, examples are shown in the fol-
lowing of DDE calls in a Windows application.
Basic sequence A DDE conversation between Windows applications takes place in a logic
of events channel. The Excel macro function
chan=INITIATE(ParameterList)
opens a channel to a application that supports DDE. The channel number is the
return parameter of the macro required during the DDE conversation in order
to reference the logic channel.
For exchanging data and other services, MS Excel features the macro functions
POKE, REQUEST and EXECUTE. The first two macros can be used to send
data to the other DDE application or to receive data from the other DDE ap-
plication. You use the EXECUTE macro to send commands to the other DDE
application. The format of the data is invisible to the user. It is negotiated by
MS Excel and the SIMATIC DDE Server in the background.
The DDE channel is closed again with the
TERMINATE(chan) macro function.
Macro list The following DDE command macros are available in MS Excel:
INITIATE
TERMINATE
REQUEST
POKE
EXECUTE
10
Note
These macros can be used with Excel V.4 and V.5.
Detailed descriptions of MS Excel macros will be found in the “!Microsoft
Excel” manual.
10 Example file A macro model with DDE macros will be found in the root directory of the
SIMATIC DDE Server under:
\ddeplc02.xlm
Note
A conversation using MS Excel macros works only if the Clipboard format
check has been activated.
Implicit Hot links represent a rapid and effective method of integrating the values of
conversation variables in other applications into the current environment with constantly
having to retrieve them every time.
Hot link with The establishment of hot links with macros is not possible in MS Excel.
macros
Hot link with A hot link, i.e. an uninterrupted link, can be established in MS Excel only with
formulas the help of remote references (reference to an application in another program).
Remote links are particularly easy to handle in MS Excel and are implemented
as formulas. A formula calculates the contents of a cell. Unlike macros, which
extend over several cells, formulas are clearly arranged and are specified
within a cell.
Read access Read access to the ”triangle” example variable is executed from a MS Excel
form by entering the following formula (”hot link”), for which a cell array is
selected.
=ddeplc|default!triangle
The above formula is activated by simultaneously pressing the three keys
“Control”, “Shift“, and “Enter“.
The above formula causes MS Excel to send the SIMATIC DDE Server 10
(”ddeplc”) an INITIATE request of its own accord. When the link has been
opened, MS Excel subsequently sends a request to the DDE Server for a hot
link to be created to the triangle variable. When the Server has accepted the
request, MS Excel initializes the cell containing the hot link formula by means
of a REQUEST request to the DDE Server. In the event of an error, MS Excel
displays an error.
Write access Write access to a variable is not possible using MS Excel formulas.
Example file A MS Excel worksheet with DDE formulas will be found in the root directory
of the SIMATIC DDE Server under:
\ddeplc01.xls
10
Parameter The transfer parameters define the address of the module to which a connec-
tion is to be set up via the Multipoint interface.
Host ID Parameter 2 (host ID) defines either the MPI node address of the CPU or func-
tion module (FM), or the communication bus address (rack slot number) in the
S7/M7-400 system (e.g. when the DDE server is running on an FM 456-4, see
example 2).
In the case of local addressing, parameter 2 defines where local communication
will occur; the MPI node address of the module in the S7/M7 300 system and
the communication bus address (rack slot number) in the S7/M7 400 system.
A Rack Slot ID Parameter 3 (rack slot ID) defines the communication bus address (rack slot
number) in the S7/M7-400 system. In the S7/M7 300 system parameter 3 al-
ways has the value 0.
Remote Host ID Parameter 4 (remote host ID) is used only with the SIMATIC M7 DDE Server
Windows95 when addressing a module in a remote system S7/M7-300/400. It
defines the following:
MPI node address of the CPU or function module (FM) in the remote sys-
tem S7/M7-300
MPI node address of the CPU in the remote system S7/M7-400
Note
If the SIMATIC M7 DDE Server Win 3.11 runs on an FM 456-4 function
module, only the CPU and other function modules within the same
SIMATIC-400 station can be accessed. This constraint does not apply to the
SIMATIC M7 DDE Server Win 95.
Examples The following examples show subsystem declarations for SIMATIC S7/M7
automation systems. The driver DLL is mpi.drv
1. In the following example, a subsystem is declared (mpisub10), which sets
up a connection to the communication partner using the MPI node address
10 (host ID). The driver DLL is mpi.drv.
subsys mpisub10={0,10,0,0,‘mpi.drv‘};
2. In the following example, a subsystem is declared (mpisub8), which sets
up a connection to the communication partner via the communication bus
(within a SIMATIC S7/M7 station) using the communication bus address 8
(rack slot). The driver DLL is mpi.drv.
subsys mpisub10={1,8,0,0,‘mpi.drv‘};
3. In the following example, a subsystem is declared (mpisub3_7), which sets
up a connection to the node via the Multipoint interface with the commu-
nication bus address 7 (rack slot) in the communication bus subnet of a
CPU with the MPI node address 3. The driver DLL is mpi.drv.
subsys mpisub10={0,3,7,0,‘mpi.drv‘};
DDE
SIMATIC S7/M7–300
CPU FM
Communication partner
SIMATIC S7/M7–300
MPI
SIMATIC S7/M7–400
CPU FM
C Bus
DDE DDE
A
Parameter DDE Server runs on
PC, or M7-400 CPU M7-400 FM
M7-300 CPU/FM
Par 1 Device ID 0 0 1
Par 2 Host ID MPI node address of des- MPI node address of destina- Rack slot ID of CPU in the
tination CPU/FM tion CPU/FM own 400 station
Par 3 Rack Slot ID 0 0 0
Par 4 Remote Host ID 0 0 0 or MPI node address of
CPU/FM in the remote 300
station (DDE-Server Win95
only)
DDE
MPI
SIMATIC S7/M7–300
SIMATIC S7/M7–400
CPU FM
CPU FM
SIMATIC S7/M7–400
DDE DDE
CPU FM
K-Bus
DDE DDE
Local Parameter semantics for the subsystem declaration for local communication on
Communication SIMATIC M7-300/400 CPU/FM with MPI.DRV
Par 1 Device ID 2 2
Par 2 Host ID own MPI node address own Rack Slot ID
Par 3 Rack Slot ID 0 0
Par 4 Remote Host ID 0 0
A
Parameters The transfer parameters are the same as for the DOS TSR:
Parameter Description
Parameter 1: I/O address of the serial interface
Parameter 2: Software interrupt:
The value has to be the same as the value specified
as /SWINT in the winstart.bat file (refer to Chapter
???); If /SWINT is not specified in winstart.bat,
Parameter 2 has to be set to 0.
Parameter 3: Is ignored
Parameter 4: Is ignored
Default If the DLL is installed as the default DLL, the default settings from the instal-
lation of DOS TSR are applied.
Example In the following example, a subsystem called df15, installed at I/O address
0x2e8, is declared. The driver DLL is as511.drv.
subsys df15={0x2e8,0,0,0,‘as511.drv‘};
Parameters The transfer parameters define the behavior of the DLL for a CP 524/CP 525.
Note
The communication is based upon the 3964R protocol. Default protocol set-
tings are used.
A For a DDE conversation, the application has to call the SEND ALL and
RECEIVE ALL functions (refer to COM 525 manual, Volume 2/2, Part 7,
Using Data Handling Blocks, Section 2.4).
Example In the following example, a cp524 subsystem, installed at I/O address 0x2e8
and interrupt 7 on the master interrupt controller, is declared. The baud rate is
set to 19200 bd, the priority is low. The DLL driver is rk512.drv.
subsys cp524={0x2e8,7,4,0,‘rk512.drv‘};
Constraint The CPU number can be set at the present time only by absolute addressing.
This is planned as an extension to the symbol file.
Example In the following example, a subsystem called test is declared for the test.drv
driver DLL.
subsys test={0,0,0,0,‘test.drv‘};
Under the system topic, the SIMATIC DDE Server supports the items men-
tioned in this section for retrieving general information via the DDE interface.
These items represent the third component of the DDE address after the ddeplc
service and the system topic:
ddeplc system system item
Note
The names of system items are not permitted as identifiers in variable declara-
tions in the symbol file.
Under the default topic, the SIMATIC DDE Server supports the items men-
tioned in this section for retrieving general information about the DDE inter-
face.
These items represent the third component of the DDE address after the ddeplc
service and the default topic:
ddeplc default non-system item
TOPICITEMLIST generates a list of all the items supported by the SIMATIC DDE Server under
the default topic.
Note
The names of non-system items are not permitted as identifiers in variable
declarations in the symbol file.
No. of variables The number of variables and connections is limited only by the memory avail-
and connections able in MS Windows.
Amount of data When using DDE conversations via MPI, the amount of transmitted data de-
with MPI pends on the PDU (Process Data Unit) size settled with the communication
partner. If the amount of data sent or requested exceeds this size, the call is
rejected. On SIMATIC M7, you can retrieve the PDU size using the M7 API
function call M7GetPDUSize.
C
C.2.1 CF_TEXT
Field separator Individual items in fields are separated from each other by the string ‘\r\n‘ (in
line with the conventions of the CF_TEXT format).
C.2.2 CF_BYTESTREAM
Registration Before first using a data transfer format, it must be registered with Windows by
means of the Windows API function call RegisterClipboardFormat. This
applies to CF_BYTESTREAM as well.
uint_value= RegisterClipboardFormat(format_name)
The uint_value return value is the registration no. of the data transfer format. It
is passed as a format ID argument to further DDE transactions
Field separator No field separators are transmitted. When data is read, an additional byte con-
taining the access status (success=0, failure!=0) is appended to the beginning.
The length of the transmitted data and therefore the length of the allocated
buffer depends on the data type.
Examples:
When reading two long values, 9 bytes are transmitted, i.e. 1 byte access status
and 8 bytes of data.
C When writing two long values, 8 byte of data are transmitted.
Note
You must use the Windows API function calls DdeAccessData and DdeUnac-
cessData in order to access the complete transferred data, since the function
call DdeGetData reads data only until the first occurrence of 0x0.
Read and write Please mind the following when reading or writing data in CF_BYTES-
access TREAM format:
Definition of block With a block transfer, any number of variables can be read from the automa-
transfer tion system with just one DDE request to the Server. The variables may be
located in random data areas on the PLC.
The performance benefits of block transfer are based on the saving of the sys-
tem overhead, which arises upon transfer of specific variables.
Server function The DDE Server makes sure that the variables are read and sent back to the
application in a single block.
Singlevariable The Server reads specific variables in succession with a separate request to the
access automation system.
Advantages of The combination of DDE block transfer and singlevariable access provide
DDE Block the O/I system with the following advantages:
Transfer
Lists of variables can be created dynamically.
The only variables that have to be read by the PLC are the ones that are
currently required.
The application programmer does not have to make an additional data area
available on the PLC for storing O/I data.
No additional code is required in the application for supplying data areas
for O/I.
Any PLC application can thus supply data for a O/I system. All that is required
is knowledge of the distribution of the variables for visualization in the data
areas of the automation system.
Note
The characteristic of hot links of keeping the value concerned up to date, is
used only for the VarList command.
D
& as command To distinguish them from the names of variables, command names are prefixed
prefix by “&” in the case of DDE Request and DDE Advise. The parameters remain
the same in all cases.
Return values With DDE Request and DDE Advise, the result of command execution is re-
turned. The following table describes the significance of the values returned in
the variables rw_bool, rw_int and rw_buffer.
Access to lists of The following table shows the specific behavior of the DDE Server upon read-
variables ing and writing lists of variables.
Syntax DefineList(listname,var_list)
Description With this command you define a list of variables called listname, which con-
sists of the variables listed in var_list.
The name of the list of variables can then be used in all DDE commands
(hot,cold or warm link; poke) as the item name. A list of variables may contain
up to 64 variables.
The name of a variable may be defined on the symbol file of the DDE Server
or specified as an absolute address.
2 You can check the result of a request by retrieving the system item ReturnMessage
with DdeRequest.
Errors If a list of variables contains at least one error, the whole list is rejected. Pos-
sible errors are:
D References to symbolic names not defined on the symbol file.
Invalid absolute addressing.
Variables are located in different subsystems.
More than 64 variables were specified
Example Definition of a list of variables named m7list using the function call DdeRe-
quest. The list contains 4 variables named a, b, c and d.
DdeRequest(...”&DefineList(m7list,a,b,c,d)“,...)
Syntax DeleteList(listname)
Description With this command you delete the list of variables called listname on the
Server. Lists of variables are named and defined with the DefineList command.
2 You can check the result of a request by retrieving the system item ReturnMessage
with DdeRequest.
Syntax GetList(listname)
Description With this command you read the definition of the list of variables called list-
name from the Server.
Lists of variables are named and defined with the DefineList command.
The GetList command can be executed only with the DDERequest function
call.
Description You can use this command for one-shot access using a list of variables (for
DDE Request, DDE Advise, and DDE Poke).
The list of variables is not stored.
You do not need to define a list of variables for this and delete it again.
With write, an access status is not supplied for every variable.
The name of a variable may be defined on the symbol file of the DDE Server
or specified as an absolute address.
A list of variables may contain up to 64 variables.
Errors Incorrect specification of variables does not result in rejection of the list.
Instead, the access status of the different variables is set accordingly.
D
Errors are not supplied with write using VarList.
Description With this command you can read out the state of the last write access for the
list of variables.
Access states are not deleted by reading. You can therefore fetch the result as
often as you wish with Result.
Note
Warm links, hot links or pokes are not possible with this command.
The Result command can be executed only with the DDERequest function
call.
Block transfer, D-1
Hardware requirements, 3-2
Help menu, 7-4
Hot link, 2-3
Check clipboard format, 8-4
Client, 2-2, 2-3
Cold link, 2-3
Commands, 9-2 Immediate report on variable changes, 8-5
absolut, 9-2 Inbetriebnahme, 4-1
load, 9-2 Installation, 3-2
poll, 9-2
subsys, 9-3
Communications services, 1-6
Connections, 2-2, 2-3, 7-9
release, 7-9 MS Excel macros, 10-3
view, 7-9
RK 512 interface, 4-7 Technical Data , B-2
topic
default, 2-5
system, 2-5
Server, 2-2, 2-3 Trace active, 8-10
SlotPLC hardware driver, 4-9 Trace configuration, 8-8
SlotPLC interface, 4-9 Trace reset , 8-10
Software requirements, 3-2
Starting, 3-3
Status information, 7-10
Status menu, 7-4 Variable declaration, 5-4
Subsystem declaration, 5-10, A-1 Variables
as511.drv, A-7 change, 7-13
mpi.drv, A-2 copy, 7-13
rk512.drv, A-8 read, 7-12
test.drv, A-9
Subsystems, 2-8
Symbol file
addresses of variables, 5-7
create, 5-2 Warm link, 2-4
data types, 5-4
load, 7-7
memory areas, 5-7
modify, 7-8
subsystem declaration, 5-10
variable declaration, 5-4