We're trying to read a datetime variable from a 1500 PLC through OPC UA. We've used a third party OPC UA client ( UAExpert) who says that the PLC is tranmitting an byte-array of 8 bytes.
Does anyone know:
1) What to configure so that we receive the 8 byte array
2) Is there a native configuration to receive the datetime in WInCC OA
Thanks
Frenk
How to read a datetime from a 1500 PLC through OPC UA
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
How to read a datetime from a 1500 PLC through OPC UA
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: How to read a datetime from a 1500 PLC through OPC UA
Hi Frenk,
For 1)
Byte is a char, so an array of char maybe? But for me you should go directly for 2)
For 2)
Did you try a time DPE with a datetime conversion? I never connected a S7 1500 via OPC UA but via S7 it was working fine. I think it shouldnt be that different...
BR
Alex
For 1)
Byte is a char, so an array of char maybe? But for me you should go directly for 2)
For 2)
Did you try a time DPE with a datetime conversion? I never connected a S7 1500 via OPC UA but via S7 it was working fine. I think it shouldnt be that different...
BR
Alex
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to read a datetime from a 1500 PLC through OPC UA
Yes, in the past with the regular S7 protocol, we were able to read a DATETIME. But with OPC UA we're unsure how to configure the adress config.
We tried : blob, dyn char, dyn_int but keep getting an error message in the logview. Either 'No conversion' or 'out of range'
Hope someone has an idea
Frenk
We tried : blob, dyn char, dyn_int but keep getting an error message in the logview. Either 'No conversion' or 'out of range'
Hope someone has an idea
Frenk
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: How to read a datetime from a 1500 PLC through OPC UA
And datetime directly didnt work? Like DPE from type datetime + datetime conversion in address panel.
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to read a datetime from a 1500 PLC through OPC UA
No we tried all kinds of DPE's : string, time, int, blob, dyn-char....
no luck
no luck
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: How to read a datetime from a 1500 PLC through OPC UA
Frenk Mulder wrote:
DTL can be received with the single components (year, month, day, weekday, hour, minute, second and nanosecond).
LDT can be received as a 'DateTime'.
2) See 1 only for standard OPC data types transformations have been made, so custom datetime types cannot be natively configured.
1) S7 DATE_AND_TIME can be received as a 'byte string' or as array of bytes (require additional BCD conversion).1) What to configure so that we receive the 8 byte array
2) Is there a native configuration to receive the datetime in WinCC OA
DTL can be received with the single components (year, month, day, weekday, hour, minute, second and nanosecond).
LDT can be received as a 'DateTime'.
2) See 1 only for standard OPC data types transformations have been made, so custom datetime types cannot be natively configured.
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to read a datetime from a 1500 PLC through OPC UA
My question is basically : How to setup the OPC UA client.
We tried all different types of dp elements and adresses but are unable to receive the date-time being sent by the PLC.
has someone ever succesfully received a datetime from a 1500 through OPC UA ?
* What kind of Dp element
* How do I configure the OPC UA client adress config ?
Thanks
Share the fun
Frenk Mulder
We tried all different types of dp elements and adresses but are unable to receive the date-time being sent by the PLC.
has someone ever succesfully received a datetime from a 1500 through OPC UA ?
* What kind of Dp element
* How do I configure the OPC UA client adress config ?
Thanks
Share the fun
Frenk Mulder
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to read a datetime from a 1500 PLC through OPC UA
Sorry. None of your shown configs seem to return a date-time.
LogViewer will show 'conversion failed'
Somehow, there seems to be no way to read the datetime via OPC UA
share the fun
Frenk Mulder
LogViewer will show 'conversion failed'
Somehow, there seems to be no way to read the datetime via OPC UA
share the fun
Frenk Mulder
- mkerk
- Posts:75
- Joined: Wed Oct 20, 2010 12:25 pm
Re: How to read a datetime from a 1500 PLC through OPC UA
Hello Frenk,
With “datetime” you are talking about the DATE_AND_TIME type in S71500, correct?
the two first Screenshots from Gertjan are address configs configured to read a DATE_AND_TIME tag in 2 different ways.
As Gertjan wrote the OPC UA Type date-time isn´t an OPC UA basic types and is not directly supported in WinCC OA (list of supported OPC UA basic types is written in the WinCC OA documentation). It is not possible to read a tag from type data-time directly on a DPE from type Time.
As Gertjan wrote in WinCC OA you can read the DATE_AND_TIME tag as a 'byte string' OR as array of bytes (see first two screenshots from Gertjan) AND Then you have to calculate the Date in a CTRL-script (please refer to the S71500 documentation to check how to calculate the date from the read byte / Array of bytes).
The third screenshot from Gertjan shows an address-config for LTD-tag, which is directly supported in WinCC OA. That´s why if possible use the 'LDT' type in the plc.
Gertjan tried all of this with 3.16 and S7-1516 v2.5.2 and it was working correctly. No errors in the LogViewer!
Maybe you are using another type of PLC? Or another WinCC OA Version?
BR,
Mousser
With “datetime” you are talking about the DATE_AND_TIME type in S71500, correct?
the two first Screenshots from Gertjan are address configs configured to read a DATE_AND_TIME tag in 2 different ways.
As Gertjan wrote the OPC UA Type date-time isn´t an OPC UA basic types and is not directly supported in WinCC OA (list of supported OPC UA basic types is written in the WinCC OA documentation). It is not possible to read a tag from type data-time directly on a DPE from type Time.
As Gertjan wrote in WinCC OA you can read the DATE_AND_TIME tag as a 'byte string' OR as array of bytes (see first two screenshots from Gertjan) AND Then you have to calculate the Date in a CTRL-script (please refer to the S71500 documentation to check how to calculate the date from the read byte / Array of bytes).
The third screenshot from Gertjan shows an address-config for LTD-tag, which is directly supported in WinCC OA. That´s why if possible use the 'LDT' type in the plc.
Gertjan tried all of this with 3.16 and S7-1516 v2.5.2 and it was working correctly. No errors in the LogViewer!
Maybe you are using another type of PLC? Or another WinCC OA Version?
BR,
Mousser


