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

Question: I am getting the hardware error 'Cicode stack overflow', what causes this error and how can i fix it? 

The hardware error 'Cicode stack overflow' will be generated when the Cicode evaluation stack overflows. The Cicode stack is used to store local function variables and function calls. If you have many nested functions and a large number of local function variables, the Cicode stack may overflow. When the Cicode stack overflows, the Cicode that caused the overflow will be halted.

You can increase the size of the Cicode stack with the parameter [CODE]Stack=256. The default value is 128 and you can configure up the stack up to 1024. (Setting large stack values will consume more memory for each running Cicode thread.) You can estimate the size of the stack by counting the maximum number of local function variables in the deepest function calls. For example, if function A has 10 variables and calls function B with 30 variables which calls function C with 40 variables, the stack will need to be 10 + 30 + 40 = 80 deep.