Documente Academic
Documente Profesional
Documente Cultură
Application Note
AN2005
Abstract
This application notes describe the connection of the DIMS Profibus converter to a S7 PLC and a DLS / FLS laser
distance sensor. The S7 sample project is also available for download on our web site
V1.00
Please check www.dimetix.com
for the latest version
This application note is provided as is without any warranty for any problems this sample may cause.
Copyright by Dimetix AG
www.dimetix.com
Table of Contents
1 Introduction...................................................................................................................................................................................................3
2 Structure.......................................................................................................................................................................................................3
2.1 Multi-Sensor Mode..............................................................................................................................................................................3
2.2 Connection of the Sensor with the DIMS.............................................................................................................................................3
3 FLS / DLS configuration..................................................................................................................................................................................4
3.1 Reset to factory default........................................................................................................................................................................4
4 Projection (S7 configuration)..........................................................................................................................................................................5
5 Project...........................................................................................................................................................................................................6
5.1 Description of the blocs.......................................................................................................................................................................6
5.2 Startup.................................................................................................................................................................................................6
5.3 Code: OB1...........................................................................................................................................................................................7
5.4 Tables of variables of the different functions........................................................................................................................................8
5.4.1 Table of variables of the function Initialization........................................................................................................................8
5.4.2 Table of variables of the function Clear/Stop ..........................................................................................................................8
5.4.3 Table of variables of the function Single Measurement...........................................................................................................8
5.4.4 Table of variables of the function Start Tracking......................................................................................................................8
5.4.5 Table of variables of the function Read Distance.....................................................................................................................9
5.5 Table of symbols...................................................................................................................................................................................9
6 Listings........................................................................................................................................................................................................10
7 Overview of the marker words....................................................................................................................................................................16
7.1 Sensor detection manual....................................................................................................................................................................16
7.2 Clear / Stop........................................................................................................................................................................................16
7.3 Distance Measurement.......................................................................................................................................................................16
7.4 Start Tracking with buffering..............................................................................................................................................................16
7.5 Read Distance....................................................................................................................................................................................16
Page 2 of 16
1 Introduction
To connect a FLS / DLS-Distance sensor with a Siemens S7 PLC over the Profibus, the DIMS Profibus Interface (Par
No. 500214) must be used. This example describe the configuration of the S7 PLC and the configuration of the
FLS / DLS Sensor.
Further additional explanations about the example are also included. The example is available for download on
www.dimetix.com.
It is essential, that you have some experience in programming of a Siemens S7 PLC and knowledge of the
Profibus.
2 Structure
The following diagram demonstrates the connection of the FLS / DLS Sensor, DIMS Profibus Interface and S7:
FLS/DLS Sensor
RS232/422
Lasersensor
Profibus
S7_PLC
S7
2.1
Profibus DP Master
Profibus DP
Multi-Sensor Mode
The DIMS is operated in Multi Sensor Mode. Additional information about this operation mode can be found in
the DIMS User Manual.
2.2
The following diagram shows the connection of a Distance Sensor with the DIMS Profibus Interface by RS422
interface.
DIMS
Profibus Interface
UB
0V
Rx Debug
Tx Debug
Profibus
X2
X1
Rx232
Tx232
AP-GND
Rx422+
Rx422Tx422+
Tx 422-
1 2 3 4
1
2
3
4
5
6
7
4
3
6
5
T+
TR+
R-
FLS / DLS
7,8
14,15
V+
V-
ID switch
Position 0
19200 Baud
7 Bit
even Parity
1 stop bit
24V
0V
Page 3 of 16
3.1
Reset switch
ID switch
Page 4 of 16
Slave address
After the projection of the DIMS Profibus Interface, upload the appropriate module.
Page 5 of 16
5 Project
The project includes all the necessary blocs for the operation of a FLS / DLS sensor.
5.1
The VAT-blocs are each the variable charts to their corresponding function.
OB1
FC1
FC2
FC3
FC4
FC5
SFC14
SFC15
5.2
VAT_Clear/Stop
VAT_Initailization
VAT_Read_Distance
VAT_SingleMeasurement
VAT_Start-Tracking
Startup
1. Connect the control, the DIMS Profibus Interface and the FLS / DLS sensor to the communication cables
and the appropriate electric power supply.
2. Set the address of the Profibus at the front side of the DIMS Profibus Interface. It has to correspond to
the S7-project.
3. Load all the blocs onto the control.
4. The inputs E0.1, E0.2, E0.3, E0.4 and E0.5 enable you now to preselect the function you wish.
Important! Preselect only one function at once!
A pulse at the input E0.0 activates the function. (see code OB1)
5. In the appropriate table of variables, all the data is visualized.
Page 6 of 16
5.3
Code: OB1
Page 7 of 16
5.4
Page 8 of 16
5.5
Table of symbols
Page 9 of 16
6 Listings
Page 10 of 16
Page 11 of 16
Page 12 of 16
Page 13 of 16
Page 14 of 16
Page 15 of 16
7.1
'i'
110
reserve
111
112
113
114
115
116
117
'i'
100
7.2
status info
(int 32 bit)
error number
101
102
103
104
105
131
132
133
134
135
106
107
Clear / Stop
'c'
130
ID
reserve
136
137
'c'
120
7.3
status info
121
(int 32 bit)
error number
122
123
124
125
152
153
154
155
144
145
126
127
Distance Measurement
'g'
150
ID
151
reserve
156
157
'g'
140
7.4
distance
141
(float 32 bit)
142
143
error number
147
146
'f'
170
time in ms
(int 32 bit)
ID
171
172
173
174
175
161
162
163
164
165
192
193
194
195
184
185
reserve
176
177
'f'
160
7.5
error number
167
166
Read Distance
'q'
190
ID
191
reserve
196
197
'0'
180
distance
181
(float 32 bit)
182
183
error number
186
187
Page 16 of 16