How to make Led blinking

Forum Home Forums Development and Integration How to make Led blinking

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #9710

    Hi, I have a requirement where I am using a Led to show the device is switched ON. Led remains ON as long as the device is running. I configure a Led for it. But my additional requirement is that Led should blink when it remains ON. I am struggling to get how to do that. Please help. Thanks in advance.

    • This topic was modified 2 years, 2 months ago by dp_palai.

    the trick is set two “ON” states for your led, and toggle between them.
    set a led with condition
    0; 1; 2 for silver; light green; green.

    assume you have multiple led, they should blink at the same time.

    step 1, defind a function in formula, which is the value of second of current time.
    double Second(DateTime dt){
    double en_dt = EncodeDate(dt);
    double s = Math.Truncate(en_dt * 24 * 60 * 60) % 60;
    return s;

    you can have 1 input channel for device status, e.g. Cnl 1001
    0; 1 for off; on

    then you setup an other channel for led, e.g. 1002,
    set formula

    then the value will toggle between 1 and 2 every second when the device is on, and remain 0 when the device is off.


    In addition to the previous answer.
    Color also can be taken from channel status.
    Channel value 1 means that device is running.
    Custom channel statuses may change led color.
    So channel formula could be Cnl; (Second(DateTime.UtcNow) % 2) > 0 ? 101 : 102
    where 101 and 102 your custom statuses specified in the Event types table.
    And in the Scheme editor specify the Status color.

    • This reply was modified 2 years, 2 months ago by Mikhail.

    Thanks, Mikhail for a prompt response.


    Thanks a lot, JW!. You are amazing.

    Caramel Macchiato

    I tried it, It’s cannot change per second??


    Could you specify your question?


    @caramel-macchiato It worked for me. So you must be missing some steps while configuring all required areas.

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