› PLCGurus.NET Live & Interactive Forum › PLC Questions and Answers › General Automation Questions › Intouch Wonderware Duty/Assist Code?
Tagged: Lead Lag Duty Assist
- This topic has 2 replies, 3 voices, and was last updated 1 year, 10 months ago by
Stixoffire.
- AuthorPosts
- April 25, 2020 at 5:04 am #19345
Gerard339
ParticipantKarma: 13Rank: PadawanHi,
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…
August 26, 2021 at 1:44 pm #20281IAMSCADA
ParticipantKarma: 16Rank: PadawanYou would be better off designing a duty assist block within your PLC and not perform this within the SCADA system
January 30, 2022 at 4:47 am #20573Stixoffire
ParticipantKarma: 172Rank: JediWhat 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 etcPump1Select = ((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.
- AuthorPosts
- You must be logged in to reply to this topic.