Specifications
Section 6. Data Table Declarations and Output Processing Instructions
WorstCase (TableName, NumCases, MaxMin, Change, RankVar)
Allows saving the most significant or “worst-case” events in separate data
tables.
To use WorstCase, a DataTable sized to hold one data storage event must be
created to act as the event buffer. Data can be stored to the table using the
DataEvent instruction or some other trigger condition.
The user must create an algorithm in the program by which to test the
WorstCase event. The algorithm should calculate a numerical ranking value of
the event, which is stored as a variable. When WorstCase is executed, it checks
the ranking variable . If the value of the variable is a new worst case, then the
data in the event table will replace the data in the table which holds the least
significant event currently stored.
Multiple WorstCase events can be saved. The number of WorstCase events is
specified with the NumCases variable. A separate table is created for each of
the WorstCase events. These tables use the name of the DataTable with a two-
digit number appended to the end (i.e., a table called Temp's WorstCase tables
will be named Temp01, Temp02, Temp03…). An additional table, nameWC
(e.g., TempWC), stores the rank variable values for each of the worst case
tables as well as the last time to which each table was written.
If the data storage event table is stored on a compact flash card all the worst
case tables will be stored on the same card. Because the WorstCase instruction
requires the capability of erasing and writing over data, CPU Flash memory
cannot be used with WorstCase.
While WorstCase acts as Trigger Modifier and a data table declaration
(creating the cloned data tables), it is entered within the program to call the
worst case tables (see example).
Parameter
& Data Type
Enter
TableName
name
The TableName parameter is the name of the DataTable for which to create WorstCase
Events. The length of this name should be 6 characters or less so the complete names of
the worst case tables are retained when collected (see NumCases).
NumCases
The number of “worst” cases to store. This is the number of clones of the data table to
create. The cloned tables use the name of the table being cloned (up to the first 6
characters) plus a 2 digit number (e.g., Evnt01, Evnt02, Evnt03, …). The numbers give
the tables unique names, they have no relationship to the ranking of the events.
MaxMin
A code specifying whether the maximum or minimum events should be saved.
Constant
Value Result
0
Min, save the events associated with the minimum ranking; i.e.,
Keep track of the RankVar associated with each event stored.
If a new RankVar is less than previous maximum, copy the
event over the event with previous maximum)
1
Max, save the events associated with the maximum ranking;
i.e., copy if RankVar is greater than previous lowest (over event
with previous minimum)
Change
Constant
The minimum change that must occur in the RankVariable before a new worst case is
stored.
RankVar
Variable
The Variable to rank the events by.
6-6