EICS
Member
I have been tasked with a lot of cicode, i'm an electrician so its not my strong point but i am coping.
anyway my questions are simple for someone with experience.
Q1
i just need to know the correct syntax for passing a substitution string to a super genie, i am getting association errors.
i want to pass the string sFiberiser(variable) to the super genie in place of "'D2 Fiberiser 4'" the code works as i do get D2 Fiberiser 4 displayed on the super genie,its just not a variable
FUNCTION
Oldest_Spinner(STRING sTagbase)
INT bOldSpin; ! Check on commissioning
STRING sFiberiser = sTagbase; ! sTagbase is Passed from another function
AssWin("!DevFibSpinAge",250,300,8+64+128+256+1024, sTagBase+"_SPIN_HRS", sTagBase+"_SPIN_ID", "'D2 Fiberiser 4'",
"bOldSpin", sTagBase+"", sTagBase+"", sTagBase+"", sTagBase+"");
WinTitle("D1 Spinner Excessive Hours !");
END
Q2
With the following Function i am trying to totalisea flow rateof molten glass.
the Real World tag "FH_Z302_PVM" from instrumentation is the Pull Rate (The flow rate) of the glass in kG/Min typically 10.0kg per minute.
so i run a continuous task every minute via "while True do" function and before it loops i use "Sleep(60)" pause for 60 seconds.
if the boolen tag bD1Fib1Prod = 1 it is to start totalising (in production) this works well
my question is does this concept look right?
FUNCTION
Spinner_Pull_Rate()
// Start Values of D1 Pull rates
REAL D1_1GlassPull_Str;
// Average Values of D1 Pull rates
REAL D1_1GlassPull_Avg;
;
// Totalised Values of D1 & D2 Pull rates
REAL D1_1GlassPull_Tot;
// Booleen tags for Position "Production Status"
INT bD1Fib1Prod ! D1 Fiberiser 1 is in Production
WHILE True DO ! Continuous Loop (every 60 Seconds)
! *********** D1 Positions in Production **********************************************************
! if Cullet Chute Out AND Spinner Running AND Glass > 900 THEN D1Fib1 is in production.
IF CW_D1F1CH_OUT = 1 AND FM_D1FIB1_RUN = 1 AND FH_Z302_PV > 900 THEN bD1Fib1Prod = 1;
ELSE
bD1Fib1Prod = 0;
END;
! *********** D1 Production Glass Totalising **********************************************************
! D1Fib1 is in Production - Totalise the Spinner Pull
IF bD1Fib1Prod = 1 THEN
D1_1GlassPull_Avg = ((D1_1GlassPull_Str + FH_Z302_PVM) / 2); ! Average the pull over 1 Minute (the pull at start of minute + Pull at End of minute / 2)
D1_1GlassPull_Tot = (D1_1GlassPull_Tot + D1_1GlassPull_Avg); ! totalise by adding the last value with new value "every minute"
END ! IF Statement end
Sleep(60); ! Run Every 60 Seconds
FM_D1FIB1_SPIN_TONNES = (D1_1GlassPull_Tot / 1000); ! Convert kG to Tonnes
! *********** Capture the "Start of Minute" Values of all Positions **********************************************************
D1_1GlassPull_Str = FH_Z302_PVM; ! D1 # 1 Glass Pull Rate Instantaneous Value (Start of Minute Value)
END ! WHILE True DO end
END
anyway my questions are simple for someone with experience.
Q1
i just need to know the correct syntax for passing a substitution string to a super genie, i am getting association errors.
i want to pass the string sFiberiser(variable) to the super genie in place of "'D2 Fiberiser 4'" the code works as i do get D2 Fiberiser 4 displayed on the super genie,its just not a variable
FUNCTION
Oldest_Spinner(STRING sTagbase)
INT bOldSpin; ! Check on commissioning
STRING sFiberiser = sTagbase; ! sTagbase is Passed from another function
AssWin("!DevFibSpinAge",250,300,8+64+128+256+1024, sTagBase+"_SPIN_HRS", sTagBase+"_SPIN_ID", "'D2 Fiberiser 4'",
"bOldSpin", sTagBase+"", sTagBase+"", sTagBase+"", sTagBase+"");
WinTitle("D1 Spinner Excessive Hours !");
END
Q2
With the following Function i am trying to totalisea flow rateof molten glass.
the Real World tag "FH_Z302_PVM" from instrumentation is the Pull Rate (The flow rate) of the glass in kG/Min typically 10.0kg per minute.
so i run a continuous task every minute via "while True do" function and before it loops i use "Sleep(60)" pause for 60 seconds.
if the boolen tag bD1Fib1Prod = 1 it is to start totalising (in production) this works well
my question is does this concept look right?
FUNCTION
Spinner_Pull_Rate()
// Start Values of D1 Pull rates
REAL D1_1GlassPull_Str;
// Average Values of D1 Pull rates
REAL D1_1GlassPull_Avg;
;
// Totalised Values of D1 & D2 Pull rates
REAL D1_1GlassPull_Tot;
// Booleen tags for Position "Production Status"
INT bD1Fib1Prod ! D1 Fiberiser 1 is in Production
WHILE True DO ! Continuous Loop (every 60 Seconds)
! *********** D1 Positions in Production **********************************************************
! if Cullet Chute Out AND Spinner Running AND Glass > 900 THEN D1Fib1 is in production.
IF CW_D1F1CH_OUT = 1 AND FM_D1FIB1_RUN = 1 AND FH_Z302_PV > 900 THEN bD1Fib1Prod = 1;
ELSE
bD1Fib1Prod = 0;
END;
! *********** D1 Production Glass Totalising **********************************************************
! D1Fib1 is in Production - Totalise the Spinner Pull
IF bD1Fib1Prod = 1 THEN
D1_1GlassPull_Avg = ((D1_1GlassPull_Str + FH_Z302_PVM) / 2); ! Average the pull over 1 Minute (the pull at start of minute + Pull at End of minute / 2)
D1_1GlassPull_Tot = (D1_1GlassPull_Tot + D1_1GlassPull_Avg); ! totalise by adding the last value with new value "every minute"
END ! IF Statement end
Sleep(60); ! Run Every 60 Seconds
FM_D1FIB1_SPIN_TONNES = (D1_1GlassPull_Tot / 1000); ! Convert kG to Tonnes
! *********** Capture the "Start of Minute" Values of all Positions **********************************************************
D1_1GlassPull_Str = FH_Z302_PVM; ! D1 # 1 Glass Pull Rate Instantaneous Value (Start of Minute Value)
END ! WHILE True DO end
END