How to archive IEC104 variables with correct timestamps?

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
9 posts • Page 1 of 1
akcount
Posts: 6
Joined: Tue May 12, 2020 8:12 am

How to archive IEC104 variables with correct timestamps?

Post by akcount »

Hello, colleagues!

First of all, sorry for my English, it's not a native language. )

I have a Simatic ET200 CPU PLC with additional telecontrol CM. PLC is programmed as IEC104 server. Data buffering (in case of connection lost) enabled.

WinCC OA takes data from PLC, that's not a problem.

The problem is...

Now I have a goal to receive data from PLC and place it to archive with correct timestamp. But! After connection reestablished WinCC OA takes all data from PLC IEC104 buffer to arhive with "current system time" timestamp, not the timestamp of "real" event on the PLC side. I took a look at IEC104 protocol and I see, that PLC send correct timestamps (after connection reestablished) with cause of transmission 3 (spontaneous). In one IEC packed may by about 10-12 values of one IOA (of cause, with different values and different timestamps).

So the values takes place in trend with not corrent timestamp.

I tryed using config for [iec] section with COTuserbyte etc. Values now placed with correct timestamp (corr_value and corr_timestamp). But current values or original values does not change at all. Trends does not draw a line in a runtime, panel needs to be closed and opened again.

All of above is about WinCC 3.16

After this I tryed to use 3.17 version and NextGenArchive. With the same result. But for now I even dont try to use additional "iec userbyteCOT" config.

AFAIK there is not possible to read values this the timestamp in past, that is the limitation of EV. But the current timestamping is one of the most impotent things of IEC (and DNP, and ST7, and TCSB) protocol.

So... Final scream. HELP! )

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to archive IEC104 variables with correct timestamps?

Post by leoknipp »

In the Event Manager timestamps for original values have to be in the correct ascending time order. Writing an original value with a timestamp older than the time stamp for the last value is not possible.
To write older values correction values must be used, as it is done with the driver in your case.

After the connection is established and buffered data is received from the PLC do you get the newest value written as original values?

The behaviour you have described is not related to the archiving functionality.
In 3.17 when using NGA you have to take into account that currently the NGA does not support correction values.

Best Regards
Leopold Knipp
Senior Support Specialist

akcount
Posts: 6
Joined: Tue May 12, 2020 8:12 am

Re: How to archive IEC104 variables with correct timestamps?

Post by akcount »

Great! Lets have a look to protocol log. Log located in the end of this post.

First lines of log - normal data transition. This lines located before DISCONNECT string. Last timestamp and value of IOA 9 is
[9] 2020-05-14 06:11:32.492 11.455215

After re connection first transmitted value is
[9] 2020-05-14 06:11:30.086 99.459976

This is the value "in past" (I think because of acknowledge absent from OA). This timestamp is corrected to <current system time + 1 ms>?
All of the others values also have a invalid timestamp, Is see this on WnCC OA trend view.

Data transition log starts here:

Measured float with time response, Length 25 NS:27 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:21.057 56.352833

Supervisory transmit, Length 4 NR:28

Measured float with time response, Length 25 NS:28 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:21.659 59.228447

Measured float with time response, Length 25 NS:29 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:22.261 62.104061

Measured float with time response, Length 25 NS:30 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:22.862 64.978928

Measured float with time response, Length 25 NS:31 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:23.464 67.852348

Measured float with time response, Length 25 NS:32 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:24.066 70.725769

Measured float with time response, Length 25 NS:33 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:24.668 73.59919

Measured float with time response, Length 25 NS:34 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:25.269 76.47261

Supervisory transmit, Length 4 NR:35

Measured float with time response, Length 25 NS:35 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:25.871 79.346031

Measured float with time response, Length 25 NS:36 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:26.473 82.219452

Measured float with time response, Length 25 NS:37 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:27.077 85.092873

Measured float with time response, Length 25 NS:38 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:27.678 87.966293

Measured float with time response, Length 25 NS:39 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:28.281 90.839714

Measured float with time response, Length 25 NS:40 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:28.883 93.713135

Measured float with time response, Length 25 NS:41 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:29.485 96.586555

Supervisory transmit, Length 4 NR:42

Measured float with time response, Length 25 NS:42 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:30.086 99.459976

Measured float with time response, Length 25 NS:43 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:30.688 2.830018

Measured float with time response, Length 25 NS:44 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:31.289 5.705083

Measured float with time response, Length 25 NS:45 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:31.891 8.580149

Measured float with time response, Length 25 NS:46 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:32.492 11.455215

Supervisory transmit, Length 4 NR:47

Supervisory transmit, Length 4 NR:47

Connection dropped by remote station

DISCONNECT

Connected to remote station, 192.168.43.11:2404

STARTDT ACT request, Length 4

STARTDT CON response, Length 4

Interrogation request, Length 14 NS:0 NR:0
ASDU: 100 <Interrogation Command> Count 1
COT: 6 <Activation> Sector 1
[0] QOI: 20 <Station Interrogation>

Measured float with time response, Length 25 NS:0 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:30.086 99.459976

Measured float with time response, Length 25 NS:1 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:30.688 2.830018

Measured float with time response, Length 25 NS:2 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:31.289 5.705083

Measured float with time response, Length 25 NS:3 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:31.891 8.580149

Measured float with time response, Length 25 NS:4 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:32.492 11.455215

Measured float with time response, Length 25 NS:5 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:33.094 14.33028

Measured float with time response, Length 25 NS:6 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:33.696 17.205116

Supervisory transmit, Length 4 NR:7

Measured float with time response, Length 25 NS:7 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:34.297 20.079634

Measured float with time response, Length 25 NS:8 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:34.899 22.95915

Measured float with time response, Length 25 NS:9 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:35.502 25.833668

Measured float with time response, Length 25 NS:10 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:36.105 28.708185

Measured float with time response, Length 25 NS:11 NR:0
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:36.708 31.582703

Interrogation response, Length 14 NS:12 NR:1
ASDU: 100 <Interrogation Command> Count 1
COT: 7 <Activation confirmation> Sector 1
[0] QOI: 20 <Station Interrogation>

Measured float response, Length 18 NS:13 NR:1
ASDU: 13 <Measured float Information> SQ:0 Count 1
COT: 20 <Interrogated by general interrogation> Sector 1
[9] 50.416565

Supervisory transmit, Length 4 NR:14

Interrogation response, Length 14 NS:14 NR:1
ASDU: 100 <Interrogation Command> Count 1
COT: 10 <Activation termination> Sector 1
[0] QOI: 20 <Station Interrogation>

Measured float with time response, Length 250 NS:15 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 16
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:37.312 34.458157
[9] 2020-05-14 06:11:37.915 37.333771
[9] 2020-05-14 06:11:38.517 40.209385
[9] 2020-05-14 06:11:39.120 43.084999
[9] 2020-05-14 06:11:39.723 45.960613
[9] 2020-05-14 06:11:40.326 48.836227
[9] 2020-05-14 06:11:40.929 51.711842
[9] 2020-05-14 06:11:41.532 54.587456
[9] 2020-05-14 06:11:42.135 57.46307
[9] 2020-05-14 06:11:42.739 60.333683
[9] 2020-05-14 06:11:43.341 63.214298
[9] 2020-05-14 06:11:43.945 66.088318
[9] 2020-05-14 06:11:44.548 68.956741
[9] 2020-05-14 06:11:45.160 72.309898
[9] 2020-05-14 06:11:45.762 75.183319
[9] 2020-05-14 06:11:46.363 78.05674

Measured float with time response, Length 250 NS:16 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 16
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:46.965 80.930161
[9] 2020-05-14 06:11:47.568 83.803581
[9] 2020-05-14 06:11:48.171 86.677002
[9] 2020-05-14 06:11:48.774 89.550423
[9] 2020-05-14 06:11:49.377 92.423843
[9] 2020-05-14 06:11:49.980 95.297264
[9] 2020-05-14 06:11:50.583 98.170685
[9] 2020-05-14 06:11:51.186 1.539999
[9] 2020-05-14 06:11:51.789 4.415054
[9] 2020-05-14 06:11:52.394 7.29012
[9] 2020-05-14 06:11:52.996 10.165185
[9] 2020-05-14 06:11:53.599 13.040251
[9] 2020-05-14 06:11:54.201 15.915317
[9] 2020-05-14 06:11:54.805 18.78985
[9] 2020-05-14 06:11:55.408 21.664368
[9] 2020-05-14 06:11:56.011 24.538885

Measured float with time response, Length 145 NS:17 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 9
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:11:56.614 27.413403
[9] 2020-05-14 06:11:57.219 30.28792
[9] 2020-05-14 06:11:57.822 33.16288
[9] 2020-05-14 06:11:58.424 36.038494
[9] 2020-05-14 06:11:59.027 38.914108
[9] 2020-05-14 06:11:59.633 41.789722
[9] 2020-05-14 06:12:00.236 44.665337
[9] 2020-05-14 06:12:00.839 47.540951
[9] 2020-05-14 06:12:01.441 50.416565

Measured float with time response, Length 25 NS:18 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:02.112 53.772282

Measured float with time response, Length 25 NS:19 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:02.716 56.647896

Measured float with time response, Length 25 NS:20 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:03.318 59.52351

Supervisory transmit, Length 4 NR:21

Measured float with time response, Length 25 NS:21 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:03.920 62.399124

Measured float with time response, Length 25 NS:22 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:04.522 65.273766

Measured float with time response, Length 25 NS:23 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:05.124 68.147186

akcount
Posts: 6
Joined: Tue May 12, 2020 8:12 am

Re: How to archive IEC104 variables with correct timestamps?

Post by akcount »

leoknipp wrote: Wed May 13, 2020 5:49 pm
After the connection is established and buffered data is received from the PLC do you get the newest value written as original values?
The answer located above of this post.

Additional information.
Using [iec] config lines does not lead to success.
corr_time is also have a PC timsstamp, not iec protocol timestamp.

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to archive IEC104 variables with correct timestamps?

Post by leoknipp »

I do not know how to read the protocol log as it seems not to be log written by WinCC OA.

If the timestamp given by the PLC or if the system time is used depends on the configuration of the peripheral address.
When you to use the PLC timestamp you have to use a type where the text for the type contains the information "with time tag CP56Time2a".

Can you please check how your addresses are configured.

Best Regards
Leopold Knipp
Senior Support Specialist

akcount
Posts: 6
Joined: Tue May 12, 2020 8:12 am

Re: How to archive IEC104 variables with correct timestamps?

Post by akcount »

That's a third party IEC104 client log. Standart protocol parser.

According to this log my IOA 0/0/9 configuired as ASDU 36: single float with timestamp

Measured float with time response, Length 25 NS:21 NR:1
ASDU: 36 <Measured float Information with time> SQ:0 Count 1
COT: 3 <Spontaneous> Sector 1
[9] 2020-05-14 06:12:03.920 62.399124

Let's take a look at ASDU description (going to googling for 15 seconds). OK, let it be beckhoff web site )
https://infosys.beckhoff.com/english.ph ... iew.htm&id
M_ME_TF_1 36 0x24 Measured value, short floating point number with time tag CP56Time2a

Of course, my PLC configuired to short float with CP56Time2a.

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to archive IEC104 variables with correct timestamps?

Post by leoknipp »

You have to check the configuration of the _address configs in WinCC OA to see if the correct type is used.
If no "CP56Time2a" type is used the time stamp is given by the driver.

When you need further assistance it is maybe easier when you get in contact with your common WinCC OA support.
The WinCC OA Portal is not used for the official WinCC OA support.

Best Regards
Leopold Knipp
Senior Support Specialist

akim
Posts: 42
Joined: Wed Sep 16, 2015 10:48 am

Re: How to archive IEC104 variables with correct timestamps?

Post by akim »

Hi,

I have the same problem. Did anybody find any solution?

I use WinCC OA 3.17 P009.
IEC104 server - S7-1200 CP 1243-1.

I think the problem is with the timestamp format.

CP 1243-1 sends values with timestamp in GMT format (UTC +0).

But WinCC OA can not get them properly.

I have read that:
Drivers that handle data with timestamps assumes that the stamps are based on the local time and convert it to UTC internally before forwarding the data to the event manager.

I tried to set utcTimestamps = 1 in [iec] in config file. But it didn't help.

Now all historical data received from CP are inserted in archive with same (current) timestamp.

https://prnt.sc/ymb0w2

WalitziS
Posts: 15
Joined: Tue Jan 18, 2011 11:06 am

Re: How to archive IEC104 variables with correct timestamps?

Post by WalitziS »

Hi akim,

from our experience with Siemens PLCs using IEC104 protocol you have to change the time stamp in the PLC before sending it to WinCC OA. There should be the possibility to set an offset value. That value depends on the time zone configured in your connected WinCC OA system.

Regards

Post Reply
9 posts • Page 1 of 1