If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-08-15
Originally created by: scott_cunningham
A late answer, but here is a basic FB that will do it (assumes your command is 0 to 100):
FUNCTION_BLOCKHeatControlVAR_INPUTÂ Â CmdSignal:INT:=0;END_VARVAR_OUTPUTÂ Â Heat7KwA:BOOL:=FALSE;Â Â Heat7KwB:BOOL:=FALSE;Â Â Heat14Kw:BOOL:=FALSE;Â Â Heat27Kw:BOOL:=FALSE;Â Â Heat55Kw:BOOL:=FALSE;END_VARVAREND_VAR(*0% = 0kW25% = 27kW (only 27kW aktice)50% = 55kW (Only 55kW active)75% = 82kW (Only 55kW + 27kW) active100% = 110kW (all active)*)//turnallofffirstHeat7KwA:=FALSE;Heat7KwB:=FALSE;Heat14Kw:=FALSE;Heat27Kw:=FALSE;Heat55Kw:=FALSE;//nowseewhichshouldbeonIFCmdSignal>=100THENÂ Â Heat7KwA:=TRUE;Â Â Heat7KwB:=TRUE;Â Â Heat14Kw:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;ELSIFCmdSignal>=75THENÂ Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;ELSIFCmdSignal>=50THENÂ Â Heat55Kw:=TRUE;ELSIFCmdSignal>=25THENÂ Â Heat27Kw:=TRUE;ELSEÂ Â ;//noneEND_IFÂ
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like a function that calculate all the time and then find the nearest combination to match the requested input.
Is there any pre-made function for this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-08-26
Originally created by: scott_cunningham
That is what my function block will do based on your information. Call it every scan with your input and it will turn on or off whatever heaters you need.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the solution i came up with, in case someone else need this.
This function calculates the remaining kW wich are given by Heat7KwA with TRIAC.
FUNCTION_BLOCKHeatControlVAR_INPUTÂ Â CmdSignal:INT:=0;END_VARVAR_OUTPUTÂ Â Heat7KwA:BOOL:=FALSE;Â Â Heat7KwB:BOOL:=FALSE;Â Â Heat14Kw:BOOL:=FALSE;Â Â Heat27Kw:BOOL:=FALSE;Â Â Heat55Kw:BOOL:=FALSE;Â Triacscaled:INT:=0;END_VARVARÂ Â Triac:INT:=0;END_VAR
Triacscaled:=(CmdSignal-Triac)*100/7;IFCmdSignal>=103THENÂ Â Heat7KwB:=TRUE;Â Â Heat14Kw:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=103;ELSIFCmdSignal>=96THENÂ Â Heat14Kw:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=96;ELSIFCmdSignal>=89THENÂ Â Heat7KwB:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=89;ELSIFCmdSignal>=82THENÂ Â Heat27Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=82;ELSIFCmdSignal>=76THENÂ Â Heat7KwB:=TRUE;Â Â Heat14Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=76;ELSIFCmdSignal>=69THENÂ Â Heat14Kw:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=69;ELSIFCmdSignal>=62THENÂ Â Heat7KwB:=TRUE;Â Â Heat55Kw:=TRUE;Â Â Triac:=62;ELSIFCmdSignal>=55THENÂ Â Heat55Kw:=TRUE;Â Â Triac:=55;ELSIFCmdSignal>=48THENÂ Â Heat7KwB:=TRUE;Â Â Heat14Kw:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Triac:=48;ELSIFCmdSignal>=41THENÂ Â Heat14Kw:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Triac:=41;ELSIFCmdSignal>=34THENÂ Â Heat7KwB:=TRUE;Â Â Heat27Kw:=TRUE;Â Â Triac:=34;ELSIFCmdSignal>=27THENÂ Â Heat27Kw:=TRUE;Â Â Triac:=27;ELSIFCmdSignal>=21THENÂ Â Heat7KwB:=TRUE;Â Â Heat14Kw:=TRUE;Â Â Triac:=21;ELSIFCmdSignal>=14THENÂ Â Heat14Kw:=TRUE;Â Â Triac:=14;ELSIFCmdSignal>=7THENÂ Â Heat7KwB:=TRUE;Â Â Triac:=7;END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im upgrading a HVAC control system, i found a decent macro but the macro is for liquid heat battery, and this application has electrical.
I would like to use the % output from the valve controller to trigger the heat elemets. Total heat is 110kw (2 x 7kW + 1x14kW + 1x27kW + 1x55kW)
All 5 heat elemets ar triggered by DO, what function could i use to calculate wich outputs at a given time will give the most correct DO to activate?
Example:
0% = 0kW
25% = 27kW (only 27kW aktice)
50% = 55kW (Only 55kW active)
75% = 82kW (Only 55kW + 27kW) active
100% = 110kW (all active)
Originally created by: scott_cunningham
A late answer, but here is a basic FB that will do it (assumes your command is 0 to 100):
Thanks for your reply.
Im sorry if my question wasn't crystal clear.
I would like a function that calculate all the time and then find the nearest combination to match the requested input.
Is there any pre-made function for this?
Originally created by: scott_cunningham
That is what my function block will do based on your information. Call it every scan with your input and it will turn on or off whatever heaters you need.
This is the solution i came up with, in case someone else need this.
This function calculates the remaining kW wich are given by Heat7KwA with TRIAC.