0% found this document useful (0 votes)
314 views100 pages

DRL PFB USB - Manual

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
314 views100 pages

DRL PFB USB - Manual

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

Protocol manual

Profibus DRL-MPI-USB
DRL-PFB-USB
Direct-Link® PC Network Interfaces

a product of Woodhead Software & Electronics

Profibus DRL-MPI-USB DRL-PFB-USB 1 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DRL-MPI-USB DRL-PFB-USB 2 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Table of contents

1. Overview.........................................................................................5
Introduction..............................................................................................................5
Prerequisites ...........................................................................................................5
USB requirement.....................................................................................................6

2. Installation......................................................................................7
Installation procedure ..............................................................................................7
Driver installation.....................................................................................................7

3. Hardware description ..................................................................10


LEDs......................................................................................................................10
Connecting a Profibus Network.............................................................................11
Environmental specifications.................................................................................11

4. Implementation of a Profibus configuration..............................12

5. MPI / S7 messaging. ....................................................................16


Description of MPI (Multi-Point-Interface) messaging ........................................16
Description of S7 messaging ................................................................................16
Devices parameters ..............................................................................................17
MPI/S7 messaging supported features .................................................................18
Data alignment ......................................................................................................19
Access via the OPC, DDE/SuiteLink and DAS servers ........................................21
Frame size limits used in MPI/S7 messaging .......................................................23
Configuration and settings of Siemens SIMATIC S7 devices with STEP 7 ..........24

6. MPI Slave messaging. .................................................................27


Description of MPI Slave (Multi-Point-Interface) messaging ..............................27
Devices parameters ..............................................................................................28
MPI Slave messaging supported features ............................................................29
Access via the OPC and DDE/SuiteLink servers..................................................30
Frame size limits ...................................................................................................32
Configuration and settings of Siemens SIMATIC S7-200 devices........................33

7. S5 messaging...............................................................................35
Description of S5 messaging ................................................................................35
Devices parameters ..............................................................................................36
Supported features................................................................................................38
Frame size limits ...................................................................................................44
Configuration and setting of PROFIBUS PLC couplers (SINEC® L2)..................45

8. PROFIBUS DP messaging...........................................................53
Description of Profibus DP-V0 ..............................................................................53
Description of Profibus DP-V1 ..............................................................................56
Profibus DP master supported features ................................................................57
Profibus DP slave supported features...................................................................58

Profibus DRL-MPI-USB DRL-PFB-USB 3 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DP Slave configuration ...........................................................................59
Profibus Local DP slave configuration ..................................................................63
Profibus master / slave DPV0 supported variables...............................................66
Frame size limit .....................................................................................................70
Access to Specific Services of Profibus DP messaging (DPV0, DPV1) ...............71
AuWriteReadMsg : ................................................................................................72
AuWriteReadMsg sample......................................................................................86

9. In case of problems .....................................................................87


Problems resolution...............................................................................................87
Checking stations on the Profibus network ...........................................................88
Checking the Profibus wiring.................................................................................89
Token management using the Profibus protocol ..................................................91
Profibus timing profiles ..........................................................................................92
Min slave interval...................................................................................................93
Using MPI Socket..................................................................................................93

10. Returned status ...........................................................................94


General status .......................................................................................................94
Library specific statuses ........................................................................................94
Statuses relating to the Profibus protocol .............................................................95

11. Annex A: Detect USB capability of your PC ..............................97

Profibus DRL-MPI-USB DRL-PFB-USB 4 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


1. Overview

Introduction
The Direct-Link™ PC Network interfaces solution DRL-MPI-USB enables your applications to
communicate with Siemens PLCs and compatible equipment using the.
S7 protocol (S7-300, S7-400) manufactured by Siemens
MPI protocol (console outlet) manufactured by Siemens
MPI slave protocole (S7-200) manufactured by Siemens

The Direct-Link™ PC Network interfaces solution DRL-PFB-USB offers, in addition to the DRL-
MPI-USB solution
Profibus DP-V0 master/slave class 1&2 EN50170
Profibus DP-V1 master class 1&2 EN50170
Simatic S5 messaging manufactured by Siemens

These solutions uses the USB100PFB network adapter compatible with Profibus standard EN
50170 (RS485 with 500 Volts galvanic insulation) at speeds ranging from 9.6 kbps up to 12 Mbps.
Remarks:
• These solutions don’t require any external protection system to run.
• However, Data servers are an optional feature and required appropriate rights to run.
Without these rights, only the DLL library is available.
The rights are burned in the USB adapter before shipping. It is however possible to
upgrade your rights on site by entering a code supplied by your retailer.
For more information, please refer to the manual “Software protection and options”
• The supplied USB adapter is strongly linked with the ordered solution (DRL_MPI_USB or
DRL_PFB_USB) and cannot be used indifferently with both solutions.
• Profibus DP-V1 is supported only through DLL access.

Prerequisites
The DRL PCNI product is compatible with Microsoft Windows 2000 (SP4 recommended),
Windows XP (SP2 recommended) and Windows 2003 Server.
The DRL PCNI solutions require a specific firmware embedded in the BradCommunications
USB100PFB module. As a consequence, DRL-MPI-USB and DRL-PFB-USB solution cannot
run with a USB100PFB module delivered with other products (e.g. BradCommunications
USB100PFB commDTM module, …)
Only one BradCommunications USB100PFB module must be plugged at the same time
Be sure that the “Power Options Properties” in the “Control panel” of your computer will not
suspend the USB port, especially when the usb solution is used on a laptop.

Profibus DRL-MPI-USB DRL-PFB-USB 5 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


USB requirement
USB host or hub must be compliant with USB 2.0 or 1.1 specifications, High-speed or Full-speed
capable, support High-Power Bus-Powered USB device.
Note that USB 2.0 capability is recommended. Indeed, USB 1.1 decreases global performance
significantly. To know if your computer has USB 2.0 capable ports, please consult the annex A at
the end of this manual

It is recommended to use USB cable supplied along with the product. If longer cable is required, the
USB cable must be certified and capable of USB high-speed.

Profibus DRL-MPI-USB DRL-PFB-USB 6 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


2. Installation

Installation procedure
To use the DRL PCNI solution on BradCommunications USB100PFB module, during software
installation, select the Profibus EN50170 protocol.

Driver installation
After software installation, first time you will plug the BradCommunications USB100PFB module,
the operating system will ask you to install the driver. To do this, just click on button of every
window as indicated bellow:

Profibus DRL-MPI-USB DRL-PFB-USB 7 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Click on “No, not this time” then on “Next >”

Click on “Install the software automatically (Recommend)” then “Next>”

Click on ”Continue Anyway”

Profibus DRL-MPI-USB DRL-PFB-USB 8 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Click on “Finish”
Now, the solution is ready to use.

Note :

If this dialog box appears when the BradCommunications USB100PFB


module is connected the first time, restart the installation program,
choose the modify mode and select the Profibus EN50170 protocol or
just necessary messaging (See previous chapter).

Profibus DRL-MPI-USB DRL-PFB-USB 9 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


3. Hardware description

LEDs
There are three LEDs on the BradCommunications USB100PFB module:
one LED near the USB connector
two LEDs near the Profibus connector

LED near the USB connector

Colour Signification
OFF USB cable not connected or Suspend mode activated (power
energy management )
RED USB Enumeration in process. Once the USB modem connected,
the led remains red until the USB connection between the
Windows driver and the module is completed.
GREEN USB Connection established

LEDs near the Profibus connector

There are two LEDs indicator lights

Profibus DRL-MPI-USB DRL-PFB-USB 10 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Meaning of LED A: bus fault

Colour Signification
OFF Communication not initialized
RED Physical bus access error :
Check if the Profibus Connector is plugged or check the complete
Profibus wiring, termination resistor set at both ends…
GREEN Network ready

Meaning of LED B: communication status

Colour Signification
OFF Communication not initialized
RED Layer 2 error or Init error
Check the Profibus :
• Timing configuration.
• Profile chosen.
• Parameter configuration (HSA, TTR, TSLOT,..).
GREEN Communication ready

Note
For more information about troubleshooting your Profibus network, see
the chapter “In case of problems”.

Connecting a Profibus Network


The connection to the PROFIBUS network is made by a female D-Sub 9-pin connector ready to be
directly connected to the protocol line.

Environmental specifications
Storage temperature: -20°C to 70°C
Operating temperature: 0°C to 55°C
Humidity: 5% to 95% RH non-condensing
Typical Current Draw for USB connection: 350mA
Power on Profibus connector: 100mA maximum
Galvanic isolation: 500V (UTE C93-703 rules)

Profibus DRL-MPI-USB DRL-PFB-USB 11 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


4. Implementation of a Profibus configuration

• Launch the configuration console from the start menu

• Select the DRL-MPI-USB or DRL-PFB-USB solution with the menu Description / Add a
board or with the button

• Then, configure Profibus master’s parameters. For that, Double-click on the icon
symbolizing the master in the Protocol view.

Profibus DRL-MPI-USB DRL-PFB-USB 12 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


The following dialog box is displayed:

• Configure the parameters according to your master configuration. Help for each field is
available directly in the Configuration console in the description field.

• to configure the remote devices, two configuration methods are possible:

Automatic devices detection:


Your BradCommunications USB100PFB module must be already connected to your
Profibus network and the station numbers and speeds of your devices are correctly set on
your devices.
Choose the “Network detection” tab in the “Resources” area.

Activate the network detection with the menu command “Network/Read network
configuration… ” or with the button

Profibus DRL-MPI-USB DRL-PFB-USB 13 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


A minimum configuration is then loaded to initiate the Profibus communication.
The 126 possible station addresses are now scanned and each detected station is
inserted in the Network Detection view
All the detected devices can then be added in your configuration with the menu
Network/Insert and replace all or with the button. The devices can also be
added individually, by Drag&Drop, from the Network detection tab to the
configuration area.

Note
To be able to insert a DP device in the configuration, you must own its
GSD description file. This GSD file, provided by your device
manufacturer, must be inserted previously in the Device Library of the
configuration console
see also the “implementation” manual

When adding a detected device other than Profibus DP in the Protocol view, a
dialog box appears enabling you to specify the type of messaging to use :

Note
All kinds of Profibus stations are always detected (DP, S5, S7,…
devices). Stations not supported by the DRL-MPI-USB solution should
not be inserted when this solution is used.

Profibus DRL-MPI-USB DRL-PFB-USB 14 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Manual devices configuration:

Your BradCommunications USB100PFB module is not yet linked to your Profibus network, but you
know the devices to be configured.

Note
To be able to insert a DP device in the configuration, you must own its
GSD description file. This GSD file, provided by your device
manufacturer, must be inserted previously in the Device Library of the
configuration console
see also the “implementation” manual

Choose the Equipment library tab in the Resources area.

Select the device to be added.


Drag & Drop the device from the Resources area to the configuration area or use
the insert button
The properties page of the Profibus device is opened automatically, so that you can
set the station number and the other parameters. When you validate this page the
device is added to the configuration.
Repeat the procedure for all the devices to insert..
For each device type (DP, S5, S7, etc), you can refer to the corresponding chapter in
this manual to find a description of the main required parameters.

Profibus DRL-MPI-USB DRL-PFB-USB 15 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


5. MPI / S7 messaging.

Description of MPI (Multi-Point-Interface) messaging


The MPI physical interface is based on PROFIBUS (RS485, pinout compliant with standard DIN
19245 part 1). MPI is a messaging designed originally to connect the PG interface (programming
console). MPI is similar to S7 messaging with fixed parameters.
The DRL-MPI-USB and DRL-PFB-USB solutions are always client of the exchanges and the PLCs
are always servers. The network address and the highest MPI address (HSA) of the PLCs are defined
using SIEMENS STEP 7 software. By default, the PLCs are set at address 2 at factory and the
transmission speed is at 187.5 kbauds.

The use of Siemens item descriptors is identical in MPI and S7.

Description of S7 messaging
Using the S7 messaging, it releases the PG interface (MPI port) by connecting directly on any
Profibus coupler socket of the S7 PLC. S7 functions allow PLCs to communicate together in client and
server mode, up to 12 Mbs transmission speed. This S7 messaging allows a direct access to the S7 CPU
memory tags.

Profibus DRL-MPI-USB DRL-PFB-USB 16 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Devices parameters

Topic Name:
The name of the topic. This name is used in Data servers (OPC, PCDDE, …) to
access the device.
Number:
Number affected to this device.
Comment:
Describes the device
Station Address
Profibus station address configured on the device
If the Link parameter box is checked, you cannot change this value which is set
identical to the device number
Local SAP:
Local SAP must be different to Station Address. It must be different for each devices.
The maximum value is 53. So, only 54 devices (SAP 0 to 53) could be accessed.
When a new device is inserted in the configuration, the local SAP is automatically set
to the station address + 1 (only if the station address is less than 52)
Link parameters
Station Address is automatically set according the Number parameter.
Active Configuration
Activate the device configuration in the applicom® interface: used to delete a device
from the applicom® interface while keeping its configuration in the console.

Note
Not all parameters are described in this documentation. For more information
on each parameter, refer to description field in the configuration console.

Profibus DRL-MPI-USB DRL-PFB-USB 17 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


MPI/S7 messaging supported features
The variables and functions available via the MPI/S7 messaging are listed in the table below.
The address of the variable accessed must be in some cases calculated by referring to the
Addressing column in the table.

Variable Addressing Exchange type PLC function


S7-300 S7-400 (library/DLL access)
My.z y*8+z Read bits READPACKBIT
DBx.DBXy.z x*524288+y*8+z Write bit WRITEPACKBIT
Ey.z y*8+z Read input bits READPACKIBIT
Ay.z y*8+z Read output bits READPACKQBIT
Write output bits WRITEPACKQBIT
MBy y Read bytes READPACKBYTE,READBYTE
DBx.DBBy x*65536+v Write bytes WRITEPACKBYTE,WRITEBYTE
EBy y Read input bytes READPACKIBYTE,READIBYTE
ABy y Read output bytes READPACKQBYTE,READQBYTE
Write output bytes WRITEPACKQBYTE,WRITEQBYTE
MWy y Read words READWORD
DBx.DBWy x*65536+y Write words WRITEWORD
Ewy y Read input words READIWORD
Awy y Read output words READQWORD
Write output words WRITEQWORD
MDy y Read double words READDWORD
DBx.DBDy x*65536+y Write double words WRITEDWORD
MDyF y Read floating words READFWORD
DBx.DBDyF x*65536+y Write floating words WRITEFWORD
Tn n Read timers READTIMER
Write timers WRITETIMER
Zn n Read counters READCOUNTER
Write counters WRITECOUNTER

x DB number
y: Byte number
z: Number of the bit in the byte (0 to 7).
n : No. of the timer or of the counter (0 to 99)

Addressing limits:

Each DB variable can be addressed from byte 0 to byte 65535.


For the DB bits, only DBs numbered from 1 to 8191 can be addressed.
For the bytes, words, double words and floating words, only DBs from 1 to 32767 can be
addressed.

Remarks:
The PROFIBUS S7 communication is currently validated on couplers CP 342-5 and CP
443-5.
Only the current value (CV) of the timers and counters can be accessed (read and write).

Profibus DRL-MPI-USB DRL-PFB-USB 18 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Data alignment
The variables of PLCs in the SIEMENS S7 range are byte-ordered both in memento and DB areas.

By default, any read request of words , double words or floating words will return an arry of
consecutive data in memory. So,
- if you read two words, starting a word MW1, the word MW1 and MW3 will be returned
(build respectively with bytes MB1-MB2 and MB3-MB4)
- if you read two double words, starting a word MD2, the double words MD2 and MD6 will be
returned (build respectively with bytes MB2 to MB5 MB2 and MB6 to MB9)

In order to simplify your application’s design and also to optimize communication when OPC or
DDE servers are used, our recommendation is o leave the default options and
- to always use even addresses for word data ( MW0, MW2,…)
- to always use addresses multiple from 4 for double word and floating data (MD0, MD4,…)

However, you may need to access word, double words or floating words whose addresses are
aligned on even or odd addresses. To solve this problem, you can select the required addressing mode in
the configuration console (switched in “expert mode”), on byte, word or double word addresses. By
making a request to read several words, you can then access a table of words irrespective of their
physical addresses.

Example 1: An application wants to read in a request the word MW11 and the word MW13 . It will
therefore use a read request from address 11.The response content will take the following form:

- if the alignment is on byte address

User array offset S7 mnemonic PLC physical address


0 MW11 11 and 12
1 MW12 11 and 13
2 MW13 13 and 14
3 MW14 14 and 15

- if the alignment is on word address

User array offset S7 mnemonic PLC physical address


0 MW11 11 and 12
1 MW13 13 and 14
2 MW15 15 and 16
3 MW17 17 and 18

Obviously, this addressing principle cannot be applied to writing several variables in a request.
Writing 2 words from address 11

User array offset S7 mnemonic PLC physical address


0 MW11 11 and 12
1 MW13 13 and 14

Profibus DRL-MPI-USB DRL-PFB-USB 19 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Example 2: An application wants to read in a request the double words MD10 and t MD16. It will
therefore use a read request from address 10.The response content will take the following form:

- if the alignment is on byte address

User array offset S7 mnemonic PLC physical address


0 MD10 from 10 to 13
1 MD11 from 11 to 14
2 MD12 from 12 to 15
3 MD13 from 13 to 16
4 MD14 from 14 to 17
5 MD15 from 15 to 18
6 MD16 from 16 to 19

- if the alignment is on word address

User array offset S7 mnemonic PLC physical address


0 MD10 from 10 to 13
1 MD12 from 12 to 15
2 MD14 from 14 to 17
3 MD16 from 16 to 19
4 MD18 from 18 to 21
5 MD20 from 20 to 23
6 MD22 from 22 to 25

- if the alignment is on double word address

User array offset S7 mnemonic PLC physical address


0 MD10 from 10 to 13
1 MD14 from 14 to 17
2 MD18 from 18 to 21
3 MD22 from 22 to 25
4 MD26 from 26 to 29
5 MD30 from 30 to 33
6 MD34 from 34 to 37

Writing 3 double words from address 10.

User array offset S7 mnemonic PLC physical address


0 MW10 from 10 to 13
1 MW14 from 14 to 17
2 MW18 from 18 to 21

Profibus DRL-MPI-USB DRL-PFB-USB 20 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Access via the OPC, DDE/SuiteLink and DAS servers
The "items of image variables" are all syntaxes which can be used to access the variables of a
device via the DDE/SuiteLink server, the DAS server or the OPC server. The list of items authorized for a
given device type is determined by a syntax descriptor. The most suitable syntax descriptor is by default
determined automatically by the server.

Advanced Note
You can however force the use of another descriptor (generally, the
standard descriptor, composed of generic syntaxes which can be used
irrespective of the protocol or the messaging. This descriptor can be set
using the advanced options – see your data server manual). Pay
attention however, the syntax descriptor also determines some request
optimization features related to the type of device targeted and the data
mapping of this device. If you change the default descriptor, some
device access optimizations will therefore be disabled, with a possible
loss of performance.

The Siemens S7 PLC descriptor allows you to use S7 syntaxes documented in the following table.

Siemens S7 PLC descriptor


This descriptor can be used for accesses to Siemens S7-300 and S7-400 PLCs using MPI and S7
messaging.
Variables Unitary mode Array/Matrix mode
Memento bits Mx.y Mx.y_n, Mx.y_n_l
Input bits Ex.y Ex.y_n, Ex.y_n_l
Output bits Ax.y Ax.y_n, Ax.y_n_l
Bits of bytes in the DBs DBx.DBXy.z DBx.DBXy.z_n, DBx.DBXy.z_n_l
Memento bytes MBx MBx_n, MBx_n_l
Bytes in the DBs DBx.DBBy DBx.DBBy_n, DBx.DBBy_n_l
Input bytes EBx EBx_n, EBx_n_l
Output bytes ABx ABx_n, ABx_n_l
ASCII string in the memento bytes M_MBx_n
ASCII string in the DB bytes M_DBx.DBBy_n
Words in the mementos MWx MWx_n, MWx_n_l
Words in the DBs DBx.DBWy DBx.DBWy_n, DBx.DBWy_n_l
Input words EWx Ewx_n, Ewx_n_l
Output words AWx Awx_n, Awx_n_l
Double words in the mementos MDx MDx_n, MDx_n_l
Double words in the DBs DBx.DBDy DBx.DBDy_n, DBx.DBDy_n_l
Floating words in the mementos MDxF MDxF_n, MDxF_n_l
Floating words in the DBs DBx.DBDyF DBx.DBDyF_n, DBx.DBDyF_n_l
Timers Tx Tx_n, Tx_n_l
Counters Zx Zx_n, Zx_n_l

Profibus DRL-MPI-USB DRL-PFB-USB 21 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


area Size/nb
mementos 65536 bytes 0 <= x <= 65535 0 <= y <= 7
DB 65536 bytes 1 <= x <= 32767* 0 <= y <= 65535 0 <= z <= 7
(32767 areas) *If z, then:
1 <= x <= 8191
inputs 65536 bytes 0 <= x <= 65535 0 <= y <= 7
Outputs 65536 bytes 0 <= x <= 65535 0 <= y <= 7
Timers 255 0 <= x <= 255
Counters 255 0 <= x <= 255

Remarks:

Warning
Use of String, array and Matrix modes requires some precautions due to data
alignment configuration (see previous chapter in this manual) .
For an alignment on byte addresses when reading 16-bit words or an
alignment on byte or word addresses when reading 32-bit words, the write
continues to use word addressing for the 16-bit words and double words for the
32-bit words. With array and matrix mode, an item symbolizing for example a
word array does not designate the same variables in write as in read.
Consequently, array and matrix mode can only be used in read.

Note
The limit values for parameters n and l depend on the protocol. With PCDDE,
however, they can never exceed 128 for the bits and the bytes, 64 for the
words, 32 for the double words and the floating words.

Profibus DRL-MPI-USB DRL-PFB-USB 22 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Frame size limits used in MPI/S7 messaging
Maximum number of variables per read exchange

Object Max. quantity in read


Alignment byte word double word
Bit 1600
Byte 200
Word 128 100
Double word, floating word 64 64 50
Timer/Counter 100

Notes
With the OPC, DAS or DDE/SuiteLink data servers, If you use the
default syntax descriptor (Siemens S7 PLC descriptor), the server will
make the optimizations for read access:
All the unitary data will be accessed by reading bytes ( so
200 bytes max by frame)
Others limitations applies only in case of arrays or strings.

With the OPC, DAS or DDE/SuiteLink data servers , the number


indicated for read frames corresponds to the maximum (imposed by
the server and/or the protocol) number of points which can be grouped
during the dynamic frame optimization carried out by the server.
However, this number may be reduced to adapt to a particular device,
by configuring the frame lengths in the topic (see Implementation
manual /Topic configuration /Advanced options in the documentation).

Maximum number of variables per write exchange

Object PCDDE DLL/OPC/DAS


Alignment
Bit 1 12
Byte 1 200
Word 1 100
Double word, floating word 1 50
Timer/Counter 1 100

Notes
With PCDDE, each variable writing results in the creation of a frame.

For OPC, see manual "OPC Server/Optimization of synchronous and


asynchronous requests"

Profibus DRL-MPI-USB DRL-PFB-USB 23 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration and settings of Siemens SIMATIC S7 devices with STEP 7
Configuration is carried out with Step7 software supplied by SIEMENS. For further information,
refer to SIEMENS documentation.

In the following example,


- the solution is client of a SIMATIC S7_400 PLC.
- CPU slot = 3

• You must first create a project in the environment.

• Then, declare the hardware configuration of your PLC. You will need to declare:
1 Rack
1 Power supply
1 CPU (note the slot number for the server device configuration)
1 Coupler "PROFIBUS" CP443-5.

Profibus DRL-MPI-USB DRL-PFB-USB 24 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


• Now click on the line corresponding to the coupler to choose its Profibus address.

• Click on "PROFIBUS"

Profibus DRL-MPI-USB DRL-PFB-USB 25 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


• Choose the following network profile

• Load the configuration in the PLC in “Stop" mode, then switch into "Run".
The green indicator lamps of the CPU and the coupler must be lit steady.
• The coupler is ready to operate and to be connected.

Note
When devices are disconnected from the network, communication
errors may occur (status 54 or 55 ). To avoid these problems, it is best
to choose the customized profile, and adjust the value of Tslot.

Profibus DRL-MPI-USB DRL-PFB-USB 26 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


6. MPI Slave messaging.

Description of MPI Slave (Multi-Point-Interface) messaging


The MPI Slave physical interface, only available in DRL PCNI solution, is identical to that of
PROFIBUS (RS485, pinout in compliance with standard DIN 19245 part 1). The transmission speed goes
from 9600 bits/s to 12 Mbits/s.
The DRL PCNI solution, which is always master, allows to communicate with SIEMENS PLCs of the
S7-200 family which are always slaves.
The network address, the transmission speed and the highest address of each PLC are defined by
using SIEMENS « STEP 7-Micro Win32 » software.

In MPI Slave, the used messaging is the S7 messaging embedded in DPV1 Class 2 exchanges.

Profibus DRL-MPI-USB DRL-PFB-USB 27 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Devices parameters

Topic Name:
The name of the topic. This name is used in Data servers (OPC, PCDDE, …) to
access the device.
Number:
Number affected to this device.
Comment:
Describes the device
Station Address
Profibus station address configured on the device
If the Link parameter box is checked, you cannot change this value which is set
identical to the device number
Link parameters
Station Address is automatically set according the Number parameter.
Active Configuration
Activate the device configuration in the applicom® interface: used to delete a device
from the applicom® interface while keeping its configuration in the console.

Note
Not all parameters are described in this documentation. For more information
on each parameter, refer to description field in the configuration console.

Profibus DRL-MPI-USB DRL-PFB-USB 28 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


MPI Slave messaging supported features
The functions managed by the choice of a PROFIBUS channel and a S7-200 device allow access
to the variables defined in the following table.
The address of the variable accessed must be in some cases calculated by referring to the
Addressing column in the table.

Variable Addressing Exchange type PLC function


S7-200 (library/DLL access)
My.z y*8+z Read bits READPACKBIT
SMy.z 10000+y*8+z Write bit WRITEPACKBIT
VBy.z 524288+y*8+z
Ey.z y*8+z Read input bits READPACKIBIT
Iy.z
Ay.z y*8+z Read output bits READPACKQBIT
Qy.z Write output bits WRITEPACKQBIT
MVy y Read bytes READPACKBYTE,READBYTE
SMy 10000+y Write bytes WRITEPACKBYTE,WRITEBYTE
VBy 65536+y
EBy y Read input bytes READPACKIBYTE,READIBYTE
IBy
ABy y Read output bytes READPACKQBYTE,READQBYTE
QBy Write output bytes WRITEPACKQBYTE,WRITEQBYTE
MWy y Read words READWORD
SMWy 10000+y Write words WRITEWORD
VWy 65536+y
EWy y Read input words READIWORD
IWy
AWy y Read output words READQWORD
QWy Write output words WRITEQWORD
MDy y Read double words READDWORD
VDy 65536+y Write double words WRITEDWORD
VFy 65536+y

y : Byte number.
z : Number of the bit in the byte (0 à 7).

Remarks :
The MPI Slave PROFIBUS communication is currently validated on couplers 215, 216, 221,
222, 224, 224XP, 226 on the EM277 Profibus DP

Profibus DRL-MPI-USB DRL-PFB-USB 29 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Access via the OPC and DDE/SuiteLink servers
The "items of image variables" are all syntaxes which can be used to access the variables of a
device via the DDE/SuiteLink server or the OPC server. The list of items authorized for a given device
type is determined by a syntax descriptor.
Depending on the configuration of each device, the most suitable syntax descriptor is by default
determined automatically by the server: Consequently, with MPI Slave messaging, this descriptor allows
you to use syntaxes documented in the next chapter.

Advanced Note
You can however force the use of another descriptor (generally, the
standard descriptor, composed of generic syntaxes which can be used
irrespective of the protocol or the messaging. This descriptor can be set
using the advanced options – see your data server manual). Pay
attention however, the syntax descriptor also determines some request
optimization features related to the type of device targeted and the data
mapping of this device. If you change the default descriptor, some
device access optimizations will therefore be disabled, with a possible
loss of performance.

Siemens S7 PLC descriptor

This descriptor can be used for accesses to Siemens S7-200 PLCs.

Data type Unitary mode Array/Matrix mode


Memento bits Mx.y Mx.y_n, Mx.y_n_l
Bits of Special Marker SMx.y SMx.y_n, SMx.y_n_l
Bits in the VB VBx.y VBx.y_n, VB x.y_n_l
Input bits Ex.y Ex.y_n, Ex.y_n_l
Ix.y Ix.y_n, Ix.y_n_l
Output bits Qx.y Qx.y_n, Qx.y_n_l
Ax.y Ax.y_n, Ax.y_n_l
Bytes of Special Marker SMx SMx_n, SMx_n_l
Bytes in the VB VBx VBx_n, VBx_n_l
Octets dans la zone V des mémentos MVx MVx_n, MVx_n_l
Input bytes EBx EBx_n, EBx_n_l
IBx IBx_n, IBx_n_l
Output bytes ABx ABx_n, ABx_n_l
QBx QBx_n, QBx_n_l
ASCII string in the memento bytes M_MBx_n
ASCII string in the SM bytes M_SMx_n
ASCII string in the VB bytes M_VBx_n
Words in the mementos MWx MWx_n, MWx_n_l
Words in the Special Marker SMWx SMWx_n, SMWx_n_l
Words in the VW VWx VWx_n, VWx_n_l
Input words IWx IWx_n, IWx_n_l
EWx EWx_n, EWx_n_l

Profibus DRL-MPI-USB DRL-PFB-USB 30 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Output words QWx QWx_n, QWx_n_l
AWx AWx_n, AWx_n_l
Double words in the mementos MDx MDx_n, MDx_n_l
Double words VDx VDx_n, VDx_n_l
Floating words VFx VFx_n, VFx_n_l

area Size/nb
mementos 65536 bytes 0 <= x <= 65535 0 <= y <= 7
Inputs 65536 bytes 0 <= x <= 65535 0 <= y <= 7
Outputs 65536 bytes 0 <= x <= 65535 0 <= y <= 7

Warning
Use of String, array and Matrix modes requires some precautions due to data
alignment configuration (see previous chapter in this manual) .
For an alignment on byte addresses when reading 16-bit words or an
alignment on byte or word addresses when reading 32-bit words, the write
continues to use word addressing for the 16-bit words and double words for the
32-bit words. With array and matrix mode, an item symbolizing for example a
word array does not designate the same variables in write as in read.
Consequently, array and matrix mode can only be used in read.

Note
The limit values for parameters n and l depend on the protocol. With PCDDE,
however, they can never exceed 128 for the bits and the bytes, 64 for the
words, 32 for the double words and the floating words.

Profibus DRL-MPI-USB DRL-PFB-USB 31 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Frame size limits
Maximum number of variables per read exchange

Object Max. quantity in read


Alignment byte word double word
Bit 608
Byte 76
Word 38 38
Double word, floating word 19 19 19

Notes
With the OPC, DAS or DDE/SuiteLink data servers, If you use the
default syntax descriptor (Siemens S7 PLC descriptor), the server will
make the optimizations for read access:
All the unitary data will be accessed by reading bytes ( so
76 bytes max by frame)
Others limitations applies only in case of arrays or strings.

With the OPC, DAS or DDE/SuiteLink data servers , the number


indicated for read frames corresponds to the maximum (imposed by
the server and/or the protocol) number of points which can be grouped
during the dynamic frame optimization carried out by the server.
However, this number may be reduced to adapt to a particular device,
by configuring the frame lengths in the topic (see Implementation
manual /Topic configuration /Advanced options in the documentation).

Maximum number of variables per write exchange

Object PCDDE DLL/OPC/DAS


Alignment
Bit 1 5
Byte 1 76
Word 1 38
Double word, floating word 1 19

Notes
With PCDDE, each variable writing results in the creation of a frame.

For OPC, see manual "OPC Server/Optimization of synchronous and


asynchronous requests"

Profibus DRL-MPI-USB DRL-PFB-USB 32 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration and settings of Siemens SIMATIC S7-200 devices
Description
In this example, the solution is client of a SIMATIC S7-200 PLC

PLC configuration with STEP 7-Micro Win32


Configuration is carried out with Step7-Micro Win32 software supplied by SIEMENS. For further
information, refer to SIEMENS documentation.

Set the communication interface


First, set the communication interface with the PLC (Interface PG/PC) :
If the serial port of the computer is used with a RS232/PPI converter :

1. In the configuration panel, clic on « Set PG/PC Interface ».


2. In the « Access Point of the Application » list, choose « Micro/WIN => PC/PPI
cable(PPI) ».
3. Then in the list « Interface Parameter Assignement Used », choose « PC/PPI cable
(PPI) ».
4. The button « Properties… » allows to check the serial port parameters.

Step 7-Micro/Win is then ready to communicate with the S7-200 PLC.

Use of Step 7-Micro/Win


At the first start of Step 7-Micro/Win, create a new project.
Show the following window by clicking the button « System Block » :

Profibus DRL-MPI-USB DRL-PFB-USB 33 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Set the interfaces 0 and 1 according to S7-200 PLC used and according to the characteristics
of the Profibus Network.

Then load the configuration in the PLC. The green indicator lamps of the CPU and the coupler
must be lit steady. The coupler is ready to operate and to be connected, after running the launch file
"pcinit".

Profibus DRL-MPI-USB DRL-PFB-USB 34 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


7. S5 messaging

Description of S5 messaging
The S5 messaging developed by Siemens France uses the SDA services. This access is materialized by
a program section (supplied by us in the product) to be integrated in the Siemens PLCs. This program
consists of an FB(FB100). It is validated on the CPUs 928, 928B, 942, 943, 943B, 944, 944B, 945, 946,
947, 948, 948B and on the 95U. The solution is always client of the exchanges and the PLCs are always
servers.
S5 messaging is carried in the "Data" part of a PROFIBUS telegram. Management of this protocol is
completely transparent for product users.

A description of this protocol is provided below for information.

S 5 Byte 0 & 1
00 : Read Object type DB No. Byte 2 & 3
01 : Write (6 bits)
(2 bits) (If type 01 otherwise 0)
Address of first object Byte 4 & 5
Number of objects Message counter Byte 6 & 7

Object type:

Type Step5 object Description


01 DB Data block
02 M Internal variable (memento)
03 E Input
04 A Output
08 SY Internal variable (SMerker)
10 DX Extended data block

Profibus DRL-MPI-USB DRL-PFB-USB 35 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Devices parameters

Topic Name:
The name of the topic. This name is used in Data servers (OPC, PCDDE, …) to
access the device.
Number:
Number affected to this device.
Comment:
Describes the device
Station Address
Profibus station address configured on the device
If the Link parameter box is checked, you cannot change this value which is set
identical to the device number
Local SAP
SAP that transmits the request (0-53).
For the S5-115U/135U/155U :
- Local SAP must be different to physical PLC address
For the 95U:
- Local SAP = Physical PLC address (parameter TLN) + 1.
Remote SAP
For S5-115U/135U/155U
- Remote SAP = LSAP ( Service Access Point Local) cpu job.
For the 95U:
- Remote SAP = Physical address of the communication channel (parameter TS)
+1

Profibus DRL-MPI-USB DRL-PFB-USB 36 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Priority (in messaging parameters tab)
For S5-115U/135U/155U :
- Priority = LOW or HIGH
For the 95U:
- Priority = LOW (obligatory)
Caution: Priority must be identical between PLC and PC.
Link parameters
Station Address is automatically set according the Number parameter.
Active Configuration
Activate the device configuration in the solution: used to delete a device from the
solution while keeping its configuration in the console.

Note
Not all parameters are described in this documentation. For more information
on each parameter, refer to description field in the configuration console.

Profibus DRL-MPI-USB DRL-PFB-USB 37 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Supported features
The functions managed by the choice of a PROFIBUS Master channel allow access to the variables
defined in the following table.
The address of the variable accessed must be in some cases calculated by referring to the "Addressing"
column in the table.

Variable Addressing Exchange type PLC functions


Siemens (addr) (cyclic mode)
PLC
M v.w v*8+w Read bits READPACKBIT
S v.w idem+2097152 Write bits WRITEPACKBIT
DB x D y.z x*4096+y*16+z
DX x D y.z idem +1048576
MB v V Read bytes READBYTE
SY v v + 131072 Write bytes WRITEBYTE
MB v V Read packed bytes READPACKBYTE
SY v v + 131072 Write packed bytes WRITEPACKBYTE
MW v V Read words READWORD
SW v v + 131072 Write words WRITEWORD
DB x DW y x*256+y
DX x DW y idem + 65536
MD v v Read double words READDWORD
SD v v + 131072 Write double words WRITEDWORD
DB x DD y x*256+y
DX x DD y idem + 65536
MD v KG v Read floating words READFWORD
SDvKG v + 131072 Write floating words WRITEFWORD
DBxDDyKG x*256+y
DXxDDyKG idem + 65536
E v,w v*8+w Read input bits READPACKIBIT
EB v v Read input bytes READIBYTE
EB v v Read packed input bytes READPACKIBYTE
EW v v Read input words READIWORD
A v.w v*8+w Read output bits READPACKQBIT
Write output bits WRITEPACKQBIT
AB v v Read output bytes READQBYTE
Write output bytes WRITEQBYTE
AB v v Read packed output bytes READPACKQBYTE
Write packed output bytes WRITEPACKQBYTE
AW v v Read output words READQWORD
Write output words WRITEQWORD
TB n n Read timers READTIMER
Write timers WRITETIMER
ZB n n Read counters READCOUNTER
Write counters WRITECOUNTER
V : Byte No.
W : No. of the bit in the byte (0 to 7)
x : No. of the DB (1 to 255) or of the DX (0 to 255)
y : No. of the word in the DB or in the DX (0 to 255)
z : No. of the bit in the word (0 to 15)
n : No. of the timer or of the counter (0 to 255)

Profibus DRL-MPI-USB DRL-PFB-USB 38 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Caution:

The SMerkers and the DX cannot be accessed with all Siemens CPUs.

For access to words in the mementos or in the SMerkers, to input words and output words,
these words are accessed in a byte area, word 1 being composed of bytes 1 and 2, word 2
of bytes 2 and 3, etc. The words therefore overlap on each other.

For access to double words and floating words in the mementos or in the SMerkers, these
variables are accessed in a byte area, double word 1 being composed of bytes 1, 2, 3 and
4, double word 2 of bytes 2, 3, 4 and 5,… The variables therefore overlap on each other.

Profibus DRL-MPI-USB DRL-PFB-USB 39 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Descriptor for Siemens series 5 PLCs, German (D) and French syntax
This descriptor can only be used in the event of accesses to Siemens Simatic S5 PLCs in S5
messaging,

Unitary mode Array/Matrix mode


Memento bits Mx.y Mx.y_n, Mx.y_n_l
Smerker bits (internal bytes) Sx.y Sx.y_n, Sx.y_n_l
Input bits Ex.y Ex.y_n, Ex.y_n_l
Output bits Ax.y Ax.y_n, Ax.y_n_l
Bits of words in the DBs DBxDy.z DBxDy.z_n, DBxDy.z_n_l
Bits of words in the DXs DXxDy.z DXxDy.z_n, DXxDy.z_n_l
Memento bytes MBx MBx_n, MBx_n_l
Internal bytes (SMerkers) SYx SYx_n, SYx_n_l
Input bytes EBx EBx_n, EBx_n_l
Output bytes ABx ABx_n, ABx_n_l
ASCII string in the memento bytes M_MBx_n
ASCII string in the internal bytes M_SYx_n
(SMerkers)
Words in the mementos MWx MWx_n, MWx_n_l
Words in the Smerkers (internal bytes) SWx SWx_n, SWx_n_l
Input words EWx EWx_n, EWx_n_l
Output words AWx AWx_n, AWx_n_l
Words in the DBs DBxDWy DBxDWy_n, DBxDWy_n_l
Words in the DXs DXxDWy DXxDWy_n, DXxDWy_n_l
Right byte of a word in the DBs DBxDRy
Left byte of a word in the DBs DBxDLy
Right byte of a word in the DXs DXxDRy
Left byte of a word in the DXs DXxDLy
ASCII string in the DB words M_DBxDWy_n
ASCII string in the DX words M_DXxDWy_n
Double words in the memento bytes MDx MDx_n, MDx_n_l
Double words in the Smerkers (internal SDx SDx_n, SDx_n_l
bytes)
Floating words in the memento bytes MDxKG
Floating words in the Smerkers (internal SDxKG
bytes)
Double words in the DBs DBxDDy DBxDDy_n, DBxDDy_n_l
Double words in the DXs DXxDDy DXxDDy_n, DXxDDy_n_l
Floating words in the DBs DBxDDyKG
Floating words in the DXs DXxDDyKG
Timers TBx TBx_n, TBx_n_l
Counters ZBx ZBx_n, ZBx_n_l

Profibus DRL-MPI-USB DRL-PFB-USB 40 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


area Size/nb
mementos 256 bytes 0 <= x <= 255 0 <= y <= 7
SMerkers 4096 bytes 0 <= x <= 4095 0 <= y <= 7
DB (256 areas) 256 words 0 <= x <= 255 0 <= y <= 255 0 <= z <= 15
DX (256 areas) 256 words 0 <= x <= 255 0 <= y <= 255 0 <= z <= 15
Inputs 128 bytes 0 <= x <= 127 0 <= y <= 7
Outputs 128 bytes 0 <= x <= 127 0 <= y <= 7
Timers 128 0 <= x <= 255
Counters 128 0 <= x <= 255

Remark:
the limiting values of the parameters n and l depend on the protocol.

Profibus DRL-MPI-USB DRL-PFB-USB 41 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Descriptor for Siemens series 5 PLCs, English (GB) syntax
This descriptor can only be used in the event of accesses to Siemens Simatic S5 PLCs in S5
messaging

Unitary mode Array/Matrix mode


Memento bits Fx.y Fx.y_n, Fx.y_n_l
Smerker bits (internal bytes) Sx.y Sx.y_n, Sx.y_n_l
Input bits Ix.y Ix.y_n, Ix.y_n_l
Output bits Qx.y Qx.y_n, Qx.y_n_l
Bits of words in the DBs DBxDy.z DBxDy.z_n, DBxDy.z_n_l
Bits of words in the DXs DXxDy.z DXxDy.z_n, DXxDy.z_n_l
Memento bytes FYx FYx_n, FYx_n_l
Internal bytes (SMerkers) SYx SYx_n, SYx_n_l
Input bytes IBx IBx_n, IBx_n_l
Output bytes QYx QYx_n, QYx_n_l
ASCII string in the memento bytes M_FYx_n
ASCII string in the internal bytes (SMerkers) M_SYx_n
Words in the mementos FWx FWx_n, FWx_n_l
Words in the Smerkers (internal bytes) SWx SWx_n, SWx_n_l
Input words Iwx IWx_n, IWx_n_l
Output words QWx QWx_n, QWx_n_l
Words in the DBs DBxDWy DBxDWy_n, DBxDWy_n_l
Words in the DXs DXxDWy DXxDWy_n, DXxDWy_n_l
Right byte of a word in the DBs DBxDRy
Left byte of a word in the DBs DBxDLy
Right byte of a word in the DXs DXxDRy
Left byte of a word in the DXs DXxDLy
ASCII string in the DB words M_DBxDWy_n
ASCII string in the DX words M_DXxDWy_n
Double words in the memento bytes FDx FDx_n, FDx_n_l
Double words in the Smerkers (internal bytes) SDx SDx_n, SDx_n_l
Floating words in the memento bytes FDxKG
Floating words in the Smerkers (internal bytes) SDxKG
Double words in the DBs DBxDDy DBxDDy_n, DBxDDy_n_l
Double words in the DXs DXxDDy DXxDDy_n, DXxDDy_n_l
Floating words in the DBs DBxDDyKG
Floating words in the DXs DXxDDyKG
Timers TBx TBx_n, TBx_ n_l
Counters ZBx ZBx_n, ZBx_n_l

Profibus DRL-MPI-USB DRL-PFB-USB 42 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Area size
mementos 256 bytes 0 <= x <= 255 0 <= y <= 7
SMerkers 4096 bytes 0 <= x <= 4095 0 <= y <= 7
DB 256 words 0 <= x <= 255 0 <= y <= 255 0 <= z <= 15
DX 256 words 0 <= x <= 255 0 <= y <= 255 0 <= z <= 15
Inputs 128 bytes 0 <= x <= 127 0 <= y <= 7
Outputs 128 bytes 0 <= x <= 127 0 <= y <= 7
Timers 128 bytes 0 <= x <= 255
Counters 128 bytes 0 <= x <= 255

Remark:
the limiting values of the parameters n and l depend on the protocol.

Profibus DRL-MPI-USB DRL-PFB-USB 43 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Frame size limits
Maximum number of variables per read exchange

Object
Bit 1600
Byte 200
Word 100
Double word, floating word 50
Timer/Counter 100

Notes
With the OPC, DAS or DDE/SuiteLink data servers, If you use the
default syntax descriptor, the server will make the optimizations for
read access:
All the unitary data will be accessed by reading bytes in
memento and words in Data Blocks
Others limitations applies only in case of arrays or strings.

With the OPC, DAS or DDE/SuiteLink data servers , the number


indicated for read frames corresponds to the maximum (imposed by
the server and/or the protocol) number of points which can be grouped
during the dynamic frame optimization carried out by the server.
However, this number may be reduced to adapt to a particular device,
by configuring the frame lengths in the topic (see Implementation
manual /Topic configuration /Advanced options in the documentation).

Maximum number of variables per write exchange

Object PCDDE DLL/OPC/DAS


Bit 1 8 or 16 *
Byte 1 200
Word 1 100
Double word, floating word 1 50
Timer / Counter 1 100

Notes
With PCDDE, each variable writing results in the creation of a frame.

For OPC, see manual "OPC Server/Optimization of synchronous and


asynchronous requests"

Notes
* : A bit write request limited to a maximum of:
- 8 bits for a memento or a Smerker with start address modulo 8
- 8 bits for the outputs with start address modulo 8
-16 bits for a DB or a DX with start address modulo 16
Example:
You can force on an output board:
8 bits from address 0
7 bits from address 1
etc.

Profibus DRL-MPI-USB DRL-PFB-USB 44 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration and setting of PROFIBUS PLC couplers (SINEC® L2)
Connection between the computer and the SIEMENS PLC
The PC is connected to the SINEC® L2 bus via the board. A SIEMENS PLC is connected to the
SINEC® L2 network by installing a special communication processor, coupler CP 5430 TF or CP 5431
FMS, which is connected directly on the backplane bus of SIMATIC® S5 PLCs. The CP can be used with
all S5 systems as of S5 115U and better. There are two physical interfaces on the CPs, one to connect
the SINEC® L2 field network and the other to access the coupler configuration and setting. Traffic
management on the L2 network is processed independently by the CPs, so the CPU of the S5 PLC does
not have to perform this task.

Communication between the S5 processor and the communication coupler.

Communication between the PLC processor and the coupler is carried out via a dual port RAM
thereby ensuring very fast exchanges. This data exchange is carried out using communication blocks
which are PLC sub-programs partly supplied with the product. The CPUs supported are 95U, 928, 928B,
942, 943, 943B, 944, 944B, 945, 946, 947, 948, 948B.
These sub-programs are stored in directory install\simatic\simatic.s5 on the CD-ROM.

List of files contained in the directory install\simatic\simatic.s5 on the CD-ROM

L2BI55ST.S5D MS-DOS software for Siemens 155U PLC


L2RW15ST.S5D MS-DOS software for Siemens 115U PLC
L2RW35ST.S5D MS-DOS software for Siemens 135U PLC
L2RW95ST.S5D MS-DOS software for Siemens 95U PLC
L2RW945ST.S5D MS-DOS software for Siemens 945 PLC
S5\Q5431S5 Example file for configuration of the 5431 coupler with S5 messaging

If you use a PLC of type:


S5-115U, use file "L2RW15ST.S5D"
S5-135U, use file "L2RW35ST.S5D",
S5-115U with CPU 945, use file " L2R945ST.S5D ",
S5-95U, use file "L2RW95ST.S5D".

You must then transfer this file into the PLC CPU. When this block is called you must enter the following 3
parameters:

With S5-115U, S5-135U and S5-155U PLCs:


SSNR: same number as that defined by the COM 5430 in section "SYSID" or the COM
5431 in section Initialize CP.
ANR: same contract number as that defined by the COM 5430 in section "LINK" or the
COM 5431 in section "Layer 2 link free".
ANZW: address of the double status word associated with the connection. Format: KY
A,B with A= DB No. of the ANZW or 0 if memento.
With S5-95U PLCs:
ADDR: SINEC® L2 address of the PC
STBS: status byte of the SEND function
STBR: double status byte of the RECEIVE function.

Profibus DRL-MPI-USB DRL-PFB-USB 45 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Amongst the communication blocks used, a block is PLC standard type (SYNCHRON function for the
PLCs S5-115U/135U/155U ), and the other blocks are specific blocks developed by SIEMENS France

SYNCHRON
Initialization and synchronization between the CPU and the CP.

The SIEMENS specific program "FB100" is called.


L2@RW15 for the S5-115U PLC
L2@RW35 for the S5-135U PLC
L2@RW55 for the S5-155U PLC
L2@RW45 for the S5-115U PLC with CPU 945
L2@RW95 for the S5-95U PLC

This block calls the SEND and RECEIVE functions, a data block DB150.(not modifiable) and the
mementos MB255,MB0,MB1,MB2,MB3,(MW0 and MW2).

Remark: The " FB100 " of the S5-95U uses another specific program "FB101" integrated with file
L2RW95ST.S5D

SEND
Transmission of data from the processor of the S5 PLC to the communication coupler.

RECEIVE
Reception of data from the network to the PLC program via the communication coupler.

Remark:
The FB Server SINEC® L2 "FB100" is called in a given PLC cycle as many times as there different
connections to 1 or more PCs, referring to different contract numbers.

Example:
The following example shows how these function blocks must be called if you are using a PLC in
the S5-115U family. Note that the number of the function blocks differs from one type of PLC to another.
The SYNCHRON block must be called by the PLC program on each hot or cold restart of the PLC.

OB21 and OB22 (Organization blocks 21 and 22 )

SPA FB 249 ; Call block FB249.


NAME: SYNCHRON ; The console writes the block name.
SSNR: KY 0,0 ; Memory area reserved for coupler access.
BLGR: KY 0,0 ; Size of the data area used for CPU<->CP communication.
; 0 = maximum size.
PAFE: MB 255 ; Diagnostic byte.

In block OB1 you must call block FB100. This special block links the SINEC® L2 reception request
to the PLC data area.

Profibus DRL-MPI-USB DRL-PFB-USB 46 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Example on S5-115U/135U PLC:
OB1
:SPA FB100 ; This block is included in file L2RW15ST.S5D. Caution, this block
; uses the data blocks DB150, TRANSMISSION and RECEPTION.
NAME: L2@RW15
SSNR: KF +0 ; interface number defined by utility COM5430 or COM5431
ANR : KF +150 ; contract number defined by the utility COM 5430 or COM 5431
ANZW: KY 0,0 ; report

Example on S5-95U PLC:


OB1
SPA FB100 ; This block is included in file L2RW95ST.S5D. Caution, this block
; uses the data blocks DB150, TRANSMISSION and RECEPTION.
NAME: L2@RW95
ADDR: KF +1 ;SINEC® L2 address of PC=1
STBS: MB150 ; status byte SEND = MB150
STBR: MB151 ;double status byte RECEIVE = MB151 and MB152

Profibus DRL-MPI-USB DRL-PFB-USB 47 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration of the SIEMENS CP5430 with COM5430
Configuration is carried out with COM5430 software supplied by SIEMENS. When the software is
started and open, you must select F2 to configure each part of the CP5430 board. You must then
configure the system identification. In the section "SYSID" you must complete the SSNR number which is
passed in as parameter when calling the manager block FB100.
To configure the parameters of the SINEC® L2 bus, select "INIT". Now create a logical link with
"LINK". The following screen is displayed:

The Profibus protocol uses access to layer 2. The service used is SDA (Send Data with
Acknowledge).

TYPE
To define an access to layer 2, TYPE must be OUV.(link open)

PRIO
Access on SINEC® L2 can be defined in high or low priority.

SSNR
You must enter the SSNR (memory page area) (range of values 0 to 3)

ANR
Configurable as you choose, "job number" is used during direct accesses to layer 2, ANR
must be between 134-186., parameter ANR of the SIEMENS special block (FB100) must be
initialized to this value.

SAP
SAP (Service Access Point) is an address extension. All frames are received / transmitted by
this SAP.

Profibus DRL-MPI-USB DRL-PFB-USB 48 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration of CP 5430 TF for S5 Messaging

Configuration is carried out with COM 5430 TF software under SINEC® NCM supplied by
SIEMENS. When the software is started and open, you must configure each part of the CP 5430 board.
You must configure the system identification "SYSID" via the menu Edit\Init CP. In this section you must
enter the L2 address of the station, the station type (must be Active), the base No-Int, the number of
interfaces (CP5430) and parameters complementary to your project. You must now configure the network
parameters then create a logical link via the menu Edit\Links. Choose Free layer 2 link, the following
screen is displayed:

The Profibus protocol uses access to layer 2. The service used is SDA (Send Data with
Acknowledge).

Local station address


Write protected parameter indicating the address of the station being configured.

PRIO
Access on SINEC® L2 can be defined in high or low priority.

SSAP
Local Service Access Point is an address extension. All frames are received / transmitted by
this SAP.

No_I
You must enter the SSNR (memory page area) (range of values 0 to 0.3)

No_O
Configurable as you choose, "job number" is used during direct accesses to layer 2, No-O
must be between 134-186., parameter ANR of the SIEMENS special block (FB100) must be
initialized to this value.

Profibus DRL-MPI-USB DRL-PFB-USB 49 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration of CP 5431 FMS for S5 Messaging

A configuration example for the CP 5431 FMS coupler is provided in the directory
install\simatic\simatic.s5\s5 of the CD-ROM
Configuration is carried out with COM 5431 FMS software under SINEC® NCM supplied by
SIEMENS. When the software is started and open, you must configure each part of the CP 5431 board,
as below:

1) Configure the coupler identification via the menu Edit\initialize CP.In this section you must enter
the L2 address of the station, the station type (must be Active), the base SSNR, the number of
interfaces (CP5431) and parameters complementary to your project.

2) You must now configure the network parameters via menu Edit\Conf.Local-Networks. The
following screen is displayed:

3) Then create a logical link via menu Edit\Links. Choose Layer 2 link free, the following screen is
displayed:

Profibus DRL-MPI-USB DRL-PFB-USB 50 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


The Profibus protocol uses access to layer 2. The service used is SDA (Send Data with
Acknowledge).

Local L2 station address:


Write protected parameter indicating the address of the station being configured.

PRIO (H/L) :
Access on SINEC® L2 can be defined in high or low priority.

SSAP :
Local Service Access Point is an address extension. All frames are received / transmitted by
this SAP.

SSNR :
You must enter the SSNR (memory page area) (range of values 0 to 0.3)

ANR :
Configurable as you choose, "job number" is used during direct accesses to layer 2, ANR
must be between 134-186., parameter ANR of the SIEMENS special block (FB100) must be
initialized to this value.

Profibus DRL-MPI-USB DRL-PFB-USB 51 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration of the SINEC® L2 integrated interface of the S5-95U
Configuration is carried out via data block DB1 in section "SL2". No matter which transmission
mode is selected, you must define certain parameters in this section. To define the various fields, refer to
the manufacturer's documentation (ref. 6ES5-998-8MB31).

Block DB1 in L2RW95ST.S5D (section "SL2") :

156: KC =';# SL2: TLN 2 STA AKT';


168: KC =' BDR 500 HSA 10 TRT ';
180: KC ='30000 SET 1 ST 1000 ';
192: KC ='SDT 1 12 SDT 2 360 SF';
204: KC =' DB6 DW0 EF DB7 DW0 ';
216: KC =' KBS MB62 KBE MB63 ';
228: KC ='STBS 1 MB150 STBR 1 MB15';
240: KC ='1 STBS 3 MB160 STBR 3 MB';
252: KC ='161 ; END ';

Default parameters in file L2RW95ST.S5D:


TLN : 2 ; address of the 95U on the network
STA : AKT ; active station (mandatory)
BDR : 500 kbauds ; transmission speed
HSA : 10 ; highest station address of all active stations
TRT : 30000 ; Target-Rotation-Time
SET : 1 ; Setup-Time (dead time)
ST : 1000 ; Slot-Time (reception time-out)
SDT1 : 12 ; Protocol minimum processing time
SDT2 : 360 ; Protocol maximum processing time
STBS : 1 MB150 : Contract No. and status byte "Transmission"
STBR : 1 MB151 : Contract No. and status bytes "Reception" (2 bytes used)

The contract No. corresponds to parameter ADDR, remote station address (@ PC), passed in on
calling the function block FB100.
For further details on the DB1 parameters, refer to the manufacturer's documentation

Remarks:
The link type is AGAG.
The priority must be low (Caution! Make sure to define same priority on the PC side),
ADDR contract No. = SINEC® L2 address of the PC.

Profibus DRL-MPI-USB DRL-PFB-USB 52 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


8. PROFIBUS DP messaging

Description of Profibus DP-V0


The PROFIBUS DP field bus is based on the European standard EN 50170. PROFIBUS DP telegrams
can be used to transfer up to 244 bytes of data per telegram and connect to devices of address from 0 to
126. All data exchanges use the SAPs (Service Access Point). PROFIBUS DP uses SAPs from 54 to 62.

Our solutions include:

the class 1 DP master functionalities for optimized exchange of input/output data and equipment
diagnostics,

the class 2 DP master functionalities for access to equipment belonging to other masters and
reading the DP slave input/output configurations,

Multi-master operation, to enable several profibus masters to run on the same network (for
example: a class 2 DP master and a class 1 DP master). This operation is based on the token
ring. It is a logical ring where each master station passes in a defined order (of increasing
address), the token giving the right to transmit or pass its turn.

The information required for equipment configuration is contained in a file of type XXXXXX.GSD which is
supplied by the manufacturer. It is required to import the GSD file in the equipment library of the
configuration console..

The format of the GSD file is described in the standard EN 50170, volume 2, PROFIBUS.

Profibus DRL-MPI-USB DRL-PFB-USB 53 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Communication principle of DP messaging

Equipment dedicated to a single master


Communication between a DP master and the remote stations is in “ Polling ” mode (Data exchange). All
present equipments, dedicated to the master, are interrogated in a “ Polling ” cycle. As soon as the last
slave has been interrogated a new cycle starts. This method guarantees data update.

• Equipment initialization:
For the dedicated equipment, the DP master uses the function DDLM_Slave_Diag to detect the presence
of equipment connected on the network. On acknowledgment of this question the master transmits the
parameters entered or from the GSD files to the equipment with the function DDLM_Set_Prm. The
input/output configuration phase then takes place. With manual configuration, the configuration from the
configuration console is sent via the function DDLM_Chk_Cfg. For automatic configuration, the
configuration sent is that contained in the equipment; it is obtained by calling the function DDLM_Get_Cfg
(function class 2).

• Data access :
For dedicated equipment, the data exchange is cyclic. It is based on the Profibus DDLM_Data_Exchange
function. It is used to transmit to the equipment the output data and receive in return its input data. If the
equipment has inputs only, an empty frame is sent, if the equipment has outputs only an empty frame is
received.

Equipment shared between two masters

In multimaster configuration a DP slave can communicate with two masters:


One is the main master which configures and initializes the equipment, then makes the data exchanges
(DDLM_Data_Exchange). The equipment will then be considered by the master as being dedicated.
The other is a secondary master accessing in read the inputs/outputs via class 2 functionalities. The
equipment will then be considered by the master as being shared.

Example:

Master Master
1 2

4 5 6 7

In this configuration:
slaves 4 and 5 are dedicated to master 1,
slaves 6 and 7 are dedicated to master 2,
slave 5 is shared, the main master is master 1, the secondary master is master 2,
master 1 can read and write on equipment 5, whereas master 2 can simply read the slave's
input/output data.

Equipment initialization:

For shared equipment, initialization is carried out by the main master of the equipment. The mechanism is
then the same as for equipment dedicated to a single master

Profibus DRL-MPI-USB DRL-PFB-USB 54 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Data access :

For the main master, the equipment is seen as a dedicated slave. The mechanism is then the same as for
equipment dedicated to a single master

For the secondary master, the data exchange is acyclic. It is based on the Profibus class 2 functions
DDLM_Read_Input and DDLM_Read_Output. This operation does not allow writing of outputs. On
Profibus DP, only the main master can write the outputs.
The input/output data can be accessed in read by the same PLC functions as those used for the
dedicated slaves (ReadPackIByte, ReadPackQByte, etc.), and by the same DDE and OPC items.

Profibus DRL-MPI-USB DRL-PFB-USB 55 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Description of Profibus DP-V1
Profibus DP-V1 is an acyclic data transmission which allows configuration and calibration of field devices
during operation, as well as alarm acknowledgement. This acyclic transmission is parallel to the cyclic
communication (data-exchange), but has lower priority.

Profibus DP-V1 master, use the remaining time in the Profibus cycle or "dead time" to set up an acyclic
link with any slave. This acyclic exchange can therefore last for several polling cycles.

A Profibus DPV0 Class1 Master can open a DPV1 connection to its own slaves in Class1 mode or in
Class 2 mode.
A Profibus DPV0 Class2 Master can open a DPV1 connection to any slaves in Class 2 mode only!

A DPV1 Class 1 or Class 2 request consist to :


1. The DPV1 Master send a Read / Write request to a DPV1 Slave.
2. The DPV1 Master Polls the DPV1 Slave until the slave answers the request.

A Profibus DPV1 Class2 communication requests a connection between the Profibus DPV1 Class2
Master and the Profibus DPV1 Slave. This connection will then be maintained by the Profibus DPV1
master generating an idle request. To close the connection the master sends an abort request.

Dp master token Dp master


Class1 Class2

Dp slave 1 Dp slave 2 Dp slave 3

Dp slave 1 Dp slave 2 Dp slave 3 Dp slave 3


Cycle
Cyclic range ACyclic range

Profibus DRL-MPI-USB DRL-PFB-USB 56 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DP master supported features
The following DP characteristics are supported:
126 Profibus DP Slave/Master devices supported.
3070 Bytes of input data and 3070 Bytes of output data.
Standard Profibus line speed (9.6, 19.2, 45.45, 93.75, 187.5, 500 kb/s, 1.5, 3, 6, 12 Mb/s).

Master DPV0 Class1 and Class2

Service Class1 Class2


DDLM_DataExchange √ -
DDLM_Set_Prm √ -
DDLM_Chk_Cfg √ -
DDLM_Global_Control √ -
DDLM_Get_Cfg - √
DDLM_Set_Slave_Add - √
DDLM_Read_Input - √
DDLM_Read_Output - √
DDLM_Get_Master_Diag - Not supported
DDLM_Start_Seq - Not supported
DDLM_DownLoad - Not supported
DDLM_Upload - Not supported
DDLM_End_Seq - Not supported
DDLM_Act_Param_Brct - Not supported
DDLM_Act_Param - Not supported
DDLM_Slave_Diag - √

Master DPV1 Class1 and Class2

Services Class1 Class2


MSAC1_Read √ -
MSAC1_Write √ -
MSAL1_Alarm Not supported -
MSAL1_Alarm_Ack Not supported -
MSAC2_Initiate - Automatically
MSAC2_Read - √
MSAC2_Write - √
MSAC2_DataTransport - Not supported
MSAC2_Abort - √

Note :
- The MSAC2_Initiate service is automatically managed by the firmware,
the first DPV1 request will generate the connection if necessary.
- The DPV1 polling is automatically managed by the firmware.
- The DPV1 idle is automatically managed by the firmware.

Profibus DRL-MPI-USB DRL-PFB-USB 57 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DP slave supported features
Slave DPV0 Class1 and Class2

Service Class1 Class2


DDLM_DataExchange √ -
DDLM_Set_Prm √ -
DDLM_Chk_Cfg √ -
DDLM_Global_Control √ -
DDLM_Get_Cfg - √
DDLM_Set_Slave_Add - Not supported
DDLM_Read_Input - √
DDLM_Read_Output - √
DDLM_Get_Master_Diag Not supported -
DDLM_Start_Seq Not supported Not supported
DDLM_DownLoad Not supported Not supported
DDLM_Upload Not supported Not supported
DDLM_End_Seq Not supported Not supported
DDLM_Act_Param_Brct Not supported Not supported
DDLM_Act_Param Not supported Not supported
DDLM_Slave_Diag - √

Note :
The local slave does not support the DPV1 class1 and class2
functionality.

Profibus DRL-MPI-USB DRL-PFB-USB 58 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DP Slave configuration

Gsd Name:
Name of the GSD file.
Gsd Revision:
Version ID of the GSD file format.
Identification number:
The module identification number .It will be compared to the device on the network. If
they are different, the connection will be refused. This identification number is
provided in the GSD file.
Watchdog Control:
This parameter enables a remote station to switch into an error mode if no data has
been exchanged during this period (Bus Fault). The value 0 deactivates this
monitoring.
This value is a multiple of 100 ms.
Default value: 50.
MIN_TSDR
Minimum time between reception of the last bit of a telegram and transmission of the
first bit of the next telegram. This value is expressed in tBit.
The available range is from 11 to 255.
Default value: 11
Sync Mode:
Indicates that the device operates in Sync Mode as soon as the control command is
delivered by means of the DDLM_Global_Control function.

Profibus DRL-MPI-USB DRL-PFB-USB 59 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Freeze mode:
Indicates that the device operates in Freeze Mode as soon as the control command is
delivered by means of the DDLM_Global_Control function.
Profibus Group:
This parameter is used to define access groups at which this device belongs.
Shared Equipment:
This option must be activated when the device belongs to another DP master in the
network. This other master initializes the device and performs the data exchange with
this slave. However, via the product, you can access its inputs and outputs in read
using the class 2 functions (DDLM_Read_Input and DDLM_Read_Output).

Profibus DRL-MPI-USB DRL-PFB-USB 60 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


This window is used to build the IO configuration telegram. The list of IO modules is available when you
click on “Add” button. This list is filled from GSD file.

Warning:
The modules that you configure here should match exactly the physical setup
of your slave devices.

Profibus DRL-MPI-USB DRL-PFB-USB 61 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


If your device supports DPV1 functionality, a specific tab appears:

To use this Profibus DPV1 functionality, it is necessary to set True in “DPV1 Enable”. Using DPV1
commands without enabling this option will generate a status 46.

Remarks:

Note
Each parameter is described in the description field of the configuration
console.

Profibus DRL-MPI-USB DRL-PFB-USB 62 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus Local DP slave configuration
The PROFIBUS DP fieldbus is based on the European standard EN 50170. PROFIBUS DP
telegrams can be used to transfer up to 244 bytes of data per telegram and connect to devices of address
from 0 to 126. All data exchanges use the SAPs (Service Access Point). PROFIBUS DP uses SAPs from
54 to 62.

The Profibus DP slave includes:

• the class 1 DP functionalities for optimized exchange of input/output data and equipment
diagnostics,

- Get Cfg (SAP 59)


- Slave Diag (SAP 60)
- Set Prm (SAP 61)
- Ckk Cfg (SAP 62)
- Data Exchange

• the class 2 DP functionalities for access to equipment belonging to other masters and
reading the DP slave input/output configurations,

- Rd_inp (SAP 56)


- Rd_outp (SAP 57)

The information required for equipment configuration is contained in a file of type XXXXXX.GSD
which is supplied by the manufacturer.

The format of the GSD file is described in the standard EN 50170, volume 2, PROFIBUS.

Note
The remote master will include the applicom® DP slave in its configuration
through the use of the description files associated with the board used.

Card DRL-PFB-USB : BRAD0AB8.gsd

This file is available in the sub-directory “\Resources\Profibus GSD


Files\PCNI\DRL_PFB_USB\” where the DRL PCNI product is installed.

Profibus DRL-MPI-USB DRL-PFB-USB 63 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


- functionality

This functionality provides data exchange with a master in the network. The size of the input and
output data can be configured and enables all exchange combinations (0 to 244 bytes). The slave can
ensure data consistency up to sizes of 122 bytes.
Allocation of an equipment number during configuration enables access to data in the local slave
identically to that of a remote slave.

Caution:
Data transmitted by the remote master (output variables) refreshes the input variables of the
product.
The data received by the remote master (input variables) corresponds to the output variables of
the product.

applicom®
Library interface

DP Slave DP Master

Read functions INPUT INPUT


DATA DATA

Write functions
OUTPUT OUTPUT
DATA DATA

The statuses of functions guarantee refreshing of data with the remote master as long as it sets the
"Bus Time-out" (Watchdog control) parameter.

Profibus DRL-MPI-USB DRL-PFB-USB 64 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Configuration
The “General configuration” of the local slave Profibus DP device is used to validate the slave
mode of the solution.

» Equipment
Used to define the applicom® equipment number. This number is used by the application layers, in
association with the board number.
» Input size
Used to define the size of the inputs managed, in reception, by the local slave on the Profibus DP
network.
The available range is from 0 to 244 bytes.
Default value: 244
» Output size
Used to define the size of the outputs managed, in reception, by the local slave on the Profibus DP
network.
The available range is from 0 to 244 bytes.
Default value: 244
» Data format
Selects the memory representation of 16 and 32-bit words:
• Little Indian (Intel): In increasing address order: low order byte – high order byte.
• Big Indian (Motorola): In increasing address order: high order byte - low order byte.
Default value: Big Indian (Motorola).
» Description
Free text field, use it as required.

Profibus DRL-MPI-USB DRL-PFB-USB 65 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus master / slave DPV0 supported variables

DP Addressing Exchange type PLC functions


Variable (cyclic mode)
Input bits (BIx) x Read input bits READPACKIBIT
Output bits (BOx) x Read output bits READPACKQBIT
Write output bits WRITEPACKQBIT
Input bytes (OIx) x Read packed input bytes READPACKIBYTE
Output bytes (Oox) x Read packed output bytes READPACKQBYTE
Write packed output bytes WRITEPACKQBYTE
Input words (WIx) x Read input words READIWORD
Output words (WOx) x Read output words READQWORD
Write output words WRITEQWORD
Double input words (DIx) x+0x01000000 Read double input words READDWORD
Double output words (DOx) x+0x02000000 Read double output words READDWORD
Write double output words WRITEDWORD
Floating input words (FIx) x+0x01000000 Read floating input words READFWORD
Floating output words (FOx) x+0x02000000 Read floating output words READFWORD
Write floating output words WRITEFWORD
x : Variable number

The address argument of the read and write bit primitives is calculated according to the following
equation:
(number of byte transmitted * 8) + bit rank.

The address argument of the read and write byte, word, double word and floating word primitives
corresponds to the number of bytes transmitted

Remarks

The product uses the CSRD (DATA EXCHANGE) services which provide a means of refreshing
the inputs/outputs asynchronously with respect to your application. The read/write functions
therefore read and modify the buffers asynchronously with respect to the refresh cycle.
The SYNC commands can be used to synchronize the slaves according to events. If the line
" Sync_Mode_supp = 1 " appears in the GSD file, the checkbox in the configuration of the
configurator equipment will be checked.

Profibus DRL-MPI-USB DRL-PFB-USB 66 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Remarks concerning the variable access requests
The PROFIBUS DP standard does not specify the organization of data in a frame. For 16-bit word data,
the standard specifies that the high order byte is transmitted first. The software supports access to 16-bit
word data, to 32-bit word data and floating IEEE data.

Addressing mode of input/output bytes


The addressing mode is on byte (see following table).

Bit Byte
address address
0-7 0
8 - 15 1
16 - 23 2
24 - 31 3
32 - 39 4
40 - 47 5
48 - 55 6
56 - 63 7
... ...

Addressing mode of input/output words


The input and output words use byte addressing (see following table).

Bit Byte Word address


address address Even Odd
0-7 0 0
8 - 15 1 1
16 - 23 2 2
24 - 31 3 3
32 - 39 4 4
40 - 47 5 5
48 - 55 6 6
56 - 63 7 7
... ... ...

By configuration, when the console is switched in “expert mode” from menu “File\Preferences\Expert
Mode” in configuration console , two types of alignment can be used:

Alignment on word:
This mode returns, during a read of several words, contiguous words of even or odd
address.
Example:
A read of 3 words from address 0 will return words 0, 2 and 4.
A read of 3 words from address 1 will return words 1, 3 and 5.
During a write, the same addressing mode is applied.
Example:
A write of 3 words from address 0 will write words 0, 2 and 4.
A write of 3 words from address 1 will write words 1, 3 and 5.
Alignment on byte:
This mode offers the advantage, during a read of several words, of returning words of even
and odd address.
Example:
A read of 4 words from address 1 will return words 1, 2, 3 and 4.
During a write of several words, "alignment on word address" is always applied.

Profibus DRL-MPI-USB DRL-PFB-USB 67 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Addressing mode of input/output double or floating words
The input and output double or floating words use byte addressing (see following table).

Byte Double word


address addresses
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12
... ...

By configuration, when the console is switched in “expert mode”, three types of alignment can be used:
Alignment on double word:
This mode returns, during a read of several double words, contiguous double words with address
step of 4.
Example:
A read of 3 double words from address 0 will return double words 0, 4 and 8.
A read of 3 double words from address 1 will return double words 1, 5 and 9.
A read of 3 double words from address 2 will return double words 2, 6 and 10.
During a write of several double words, "alignment on double word address" is applied.
Alignment on word:
This mode returns, during a read of several double words, contiguous double words of even or odd
address.
Example:
A read of 3 double words from address 0 will return words 0, 2 and 4.
A read of 3 double words from address 1 will return words 1, 3 and 5.
During a write of several double words, "alignment on double word address" is applied.
Alignment on byte:
This mode offers the advantage, during a read of several double words, of returning double words
of even and odd address.
Example:
A read of 4 words from address 1 will return double words 1, 2, 3 and 4.
During a write of several double words, "alignment on double word address" is applied.

Profibus DRL-MPI-USB DRL-PFB-USB 68 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DP equipment descriptor

Input bits Unitary mode Array/Matrix mode


Input bits Bix BIx_n, BIx_n_l
Output bits Box BOx_n, BOx_n_l
Input bytes Oix OIx_n, OIx_n_l
Output bytes Oox OOx_n, Oox_n_l
Input words Wix WIx_n, Wix_n_l
Output words Wox WOx_n, Wox_n_l
Input internal double words Dix DIx_n, DIx_n_l
Output internal double words Dox DOx_n, DOx_n_l
Input internal floating words Fix FIx_n, FIx_n_l
Output internal floating words Fox FOx_n, FOx_n_l

X: rank of variable

Warning
String, array and Matrix modes require certain precautions in use. For
an alignment on byte addresses when reading 16-bit words or an
alignment on byte or word addresses when reading 32-bit words, the
write continues to use word addressing for the 16-bit words and double
words for the 32-bit words. With array and matrix mode, an item
symbolizing for example a word array (WOx_n_l) does not designate
the same variables in write as in read. Consequently, array and matrix
mode can only be used in read.

Profibus DRL-MPI-USB DRL-PFB-USB 69 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Frame size limit
Maximum number of variables per read exchange

Object DLL/OPC/DAS/PCDDE
Bit 1952
Byte 244
Word 122
Double word, floating word 61

Notes
With the OPC, DAS or DDE/SuiteLink data servers, If you use the
default syntax descriptor (itemdp.dll), the server will make the
optimizations for read access:
All the unitary data will be accessed by reading bytes
Others limitations applies only in case of arrays or strings.

With the OPC, DAS or DDE/SuiteLink data servers , the number


indicated for read frames corresponds to the maximum (imposed by
the server and/or the protocol) number of points which can be grouped
during the dynamic frame optimization carried out by the server.
However, this number may be reduced to adapt to a particular device,
by configuring the frame lengths in the topic (see Implementation
manual /Topic configuration /Advanced options in the documentation).

Maximum number of variables per write exchange

Object PCDDE DLL/OPC/DAS


Bit 1 1952
Byte 1 244
Word 1 122
Double word, floating word 1 61

Notes
With PCDDE, each variable writing results in the creation of a frame.

For OPC, see manual "OPC Server/Optimization of synchronous and


asynchronous requests"

Profibus DRL-MPI-USB DRL-PFB-USB 70 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Access to Specific Services of Profibus DP messaging (DPV0, DPV1)

To access to Profibus DPV1 Data or specific DPV0 functionality it is necessary to use the Service
interface only available as DLL command. These Service interface is not available over any of our
data servers like OPC, DDE, Suite/Link, DAServer.

This Service Interface can be accessed through the DLL Function : AuWriteReadMsg (for more
details about this function refer to the following chapter)

These specific Profibus DP services can also be used from the diagnostic tool via the tabs DP-V0,
DP-V1 C1 and DP-V1 C2.

Profibus DRL-MPI-USB DRL-PFB-USB 71 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


AuWriteReadMsg :
The "AuWriteReadMsg" function provides Profibus DP-V0 and DP-V1 services:
Get configuration from the device (Get Config).
Read input from the device (Read Input).
Read output from the device (Read_Output).
Read diagnostic function from the device (Slave Diag).
Write a command in the device (Global Control).
Configure the Profibus Address in a remote device (Set_Slave_Add)
DP-V1 Class1 Read and Write
DP-V1 Class2 Read and Write
DP-V1 Class2 Abort

This function requires the following 8 parameters:


wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the targeted device.
dwMsgParam: 32-bit word indicating the service.

Service Function
56 DPV0_C2_DDLM_Read_Input
57 DPV0_C2_DDLM_Read_Output
58 DPV0_C1_DDLM_Global_Control
59 DPV0_C2_DDLM_Get_Config
60 DPV0_C2_DDLM_Slave_Diag
0x10037 DPV0_C2_DDLM_Set_Slave_Add
67 DPV1_C1_MSAC1_Read
68 DPV1_C1_MSAC1_Write
69 DPV1_C2_MSAC2_Read
70 DPV1_C2_MSAC2_Write
72 DPV1_C2_MSAC2_Abort

wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.


lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

Profibus DRL-MPI-USB DRL-PFB-USB 72 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Diagnostic request
The function "AuWriteReadMsg" can be used to read the device diagnostic.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 60.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word

#include "applicom.h" /* Statement File*/

void DPV0_C2_DDLM_Slave_Diag(WORD wChan)


{
DWORD dwMsgParam = 60; /* SAP for Read Slave Diagnostic */
WORD wEquip; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Slave Diagnostic\r\n");

wEquip = (WORD)PrintAndScan("Equipment Number :","%u"); /* Get


equipment number */

AuWriteReadMsg (wChan, /* Channel number */


wEquip, /* number */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 73 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Read IO configuration
The function "AuWriteReadMsg" can be used to read the device configuration string.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 59.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/

void DPV0_C2_DDLM_Get_Config(WORD wChan)


{
DWORD dwMsgParam = 59; /* SAP for Read Configuration */
WORD wEquip; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Slave Configuration\r\n");

wEquip = (WORD)PrintAndScan(" Equipment Number :","%u"); /* Get


equipment number */

AuWriteReadMsg (wChan, /* Channel number */


wEquip, /* number */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 74 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Read all input data of a device
The function "AuWriteReadMsg" can be used to read all inputs data of a device.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel,
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 56.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to status 32-bit word

#include "applicom.h" /* Statement File*/

void DPV0_C2_DDLM_Read_Input (WORD wChan)


{
DWORD dwMsgParam = 56; /* SAP for Read Input */
WORD wEquip; /* number equip */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Slave Input\r\n");

wEquip = (WORD)PrintAndScan(" Equipment Number :","%u"); /* Get


equipment number */

AuWriteReadMsg (wChan, /* Channel number */


wEquip, /* number */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 75 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Read all output data of a device
The function "AuWriteReadMsg" can be used to read all outputs of a device.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 57.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word

#include "applicom.h" /* Statement File*/

void DPV0_C2_DDLM_Read_Output(WORD wChan)


{
DWORD dwMsgParam = 57; /* SAP for Read Output */
WORD wEquip; /* number Equip */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Slave Output\r\n");

wEquip = (WORD)PrintAndScan(" Equipment Number :","%u"); /* Get


equipment number */

AuWriteReadMsg (wChan, /* Channel number */


wEquip, /* number */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 76 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Transmit Global Control
The function "AuWriteReadMsg" can be used to transmit a global control.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 58.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. The first byte of this buffer must contain the
first byte of data corresponding global control service request.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/

void DPV0_C1_DDLM_Global_Control (WORD wChan)


{
DWORD dwMsgParam = 58; /* Set Global ctrl service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Set Global Ctrl\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

/* Get slave data length */;


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("New Global ctrl value :","%u");

AuWriteReadMsg (wChan, /* Channel number */


wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 77 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Read Class1 DPV1 data blocks
The function "AuWriteReadMsg" can be used to read data blocks in class1 DPV1
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 67.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/

void DPV1_C1_MSAC1_Read (WORD wChan)


{
DWORD dwMsgParam = 67; /* Read data block C1 service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Data Async\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

/* Get slave data length */;


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Slot Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Index Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Lenght Data :","%u");

AuWriteReadMsg (wChan, /* Channel number */


wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 78 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Write Class1 DPV1 data blocks
The function "AuWriteReadMsg" can be used to write data blocks in class1 DPV1
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 68.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/

void DPV1_C1_MSAC1_Write (WORD wChan)


{
DWORD dwMsgParam = 68; /* Write data block C1 service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */
WORD wLen;

printf("Write Data Async\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

/* Get slave data length */;


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Slot Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Index Number :","%u");
wLen = byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Lenght Data :","%u");

if (wLen)
{
if ( (wLen <= (244 -3)) )
{ /* Get slave data */;
GetData(&byTxBuf[wNbTx],wLen);
wNbTx += wLen;
}
else
{ /* length error */
printf("Error : \r\n%s \r\n",GetStatusDefinition(21));
return;
}
}

AuWriteReadMsg (wChan, /* Channel number */


wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
Profibus DRL-MPI-USB DRL-PFB-USB 79 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 80 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Read Class2 DPV1 data blocks
The function "AuWriteReadMsg" can be used to read data blocks in class2 DPV1
This function requires the following 8 parameters: The initiate frame is sending automatically. This
frame can be configured by the console of configuration.
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 69.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/

void DPV1_C2_MSAC2_Read (WORD wChan)


{
DWORD dwMsgParam = 69; /* Read data bloc C2 service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */

printf("Read Data Async\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

/* Get slave data length */;


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Slot Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Index Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Lenght Data :","%u");

AuWriteReadMsg (wChan, /* Channel number */


wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}}

Profibus DRL-MPI-USB DRL-PFB-USB 81 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Write Class2 DPV1 data blocks
The function "AuWriteReadMsg" can be used to write data blocks in class2 DPV1
This function requires the following 8 parameters: The initiate frame is sending automatically. This
frame can be configured by the console of configuration.
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 70.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/


void DPV1_C2_MSAC2_Write (WORD wChan)
{
DWORD dwMsgParam = 70; /* Write data bloc C2 service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */
WORD wLen;

printf("Write Data Async\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

/* Get slave data length */;


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Slot Number :","%u");
byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Index Number :","%u");
wLen = byTxBuf[wNbTx++] = (BYTE)PrintAndScan("Lenght Data :","%u");

if (wLen)
{
if ( (wLen <= (244 -3)) )
{ /* Get slave data */;
GetData(&byTxBuf[wNbTx],wLen);
wNbTx += wLen;
}
else
{ /* length error */
printf("Error : \r\n%s \r\n",GetStatusDefinition(21));
return;
}
}
AuWriteReadMsg (wChan, /* Channel number */
wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

Profibus DRL-MPI-USB DRL-PFB-USB 82 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


if (dwStatus == 0) /* get return status */
{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 83 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Abort Class2 DPV1 communication
The function "AuWriteReadMsg" can be used to abandon a class2 DPV1 type communication
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the number of the configured device.
dwMsgParam: 32-bit word initialized to the value 72.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/


void DPV1_C2_MSAC2_Abort (WORD wChan)
{
DWORD dwMsgParam = 72; /* Write data bloc C2 service */
WORD wEquip ; /* equipment number */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */
WORD wLen;

printf("Abort Data Async\r\n");

/* Get equipment number */


wEquip = (WORD)PrintAndScan(" Equipment Number :","%u");

AuWriteReadMsg (wChan, /* Channel number */


wEquip , /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

Profibus DRL-MPI-USB DRL-PFB-USB 84 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Address Change for a Station

The function "AuWriteReadMsg" enables the address of a Profibus DP station to be changed (Set
Slave Address) only on non-configured stations.
This function requires the following 8 parameters:
wChan: 16-bit word indicating the targeted channel.
wEquip: 16-bit word indicating the physical address of the targeted Profibus DP station.
dwMsgParam: 32-bit word initialized to the hexadecimal value 0x00010037.
wNbTx: Number of bytes to transmit to the lpbyBufTx buffer.
lpbyBufTx: Near pointer to the transmission buffer. Up to 244 bytes of data can be placed in the
transmission message.
pwNbRx: Near pointer to the number of bytes received. The return value indicates the number of
bytes received, if the variable indicated by pdwStatus is equal to zero.
lpbyBufRx: Near pointer to the reception buffer. Up to 244 bytes of data can be received in the
buffer.
pdwStatus: near pointer to an error status 32-bit word 1

#include "applicom.h" /* Statement File*/


void DPV0_C2_DDLM_Set_Slave_Add (WORD wChan)
{
DWORD dwMsgParam = 0x00010037; /* SAP to Set Slave Address */
WORD wTs; /* Station address */
WORD wNbTx = 0; /* Number of bytes to send */
BYTE byTxBuf[MAX_BUFFER_SIZE]; /* send buffer */
BYTE byRxBuf[MAX_BUFFER_SIZE]; /* receive buffer */
WORD wNbRx = sizeof(byRxBuf); /* number of bytes received */
DWORD dwStatus; /* return code */
WORD wIdentNumber;
WORD wLen;

printf("Set Slave Address\r\n");

/* Get station address */


wTs = (WORD)PrintAndScan("Current station address [0..126]:","%u");

/* Get New Station Address*/


byTxBuf[wNbTx++] = (BYTE)PrintAndScan("New Station Address [0..125]
:","%u");

/* Get Ident Number */


wIdentNumber = (WORD)PrintAndScan("Ident Number :","%u");
byTxBuf[wNbTx++] = wIdentNumber >> 8; /* Get Ident high */
byTxBuf[wNbTx++] = (BYTE)wIdentNumber; /* Get Ident low */

/* Get flag no address change*/


if (0 == PrintAndScan("No Address change [0..1] :","%u"))
byTxBuf[wNbTx++] = 0;
else
byTxBuf[wNbTx++] = 0xFF;

/* Get slave data length */;


wLen = (WORD)PrintAndScan("Slave Data len [0..237] :","%u");
if (wLen)
{
if (wLen <= 237)
{ /* Get slave data */;
GetData(&byTxBuf[wNbTx],wLen);

Profibus DRL-MPI-USB DRL-PFB-USB 85 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


wNbTx += wLen;
}
else
{ /* length error */
printf("Error : \r\n%s \r\n",GetStatusDefinition(21));
return;
}
}

AuWriteReadMsg (wChan, /* Channel number */


wTs, /* Station address */
dwMsgParam, /* service */
wNbTx, /* Number of bytes to send */
byTxBuf, /* send buffer */
&wNbRx, /* number of bytes received */
byRxBuf, /* receive buffer */
&dwStatus ); /* return code */

if (dwStatus == 0) /* get return status */


{ /* if no error */
printf("Response Len: %u Data: %s
\r\n",wNbRx,DumpData(byRxBuf,wNbRx));
}
else
{/* Error code analysis */
printf("Error : \r\n%s \r\n",GetStatusDefinition(dwStatus));
}
}

AuWriteReadMsg sample

A Sample is available in the Product installation directory under the following sub-directory:
"Development\Visual Studio\C\Example\Profibus\ProfibusDpAuWriteReadMsg"

It contains a source file in ANSI C: ProfibusDPAuWriteReadMsg.c, and an executable file:


ProfibusDpAuWriteReadMsg.exe.

To be integrated into a project or to be compiled, this file requires access to the following files: applicom.h
and applicom.lib

Profibus DRL-MPI-USB DRL-PFB-USB 86 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


9. In case of problems

Problems resolution

Problem Suggestions
The BradCommunications Verify that the USB cable is correctly inserted on the both sides
USB100PFB is connected to Bad USB cable. Test with the supplied cable if another one is
the machine but the LED near used
the USB connector remains off
The BradCommunications The computer doesn’t recognize the device.
USB100PFB is connected to The driver has not been installed. Run the installation program in
the machine but the LED near “modify mode” and select the S7, MPI on USB protocol
the USB connector remains Verify in the Windows Device Manager that the USB DC100
red Fieldbus adapter is present without error. If there is an error,
disconnect and reconnect the BradCommunications USB100PFB
on the computer, then “Scan for hardware change” in the Device
Manager. If the error persists, uninstall and reinstall the software
No device present after Check your Profibus configuration on devices (address, speed)
network detection. Check the Profibus cable.
Check the master settings in the configuration console.
or
see also in this manual:
Network detection indicates a General points about the Profibus protocol
network problem. Checking stations on the Profibus network
Checking the Profibus wiring
At least, one of the two leds Check your Profibus configuration on devices (address, speed)
near the Profibus connector is Check the Profibus cable.
not green Check the master and devices configuration in the console.
Also, check that the BradCommunications USB100PFB module is
usable with usb solution.

see also in this manual:


General points about the Profibus protocol
Checking stations on the Profibus network
Checking the Profibus wiring
A status 55 is returned to your if your transmission speed is lower than 187,5 Kbds, increase the
application “Request Time-out” parameter in the Master parameters
\Advanced Configuration tab

see also in this manual:


Profibus Status chapter in this manual.
General points about the Profibus protocol
Checking stations on the Profibus network
Checking the Profibus wiring

Profibus DRL-MPI-USB DRL-PFB-USB 87 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


A status 92 is returned to your Hardware has been unplugged during communication.
application Check the USB cable.
Also, check that the BradCommunications USB100PFB module is
usable with usb solution.

After correcting the problem, it will be necessary to initialize the solution by


running PCINIT, so that the status 92 or 93 disappears.
A status 93 appears in tools Driver not installed. You didn’t select the S7, MPI on USB
(readwait, writewait, …) protocol during installation, or you installed the solution on an
unsupported operation system (e.g. Windows NT4.0)

After correcting the problem, it will be necessary to initialize the solution by


running PCINIT, so that the status 92 or 93 disappears.

For additional status Additional status are detailed in the chapter 8 of this manual

Checking stations on the Profibus network


This chapter lists certain problems related to the configuration of Profibus stations. A Profibus
network consists of at least one bus segment and two stations. The stations are divided into two
families: the active stations (Masters) and the passive stations (Slaves): a Profibus network always
has at least one master station.
With the Profibus protocol, physical addresses from 0 to 126 can be used, to identify each station
on the network. By definition, the active stations have the communication initiative. However, in
order to control the bus access, access authorization (the token) is passed from a master station to
another master station in increasing address order. Only the station with the highest address
transfers the token to the station with the lowest address to close the logical token loop.

For a Profibus network to operate correctly, the following points must be respected:
Each station has a unique physical address.
All stations are set to the same transmission speed or can detect the speed used
automatically.
The highest station address (HSA) configured for each master station is greater than or
equal to the highest master station address.
The Slot time (TSL) of each master station is adapted to the network architecture. The
value of this parameter increases for networks with several master stations, long cable
lengths or which include the use of repeaters.
Inside the Console, in the network detection tab, the online action command allows you to check
quickly the list of passive and active stations connected on the network. This action can be
performed before to configure your device.

Profibus DRL-MPI-USB DRL-PFB-USB 88 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Checking the Profibus wiring
This chapter lists certain problems related to the use of a Profibus cable with copper conductors
assuming that the rules and directives contained in the standards concerned (standard EN50170,
EMC rules, etc.) are observed. Use of connectors dedicated to Profibus is essential (SUB D 9-pin
male connectors).
The integration of bus terminations on the connection equipment often leads to difficulties when
starting the network:
Either because of incorrect configuration of the terminations.
Or due to inversion of the cable in the connector.
A Profibus cable with copper conductors must have two bus terminations at the ends of each
network segment, as shown on the following figure:

RECEIVER

ACTIVE TERMINATION

Profibus DRL-MPI-USB DRL-PFB-USB 89 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Activation of a termination is accessible on each connector. A Profibus connector generally has a
switch, either directly visible, or connected to a tab as shown on the figure below:

ACTIVE TERMINATION

The station which has a termination activated must always be powered up.
A network operating correctly at 9.6 kbit without termination may have serious malfunctions at 1.5
Mbit since the risks of disturbance are greater at high speed.
The Profibus connectors are equipped with terminals to fit two cables. The position of the cable in
the connector is important. If the cable is not connected to the correct terminal, the PROFIBUS
network link will be considered as interrupted.

Profibus DRL-MPI-USB DRL-PFB-USB 90 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Token management using the Profibus protocol
There are 2 types of stations with different access rights
• The active stations:
They initiate exchanges.
• The passive stations:
They can only exchange data after having been invited by an active station.

Whether a station is active or passive depends on the device considered. Generally, simple field devices
such as motor controls are passive, whereas "intelligent" devices such as PLCs are active. Many devices
can be configured as either passive or active.

The DRL-MPI-USB and DRL-PFB-USB are active stations.

To prevent all the active stations accessing the bus at the same time, a station which wants to transmit
must wait until it has received authorization to access the bus. It receives this authorization in the form of
a special telegram, the "token".

• The token moves automatically from one active station to the next active station (in increasing
order of station address).

• The token is transmitted around a logical ring, i.e. the station with the highest address sends the
token to the station with the lowest address. Rule valid for each station: between transmission of
the token and reception of the token there is a token rotation cycle.

• Each active station "knows" the addresses of the other active stations. An active station checks
cyclically the range of addresses between it and the next active station. This range of addresses
is called the "GAP". During this check it detects the possible:
- Addition of an active or passive station.
- Deletion of a passive station.

The GAP is an update factor, it indicates the frequency where a new cycle of Fdl_status is sent. This
service builds a list of the active stations on network (LAS: list active stations).
If the check shows that a new active station has been added, the new station receives the token
immediately.

Two special cases result from this type of operation:

• If there is only one active station and all the other stations are passive, the network operates on
the master-slave principle.

• If all the stations are active, it is a purely token passage type network.

The figure shows a PROFIBUS network with 3 active stations and 3 passive stations.

1 2 3

4 5 6

Profibus DRL-MPI-USB DRL-PFB-USB 91 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Stations 1, 2 and 3 are active. The token will be transmitted as follows:
1 => 2 => 3 => 1 => 2 ...

The token rotation cycle takes a certain amount of time. The maximum token cycle time must be set in the
configuration console as the Target-Rotation-Time.
The value set for the Target-Rotation-Time (TTR) must be respected even when there is a large volume of
data to be transmitted. To respect this time, PROFIBUS adopts the following principle:

Each active station measures the time during which it did not have the token. This time represents for it
the effective token rotation time.
It compares this measured time with parameter TTR. The processing of the telegrams to be transmitted
depends on the result of this comparison and the link priority:
• Measured token rotation time < TTR:
All the existing transmission and reception contracts are executed until the TTR is reached or
until all pending contracts have been executed: firstly the contracts on the high priority links,
then the contracts on the low priority links.
• Measured token rotation time >= TTR:
A single high priority contract will be executed. The low priority contracts will only be
executed during subsequent token cycles, when the measured token rotation time is again
less than the TTR (Target Rotation Time).

Note :
All Profibus parameters are described in the configuration console (description
fields).

Profibus timing profiles

Profibus is a complex protocol where a lot of timing are used to handle properly the communication. A bad
timing can generate communication troubles.
When you configure your Profibus network in the configuration console, the product provides default
timing, depending as much as possible of your topology. These timings are estimated to provide the best
compromise for all active stations (master or client/ server) or passive stations (device) configured.
Profibus defines also some standard profiles (DP, universal,..) corresponding to different kinds of Profibus
station type. These profiles can be selected in our configuration console. Each profile will set the default
communication timing on the best way:
Profile DP
This profile should be chosen if your configuration contains only DP devices
Profile “MPI
This profile should be chosen if your configuration contains at least one S7-200 device
Profile Universal
This profile should be chosen for any other case (e.g. mix of different devices)

Profibus DRL-MPI-USB DRL-PFB-USB 92 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


However, even if the profile will set the more appropriated parameters by default, some communication
troubles can still happen. Indeed,
some particular devices can have specific behavior on the network (e.g S5 devices, VIPA
devices for S7,…)
The network can sometimes contains other Profibus devices not included in the
configuration
etc…

It can then normal to detect some communication problem after having configured your network and
initialized the solution.

Min slave interval


This parameter is used for Profibus DP. This time represents the minimum interval between two data-
exchanges on the same station. This is the time cycle.
This time is a minimum and is not guaranteed. If, there is too many stations included in the cycle, this time
couldn’t be respected. Smaller is this time, more the slave is solicited (quick data-exchanges).

In the case where only other messaging modes (S7, S5…) are used, this parameter is not used in the
same way, This time will then be used by our product to regulate the FDL_status sends. it should be then
set to largest time (set to 20, 2ms) because this service can to perturb some other stations as Simatic S5.

Using MPI Socket.

If you use a MPI socket to communicate with a S7 PLC, even if the MPI profile has been selected both in
the PLC and in our configuration console, some communication troubles can appear.
Indeed, this profile can vary dramatically depending on the device.
So, if you encounter any communication problem , please refer to the technical note
“Technote_Troubleshooting - MPI messaging.pdf” available from the main installation directory.

Profibus DRL-MPI-USB DRL-PFB-USB 93 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


10. Returned status

The following status can be returned:

General status
0 No anomaly detected. The function was properly executed.
32 Bad parameter
Bad number of variables.
45 Initialize the interface before it is used by typing the Initialization command.
59 - Access denied.
- Access Rights not valid.
- Messaging not enabled.
In this case, please contact your product supplier.
66 Not enough hardware interface memory.
76 Bad firmware version.
In this case, please contact your product supplier.
92 - None detected USB100PFB module can be used by DRL-MPI-USB or DRL-PFB-USB.
- USB error between computer and USB100PFB module
After correcting the problem, you must reinitialize the solution by executing PCINIT
93 Driver access problem.
After correcting the problem, you must reinitialize the solution by executing PCINIT
255 Used by the PCDDE server. Initial value of the items "STATUS_READ" and "STATUS_WRITE". This value
indicates that no transaction has taken place between "PCDDE" and the interface.

Library specific statuses

-6 The TRANSCYC function (or TRANSCYCPACK) is used with a cyclic function number which was activated, but
which is no longer.
-5 The user program attempts to make a deferred transfer TRANSDIF (or TRANSDIFPACK) even though the
current deferred request is not finished.
-1 Deferred transfer request TRANSDIF (or TRANSDIFPACK) concerning a write which occurred correctly.
0 No anomaly detected. The function was properly executed.
1 Unknown function.
The function requested is not supported.
2 Bad address.
The address of the variable that you are soliciting is bad.
3 Bad data.
Additional information:
Function: BINBCD, BCDBIN.
- At least one of the values accessed is not in BCD format (0<= value <= 9999).
4 Inaccessible data.
32 Bad parameter passed to the function.
Bad number of variables.
35 Data not available in cyclic read.
Attempt to transfer data by TRANSCYC (or TRANSCYCPACK) before reading it in the device.

Profibus DRL-MPI-USB DRL-PFB-USB 94 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


40 Deferred read or write attempt by a task when the maximum number of tasks that can use deferred mode
simultaneously has been reached.
Another task must release resources by making an exitbus.
41 Deferred read or write attempt when the deferred request register is full.
Make deferred request transfers with TRANSDIF (or TRANSDIFPACK) in order to release the register (64
positions).
42 Attempted differed request transfer by TRANSDIF (or TRANSDIFPACK), even though the latter is empty (no
differed requests in progress).
Remark: Negative statuses are information codes.

Statuses relating to the Profibus protocol

0 No anomaly detected. The function was executed correctly.


1 Unknown function.
The function requested is not supported.
2 Bad address.
The address of the variable that you are soliciting is bad.
3 Bad data.
Additional information:
Function: BINBCD, BCDBIN, READWORDBCD, WRITEWORDBCD.
- At least one of the values accessed is not in BCD format (0<= value <= 9999).
4 Inaccessible data.
6 Layer 2 negative acknowledgement by the device (NACK).
10 Layer 2 negative acknowledgement by the device (NACK).
Additional information:
PROFIBUS protocol:
- UE (User Error), Error in the remote device.
11 Layer 2 negative acknowledgement by the device (NACK).
PROFIBUS protocol:
- RR (Remote Resource), Insufficient resource in the remote device.
Or initialization parameters invalid
12 Layer 2 negative acknowledgement by the device (NACK).
Additional information:
PROFIBUS protocol:
- RS (Remote Service), The layer 2 service used is not allowed on the SAP or the SAP is not
activated.
13 Layer 2 negative acknowledgement by the device (NACK).
Additional information:
PROFIBUS protocol:
- RDL (Response FDL/FMA1/2 Data Low), The resource of the remote device is insufficient to reply
in low priority.
14 Layer 2 negative acknowledgement by the device (NACK).
Additional information:
PROFIBUS protocol:
- RDH (Response FDL/FMA1/2 Data High), The resource of the remote device is insufficient to reply
in high priority.
15 PROFIBUS protocol:
- LS (Local Service), local SAP not activated.
16 PROFIBUS protocol:
- NO (Not Ok), Meaning depends on the layer 2 service.
One LSAP is identical to another LSAP on a different communication channel.

Profibus DRL-MPI-USB DRL-PFB-USB 95 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


21 PROFIBUS protocol:
- IR (Invalid parameter in Request),
Additional information:
TS applicom® = device address.
TS or device address > HSA
32 Bad parameter passed to the function.
Bad number of variables.
33 Response time-out fault.
34 Parity fault in reception or check word fault (CRC16, BCC).
Check the configuration of the channel and the target device.
Check the wiring (RC at end of line for the RS485).
36 Device not configured.
Define the device configuration with the console and reinitialize the product.
54 PROFIBUS protocol:
- The PROFIBUS channel address is not present in the logical ring.
55 Response time-out exceeded, message lost.
PROFIBUS protocol:
- Response time-out exceeded.
- if your transmission speed is lower than 187,5 Kbds, increase the “Request Time-
out” parameter in the Master parameters \Advanced Configuration tab.
65 Connection denied.
Additional information:
Bad wiring
Remote stations badly configured.
67 Additional information:

Profibus DRL-MPI-USB DRL-PFB-USB 96 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


11. Annex A: Detect USB capability of your PC

Note :The following annex is extracted from a Microsoft article.

Most desktop and laptop computers sold after 2002 are USB 2.0 enabled. USB 2.0 enabled
means that the computer has one or more USB-enhanced host controllers. To determine if your
computer running the Windows XP or Windows Server 2003 operating system has a USB-
enhanced host controller, follow these steps:

1. Start Device Manager. To do so, click Start, and then click Run. In the Open box, type
devmgmt.msc, and then click OK.

Figure 1. Starting Device Manager

2. In the Device Manager window, expand the Universal Serial Bus controllers node.
Look for a host controller with the word "Enhanced" in the title. If you find one, your system has
USB 2.0 capable ports and has the necessary host controller drivers.

Figure 2: Enhanced host controller with drivers loaded

Profibus DRL-MPI-USB DRL-PFB-USB 97 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


3. If you do not find an enhanced host controller in step 2, expand the Other Devices
section. Look for Universal Serial Bus (USB) Controller. If you find this item, your system has
USB 2.0 capable ports, but you need to install drivers for this host controller. If you do not find
this item, your system does not have any USB 2.0 ports.

Figure 3: Enhanced host controller without drivers loaded

Do I need to install drivers for my enhanced (USB 2.0) host controller?


- Windows 2000 Service Pack 4 (SP4)
- Windows XP SP1
- Windows Server 2003

Windows 2000 and Windows XP were released before USB 2.0 hardware was available, so
the drivers were released for those operating systems in the service packs. To install drivers,
follow these steps:

1. Follow the procedure described in the answer to the previous question to verify that your
computer has USB 2.0 ports that required you to install a driver for the enhanced host controller.

2. In the Device Manager window, expand the Other Devices section as explained under
the previous question, and then double-click Universal Serial Bus (USB) Controller.

Profibus DRL-MPI-USB DRL-PFB-USB 98 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


3. On the General tab of the Properties dialog box, click Reinstall Driver.

Figure 4. Properties window for EHCI with no drivers


4. In the Add New Hardware Wizard, select Install the software automatically (Recommended),
and then click Next. Continue with the wizard, accepting all default options, until you reach the last page
of the wizard, and then click Finish. You may have to restart your computer to finish the installation.

Profibus DRL-MPI-USB DRL-PFB-USB 99 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.


Profibus DRL-MPI-USB DRL-PFB-USB 100 18/12/2006

Copyright © 2006 Woodhead Software & Electronics. All rights reserved.

You might also like