Professional Documents
Culture Documents
Table 2-2
No. Tag Explanation
1. filllevel Filling level of the inspection shaft
2. pump_state Status of the pump of the inspection shaft
3. year Date at the time of the measured data acquisition
4. month
5. day
6. hour Time at the time of the measured data acquisition
7. minute
8. second
The process data listed here are in this document referred to as data record. The
time stamp is automatically written to the data record at the time of measured data
acquisition.
The time stamp used is always the UTC system time of the S7-1200 controller.
This system time is synchronized in 15 minute intervals using SINAUT Micro SC.
Copyright ¤ Siemens AG 2011 All rights reserved
Figure 2-6
Central Station
OPC Server
SINAUT MICRO SC
Properties – RS001
RS001
modem1
secret1
15 Minutes
Kommentare
The send and measured value acquisition cycle in this application example is
realized separately in order to prevent changing the sampling time of the measured
values in the send cycle during delays, e.g. through disconnection. This ensures
that on the server side a proof of the measured variables can be provided in the
correct temporal sequence.
Figure 2-7
Read Send
m. values m. values
P1
xx seconds
Acquisition cycle
Send cycle
yy seconds
Data record 50
…
….
Data record 2
Data record 1
Copyright ¤ Siemens AG 2011 All rights reserved
Using a FIFO(First In First Out) measured value buffer, differences between both
cycles are polled.
x If the send cycle is slower than the measured value acquisition cycle, more
than one process value frame can be sent at the planned sending time. The
correct order on message frame level is guaranteed due to the FIFO buffer.
x If the send cycle is faster than the measured value acquisition cycle, the
planned time of sending is cancelled and the send cycle starts fresh. This
should be prevented on a conceptual level beforehand Æ send cycle <=
measured value acquisition cycle
x If the send cycle is equal to the measured value acquisition cycle, precisely
one process value frame is always sent at the planned sending time.
Up to 50 data records can be filed in the measured value buffer. These data
records are stored non-volatile.
Figure 2-8
The size of the array fields can be adjusted and is only limited by the size of the
memory in the S7-1200 controller. Should the size be changed, the respective
parameters should be entered in function “B_add_record[FC8]” in network 3.
If the send cycle has expired, the oldest data record is fetched from the measured
value buffer and copied to the global data block “data_DB[DB144]” (see library
description chapter 1.5). This data record is only deleted from the measured value
buffer if the send process has been terminated successfully with this data record.
Table 2-3
No. Explanation
1
2
Copyright ¤ Siemens AG 2011 All rights reserved
3
4
5
6
7
8
No. Explanation
This global data block contains the measured value buffer. All tags in this DB are
7
declared non-volatile.
8 All tags required for the simulation of the inspection shaft are configured in this DB.
Modem tags
Table 2-4
No. Address assignment Description
1. MSC:[<stationname>]GPRSConnected x BOOL, Read only
x MD720-3 is connected with the central
station (GPRS connection active, login
parameters correct)
2. MSC:[<stationname>]PLCConnected x BOOL, Read only
x S7-1200 controller connected with the
central station (connection between
controller and modem is OK, controller
reacts to message frame of the central
station)
3. MSC:[<stationname>]SignalQuality x BYTE, Read only, values 0 to 31
x Receive intensity of GSM antenna at
the MD720-3
4. MSC:[<stationname>]BytesReceived x DWORD, Read only
x Counter value in MD720-3 for the total
of all received bytes
5. MSC:[<stationname>]BytesTransmitted x DWORD, Read only
x Counter value in MD720-3 for the total
of all sent bytes
6. MSC:[<stationname>]BytesTotal x DWORD, Read only
x Counter value in MD720-3 for the total
of sent and received data
7. MSC:[<stationname>]Firmware x STRING, Read only
x Firmware version of the modem
MD720-3 (e.g. 1.7.7)
x No 3 to 6. These tags are updated every hour. This given interval cannot be
influenced.
x No 7 to 8: these tags are transmitted only once when the remote station logs in
at the central station
x No 9 to 10: these variables can only be written. A READ-command to these
tags always returns the value “0”.
In the “Item Names” column you see the OPC-conform addressing of the modem
tags as it would have to be selected in other OPC clients as well. Station RS001
had previously been created in SINAUT Micro SC.
Control tags
Tags from the S7-1200 controller are addressed in the OPC client as follows:
x MSC:[<station_name>]DB1,<data_type><memory_address>.
The following OPC-conform address must be used for a floating point value at
address DBD0 in the S7-1200:
x MSC:[RS001]DB1,REAL0
The abbreviation “DB1” does not mean that the information origins from or has to
be written to the data block with the number 1.
The following data types can be addressed:
x B (bytes)
x W (word)
x D (doubleword)
x CHAR (byte)
x INT (word, signed)
x DINT (word, signed)
x REAL (floating point value)
x STRING (string with fixed length), example: MSC:[RS001]DB1,STRING30.12
x DT (date and time BCD format)
In the “Item Names” column you see the OPC-conform address of the control tag
as it would have to be selected in other OPC clients as well. Station RS001 had
previously been created in SINAUT Micro SC.
2.4 Archiving
Apart from the actual value visualization in the OPC client WinCC flexible it is
possible to archive the actual values using a VBA script. For this reason the current
time stamp at the time of measured value acquisition is sent as well as the process
values “filling level” and “pump status”.
In WinCC flexible the following script has been implemented.
Table 2-5
No. Explanation
2
Copyright ¤ Siemens AG 2011 All rights reserved
6
For the path for each tag to be archived later on is saved in WinCC flexible. This
1
enables the “SmartTags” to access the tag values later on.
2 Now the tag values are accessed. These values are saved in separate script tags.
The names for the *.csv-file are generated. Elements comprise the current data and
3
the station name to be able to assign the archive data records later on.
The generated file name is now compared with the already existing file names in the
4 storage path. If the file does not yet exist it is created. In each case the csv-file is
opened afterwards in order to enable the succeeding write process.
The data record separated by semi-colons containing the values “station”, “date”,
5
“time”, “FillLevel” and “PumpState” is now created.
6 In the last step the data record is written to the opened file and the file is closed.
This script is called at every value update of the seconds counter (part of the
transmitted time stamp). Thereby the script is informed of the folder structure and
possible prefixes in the name of the tags. This makes it possible to use the same
script for various tags and/or stations.