Forum Home › Forums › Understanding the Software › Daily Time Counter
- This topic has 11 replies, 2 voices, and was last updated 1 year ago by
rapidscadaaks.
-
AuthorPosts
-
August 21, 2024 at 4:56 am #15184
rapidscadaaks
ParticipantHi
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
August 21, 2024 at 11:28 am #15194Mikhail
ModeratorHi,
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?
August 21, 2024 at 1:30 pm #15195rapidscadaaks
ParticipantHi,
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
August 22, 2024 at 9:58 am #15207Mikhail
ModeratorChannel 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.
August 22, 2024 at 10:52 am #15209rapidscadaaks
ParticipantHi 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
August 23, 2024 at 9:55 am #15220Mikhail
ModeratorHi,
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 formulaResetChannels(101, 102)
, for example.August 23, 2024 at 10:00 am #15221Mikhail
ModeratorOption 1 looks better because it does not need an additional module.
Option 2 is easier.August 23, 2024 at 10:11 am #15222rapidscadaaks
ParticipantHi
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
August 23, 2024 at 12:53 pm #15223Mikhail
ModeratorHi,
You right.
1. Yes. An output channel.
2. Yes.
You should check how it works.August 23, 2024 at 12:56 pm #15224rapidscadaaks
ParticipantHi Mikhail
Please let me know what Command should be sent by the ACM.
Thanks once again
August 26, 2024 at 1:43 pm #15231Mikhail
ModeratorHi,
Any command to an output channel. When command is processed by a channel, the output formula is calculated to reset channels.August 27, 2024 at 11:24 am #15243rapidscadaaks
ParticipantMany thanks. This works
-
AuthorPosts
- You must be logged in to reply to this topic.