rapidscadaaks

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 64 total)
  • Author
    Posts
  • rapidscadaaks
    Participant

    Hi
    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

    rapidscadaaks
    Participant

    Hi

    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

    rapidscadaaks
    Participant

    The solution works.
    Many thanks for the guidance.

    rapidscadaaks
    Participant

    Hi
    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

    rapidscadaaks
    Participant

    Hi

    I tried creating a calculated channel with following formula and Rapid Scada stopped working:

    if(hour() >= 8 && hour() < 20, 1, 0)

    Please advise

    Thanks

    in reply to: “IF” Formula in channels #16765
    rapidscadaaks
    Participant

    Thanks for the tip. Please advise how to use data of 2 channels for returning 1 or 0

    Many thanks in advance

    rapidscadaaks
    Participant

    This scenario is better. Please advise how to create a channel that can be 0 or 1 depending on time.

    Thanks in advance

    in reply to: Register reading with Modbus TCP #16752
    rapidscadaaks
    Participant

    Hi
    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 assistance

    in reply to: Register reading with Modbus TCP #16723
    rapidscadaaks
    Participant

    Hi
    I tried polling one register from 0 using Holding Registers and there was no response from the unit

    I 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.

    in reply to: Register reading with Modbus TCP #16720
    rapidscadaaks
    Participant

    Hi
    Awaiting guidance for resolution.
    Thanks

    in reply to: Register reading with Modbus TCP #16710
    rapidscadaaks
    Participant

    Yes. This matches with the documentation.

    in reply to: Register reading with Modbus TCP #16698
    rapidscadaaks
    Participant

    Hi
    In 100% cases, Digital Input is failing

    2025-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 failed

    2025-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 failed

    2025-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 failed

    2025-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 failed

    2025-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
    OK

    in reply to: Register reading with Modbus TCP #16693
    rapidscadaaks
    Participant
    in reply to: Register reading with Modbus TCP #16692
    rapidscadaaks
    Participant

    Hi
    I have the screenshots ready. Please advise how to attach as I do not seem to find option for uploading file

    in reply to: Register reading with Modbus TCP #16684
    rapidscadaaks
    Participant

    Details & manual of the device:

    https://www.waveshare.com/wiki/Modbus_RTU_Relay_(D)

Viewing 15 posts - 31 through 45 (of 64 total)