CitectSCADA Symbol animation

kjell_inn

Member
Join Date
May 2014
Location
Ålesund
Posts
2
Hello!

I am currently working on a school project where i'm using CitectSCADA. This is a new program for me and i'm not that familiar with it's functions and uses.

The problem i have is:

I'm trying to animate the inner of an sentrifugal seperator, and the different stages in the seperator. Trying to use the animted symbol functions does'nt work well as it loops continuesly, and when the Command that activates the animation is turned off and on again the animation continues from where it starts, i want it to start at the beginning again.

My next try was to use an array symbol and construct an function that controls the array and switches the symbols. But with my lack of experience with Cicode and text programming that was eiter no success.

I tried to make an function that looks like this:

INT
FUNCTION
KjellAnimation(INT anmCmd)
INT i = 0;
WHILE ((anmCmd = 1)AND (i>100)) DO
i = i + 1;
SleepMS(500)
END
RETURN i;
END

Tried an version with an FOR loop but no success. Maybe i'm not understanding the loops and functions correctly. For example can an function return multiple values or will a return end the function?

Kjell
 
Hi Kjell,
From my reading of the help files RETURN should not end the function, just transfer the value back to the calling source. Is 'i' what you are using to animate your graphics in the array? If so, how does the WHILE statement ever be true if 'i' starts out at less than 100 (WHILE ... AND (i>100)? If you want 'i' to increment from 0 to 100 then maybe the statement should be WHILE ((anmCmd = 1) AND (i<100) DO... Also the Help file says the RETURN should be in the executable portion of the code, so perhaps it should be after the SLEEP and before the second END.... hope this helps!
 
Hi Kjell,
From my reading of the help files RETURN should not end the function, just transfer the value back to the calling source. Is 'i' what you are using to animate your graphics in the array? If so, how does the WHILE statement ever be true if 'i' starts out at less than 100 (WHILE ... AND (i>100)? If you want 'i' to increment from 0 to 100 then maybe the statement should be WHILE ((anmCmd = 1) AND (i<100) DO... Also the Help file says the RETURN should be in the executable portion of the code, so perhaps it should be after the SLEEP and before the second END.... hope this helps!

Thank you for the answer.

The value of ‘i’ is the value im using to animate the picture:
When ‘i’ is 0 show picture zero wait the sleep time and increment ‘i’ show picture 1 and so on.

Yes you’re right about the i>100 and return, a little typing error from my side as I am testing how the function behaves with different parameters.

As now for testing the function I’m calling the function to a numeric display, and the argument anmCmd is an on/off switch with the name Pump_1_Run:

2h5iex5.png


Here is the function I’m using now for testing and trying to get a incrementing function:

INT
FUNCTION
KjellAnimation(INT anmCmd)
INT i = 0;
WHILE ((anmCmd = 1)AND (i < 100)) DO
i = i + 1;
RETURN i;
Sleep(1);
END
RETURN 101;

END

While the Pump_1_Mode(anmCmd) is equal to 0 the function returns 101 to the numerical display. But while its equal to 1 the function returns 1 to the numerical display, and doesn’t loop and increment i. As I understood from the description of functions the function will return a integer when the INT is placed before the function.
 

Similar Topics

Hello everyone! I have a question about the allowable syntax for an expression in CitectSCADA. If I wanted an advanced alarm to trigger based on...
Replies
2
Views
924
Hello, Just wondering if it is possible to make internal CitectSCADA project tags available to an OPC server. (Schneider OFS). There are...
Replies
0
Views
910
Hello, This may not be the place for this but im curious of anyone has worked with CitectSCADA 2018 and windows sessions. Any feedback would be...
Replies
0
Views
1,581
Hi Guys, I am still trying to learn citectscada and curious about the how the hmi stores the alarms (active, historical, etc). I could see a...
Replies
1
Views
1,248
I want to make an application in C# .Net to read Tags from CitectScada (Local variables, Variables tags, Digital Alarms ...) so that I can process...
Replies
1
Views
1,588
Back
Top Bottom