Applies To:
  • CitectSCADA 2.01

Summary:
Question: I get the error 'Unit data > 64K' when I startup Citect, what is causing this error? 

Solution:
This error message is generated when the I/O Server tries to allocate memory for all the units on a protocol driver. If there is too many units the total memory may be greater than the 64K limit.

To keep track of the unit status, the protocol driver needs a block of memory for each unit. On startup, the I/O server asks the protocol driver how much memory is required for each unit. The I/O server then multiplies the number of units for that protocol port by the memory required by each unit, and then allocates that memory. If the size of this memory is > 64K the error message 'Unit data > 64K' is generated. Citect will continue to run, however the protocol driver will be unstable and may cause General Protection faults. You should shut Citect down and reduce the number of units. If the problem persists, contact Citect support.

Most protocols use a small amount of memory for each unit, usually only a few bytes, so this is not normally a problem. The disk protocol driver uses a large block of memory for each unit, so you will get this error message if you have more than 44 disk PLCs. You may also get this message if using other third party protocol drivers that use a large block of memory for each unit. If you are a third party protocol developer, the size of the unit data is specified in the drv_info.buf structure, variable Constants.MemUnit. This variable is declared in the xx_init.c file.

This error message was added to Citect in Version 1.20 and 2.01, in previous versions exceeding the 64k limit may cause unpredictable results.

If you are using the DDK to develop your own protocol and you get this message you should reduce you use of this memory. This is not a restriction as your DLL can allocate any extra memory it requires directly from Windows. The best solution is to get Citect to allocate a pointer to a large structure which you allocate. In this way Citect will only have to allocate 4 bytes of memory for each unit and each structure can be very large. 


Keywords:
 

Attachments