Trusted
TM
AN-T80011
Application Note
Application Variable Limit Check
Technical Alert TA20004 describes how an overflow in the numbering of temporary (internal unnamed) variables in a compiled application can cause corruption of I/O variables without warning. This
may occasionally affect large applications but is unlikely in small applications.
This document describes how to check for the temporary variable numbering overflow.
Issue Record
Issue
Number
1 Dec 07 Nick Owens Pete Stock Gerry Creech Initial Issue
Date Revised by Technical
Check
Authorised by Modification
Issue 1 Dec 07 AN-T80011 1
Trusted
TM
AN-T80011 Application Variable Limit Check
1. Application Variable Limit Check
1.1. Compiled file appli.h
Compile the application as normal. When compilation is complete, before downloading or updating,
open Windows Explorer and navigate to the Toolset application folder. This will normally be a subfolder of c:\Trusted\Toolset\apl. In this folder, find a file called appli.h.
The file size is a reasonable guide to the chances of having a problem. This example is just over 2MB
and its temporary variable numbering is still 39% short of the limit.
Open the file using Notepad or another text
editor. The temporary variables are listed in
categories with their internal tagname and
hexadecimal address. If the address is
greater than hexadecimal FFFF (0XFFFF,
decimal 65,536), it rolls over to zero and will
overwrite other data. The category which is
most likely to roll over is the Booleans,
because these include variables for power
flow debugging.
Request a search for the text ‘FFFF’. In
Notepad, select Edit | Find… and type FFFF
in the ‘Find what:’ window. If an address
0XFFFF is found, then there are too many
temporary variables and other data will be
corrupted.
Issue 1 Dec 07 AN-T80011 2