[yapc 99 talks]
YAPC | talks

Robert Rhode

25-minute talk

Producing Commented Source Code from Spreadsheets with XL2E

Performance equations are periodic calculations performed as part of or in conjunction with an automated control system for an industrial process. A large system may use thousands of performance equations (PEs), many of which are identical apart from their specific data points (input variables). Using cut and paste, a programmer may produce up to a couple hundred equations per hour, with a high likelihood of making errors and a low likelihood of adequately documenting the code. However, if the PEs are defined in a consistent, regular format, such as in a table or spreadsheet, then an automated code generation tool can deliver improved speed, reliability, and accountability.

XL2E is a PERL script that reads an engineering requirements specification from a tab-delimited text file, such as a spreadsheet saved as text, and produces fully commented PE source code. The spreadsheet input describes the performance equations, and the output is the implementation of the performance calculations in EDICT source code. The entire input spreadsheet is reproduced in tabular form as comments, with executable code interspersed between commented equation definitions. Using XL2C, hundreds of equations can be processed in a minute, error-free, with each equation annotated with the customer's own original specificaation. Furthermore, by using the original requirements specification as documentation, the programmer can be confident that the implementation does exactly what the customer requested.

EDICT is Exele Information Systems' PE add-on for PI Data Archive. With respect to XL2E, EDICT may be viewed as a special-purpose C preprocessor. PI, from OSI Software, Inc., is the leading data archive product in the industrial automation market. Exele sells versions of EDICT that work with FORTRAN, C, and VB, and that run under VMS, Unix, or Windows NT.


Kevin Lenzo
Last modified: Fri May 7 16:05:27 EDT 1999