Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual
Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual

Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual

Script language

Advertisement

Cat. No. W09E-EN-01
Software Release 2.0
CX-Supervisor
SCRIPT REFERENCE

Advertisement

Table of Contents
loading

Summary of Contents for Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0

  • Page 1 Cat. No. W09E-EN-01 Software Release 2.0 CX-Supervisor SCRIPT REFERENCE...
  • Page 2: Cx-Supervisor

    CX-Supervisor Script Language Software Revision 2.0...
  • Page 4 All OMRON products are capitalised in this manual. The word “Unit” is also capitalised when it refers to an OMRON product, regardless of whether or not it appears in the proper name of the product. The abbreviation “PLC” means Programmable Logic Controller and is not used as an abbreviation for anything else.
  • Page 5 CX-Supervisor – Script Language OMRON Page (ii) Revision 2.0...
  • Page 6 OMRON CX-Supervisor – Script Language Visual Aids The following headings appear in the left column of the manual to help you locate different types of information. Note: Indicates information of particular interest for efficient and convenient operation of the product.
  • Page 7 CX-Supervisor – Script Language OMRON Page (iv) Revision 2.0...
  • Page 8 ♦ Chapter 7 Script Examples. A description of the script language in practice, using some examples. ♦ Chapter 8 Colour Palette. A description of the colour palette that can be applied to certain script statements. ♦ Appendix A OPC Communications Control. This appendix contains a list of the available component properties and gives details of the Visual Basic script interface.
  • Page 9 CX-Supervisor – Script Language OMRON Page (vi) Revision 2.0...
  • Page 10: Table Of Contents

    Control Statements ..........................15 Subroutines ............................22 Punctuation ............................23 Indirection within Script Commands and Expressions ..............26 Point Arrays within Script Commands and Expressions ..............27 Using Aliases.............................28 Chapter 5– VBScript Language reference ........... 31 List of features ...........................31 Chapter 6 – Functions and Methods............. 35 Object Commands ..........................39...
  • Page 11 ActiveX Functions .......................... 133 Chapter 7 – Script Examples ............... 137 Balloon Script ..........................137 Chapter 8 – Colour Palette..............141 Appendix A – OPC Communications Control ........143 Component Properties........................143 Script Interface ..........................143 Functions............................143 Appendix B – CX-Server Communications Control ......145 Component Properties........................
  • Page 12 OMRON CX-Supervisor – Script Language Appendix D – Obsolete Features ............153 Glossary of Terms ................. 161 Index....................... 169 Revision 2.0 Page (ix)
  • Page 14: Chapter 1 - Introduction

    ♦ Operators. Relational, arithmetic, and logical statements, for instance ‘+’, ‘<=’ or ‘AND’. ♦ Or (‘|’). The ‘|’ symbol is used to represent ‘or’, where there are two or more forms of the same syntax. ♦ Point Types. Either Boolean, Integer, Real or Text.
  • Page 15 CHAPTER 1 - Introduction OMRON Page 2 Revision 2.0...
  • Page 16: Chapter 2 - Expressions

    ♦ Operands are constants or point variables. Expressions can be used in a script as part of a statement (refer to chapter 3 Scripts, chapter 4 CX- Supervisor Script Language, and Chapter 6 Functions and Methods). However expressions can be applied to the following actions directly using the associated Expression: or Digital Expression: field: ♦...
  • Page 17 The following example of a more complex expression contains a test on point ‘position’. If ‘position’ is more than 300 in value, and ‘position’ is less than 450 in value, i.e. the value of ‘position’ is between 300 and 450, then the expression has been met, and an action is initiated (in this instance the current object is made visible if the expression is met).
  • Page 18 $Second as it will be executed when $Second changes to 59, and to 1 but not when it changes to 0. To execute a condition script any time a point changes, force the expression to always evaluate to TRUE for example “$Second || TRUE”.
  • Page 19 CHAPTER 2 - Expressions OMRON Page 6 Revision 2.0...
  • Page 20: Chapter 3 - Scripts

    Object If a script is executed as a runtime action of an object, then the script can affect the object of the action, or any other, depending on the actual content of the script.
  • Page 21 CHAPTER 3 - Scripts OMRON Page 8 Revision 2.0...
  • Page 22: Chapter 4 - Cx-Supervisor Script Language

    Boolean state Applies Boolean expression. The ‘Type’ column refers to the types of script and expression the function can be applied to. ‘All’ refers to both expressions and scripts. ‘Scr’ refers to scripts only. ‘OP’ refers to Object and Page scripts only.
  • Page 23: Points

    Note: When assigning Real (floating point) values to an Integer point the assignment uses the 'Symetrical Rounding Down' (towards 0) standard. This means a value of 4.1 would be assign a value 4. A value of -4.1 would asign a value of -4.
  • Page 24 = height + rate/5.0 The Integer or Real point ‘lift’ is assigned the value calculated by the value of point ‘rate’ divided by 5, plus the value of point ‘height’. Precedence can be changed by the introduction of parenthesis.
  • Page 25: Logic And Arithmetic

    Decrement ‘--’. Typical Examples result = 60 + 20/5 The Integer or Real point ‘result’ is assigned the value calculated by the value of 20 divided by 5, plus 60. lift = height + rate/5.0 The Integer or Real point ‘lift’ is assigned the value calculated by the value of point ‘rate’ divided by 5, plus the value of point ‘height’.
  • Page 26: Logical Operators

    Bitwise Shift Right, ‘SHR’ or ‘>>’. Typical Examples MSB = value & 128 The Boolean point ‘MSB’ is set ‘TRUE’ if the binary representation of ‘value’ has the bit set which is worth 128. Pattern = value << 2 The binary representation of ‘value’ is shifted left twice, and stored in ‘pattern’. Each Shift Left operation has the effect of doubling the value, so two shifts quadruple the value.
  • Page 27: Control Statements

    The Boolean point ‘flag’ is assigned a value based on the logic of point ‘temp’ AND point ‘speed’. If ‘temp’ and ‘speed’ are both not zero, ‘flag’ is set to 1, or ‘‘TRUE’’. A value of zero in either ‘temp’...
  • Page 28: Control Statements

    IF fuel < 0 THEN fuel = 0 ENDIF The point ‘fuel’ is assigned the value 0 on the condition that currently, ‘fuel’ is less than 0. If ‘fuel’ is not less than 0, then it is not assigned the new value. References Refer to chapter 4, Control Statements for details of the use of the IF THEN ELSE/ELSEIF ENDIF statements.
  • Page 29 Provided that Integer point ‘distance’ is greater in value than 630 AND ‘distance’ is less in value than 660 (i.e. ‘distance’ is a value between 630 and 660) AND point ‘lift’ is greater than or equal to -3, then Boolean points ‘winner’ and ‘burner’ are assigned new values.
  • Page 30: Nested Conditional Statements

    OMRON CHAPTER 4 – CX-Supervisor Script Language Nested Conditional Statements Syntax IF conditionA THEN statementblock1 IF conditionB THEN statementblock3 ENDIF ELSE statementblock2 ENDIF IF conditionA THEN statementblock1 IF conditionB THEN statementblock3 ELSE statementblock4 ENDIF ELSE statementblock2 ENDIF IF conditionA THEN...
  • Page 31 Provided a successful evaluation has been made to points ‘burner’ AND ‘fuel’ AND ‘rate’, point ‘lift’ is updated with the current value of rate divided by 5 plus ‘lift’. Otherwise, a further evaluation is required on point ‘altitude’. If ‘altitude’ is currently greater than 140, then ‘lift’ is decremented by 0.2.
  • Page 32: Case Select

    CHAPTER 4 – CX-Supervisor Script Language These two examples are identical. The use of the ELSEIF statement combines the ELSE statement and the IF/ENDIF statements for brevity. It is acceptable to have more than one ELSEIF statement in an IF THEN ELSE/ELSEIF ENDIF construct.
  • Page 33 If it is ‘‘TRUE’’ that ‘temperature’ is between 0 and 10, then the current object is set to blue, or if it is ‘‘TRUE’’ that ‘temperature’ is between 11 and 20, then the current object is set to green, or if it is ‘‘TRUE’’...
  • Page 34 The pointname to be used as the loop counter. startpt The initial setting of pointname, and the first value to be used through the loop. endpt The last value to be used. The loop ends when pointname exceeds this value.
  • Page 35: Subroutines

    LOOP UNTIL expression Remarks Argument Description expression The expression may be a point, or a calculation of constants and/or points that produces a result. statementblock One or more statements to be executed multiple times depending on expression. Typical Example DO WHILE dooropen == TRUE Message (“You must shut the door before continuing”)
  • Page 36: Punctuation

    POLYGON_1.COLOUR = red ELLIPSE_5.WIDTH = value The integer point ‘limit’ is tested for its value. If its value exceeds 1000, then the condition is met, and the RETURN command is executed. All statements after the RETURN command are ignored. If the value of integer point ‘limit’...
  • Page 37: Multiple Commands

    Message({Error: "Invalid Function" occurred}) The ‘{‘ and ‘}’ braces inserted around the whole strings allows the actual text in the string to contain quotes which will be displayed normally. They can be used in any situation where quotes can be used whether or not embedded quotes are required.
  • Page 38: Quotation Marks

    Message("This text to be displayed as a message.") Passing static text as arguments to functions. BlueCarsAck = IsAlarmAcknowledged("BLUEPAINT") The point ‘BlueCarsAck’ is assigned a Boolean state based on the alarm ‘BLUEPAINT’. Quotation marks must be used for an alarm name. Remarks...
  • Page 39: Indirection Within Script Commands And Expressions

    ‘add two numbers Indirection within Script Commands and Expressions It is possible to use text points directly or indirectly in place of literal string arguments within scripts and expressions. For instance, each of the following commands has the same effect: ♦...
  • Page 40: Point Arrays Within Script Commands And Expressions

    An example using Point Arrays The value of array points can be seen in a situation where it is necessary to dynamically change the pointname that an object is linked to. In the following example a toggle button is configured to control the Boolean state of one of four elements of an array point.
  • Page 41: Using Aliases

    Using Aliases This facility is used to declare an alias - that is, to define a text string that can be used in place of another text string or a number within any script or expression. The Alias Definitions dialog is displayed by selecting the “Alias Definition...”...
  • Page 42 @Test1 = InArray[12] * 10 i.e. an @ symbol followed by the name of the alias, then an equals sign (or space), followed by the definition of the alias. Anything that follows the last apostrophe ( ' ) symbol on a line is interpreted as a comment.
  • Page 43 OMRON Note: Changing an alias definition after it has been used in an expression or script will not automatically change the result in the script. The appropriate script or expression where that alias is used must be accessed and recompiled by pressing the OK button in order to apply the changes.
  • Page 44: Chapter 5- Vbscript Language Reference

    This chapter is a reference for the syntax of Microsoft Visual Basic scripting language called VBScript. These features are provided by the Windows Scripting Host, included by default with Windows 2000 and Windows XP. For a full User Guide, Language reference and details of the latest versions and support contact Microsoft at http://msdn.microsoft.com/scripting...
  • Page 45 CHAPTER 5 – VBScript Language Reference OMRON Category Keyword / Feature TimeSerial, TimeValue Declarations Class Const Dim, Private, Public, ReDim Function, Sub Property Get, Property Let, Property Set Error Handing On Error Expressions Eval Excute RegExp Replace Test Formatting Strings...
  • Page 46 OMRON CHAPTER 5 – VBScript Language Reference Category Keyword / Feature Options Option Explicit Call Procedures Function, Sub Property Get, Property Let, Property Set Rounding Int, Fix, Round Script Engine ID ScriptEngine ScriptEngineBuildVersion ScriptEngineMajorVersion ScriptEngineMinorVersion Strings Asc, AscB, AscW Chr, ChrB, ChrW...
  • Page 47: Chapter 6 - Functions And Methods

    OMRON CHAPTER 6 Functions and Methods This chapter describes the Functions and Methods available to the scripting language. In most cases, this can be CX-Supervisor script, VBScript or JScript. The following table describes the Functions and Methods at a glance.
  • Page 48 Edits a specified file. EnableAlarms alarm command Enables alarm functions. EnableErrorLogging error command All actions become subject to Error Logging. Permits a group of points to be read or EnableGroup point command written. EnableOLE comms command Allows use of OLE functions. EnablePLC comms command Allows use of PLC functions.
  • Page 49 Moves an object. MoveFile file command Moves the specified file. OpenComponent comms command Opens a component for a PLC (e.g. CX- Server components). OpenFile file command Opens the specified file. OpenLogFile Data Logging command Opens a data log file...
  • Page 50 Runs the specified help file. SelectFile file command Specifies a file name and path. SetBit point command Sets a specific bit from a point. SetPLCMode PLC command Sets the mode of a PLC. SetPLCPhoneNumber PLC command Sets a phone number to a PLC.
  • Page 51: Object Commands

    Writes text to an external file. The ‘Type’ column refers to the types of script and expression the function can be applied to. ‘All’ refers to both expressions and scripts. ‘Scr’ refers to scripts only. ‘OP’ refers to Object and Page scripts only.
  • Page 52: Other Objects

    Description objectname This is the name of the object. The object is provided with a generic name on creation, which can be amended later to something more meaningful. The script is automatically updated following any amendment to the object name.
  • Page 53 Remarks Argument Description objectname This is the name of the object. Where a script is directly attached to an object, objectname is not required. colour Colour to blink to. Some colour values within the colour palette have a meaningful colourID. This takes the form of the colour name, e.g., ‘black’ or ‘yellow’.
  • Page 54 = expression objectname.colour = colourID colour = expression Either spelling ‘colour’ or ‘color’ is acceptable. Note: An equals sign may also be used for most other object commands, even if it is not directly specified in this manual. Remarks Argument...
  • Page 55 ELLIPSE_1.colour (shade + 0x1000000) The point ‘shade’ is set to a value based on ‘tint1’ and ‘tint2’, and is tested first to ensure that it is a value between 0 and 65. If ‘shade’ falls outside this range, then it cannot be applied as a colour to an object, and is therefore reset to 0 (or black).
  • Page 56: Horizontal Fill

    = 100 The height of the current object is set to 100. LINE_1.height (stretch/offset, @top) The height of object ‘LINE_1’ is changed to the value calculated by points ‘stretch’ and ‘offset’, keeping the top where it is. Horizontal Fill Syntax objectname.horizontal%fill (expression, context)
  • Page 57 Where a script is directly attached to an object, objectname is not required. x co-ordinate The x and y co-ordinates of the origin of the object at its resultant position in y co-ordinate pixels are specified in the form (x, y). Points alone or as part of an arithmetic expression may be used as a basis for this expression.
  • Page 58 The current object to which this example applies is rotated by 45°. RECTANGLE_1.rotate(tilt, @USERDEFINED, 0, -100, 10) The object ‘RECTANGLE_1’ is rotated by the value of ‘tilt’, about a point –100, 10 relative to the objects current position. rotate (a * sin(b)) The current object is rotated based on the result of an arithmetic expression involving points named ‘a and ‘b’.
  • Page 59: Vertical Fill

    Remarks Argument Description objectname This is the name of the object. Where a script is directly attached to an object, objectname is not required. expression This is an arithmetic expression that must return a value between 0 and 100. On return of a valid result, the fill commences from bottom to top.
  • Page 60: Page Commands

    (150) The width of the current object is set to 150. LINE_1.width (squeeze/offset, @RIGHT) The width of object ‘LINE_1’ is changed to the value calculated by points ‘squeeze’ and ‘offset’, keeping the rightmost point fixed. Page Commands Display Page Syntax display ("pagename")
  • Page 61 = “CAR” display(textpoint) The page ‘CAR.PAG’ is displayed. display("CAR", 100, 200) The page ‘CAR.PAG’ is displayed in a custom position, 100 pixels across from the left of the main window and 200 pixels down from the top. Close Page Syntax close ("pagename")
  • Page 62: General Commands

    , i.e. 32,768. PlayOLE Description Initiate an OLE verb or ‘method’ on an OLE 2 object. The verb number is object dependent so refer to the object’s documentation. This function is now largely obsolete as most objects are nowadays ActiveX objects.
  • Page 63 -1: instructs the object to show itself for editing or viewing. Usually an alias for some other object-defined verb. -2: instructs an object to open itself for editing in a window separate from that of its container. -3: causes an object to remove its user interface from the view.
  • Page 64 CHAPTER 6 – Functions and Methods The object "Bitmap_1" will load and display the Floorplan1 bitmap. DisplayPicture("Bitmap_2", txtFileName) The object "Bitmap_2" will load and display the file name stored in txtFileName text point. PlaySound Description Plays a Windows .WAV sound file using the standard Windows sound channel and Sound Card driver.
  • Page 65 OMRON Typical Example randomnumber = Rand(upperlimit) A random integer in the range 0 to upperlimit is returned and contained in the point ‘randomnumber’. Maximum upperlimit is 32767. Note: If ‘upperlimit’ is negative then the range is 0 to the negative number.
  • Page 66 Change the language of text on display. This will reload the system language file from the program folder (i.e. with a .LNG extension), and the user defined text from the application folder (i.e. with a .USL extension). This function is the programmatic equivalent of the user right clicking and changing the “Language Settings…”...
  • Page 67 CHAPTER 6 – Functions and Methods OMRON GetPerformanceInfo Description Read the value of a performance and diagnostics Property as shown by the Performance Monitor and Diagnostics dialog. Syntax returnvalue = GetPerformanceInfo(PLC, Point, "Property Name") Remarks Argument Type Description returnstate bool Returnstate is ‘1’...
  • Page 68: Communications Commands

    Text point or text constant containing the name of the PLC that the component to close is attached to. Typical Examples CloseComponent(“PLC Data Monitor”, “MyPLC”) In this example, the PLC Data Monitor component monitoring the PLC ‘MyPLC’ is closed. Component = “Performance Monitor” PLC = “PLC06” OK = CloseComponent(Component, PLC) In this example, the Performance Monitor component monitoring the PLC ‘PLC06’...
  • Page 69 A Boolean point that holds the required enable/disable state. Typical Examples EnableOLE(result) OLE functions are enabled based on the value of point ‘result’. If result is ‘TRUE’, then OLE is enabled. If result is ‘FALSE’, then OLE is disabled. EnableOLE(TRUE) OLE functions can also be enabled directly without using a point to hold the desired status.
  • Page 70: Point Commands

    CancelForce command applied. Typical Example CancelForce(point1) The forcing of values on the point ‘point1’ is cancelled. References Refer to PLC operation manuals for a detailed description of Force Set, and Force Reset. Revision 2.0 Page 57...
  • Page 71 Finally, copy the content of the source array ‘SourceArray’ to the destination array ‘DestArray’. The two arrays do not have to be the same size as each other, for example if ‘DestArray’ contains 20 elements, only elements [0], [1] and [2] are set to 1, 2 and 3 respectively, the remaining elements are unchanged i.e.
  • Page 72 OMRON CHAPTER 6 – Functions and Methods Typical Example DisableGroup(“<Default>“) All points belonging to the <Default> group is disabled thus preventing values from being read\written. DisablePoint Syntax returnstate = DisablePoint(pointname) Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise.
  • Page 73 Flag set to TRUE if input is not to be echoed for security Typical Example EditPoint(bFlag, "Select ON or OFF", "ON", "OFF") A dialog is displayed to edit the Boolean point ‘bFlag’, to “ON” or “OFF” with a caption “Select ON or OFF”. EditPoint(nValue, "Enter a new value", 0.000000, 9999.000000, FALSE ) A dialog is displayed to edit the analogue point ‘nValue’, between 0 and 9999 with a caption “Enter a...
  • Page 74 Force command applied. Typical Example Force(point1) The point ‘point1’ is locked in its current state. i.e. if it is currently set to 1 it cannot be changed until the forced state is removed via the CancelForce command. ForceReset Syntax returnstate = ForceReset(pointname) Revision 2.0...
  • Page 75 ForceSet command applied. Typical Example ForceSet(point1) The Boolean point ‘point1’ has its value set to ‘TRUE’. References Refer to PLC operation manuals for a detailed description of Force Set, and Force Reset. GetBit Syntax returnpoint = GetBit(pointname,bit) Page 62...
  • Page 76 Remarks Argument Type Description pointname Integer / This is the name of the point to get the bit value from. real Indirection or point value may be used. integer This specifies which bit to get the value of. returnpoint bool This contains the return value ‘TRUE’...
  • Page 77 Typical Examples OutputPoint(result) The point ‘result’ is updated with its current value. Note: The value of a point connected to a PLC is not be set if the point is currently in a “forced” state. PointExists Syntax returnpoint = PointExists(pointname)
  • Page 78: Plc Commands

    CHAPTER 6 – Functions and Methods Typical Example PointName=“Testpoint” Exists=PointExists(PointName) The Boolean point ‘Exists’ is set to ‘TRUE’ if a point called ‘TestPoint’ exists. Note: “PointName” is a text point which can be set to any string value. SetBit Syntax...
  • Page 79 Communications Control this parameter should be the control name and PLC name separated by a dot e.g. “OMRONCXCommunicationsControl.controlPLC”. Typical Example ClosePLC(“controlPLC”) The PLC called controlPLC is closed. No further communications with the PLC will take place until it is reopened. DownloadPLCProgram Syntax returnstate = DownloadPLCProgram(plcname, filename, processed)
  • Page 80 OMRON CHAPTER 6 – Functions and Methods Note: This command can only be used when the PLC is in ‘STOP’ mode. Refer to chapter 6, GetPLCMode or chapter 6, SetPLCMode for further information. GetPLCMode Syntax mode = GetPLCMode(“plcname”) Remarks Argument...
  • Page 81 Note that the PLC may not be opened immediately after the statement has been executed. The processed flag will be set at a later time when the operation has been completed. Therefore, if using statements which require the operation to be completed create an On Condition script containing the code to be executed after the PLC is opened with the ‘processed' flag as the expression (this is...
  • Page 82 The mode may not be changed immediately after the statement has been executed. The processed flag ‘done’ is set at a later time when the operation has been completed. Therefore, if using statements that require the operation to be completed create an On Condition script containing the code to be executed after the mode is set, with the processed flag as the expression (e.g.
  • Page 83: Temperature Controller Commands

    Condition script containing the code to be executed after the upload, with the processed flag as the expression (e.g. ‘done’). Note: This command can only be used when the PLC is in ‘STOP’ mode. Refer to chapter 6, GetPLCMode or chapter 6, SetPLCMode for further information. Temperature Controller Commands...
  • Page 84 0: Indicates that the auto-tuning operation is to be stopped. 1: This mode is supported on the E5*K and is used to set the limit cycle of the manipulated variable change width to 40%. 2: This is used to start the auto-tuning operation.
  • Page 85 This is a string representing the name of the temperature controller. paramID point This is a point depicting the required parameter range 0 to 22: 0: ControlMode. 1: Output. 2: InputShiftDelay (Bool) E5*F, E5*X, E5*J. 3: DisplayUnit. 4: PIDConstantDisplay (Bool) E5*F, E5*X, E5*J.
  • Page 86 = TCRequestStatus(“e5ak”, temp2) Note: The status information is NOT returned immediately - it is not possible to access the status information in the same script as the TCRequestStatus command. Instead, the status information should be accessed from within an “On Condition” script which has an expression of “returnflag == TRUE”.
  • Page 87 This is a string representing the name of the temperature controller. mode Point This is a point depicting the mode of operation and defines the setpoint mode used by the temperature controller. 0: This specifies remote setpoint mode. 1: This specifies local setpoint mode.
  • Page 88 CHAPTER 6 – Functions and Methods Remarks Argument Type Description returnstate Bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. TController String This is a string representing the name of the temperature controller. Typical Example temp1 = TCSaveData(“e5ak”,temp2)
  • Page 89: Alarm Commands

    Syntax returnstate = AcknowledgeAlarm(“alarmname”) Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. alarmname string This is the identifier of the alarm. Typical Example AcknowledgeAlarm(“temphigh”) The alarm ‘temphigh’ is acknowledged. References Refer to the CX-Supervisor User Manual for details of alarms.
  • Page 90 Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. Typical Example AcknowledgeLatestAlarm() The most current alarm of the highest priority is acknowledged. References Refer to the CX-Supervisor User Manual for details of alarms.
  • Page 91 OMRON Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. Typical Example CloseAlarmHistory() The alarm history window is closed. References Refer to the CX-Supervisor User Manual for details of alarms CloseAlarmStatus Syntax...
  • Page 92 = DisplayAlarmStatus() Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. Typical Example DisplayAlarmStatus() The current alarm status is displayed. References Refer to the CX-Supervisor User Manual for details of alarms. EnableAlarms Syntax EnableAlarms (flag, “message”)
  • Page 93 The identifier of the alarm. Typical Example active = IsAlarmActive("temptoohigh") The point ‘active’ is assigned Boolean state ‘‘TRUE’’ if the ‘temptoohigh’ alarm is currently active. The point is assigned Boolean state ‘FALSE’ if the alarm is not currently active. Page 80...
  • Page 94: File Commands

    Typical Examples CloseFile(status) The currently open file is closed. Blank spaces at the end of each line are stripped from the file if the Boolean point ‘status’ is set to ‘TRUE’. CloseFile(FALSE) In this example, the currently open file is closed and any blank spaces are not stripped from the file.
  • Page 95 Typical Example CopyFile(“c:\autoexec.bat”, “c:\autoexec.old”) The file “c:\autoexec.bat” is copied to the file “c:\autoexec.old”. CopyFile(“c:\logging\*.dlv”, “a:\backup”) The data log files (ending in dlv) in “C:\logging” are copied to the “\backup” directory on drive A: DeleteFile Syntax returnstate = DeleteFile(“filename”) Remarks...
  • Page 96 Boolean point that contains the return value. Typical Example FileName = “TEST.TXT” Exists = FileExists(FileName) The Boolean point ‘Exists’ is set to ‘TRUE’ if a file called ‘C:\TEST.TXT’ exists. Note: “FileName” is a text point which can be set to any string value. MoveFile Syntax returnstate = MoveFile(“sourcename”, “destname”)
  • Page 97 The file “c:\filename.csf” is opened and able to be accessed by the Read() and Write() script commands. Only one file can be open at a time. Files can be shared (for instance located on a network drive, and accessed by several running CX-Supervisor applications simultaneously - this can be used for data exchange).
  • Page 98 Typical Examples Read(1, value) The point ‘value’ is loaded with the value read from the currently open file using the value of 1 as an index into the file. ReadOK = Read(indexno, value1, value2, value3) The points ‘value1’, ‘value2’, ‘value’ are loaded using the value of indexno as an index into the file.
  • Page 99 The first 20 characters are be read from the file “C:\CX-SUPERVISOR\TESTFILE.TXT” and stored in the point ‘TextPoint’. Note: Text points can hold up to 256 characters therefore a maximum of 256 characters can be read from the file. SelectFile Syntax...
  • Page 100 TFile = SelectFile(“Text Files (*.txt; *.csv)|*.txt;*.csv|Document Files (*.doc)|*.doc||”) In this example, the ‘Files of type’ filter has 2 choices: one to show text files (i.e. both .txt and .csv files), and one to show document files (just .doc files). TFile = SelectFile(“”, “C:\WINDOWS”) The ‘File Open’...
  • Page 101: Recipe Commands

    WriteMessage(“C:\CX-SUPERVISOR\TESTFILE.TXT”, 0, “Hello World”, TRUE) The text ‘Hello World’ is written at the start of the ‘C:\CX-SUPERVISOR\TESTFILE.TXT’ file and a carriage return and line feed is appended which moves and subsequent text to the start of the next line. Note: When the text is written into the file it overwrites any existing text that may exist at this location.
  • Page 102 Syntax returnstate = DownloadRecipe(“recipename”) Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. recipename string The name of the recipe to be downloaded. Typical Example DownloadRecipe(“recipe1”) The recipe ‘recipe1’ is downloaded. References Refer to the CX-Supervisor User Manual for details of recipes.
  • Page 103: Report Commands

    The template file can be written using any ASCII text editor, for instance a Text file (.TXT), a Rich Text file (.RTF) or a Hypertext file (.HTML).
  • Page 104: Text Commands

    Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. ReportTemplateFile string Pathname of the report template file. Typical Example PrintReport(“report3.txt”) The report template is processed, dynamically replacing the point names with current values, and printed to the default Windows printer. ViewReport Syntax returnstate = ViewReport(ReportTemplateFile) Remarks...
  • Page 105 = Bin (value) Remarks Argument Type Description value - - - Number to be converted to a binary number. result - - - String containing binary representation of value. Typical Example BStr = Bin (20) In this example, ‘Bstr’ contains ‘10100’.
  • Page 106 The value of the ‘BoilerTemp’ point is inserted into the specified text at the position marked by the formatting characters (%ld) and then stored in the point ‘TextPoint’. If the value of ‘BoilerTemp’ was 57 then the resultant text that is stored in ‘TextPoint’ is as follows: “Boiler temperature is 57 degrees.”...
  • Page 107 CHAPTER 6 – Functions and Methods OMRON References More complex expressions (for instance controlling justification, decimal places, number base, etc.) are also possible. Refer to any C language reference book for full details of the format used by the ‘sprintf’ function. GetTextLength Syntax...
  • Page 108 The text point containing the string that is to be manipulated. offset integer The zero based index of the first character in the string that is to be included in the extract. noofchars integer The number of characters to extract from the string.
  • Page 109 Contains the text string that is sent to the printer. Typical Example PrintMessage (“Print this message”) The message ‘print this message’ is printed to the configured ‘Alarm/message printer’, queued if operating in page mode, or printing has been disabled by the EnablePrinting command. References Refer to the CX-Supervisor User Manual for further details to configure the ‘Alarm/message printer’.
  • Page 110 A text point containing the value converted into a string. Typical Examples textpoint = ValueToText(10) The value 10 is put into a string and assigned to the text point ‘textpoint’. value = 10 textpoint = ValueToText(value) This has the same effect as the previous example.
  • Page 111: Event/Error Commands

    Syntax returnstate = DisplayErrorLog() Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. Typical Example DisplayErrorLog() A list of all currently logged errors is displayed in a dialog. Page 98 Revision 2.0...
  • Page 112 A Boolean point. Typical Example EnableErrorLogging(flag) Error Logging is enabled based on the Boolean point ‘flag’. If ‘flag’ is ‘TRUE’, then error logging is enabled. If ‘flag’ is false, then error logging is disabled. LogError Syntax returnstate = LogError(“message”, priority)
  • Page 113: Printer Commands

    Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. Typical Example ClearSpoolQueue() Any messages (typically printed alarms) that are queued up waiting to be sent to the CX-Supervisor Alarm/Message printer is discarded. EnablePrinting Syntax returnstate = EnablePrinting(flag)
  • Page 114 EnablePrinting(TRUE) - Enables printing While alarm printing is disabled, any new messages are stored but not printed. When alarm printing is re-enabled, any pending messages are printed (if in line mode) or added to the current page (if in page mode).
  • Page 115 PrintScreen(FALSE) All CX-Supervisor pages currently on view is printed. The flag ‘FALSE’ indicates that the print dialog is not displayed. A flag of ‘TRUE’ causes the print dialog to be shown, allowing the user to configure or choose the printer.
  • Page 116: Security Commands

    = Login(username, password) Remarks Argument Type Description returnstate bool Returnstate is ‘1’ if the function is successful, or ‘0’ otherwise. username Text Optional parameter with name of user to login. If omitted, the login dialog will be shown. password Text Optional parameter with password for user to login.
  • Page 117: Data Logging Commands

    Name of Data Set to clear as text point or constant. Typical Example ClearLogFile("Process 1") This command will clear all data from the active (latest) log file for this data set, and add a ‘Clear Event’ indicator. Page 104 Revision 2.0...
  • Page 118 Name of Database link to close as text point or constant. Typical Example CloseLogFile("Process 1") This command will close the active log file for the data set. Logging for this data set is automatically stopped. CloseLogView Syntax CloseLogView("datasetname")
  • Page 119 All these arguments are optional, and may be omitted provided there are no further arguments i.e. to specify the ‘format’, ‘datasetname’ and ‘item list’ must be included but ‘file’ and ‘output’ may be omitted.
  • Page 120 CHAPTER 6 – Functions and Methods All these commands will export all the data in the specified file, for the named data set to the named output file, in the format specified (as per ExportLog). It then launches an appropriate viewer to display the file, using the Windows file associations.
  • Page 121 ItemList[3] = "List" ItemList[4] = "Group 1" ExportAndViewLog("Balloon", ItemList, "CSV-BDTM", 0, "output") All these commands will export all the data in the specified file, for the named data set to the named output file, in the format specified. OpenLogFile Syntax returnstate = OpenLogFile("datasetname”)
  • Page 122 OpenLogView("Balloon", ItemList, "C:\Program Files\Omron\CX- SUPERVISOR\App\MySessionInfo.txt") This command will open the Data Log Viewer and Balloon log file as above but the Data Log Viewer will always appear in the same position, and with the same settings – not as it was last shown.
  • Page 123: Database Commands

    Name of Database link to start logging as text point or constant. Typical Example StartLogging("Process 1") This command will start logging of all items in the named data set. If the file is closed it will be automatically opened. StopLogging Syntax returnstate = StopLogging("datasetname")
  • Page 124 DBAddNew("Northwind.Order Details.Quantity") DBAddNew("Northwind.Order Details.UnitPrice") DBUpdate("Northwind.Order Details") Using a Field connection level, each required field is added to the new record using multiple calls to DBAddNew(). When the record is complete, it is added by calling the DBUpdate() function Note: To use DBAddNew() with a Recordset level the Recordset must be configured to perform this type of operation i.e.
  • Page 125 Description Deletes the specified number of records from the current record position. This function works only at the Recordset level. This function will fail if the Recordset is opened with a lock of 'Read Only'. Syntax returnstate = DBDelete(level, quantity)
  • Page 126 Find the next record satisfying the specified criteria, starting from the current position. Valid search criteria include: "ProductName LIKE ‘G*’ " wildcard search finds all records where ProductName starts with ‘G’, "Quantity = 5", "Price >= 6.99". Only single search values are allowed, using multiple values with ‘AND’ or ‘OR’ will fail.
  • Page 127 Apply a filter to a Recordset. Save Recordset Saves a Recordset in XML format. DBGetLastError Description Returns the last error string generated by the Database provider, and displays it in a message box. Syntax returnstate = DBGetLastError(level, display) Page 114 Revision 2.0...
  • Page 128 DBGetLastError("Northwind") DBGetLastError("Northwind", TRUE) Both the above lines will get and display the last error to occur for the Northwind connection. ErrMsg = DBGetLastError("Northwind", FALSE) The last error to occur for the Northwind connection is stored Text point 'ErrMsg', without displaying a message box.
  • Page 129 DBMove("Northwind.Order Details", "Page", 6) Go to the sixth page in the Recordset. Note: Bookmarks are returned from the function ‘DBProperty’, they enable you to return to a ‘marked’ record, even after records have been added or deleted Page 116 Revision 2.0...
  • Page 130 Bookmarks will only work if specifically supported by the Provider. DBOpen Description Opens a Connection or Recordset. Opening a Connection will automatically open all recordsets associated with it, that are marked as auto open. Recordsets can be opened in isolation by selecting the appropriate level. Syntax returnstate = DBOpen(level)
  • Page 131 CHAPTER 6 – Functions and Methods OMRON DBProperty Description Returns the requested property. This function operates on the Recordset and Field levels. The type of the value returned depends on the property requested. Syntax returnstate = DBProperty(level, property) Remarks Argument...
  • Page 132 This function operates on both Recordset and Field levels. At the Field level the associated column values from the Recordsets current position will be copied into the Point (number of elements copied = number of elements in the Point, no paging applies at the Field level).
  • Page 133 Read the next page of records from the 'Customers' Recordset, and leave the cursor at the next record. DBRead("Northwind.Customers.Address") The Address field is read. If it is an array point, the Address is read from subsequent records until the array has been filled.
  • Page 134 Some commands require 1 or more extra parameters. "Read" takes an optional parameter ‘Page Number’ of type integer. If no ‘Page Number’ is supplied, this function will return page 1 when first called and automatically return the next page of schemas for each subsequent call, cycling back to the beginning when all pages have been returned.
  • Page 135 = DBState(level, state) Remarks Argument Type Description return bool 1 if the specified level is in the requested state, otherwise 0 level text A text point or constant specifying the connection level. This may be a Connection or Recordset level. state text The requested state must be either "Open"...
  • Page 136 Recordset and Field levels. At the Recordset level all the associated points values from the Points will be written into the Recordset starting at the current record (1 page of values will be written for each Point). At the Field level the associated values from the point are written into the Recordsets starting at the current position.
  • Page 137: Serial Port Functions

    Sets the serial communications port for receiving ASCII text messages. Any message received is placed in the text point. The boolean flag is set true to indicate that a message has been received. It is up to the user to reset this flag between receiving messages in order to indicate that a new message is present.
  • Page 138 Typical Example: bState = OutputCOMPort(1, Msg) CloseCOMPort Description Closes the designated serial communications port on the PC. The port must have been configured and opened before it can be closed. Syntax ReturnState = CloseCOMPort(PortNumber) Revision 2.0 Page 125...
  • Page 139 SetupCOMPort and opened using the script function OpenCOMPort. Typical Example: bState = CloseCOMPort(1) OpenCOMPort Description Opens the designated serial communications port on the PC for transmitting or receiving data. The port must have been configured before it can be opened. Syntax ReturnState = OpenCOMPort(PortNumber) Remarks Argument...
  • Page 140: Activex Functions

    @ONINPUT | @ONOUTPUT (or value 3) – both of the above. Typical Example: bState = SetupCOMPort(2, "9600,N,8,1", 0, 0x0D, TRUE) ActiveX Functions GetProperty Description Gets the value of a property of an OLE object and stores it in a point. Syntax propertyvalue = GetProperty(object, property, ...) Remarks Argument Type Description propertyvalue The value of the property.
  • Page 141 Can also be a number. Typical Examples PutProperty(“OLE1”, “Left”, NewLeftValue) This will write the value stored in the point NewLeftValue to the property ‘Left’ in the OLE object ‘OLE1’. PutProperty(“CXComms1”, “DM” 10, NewValue) This will write the value stored in the point NewValue to the property ‘DM’ (with one parameter 10) in the OLE object ‘CXComms1’.
  • Page 142 ‘CXComms1’ ExecuteVBScript Description Creates aliases allowing Visual Basic Script to be executed in line. This uses the Windows Scripting Host. See chapter 5 for a list of supported functions and details of the Windows Scripting Host. Syntax @VBSCRIPT @ENDSCRIPT Typical Examples @VBSCRIPT OLE1.LEFT = Point(“PointName”)
  • Page 143 This Java Script will write the value of the property ‘Height’ from the OLE object ‘OLE1’ into the Point named ‘PointName’. Note: The Java Script can not include the { or } characters. To use these, put the script in a text file and use the ExecuteJScriptFile function. ExecuteVBScriptFile Description Allows Visual Basic script stored in a text file to be executed.
  • Page 144 CHAPTER 6 – Functions and Methods ExecuteJScriptFile Description Allows Java script stored in a text file to be executed. This uses the windows scripting host which must be installed. See Appendix C for a list of supported functions. Syntax returnstate = ExecuteJScriptFile(scriptfile)
  • Page 145 The second and third parameters are not used. returnstate = GenerateEvent (“[Alarm Set]”, “Boiler alarm”, “95.5”) An event is sent to the client application which can be interpreted as ‘The Boiler alarm has been set with a process value of 95.5’.
  • Page 146: Chapter 7 - Script Examples

    When the balloon is airborne, clouds move slowly horizontally and change colour slightly. Clicking Help at any time brings up a special help page; clicking Close from this help page returns the user to the game. The blue gauge shows the amount of fuel consumed and left.
  • Page 147 CHAPTER 7 – Script Example OMRON The page script initiated at intervals of 100 milliseconds provides the main configuration of the game, reacting to user input and moving the balloon accordingly. This page script is as follows: IF burner AND alt > 400.0 THEN...
  • Page 148 ENDIF If the fuel burner is on, and there is still fuel left, and the rate of ascent exceeds 0 (the balloon has taken off) then point ‘lift’ is incremented by the rate of ascent divided by 5 to allow the balloon to climb.
  • Page 149 CHAPTER 7 – Script Example OMRON If the balloon has hit the ground (point ‘alt’ equals 140), then if the rate of descent is not too fast (defined by point ‘lift’), then the game is lost. lift = 0.0 ENDIF Point ‘lift’...
  • Page 150: Chapter 8 - Colour Palette

    Some colour names made up of more than one word are separated by an underscore or a hyphen. A specified colour can be changed in the CX- Supervisor development environment for the current session; such changes cannot be saved to a Page or Project, unless colours are changed from the Colour Palette located under the General Settings submenu in the Project menu.
  • Page 151 CHAPTER 8 – Colour Palette OMRON Page 138 Revision 2.0...
  • Page 152: Appendix A - Opc Communications Control

    OPC Communications Control This appendix contains a list of the available component properties and gives details of the Visual Basic script interface. These properties can be set in run time by using a Visual Basic script command – for example: - OMRONCXOPCCommunicationsControl1.ServerNodeName = “\\NAME”...
  • Page 153 In this example, the OPC item ‘BoilerTemp’ in the OPC group called “MyGroup” will be read from the OPC Server and will be stored in ‘intVal’. The script will wait for the read operation to complete before continuing to execute the next line. This is identical to the operation of the ‘Value’ method.
  • Page 154: Appendix B - Cx-Server Communications Control

    Checks a point name is valid. PLC Memory Functions A, AR, C, CIO, D, DM, DR, E, EM, G, GR, H, IR, LR, SR, ST, T, TC, TK, W. Functions for getting and setting the memory areas in the PLC.
  • Page 155 Description of last error that occurred Value Reads the value of an address from a PLC, or writes a value to an address in a PLC. This function allows logical names. Example 1 – Reading a value from the PLC using a logical name.
  • Page 156 ‘0’ parameter. This is identical to the operation of the ‘Value’ method. Note: If the PLC is not open, then this command will cause it to be opened, and then closed after the read is complete. If more than one read or write operation is to be performed, it is considerably faster and more efficient to use the OpenPLC command first, do all the reading and writing, and then (if required) use the ClosePLC command to close the PLC.
  • Page 157 ‘0’ parameter. This is identical to the operation of the ‘Value’ method. Note: If the PLC is not open, then this command will cause it to be opened, and then closed after the write is complete. If more than one read or write operation is to be performed, it is considerably faster and more efficient to use the OpenPLC command first, do all the reading and writing, and then (if required) use the ClosePLC command to close the PLC.
  • Page 158 In the first example, the contents of ‘MyString’ will be written into DM50 to DM54. Any additional data in ‘MyString’ will be ignored (i.e. if ‘MyString’ is 15 characters in length then the first 10 characters will be written to DM50 to DM54 and the remaining 5 characters will be ignored – {Note: each PLC address holds 2 characters}).
  • Page 159 Example 4 CXServer.IR(“100.2”) = True In this example, bit IR100.2 (i.e. bit 2 of IR100) in the PLC will be set to True. Note that use of the quotes is optional, but is required to differentiate between 100.1 and 100.10 ListPLCs Holds a list of all PLC names configured in the project file.
  • Page 160 In this example, the list of PLC names in the project configured stored in ‘arrayOfPLCs’ and then each is displayed in a message box. ListPoints Holds a list of all point names configured in the project file or PLC. This property is read only. Example Dim arrayOfPoints Dim nUbound, nLbound arrayOfPoints = CXServer.ListPoints(sPLC)
  • Page 161 NewDate = Now ‘ This example sets the time to the current PC time CXServer.ClockWrite "PLC1", NewDate RawFINS This function enables raw FINS commands to be sent to a specified PLC. This function is for advanced users familiar with the Omron FINS protocol only. VBScript Example...
  • Page 162 This function can be used to set key elements of a device address (the network number, node number, unit number and Ethernet IP address). The numbers are in the range 0 to 255, with -1 being used to denote “ignore this parameter”. This function is for advanced users only.
  • Page 163 OMRON SetDeviceConfig This is a function that can be used to set any element of CX-Server device configuration. All the data is passed in textual form. This function is for advanced users only. Note: This method does not interpret or verify the data passed, and it is possible to pass invalid data that will prevent a device communicating.
  • Page 164 The second parameter is the source file name. To upload the current program this should be an empty string, but may also be set to the name of a file in the root directory of a memory card, e.g. “Example.obj”.
  • Page 165 EnableProtection – true to set password protection, false to unset it PasswordString – Password as a string. For CS series PLCs this should be a string of up to 8 characters. For CV PLCs this should be a string of up to 8 characters containing a hexadecimal number, e.g.
  • Page 166 The correct password must be provided, however, when disabling the password protection. LastErrorString This property, which can be set as well as read, is a textual description of the last error that occurred. If none have occurred, it is blank. Example: txtError = CXServer.LastErrorString...
  • Page 167: Appendix Cjscript Features

    Windows 98, Windows ME, Windows 2000 and Windows XP and installed by Internet Explorer 4.0 and later. For Windows 95 and Windows NT, the Windows Scripting Host is available as a free download from Microsoft’s Web site.
  • Page 168 Maths Math abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan, E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2 Numbers Number MAX_VALUE, MIN_VALUE NEGATIVE_INFINITY, POSITIVE_INFINITY...
  • Page 169: Appendix D – Obsolete Features

    Details are included here to assist maintaining old projects still using these features. These features should not be used in development of new solutions as it is likely support for the following features may and will be removed from the next or future releases.
  • Page 170 DDE Commands DDE as a means for exchanging data has now been obsolete for some years. In fact for so long even its successor, OLE Automation is obsolete. DDE has also proved to be a poor technology, suffering from unfixed memory leaks both in the native Operating Systems, and tools like Microsoft Excel.
  • Page 171 Typical Example channelname = DDEInitiate("Excel", "Sheet1.xls") The Integer point ‘channelname’ is provided with a DDE link to the application Microsoft Excel which is run by the executable filename ‘EXCEL.EXE’, and to the file ‘SHEET1.XLS’ within that application.
  • Page 172 The DDEOpenLinks command enables points which have been configured to communicate via DDE to begin data transfer. Data transfer between CX-Supervisor and the application Microsoft Excel is automatically maintained until the channel is closed either by Microsoft Excel or by the command DDETerminate() using the Integer point ‘channelname’, or the command DDETerminateAll().
  • Page 173 APPENDIX D – Obsolete Features OMRON The content of point ‘data’ is sent to row 2, column 5 of ‘SHEET1.XLS’ in the Microsoft application. The Microsoft Excel application, and ‘SHEET1.XLS’ are specified by Integer point ‘channelname’. DDERequest Syntax pointname = DDERequest(channel, "item")
  • Page 174 A Boolean point that holds the required enable/disable state Typical Examples EnableDDE(result) DDE functions are enabled based on the value of point ‘result’. If ‘point’ is ‘TRUE’, then DDE is enabled, if ‘point’ is ‘FALSE’, then DDE is disabled. EnableDDE(TRUE) DDE functions can also be enabled directly without using a point to hold the desired status.
  • Page 175 ClearGraph(“Graph_1”, “TestPage1”) The trend or scatter graph on ‘TestPage1’ with the identifier ‘Graph_1’ has its data cleared. ClearGraph (“Graph_2”) The trend or scatter graph on the current page, with the identifier ‘Graph_2’, has its data cleared. StartGraph Syntax returnstate = StartGraph(“graphid”, “pagename”)
  • Page 176 OMRON APPENDIX D – Obsolete Features The trend or scatter graph on the current page with the identifier ‘Graph_2’ has its data logging started. Note: This command is provided for compatibility with SCS v2.0 applications. For newer applications the data logging facilities should be used in preference.
  • Page 177 Typical Examples SaveGraph(“Graph_1”, “TestPage1”) The trend graph on the page ‘TestPage’ with the identifier ‘Graph_1’ has its data saved to disc. SaveGraph(“Graph_2”) The trend graph on the current page with the identifier ‘Graph_2’ has its data saved to disc.
  • Page 178 The current data in trend graph ‘Graph1’ on ‘TestPage1’, is stored and is able to be viewed via the EditGraph command. Snapshot(“Graph_2”) The current data in trend graph ‘Graph1’ on the current page, is stored and is able to be viewed via the EditGraph command. Note: This command is provided for compatibility with SCS v2.0 applications.
  • Page 179 Number of messages queued up waiting to be printed on Alarm/Message printer. Typical Example NumberMessages = GetSpoolCount() The count of the number of messages (typically printed alarms) that are queued up waiting to be sent to the CX-Supervisor Alarm/Message printer is returned. SetPrinterConfig Syntax...
  • Page 180 OMRON APPENDIX D – Obsolete Features SetPrinterConfig(DriverNamePoint, DeviceNamePoint, PrintNamePoint) This uses text points. Terminator = FormatText(“%c%c”,13,10) Character 10 is 'lf' (newline), character 13 is cr (carriage return). SetPrinterConfig(“Epson9”,“”,“LPT1:”,Terminator) Revision 2.0 Page 167...
  • Page 181: Glossary Of Terms

    A logic operator used to interrogate Boolean type points. AND returns ‘TRUE’ if all arguments are ‘TRUE’. An example of AND is that if a is a statement and b is a statement, AND returns ‘TRUE’ if both a and b are ‘TRUE’.
  • Page 182 Database Recordset A Database recordset (or Recordset for short) is a set of records. This could either be an actual Table in the database, or a table that has been generated as a consequence of running a Query. Database Schema A Database Schema (or Schema for short) obtains database schema information from a Provider.
  • Page 183 The SQL Text can be modified at runtime, enabling different Queries to be run for varying situations however, the SQL Text has to be compiled on the fly every time it is executed and consequently is less efficient than a Server Query.
  • Page 184 Each recipe consists of at least one ingredient. Each ingredient must be related to an existing point. Integer type A type of point where the value of the point can only be a whole positive or negative number. Item Within the CX-Supervisor script language, Item is a generic term for a point, OPC item or Temperature Controller item.
  • Page 185 ‘TRUE’ if any of the supplied arguments are ‘TRUE’. An example of OR is that if a is a statement and b is a statement, OR will return ‘TRUE’ if either a and b are ‘TRUE’. If both statements return ‘FALSE’ then OR will return ‘FALSE’.
  • Page 186 Point A point is used to hold a value of a predefined type - Boolean, Integer, Text, etc. The contents of a point may be controlled by a graphical object or I/O mechanism such as PLC communication. The contents of a point may control the action or appearance of an object, or be used for output via an I/O mechanism.
  • Page 187 PLCs and other I/O mechanisms. Target Value An ingredient must specify a target value for its related point. This is the value to which the point will be set in runtime when the recipe is downloaded.
  • Page 188 OMRON GLOSSARY OF TERMS – Script Language A mode of video display that provides 640 × 480 pixel resolution with 16 VGA mode colours and is supported on Video Graphics Adapter systems. Windows Desktop An integral part of Microsoft Windows which allows Microsoft Windows based applications to be started from icons and for all applications to be organised.
  • Page 189: Index

    INDEX Bin - Text Commands: · 92 Bitmap · 168 Pixel · 173 Bitwise Operators - Logic and Arithmetic: · 12 Blink - Object Commands: · 40 AcknowledgeAlarms - Alarm Commands: · 76 AcknowledgeAllAlarms - Alarm Commands: · 76 AcknowledgeLatestAlarm - Alarm Commands: · 77 Alarm Commands ·...
  • Page 190 Read · 85 DisplayRecipes - Recipe Commands: · 88 ReadMessage · 85 DLL · 170 SelectFile · 86 Do While/Until Loop - Control Statements: · 21 Write · 87 Double Byte Character Set · See DBCS WriteMessage · 88 Download · 170 FileExists - File Commands: ·...
  • Page 191 Bitwise Operators · 12 Graphic Object · 171 Relational Operators · 14 Graphical User Interface · See GUI Logical Operators - Logic and Arithmetic: · 13 GUI · 171 Login - Security Commands: · 103 Logout - Security Commands: · 103 Height - Object Commands: ·...
  • Page 192 Object · 172 PLCMonitor - PLC Commands: · 68 Object Commands · 38 Point · 173 Blink · 40 Point Arrays within Script Commands and Expressions · Colour · 41 Current Object · 38 Point Commands · 57 Disable · 42 CancelForce ·...
  • Page 193 Current object statement · 38 Indentation · 24 Examples · 133 Multiple Commands · 24 Executable files, use of · 1, 158, 170 Parenthesis · 25 FALSE Boolean state · 1, 4 Quotation Marks · 25 Logical functions · 13–14 Mathematical precedence ·...
  • Page 194 Return · 23 ValueToText · 97 Super Video Graphics Adapter · See SVGA Text Object · 174 Supervisory Control and Data Acquisition · See SCADA TextToValue - Text Commands: · 97 SVGA · 174 Typographical conventions · 1 Target Value · 174 Unicode ·...
  • Page 195 INDEX – Script Language OMRON Vertical Fill - Object Commands: · 46 Windows Desktop · 175 VGA · 174, 175 Windows Scripting Host · 175 Video Graphics Adapter · 174, See VGA JScript · 154 ViewReport - Report Commands: · 91 VBScript ·...

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents