Applies To:
  • CitectSCADA 5.xx

While debugging my Cicode, I get an 'Out of memory' error (code 272) immediately after stepping through PlotClose(hPlot). A section of my Cicode looks like this:

    hPlot = PlotOpen(21, "Display", 1);
    PlotText(hPlot, DspFont("Helv", 12, White, Red), 0, 200, 460, "Stuff");

I know the code works, since it works fine on all my other machines running with 128MB RAM. I checked my system memory before executing the Cicode and found it to be low, but not too low. For good measure, I installed another 128MB memory card for a total of 256MB RAM and still get the error.


The 'Out of memory' error is rather misleading, perhaps generating the fear that there may be a memory leak in the system causing the error. You must make sure that the PlotOpen command is referencing the correct AN. Also, if an AN is assigned to an object of the wrong type (i.e. an AN assigned to a graphic object instead of a Cicode object), this, too, can generate the 'Out of memory' error. Please make sure the plot is either an AN (must enable the 'Show version 3.xx/4.xx tools' check box in Graphics Builder | Tools menu | Options) or Cicode object. It is recommended you use a Cicode object.

The following note can be found in the Online Help when clicking on the plot handle (hAN) argument for the PlotOpen function:

NOTE: Do not use an animation point number at which a graphic object exists, as this will cause the PlotOpen function to fail.