Citect SCADA - Questions

EICS

Member
Join Date
Dec 2008
Location
Melbourne, Australia
Posts
323
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
 
Q1, you want to pass the value and not the tag name so you would do this.

AssWin("!DevFibSpinAge",250,300,8+64+128+256+1024, sTagBase+"_SPIN_HRS", sTagBase+"_SPIN_ID", "'" + sFiberiser + "'","bOldSpin");


Q2, Your bD1Fib1Prod flag is not really useful and just double handling. I would just delete it and replace it with your calc like below. Also the value of D1_1GlassPull_Tot will retain last value when condition is not true (not in production).

Code:
	IF CW_D1F1CH_OUT = 1 AND FM_D1FIB1_RUN = 1 AND FH_Z302_PV > 900 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;

With this calc after the sleep, would you not want to do this straight away and have it before the sleep function?
FM_D1FIB1_SPIN_TONNES = (D1_1GlassPull_Tot / 1000);
 
Hi Andrew,


thanks for your reply i tried the syntax "'" + sFiberiser + "'" and its exactly what i wanted. i spent way too long on this simple task yesterday, many thanks.



much appreciated. will work on your suggestion to question 2 today
 

Similar Topics

I am trying to display a variable within a cicode function onto a graphics page. This function queries a SQL database. I can get the value onto a...
Replies
3
Views
273
We are trying to set up a newer generation Omron PLC (NX/NS Series) with Citect / Aveva Plant SCADA using the Ethernet/IP CIP Protocol to read...
Replies
2
Views
342
I am new to Citect SCADA and I am building the graphics for a page that will contain the control of a plant by a Kingfisher RTU. The project I...
Replies
0
Views
248
Hi All, I aim to use Aveva Plant SCADA 2020 to read and write data from/to Omron CJ2M CPU35 PLC using OMFINS protocol. However I have Bad Data...
Replies
1
Views
714
Hey, I'm trying to do the following, I have some experience with Citect but can't seem to figure this out. I/O Tag: BoxPos1_ProdNum (Data Type...
Replies
0
Views
573
Back
Top Bottom