CitectSCADA Cicode Function Q.

MatsterAu

Member
Join Date
Jul 2013
Location
Australia
Posts
9
Need to run up a pop up box at a certain time of day.
At the moment i've done it as such....

FUNCTION
STRING sTime;
//Set sTime to "00:00" Format.
sTime=Time(0);
//Run Message at 6am and 6pm each day
IF "06:00" = sTime THEN
Message("info", "Reminder!, infoText^".", 0);
END
IF "18:00" = sTime THEN
Message("info", "Reminder!, infoText^".", 0);
END
Sleep(45)
END

Needing to know if that look right to all, or if there's a better way to run it.
At the moment i'm getting the Time and setting a string.
Then comparing that string to the time needed and running the message.\

All compiles but i can't run it until tomorrow, wanting to get a head start if someone can help.
 
It's been many years since I did any Cicode but if memory serves me you can set up a function to run based on a time. I did a project once where I set up the system to back everything up at the end of the day every Friday.

I wrote the function to do the backing up (or the pop up in your case) and then, within the Citect environment, there was a menu where I could set up a daily/weekly/monthly function and I just set the time and pointed it at my function. It just used the PC clock for the time.

Maybe that would be an easier / more elegant solution? Otherwise you are running the function all the time and only really need it twice a day?
 
It's been many years since I did any Cicode but if memory serves me you can set up a function to run based on a time.

That would be the best way, it is called an event and is located in the system menu in the project editor.
The help documentaion is fairly clear in its operation but if you have any issues post back and we can help you out.
 
Terrific thanks for your help.
Event will much much easier.

So i've created an Event
Name:Global
Time: 06:00:00
Period: Blank (Looks like it defaults to 1day after time specified)
Action: DailyMessageInfo()
Comment:

Then cicode is just,

Function DailyMessageInfo()
Message("info", "Reminder!, infoText^".", 0);
END
 

Similar Topics

I'm trying to design a custom alarm page as I'm preparing for a project launch. So far I have learnt that I need to use CiCode functions such as...
Replies
6
Views
4,302
Hi guys, I am currently working out my project. Right now i am having a diffculty in writing my scada because my supervisor requests me to...
Replies
3
Views
2,665
Hello, i would like make a simpe cicode program. I just wanna change an object color when the mouse on it. Im new in cicode so in 1st step I just...
Replies
16
Views
10,952
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
930
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
912
Back
Top Bottom