Quick Links: Command Line Command Reference Scripting INI File Entries
sdBatch is an interactive program that allows changing groups of points (matching a point name mask) to the same settings.

sdBatch Program Window
The sample program window above shows sdBatch restarting after an earlier session left the pattern as the regular expression 'C310' (which will match the string 'C310' anywhere within a point name). Below the program version and copyright notice, sdBatch 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).
sdBatch 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 sdBatch loads.
Parameter Value Description -config= sdBatch.ini Alternate name for the INI file to be used for the session. -script= somefile.ext Name of an sdBatch script to be executed when sdBatch loads.
sdBatch accepts user input through a single line command field, located at the bottom of the main window. sdBatch 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 help none Display a short, on screen command list. This is intended as a quick reminder -- NOT a replacement for reading the manual. ? none exit! none Exit sdBatch immediately. No prompt is displayed. exit none Exit sdBatch after confirmation via prompt message box. about none Display the standard 'About' dialog box. shmre none Show most recent command entries clmre none Clear most recent command entries. ----- Admin Commands ---- 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 none clear [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 sdBatch 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.
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 sdBatch on the changes being submitted to SDB log open/close Open (or close) a log file which will record everything displayed in the sdBatch 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
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 sdBatch.
In order to emulate the USEC/PGDP MODCOMP alarm system, the database import utility program (CADP2CSV2) generates alarm limits using the following rules:
HIGH: HighCritical = HighAlert WARN: HighWarning LOW: LowCritical = LowAlert = LowWarning ROC: RoA = RoDThese 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 <= HighCritIn 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.
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
sdBatch 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. [link TBD]
Any command that may be manually entered into sdBatch may be included in an sdBatch script file. In fact, an sdBatch script file is, quite simply, an ASCII text file containing a series of sdBatch 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.
The sdBatch INI file is located, by default, in the C:\PICS\Config folder (along with all other PICS INI files). In general, one should never need to access this file directly because sdBatch updates it with all of the settings in effect when the program is exited. However, examples and descriptions are provided here for the curious.
Section Item Possible Value(s) Description Settings Pattern Type regexp or custom Tells sdBatch what type of pattern matching to use with the pattern provided. REGEXP is an accepted standard pattern matching system, CUSTOM Region KB 4 Size of the IPC command region used between sdBatch and SDB. Because batch commands are very concise, the default value of 4KB should always be sufficient. Log File 0 When zero, this setting indicates that the log file is closed. When non-zero, the log file will be opened as soon as sdBatch starts up. Log File Name sdBatch.log Name (and possibly location) of the log file being used. Verify off, on, or auto [future] This setting will determine what kind of change verification sdBatch performs on its own. Currently, the user must issue a VERIFY command, no verification is performed automatically. Pattern as appropriate by pattern type The last pattern string used in the pervious session. Will be the initial pattern in the next session, too. User-Alarm sdBatch Change Username for alarm record changes. This should be changed to the name of the user running sdBatch. User-Point sdBatch Change Username for point record changes. This should be changed to the name of the user running sdBatch. Comment-Alarm Automated sdBatch Change Procedure Comment for alarm record changes. This should be changed to the name of the user running sdBatch. Comment-Point Automated sdBatch Change Procedure Comment for point record changes. This should be changed to the name of the user running sdBatch. Point Type Analog, Digital or Any This may further limit the points that match a pattern to a specific class (analog or digital). Colors Error Foreground RGB(0xFF,0xFF,0xA0) sdBatch uses your current windows color settings for the main window background and text. It uses the highlight colors when echoing your input. For other messages, it uses these three color pairs. The RGB color sets specific the amount of red, green and blue in the color with values from 0x00 to 0xFF (or 0 to 255) for each. Error Background RGB(0xD0,0x00,0x00) Warning Foreground RGB(0xFF,0x00,0x00) Warning Background RGB(0xFF,0xFF,0xFF) Info Foreground RGB(0x00,0x90,0xB0) Info Background RGB(0xF5,0xF5,0xFF) MRE DO NOT MODIFY this section. It is for internal program use ONLY. The MRE section contains the Most Recently Entered command history. sdBatch uses this to maintain the command history between executions. This section may be safely deleted, but modification is discouraged and the results due to modification errors are undefined. Window Position DO NOT MODIFY this section. It is for internal program use ONLY. The window position section is used by sdBatch to save (and restore) the program's position and size on your display. This allows sdBatch to always return in the exact same location when restarted.