MCR2 Advanced Features

Quick Links: Command Line Command Quick Reference Scripting

mcr2 is an interactive program designed to resemble the console command interface used on the previous (MODCOMP-based) plant computer system.

The sample program window above shows mcr2 restarting after an earlier session left the pattern as the regular expression 'C310'. Below the program version and copyright notice, mcr2 displays the match results of the current pattern. Finally, at the bottom of the window is the command edit (input) line, with some text typed into it (but not yet entered).

Command Line

mcr2 accepts two command line parameters, one to specify an alternate INI file and the other to provide the name of a script to run when mcr2 loads.

Parameter Value Description
-config= mcr2.ini Alternate name for the INI file to be used for the session.
-script= somefile.ext Name of an mcr2 script to be executed when mcr2 loads.

Command Quick Reference

mcr2 accepts user input through a single line command field, located at the bottom of the main window. mcr2 will read and attempt to execute commands when the ENTER (carriage return) key is pressed. Some commands (such as value assignments) only echo the command when they work, others may produce large amounts of output (e.g. show alarms). All commands should produce an error/warning message (or multiple error/warning messages) when they fail.

Command Parameters Description
set see below
show see below
check none Check the current pattern, count matches, build PICS type list.
submit none These two commands are synonyms. They send the currently pending changes to SDB for processing and display the result. When the number of matching points doesn't match the number of changed records, a warning is displayed. This is normal because oftentimes, one or more of the matching points already has the new value.
commit
pclear [alarm | point] Clear all pending changes (or clear only pending point or alarm changes, if specified)
eval see below
script somefile.ext Executes the named mcr2 script file.
verify none Submits all pending changes to SDB for verification and reports the results. This command does everything that submit does, with the exception that nothing is actually changed. Everything is checked for consistency, format, range, etc. and any problems should be reported back.
define key name Set/Change/Delete function key definitions
defkey
building bldgname Set/Change the default building. The building name must be one found in this list:  C331, C333, C335, C337, C300, C310, C315
bldg
ANALST These three commands simulate (generally) the database dump utilities from the MODCOMP system for analog, digital and smoke points (respectively). Not all of the fields from the MODCOMP are imported into PICS, some some of the fields in these reports are empty (or zero), but the general format is the same.
DIGLST
SMKLST
MDBIAS Runs the generic version of BIAS3x

SET Commands

The word 'SET' itself is optional when your command is entered in the form 'object=value'. In some special instances, the word 'SET' is required in order to determine that the statement should be preocessed by the SET command handler. This is typically true when you are looking for the current setting of an object (or a quick explanation of how to set and object). The SET command allows you to alter a number of internal program settings as well as a fairly large number of fields from the PICS static database.

The general syntax for a set command (with the option word 'set' enclosed in square brackets to indicate that it is optional)

[set] field=value

Sometimes the value may actually be a list of values, depending on the object being set.

Command Parameters Description
match regexp/custom Change the type of match rules being used
type any/analog/digital Set additional filtering for analog/digital points
verify off/on/auto Change the level of verification performed by mcr2 on the changes being submitted to SDB
log open/close Open (or close) a log file which will record everything displayed in the mcr2 session window from the time it is opened until it is closed. This can be a handy way to get the source for a script (just edit out the unnecessary parts).
logfile filename.ext Change the name of the log file that will be used.
pattern pattern Change the pattern being used to select points
user text Change the current user name. The user name is included in all database changes, for auditing purposes.
comment text Change the comment logged into the SDB audit trail.
errfg/errbg RGB Set the color for error messages. errfg is the foreground, and errbg is the background color.
warnfg/warnbg RGB Set the color for warning messages. errfg is the foreground, and errbg is the background color.
infofg/infobg RGB Set the color for info messages. errfg is the foreground, and errbg is the background color.
echofg/echobg RGB Input echo colors
menufg/menubg RGB Menu display colors
set? none Display internal settable values
point? none Display currently settable point fields
alarm? none Display currently settable alarm fields

NOTE on PICS Alarm Limits

In the USEC/PGDP MODCOMP system, there are only four alarm limits defined: HIGH, WARN, LOW and RoC. In PICS there are eight: HighCritical, HighAlert, HighWarning, LowWarning, LowAlert, LowCritical, RoA and RoD. Also, the USEC/PGDP MODCOMP uses one alarm deadband, where PICS has both a high and low deadband. These differences must be taken into account when changing alarm limits through mcr2.

In order to emulate the USEC/PGDP MODCOMP alarm system, the CADP2CSV2 program generates alarm limits using the following rules:

HIGH: HighCritical = HighAlert
WARN: HighWarning
 LOW: LowCritical = LowAlert = LowWarning
 ROC: RoA = RoD

These rules should be followed as long as compatibility with the MODCOMP system is desired. Under all circumstances, the following rule must be observed when setting PICS alarm limits:

LowCrit         <= 
   LowAlert     <= 
      LowWarn   <
         normal <
      HighWarn  <= 
   HighAlert    <=
HighCrit

In PICS, when an alarm limit is equal to the next WORSE (farther from normal) alarm, only the WORSE alarm will ever be reported. This effectively disables an alarm limit. To disable the critical alarm limits (since they are the WORST), PICS uses the special values of -3.0e38 to disable the low critical alarm and 3.0e38 to disable the high critical alarm. mcr2 recognizes the string 'none' for all alarm levels (but not for alarm deadbands).

SHOW Commands

When you need to see information about what you've done so far or about the points you will be affecting, SHOW is your friend.

Command Parameters Description
pending none Show all currently pending changes, both point and alarm.
match none Show a list of all points that match the current pattern.
alarm/alarms [desired alarm fields] Show current alarms for points matching the current pattern. The alarms shown may be limited to those listed as parameters to this command. Otherwise, all alarms are shown. When listing fields to be shown, you must use a comma separated list with NO EMBEDDED SPACES.
point/points [desired point fields] Show current values for points matching the current pattern. The fields shown may be limited to those listed as parameters to this command. Otherwise, all fields are shown. When listing fields to be shown, you must use a comma separated list with NO EMBEDDED SPACES.
status none Show program status
settings none Show internal program settings
point? none Display currently showable point fields
alarm? none Display currently showable alarm fields

EVAL Commands

mcr2 also supports an EVAL command that allows moderately complex operations to be performed on values and the results to be used when setting, say, an alarm limit. For example, if you have a group of temperatures and you'd like to decrease their high alarm limit by 10%, you could enter the following command:

eval [hc]={hc}-({hc}*0.10)
ha=hc

Notice the special characters around 'hc' in the eval statement above. The square brackets ('[' and ']') tell the eval function that the variable is (or will be) in the pending change set. The curly brackets ('{' and '}') tell the eval function to look in the current static database cache for the values. Any variable not enclosed in either square or curly brackets will be treated as a eval variable and retained until cleared (or until the program terminates).

The second statement is a 'simple' assignment (using an implied SET command) to set the high alert limit to match the high critical limit. This demonstrates a requirement for the users of this program to have some familiarity with the PICS alarm limit system.

Scripting

Any command that may be manually entered into mcr2 may be included in an mcr2 script file. In fact, an mcr2 script file is, quite simply, an ASCII text file containing a series of mcr2 commands that will be entered and executed automatically (instead of being manually typed into the program). Remember that some commands, such as 'exit' pop open a message dialog for user confirmation. You will normally want to avoid interactive command in batch files. However, should you have a need for them, they, too, will work as if someone had just typed them.