date & time with S7 ISO over TCP

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
charlyprouteau
Posts: 33
Joined: Wed Jan 23, 2013 2:01 am

date & time with S7 ISO over TCP

Post by charlyprouteau »

I use a TA150 with a Siemens PLC throught ethernet and I use controller S7 ISO over TCP 4.11.05.
On controller help, It is noted that clock tag is not available for all HMI models. And I tried to have time and date from my PLC on HMI, but actually I cannot.
Could you tell me if I can read PLC date&time on the TA150? and How?
Thanks for your reply

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: date & time with S7 ISO over TCP

Post by mark.monroe »

The Clock Tag only works when you are using Exters. In iX Developer, to display the PLC time, you would have to create a memory location in the PLC that you copy the time to, and then map a tag from the HMI to that memory location.

If you wanted to set the HMI time from the PLC, you would need to write a script in C# that sets the HMI time.

Here is another post regarding your question.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

charlyprouteau
Posts: 33
Joined: Wed Jan 23, 2013 2:01 am

Re: date & time with S7 ISO over TCP

Post by charlyprouteau »

Thanks for your answer.
Have you got a C# script already done?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: date & time with S7 ISO over TCP

Post by mark.monroe »

I have attached a project that has C# code in it that allows you to change the system time.
BenTime_A7.zip
(26.67 KiB) Downloaded 1092 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

charlyprouteau
Posts: 33
Joined: Wed Jan 23, 2013 2:01 am

Re: date & time with S7 ISO over TCP

Post by charlyprouteau »

And How can I set date & time on a runtime application (on a PC application)? Because this script doesn't work.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: date & time with S7 ISO over TCP

Post by mark.monroe »

The script only works for Windows CE terminals. There are many examples online on how to set the PC's time using C#. We provide a Win CE example because it is not easy to do.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Fmedeiros
Posts: 2
Joined: Sat Apr 13, 2013 11:01 am

Re: date & time with S7 ISO over TCP

Post by Fmedeiros »

Hello,

I have a T4A connected to a S7-1200 via IsoTcp. In my program the time and date of the PLC has to be always synchronized with the HMI. I've tried many different ways to do this, by having the PLC date and time to be the master, and vice versa, but haven't been able to solve it.
Is it possible to transfer the value of the system time tags of the T4A to mapped tags of the S7-1200? Like with C# or something?

Thanks

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: date & time with S7 ISO over TCP

Post by mark.monroe »

Yes, there are system tags on the HMI that allow you to map each component of the HMI's date and time to a register. That way you could send the HMI's time to the PLC. You might be able to do the same thing on your PLC, and send the date & time to the HMI. Going from the PLC to the HMI would allow you to set the HMI's time from the PLC time. An example of how to set the HMI's time via C# was previously posted in this thread.
Snap 2013-04-15 at 08.36.27.jpg
Snap 2013-04-15 at 08.36.27.jpg (108.68 KiB) Viewed 18615 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Fmedeiros
Posts: 2
Joined: Sat Apr 13, 2013 11:01 am

Re: date & time with S7 ISO over TCP

Post by Fmedeiros »

Thank you Mark.

My problem is solved.

Post Reply