Daily Time Counter

Forum Home Forums Understanding the Software Daily Time Counter

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #15184
    rapidscadaaks
    Participant

    Hi

    Please assist for configuring Rapid Scada in a way that one of the Channels records the cumulative time that another Chanel has been on a particular value or state. This Channel value should get reset everyday to 0.

    For eg. Channel 101 records Status as 0 or 1 and this changes many times during the day. I need another Channel to record the number of minutes Channel 101 has been on Status 1 during a particular day.

    Please help.

    Many Thanks

    #15194
    Mikhail
    Moderator

    Hi,

    If the channel 101 changes not too often, you can measure it’s value every minute. If it’s 1, increase the channel 102. Does this method fit your needs?

    #15195
    rapidscadaaks
    Participant

    Hi,
    Thanks for your reply. I could definitely try this out; please let me know how to go about configuring Channel 102 to increase by 1 every minute if value is 1. Kindly also advise how to reset Channel 102 everyday to zero.

    Many Thanks

    #15207
    Mikhail
    Moderator

    Channel 101 is the source channel.
    Channel 102 formula: EveryMin(() => IncIfOn(101, 103))
    Channel 103 stores the cumulative value.
    Channels 102 and 103 of the Calculated type.

    Add to the Scripts table

    public CnlData IncIfOn(int cnlNum1, int cnlNum2)
    {
      if (Val(cnlNum1) > 0)
        SetData(cnlNum2, Val(cnlNum2) + 1, 1);
      return CnlData.Empty;
    }
    

    Note: the above is not tested.

    #15209
    rapidscadaaks
    Participant

    Hi Mikhail

    Many thanks for the solution. I have applied the solution as suggested and as of now it is working.

    Please advise how to reset the value of Channel 103 to 0 everyday at say 6am or any other system time.

    Thanks once again

    #15220
    Mikhail
    Moderator

    Hi,

    Option 1
    Develop a function that calls the ResetChannels function (I’ve sent it to you) on a required time of a day.

    Option 2
    Use Automatic Control Module without programming. It can send a command on a certain time. A command will be sent to an input channel of the output type which has an output formula ResetChannels(101, 102), for example.

    #15221
    Mikhail
    Moderator

    Option 1 looks better because it does not need an additional module.
    Option 2 is easier.

    #15222
    rapidscadaaks
    Participant

    Hi

    Please guide for Option 2 for resetting Channel 1437 which is a Calculated Channel since I already have the additional module.

    In the ACM, I can create a Time Trigger but need help for further steps i.e.

    1. Do I need to make a new Input/Output Channel 1438 which has ResetChannels(1437) in Output Formula? All other fields i.e. Device, Tag, etc. will be empty

    2. In the ACM what command to send to 1438?

    Please do pardon me for my basic questions as this is quite new to me.

    Looking forward to expeditious help.

    Thanks

    #15223
    Mikhail
    Moderator

    Hi,

    You right.
    1. Yes. An output channel.
    2. Yes.
    You should check how it works.

    #15224
    rapidscadaaks
    Participant

    Hi Mikhail

    Please let me know what Command should be sent by the ACM.

    Thanks once again

    #15231
    Mikhail
    Moderator

    Hi,
    Any command to an output channel. When command is processed by a channel, the output formula is calculated to reset channels.

    #15243
    rapidscadaaks
    Participant

    Many thanks. This works

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