These functions help in printing, saving and updating a model.
An automatic printing from EbsScript can especially be useful for creating a series of documents for the different states.
Name |
Purpose |
Arguments |
Return values |
Example |
changeObjectName |
With the function changeObjectName you can redefine the names of objects. Here you can control by means of a flag how to proceed if the desired name exists already. Example: strNew:="Throttle_5"; changeObjectName("Throttle_3", strNew); renames “Throttle_3“ to “Throttle_5“, but only if there is no object named “Throttle_5“ in the model yet. You can see by the return code of changeObjectName whether the renaming has been successful. Alternatively, you can also use the flag “allowModify“ (the third argument of changeObjectName): strNew:="Throttle_5"; changeObjectName("Throttle_3", strNew, true); In this case, after the call strNew contains the name of the component named ”Throttle_3“ before, i.e. ”Throttle_5“, if the renaming could be effected; otherwise ”Throttle_3“. A fourth parameter ”checkOnly“ makes it possible to just check if a renaming would be possible, without actually renaming the object: strNew:="Throttle_5"; changeObjectName("Throttle_3", strNew, false, true); yields true if the renaming would be possible but does not change the name of the object. |
1: STRING: actual name 2: STRING: new name 3: BOOLEAN: allowModify-Flag (see purpose) 4: BOOLEAN: checkOnly-Flag (see purpose) |
BOOLEAN: |
see purpose |
getAllCompNames |
Like getCompNames, but even those components are returned, which are deactivated for the calculation. |
1: INTEGER: Component Number 2: ARRAY OF STRING: Field for the component names 3: INTEGER: Size of the field handed over 4: BOOLEAN: Flag for the handling of macros: true: objects of lower-level contexts are included false (default): only the current context is considered |
INTEGER: Total number of the components found (of these only that many are shown, which fit in the fields) |
nCount:=getAllCompNames( 46, arstrMeasmNames, 1000); |
getAllPipeNames |
Like getPipeNames, but even those components are returned, which are deactivated for the calculation. |
1: INTEGER: Pipe type (see below) 2: ARRAY OF STRING: Field for the pipe names 3: INTEGER: Size of the field handed over 4: BOOLEAN: Flag for the handling of macros: true: objects of lower-level contexts are included false (default): only the current context is considered |
INTEGER: Total number of the pipes found (of these only that many are shown, which fit in the fields) |
nCount:=getAllPipeNames( 3, arstrNames, 100 ); |
getCalcState |
returns the calculation status of a component i.e. whether a component is included for the calculation or else is used only as a passive graphics |
1: STRING |
INTEGER: |
iStatus:=getCalcState( "Boundary value" ); |
getCompNames |
With this function, it is possible to process the components one after the other in a loop. It returns an array with the names of all components of a type. The array must be created beforehand with the suitable size. |
1: INTEGER: Component Number 2: ARRAY OF STRING: Field for the component names 3: INTEGER: Size of the field handed over 4: BOOLEAN: Flag for the handling of macros: true: objects of lower-level contexts are included false (default): only the current context is considered |
INTEGER: Total number of the components found (of these only that many are shown, which fit in the fields) |
nCount:=getCompNames( 46, arstrMeasmNames, 200); |
getEbscriptOutpufilename |
Returns the path of the EbsScript output file. |
- |
STRING: |
var begin str:=getEbsScriptOutputfilename; println (str); setEbsScriptOutputfilename str:=getEbsScriptOutputfilename; println (str);
if (getEbsScriptOutputfilenameAddTimestamp) begin println ("Timestamp will be added"); end; end; |
getEbscriptOutpufilename |
Returns, whether a timestamp is attached to the EbsScript output file. |
- |
BOOLEAN: |
|
getModelEbsScriptOutputfilename |
Returns the path of the model specific EbsScript output file. |
- |
STRING: |
getModelEbsScriptOutputfilename(); |
getObjects |
Returns all objects of the model of a specific type |
1: STRING: type (class) of the requested objects 2: BOOLEAN: false: restrict to objects in the current context (default setting) 3: BOOLEAN: false: all objects (default setting) |
ARRAY of EBSOBJECT: array of requested objects |
var are:array of ebsobject; i,n:integer; strName:string; begin are:=getObjects("ebscomp1"); n:=length(are); for i:=0 to n-1 do begin println (are[i]); end; end; |
getPipeNames |
With this function, it is possible to process the pipes one after the other in a loop. It returns an array with the names of all pipes of a type (see below for type numbers). The array must be created beforehand with the suitable size. |
1: INTEGER: Pipe type (see below) 2: ARRAY OF STRING: Field for the pipe names 3: INTEGER: Size of the field handed over 4: BOOLEAN: Flag for the handling of macros: true: objects of lower-level contexts are included false (default): only the current context is considered |
INTEGER: Total number of the pipes found (of these only that many are shown, which fit in the fields) |
nCount:=getPipeNames( 3, |
getText |
returns the text entered in a text object |
1: STRING: |
STRING: |
strText:=getText( "Text object" ); |
getTextNames |
With this function, it is possible to process the text fields one after the other in a loop. It returns an array with the names of all text fields (including buttons and alarm fields). The array must be created beforehand with the suitable size. |
1: ARRAY OF STRING: Field for the text field names 2: INTEGER: Size of the field handed over 3: BOOLEAN: Flag for the handling of macros: true: objects of lower-level contexts are included false (default): only the current context is considered |
INTEGER: Total number of the text fields found (of these only that many are shown, which fit in the fields) |
var begin |
getVisibleState |
returns the visibility status of an object i.e. whether an object is visible or invisible in the cycle |
1: STRING: |
INTEGER: |
iStatus:=getVisibleState( "Boundary Value" ); |
printModel |
Prints the model with the default printer settings by using the specified layout. |
1: STRING: Name of the layout used for printing (see Print Preview, Layouts) 2: STRING: name of the printer (optional; default printer is used when this entry is empty) 3: STRING: in case of printing to a file: name of the file (optional) |
BOOLEAN: |
printModel ("SmallFrameLandscape"); |
restoreModelVariables |
see saveModelVariables and saveProfileVariables |
1: INTEGER: index, which of the stored sets shall be used 2: BOOLEAN: false: remove stored data after restore |
BOOLEAN: |
|
restoreProfileVariables |
1: INTEGER: index, which of the stored sets shall be used 2: BOOLEAN: false: restore to original profile (default setting) 3: BOOLEAN: false: remove stored data after restore (default setting) |
BOOLEAN: |
|
|
saveModel |
Saves the current state of the model on the hard disk. |
1: STRING: file name including path (optional; if empty, the model is stored to the same file as before) 2:BOOLEAN: true: |
BOOLEAN: |
saveModel; |
saveModelVariables |
With the functions saveModelVariables and saveProfileVariables one can store the current values of all the model and the profile variables internally in a buffer. With the functions restoreModelVariables or restoreProfileVariables one can then restore them at a later point of time. It is also possible to store several states in a buffer. For this purpose, the functions saveModelVariables and saveProfileVariables return an index as return value, which then must be specified with the Restore-functions. By default, the intermediate state is deleted after a restore. However, one can save the intermediate state (in case later a restoration is needed again) by setting the 2nd argument of the Restore-function “keepEntryForFurtherRestores” to “true”. |
- |
INTEGER: Index for restore |
|
saveProfileVariables |
- |
INTEGER: Index for restore |
|
|
setCalcState |
sets the calculation status of a component i.e. whether a component is included for the calculation or else is used only as a passive graphics |
1: STRING 2:INTEGER |
BOOLEAN: |
setCalcState( "Boundary Value", 1 ); |
setColor |
This function makes it possible to set the colours of an object (component, line, text field). The third optional parameter "colorIndex" controls which of the four colours "colour 1" - "colour 4" is changed: colorIndex = 0: colour 1 If the "colorIndex" parameter is omitted, colour 1 is changed. The colour must be specified as an RGB value in the format $ 00bbggrr, whereby bb, gg, rr can each run from 0 to $ ff and indicate the blue, green or red component. Examples: $ 00ff0000 = 16711680 pure blue $ 0000ff00 = 65280 pure green Alternatively, one of the colours of the standard palette can be specified. To do this, enter a value of $ 01000000 + pallet index. (These correspond to the values of the standard colours in the properties bar under Layout.) |
1: STRING 2: INTEGER 3: INTEGER: |
- |
setColor ("Boundary Value", $ 000000ff); // changes the background colour of the component to red setColor ("heliostat field", $ 00ffffc0, 1); // changes colour of the heliostat to light turquoise setColor ("heliostat field", 01000000); // changes the background colour of the heliostats to pallet index 0 (black) setColor ("heliostat field", $ 01000001, 1); // changes colour of heliostats to pallet index 1 (white)
|
setEbscriptOutputfilename |
Sets the path of the EbsScript output file to a specific path and determines, whether a timestamp is attached to the output file. |
1: STRING: 2:BOOLEAN |
|
setEbscriptOutputfilename("C:\\Temp\\Test", false); |
setModelEbsScriptOutputfilename |
Redirects the EbsScript output for the current model to the specified file. The general setting for the other models is not changed. |
1: STRING: name (including path) of the requested EbsScript output file |
- |
setModelEbsScriptOutputfilename ("D:\\Temp\\EbsScript.txt"); |
setModelTime |
This function sets the model time. This is normally set when data is received from EposInterface or EposArchive, but can also be modified explicitly, if needed. |
1: STRING: |
- |
setModelTime( "01.12.2004 16:30:00" ); |
setModelTime ForArchiveId |
This function sets the model time for a specific archive ID. |
1: INTEGER: 2: STRING: |
- |
setModelTimeForArchiveId(300, "01.12.2004 16:30:00" ); |
setStandardColor |
This function resets the colour of the objects to the original state. |
1: STRING: 2: INTEGER: |
- |
setStandardColor ( "Boundary Value" ); |
setText |
sets the text entered in a text object |
1: STRING: 2: STRING: |
- |
setText( "Text object", "This is a test text" ); |
setVisibleState |
sets the visibility status of an object i.e. hides the object or shows it. |
1: STRING: 2:INTEGER: |
- |
setVisibleState( "Boundary Value", 1); |
switchShiftView |
With the function switchShiftView the control room view can be changed over t a specific view. |
1: INTEGER: index of the requested view |
BOOLEAN: |
|
updateModel |
Updates the display on the monitor screen. |
1: BOOLEAN: 2: BOOLEAN: |
- |
|
Contrary to the "printModel", the functions "print" and "printToString" do not generate an output on the printer, but instead are used only internally. You will find these functions in the chapters Simple In/Output Functions and String-Functions respectively.
The following IDs are defined for the pipe types:
0 |
All pipes |
1 |
Air |
2 |
Flue gas |
3 |
Steam |
4 |
Water |
5 |
Scheduled value |
6 |
Actual value |
7 |
Crude gas |
8 |
Oil |
9 |
Electro |
10 |
Mechanical shaft |
11 |
Coal |
12 |
Gas |
13 |
Logic |
14 |
User-defined |
15 |
2-phase fluid gaseous |
16 |
2-phase fluid liquid |
17 |
Salt water |
18 |
Universal fluid |
19 |
Binary mixture |
20 |
Thermo liquid (Oil/melt) |
21 |
Humid air |
22 |
NASA |