You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
Thread Tools Display Modes
Unread July 17th, 2019, 05:55 AM   #1
EICS
Member
Australia

EICS is offline
 
EICS's Avatar
 
Join Date: Dec 2008
Location: Melbourne
Posts: 203
Citect SCADA - Questions

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
  Reply With Quote
Unread July 17th, 2019, 09:27 AM   #2
andrewf
Member
Australia

andrewf is offline
 
Join Date: Mar 2008
Location: NSW
Posts: 78
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);
  Reply With Quote
Unread July 17th, 2019, 04:43 PM   #3
EICS
Member
Australia

EICS is offline
 
EICS's Avatar
 
Join Date: Dec 2008
Location: Melbourne
Posts: 203
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
  Reply With Quote
Unread July 17th, 2019, 09:57 PM   #4
Wasan
Member
Thailand

Wasan is offline
 
Wasan's Avatar
 
Join Date: Jun 2015
Location: Bangkok
Posts: 66
For Q2 if you need to totalize some tag maybe you should use Accumulator function in SCADA.
For more detail check link below.

https://www.youtube.com/watch?v=uRGPHeVQJhY&t=22s
__________________
Wasan Thawon

My Blog: https://scadaskill.blogspot.com/

Facebook Page: https://www.facebook.com/scadaskill

Youtube Channel: https://www.youtube.com/scadaskill
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Citect SCADA 2015 to Citect SCADA 2016 - General question EICS LIVE PLC Questions And Answers 15 April 4th, 2019 06:55 PM
Two Issues with Citect Scada 2016 Picojoe LIVE PLC Questions And Answers 2 November 21st, 2018 09:38 PM
Tag addressing in citect scada james84 LIVE PLC Questions And Answers 17 December 14th, 2015 03:36 AM
Connecting Citect Scada 5.5 to PLC newinscadacitect LIVE PLC Questions And Answers 1 May 10th, 2012 07:52 AM
Export/import tags from rslogix 5k to citect scada james84 LIVE PLC Questions And Answers 1 May 20th, 2010 02:52 AM


All times are GMT -5. The time now is 06:09 PM.


.