LED Colour in Schema in not changing with values in Output Channel

Forum Home Forums Understanding the Software LED Colour in Schema in not changing with values in Output Channel

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #17018
    rapidscadaaks
    Participant

    Hi

    1. I am trying to show LED colour as Red and Green based in On-Off command sent to a relay. Channel number of the output channel is say 1100.
    In Schema I added a LED and in properties of LED, output channel 1100 is added. Collections in properties has inbuilt Red for 0 and Green for not 0
    Colour of the LED is default colour and not changing with change in Output Channel.
    2. Similarly, when I create a Toggle for On & Off with Send Now Command, colour of toggle is not changing.

    Please help

    • This topic was modified 2 months, 1 week ago by Mikhail.
    #17030
    Mikhail
    Moderator

    Hi,
    Led and toggle reflect an input channel. Your command should cause a change of an input channel to display its value.

    #17036
    rapidscadaaks
    Participant

    Hi

    Please advise to change input channel value using :

    1. Command sent to a device
    2. Command sent to an output channel which is not attached to any specific device but only for getting value for updating input channel

    Thanks

    #17051
    Mikhail
    Moderator

    Hi,
    It’s needed to create a function, e.g.

    public double MyFunc()
    {
      SetVal(101, CmdVal); // set value of channel 101
      return CmdVal; // return command value
    }

    And specify MyFunc() in the output formula of the channel that is used to send commands.

    Note: not tested.

    #17056
    rapidscadaaks
    Participant

    Hi Mikhail

    I tried and it did not update the input channel value.
    As suggested, I entered the function in output type channel in output formula. This output channel is not connected to any real device.
    Server log mentions command queued for sending to clients.
    Please help
    Thanks

    #17064
    Mikhail
    Moderator

    Hi,
    Make sure that the channel 101 is of the calculated type.
    Change SetVal to SetData(101, CmdVal, 1)

    #17068
    rapidscadaaks
    Participant

    Hi Mikhail

    This works. Thanks.

    I have a last follow up question on the subject for understanding :

    What is the difference between following the above solution (making a script for a function and calling the function in an output channel) and just using SetData() in an Output/Calculated Channel (as suggested by you in another topic) ?

    Thanks for all the help

    #17073
    Mikhail
    Moderator

    Hi,
    Making a script is preferable to create more complex functions and scenarios. A formula can contain only an expression.

    #17081
    rapidscadaaks
    Participant

    Thanks Mikhail

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