Citect Scada 2018 - IOServer stops when transferring data between Array's

Hi,

When I try to move data from one array defined in Cicode to an array defined in Variable Table, the IOServer "halts" and sometimes stops and then restarts.

My Simple test code in Cicode Editor is as follow:
REAL HPCData[8760];
FUNCTION Transfer()
INT i;
FOR i = 0 TO 8760 DO
  HPCPerfDatahttps://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f4a1.svg = HPCDatahttps://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f4a1.svg;
END
The Variable Array HPCPerDatahttps://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f4a1.svg is defined as follow:
TagName: HPCPerDatahttps://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f4a1.svg
I/O Device: GENERIC
Data Type: REAL
Address: R1[8760]
If I reduce the array size, the IOServer is not halted/stopped that frequently. As an array may have 32767 elements according to help files, this number should not be an issue.
Appreciate any input that can help enlighten what's going on and perhaps there are some good best practices in Citect on how to work efficient with Arrays. 
Thanks,
Rune
Parents
  • Hi Rune,

    First thing: when performing large FOR or WHILE loops, always put a SleepMs(0) statement in the loop to prevent your cicode from locking up other Citect processes.

    On array limits in Citect this is what the documentation says:
    In the "GENERIC" protocol help, a limit of 16376 elements is mentioned for the REAL datatype, not 32767.

    As for cicode arrays, help states (topic "Compile Error Messages") that there is a memory limit of 60kB per array, which translates to max. 7680 elements for (64 bit) REALs. If that limit is exceeded a compiler error "Cicode data limit reached" should be thrown.
    My personal understanding however is that in the past cicode arrays could always be declared up to 64kB (8192 elements) and I'm not 100% sure but I thought they increased that limit in newer Citect versions to 8192kB (over 1,000,000 REAL elements).

    In any case, the exception you are experiencing should never occur for going over the maximum array size. Perhaps the I/O server chokes on the many tag writes it has to perform in one go. Putting in a SleepMs(0) command should prevent that.

    Furtermore: do you have the "Persist" option set to TRUE or FALSE for this I/O device? If it is set to TRUE then it saves all values to disk as well, which might cause disk performance issues. Again, applying some sleep time in your loop might prevent this.

    If the problem persists, best option is to contact support for this issue. If you have the crash reports and dump files it might help them.

    Last thing:
    In v2015 there is a known bug (bug 60143) that can cause exceptions when writing to memory I/O device array tags.
    Maybe this bug has re-appeared in v2018?

    Best Regards,
    Patrick
Reply
  • Hi Rune,

    First thing: when performing large FOR or WHILE loops, always put a SleepMs(0) statement in the loop to prevent your cicode from locking up other Citect processes.

    On array limits in Citect this is what the documentation says:
    In the "GENERIC" protocol help, a limit of 16376 elements is mentioned for the REAL datatype, not 32767.

    As for cicode arrays, help states (topic "Compile Error Messages") that there is a memory limit of 60kB per array, which translates to max. 7680 elements for (64 bit) REALs. If that limit is exceeded a compiler error "Cicode data limit reached" should be thrown.
    My personal understanding however is that in the past cicode arrays could always be declared up to 64kB (8192 elements) and I'm not 100% sure but I thought they increased that limit in newer Citect versions to 8192kB (over 1,000,000 REAL elements).

    In any case, the exception you are experiencing should never occur for going over the maximum array size. Perhaps the I/O server chokes on the many tag writes it has to perform in one go. Putting in a SleepMs(0) command should prevent that.

    Furtermore: do you have the "Persist" option set to TRUE or FALSE for this I/O device? If it is set to TRUE then it saves all values to disk as well, which might cause disk performance issues. Again, applying some sleep time in your loop might prevent this.

    If the problem persists, best option is to contact support for this issue. If you have the crash reports and dump files it might help them.

    Last thing:
    In v2015 there is a known bug (bug 60143) that can cause exceptions when writing to memory I/O device array tags.
    Maybe this bug has re-appeared in v2018?

    Best Regards,
    Patrick
Children
No Data