Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 2.10

Question: Can we compile off line with a backup system and link to run time environment? 

You can compile your project on the file server and then tell the running Citect to shutdown and restart on the new project. You don't have to recompile the project on any of the other Citects. Common problems are the drive mapping's are different on each computer or each computer has it unique copy of the project. The recommend procedure would be to setup your projects as follows:
  • Project Run A
  • Project Run B
  • Project Dev

You have 3 master projects which can just be an include of all the other projects. The plant is running on project Run A. Make any modifications to the Include or development project and compile it in the Dev project. When testing has been completed for the changes in the Dev project, copy any data from this project to the Run B project. If the Dev project is just a set of INCLUDE records with not other data you don't have to do this. The Project Run B is compiled. Now shutdown the running plant Citects and change their active databases from Run A to Run B and then restart.

With this procedure you are not working on the running project and you always have a backup project. So if Run B fails you may easily switch back to Run A. As you know with Citect you may have many Run projects as required. In future versions of Citect this procedure will become automatic on a network and this configuration of projects will be compatible with this future method.

You may also make the restarting of the plant Citect automatic as follows:

Make Citect into the program manager as detailed in the KB article Q1084. This will cause Citect to be started when Windows is started and it will also cause Windows to be shutdown when Citect shutdown. You then also modify the AUTOEXEC.BAT file so that when Windows is shutdown you restart Windows again. With this method when you shutdown Citect it will shutdown and restart. The only extra problem is you must update the CITECT.INI file to switch to the new project.

The way to solve this problem is to place all the CITECT.INI files on the file server and then each computer is started you copy the CITECT.INI file. See example AUTOEXEC.BAT file below:

REM login to file server

REM restart windows after Citect shutdown
GOTO loop

This method has the advantage that you now have central control and maintenance of all the INI files on your network. Just create unique INI files for each Citect, best to use the Node name as the name of the INI file.

Now the only problem is how to tell the remote Citect to shutdown. There are several methods on how to do this. The simplest method is to open the Cicode window with the command CICODE ALARM. This will open the cicode window and attached it to the ALARM server, if you then type in Shutdown(), the Shutdown function will be called on the ALARM server and that computer will shutdown. This is a very handy method for remotely controlling Citect Servers. This is quick and simple method however if you are a Citect Client you can only shutdown Servers you are attached to (cannot shudown standby servers), or if you are a Server you can only shutdown Clients attached to you. Because of this limitation it is better to write a simple cicode task which polls a DISK PLC variable. For example:

      Sleep(2); ! wait for the write to be completed
   Sleep(60); ! go to sleep for a while

You should create one disk PLC variable for each Citect node on your system (you could also use a database table with one record for each node and put the node name as part of the record). This way you can restart one or all Citect on you plant as required. Then draw up a page with Buttons which allow you to set these bits to force a restart. For example:

Computer Buttons
Alarm Server {Restart Button}
IO Server {Restart Button}
Node 1 {Restart Button}
Node 2 {Restart Button}

All Citects {Restart Button}

You can keep going by adding a command to this page so that it will automatically set the [CtEdit]Run in all of your INI files to the correct Project, via the function, WndPutFileProfile(). This will save you having to edit all the INI files for each Citect.

STRING ComputerNames[4] = "ALMSRV", "IOSER", "NODE1", "NODE2";

FOR i = 0 TO MaxNodes DO
   WndPutFileProfile("CtEdit", "RUN", "RunA", "F:\CITECT\INI\" +     ComputerNames[i] + ".INI");

As you can see with a few simple tools you can fully automate your procedures and gain centralised control.