Forum Replies Created
-
AuthorPosts
-
August 4, 2025 at 10:05 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16781
rapidscadaaks
ParticipantHi
I actually need a script that toggles between 0 and 1 at specific times during the day.
I did some search and came across the following script:double ToggleAtSpecificTimes(DateTime currentTime)
{
DateTime[] toggleTimes = new DateTime[]
{
new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 8, 0, 0), // 08:00 AM
new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 12, 0, 0), // 12:00 PM
new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 18, 0, 0), // 06:00 PM
new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 22, 0, 0) // 10:00 PM
};
{
if (currentTime.Hour == toggleTime.Hour && currentTime.Minute == toggleTime.Minute)
{
return 1; // Return 1 at the specified times
}
}
return 0; // Default to 0 at all other times
}I copied the above in the Scripts table and Rapidscada worked without any issues.
However when I added a Channel and in formula used ToggleAtSpecificTimes(DateTime.Now), Rapidscada stopped working.Please guide
Thank you in advance
-
This reply was modified 7 months, 1 week ago by
rapidscadaaks.
August 1, 2025 at 11:44 pm in reply to: Auto Control Module : Multichannel Trigger between specific time #16778rapidscadaaks
ParticipantHi
Just one more guidance.
If a channel is required which should return 0 or 1 at specific time say 6, 8, 10, 12, 14, 16, 18 and 20 hours, what would the script be ?
Appreciate your help and assistance
August 1, 2025 at 11:34 pm in reply to: Auto Control Module : Multichannel Trigger between specific time #16777rapidscadaaks
ParticipantThe solution works.
Many thanks for the guidance.August 1, 2025 at 7:21 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16770rapidscadaaks
ParticipantHi
I picked up if(hour()… from google search.From the record I would like an output of 0 or 1 to be able to access from multipoint trigger in automatic control module.
Basically i would like to create a channel that can be 0 or 1 depending on the time, and use it in a multichannel trigger.
Please guide
Thank you in advance
August 1, 2025 at 5:34 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16766rapidscadaaks
ParticipantHi
I tried creating a calculated channel with following formula and Rapid Scada stopped working:
if(hour() >= 8 && hour() < 20, 1, 0)
Please advise
Thanks
rapidscadaaks
ParticipantThanks for the tip. Please advise how to use data of 2 channels for returning 1 or 0
Many thanks in advance
July 31, 2025 at 11:00 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16763rapidscadaaks
ParticipantThis scenario is better. Please advise how to create a channel that can be 0 or 1 depending on time.
Thanks in advance
rapidscadaaks
ParticipantHi
Manufacturer (Waveshare) is not responding to the issue.
I have checked connecting the device directly to the PC using serial port and values are not received for the Input Channels. The issue therefore is not Rapidscada related.
I am therefore using alternate product and results are fine.
Thank you for the assistancerapidscadaaks
ParticipantHi
I tried polling one register from 0 using Holding Registers and there was no response from the unitI have created a support ticket with the manufacturer and await their response.
In the meantime, please suggest software for testing purposes for sending command to the unit and getting response.
rapidscadaaks
ParticipantHi
Awaiting guidance for resolution.
Thanksrapidscadaaks
ParticipantYes. This matches with the documentation.
rapidscadaaks
ParticipantHi
In 100% cases, Digital Input is failing2025-07-23 18:10:48 Session with the device [47] Waveshare_Relay_Test
Request element group “Relays”
Send (8): 01 01 00 00 00 08 3D CC
Receive (2/2): 01 01
Receive (4/4): 01 00 51 88
OK
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed2025-07-23 18:10:52 Session with the device [47] Waveshare_Relay_Test
Request element group “Relays”
Send (8): 01 01 00 00 00 08 3D CC
Receive (2/2): 01 01
Receive (4/4): 01 00 51 88
OK
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed2025-07-23 18:10:56 Session with the device [47] Waveshare_Relay_Test
Request element group “Relays”
Send (8): 01 01 00 00 00 08 3D CC
Receive (2/2): 01 01
Receive (4/4): 01 00 51 88
OK
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed2025-07-23 18:11:00 Session with the device [47] Waveshare_Relay_Test
Request element group “Relays”
Send (8): 01 01 00 00 00 08 3D CC
Receive (2/2): 01 01
Receive (4/4): 01 00 51 88
OK
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed
Request element group “Digital Input”
Send (8): 01 02 00 00 00 08 79 CC
Receive (0/2):
Error: communication failed2025-07-23 18:11:04 Session with the device [47] Waveshare_Relay_Test
Request element group “Relays”
Send (8): 01 01 00 00 00 08 3D CC
Receive (2/2): 01 01
Receive (4/4): 01 00 51 88
OKrapidscadaaks
Participanthttps://drive.google.com/drive/folders/1vlIcl4xIIcAInInh3mefr4DbJkR56pO0?usp=sharing
I hope the link is fine
Thanks
rapidscadaaks
ParticipantHi
I have the screenshots ready. Please advise how to attach as I do not seem to find option for uploading filerapidscadaaks
ParticipantDetails & manual of the device:
-
This reply was modified 7 months, 1 week ago by
-
AuthorPosts