beautypg.com

Campbell Scientific CR9000X Measurement and Control System User Manual

Page 193

background image

Section 6. Data Table Declarations and Output Processing Instructions

WorstCase (TableName, NumCases, MaxMin, Change, RankVar)

The WorstCase instruction allows for saving the most significant or “worst-
case” events in separate, cloned, data tables.

To use the WorstCase instruction, the user must create a DataTable
(TableName) that is sized to hold one event. This table acts as the event buffer.
This table may use the DataEvent instruction or some other condition to
determine when an event is stored. The significance of an event is determined
by a numerical ranking of the RankVar. The RankVar's value is set by a user
created algorithm (see example program).

Multiple WorstCase events can be saved. The number of WorstCase events is
specified with the NumCases variable. A separate Data Table is automatically
created for each of the WorstCase events. These Data Tables use the name of
the test Data Table with a two-digit number appended to the end (i.e., a Data
Table named Evnt would have WorstCase Data Tables named Evnt01, Evnt02,
Evnt03…). It should be noted that the same data will not be written to two
WorstCase Tables. So if a trigger has occurred without the requisite # of pre-
trigger records since the last event, the DataTable will not have the specified #
of records. See the DataEvent topic in Section 6.2 Trigger Modifiers.

An additional Data Table that has "WC" appended to the end of the test Data
Table name (e.g., EvntWC for a Data Table named Evnt) is created. This "WC"
Data Table holds the values of the rank variables for each of the WorstCase
Data Tables, and the times that they were last written to.

When WorstCase is executed, it checks the ranking variable and performs the
following:

When checking for Max Worst Cases (MaxMin option set to 1), if the
current value of the ranking variable has a higher value than the lowest
ranked WorstCase clone's recorded ranking variable, then the new data in
the event DataTable will replace the data in this Data Table clone.

When checking for Min Worst Cases (MaxMin option set to 0), if the
current value of the ranking variable has a lower value than the highest
ranked WorstCase clone's recorded ranking variable, then the new data in
the event DataTable will replace the data in this Data Table clone.

WorstCase must be used with data tables sent to the CPU. It will not work if
the event table is sent to the PC card (CardOut).

6-9