Applies To:
  • CitectSCADA
  • CitectHMI

Summary:
I have a Windows2000 dual CPU Server which helps to optimise CPU load. However, my trend system consistently hangs on shutdown around 80% of the time, thus creating a loss of trend data. However, I have found that if I manually force Citect to run on 1 CPU during shutdown, then I do not have the problem. Is there a way to force Citect to always use 1 CPU? 

Solution:
Since Citect does NOT completely support multi-processors (at the time this article was published), as problems like the one mentioned above may occur, the following may help to work around issues that have in fact been determined to be the direct result of using multi-processors:

The ImageCfg.exe utility must be used either from the Support\Debug\i386 folder of a Windows NT 4.0 CD-ROM, or from the Windows 2000 Server Resource Kit Supplement One.

WARNING: Do NOT use the ImageCfg.exe tool on any Kernel operating system files, as the Windows NT and 2000 Kernel retains complete control over which applications use the processor. The Kernel also has the ability to remove a program from the processor (by removing it from memory) in case a program (i.e. like the trend system mentioned earlier) decides to hang or crash, thus effecting a more stable operating environment, as the rest of the system is unaffected. Also, after permanently setting the processor affinity, if any service packs or hotfixes are applied, then the affinity settings will become lost and will need to be reset. This is because the Citect Runtime instance (Citect32.exe) gets replaced each time either a service pack or hotfix is applied. To countermand this, it is suggested you create a batch file that will run the following ImageCfg.exe command line every time Windows starts up.

To permanently set the processor affinity for your 32-bit executable program, open the MS-DOS Command Prompt (CMD.exe) and type the following command line:

    i magecfg -a 0xN "<Drive Letter>:\<Path>\<MyTask>.exe"

...where 0xN is the affinity mask. The mask constrains your application to a specific CPU, starting from 0 and ending at 31.

This will update the value for the ProcessorAffinityMask sub key in the Windows Registry (RegEdt32.EXE) at the following location:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NDIS\Parameters

Processor Affinity Mask Table:

CPU MASK
0 0x1
1 0x2
2 0x4
3 0x8
4 0x10
5 0x20
6 0x40
7 0x80
8 0x100

To set the affinity for the Citect Runtime to processor 1, you may type the following command line (NOTE: paths may vary depending on the Citect installation directory, and affinity masks may vary depending on the operating system used - Win2000 Professional has a limit of 2, Win2000 Server has a limit of 4, Win2000 Advanced Server has a limit of 8 and Win2000 Datacenter Server has up to 32):

    imagecfg -a 0x2 "C:\Citect\Bin\Citect32.exe"

The following is an example of the response you may receive based on the aforementioned command line:

C:\Citect\Bin\Citect32.exe contains no configuration information
C:\Citect\Bin\Citect32.exe contains a Subsystem Version of 4.0
C:\Citect\Bin\Citect32.exe updated with the following configuration information:
Process Affinity Mask: 00000002

When launching the Citect Runtime task (Citect32.exe) its affinity should now be set to CPU1.

Note: you can disable hyperthreading by using the following:

imagecfg -u "C:\Citect\Bin\Citect32.exe"

 

 

 

 

UPDATED: Modifications have been made to CitectSCADA version 6.00 service pack A to allow the processor affinity to be set from an INI file parameter. Please refer to Q4231.

This Knowledge base article is no longer relevant for users of CitectSCADA version 6.10 and higher as Citect32.exe has been modified into separate server and client components that can be configured to run on separate CPUs and/or processes. These modifications improve both the performance and stability of the CitectSCADA runtime environment. For more information, see KB Q4227.

 


Keywords:
Process Binding, Processor Control, Dual-Processors, Multi-CPU Servers, Multi-Microprocessors, Dual-Microprocessors, Central Processing Unit, Image Configuration Tool  

Attachments