Intouch Wonderware Duty/Assist Code?

  • This topic has 2 replies, 3 voices, and was last updated 8 months ago by StixoffireKen S.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19345
    Gerard339Gerard339
    Participant
    Karma: 13
    Rank: Padawan

    Hi,

    I would appreciate some help on how to write the code for a duty and assist pump arrangement.

    The water level is controlled with an ultrasonic sensor and the duty and assist pumps will start when the water reaches a certain level.  I want the pumps to operate on duty/assist arrangement and automatically alternate duty after each pumping event.

    Can anyone help with this code please – I’ve tried everything but no joy?!

    Thanks in advance…

    #20281
    IAMSCADAIAMSCADA
    Participant
    Karma: 16
    Rank: Padawan

    You would be better off designing a duty assist block within your PLC and not perform this within the SCADA system

    #20573
    StixoffireKen S
    Participant
    Karma: 161
    Rank: Jedi

    What you are referring to is a lead lag system. If you have a PLC – you REALLY REALLY REALLY should program in the PLC.
    If you have Danfoss Aqua VLT drives for the pumps you can do it in the drives.
    If you have none of those options – and you have no choice then the below is some rough pseudo code ..

    //Use the sensor for determining if water is needed.

    If  DebouncedWaterSensorLevel <= RequestWaterLevel then Water_Requested =true else Water_Requested =false endif;

    //Set the Conditional Start State values to a single boolean value for ease of use and code readability.
    Pump1IsOperable == AnyPump1NoRunConditon; // alarm, maintenance etc
    Pump2IsOperable == AnyPump2NoRunConditon; // alarm, maintenance etc

    Pump1Select = ((LastPumpWas == 2) AND (Pump1IsOperable == true)) OR ((LastPumpWas == 2) AND (Pump2IsOperable == false) AND (Pump1IsOperable == true)) ;
    Pump2Select = ((LastPumpWas == 1) AND (Pump2IsOperable == true)) OR ((LastPumpWas == 1) AND (Pump1IsOperable == false) AND (Pump2IsOperable == true));

    // Do we have an Alarm or No Run Condition ?  this will need better refinement
    if ((Pump1Select == false) AND (Pump2Select == false) AND (InMaintenance == false)) then
    PumpNotAvailableAlarm == true endif;

    If ((PumpAlarm ==false) AND (Water_Requested==true)) AND Pump1Select then
    StartPump1 = true
    LastPumpWas = 1
    if AssistRequired then StartPump2 = true endif;
    elseif
    ((PumpAlarm ==false) AND (Water_Requested==true)) AND Pump2Select then
    StartPump2 = true
    if AssistRequired then StartPump1 = true endif;
    LastPumpWas = 2
    endif;

    You can trigger recording hourly usage via the startpump and shutdown of pump via another script.

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