Get time from two channels

Forum Home Forums Understanding the Software Get time from two channels

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6072
    roni
    Participant

    Greetings, I have a modbus device that sends me the hours and minutes through two channels and I would like to know how to display them in a dynamic text box in hh: mm format and then modify and resend it.

    #6076
    Mikhail
    Moderator

    Hi,

    To display:
    Create a 3rd input channel of the Calculated real type.
    Use a formula for this channel. Something like EncodeDate(new DateTime(1, 1, 1, Val(101), Val(102), 0))
    where 101 and 102 are the channels for hours and minutes.
    Set the format of the new channel to Time.

    When the above works, let’s think how to set the time.

    #6077
    roni
    Participant

    Thanks, it works perfectly, now I only have to eliminate the seconds.

    #6079
    Mikhail
    Moderator

    now I only have to eliminate the seconds.

    In this case it’s better to simply use 2 text components close to each other. And “:” between them.

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