We are in the process of migrating from E9 (Progress) to E10. As part of that migration, our Configurators need to be converted to E10 syntax. For the most part the process has been slow but steady. However, have run up against the following E9 OnLeave code and would appreciate any assistance in converting it to E10 syntax. It’s the array(s) that are proving difficult for us to replicate. In this example, “SP” , “CFM”, “FanSize”, “SystemConfig”, and “FanWidth” are all Configurator inputs being referenced:
/* – FCW Calculations – */
if (SP <> 0 and CFM <> 0 and SP > 20) then do:
def var TRarefaction as Decimal extent 5.
def var TZoneCFM as Decimal extent 20.
def var TminZoneCFM as Decimal extent 20.
def var TmaxZoneCFM as Decimal extent 20.
def var TuseableZoneCFM as Decimal extent 20.
def var TFCFan as char extent 20.
def var TwFan as Decimal extent 20.
def var TminZone as integer.
def var TmaxZone as integer.
def var TiCount as integer init 1.
/* – Temperature Correction – /
TRarefaction[1] = 529.67 / (Temp + 459.67).
/ – Elevation Correction – /
TRarefaction[2] = exp(1 - 0.00000673 * Elevation, 5.258).
/ – Rarefaction Correction – /
if SystemConfig = “Vacuum” then TRarefaction[3] = (-1 * SP + 29.92 * 13.63) / (29.92 * 13.63).
if SystemConfig = “Pressure” then TRarefaction[3] = 1.
/ – Combined Factor – /
TRarefaction[4] = TRarefaction[1] * TRarefaction[2] * TRarefaction[3] * .075.
/ – Corrected S.P. – */
TRarefaction[5] = SP * 0.075 / TRarefaction[4].
/* – Calculate CFM at each boudary – */
TZoneCFM[1] = exp((TRarefaction[5] / 45.56), 0.5) * 2470.
TZoneCFM[2] = 0.
TZoneCFM[3] = exp((TRarefaction[5] / 43.55), 0.5) * 5097.
TZoneCFM[4] = -186.1 * TRarefaction[5] + 11187.
TZoneCFM[5] = exp((TRarefaction[5] / 33.01), 0.5) * 6310.
TZoneCFM[6] = 0.
TZoneCFM[7] = exp((TRarefaction[5] / 40), 0.5) * 6325.
TZoneCFM[8] = -265.9 * TRarefaction[5] + 15614.
TZoneCFM[9] = exp((TRarefaction[5] / 30.5), 0.5) * 8721.
TZoneCFM[10] = 0.
TZoneCFM[11] = exp((TRarefaction[5] / 45.92), 0.5) * 9437.
TZoneCFM[12] = -268.2 * TRarefaction[5] + 17953.
TZoneCFM[13] = exp((TRarefaction[5] / 31.82), 0.5) * 11382.
TZoneCFM[14] = 0.
TZoneCFM[15] = exp((TRarefaction[5] / 45.83), 0.5) * 11344.
TZoneCFM[16] = -433.7 * TRarefaction[5] + 26485.
TZoneCFM[17] = exp((TRarefaction[5] / 29.82), 0.5) * 16971.
TZoneCFM[18] = 0.
TZoneCFM[19] = -396 * TRarefaction[5] + 32150.
TZoneCFM[20] = exp((TRarefaction[5] / 31.35), 0.5) * 19735.
/* – Set minimum CFM for each boundary equation – */
TminZoneCFM[1] = 1637.
TminZoneCFM[2] = 2314.
TminZoneCFM[3] = 4600.
TminZoneCFM[4] = 4600.
TminZoneCFM[5] = 4912.
TminZoneCFM[6] = 4885.
TminZoneCFM[7] = 6010.
TminZoneCFM[8] = 6010.
TminZoneCFM[9] = 7062.
TminZoneCFM[10] = 6325.
TminZoneCFM[11] = 8338.
TminZoneCFM[12] = 8338.
TminZoneCFM[13] = 9024.
TminZoneCFM[14] = 8808.
TminZoneCFM[15] = 10252.
TminZoneCFM[16] = 10252.
TminZoneCFM[17] = 13899.
TminZoneCFM[18] = 10598.
TminZoneCFM[19] = 16310.
TminZoneCFM[20] = 15763.
/* – Set maximum CFM for each boundary equation – */
TmaxZoneCFM[1] = 2314.
TmaxZoneCFM[2] = 4885.
TmaxZoneCFM[3] = 4885.
TmaxZoneCFM[4] = 5871.
TmaxZoneCFM[5] = 5871.
TmaxZoneCFM[6] = 6325.
TmaxZoneCFM[7] = 6325.
TmaxZoneCFM[8] = 8289.
TmaxZoneCFM[9] = 8289.
TmaxZoneCFM[10] = 8808.
TmaxZoneCFM[11] = 8808.
TmaxZoneCFM[12] = 10580.
TmaxZoneCFM[13] = 10580.
TmaxZoneCFM[14] = 10598.
TmaxZoneCFM[15] = 10598.
TmaxZoneCFM[16] = 15582.
TmaxZoneCFM[17] = 15582.
TmaxZoneCFM[18] = 16310.
TmaxZoneCFM[19] = 19735.
TmaxZoneCFM[20] = 19735.
/* – Set range of fans for each boundary – */
Do TiCount = 1 to 20:
if (TiCount < 4) then TFCFan[TiCount] = “FC13W”.
if (TiCount < 8 and TiCount > 3) then TFCFan[TiCount] = “FC17W”.
if (TiCount < 12 and TiCount > 7) then TFCFan[TiCount] = “FC17W”.
if (TiCount < 16 and TiCount > 11) then TFCFan[TiCount] = “FC23W”.
if (TiCount > 15) then TFCFan[TiCount] = “FC23W”.
if (TiCount < 4) then TwFan[TiCount] = 16.
if (TiCount < 8 and TiCount > 3) then TwFan[TiCount] = 16.
if (TiCount < 12 and TiCount > 7) then TwFan[TiCount] = 24.
if (TiCount < 16 and TiCount > 11) then TwFan[TiCount] = 24.
if (TiCount > 15) then TwFan[TiCount] = 32.
end.
/* – Find min boundary condition equation – /
Do TiCount = 1 to 20:
if (TZoneCFM[TiCount] > TminZoneCFM[TiCount] and TZoneCFM[TiCount] < TmaxZoneCFM[TiCount]) then TuseableZoneCFM[TiCount] = TZoneCFM[TiCount].
end.
/ – Find min boundary condition equation – /
Do TiCount = 1 to 20:
if (CFM > TuseableZoneCFM[TiCount] and TuseableZoneCFM[TiCount] <> 0) then TminZone = TiCount.
end.
/ – Find max boundary condition equation – /
Do TiCount = 1 to 20:
if (CFM < TuseableZoneCFM[21 - TiCount] and TuseableZoneCFM[21 - TiCount] <> 0) then TmaxZone = 21 - TiCount.
end.
/ – Set fan size – */
if TmaxZone <> 0 then do:
FanSize = TFCFan[TminZone].
FanWidth = TwFan[TminZone].
end.
if TmaxZone = 0 then do:
FanSize = “”.
FanWidth = 0.
end.
end.