To display exact Time And Date of Event occur

Forum Home Forums Understanding the Software To display exact Time And Date of Event occur

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #5085
    mitesh
    Participant

    Hi Mikhail,

    I want to Display the exact date and time when event occurs. In Administrator i have selected channel type as hourly real. i am getting wrong date (30/12/1899) and time (00.00.00). Please help me to display exact date and time.

    Ex: Event: High Temperature : 70°C
    Date of Event Occur: 27/02/2019
    Time of Event Occur : 10:35:40

    Thank you.

    #5089
    Mikhail
    Moderator

    Hi,

    For example to display current time, set input channel type to Real and formula to EncodeDate(DateTime.Now) and format to Date and Time.

    How to display time of event, I’m not sure. Probably you need a custom module that catches events and copy their time stamps to an input channel.

    #5114
    mitesh
    Participant

    Hi Mikhail,

    I am not getting anything after setting input channel type to Real and formula to EncodeDate(DateTime.Now) and format to Date and Time.

    Thank you.

    #5123
    Mikhail
    Moderator

    Hi,
    Please provide screenshots and logs.

    #5149
    Horacio
    Participant

    Hello Mikhail

    I am trying to display Date and Time.
    I set up an input channel for this type Real, formula EncodeDate(DateTime.Now) and format Date and Time. Please see image of Administrator:

    https://www.dropbox.com/s/mwhq8cc0vuwblzj/Trying%20to%20show%20Date%20and%20Time.docx?dl=0

    I included a Dynamic Text with Scheme and assigned it to the corresponding input channel. I only get: “—“.

    Am I missing something?

    Thank you

    #5151
    Mikhail
    Moderator

    Hi,
    Switch channel type to Calculated Real and remove Signal.

    #5154
    Horacio
    Participant

    Thank you very much! It worked ot fine.

    #9871
    myscada
    Participant

    Hi Mikhail,

    Is it possible to display the DayOfWeek? I tried EncodeDate(DateTime.DayOfWeek) but it prompts “invalid argument”. It seems that enum constants cannot be converted to double ones.

    #9872
    myscada
    Participant

    Hi Mikhail,

    I solved it based on your previous example. The return value 0-6 represents Sunday – Saturday. THX

    int CheckDayOfWeek()
    {
    DateTime nowDT = DateTime.Now;
    return (int)nowDT.DayOfWeek;
    }

    #9875
    Mikhail
    Moderator

    Good, thank you for the solution 🙂

    #9876
    myscada
    Participant

    Hi Mikhail,

    According to your post
    Link

    I creat my own unit in the Units table, and then an input channel (calculated real) with the format “Enum text” and my own unit. Now the string value of DayOfWeek is displayed perfectly on the web page. THX a lot.

    • This reply was modified 4 months, 2 weeks ago by Mikhail.
    #9880
    Mikhail
    Moderator

    You are welcome.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.