Though a bit late, here the solution as found in the codesysv2.3 help;
If you enter "%t", followed by a certain sequence of special placeholders, then this location will be
replaced in Online mode by the system time. The placeholders define the display format, see the
following table. Attention: Do not insert any other characters before %t in the 'Content' field (in
contrast this is allowed for e.g. "%s", see above)
%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%c Date and time representation appropriate for locale
%d Day of month as decimal number (01 β 31)
%H Hour in 24-hour format (00 β 23)
%I Hour in 12-hour format (01 β 12)
%j Day of year as decimal number (001 β 366)
%m Month as decimal number (01 β 12)
%M Minute as decimal number (00 β 59)
%p Current localeβs A.M./P.M. indicator for 12-hour clock
%S Second as decimal number (00 β 59)
%U Week of year as decimal number, with Sunday as first day of week (00 β 53)
%w Weekday as decimal number (0 β 6; Sunday is 0)
%W Week of year as decimal number, with Monday as first day of week (00 β 53)
%x Date representation for current locale
%X Time representation for current locale
%y Year without century, as decimal number (00 β 99)
%Y Year with century, as decimal number
%z, %Z Time-zone name or abbreviation; no characters if time zone is unknown
%% Percent sign
Examples:
%t%a %b %d.%m.%y %H:%M:%S
-> Display in online mode: Wed Aug 28.08.02 16:32:45
Between the placeholders you can insert any text strings:
%Today is %d.%m.%y
-> Display in online mode: Today is 28.08.02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a "TIME" variable to count how much time is working the PLC.
What should I write into the "Text" field to have the time divided in hours, minutes and seconds?
I have tried with %t but it does not work.
Actually I am doing it with %s and I just see the values on minutes and seconds.
Thanks for your help
With your visualization open, choose Extras:Settings:Date/Time. What do you see for the TIME/TOD field? Is Formatted time display checked?
Where is that "Extras" tab? I am working with a CoDeSys v3.4
Thanks Musashi Aharon
in 2.3 it is %t this will give system time.
Ah, sorry. I'm on V2.3.
Do not worry, itΒ΄s OK.
I have tried %t but it does not work on v3.4, in the visualization appears a "t"
Is this problem solved?
Im also facing this issue...Kindly help me solve this.
Thanks
arrvvii
Though a bit late, here the solution as found in the codesysv2.3 help;
If you enter "%t", followed by a certain sequence of special placeholders, then this location will be
replaced in Online mode by the system time. The placeholders define the display format, see the
following table. Attention: Do not insert any other characters before %t in the 'Content' field (in
contrast this is allowed for e.g. "%s", see above)
%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%c Date and time representation appropriate for locale
%d Day of month as decimal number (01 β 31)
%H Hour in 24-hour format (00 β 23)
%I Hour in 12-hour format (01 β 12)
%j Day of year as decimal number (001 β 366)
%m Month as decimal number (01 β 12)
%M Minute as decimal number (00 β 59)
%p Current localeβs A.M./P.M. indicator for 12-hour clock
%S Second as decimal number (00 β 59)
%U Week of year as decimal number, with Sunday as first day of week (00 β 53)
%w Weekday as decimal number (0 β 6; Sunday is 0)
%W Week of year as decimal number, with Monday as first day of week (00 β 53)
%x Date representation for current locale
%X Time representation for current locale
%y Year without century, as decimal number (00 β 99)
%Y Year with century, as decimal number
%z, %Z Time-zone name or abbreviation; no characters if time zone is unknown
%% Percent sign
Examples:
%t%a %b %d.%m.%y %H:%M:%S
-> Display in online mode: Wed Aug 28.08.02 16:32:45
Between the placeholders you can insert any text strings:
%Today is %d.%m.%y
-> Display in online mode: Today is 28.08.02