Applies To:
  • CitectSCADA 5.xx, 6.00

Summary:
How many arguments can be passed into a cicode function?
 

Solution:
Prior to Version 6.0r1 the maximum number of cicode arguments was approximately 16.

This has been modified to allow for a 64KB of space for cicode functions, assuming that each argmument will occupy 4bytes, considerably more room is available for cicode arguements.

If this does become an issue with your project, it would be possible to create a multi call cicode
function such that:

MyFunc(1, arg1, ..., arg9); //To load parameters 1 - 9

MyFunc(10, arg10, ..., arg19); //To load parameters 10 - 19

MyFunc(20, arg20, ..., arg29); //To load parameters 20 - 29

MyFunc(-1); //To execute using all parameters


!Must
Declare a Global variable For Each argument here

INT MyFun_arg[100];

INT Function MyFunc(INT Type, INT Argx0, INT argx1, ....., INT argx9)

    If Type = -1 Then

        !Do Execution Call

    Else

        MyFunc_Arg[Type + 0] = Argx0;

        ...

        MyFunc_Arg[Type + 9] = Argx9;

    End

End



Note:

1. Designing a cicode function with a lot of arguments does cause excessive use of the stack, which can then make the Citect32 application susceptible to a stack overflow.

2. The above function is intended to be called by a single calling thread and is not to be used by multiple threads simultaneously.

 

Keywords:
Cicode Argument  

Attachments