time visualization

2012-11-30
2018-06-01
  • Andoni Crespo - 2012-11-30

    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

     
  • MusashiAharon - 2012-11-30

    With your visualization open, choose Extras:Settings:Date/Time. What do you see for the TIME/TOD field? Is Formatted time display checked?

     
  • Andoni Crespo - 2012-12-03

    Where is that "Extras" tab? I am working with a CoDeSys v3.4

    Thanks Musashi Aharon

     
  • shooter - 2012-12-03

    in 2.3 it is %t this will give system time.

     
  • MusashiAharon - 2012-12-03

    Andoni Crespo hat geschrieben:
    Where is that "Extras" tab? I am working with a CoDeSys v3.4

    Ah, sorry. I'm on V2.3.

     
  • Andoni Crespo - 2012-12-03

    Do not worry, itΒ΄s OK.

    I have tried %t but it does not work on v3.4, in the visualization appears a "t"

     
  • arrvvii - 2017-07-18

    Is this problem solved?
    Im also facing this issue...Kindly help me solve this.

    Thanks
    arrvvii

     
  • aliazzz

    aliazzz - 2018-06-01

    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

     

Log in to post a comment.