6/27/2013 9:05 AM | |
Joined: 11/4/2011 Last visit: 7/22/2024 Posts: 253 Rating:
|
Should it work like this? http://www.youtube.com/watch?v=_eDnd3HRsUw STL Source for that FB: [code]DATA_BLOCK "dbDS" TITLE = VERSION : 0.1 STRUCT DSswitch : BOOL := TRUE; //Duty/StBy switch from HMI PumpA_Duty : BOOL ; //PumpA works as Duty (and PumpB as StBy) PumpB_Duty : BOOL ; //PumpB works as Duty (and PumpA as StBy) END_STRUCT ; BEGIN DSswitch := TRUE; PumpA_Duty := FALSE; PumpB_Duty := FALSE; END_DATA_BLOCK FUNCTION_BLOCK "DStest" TITLE = VERSION : 0.1 VAR_INPUT DSswitch : BOOL := TRUE; //Duty/StBy switch Fault : BOOL ; //Fault that switches PumpA and PumpB as Duty/StBy END_VAR VAR_OUTPUT PumpA_Duty : BOOL := TRUE; //Set PumpA as Duty (and PumpB as StBy) PumpB_Duty : BOOL ; //Set PumpB as Duty (and PumpA as StBy) FaultAct : BOOL ; //Fault active END_VAR BEGIN NETWORK TITLE =Duty/StBy switch from HMI A #Fault; JCN nFlt; // there is no fault A #FaultAct; JC end; // skip fault and norm.operation actions S #FaultAct; A #PumpA_Duty; // if PumpA is Duty R #PumpA_Duty; S #PumpB_Duty; // then set PumpB as Duty R "dbDS".DSswitch; NOT ; S #PumpA_Duty; // else set PumpA as Duty R #PumpB_Duty; S "dbDS".DSswitch; JU end; // skip norm.operation actions nFlt: A #DSswitch; = #PumpA_Duty; NOT ; = #PumpB_Duty; SET ; R #FaultAct; end: NOP 0; END_FUNCTION_BLOCK[/code] |
6/27/2013 9:36 AM | |
Posts: 515 Rating:
|
Hi, I have a suggestion, in your HMI create two buttons namely duty and standby for Pump1 and assign a single tag(same tag) for both the buttons. In the properties of the duty button, in events-on click-set the tag to 1. whereas in the properties of the standby button, in events-on click-set the tag to 0. do the same for Pump 2, ie create two duty and stanby buttons and inverse the function, ie in the properties of the duty button-on click-reset the tag to 0, and for standby, set the tag to one(ie same tag for both the pumps with inverse function). And in case of fault for pump1, reset the tag to 0(which makes the pump2 as duty) and in case of fault for pump2,set the tag to 1(which makes the pump1 as duty). u may try this please. see the attachment for your reference
AttachmentPUMP DUTY_STANDBY.pdf (350 Downloads) |
Last edited by: shazin at: 6/27/2013 9:38 AM |
|
Follow us on