|
|
|
|
When PICS Test starts up, the following window is displayed:

Figure 1 - PICS Test Main Window
As you can see after you get past all of the standard Windows controls, the PICS Test window includes a number of extra areas which have meanings specific to itself.
Messages & Information All non-critical messages from PICS Test will be displayed here, along with messages produced by scripts with the Echo() statement.
Status This shows something about the current state of the test program, like whether or not debug mode is in effect (DEBUG). If a number is shown here, a script has paused for that many milliseconds.
Current Line When a script is running, this area shows the line currently being interpreted. This is intended for a 'warm-fuzzy' that the script is still running even when it is not producing any [visible] output.
Data Source The data source currently providing the real time flow. Generally this will be SPDS, SIM, or PPCS.
Plant Mode Current plant operating mode, as set by operations.
Current SPDS Time Shows the current time within the SPDS system. As long as the system is functioning, this value should update about once per second.
The menu provided in the PICS Test window is the primary means of interacting with the program. The following selections are available and will be discussed in the following paragraphs:
Use this menu item to choose a script for execution. After you have selected a script, you will be prompted for the name of a log file. If you press 'Cancel' at this time, the script will run without a log file. (Note that the dialog displayed below is the new, Windows95/WindowsNT 4.0 style, if you're running under Windows NT 3.51, the dialog will appear different, but it will still perform the same function.)

Figure 2 - File Open Dialog Box
Why? There are a number of reasons. Perhaps you are having trouble debugging a script, the log file will contain all of the lines executed, in the order of execution. You may even have the values and names of all of the variables used included (Log Symbols). Perhaps you have a requirement to record the actions and results of a test procedure, a script log could be used to satisfy part or all of that requirement.
Also note that when a script is being logged, debug messages will also be logged when enabled. This will give you very detailed information with which to track down problems in your scripts.
You guessed it, this is how you exit from the program. When you exit, the following things happen:
These options, or more likely the associated hot keys (F4/F5 respectively), allow you to halt script execution without terminating. Since these selections have meaning only when a script is running, they are grayed out (not available) at other times.
There are times when a script may pause itself, for example to have the user verify a test checkpoint. In these situations, the Unpause command (or key) is used to continue with the script. When a script starts a timed pause (a number is visible in the status cell), pressing the Unpause key will continue script execution immediately.
When you are debugging a new script, you may want to execute it one line at a time in order to see when, where and how things happen in your script. The Step key allows you to do this. Any time that a script is paused, you may either continue or step. If you have debug mode enabled, you will be able to see each line in the PICS Test window as is is executed.
If you wish to stop a running script, choosing this (or pressing the Esc key) will do the trick. This is generally used for scripts that (perhaps inadvertantly) contain infinite loops. It is also useful if you discover that you ran the wrong script or decide not to wait for a particularly time consuming script to finish.
When a script is running, the currently executing line number may be displayed on the status line. This menu option allows you to toggle this feature on and off. Scripts run slightly faster when this option is off. Line Numbers are on by default.
The Script Options dialog is used to make changes to some of the options available for a script, while it is running. These settings have the exact same effect as the Option() statement in a script. For a detailed description of the effect of each of these options, see the Option() statement in the Script Programming section of this document.

Figure 3 - Script Options Dialog Box
PICS Test actually maintains three sets of script option settings. Set 1 is the program's compiled defaults. Set 2 (Global) is the user defined defaults for any script which will be run. Set 3 (Local) applies only to the currently running script. PICS Test will display the Global Script Options when no script is running and the Local Script Options when a script is running. Pressing the 'Defaults' button will restore the settings to those found in the next lower set of options, by set number. So pressing the 'Defaults' button when the Local Options (Set 3) are displayed will change the options to match those currently in effect for the Global Options (Set 2).
The 'Pauses Enabled' and 'Global Delay Time' options are only available through this dialog. When 'Pauses Enabled' is not checked, then all script functions which pause will simply continue immediately, as if the user had pressed the Continue key. When 'Global Delay Time' is checked, all TimedWait() functions will use the value specified in the 'Delay (ms)' text field instead of those specified for each function. This allows you to speed up a script once you're satisfied that it is working properly, without stopping, editing and restarting the script.
The Edit Variables menu option displays the following dialog box:

Figure 4 - Debug Dialog Box (Variables)
The radio buttons on the right hand side of the dialog allow you to choose what information is to be displayed in the listbox. On the variables page, there are three buttons which allow you to manipulate the current script's variables by changing a variable's value, adding a new variable or deleting an existing variable. To delete a variable, select it in the list and press the 'Delete Value' button, you will be prompted to confirm your action. Changing and modifying a value use the dialog shown in Figure 5, but the variable name may not be changed when modifying a value.

Figure 5 - Edit Value Dialog
When you press OK, the value (and new variable, when appropriate) will be entered in the variable list. The script will be able to use the new value/variable on the next statement executed. In fact, that's one of the reasons that there's a 'Single Step' button in this dialog. (The other is to allow you to watch the values of variables and parameters while the script runs.)

Figure 6 - Debug Dialog Box (Labels)
The label and parameter lists are for informational use only and may not be modified outside the script engine. Notice that the change, new, delete value buttons are not available for labels or parameters.

Figure 7 - Debug Dialog Box (Parameters)
The first column in the parameter list indicates three pieces of information: the subroutine nesting level, which may go from one to fifteen (level zero is the main line of script execution); the subroutine name [label]; and the parameter name. Notice that all parameters share a single set of names, from Parm.0 through Parm.5, so only parameters local to the current subroutine may be accessed by a script.
The Real Time Point Editor dialog allows you to view and make changes to any point in the Real Time database. Since this can be a very powerful feature, you should be very careful before making changes. The active controls in the dialog are determined by the point's type, as recorded in the static point database. At times (generally before a record has been provided for a point) the real time and static database point types will disagree. When this happens, a message will appear where the arrow indicates, stating 'Data Type Conflict.' This message is only a concern if the point has been provided.

Figure 8 - Edit Real Time Dialog Box (Analog Point)
The point names in the drop-down list box are currently sorted according to the point ID, rather than the names. This may change is future versions.
Most of the controls in this dialog are self-explanatory. However, here's how some of the less than obvious controls work:
Update When you press this button, PICS Test will inform the Real Time Database the PICS Test will be providing data for the current point from this time onward. After the Real Time has agreed, the values you've specified are sent and the program will pause for two seconds to allow time (more than is necessary, in fact) for a complete round trip of the data. It will then refresh the window with the current value which should reflect the changes you've made.
Refresh Since the values of data points may change at any time, you may press the refresh button to see the current values at any time. Note that by pressing the refresh button you will lose any changes you may have made to the point's value.
Release If you are finished working with a point (providing data) you should press the Refresh button ro inform the Real Time Database the the default provider is again responsible for the current point.
Toggle If you are waiting for an external event to change the value of a point, you may use the toggle button to turn on (or off, hence the name) the automatic refresh feature. Just above the toggle button is a text entry field labelled 'Rate' in which you specify the number of seconds which should elapse between automatic refreshes.
Display Range The two text entry fields under this heading (Minimum and Maximum) are available to scripts. Their intent is to allow you to set an acceptable range for a script to generate values within, for example. These values are used only by PICS Test and have no effect on any other applications.

Figure 9 - Edit Real Time Dialog Box (Digital Point)
Whenever you enter a value for a point (analog or digital), PICS Test uses the current plant mode (always zero for SPDS) to test and set the alarm level (or state). This means that you cannot set a conflicting value and alarm for a point. For analog points however, the High/Low Validity and Scan/Math Exception levels will be respected by PICS Test.
For analog and digital points, a Measurement Descriptor Entry (MDE) may be defined. To view the MDE for a point, press the MDE button within the appropriate group box. The MDE record contains information about the point's alarm and validity limits and the associated deadbands.

Figure 10 - Analog Point MDE Display
The Analog MDE entry shows all of the alarm levels defined for an analog point. When a low alarm is defined as the lowest possible floating point value, 'none' is displayed, with the reverse being true for high alarms. When the same value is used for multiple alarm levels, only the highest level of alarm is shown as being defined. For example, if High Warning, High Alert, and High Critical are defined as 100.0, then the High Warning and Alert will be shown as having no alarm defined and High Critical will be shown with a setting of 100.0.

Figure 11 - Digital Point MDE Display
The two entries in a digital MDE indicate whether a particular state for a digital point is considered an alarm state. Digital points may have either, neither or both states defined as alarmed states.
If the Prev/Next buttons available in the MDE dialogs are used to access a point type other than analog or digital, the following dialog will be shown, because no other point types have alarm levels.

Figure 12 - No MDE Display
This standard dialog simply displays information about the program like copyright and version information. Some of this information may be useful if (ok, when) you call tech support for help.

Figure 13 - Help About
When the 'System Info' button is pressed, the About dialog queries the operating system for some information about your particular machine which may be helpful to tech support in determining the causes for any problems you may experience.

Figure 14 - System Information
Within the output window, PICS Test uses some system colors, as follows: Window Text / Background for TtyEcho; Highlight Text / Background for Error messages; and Grayed Text /Window Background for Debug output.
This application has been created to allow the encapsulation and maintenance of standard software test procedures for the SPDS familiy of applications. A large portion of this testing involves setting real time data points to specific values and observing the results through the tested applications.
PICS Test scripts are made up of a sequence of statements which may be either comments or commands. All blank lines are comments along with any line whose first non-blank character is a semi-colon. Commands consist of a command name followed by a list of parameters separated by commas and enclosed in parenthesis. Parameters may be either constants or substituted values. Constants may be quoted to allow the inclusion of spaces and/or commas. Special characters may be included by prefixing them with a backslash character. Substituted values may be either variables local to the script, or elements from the point database. All commands require from zero to six parameters which may be followed by a failure label and a success label, respectively.
Here are some examples:
; This is a comment SetVariable( PID, 0 ) ; This is also a comment
This statement will create the script variable PID (if it doesn't already exist) and set it's value to 0.
Add( PID, <PID>, 1 )
Get the current value of PID, add one to it and store the result back into PID.
IsEqual( [<PID>.InUse], 1, NextPoint )
Get the in use flag associated with the point indexed by the value of PID and compares it to 1. If the value is not equal to 1, then the script will branch to the NextPoint label.
NOTE: Values associated with the point database are READ ONLY. A point's value and quality codes may be changed using the SetPoint(), Increment() or Decrement() commands. Report( [<PID>.Name%-16.16s] " " [<PID>.Description%-32.32s] )
Write a record to the currently open report file containing the name and description of the point associated with the given PID. Note that the result strings will be formatted as specified by the 'C' format strings following the variable names.
IsPidValid( <PID>, NextPoint, GoodPoint )
Tests the given point ID and branches to the label NextPoint if the PID is out of the legal range and to the label GoodPoint otherwise.
Although the PICS Test language does not directly support array variables, they can be approximated by using multiple level variables. For example, you could create the following variables:
SetVariable( evi.0, 17 ) SetVariable( evi.1, 105 ) SetVariable( evi.2, 101 ) SetVariable( evi.3, 260 ) SetVariable( evi.4, 400 )
After these variables have been created, you could create an "index" variable, say i, which may be used as follows to access of the variables, in turn:
SetVariable( i, 0 ) Label( Top ) TtyEcho( "Element " <I> "=" <evi.<i>> ) Add( i, <i>, 1 ) IsGreater( <i>, 4, Top ) ; Return to loop top
This code fragment will print the first five elements of the array to the PICS Test Window. Looking at the TtyEcho() line, you can see that the PICS Test syntax allows you to nest variables within one another. The result of such nesting is the creation of a new variable name. For example, <evi.<i>> is first translated into <evi.0> and then translated into 17 by the interpreter. This allows for arrays dimensioned with things other than sequential integers as well as multi-dimensional arrays.
NOTE: Using arrays can quickly eat up entries in PICS Test's limited variable name space. Currently, only 100 variables may exist at any given time during the execution of a script, however, you may use the DeleteVariable() statement to remove variables which are no longer needed.
The following exit codes are defined by PICS Test (all others are user-defined):
| Code | Meaning |
|---|---|
| 0 | No error |
| 1 | Command Error |
| 2 | End-of-File |
| 3 | Too Many Variables |
| 4 | Label Not Found |
| 5 | Abort (default) |
| 6 | Exit (default) |
| 7 | Default Command Failure |
When a script ends for any reason other than success, the result codes above will be displayed (in English) on the status bar in the format "Script terminated: reason text." Any other result code will be displayed using the format "Script exit code: n," where n represents the user-defined exit code, in decimal.
[point.field] | Where point refers to a data point by name if the first character is a letter and by PID if the first character is a number. field refers to one of the data fields listed in the following tables. |
For example:
[123.Value][RECL-32.PST][<point>.Date]Sometimes, a value will not have meaning at the time it is requested. When this occurrs, PICS Test will return one of the following strings, hopefully indicating what's wrong:
| String | Description |
|---|---|
| #invalid# | The point specified is invalid. This occurs when you specify a point by number rather than name and the number specified is not within the range of existing points. |
| #unknown# | The point specified could not be located in the static database. This occurs when you specify an undefined point name, or an point ID number which refers to an unused entry in the static point table. |
| #error# | The value requested is not available for the given point. This generally occurs when you request an analog only field from a digital point or vice versa. |
The following table contains all of the fields which PICS Test understands. The first set relates to information from the Static Database about a point:
| Field Name | Description |
|---|---|
| Exists | Zero if there is no entry in the Static Database for the associated point |
The following fields have meaning only when the 'Exists' field is non-zero:
| Field Name | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | From the following table:
|
||||||||||||||||||||||
| Name | Name of this point | ||||||||||||||||||||||
| Description | Description of this point | ||||||||||||||||||||||
| MaxVal | Maximum normal display value (analog only) | ||||||||||||||||||||||
| MinVal | Minimum normal display value (analog only) | ||||||||||||||||||||||
| Units | Unit description (analog only) | ||||||||||||||||||||||
| OnState | On state name (digital only) | ||||||||||||||||||||||
| OffState | Off state name (digital only) | ||||||||||||||||||||||
| Color | Display color for this point | ||||||||||||||||||||||
| Format | Display format for this point |
The next set of fields refer to information from the Real Time Database about a point:
| Field Name | Description |
|---|---|
| DataValid | True (non-zero) when the remaining real time data is valid. When this field is false, the value of all other real time fields for this point are undefined. |
The following fields have meaning only when the 'InUse' field is non-zero:
Fields common to all points:
| Field Name | Description |
|---|---|
| Value | Point value (based on the point type) |
| Date | Date of last update (mm/dd/yy) |
| Time | Time of last update (hh:mm:ss am/pm) |
| PS | Point Status (alpha display, see Quality1, Quality2, and AlarmLevel, below) |
| PSX | Point Status (hex value) |
| PointType | |
| PointSide | |
| PointProvider | |
| Revision | |
| AlarmInhib | One means that the point is in alarm inhibit. |
| AlarmHold | One means that the point is in alarm hold. |
Fields common to Analog and Digital points:
| Field Name | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| InTest | One means that the point is in test. | ||||||||||||||||||
| OffScan | One means that the point is off scan. | ||||||||||||||||||
| OpEnter | One means that the point contains an operator (manually) entered value. | ||||||||||||||||||
| Exception | One means that the point is in exception. | ||||||||||||||||||
| Quality1 | A combination of:
|
||||||||||||||||||
| Quality2 | A combination of source (input) points' Quality1 values. This field is only meaningful for computed points. |
Fields specific to Analog points:
| Field Name | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EUAlarmLevel | Blank to show no alarm is present, or one of the following values, based on the point's type. Analog point alarm level:
|
||||||||||||||||||||||||||||||
| EUAlarmLevel# | Analog EU alarm level (0-9) | ||||||||||||||||||||||||||||||
| ValAlarmLevel | Blank to show no alarm is present, or one of the following values, based on the point's type. Analog point validity alarm level:
|
||||||||||||||||||||||||||||||
| ValAlarmLevel# | Analog validity alarm level (0-3). | ||||||||||||||||||||||||||||||
| RocAlarmLevel | Blank to show no alarm is present, or one of the following values, based on the point's type. Analog point rate of change alarm level:
|
||||||||||||||||||||||||||||||
| RocAlarmLevel# | Analog Rate of Change alarm level (0-3). |
Fields specific to Digital points:
| Field Name | Description |
|---|---|
| DigitalValue | Digital point value as either the OnState or OffState name. |
| DigitalValue# | Numeric Digital value (0 or 1). |
| Alarm | Digital On/Off State Name |
| Alarm# | One means that the digital point is in alarm. |
| RawValue | Numeric RAW Digital value (0 or 1). |
Fields specific to the Time point:
| Field Name | Description |
|---|---|
| TimeChanges | Number of time changes since the system was started. |
| TimeQuality | Currently undefined |
Fields specific to System Status points:
| Field Name | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| StatusA -or- StatusB |
State of the specified side, according to the following table:
|
||||||||||||||||||
| PrimaryA -or- PrimaryB |
True when the specified side is the primary side. | ||||||||||||||||||
| DataLiveA -or- DataLiveB |
True when the specified side is receiving data. Serial Time data for 8800 systems and Real Time data for other systems. |
NOTE: The PointSide field should be used to determine which sides are reported in a system status point. An unreported side's values should be considered undefined.
| Real Time Interface | Math Functions | Flow Control | ||
|---|---|---|---|---|
| Decrement Increment IsPIDValid IsTooHigh IsTooLow PostChanges Restore SetPoint |
Add Divide IntegerDivide IsBetween IsEqual IsGreater IsLess IsNear Modulo Multiply Subtract |
Abort Call Exit ExitApp Goto Label Pause TimedWait Return Stop |
||
| Report File | Misc Functions | Variable Control | ||
| Close Open Report |
MenuCommand Option Rem |
CreateVariable DeleteVariable SetVariable |
||
| Screen Output | String Functions | |||
| ClearEchoFields ClearScrollRegion ClearWindow Echo EchoTo RefreshWindow SetScrollRegion SetWindowColor SetWindowSize TtyEcho |
IfMatch InString Left Length Lower Right Substring Trim Upper |
Abort()Immediately terminate execution of the script. If a numeric parameter is present, it will be used as the script result code which is displayed when the script terminates. If no value is specified, then the result code will be 5.
Add( VariableName, Value, Value )named variable = Value + Value
If the named variable does not exist, it will be created.
Call( LabelName, FailureLabel, Parm.0, ..., Parm.5 )Perform a simple subroutine call to the named label. These calls are very similar to interpreted BASIC's GOSUB command in that there are no parameters and all variables and labels are globally visible. Subroutines may call other subroutines, up to a maximum nesting depth of 15 calls. The optional failure label must be included if parameters are going to be used. The Call statement supports up to six parameters, which will be named 'parm.0' through 'parm.5' within the subroutine. Due to the nature of this language, parameters may evaluate to either a value or the name of a variable. For example, using <Parm.0> in a statement would extract the value of the parameter. However, if the parameter is the name of a variable, the parameter's value is the name. To extract the value of the variable, you would use <<Parm.0>> (Note the double eclosing angle brackets).
ClearEchoFields( )Clears all fields created with the EchoTo() statement from memory and repaints the PICS Test client window.
ClearScrollRegion( )Clears all lines from the scroll buffer and repaints the PICS Test client window.
ClearWindow( )Clears all fields created with the EchoTo() statement from memory and repaints the PICS Test client window AND clears all lines from the scroll buffer and repaints the PICS Test client window. This is the same as using both ClearEchoFields() and ClearScrollRegion() one after the other.
Close( )Closes the open report file. This function will fail if there is no open report file.
CreateVariable( VariableName, Value )Creates a new variable as named, using the specified value. This function will fail if the variable already exists.
Decrement( Point, Value )Subtract the specified value from the given point. This function incorporates an internal call to the SetPoint function.
DeleteVariable( VariableName )Removes the named variable from the script's internal variable list. This function will always succeed.
Divide( VariableName, Value, Value )named variable = Value / Value
If the named variable does not exist, it will be created.
NOTE: If the second value is zero, then the script will be terminated.
Echo( MessageText )The specified message is placed in the status bar's information cell (the first cell).
EchoTo( Column, Row, Foreground, Background, MessageText )Create (and updates) an echo field within the PICS Test client window. The column and row are specified in units of character cells (from 1 to n ). The foreground and background specify values from the following list of colors (the second set [16-36] are the Windows system colors, which will vary according to user preferences):
Value Color Name Value Color Name 0 Black 16 Scrollbar 1 Blue 17 Background 2 Green 18 Active Caption 3 Cyan 19 Inactive Caption 4 Red 20 Menu 5 Magenta 21 Window 6 Brown 22 Window Frame 7 Light Gray 23 Menu Text 8 Dark Gray 24 Window Text 9 Bright Blue 25 Caption Text 10 Bright Green 26 Active Border 11 Bright Cyan 27 Inactive Border 12 Bright Red 28 App Workspace 13 Bright Magenta 29 Highlight 14 Yellow 30 Highlight Text 15 White 31 Button Face 32 Button Shadow 33 Gray Text 34 Button Text 35 Inactive Caption Text 36 Button Highlight
Exit()Immediately terminate execution of the script. If a numeric parameter is present, it will be used as the script result code which is displayed when the script terminates. If no value is specified, then the result code will be 6.
ExitApp()Immediately terminate execution of the script and the PICS Test application. This is intended to be used by external command scripts (or batch files) in conjunction with command line parameters to run a series of separate test scripts automatically.
Goto( Label )Unconditional branch (forward or backward) to the specified label.
IfMatch( A, B, failureLabel, successLabel )Used for branching on the result of a string comparison.
Increment( Point, Value )Add the specified value to the given point. This function incorporates an internal call to the SetPoint function.
InString( String, Target, VariableName )Stores the location of target in string into the named variable. May be used for flow control by specifying a failure and/or success label
IntegerDivide( VariableName, Value, Value )named variable = Value / Value
If the named variable does not exist, it will be created.
NOTE: The fractional parts of any floating point values used as arguments to this function are ignored. If the second value is zero, then the script will be terminated.
IsBetween( Source, Low, High, FalseLabel, TrueLabel )Compare the source to the given high/low limits. If the source is between the limits (non-inclusive), then the true branch is taken, otherwise the false branch is followed.
IsEqual( Value1, Value2, FalseLabel, TrueLabel )Compare two numeric values and branch on the result.
IsGreater( Value1, Value2, FalseLabel, TrueLabel )Compare two numeric values and branch on the result.
IsLess( Value1, Value2, FalseLabel, TrueLabel )Compare two numeric values and branch on the result.
IsNear( Source, Ref, Plus, Minus, FalseLabel, TrueLabel )Compare the source to the reference value, within the given tolerances. This function performs the following test:
IF (Source .GT. (Ref + Minus)) .OR. (Source .LE. (Ref + Plus)) THEN Goto( TrueLabel) ELSE Goto(FalseLabel)
IsPIDValid( Point, FalseLabel, TrueLabel )Determines is the specified point is known and in use.
IsTooHigh( Point, TrueLabel, FalseLabel )Tests the current value of a point against the EU_High value from the static database.
IsTooLow( Point, TrueLabel, FalseLabel )Tests the current value of a point against the EU_Low value from the static database.
Label( LabelName )Define a destination for any of the branching commands.
Left( String, VariableName, Count )Copies the first count characters from string to the named variable.
Length( String, VariableName )Compute the length of string and store the result into the named variable.
NOTE: When a string is evaluated which has a length of zero, this function will follow the failure label's path. This allows Length() to be used to test for the existence of a variable. However, one must be careful to specify the Next label to ignore a zero length result.
Lower( VariableName )Converts the string contained by the named variable to all lowercase characters.
MenuCommand( Value1, Value2, FalseLabel, TrueLabel )Executes a command from the PICS Test menu, just as if a user had selected the item with the mouse or keyboard. The following menu items are defined:
GenerateTime SameTime Warn LogSymbols LineNo Refresh ClearAll ClearScreen ClearEcho Pause UnPause Step StopScript OptionDialog OpenScript EditRealTime ReserveAll ReleaseAll About Exit EditVariables
Modulo( VariableName, Value, Value )named variable = Value % Value
If the named variable does not exist, it will be created.
NOTE: Modulo arithmetic requires integers. Therefore, the fractional parts of any floating point values used as arguments to this function are ignored.
Multiply( VariableName, Value, Value )named variable = Value * Value
If the named variable does not exist, it will be created.
Open( Mode, ReportFileName )This allows simple reports to be generated using the Report statement. The Mode must be either Create or Append. If the report file name is missing, then a standard file open dialog will open, allowing the script user to select the report file to be used. NOTE: only one report file may be open at any given time.
Option( Name, Setting )The Option command allows you to modify the script's operating environment, from activating the debugger, to changing the format strings used for outputting variable values. The following options are supported:
Option Name Type of Value Description of usage FloatFormat C Format String The format to be used for outputting floating point values, when no other format is specified. IntegerFormat C Format String The format to be used for outputting integer values, when no other format is specified. (Integer values include the numeric value of a digital point.) StringFormat C Format String The format to be used for outputting string values, when no other format is specified. Debug Logical When set to TRUE, statements will be echoed to the application window (in red) as they are executed. May be set to NEVER to always inhibit debugging, otherwise, the PICS Test shell may override the Debug setting in a script file. Warn Logical Determines if warning messages are to be displayed. Warning messages are generated by conditions which the user may not have intended, but will not stop the script from continuing. Collect Logical When set TRUE, changes to data points are collected until a PostChanges command is executed. Otherwise, changes to data points are posted to the Real Time Database as they occur in the script. SymbolicLog Logical When set TRUE, the [optional] log file will contain both the value and name of variables replaced during execution. When FALSE, only the value is logged. SingleStep Logical When TRUE, the script will pause execution after executing each line and wait for the user to press either the Step or the Continue key. SameTime Logical All collected data point changes will be tagged with the same time when they are posted if this option is set TRUE. Otherwise, changes are tagged with the time their statement was executed. GenerateTime Special You should set this option TRUE only when the normal SPDS time source is offline. PICS Test will generate a SPDS Time message to the Real Time Database every second when this is TRUE. If you have a requirement to time-tag every point individually, and to either provide (or avoid) the time point itself, set this option to PERPOINT, which will time tag each point with the current system time.
Pause( MessageType, MessageText )Execution of the script is paused until the user presses a key. The MessageType must be either Box or Bar. When the MessageType is Box, the MessageText will be displayed in a dialog box which offers 'OK' and 'Cancel' buttons. If the user selects the 'Cancel' button, then the script will be terminated. Otherwise the message will be displayed in the info cell (cell #1) on the status bar and the user must press the continue execution key (F5) to terminate the pause.
PostChanges( failureLabel, successLabel )All collected data point changes will be sent to the Real Time Database when this statement is executed.
RefreshWindow()This command may be inserted into a script to ensure that the display is repainted at a certain time. Normally, this command will not be necessary, since PICS Test keeps the display painted at all times.
Rem( Translated Comment Text )This is an interpreted comment. This allows the inclusion of point and variable values in the log file, even though they may not be required for the execution of the script. For example, the name and description of the point being processed may be added to a comment to enhance the readability of the resulting log.
Report( MessageText, FailureLabel )This function is exactly like an Echo, TtyEcho or Rem statement, except that its output is written to a report file. If no report file is open, then the script will branch to the failure label.
Restore( Point )Generally used when a script terminates, this function will cause PICS Test to notify all providers that the points used by the script are no longer disabled. PICS Test will automatically call this function when it exits. If the optional parameter is present, only the point it references will be restored to normal operation. NOTE: This function only accepts zero or one parameter, if you wish to restore three specific points, then you must call this function three times.
Return( failureLabel )Terminate the current subroutine. If this function is called without a previous Call(), then it will fail.
Right( String, VariableName, Count )Copies the last count characters from string to the named variable.
SetPoint( Point, Value, Quality, failureLabel, successLabel )Creates a significant change record for the specified point, using the value and quality specified. Bits other than the quality codes in the point status word are retained and/or set according to alarming rules. If the collect option is set to false, then the significant change record will immediately be delivered to the Real Time Database, otherwise, change records will be collected until a PostChanges statement is executed. Only points defined in the static database may be set. Only points of the following types may be set: AI, AO, AC, DI, DO, DC, PT, PM, and AW.
The value specified for analog points may be a decimal number, a hexadecimal value which will be used as a bit pattern, or one of the following three values: +INF, -INF, or NAN. The positive/negative infinities and NANs allow test scripts to verify that display and reporting software will continue to function correctly when potentially invalid values are delivered. The hexadecimal values allow test script writers to choose any 32 bit pattern to be used as a floating point value. Hexadecimal values are specified by preceeding the hex value with '0x' as in the 'C' programming language. For example: 0x7F800000 represents the +INF value, 0xFF800000 represents the -INF value and 0xFFC00000 represents the NAN value used by PICS Test.
Digital values may be specified with numbers as zero or non-zero. Digital values may also be specified using the On/Off state names for the appropriate point, as defined in the static database (these may be retrieved as
[PID.OnState]and[PID.OffState]). Please note that the on state name must match exactly (except for case), or the off state will be used.The quality code may be omitted (or an asterisk) to signify that the current quality code is to be maintained. Otherwise, the quality code may be a combination of the following letters:
| Letter | Meaning |
|---|---|
| S | Off Scan |
| T | In Test |
| X | Exception |
| M | Manual Entry |
| I | Alarm Inhibit |
| H | Alarm Hold |
| * | No change |
The lowercase letters 's', 't', 'x', and 'm' signify bits in the secondary quality corresponding to their uppercase counterparts. Any unknown letters in the quality field will be ignored, therefore, to clear all quality codes for a point, enter an unlisted letter, I suggest a zero. This may be obvious but, the asterisk only has meaning when it is used alone.
SetScrollRegion( Lines )Sets the number of lines in the scroll region of the PICS Test client window. The scroll region is used for TtyEcho() output as well as debug and error messages. The scroll region must have at least one line. (This is to allow PICS Test to report errors.) By default, this is the entire window. When the Scroll region is smaller than the entire window, it will be attached to the bottom of the window, allowing the remaining space to be used for EchoTo messages.
SetVariable( VariableName, Value )Sets the value of the named variable to the specified value. If the variable does not exist, it will be created.
SetWindowColor( Foreground, Background )Changes to the PICS Test window's default colors. Currently, the foreground color is unused. The background color should generally be changed to match that being used by the bulk of your EchoTo() fields.
SetWindowSize( Columns, Rows )Changes to the PICS Test window's size to allow the specified number of character columns and rows. If the number of rows or columns would cause the window to exceed the maximum allowed, it will be truncated to the maximum size in the offensize direction. NOTE: Very small sizes (those which cause the menu to wrap, for instance) may cause the program's behavior to appear strange.
Stop( MessageType, MessageText )Stop script execution immediately. The MessageType must be either Box or Bar. When the MessageType is Box, the MessageText will be displayed in a dialog box which offers 'OK' and 'Cancel' buttons. If the user selects the 'Cancel' button, then the script will not be terminated. Otherwise the message will be displayed in the info cell (cell #1) on the status bar and the script will enter a paused state. The user may either terminate the script by pressing the Esc key or continue by pressing the continue key (F5).
SubString( String, VariableName, Start, Length )Copy length characters from string into the named variable beginning at the given starting position.
Subtract( VariableName, Value, Value )named variable = Value - Value
If the named variable does not exist, it will be created.
TimedWait( Milliseconds )Pauses execution of the script for the specified number of milliseconds, or until the Continue key is pressed. TimedWaits may be changed as a group while a script is running by turning on the 'GlobalDelayTime' switch (in the Script Options dialog) and entering a value in the 'Delay (ms)' edit box.
Trim( VariableName )Removes all leading and trailing blanks from the string contained by the named variable.
TtyEcho( MessageText )The specified message is scrolled into the client area, just above the status bar.
Upper( VariableName )Converts the string contained by the named variable to all uppercase characters.
|
|
|
|