Home
CX-Supervisor Reference Manual
Contents
1. objects statement OP Specifies an object name for modification or test points statement All Specifies a point name for modification or test jarithmetic All Applies arithmetic operators expressions lt gt lt gt relational All Applies relational operators expressions AND logical operators All Applies logical expressions CALL statement All Call a subroutine DO LOOP WHILE statement Scr Script segment to be repeated UNTIL EXIT DO FALSE Boolean state Scr Applies Boolean expression FOR TO STEP statement Scr Script segment to be repeated NEXT EXIT FOR IFTHEN statement Scr Applies a test to a script ELSE ELSEIF ENDIF OR logical operators All Applies logical expressions NOT logical operators All Applies logical expressions REM statement Scr Remarks on line or lines of script RETURN statement Scr Stops sequential execution of script SELECT CASE statement Scr Applied to complex tests END SELECT TRUE Boolean state Scr 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 19 Points SECTION 4 CX Supervisor Script Language 4 1 Points 4 1 1 Basic Point Assignment Syntax pointname expression Remarks
2. Function Name Function Type Type Remarks TCBackupMode temp controller All Defines how a temperature command controller stores internal variables TCGetStatusParameter temp controller All Retrieves the temperature command controller status parameter TCRemoteLocal temp controller All Defines the operational mode of a command temperature controller TCRequestStatus temp controller All Retrieves the temperature command controller status TCReset temp controller All Resets the temperature controller command TCRspLsp temp controller All Defines the setpoint mode used command by the temperature controller TCRunStop temp controller All Defines either auto output mode command shift or manual output mode shift TCSaveData temp controller All Saves data associated with the command temperature controller TCSettingLevel1 temp controller All Performs a settinglevel function command for the temperature controller TextToValue textcommand Scr Converts a string to a numerical point value UploadPLCProgram PLC command All Uploads programs in the PLC to specified files ValueToText textcommand Scr Converts a numerical value into a text point vertical fill object command OP _ Specifies the vertical fill of an object ViewReport report command All Displays a report visible object command OP Toggles the visibility of an object width object command OP Specifies the width of an obje
3. Syntax lefttext Left textpoint noofchars Remarks Argument Type Description textpoint text The text point containing the string that is to be manipulated noofchars integer The number of characters to extract from the start of the string lefttext text Text point containing the specified range of characters Typical Example textpoint abcdefgh lefttext Left textpoint 3 The text point lefttext contains the string abc 6 12 8 Message Syntax Message message Remarks Argument Type Description message string Contains the text string that is displayed in the message box Typical Example Message this is a message The message this is a message is displayed in a Message Box 6 12 9 Mid Syntax midtext Mid textpoint offset noofchars Remarks Argument Type Description textpoint text 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 midtext text Text point containing the specified range of characters Typical Example textpoint abcdefgh midtext Mid textpoint 3 2 The text point midtext contains the string de 90 Text Commands SECTION 6 Functions and Methods 6 12 10 PrintMessage Syntax P
4. Syntax returnstate DBAddNew level Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 level text A text point or constant specifying the connection level This should be a field or recordset level Typical Examples Result DBAddNew Northwind Order Details Using a Recordset connection level a new record is added with values from all fields associated with a property type Add Point Result is set true if this was successful DBAddNew DBAddNew Northwind Order Details OrderID Northwind Order Details ProductID 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 To use DBAddNew with a Recordset level the Recordset must be configured to perform this type of operation i e it will need to contain fields for any primary keys and non null values required to create a new record When used at Recordset level all fields associated with the Recordset with property type Add are added as if calling DBAddNew and the record is updated as if calling DBUpdate Points associated with the Add property can be array points thus enabling you to add multiple records in one
5. DBAddNew Northwind Order Details UnitPrice DBUpdate Northwind Order Details Each required field is added to the new record using multiple calls to DBAddNew When the record is complete it is added to the Recordset by calling the DBUpdate function 6 17 14 DBWrite Description Writes a set of records into a Recordset from the associated point s This function operates on both 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 The number of elements written number of elements in the Point This function will fail if the Recordset is opened with a Lock of Read Only Syntax return DBWrite level reset 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 reset bool This argument is optional and may be omitted If omitted or TRUE when the write is complete the record cursor is reset to the position prior to writing Typical Examples DBWrite Northwind Customers Write all point values to the associated Customers fields
6. Category Keyword Feature Declarations Class Const Dim Private Public ReDim Function Sub Property Get Property Let Property Set Error Handing On Error Err Expressions Eval Excute RegExp Replace Test Formatting Strings FormatCurrency FormatDateTime FormatNumber FormatPercent Input Output Literals InputBox LoadPicture MsgBox Empty False Nothing Null True Math Atn Cos Sin Tan Exp Log Sqr Randomize Rnd Miscellaneous Eval Function Execute Statement RGB Function Objects CreateObject Err Object GetObject RegExp Operators Options Addition Subtraction Exporentiation Modulus arithmetic Mod Multiplication Division Integer Division Negation String concatentation amp Equality Inequality lt gt Less Than lt LessThan or Equal lt Greater Than gt Greater Than or Equal To gt Is And Or Xor Eqv Imp Option Explicit List of Features SECTION 5 VBScript Language Reference Category Keyword Feature Procedures Call Function Sub Property Get Property Let Property Set Rounding Abs Int Fix Round Sgn Script Engine ID ScriptEngine ScriptEngineBuildVersion ScriptEngineMajorVersion ScriptEngineMinorVersion Strings Asc AscB AscW Chr ChrB Chrw Filter InStr InStrB InStrRev Join Len LenB LCase UCase Left Lef
7. Typical Example GenerateReport report3 txt output txt The ReportTemplateFile report3 txt contains a predefined set of point names and text laid out exactly as the report reader likes to view them The point names contained within enclosing characters are the CX Supervisor names for the data that is required in the report The enclosing characters can be changed in the Project Runtime Setting Report setting dialog box but once set must be fixed for all reports generated by the project 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 KHTML The report template is processed dynamically replacing the point names with current values and saved as output txt Syntax returnstate Printreport ReportTemplateFile Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Text Commands SECTION 6 Functions and Methods 6 11 3 ViewReport Argument Type Description ReportTemplateFil string Pathname of the report template file e ReportOutputFile string Pathname of the report output 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 Syntax returnstate ViewReport ReportTemplateFile Rem
8. 6 9 2 CopyFile 6 9 3 DeleteFile 6 9 4 EditFile 80 Syntax returnstate CopyFile sourcename destname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise sourcename string Pathname of file to be copied May include a wildcard character destname string Pathname of destination of copy If path name does not exist it is created 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 Syntax returnstate DeleteFile filename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Filename string Pathname of file to be deleted Typical Example DeleteFile c pagename pag The file c pagename pag is deleted Syntax returnstate EditFile filename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Filename string Pathname of file to be edited Typical Example EditFile C report3 txt FileExists Syntax returnpoint FileExists filename Remarks File Commands SECTION 6 Funct
9. A file that contains programs or commands of an application that can be executed by a user or another application Executable files have a EXE file extension CX Supervisor provides two executable files one for the development environment CXSUPERVISORDEV EXE and one for the run time environment SCS EXE In the CX Supervisor script language expressions are a construct for computing a value from one or more operands For instance in the example lift height rate the expression is height rate where the result yielded from the expression is used for the value of lift 155 Appendix E Glossary of Terms 156 Field association Graphic Object GUI I O type Icon Ingredient Integer type ltem JScript JVM Microsoft Excel Microsoft Windows Microsoft Word for Windows Outside of the script language expressions consisting of operators and operands can be used to control objects through actions A field association enables a link to be made between a CX Supervisor Point and a particular field i e column within a recordset In CX Supervisor a graphic object is created in the development environment and can be a line an arc a polygon including a square and rectangle a round rectangle an ellipse including a circle or a polyline A complex object can exist as a combination of two or more graphic objects Graphical User Interface Part of a program that interacts with the us
10. currentmode 68 PLC Commands SECTION 6 Functions and Methods 6 6 4 OpenPLC Note Syntax Returnstate OpenPLC plcname processed Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 plcname string Name of PLC to be opened If the PLC is being accessed using a communications component e g the Omron CX Communications Control this parameter should be the control name and PLC name separated by a dot e g OMRONCXCommunicationsControl controlPL Cc processed bool Flag set to TRUE when set operation has actually been completed Typical Example OpenPLC controlPLC doneopen The PLC called controlPLC is opened for communication 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 generally more efficient 6 6 5 PLCCommsFailed 6 6 6 PLCMonitor Syntax returnstate PLCCommsFailed plcname Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 plcname string Name of PLC to be checked Typical Example IsFailing PLCCommsFailed controlPLC The
11. Positive numbers designate object specific verbs 55 General Commands SECTION 6 Functions and Methods Typical Example PlayOLE ole_1 0 The object ole_1 is played using its primary verb 6 3 3 DisplayPicture 6 3 4 PlaySound 6 3 5 Rand 56 Description Reload a picture for a Picture object Syntax returnstate DisplayPicture objectname filename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise objectname string The identifier of the bitmap object with a to be loaded and displayed filename string The filename of the bitmap to be displayed This can be a constant inside quotes or a text point Typical Example DisplayPicture Bitmap_1 C Application Floorplanl bmp 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 Description Plays a Windows WAV sound file using the standard Windows sound channel and Sound Card driver Syntax returnstate PlaySound soundfile Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise soundfile string Path of sound file to be played Typical Example PlaySound c noise wav The soundfile c noise
12. 6 19 1 GetProperty 116 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 n a The value of the property Type is dependant on the type of the property object Text The name of the OLE object to get the property of property Text The name of the property to get n a Any number of parameters for the property Typical Examples OLElHeight GetProperty OLE1 Height This will read the property Height from the OLE object OLE1 and store it in the point OLEHeight DM100Value GetProperty CXComms1 DM 100 ActiveX Functions SECTION 6 Functions and Methods 6 19 2 PutProperty 6 19 3 Execute This will read the property DM with one parameter 100 from the OLE object CXComms1 and store it in the point DM100Value Description Puts a value stored in a point into the property of an OLE object Syntax PutProperty object property value Remarks Argument Type Description object Text The name of the OLE object containing the property to change property Text The name of the property to put n a Any number of parameters for the property value n a The value to write to the property Type is dependant on the type of property Can also be a number Typical Examples PutPro
13. A type of point where the value of the point can be any number including those containing a decimal point A recipe is a set of pre defined steps used to perform a particular task A CX Supervisor project may contain zero or more number of recipes Recipes are defined in the development environment and executed or downloaded in the run time environment SCADA applications are run using the run time environment of CX Supervisor following creation of the application in the CX Supervisor development environment Supervisory Control and Data Acquisition A Server is the central processing point of a Network that is accessible to all computers Networks affect CX Supervisor in that further associated options are available if the computer Network is connected An application that can be used to view or interact with whilst currently within CX Supervisor Statement String SVGA mode CX Supervisor Target Value Taskbar Text Object Text Type Unicode Validation Code VBScript VGA mode Windows Desktop Windows Scripting Host Appendix E Glossary of Terms Within the CX Supervisor script language a statement is a command understood by the run time environment Statements are constructed of commands and arguments which when combined help to formulate a finished application to be used in the run time environment The contents of a Text type point that can only contain literal alphanumeric characte
14. Resize width e Rotate e Show page e Vertical move Vertical percentage fill e Visible The following example of a simple expression contains a point redcars attached to a particular object with an appropriate object action Resize Height At runtime once the value of the point has been met within the attributes declared within the Active Expression Range Required Height fields the current object is resized accordingly This example is an Integer or Real example whereby the value of the point either falls inside or outside the specified range In this example the point redcars must fall between O and 40 for the expression to be met 13 SECTION 2 Expressions Resize Height x Expression a redcars Cancel Active Expression Range Required Height Minimum Value fo Minimum Height fo Maximum Value fao Maximum Height fi 60 C Centre i C Top 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 This example is a Boolean example whereby either the expression is met TRUE or not met FALSE A Boolean value is always returned from a Digital Expression field as opposed to
15. The message this is an event appears as an event in the error log 6 14 Printer Commands 6 14 1 ClearSpoolQueue Syntax returnstate ClearSpoolQueue Remarks Argument Type Description returnstate bool 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 6 14 2 EnablePrinting Syntax returnstate EnablePrinting flag Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise flag bool 0 to disable 1 to enable Typical Example EnablePrinting FALSE Disables printing 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 6 14 3 PrintActivePage Syntax returnstate PrintActivePage flag Remarks 94 Printer Commands SECTION 6 Functions and Methods 6 14 4 PrintPage 6 14 5 PrintScreen Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise flag bool Flag is to indicate whether the print setup dialog is to be displayed
16. Value is the default property and does not have to be specified Reads an array of values from a PLC or writes an array of values to a PLC This function allows logical names If an array is used then a SAFEARRAY is returned with all values Example 1 Reading an array of values from the PLC using a logical name SomeArray CXServer Values BoilerTemps Example 2 Writing an array of values to the PLC using a logical name CXServer Values BoilerTemps SomeArray SetDefaultPLC Appendix B CX Server Communications Control B 4 SetDefaultPLC The SetDefaultPLC function can be used to inform the script parser that a particular PLC is has been set as the default Once a default PLC has been set then it is not necessary with some functions to specify a PLC name For example CXServer SetDefaultPLC MyPLC intVal CXServer Value BoilerTemp1 CXServer Value BoilerTempl1 75 intVal CXServer Value DM50 Each Value function above will access data in the PLC called MyPLC Note If there is only 1 PLC in the project then it is not necessary to call the SetDefaultPLC function The first PLC in a project will automatically be set as the default PLC B 5 OpenPLC Opens a PLC for communications If no PLC is specified then the default PLC is opened Example 1 CXServer SetDefaultPLC MyPLC CXServer OpenPLcC CXServer DM 100 10 CXServer DM 50 10 Example 2 CXServer OpenPLC MyPL
17. lt lt Shift Right gt gt Unsigned Shift Right gt gt gt Conditional Comma delete typeof void Decrement Increment Objects Array Boolean Date Function Global Math Number Object String Strings String charAt charCodeAt fromCharCode indexOf lastIndexOf split toLowerCase toUpperCase length Windows NT Windows ME Windows 98 and Windows 95 Appendix D Obsolete Fea Appendix D Obsolete Features This appendix provides a summary of features that are obsolete and have been removed from the standard documentation 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 D 1 Windows NT Windows ME Windows 98 and Windows 95 D 2 Sleep Note Note Note Note This product will no longer install on these operatinf systems It is recommended to upgrade to a later Windows version Description Pause execution of a script for specified duration Syntax Sleep duration Remarks Argument Type Description Duration Number of milliseconds to wait before continuing Typical Example Sleep 1000 CX Supervisor waits 1 second The sleep statement should be used with caution as some other parts of the system may not be updated while a script is sleeping
18. of the OLE object OLE1 6 19 5 ExecuteJScript Note Description Creates aliases allowing Java Script to be executed in line See Appendix C for a list of supported functions and details of the Windows Scripting Host Syntax JSCRIPT ENDSCRIPT Typical Examples JSCRIPT Point PointName OLE_1 Height ENDSCRIPT This Java Script will write the value of the property Height from the OLE object OLE1 into the Point named PointName The Java Script can not include the or characters To use these put the script in a text file and use the ExecuteJScriptFile function 6 19 6 ExecuteVBScriptFile 118 Description Allows Visual Basic script stored in a text file to be executed This uses the windows scripting host which must be installed See chapter 5 for a list of supported functions Syntax returnstate ExecuteVBScriptFile scriptfile Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 scriptfile Text The name of the file with the Visual Basic Script to execute Typical Examples returnstate ExecuteVBScriptFile c vbscript txt This will execute the Visual Basic Script stored in c vbscript txt ActiveX Functions SECTION 6 Functions and Methods 6 19 7 ExecuteJScriptFile Description Allows Java script stored in a text file to be executed This uses the windows scripting host which must be
19. pointname point This is a point whose attributes must include a DDE Access of Read Only or Read Write The contents of this point are assigned to the server application Typical Example channelname DDEInitiate Excel Sheetl xls DDEPoke channelname R2C5 data 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 Syntax pointname DDERequest channel item Remarks Argument Type Description channel Integer This is an integer point which contains the point return value of the DDEInitiate command Both server and topic parameters applied to the channel in the DDElnitiate command must be open or an error is reported item string This is an item as recognised by the server application For instance a cell is an item within a spreadsheet application Likewise a page is an item for a word processing application It is wholly dependent on the server application pointname point This is a point whose attributes must include a DDE Access of Read Write Typical Example channelname DDEInitiate Excel Sheetl xls cellref DD ERequest Channelname R2C5 The point cellref is filled from a specific item row 2 column 5 from SHEET1 XLS from the Microsoft Excel application specifi
20. 0 otherwise Pointname point Name of point to be disabled Typical Example DisablePoint point1 The point point1 is disabled thus preventing values to be read written Note This is useful for optimisation of communications 62 Point Commands SECTION 6 Functions and Methods 6 5 5 EditPoint 6 5 6 EnableGroup Syntax EditPoint BoolPoint Caption OffText OnText or EditPoint AnalogPoint Caption MinValue MaxValue Keyboard or EditPoint TextPoint EchoOff Keyboard Remarks Argument Type Description BoolPoint point Name of Boolean point to be edited Caption Text Text Caption for Edit dialog Off Text Text Text description for Boolean state 0 OnText Text Text description for Boolean state 1 AnalogPoint point Name of Integer or Real point to be edited MinValue Int Real Minimum value to be entered MaxValue Int Real Maximum value to be entered Keyboard Bool Flag set to TRUE to display the onscreen keyboard TextPoint point Name of Text point to be edited EchoOff Bool 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 o 9999 000000 r OFF EditPoint nValue FALSI Enter a new value 0 000000 E A dialog is displayed to edit the
21. Equal to and not equal to relational operators e Bitwise AND XOR OR e AND logical operator OR logical operator lowest 20 Logic and Arithmetic SECTION 4 CX Supervisor Script Language Typical Examples 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 Precedence can be changed by the introduction of parenthesis lift lift 0 2 The Integer or Real point lift is assigned the value calculated by the current value of point lift minus 0 2 distance distance time The Integer or Real point distance is assigned the value calculated by the current value of point distance multiplied by point time References Refer to chapter 4 Logic and Arithmetic for details of the use of arithmetic and logic functions Refer to chapter 4 Punctuation for details of the use of parenthesis 4 2 Logic and Arithmetic 4 2 1 Arithmetic Operators Syntax pointname expression Remarks Argument Description pointname The point name to be assigned a value based on an arithmetical expression expression The value to be assigned to pointname The expression may include the following operators with points and constants Addition e Subtraction e Multiplication e Division Modulus e Increment Decrement Typical Ex
22. Insert hexadecimal value upper case HEX characters for instance FFFF lx Insert hexadecimal value lower case HEX characters for instance ffff c Insert character can be used to convert value to character for instance to insert control character With the text left aligned and with a width field for instance 6ld to insert a value left aligned with a field 6 characters wide 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 6 12 5 GetTextLength Syntax value GetTextLength textpoint Remarks Argument Type Description textpoint text This is the point which has its text length point counted returnpoint Integer This is the point that holds the return value real Typical Example textpoint Hello World count GetTextLength textpoint The number of characters in textpoint is counted and the point count is set to the value 11 6 12 6 Hex Syntax result Hex value Remarks Argument Type Description Value Number to be converted to a Hex number Result String containing Hex representation of value Typical Example HStr Hex 44 In this example Hstr contains 2C 89 Text Commands SECTION 6 Functions and Methods 6 12 7 Left
23. 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 LOOP DO nextchar Mid Mystring position 1 position position 1 LOOP UNTIL nextchar A Note Loop statements should be used with caution as they consume processor time while they are running and some other parts of the system may not be updated 4 4 Subroutines 4 4 1 Call Syntax CALL subroutine arguments Remarks 29 Punctuation SECTION 4 CX Supervisor Script Language 4 4 2 Return 4 5 Punctuation 4 5 1 4 5 2 Indentation 30 Argument Description subroutine The name of the subroutine defined at project level arguments The list of arguments required by the subroutine separated by commas Each argument may be a pointname constant arithmetical or logical expression or any valid combination Typical Example CALL MySub Second Default 2 Intl Syntax RETURN Typical Example IF limit gt 1000 THEN RETURN value limit DIF EM final part of script OLYGON_1 COLOUR red JLIPSE_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 R
24. read from the open file 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 valuel value2 value3 The points value1 value2 value are loaded using the value of indexno as an index into the file Pass or fail status is stored in ReadOK It is advisable to use a Recordld less than 1024 whenever possible in order to optimise file access time records 0 to 1023 are cached Syntax returnstat ReadMessag filename offset textpoint noofchars Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Filename string Pathname of file to be read File Commands SECTION 6 Functions and Methods Note 6 9 10 SelectFile Argument Type Description Offset integer An offset from the beginning of the file in characters indicating where to start reading from Textpoint text The text point which holds the characters read point from the file Noofchars integer The number of characters to read from the file Typical Example ReadMessage C CX SUPERVISOR TESTFILE TXT 0 TextPoint 20 The first 20 characters are be read from the file CACX SUPERVISOR TESTFILE TXT and stored in the point TextPoint Text points can hold up to 256 characters therefore a max
25. 97 Data Logging Commands SECTION 6 Functions and Methods 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 6 16 3 CloseLogView Syntax CloseLogView datasetname Remarks Argument Type Description datasetname text Name of Data Set to close as text point or constant Typical Example CloseLogView Process 1 This command will close the Data Log Viewer which is displaying the named data set 6 16 4 ExportAndViewLog Syntax ExportAndViewLog datasetname item st format file outputfile or ExportAndViewLog datasetname TextArray format file outputfile Remarks Argument Type Description datasetname text Name of Data Set to close as text point or constant item list string List of ltems and or Groups within the data set to export separated by commas Alternatively use to export all TextArray string A text point which has an array size specified array as 1 or more elements Each element holds an Item or Group name format string Either CSV or Text to specify output format May include suffix followed by B to exclude break information D to exclude the log date T to exclude the log time M to exclude to log milliseconds G to not Group On Change data together file integer Number of file to export where 0 is the latest active file 1
26. A mode of video display that provides 640 480 pixel resolution with 16 colours and is supported on Video Graphics Adapter systems An integral part of Microsoft Windows which allows Microsoft Windows based applications to be started from icons and for all applications to be organised CX Supervisor can be run from Windows Desktop A scripting engine supplied by Microsoft to run VBScript or JScript See http msdn microsoft com scripting 159 Appendix E Glossary of Terms Wizard Wizards are dialogs used by the CX Supervisor development environment to take the user through complex operations in a simplified step by step process 160 Revision history Revision history A manual revision code appears as a suffix to the catalog number on the front cover of the manual Cat No WO9E EN 01 The following table lists the changes made to the manual during each revision The page numbers of a revision refer to the previous version Revision Date Revised content code 01 Sept 2010 First version in the standard Omron format 161 Revision history 162 OMRON Authorized Distributor Cat No WO9E EN 01 Note Specif cations subject to change without notice Printed in Europe
27. Alternatively use to export all TextArray string A text point which has an array size specified array as 1 or more elements Each element holds an Item or Group name format string Either CSV or Text to specify output format May include suffix followed by B to exclude break information D to exclude the log date T to exclude the log time M to exclude to log milliseconds G to not Group On Change data together file integer Number of file to export where 0 is the latest active file 1 is the previous file etc 99 Data Logging Commands SECTION 6 Functions and Methods 6 16 6 OpenLogFile Argument Type Description outputfile string File name for output file May include full path which will be created automatically if it does not exist 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 Typical Examples ExportLog Balloon or ExportLog Balloon Altitude Fuel Burning Lift Group 1 CSV BDTM 0 output or ItemList 0 Altitude ItemList 1 Fuel ItemList 2 Burning 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
28. DBWrite Northwind Customers Address FALSE Write the point values to the Address column and leave the cursor at the next set of records 113 Serial Port Functions SECTION 6 Functions and Methods 6 18 Serial Port Functions 6 18 1 InputCOMPort Description 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 This function need only be called once to receive multiple messages every time the termination character is recieved Syntax ReturnState InputCOMPort PortNumber Message MessagePresent MaxLength Remarks Argument Type Description ReturnState bool True if successful else false PortNumber Integer The number of the port previously configured using the function SetupCOMPort and opened with OpenCOMPort message Text Text point to hold ASCII text message received through the port MessagePresent Bool Boolean point indicating that a message has been received MaxLength Integer Optional Maximum length of transmission before input is terminated Used where fixed length packets are received without termination characters Typical Example bState InputCOMPort 1 Msg bTransmission 6 18 2 OutputCOMPort Descripti
29. 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 recipel The recipe recipe1 is downloaded References Refer to the CX Supervisor User Manual for details of recipes 6 10 3 UploadRecipe Syntax returnstate UploadRecipe recipename processed Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise 85 Report Commands SECTION 6 Functions and Methods Argument Type Description recipename string The name of the recipe to be uploaded processed bool Flag set to true when operation has been completed Typical Example UploadRecipe recipel done The recipe recipe1 is uploaded and point done is set True when the upload is complete References Refer to the CX Supervisor User Manual for details of recipes 6 11 Report Commands 6 11 1 GenerateReport 6 11 2 PrintReport 86 Syntax returnstate GenerateReport ReportTemplateFile ReportOutputFile Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise ReportTemplateFil string Pathname of the report template file e ReportOutputFile string Pathname of the report output file
30. DisplayErrorLog event command Scr Displays the current Error Log DisplayPicture general Scr Reload an image for a picture command object DisplayRecipes recipe command Scr View the current recipes in the project DownloadPLCProgram PLC command All Downloads specified files to the PLC DownloadRecipe recipe command Scr Downloads a specified recipe EditFile file command All Edits a specified file EnableAlarms alarm command All Enables alarm functions EnableErrorLogging error command Scr All actions become subject to Error Logging EnableGroup point command All Permits a group of points to be read or written EnableOLE comms Scr Allows use of OLE functions command EnablePLC comms Scr Allows use of PLC functions command EnablePoint point command Scr Enables communications to a point EnablePrinting printer All Permits printing of Alarms or command messages ExportAndViewLog Data Logging Scr Exports data log and views command ExportLog Data Logging Scr Exports data log command FileExists file command All Specifies the existence of a file Force point command Scr Locks the value of a point ForceReset point command Scr Sets a point value to 0 ForceSet point command Scr Sets a point value to 1 FormatText text command All Inserts text with standard C formatting characters GenerateReport report command All Produces a report based ona report t
31. alarms close object command Scr Closes a specified page CloseAlarmHistory alarm command All Closes the current alarm history CloseAlarmStatus alarm command Scr Closes the current alarm status CloseComponent comms All Closes a component for a PLC command e g CX Server components CloseErrorLog error command Scr Closes the currently open Error Log CloseFile file command Scr Closes the open file CloseLogFile Data Logging Scr Closes a data log file command CloseLogView Data Logging Scr Closes the log viewer command ClosePLC PLC command Scr Close communications with a PLC colour object command OP Specifies a colour to an object CopyArray point command All Copies the content of an array CopyFile file command Scr Copies a specified file cos unary function All Applies unary expression DeleteFile file command Scr Deletes the specified file 41 SECTION 6 Functions and Methods 42 Function Name Function Type Type Remarks disable object command OP Disables an object DisableGroup point command All Prevents a group of points to be read or written DisablePoint point command Scr Disables communications to a point display object command Scr Displays a specified page DisplayAlarmHistory alarm command Scr _ Displays the current alarm history DisplayAlarmStatus alarm command Scr __ Displays the alarm status of all current alarms
32. bMyFlagPoint 1 or bMyFlagPoint 0 Instead always test using the correct Boolean constant i e TRUE or FALSE for CX Supervisor scripts or True and False when using VBScript On Condition scripts are only executed when the expression is TRUE Sometimes this leads to peculiar results for example using 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 This works because the Second forces the expression to be tested when the point changes but the TRUE means the test will return TRUE regardless of the value of the point Use array points in On Condition expressions with caution The expression MyArray 3 1 does not mean execute every time the third element changes to 1 It means execute when any element of MyArray changes and the third element happens to be 1 Using an array point without any index is the same as specifying element 0 i e MyArray actually means MyArray 0 1 15 16 SECTION 2 Expressions Object SECTION 3 Scripts SECTION 3 Scripts A CX Supervisor script is a simple programming language used to manipulate points Scripts can be created at different levels at object level page level or project level Although the script code can be applied to all levels of script there are subtle differences described in th
33. configured using the function SetupCOMPort Typical Example bState OpenCOMPort 1 6 18 5 SetupCOMPort Description Configures the designated serial communications port on the PC for transmitting or receiving data Syntax ReturnState SetupCOMPort PortNumber ConfigurationString HandShaking TerminationChar ControlCharFlag TermMode Remarks Argument Type Description ReturnState bool True if successful else false PortNumber Integer A string indicating the desired Baud rate Parity number of data bits and stop bits 115 ActiveX Functions SECTION 6 Functions and Methods Argument Type Description HandShaking Integer The required handshaking protocol Valid values are 0 None 1 XonXoff 2 RTS 3 RTS amp XonXoff TerminationChar Integer A character indicating the end of the message ControlCharFlag Bool A flag indicating that control characters contained in a received message should be Ignored TermMode Integer Optional Flags to indicate how to use the termination character ONINPUT or value 1 Function InputComPort expects Termination Character This is the default value if omitted ONOUTPUT or value 2 Function OutputComPort appends Termination Character ONINPUT ONOUTPUT or value 3 both of the above Typical Example bState SetupCOMPort 2 9600 N 8 1 0 Ox0D TRUE 6 19 ActiveX Functions
34. cursors or you simply want to step through the records a page at a time Description Issues commands to read schema results or properties or set up new schema criteria This function operates only at a Schema level Syntax return DBSchema level command parameters Remarks Argument Type Description return Value returned by command For some commands e g RecordCount this is an integer value for other commands this is a text value level text A text point or constant specifying the connection level This must be a Schema level Database Commands SECTION 6 Functions and Methods 6 17 11 DBState Argument Type Description command text The command must be one of the following e Read Transfers a schema page into the associated point Set Enables schema details to be modified e Type Returns the current Schema Type e Criteria Returns the current Schema Criteria Filter Returns the current Schema Filter e RecordCount Returns the number of records in the current Schema e PageCount Returns the number of pages in the current Schema e CurrentPage Returns the current Schema page parameters 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 schema
35. directory is assumed which may not be the same as the application directory Ifa filename is specified as the user is prompted at runtime for a filename processed bool processed is set to TRUE when the operation is actually completed Typical Example DownloadPLCProgram controlPLC ProgOl bin done The program stored in the file Prog01 bin in the current directory is downloaded to the PLC controlPLC Before continuing the script waits up to five seconds for the action to succeed Note The operation may not be complete 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 upload to be completed create an On 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 6 6 3 GetPLCMode Syntax mode GetPLCMode plcname Remarks Argument Type Description mode string A Text point containing the current PLC mode Possible modes are STOP DEBUG RUN MONITOR and UNKNOWN plename string Name of PLC Typical Example currentmode GetPLCMode controlPLC In this example the current mode of the PLC controlPLC is stored in the point
36. in isolation by selecting the appropriate level Syntax returnstate DBOpen level Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 level text A text point or constant specifying the connection level This must be a Recordset level Typical Examples DBOpen Northwind Open the connection to the Northwind database and automatically open any Recordsets set to open on connection done DBOpen Northwind Order Details Just open a specific Recordset 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 Type Description returnstate bool 1 if the function is successful otherwise O level text A text point or constant specifying the connection level This must be a Recordset level Database Commands SECTION 6 Functions and Methods Note 6 17 9 DBRead Argument Type Description property text The name of the property to get For details see the Recordset Properties and Field Properties tables Typical Examples Page DBProperty CSV Result CurrentPage Get the current page for the CSV Result Recordset FieldSize DBProperty Northwind Customers Address Size Get the size for the Address field The Recor
37. 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 A Database Schema or Schema for short obtains database schema information from a Provider A Database Server Query or Server Query for short is a query that is stored in the actual Database They are pre defined and added by the database designer which means they are fixed for the duration of a project Server Queries may have pre defined Parameters which allow criteria to be passed to the query at runtime e g values to filter allowing one query to be used to produce different results Each pre defined parameter must have a Parameter Association defined Because these queries are stored in a compiled and tested form they are more efficient and therefore preferential to running a SQL Query Database SQL Query DBCS DCOM DDE Development Environment DLL Download Executable Expressions Appendix E Glossary of Terms A Database SQL Query or SQL Query for short is interpreted dynamically at runtime 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 DBCS stands for Double Byte Character Set and is a Microsoft extension of ASCII which uses 2 byte
38. result Exp value exponent Remarks Argument Type Description result integer Point name to receive returned result of value raised to the power of exponent value integer Number to raise exponent integer Power to raise value by Typical Example MSBMask Exp 2 15 In this example MSBMask is assigned the value 215 i e 32 768 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 Syntax returnstate PlayOLE objectname OLEVerbNumber Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise objectname string The identifier of the OLE object to be played OLEVerbNumber integer The verb number has a specific meaning to the OLE application Typical values are 0 specifies the action that occurs when an end user double clicks the object in its container The object determines this action often edit or play 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 Applies only to objects that are activated in place
39. the DDEInitiate command Both server and topic parameters applied to the channel in the DDEInitiate command must be open or an error is reported Typical Example channelname DDEInitiate Excel Sheetl xls DDEOpenLinks channelname 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 Syntax returnstate DDEPoke channel item pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise 145 DDE Commands Appendix D Obsolete Features D 3 5 DDERequest 146 Argument Type Description channel Integer point This is an integer point which contains the return value of the DDEInitiate command Both server and topic parameters applied to the in the DDElnitiate command must be open or an error is reported item string This is an item as recognised by the server application For instance a cell is an item within a spreadsheet application Likewise a page is an item for a word processing application It is wholly dependant on the server application
40. the disable command e Chapter 6 Height for use of the height command e Chapter 6 Horizontal Fill for use of the horizontal fill command e Chapter 6 Move for use of the move command e Chapter 6 Rotate for use of the rotate command e Chapter 6 Vertical Fill for use of the vertical fill command e Chapter 6 Visible for use of the visible command e Chapter 6 Width for use of the width command The CX Supervisor User Manual for details of the Animation Editor Syntax objectname objectcommand pagename objectname objectcommand Remarks Argument 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 Object Commands SECTION 6 Functions and Methods 6 1 3 Blink Argument Description objectcommand This can be made up of the following commands which are described in chapter 6 Object Commends Blink command e Colour command Disable command e Visible command Move command Rotate command e Vertical fill command Horizontal fill command Height command e Width command The content of the commands are made up arithmetical or logical expressions x and y co ordinates or references varying between commands The colour command requires a colour identifier Typical Examp
41. the function is successful otherwise 0 Typical Example DisplayAlarmStatus The current alarm status is displayed References Refer to the CX Supervisor User Manual for details of alarms Syntax EnableAlarms flag message Remarks Argument Type Description flag If set TRUE then alarm logging is enabled If set FALSE logging is disabled message Text message which is recorded in the alarm log to indicate change of status Typical Example EnableAlarms TRUE Alarm logging enabled References Refer to the CX Supervisor User Manual for details of alarms 6 8 10 IsAlarmAcknowledged 78 Syntax pointname IsAlarmAcknowledged alarmname Remarks Argument Type Description pointname bool The Boolean point name to be assigned a point value based on the test of an acknowledged alarm alarmname string The identifier of the alarm File Commands SECTION 6 Functions and Methods 6 8 11 6 9 6 9 1 Typical Example acknowledged IsAlarmAcknowledged temptoohigh The point acknowledged is assigned Boolean state TRUE if the temptoohigh alarm is currently acknowledged The point is assigned Boolean state FALSE if the alarm is not currently acknowledged References Refer to the CX Supervisor User Manual for details of alarms IsAlarmActive Syntax pointname IsAlarmActive alarmname Remarks Argument Type Descr
42. the position of each cloud and the speed at which each cloud moves The page script initiated at intervals of 1000 milliseconds determines how the balloon reacts to the conditions 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 gt 400 0 THEN burner FALSE ENDIF IF burner THEN fuel fuel rat IF fuel lt 0 0 THEN fuel 0 0 burner FALSE 121 Balloon Script SECTION 7 Script Example 122 ENDIF ENDIF IF burner AND fuel gt 0 0 AND rate gt 0 0 THEN lift lift rate 5 0 ELSE IF alt gt 140 0 THEN lift lift 0 2 ENDIF ENDIF IF lift lt 10 0 THEN lift 10 0 ENDIF alt alt lift IF alt lt 140 0 THEN IF distance gt 630 0 AND distance lt 660 0 AND lift gt 3 0 THEN winner TRUE burner FALSE ENDIF IF lift lt 3 0 then crash TRUE burner FALSI ENDIF lift 0 0 ENDIF Gl speed alt 140 0 100 0 IF speed lt 0 0 then speed 0 0 ENDIF distance distance speed The following paragraphs describe the above script on a line by line basis IF burner AND alt gt 400 0 THEN burner FALSE ENDIF If the fuel burner is on based on Boolean point burner set to TRUE and the altitude of the balloon bas
43. to the named output file in the format specified Syntax returnstate OpenLogFile datasetname or returnstate OpenLogFile databaselink Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 datasetname text Name of Data Set to open as text point or constant databaselink text Name of Database link to open as text point or constant Typical Example OpenLogFile Balloon This command will open the log file ready to start logging As the function is disk intensive it should not be called frequently 6 16 7 OpenLogView 100 Syntax OpenLogView datasetname item list sessionfile or OpenLogView datasetname TextArray sessionfile Data Logging Commands SECTION 6 Functions and Methods Remarks Argument Type Description datasetname text Name of Data Set to open as text point or constant item list string List of Items and or Groups within the data set to view separated by commas TextArray string A text point which has an array size specified array as 1 or more elements Each element holds an Item or Group name sessionfile string Optional filename of session information file The Data Log Viewer is shown with the session settings e g Window position size colours grid options etc stored in the session file If omitted the previous settings are used Typical Example OpenLogVie
44. wav is played Description Returns a random integer between 0 and the specified limit Syntax General Commands SECTION 6 Functions and Methods Note pointname Rand upperlimit Remarks Argument Type Description upperlimit integer The maximum negative or positive integer value that the Rand function can generate pointname Integer Point that contains the integer returned from point the Rand function 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 If upperlimit is negative then the range is 0 to the negative number 6 3 6 RunApplication 6 3 7 RunHelp Description Requests the operating system runs a new program It will run in a separate process and RunApplication does not wait for the application to be launched The specified filename must be executable i e have an extension of EXE COM or BAT Syntax returnstate RunApplication executable Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise executable string Pathname of executable file Typical Example RunApplication c myprog exe The executable file c myprog exe is run Description Invokes the Windows Help engine and loads a help file showing a specific topic number Synta
45. working directory 83 File Commands SECTION 6 Functions and Methods 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 dialog will be displayed showing all files in the CAWINDOWS directory 6 9 11 Write Syntax returnstate Write Recordld pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Recordld integer An index into the file Pointname point Name s of point s containing data to write to the open file Typical Examples WroteOK Write indexno Second The point Second is written to the currently open file using the value of indexno as an index into the file Pass or fail status is stored in WroteOK Write 2 Second Minute S Hour The points Second 5Minute Hour are written to the currently open file using the value 2 as an index into the file Note It is advisable to use a Recordld less than 1024 whenever possible in order to optimise file access time records O to 1023 are cached 6 9 12 WriteMessage Syntax returnstate WriteMessage filename offset text linefeed R
46. 1 GetBit Syntax returnpoint GetBit pointname bit Remarks Argument Type Description pointname Integer This is the name of the point to get the bit value real from Indirection or point value may be used bit integer This specifies which bit to get the value of returnpoint bool This contains the return value TRUE or FALSE Typical Example pointname 256 returnpoint GetBit pointname 8 The point returnpoint contains TRUE 6 5 12 InitialiseArray Syntax InitArray arrayname value Remarks Argument pe pesares oo value Value to set all elements of the array to 65 Point Commands SECTION 6 Functions and Methods 6 5 13 InputPoint Note 6 5 14 OutputPoint Note 6 5 15 PointExists 66 Typical Example InitArray MyArray 0 In this example all elements of the array MyArray are set to 0 Syntax returnstate InputPoint pointname returnflag Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point The point name whose data is to be read returnflag point Optional Boolean point which is set to TRUE when value is returned from the PLC Typical Examples InputPoint point returnflag FALSE InputPoint point returnflag A request is made that the current value of point point should be read In the second example returnflag is set to TR
47. 1721 OIDBSCHSM droit tritio niles 110 017 1MDBState oia trcrecere a Peer E E arias 111 6 17 12 DBSUppOMtS niacin datan 112 6 17 13 DBU Pd ates ua dt dd diri 112 6 17 14 DBWiite h asec iia tesa eee nee i ae A eee eee aia 113 6 18 Serial Port FUNCtIONS miea eee aeeeeeeeee a aa a a i aaa aata hae aa dadi iiaa 114 6 19 11 MPA O OM POE e cl a sel ea a eek sets 114 6 18 2 QUIPUTGOMPOMT cantata 114 6 18 39 CloseGOMPort dorada 115 6 18 4 OpenCOMPott iii a dd 115 6 18 5 Sep OM OE siii dt la A Air 115 6 19 ActiveX FUTNICIUONS coccion A dd aye 116 6219 1 GetProperty ui as 116 621922 a ar cee eyabel lite ebeceee AE A Saga Sacicuna sa bacenas shal AOA 117 6 1953 EXOCUTS ici rollito 117 6 19 4 ExecuteVBScripPt ooomnccnnncnnnccnnnncconericnnneccnnncccnnnncc cnc 118 6 19 5 gt Executive 118 6 19 6 ExecuteVBScriptE less odds 118 6 19 7 Executed ScriptFile cece ceceeeseeceeeeeeeeeeeeceseaaeseeeecaaeeenaeesaaeseeeaeesnaaeseeaaaeessaeseeeeeeeeeaees 119 6 19 8 Generate Event sistant Aileen ne ede heed Ase aed 119 SECTION 7 SCALE oc Ue 7 1 Balloon SCript ii o tate ba ee 121 SECTION 8 Colour Palette inicio oconnianiaancidn sitas 129 Appendix A OPC Communications Control c cccceececceccececcecceceecnececescnense 127 A 1 A 2 A 3 Component Properties tirano sanan Oasis ia 127 Script Interface ica Aa 127 FUNCION ts A A ias 127 AST O ete 127 A Ad a de dto a da dl A ne 128 PER MMM a E 128 Appendix B CX Se
48. 19 ClockWrite B 20 RawFINS For Count 1 To UBound arrayOfPoints MsgBox arrayOfPoints Count Next In this example the list of Points configured for the PLC name specified in text point sPLC is stored in arrayOfPoints and each displayed in a message box Example 2 arrayOfPoints CXServer ListPoints If ListPoints is used without a parameter then points from all PLCs are returned Checks whether a point is currently indicating Bad Quality Example Dim bBad bBad CXServer IsBadQuality MyPLC MyPoint IsBadQuality will return True in situations where the quality is unknown e g where no previous communications with a point has occurred Function that reads the PLC clock Example Dim NewDate NewDat CXServer ClockRead PLC1 dates can be manipulated via standard VBScript methods FormatDateTime DatePart etc TextBoxl NewDate this uses a Microsoft Forms Text Box to convert date to string TextPointl TextBoxl this writes the date string to a CX Supervisor text point Function that sets the PLC clock The expected format for the date is dd mm yyyy hh mm ss Example Dim NewDate set time date value here using standard VBScript methods Date Time Now CDate etc NewDate Now This example sets the time to the current PC time CXServer ClockWrite PLC1 NewDate This function enables raw FINS commands to be sent to a specified PLC This function is for advanced users famil
49. A e at E a sable entaiananesa saiborace certs 66 6 5 14 OutputPoint sss wdlensi dete nn A eae es 66 B 9 15 POINTEXISTS 0d da T AAA A 66 6 5 16 SAB a a EE AA Win A E a E Ad da adi 67 PLE COMMANAS sisediscesiencedistand eee van chndeves ean vei a ehiteees E E a S NEE 67 Sa a N D e A E F E O poo Eta Le ds 67 6 6 2 DownloadPE Program iman ata 68 6 623 GelPLCGMOde viii a e VA a i a aaa 68 6 64 OpenPL Gwasanaeth a eae el ee 69 6 6 5 PLOCOMIMSF lO ai adsusitdedanssacesdeuasstdatasdsoendepansiagedehsvvidedesdvatecs 69 626 6 A O RON 69 6 67 SOIPLOMOe ia de la il Dl a aaa 70 6 6 8 SetPLCPhoneNumber mccccconococccnnonononcnnnonononcnnnnnnnnnnnnnnnn non nnnnnnn nn rnnnnnnnnnrnnnnnnnnnnnnnnnnnnnrnnnannnnnnos 70 6 6 9 UploadPLECGP FO aMi eniai AAA onl es 70 Temperature Controller COMMANdS ooconccccnnnncnnnnccccnnnnnnnnnnnccnncc non nn narran rra 71 6 71 TEAULOTUNG aii ita 71 6722 TEBackupMOde siii retar iaa rca ria ew 72 6 7 3 TCGetStatusParameter c cooonococccnonnoccnnnnnononcnnnnnnnnnnnnnnnnnnnnnnnnnnn nn rn aai a EENAA EEEE ARAA aa 72 674 TERemoteLocalin iii a E AA AE AEA SAARE ANA di 73 6 7 5 TOROQUEStSIalUsS viaria dia 74 627 6 TORSPLESP i da a 4 74 6 7 7 _ FGR N STOD ci e a ea hee ee ee Bet a 75 6 78 TES VOD ds 75 679 TOSetindLeve ito a Pek leebe tes leg ceed gb ra aa lial Pardee ete sberd a Enait 75 B 721 0 TORES iiss O 75 Alarm COMME a ceeds dha cada ii ita 76 62821 AcknowledgeAlarinciccicccccccpecccec
50. Argument Description pointname The point name to be assigned a value expression The value to be assigned to pointname The expression may be of type Boolean Integer Real or Text Typical Examples count 100 The Integer or Real point count is assigned the value 100 result TRUE The Boolean point result is assigned the state TRUE name Valve position The Text point name is assigned the associated text contained within quotation marks 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 References Refer to chapter 4 Punctuation for details of the use of quotation marks 4 1 2 Further Point Assignment Syntax pointname expression Remarks Argument Description pointname The point name to be assigned a value expression The value to be assigned to pointname The expression may be of type Boolean Integer or Real and can include other points logical or arithmetical expressions Mathematical precedence is applied as follows e Parenthesis highest e Unary minus and NOT logical operator e Multiplication division and modulus e Addition and subtraction e Greater than less than greater than or equal to and less than or equal to relational operators e Shift Left SHL and Shift Right SHR
51. C CXServer DM 100 10 B 6 ClosePLC Closes a previously opened PLC If no PLC is specified then the default PLC is closed Example CXServer ClosePLC MyPLC B 7 Read Function to read the value of a PLC point Example of synchronous Read intVal CXServer Read MyPLC MyPoint 0 In this example the Point MyPoint will be read from the PLC MyPLC and stored in intVal The script will wait for the read operation to complete before continuing to execute the next line due to the 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 B 8 Write Function to write the value of a PLC point Example of synchronous write CXServer Write MyPLC MyPoint NewValue 0 131 ReadArea Appendix B CX Server Communications Control In this example NewValue will be written to the point MyPoint in the PLC called MyPLC The script will wait for the write operation to complete before continuing to execute the next line due to the 0 parameter This is identical to the operation of the Value method Note If the PLC is not open then this comm
52. CX Supervisor Software Release 3 1 Script Language Reference Trademarks and copyrights Notice Note A A Notice OMRON products are manufactured for use by a trained operator and only for the purposes described in this manual The following conventions are used to classify and explain the precautions in this manual Always heed the information provided with them Indicates information of particular interest for efficient and convenient Operation of the product Caution Indicates information that if not heeded could possibly result in minor or relatively serious injury damage to the product or faulty operation Warning Indicates information that if not heeded could possibly result in serious injury or loss of life Trademarks and copyrights Copyright MECHATROLINK is a registered trademark of Yaskawa Corporation Trajexia is a registered trademark of OMRON EtherCAT is a registered trademark of the EtherCAT Technology Group All other product names company names logos or other designations mentioned herein are trademarks of their respective owners Copyright O 2010 OMRON All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means mechanical electronic photocopying recording or otherwise without the prior written permission of OMRON No patent liability is assumed with respect to the use of the information cont
53. DDE as a DDE server Typically this is the name of the applications EXE executable file without the filename extension At runtime the server application must be open or a value cannot be returned and an error is reported 144 DDE Commands Appendix D Obsolete Features D 3 3 DDEOpenLinks D 3 4 DDEPoke Argument Type Description topic String This contains the name of the topic recognised by the server application Typically a topic is a document within an application At runtime the topic must be open or a value cannot be returned and an error is reported The topic may be left empty which enables documents to open remotely prior to making a specified connection The topic name System may be used to find out which other topics within the server application are available However this is dependant on the server application supporting this topic Typical Example channelname DDEInitiate Excel Sheetl 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 Syntax returnstate DDEOpenLinks channel Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise channel Integer This is an integer point which contains the point return value of
54. DIF Provided Integer point fuel is less than 0 then it is assigned the value 0 IF burner THEN fuel fuel rat ENDIF Provided Boolean point burner is TRUE then Integer point fuel is assigned a new value It is also possible to apply IF burner TRUE THEN as the first line with identical results IF distance gt 630 AND distance lt 660 AND lift gt 3 THEN winner TRUE burner FALSE ENDIF 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 24 Control Statements SECTION 4 CX Supervisor Script Language IF burner AND fuel gt 0 AND rate gt 0 THEN fuel fuel rat ELSE lift 0 altitude 0 ENDIF Provided that Boolean point burner is TRUE AND points fuel and rate are greater in value than 0 then fuel is assigned a new value Otherwise points lift and altitude are assigned a new value References Refer to chapter 4 Punctuation Indentation for details on the layout of code 4 3 2 Nested Conditional Statements Syntax IF conditionA THEN statementblockl IF conditionB THEN statementblock3 ENDIF ELSE statementblock2 ENDIF or IF conditionA THEN statementblockl IF
55. E and ELSEIF the CASE ELSE statement is optional 27 Control Statements SECTION 4 CX Supervisor Script Language SELECT CASE TRUE CASE temperature gt 0 AND temperature lt 10 colour blue CASE temperature gt 10 AND temperature lt 20 colour green CASE temperature gt 20 AND temperature lt 30 colour red CASE ELSE colour white ENDSELECT In this example instead of using a point as the condition as with the previous example the value is the condition in this case Boolean state TRUE with the integer point temperature being tested at each case 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 that temperature is between 21 and 30 then the current object is set to red If none of these CASE statements are met then the current object is set to white Like ELSE and ELSEIF the CASE ELSE statement is optional References Refer to chapter 6 Object Commands for details of applying attributes to an object and for the use of the Colour object command Refer to chapter 8 Colour Palette for details of the Colour Palette colour designation 4 3 4 FOR NEXT Loop 28 Syntax FOR pointname startpt TO e
56. ETURN command are ignored If the value of integer point limit does not exceed 1000 then the RETURN command is not executed and statements after the RETURN command are performed References Refer to the CX Supervisor User Manual for the use of the RETURN statement for Recipe validation 3 U nD m Command String Delimiters Description Alternative string delimiters allowing string to contain quote characters Syntax Some string text Typical Example 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 However for clarity the quote characters should be used by preference Message Error Typical Examples IF burner AND fuel gt 0 AND rate gt 0 THEN lift lift rate 5 Punctuation SECTION 4 CX Supervisor Script Language H SE IF altitude gt 140 THEN lift lift 0 2 ENDIF ENDIF IF burner AND fuel gt 0 AND rate gt 0 THEN lift lift rate 5 IF altitude gt 140 THEN lift lift 0 2 ENDIF ENDIF Both examples provide identical functionality but the use of indentation either spaces or tabs to show the construction of the statements aids readability The use of the ELSEIF statement in this example was omitt
57. Example 2 CXServer DM 100 75 In this example the value 75 will be written to DM100 in the PLC Bit addressing that is accessing data from individual memory bits is also supported by these memory areas IR AR HR and CIO Example 3 bVal CXServer IR 100 2 In this example the status of bit IR100 2 i e bit 2 of IR100 will be read from the PLC and stored in bVal e g bVal will be set to TRUE or FALSE 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 Holds a list of all PLC names configured in the project file This property is read only Example Dim arrayOfPLCs Dim nUbound nLbound arrayOfPLCs CXServer ListPLCs nLbound LBound arrayOfPLCs nUbound UBound arrayOfPLCs For Count nLbound To nUbound MsgBox arrayOfPLCs Count Next In this example the list of PLC names in the project configured stored in arrayOfPLCs and then each is displayed in a message box 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 nLbound LBound arrayOfPoints nUbound UBound arrayOfPoints IsBadQuality Appendix B CX Server Communications Control B 17 IsBadQuality Note B 18 ClockRead B
58. It also uses multithreading which means some tasks like PLC communication may occur in parallel and behave unpredictably In a well designed truly event driven system use of the Sleep statement should never be required Always consider if the statements after the Sleep should be in their own script executed when a Condition occurs The Granularity or intervals differs between Operating Systems In Windows NT and 2000 expiration is checked every 10ms so Sleep 100 actually pauses for any time between 100 to 109 99 milliseconds depending on when it was started For Windows 98 and ME the granularity is 55ms so Sleep 100 actually pauses for 110 2 times 55 to 164 99 milliseconds nearly 3 times 55 For this reason Sleep statements can act differently on different Operating Systems making the application OS dependant Sleep should never be used as a delay for timing processes for the following reasons e The actual time delay depends on the OS as described above There is always an error of O to 1 granularity depending on when the action is started The frequency can not be guaranteed as the OS may be busy or handling other processes 143 DDE Commands Appendix D Obsolete Features D 3 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 mem
59. NT 138 Download rogram arini lio la el naa 138 A chaste stbbcc oe ccd hte dn cause eaves A et ethes bastante E E E E 138 LastErrorString iie a Me li ee a a ee ee R a 139 Appendix C JScript Features 14 Appendix D Obsolete FeatureS oocooconcoococnoconnoncononnononnnnrnanannnnnanna cnn narnaranra zan 143 D 1 Windows NT Windows ME Windows 98 and Windows DB occccccccccoccnccccccococononononaconononononnnnnnnnnns 143 D 2 Pi A DA AA AA ET 143 D 3 DDE Gomimanids orton A aida 144 D371 DDEEXSCUtO vai id dai 144 32 SD DEI Mitte A ata 144 D 3 3 DDEQpPenLinkS ceso iii ea da ads 145 D 3 4 DDEP OK cui dit eee eae iaa 145 D3I5 DDEReq eSb orai i doc 146 D3 6 DDEJ MiNaS vebebetle shel wabeeevbtepeaveaMadveln hela depeceebhewenteupel a ie 147 DISA DDET rminateAllec aia ince csccente cet a a dies eines R a ai 147 D 3 8 Enable DDE Wariano bane biases tet aaa aaaea aaa aaa ia 147 D 4 Graph COMMAS eco iii id dea Eaa Aea Eaa A A ir 148 DA lt ClearGraph v2 cces Gaia ce A Aa a ee es een ad ae aie 148 RS A pe ete ees 148 DAS 8 Orap r rere rece tree rere eer ereereeen freee a aa ne ree mre rere reece Perea Tree rere 148 D 4 4 Edita still 149 D45 ES AVE GPAPM it A iaa 150 D 4 6 7 SnapShots descdcigive tessctiin iniatekiade eres eave aa 150 D 47 GOP OI E ETE PE ENO E PEE ETE TEE ESTEE NEA ETE hitvigen Aaa 150 D 4 8 CGOIS PO EAU A ale wee aa aa ea 151 D 4 9 SetPrinterGontid ii da 151 Appendix E Glos
60. RunMode MyPLC In this example the operating mode would be read from MyPLC and stored in intMode If MyPLC was in Monitor mode then intMode would be set to the value 2 Reads the PLC model name of a PLC e g C200H CQM1H CVM1 etc Example strPLCType CXServer TypeName MyPLC In this example the PLC model type will be read from MyPLC and will be stored in strPLCType Checks if a Point name has been defined in the CX Server project file Examples bValid CXServer IsPointValid MyPoint bValid CXServer IsPointValid MyPoint MyPLC In both examples the boolean variable bValid is set True if the point MyPoint has been defined B 14 PLC Memory Functions A AR C CIO D DM DR E EM G GR H IR LR SR ST T TC TK W 133 ListPLCs Appendix B CX Server Communications Control Note B 15 ListPLCs B 16 ListPoints 134 All PLC memory functions e g A AR D DM etc work in exactly the same way The following examples use the DM function to get and set the value of a DM address in a PLC Example 1 intVal CXServer DM 100 In this example the contents of DM100 will be read from the PLC and stored in intVal These examples assume there is only 1 PLC in the CX Server project file or that the SetDefaultPLC function has been used to select the required PLC Refer to the SetDefaultPLC function for details about using script with multiple PLCs in the project
61. SECTION 6 Functions and Methods templ TCAutoTune e5ak temp2 6 7 2 TCBackupMode Syntax returnstate TCBackupMode TController mode Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string 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 method used by a temperature controller for storing internal variables 0 In this mode variables are stored in RAM and EPROM 1 In this mode variables are stored in RAM only Typical Example templ TCBackupMode ea5k temp2 6 7 3 TCGetStatusParameter Syntax returnstate TCGetStatusParameter TController paramID value Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller 72 SECTION 6 Functions and Methods Temperature Controller Commands Argument Type Description 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 5 OutputType 6 CoolingType 7 Output2 8 Alarm1 9 Alarm2 10 InputType Integer E5 F E5 X E5 J 11 OperationMode 12 Back
62. The type of data returned is dependant on the pointname specified Typical Example pointname 10 returnpoint GetPointValue pointname 0 The point returnpoint contains the value 10 The offset is added to any offset specified for pointname For example returnpoint GetPointValue a 10 10 Causes the 21st element offsets begin at zero of array a to be retrieved Note It is often simpler to access an array element directly e g returnpoint a 20 D 4 8 GetSpoolCount Syntax returnstate GetSpoolCount Remarks Argument Type Description returnstate int 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 D 4 9 SetPrinterConfig Syntax returnstate StePrintConfig Driver Device Port Remarks Argument Type Description returnstate Bool Returnstate is 1 if the function is successful or 0 otherwise Driver String Name of printer device e g Epson9 for 9 pin Epson printers Device String Name of specific device e g Epson FX 870 This is optional Port String Name of port or file e g LPT1 Line Terminator String Optional Sets terminator e g cr to be added to end of each printed line Typica
63. This method does not interpret or verify the data passed and it is possible to pass invalid data that will prevent a device communicating Care should be taken to ensure that all data passed is valid This method should not be used while a PLC is open and communicating Example Device PLC1 Section NET Entry IPADDR Setting 10 0 0 1 bValid CXServer SetDeviceConfig Device Section Entry Setting Note The return Boolean value bValid is set to True if no errors were detected However this does not necessarily mean that all the parameters used were valid or appropriate for the device being used Only the following Section Entry and Setting parameter value combinations are currently supported e Section ADDRESS Entry DNA Setting 0 Setting 255 this can be used to set the network number Section ADDRESS Entry DA1 Setting 0 Setting 255 this can be used to set the node number e Section ADDRESS Entry UNIT Setting 0 Setting 255 this can be used to set the unit number Section ADDRESS Entry IPADDR Setting 0 0 0 0 Setting 255 255 255 255 this can be used to set the Ethernet IP address Other parameter values may work but should only be used on Omron advice B 26 GetDeviceConfig This is a function that can be used to read any element of the CX Server device configuration All the data is passed and received in textual form This funct
64. Types Either Boolean Integer Real or Text e Point Variable A point or object within a script that may take different values Strings Data in the form of text delimited by quotation marks which can be assigned to a point The and braces Must be inserted around the argument command or an error is reported An error is reported if there are spaces between braces e TRUE and FALSE Refer exclusively to Boolean states where Boolean state 0 is FALSE and Boolean state 1 is TRUE 11 12 SECTION 1 Introduction SECTION 2 Expressions SECTION 2 Expressions This chapter describes the use of expressions within scripts Expressions consist of operators and operands e Operators are relational arithmetic logical and include many functions e 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 e Blink e Close page e Colour Change Analogue e Colour Change Digital e Display Status Text e Display Text Point e Display Value Edit point value Analogue Edit point value Digital Edit point value Text e Enable Disable Horizontal move e Horizontal percentage fill e Resize height
65. UE when the value is returned from the PLC The value is not returned immediately it is not possible to use the returned value in the same script as the InputPoint command Instead the value should be accessed from within an On Condition script which has an expression of returnflag TRUE Syntax returnstate OutputPoint pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point The point to be updated Typical Examples OutputPoint result The point result is updated with its current value The value of a point connected to a PLC is not be set if the point is currently in a forced state Syntax returnpoint PointExists pointname Remarks PLC Commands SECTION 6 Functions and Methods Argument Type Description pointname string pointnamestringThis text contains the point name returnpoint point Boolean point that contains the return value 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 6 5 16 SetBit Syntax returnstate SetBit pointname bit value Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwi
66. _1 has its data logging started StartGraph Graph_2 The trend or scatter graph on the current page with the identifier Graph_2 has its data logging started This command is provided for compatibility with SCS v2 0 applications For newer applications the data logging facilities should be used in preference Syntax returnstate StopGraph graphid pagename Graph Commands Appendix D Obsolete Features D 4 4 EditGraph Note Note Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to be stopped pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples StopGraph Graph_1 TestPagel The trend or scatter graph on TestPage1 with the identifier Graph_1 has its data logging stopped StopGraph Graph_2 The trend or scatter graph on the current page with the identifier Graph_2 has its data logging stopped Syntax returnstate EditGraph graphid Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to be edited Typical Example EditGraph Graph_1 The Edit Graph dialog is displayed offering options to view historical data for t
67. a basis A word processing application Nesting Network Non Volatile NOT Object OLE DB Operand Operator OR Pages Appendix E Glossary of Terms To incorporate one or more IF THEN ELSE ELSEIF ENDIF statements inside a structure of the same kind 1 Part of the PLC configuration based on the device type The number of Networks available is dependant on the device type 2 A number of computers linked together with a central processing point known as a Server which is accessible to all computers Networks affect CX Supervisor in that further Network associated options are available if the computer is Network connected A point that is designated as non volatile is a point whose value is saved on disk and automatically reloaded when CX Supervisor resumes execution A logic operator used to interrogate Boolean type points which produces the Boolean inverse of the supplied argument An example of NOT is that if a is a statement and is FALSE then NOT returns TRUE Ifais a statement and is TRUE then NOT returns FALSE In CX Supervisor an object can be text graphics a control a bitmap or ActiveX object as created in the development environment A complex object can exist as a combination of two or more objects of any of the above types Specifically graphical objects can be categorised as a line an arc a polygon including a square and rectangle a round rectangle an ellipse includi
68. ained herein Moreover because OMRON is constantly striving to improve its high quality products the information contained in this manual is subject to change without notice Every precaution has been taken in the preparation of this manual Nevertheless OMRON assumes no responsibility for errors or omissions Neither is any liability assumed for damages resulting from the use of the information contained in this publication Copyright Notice Table of Contents Notice A A AR IEEE eee ceeeeaeeeeeeeeaaeeeeeeeaaaeeeeseeaaaeeeeeeeaaaeeeeeseaeeeeeeeaaes 1 COPY Miri EE E tal 1 SECTION 1 Introduction lt a a ls ec eee EA SECTION 2 Expro SSIONS E aa FO SECTION 3 3 1 ODO EEIE A A AA EA A A ica 17 3 2 A nine EE E E E E T E N ede A AS A T 17 3 3 Pd A ios 17 SECTION 4 CX Supervisor Script Language cccccceceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 19 4 1 A 20 4 1 1 Basic Point ASSIQOMeN occcccccnococcncnonncnnnncnanannnnonnnnnn cnn rr nana nn eee E rra 20 4 122 Further RointASsiGh MENE il deca ie 20 4 2 LOGIC and Aritmetica ia ag ane ena 21 4 2 1 Arithmetic Operators ccoo did ended dies 21 4 2 2 Bitwise OperatOlS ooonmiccninnnninncccnnncnnncncnn scene 22 4 2 3 o O ae iene gi ee i es el i k 22 4 2 4 Relational Operators oooonnncinnncicnncccnnnocnnnnccccnnnnnn nano coran 23 4 3 Control Statements la ete 24 4 3 1 Simple Conditional StatemMentS oooocccccnnicoconcnonooononccnnnnnonnncnnnnnonnccnnnnnonnccnnnnnnnnrnnnnnnnnn
69. all currently logged errors is displayed in a dialog 6 13 4 EnableErrorLogging 6 13 5 LogError 6 13 6 LogEvent Syntax returnstate EnableErrorLogging pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname bool 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 Syntax returnstate LogError message priority Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise message string Contains the text string that is displayed in the Error Log priority integer Priority assigned to the error O low 1 medium 2 high Typical Example LogError This is an error 1 The message This is an error appears as a medium priority error in the error log Syntax returnstate LogEvent message Remarks 93 Printer Commands SECTION 6 Functions and Methods Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise message string Contains the text string that is displayed in the Error Log Typical Example LogEvent this is an event
70. alue arraypoint 2 Setting the value of an array point using indirection textpoint arraypoint textpoint 2 30 e Getting the value of an array point using indirection textpoint arraypoint value textpoint 2 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 The Boolean array point motor is configured to contain 4 elements The integer point index which has a range 0 3 is used to dynamically change the element of the point being controlled In order to dynamically change the element of a Boolean point that a toggle button is linked to follow these steps 1 2 3 1 Link the toggle button to an array point e g motor index 2 Change the value of the index to determine which element of the Boolean point to control e g via the Edit Point Value Analogue animation 4 8 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 option from the Project menu It can also be displayed if Aliases is selected from the script editor The dialog dis
71. ample StopAuditTrail This command will stop the current audit trail logging and close the audit trail database Syntax returnstate StartLogging datasetname or returnstate StartLogging databaselink Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 datasetname text Name of Data Set to open as text point or constant databaselink text 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 Syntax returnstate StopLogging datasetname or returnstate StopLogging databaselink Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 datasetname text Name of Data Set to open as text point or constant databaselink text Name of Database link to stop logging as text point or constant Typical Example StopLogging Process 1 This command will stop logging of all items in the named data set Database Commands SECTION 6 Functions and Methods 6 17 Database Commands 6 17 1 DBAddNew Note Note Note Note 6 17 2 DBClose Description Adds a new record to a Recordset This function will fail if the Recordset is opened with a lock of Read Only
72. amples 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 Precedence can be changed by the introduction of parenthesis References Refer to chapter 4 Punctuation for details of the use of parenthesis 21 Logic and Arithmetic SECTION 4 CX Supervisor Script Language 4 2 2 Bitwise Operators Syntax pointname expression or IF expression or DO WHILE expression or DO UNTIL expression Remarks Argument Description pointname The pointname to be assigned a value based on the bitwise operation expression The value to be assigned to pointname or to be evaluated as a Boolean expression The expression can include the following operators with points and constants Bitwise AND BITAND or amp e Bitwise OR BITOR or e Bitwise XOR XOR or e Bitwise Shift Left SHL or lt lt e Bitwise Shift Right SHR or gt gt Typical Examples MSB value amp 128 The Boolean point MSB is set TRUE if the binary representation of value has the bit set which is worth 128 Pattern value lt lt 2 The binary representation of value is shifted left twice and stored in pattern Each Shift Left operation has
73. an Expression field which returns an Integer or Real value Operators used within this example are fully described in chapter 4 Logic and Arithmetic Visibility Ea Digital Expression position gt 300 AND position lt 450 Cancel Visibility State Invisible while TRUE Visible while FALSE Browse lave eanuaneennranpaneantennanavenesnsanassnsusenousnansannegacene ssuesunanvenesentsussuadnrenvenee The following example of an expression contains a value point prompt which is included at the value position denoted by a symbol Display Value Analogue Ed Expression q AA Second ner A Dad Bome Displayed Text Number of seconds Format T Left Justified Q Standard I Leading Zeros Scientific Hexadecimal Browse Refer to the CX Supervisor User Manual for detailed dialog descriptions 14 Note Note Note Note Note SECTION 2 Expressions Boolean Expressions execute when the expression is TRUE so it can be said that every Boolean expression has an inferred TRUE Sometimes Boolean expressions can be difficult to read e g bMyFlagPoint or BitMask 8 0x80 It can help maintenance if this TRUE is explicitly specified e g bMyFlagPoint TRUE or BitMask amp 0x80 TRUE When using Boolean operators e g amp amp never mix tests for Boolean and non Boolean operands For example never use
74. analogue point nValue between 0 and 9999 with a caption Enter a new value without using the onscreen keyboard EditPoint txtMessage Set Text to FALSE FALSE A dialog is displayed to edit the Text point txtMessage with a caption Set Text to echoing the input and not displaying the onscreen keyboard Syntax returnstate EnableGroup groupname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise groupname text Name of the group containing the points to enable Typical Example 63 Point Commands SECTION 6 Functions and Methods 6 5 7 EnablePoint 6 5 8 Force 6 5 9 ForceReset 64 EnableGroup lt Default gt All points belonging to the lt Default gt group is enabled thus allowing values to be read written Syntax returnstate EnablePoint pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point Name of point to be enabled Typical Example EnablePoint point1 The point point1 is enabled thus allowing values to be read written Syntax returnstate Force pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point Name of point to have force s
75. and 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 B 9 ReadArea Reads a specified block of memory from a PLC Examples of synchronous read MyVariant CXServer ReadArea MyPLC DM0 12 vbString MyVariant CXServer ReadArea BoilerTemp 10 vbInteger MyVariant CXServer ReadArea BoilerTemp 20 In the first example DMO to DM11 will be read as characters part of a string from MyPLC and will be stored in MyVariant The second example demonstrates that it is also possible to use a logical name for the start address and that any VB variant types such as vbInteger can be used The third example shows that the VB Variant type parameter is optional if none is specified then vbInteger is assumed The script will wait for the read operation to complete before continuing to execute the next line Note If accessing from a CX Supervisor script the following integral values should be used for the return type Constant Value Description vbEmpty 0 Uninitialized default vbNull 1 Contains no valid data vbInteger 2 Integer subtype vbLong 3 Long subtype vbSingle 4 Single subtype vbSingle 5 Double subtype vbCurrency 6 Cur
76. arks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise ReportTemplateFil string Pathname of the report template file e Typical Example ViewReport report3 txt 6 12 Text Commands 6 12 1 BCD 6 12 2 Bin Syntax result BCD value Remarks Argument Type Description Value Number to convert to Binary Coded Decimal BCD result String containing BCD representation of value Typical Example BCDStr BCD 39 In this example BCDstr contains 00111001 Syntax result Bin value Remarks Argument Type Description Value Number to be converted to a binary number result String containing binary representation of value 87 Text Commands SECTION 6 Functions and Methods 6 12 3 Chr 6 12 4 FormatText 88 Typical Example BStr Bin 20 In this example Bstr contains 10100 Syntax result Chr value Remarks Argument Type Description Value Extended ASCII value to convert to a character result String containing single character representation of value Typical Example Char Chr 65 In this example Char contains A Syntax textpoint FormatText formattext expression Remarks Argument Type Description textpoint text A text point which holds the formatted text point formattext stri
77. base Schema Database Server Query The relevant communications management system for OMRON PLCs in conjunction with Microsoft Windows providing facilities for other SYSMAC software to maintain PLC device and address information and to communicate with OMRON PLCs and their supported network types Within CX Supervisor a constant is a point within the script language that takes only one specific value In CX Supervisor a control object is applied in the development environment and can be a pushbutton a toggle button a slider a trend graph a rotational gauge or a linear gauge Essentially a control object can be a complex graphic object consisting of a number of primitive graphic objects which provides user interaction An advanced communications management system for OMRON PLCs providing facilities for software to maintain PLC device and address information and to communicate with OMRON PLCs and their supported network types CX Server supports CS Series PLCs A Database connection or Connection for short contains the details used to access a data source This can either be via Data Source Name DSN filename or directory A Database Connection Level is a string which determines what level in the database tree hierarchy is to be operated on Some examples are listed below Northwind Connectionlevel CSV Result Recordset level Northwind Order Details OrderlD Field level Invoice Data Types Schema level A Database
78. before printing Typical Example PrintActivePage TRUE The currently active page is sent to the printer The flag TRUE indicates that the print dialog is displayed FALSE causes the print dialog not to be shown Syntax returnstate PrintPage pagename flag printheaderfooter Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pagename string The name of the page to be printed flag bool Flag to indicate whether the print setup dialog is to be displayed before printing printheaderfooter bool Optional Flag to control if printout details are included in a header and footer Typical Example PrintPage pagel TRUE The CX Supervisor page is sent to the printer The flag TRUE indicates that the print dialog is displayed first to allow for printer configuration If FALSE was specified instead of TRUE then the print dialog is not shown the page is just printed Syntax returnstate PrintScreen flag Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise flag bool Flag to indicate whether the print setup dialog is to be displayed before printing Typical Example PrintScreen FALSE All CX Supervisor pages currently on view is printed The flag FALSE indicates that the print dialog is not displayed A flag
79. ccctscccnes censceecccesedecbacadebecuacdcabessucte ceshassteccesebssuhe caebesacteeebesssieets 76 6 8 2 AcknowledgeAllAlarMs oooooconncnnncciccconoconoconononcconcnnncnnnnnnnno aeaaeaeeeeeeeeeedseeeeaeaaeeeeeeeeeseneeeeennes 76 6 8 3 AcknowledgeLatestAlarm sii siora an iieu aaa NN aa ana aa Eaa ANE NE 76 6 8 4 ClearAlarMHistOlY ooooonnnccnnnnnonnnccccncconnccnccn rca 77 6 8 5 Clos AlarmHiStory coito da tr atril inde 77 6 8 6 ClOS AlarMS tats cias A A a a A ad 77 6 8 7 DisplayAlarmHIStOry nrun a N anne 77 6 8 8 DisplayAlarm Stas sara prat di AAAI dida TAREAS E AREER 78 6 6 9 Enable Ala MS tetona a a a a a a lolas diia hos 78 6 8 10 IsAlarmAcknowledged ccccceesecceeeeeeeeeeeeeeeeeeeeeeeesaaeeeeeeeaeeeeeeeesaeaeeeeeeneeseeeeensneaeeeeenennaees 78 Oean D SEN naV toi E E AFE E E E A EN 79 File Commands aore ean a A a AN a a A E a da od 79 6 9 1 E si a a O A A EEEE A E A A E 79 6 9 2 CopyFil nuie pna a eel da li 80 6 93 Delete llar ta aa ted 80 69450 EdiFlenucan titi rado A 80 6 9 5 A A itr tin wate oii aie ee ek al a a E reaa aa aaa aa 81 Table of Contents 6 10 6 11 6 12 6 13 6 14 6 15 6 16 6 9 6 Opel A et as a A ee a A eee 81 697 Printhile i con y TA Le A ed Me E AIDA 81 6 98 Realice 82 659 9 ReadMessage urinarias 82 56 910 Select ua ate rl Ptas 83 GHOST E OT 84 6 9 12 Write Message siii dados 84 RECIPE Commands 00d a a aaae naaa A IA AA a a 85 6410 1 Display Recipes
80. conditionB THEN statementblock3 ELSE statementblock4 NDIF E statementblock2 ENDIF or IF conditionA THEN statementblock1 ELSEIF conditionB THEN statementblock3 ENDIF or IF conditionA THEN statementblockl ELSE statementblock2 IF conditionB THEN statementblock3 ELSE statementblock4 ENDIF ENDIF Remarks 25 Control Statements SECTION 4 CX Supervisor Script Language Argument Description conditionA The condition is made up of points and constants using relational logical or arithmetical notation as a test The condition can evaluate Boolean state TRUE and FALSE Integer or Real numbers or a text string conditionB This condition is nested in the first condition either on a successful or unsuccessful evaluation of conditionA The condition is made up of points and constants using relational logical or arithmetical notation as a test The condition can evaluate Boolean state TRUE and FALSE Integer or Real numbers or a text string There is no limit to the number of nested conditional statements statementblock1 One or more statements which are performed if conditionA is met statementblock2 One or more statements which are performed if conditionA is not met statementblock3 One or more statements which are performed if conditionB is met statementblock4 One o
81. ct Write file command Scr Writes a value to an open file WriteMessage file command All 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 Object Commands Object commands control native CX Supervisor graphical objects like rectangles or lines Objects are native to CX Supervisor and therefore cannot be accessed or commands issued from external script languages like VBScript or Jscript 45 Object Commands SECTION 6 Functions and Methods 6 1 2 Other Objects 46 Argument Description The expression can be made up of the following commands which are also described in chapter 6 Object Commands e Colour command e Disable command e Visible command Move command Rotate command e Vertical fill command Horizontal fill command e Height command e Width command The content of the commands are made up of arithmetical or logical expressions x and y co ordinates or references varying between commands The colour command requires a colour identifier Typical Example colour red The current object is specified as red in colour References Refer to e Chapter 6 Blink for use of the blink command e Chapter 6 Colour for use of the colour command e Chapter 6 Disable for use of
82. d Typical Examples blink red TRUE Start blinking red LINE_1 blink OxFFFFOO status The object LINE_1 starts or stops blinking yellow depending on value of Boolean point status Syntax objectname colour expression context colour expression context or objectname colour colourID context colour colourID context An equals sign may be used as an alternative to brackets objectname colour expression colour expression or objectname colour colourID colour expression Either spelling colour or color is acceptable An equals sign may also be used for most other object commands even if it is not directly specified in this manual 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 The expression may be an Integer point or a calculation of constants and or points that produce an Integer value between 0 and 16777215 This is the desired colour s RGB value format is OXBBGGRR colourlD Some colour values within the colour palette have a meaningful colourlD This takes the form of the colour name e g black or yellow Alternatively an integer value of 0x1000000 can be added to a number 0 65 to select a palette entry Object Commands SECTION 6 Functions and Methods 6 1 5 Disable Argument Description context This argumen
83. ds textpoint 10 34 realpoint TextToValue textpoint The real value 10 34 is assigned to the real point realpoint 6 12 13 ValueToText Syntax textpoint ValueToText value Remarks Argument Type Description value integer The number that is to be placed into the textpoint A point name is also a valid parameter textpoint text A text point containing the value converted into point 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 6 13 Event Error Commands 6 13 1 ClearErrorLog Syntax ClearErrorLog Typical Example ClearErrorLog The error list is cleared and the log deleted 6 13 2 CloseErrorLog Syntax returnstate CloseErrorLog Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example CloseErrorLog The list of all currently logged errors is closed 6 13 3 DisplayErrorLog Syntax returnstate DisplayErrorLog Remarks 92 Event Error Commands SECTION 6 Functions and Methods Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example DisplayErrorLog A list of
84. dset will only return valid properties when it is Open Recordset Properties The properties of a Recordset are Property Description Return type CurrentRecord Current cursor position Integer RecordCount Number of records in the Recordset Integer Bookmark Record marker Real PageCount Number of pages in the Recordset Integer PageSize Number of records in a page Integer CurrentPage Page in which the cursor position resides Integer Source Command or SQL that created the Recordset Text Sort Field name s the Recordset is sorted on Text FieldCount Number of fields columns in the Recordset Integer BOF Current position is at the start of the Bool Recordset EOF Current position is at the end of the Recordset Bool Field Properties The properties of a Field are Property Description Return type Value Value of the field at the current position As type of field Name Name of the Field String Type The fields data type String Size Maximum width of the field Integer Description Reads a record from a Recordset to the associated point s or if associated points are array points reads a whole page of records This function operates on both Recordset and Field levels At the Field level the associated column 109 Database Commands SECTION 6 Functions and Methods Note Note 6 17 10 DBSchema 110 values fr
85. e bh E 49 O ouateasaedunag tates 50 6 4 7 Horizontal Fill siaa adaa e ea aaa ha eae eat IAS 50 A TEATA O E ETT 51 6 1 97 Rotate ON 51 6 1 107 Vertical Fimnc cts 0 lt dd 52 miT A RR TONO 53 A NN 53 Page COMMANOS fess ceva iis id ii a a ADA dete Desa can Meters AD DEAR AAA DES a E E aa 54 6 2 1 Close Page ci A eidlpeeinina el 54 General COMIMANAS szana das di it ia Ceai aaa tdi dass da 55 63 11 EXPONE Male ic ii oi ooo reload a umeads caves ndice dde ce sae ie ony 55 A O 55 A ON 56 6 3 4 E aa NN 56 679 0 RM e deta lolas 56 6 3 6 RunApplication suiii ieai ia 57 6 3 RUNTE ir la ad tt iaa 57 E o E O AE T 58 699 GetPornomancelnfo reisst aasa id A dd EEA EAN AAA E EAE RENA EA cta danita 58 E SPMD OWN saae e AR a a A AA A AOE a NEENA 59 COMMUNICATIONS COMMANAS aid ia eiat e A e eA 59 6 4 1 ClOSOCOMpON OM occccinncccnnnccccnnoncnnnnc cnn cnn 59 624 2 Enable OLE tin aaa aaa lana cada lec 60 6 43 SENADIOPEC dui ici ida aaa Ed ass EEE RA SERRE ATE 60 6 4 4 OpenComponent ccccccccccccnoncconnno conc cn ron 60 Point ComMmMandsiici AA a 61 A NN 61 625 2 COPY A ale el ele Ate a A evel aay nee 61 6 5 3 Disable Cru da id 62 65 47 DISADIGPONAE a E T 62 A O AO 63 6 5 6 ENableGrOup sijere hit cnn 63 6 5 7 EnablePolMt lt ita 64 Table of Contents 6 6 6 7 6 8 6 9 A A A wa eeerabeeaeaes yeasts 64 6 5 9 A A a eee en ee ee ee nae eee 64 6 521 07 A ON 65 E A NO 65 625 12 InttialisoAlTAy tratarla 65 6013 ANPUIP OM
86. e bool Returnstate is 1 if the function is successful or 0 otherwise Pointname bool A Boolean point that holds the required enable point 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 6 4 3 EnablePLC Syntax returnstate EnablePLC pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Pointname bool A Boolean point that holds the required enable point disable state Typical Examples EnablePLC result PLC functions are enabled based on the value of point result If result is TRUE then PLC functions are enabled If result is FALSE then they are disabled EnablePLC TRUE PLC functions can also be enabled directly without using a point to hold the desired status 6 4 4 OpenComponent Syntax Returnstate OpenComponent ComponentName PLCName Remarks 60 Point Commands SECTION 6 Functions and Methods 6 5 6 5 1 Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise ComponentName text A Text poi
87. e following paragraphs 3 1 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 3 2 Page Page scripts are concerned with manipulating points and graphical objects that are used or included within that page In other words page scripts are used to drive a number of actions on the occurrence of a particular event These actions may manipulate several graphical objects on one page 3 3 Project Scripts can be applied to a project to manipulate points These scripts are associated with events that occur throughout the whole operating session 17 Project SECTION 3 Scripts 18 SECTION 4 CX Supervisor Script Language SECTION 4 CX Supervisor Script Language This chapter describes the CX Supervisor script language syntax lt provides a detailed definition of the syntax of CX Supervisor scripts that drive project page and object actions and CX Supervisor expressions as used by objects and scripts In conjunction with the script functions and methods described in Chapter 6 the CX Supervisor script language provides a very powerful compiled fast and full featured programming language The following table describes the script language syntax at a glance Function Name Function Type Type Remarks amp 4 lt lt gt gt bitwise operators All Applies bitwise expressions
88. e ground point alt equals 140 then provided it is on the plateaux the position of the balloon in pixels defined by point distance is between 630 and 660 and the rate of descent is not too fast defined by point lift then the game is won IF lift lt 3 0 then crash TRUE burner FALSE ENDIF 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 is reset speed alt 140 0 100 0 IF speed lt 0 0 then speed 0 0 ENDIF Point speed is calculated based on the altitude distance distance speed Point distance is calculated based on the speed 123 Balloon Script SECTION 7 Script Example 124 SECTION 8 Colour Palette SECTION 8 Colour Palette This chapter describes the colour palette A colour may be specified by its name or number The following table provides a cross reference between these 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 Using a 16 colour based screen resolution consult the Microsoft Windows documentation for further inf
89. e used If an array is used the first element is returned Values Function for getting and setting an area of memory in a PLC This function allows logical names to be used If an array is used then a SAFEARRAY is returned with all values SetDefaultPLC Function for setting the default PLC This is primarily used when a project contains multiple PLCs OpenPLC Opens the specific PLC for communications ClosePLC Closes the specific PLC Read Function to read the value of a PLC point Write Function to write the value of a PLC point ReadArea Function for reading a block of memory from the PLC WriteArea Function for writing a block of memory to the PLC RunMode Function for reading writing the current mode of the PLC TypeName Function for reading the PLC type e g CQM1H IsPointValid Checks a point name is valid PLC Memory A AR C ClO D DM DR E EM G GR H IR LR SR Functions ST T TC TK W Functions for getting and setting the memory areas in the PLC ListPLCs Property Holds a list of all PLC names configured in the project file This property is read only ListPoints Property Holds a list of all point names configured in the project file This property is read only IsBadQuality Checks whether a point is currently indicating bad quality ClockRead Reads the PLC Clock ClockWrite Sets the PLC Clock RawFINS Function that enables raw FINS commands to be sent to a specified PLC 129 Value App
90. ed by the Integer point channelname DDE Commands Appendix D Obsolete Features D 3 6 DDETerminate Syntax returnstate DDETerminate channel Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise channel Integer This is an integer point which contains the point return value of the DDElnitiate command Both server and topic parameters applied to the channel in the DDElnitiate command must be open or an error is reported Typical Example DDETerminate channelname The server and topic specified by Integer point channelname is closed D 3 7 DDETerminateAll D 3 8 EnableDDE Syntax returnstate DDETerminateAll Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example DDETerminateAll All previously initiated DDE links are closed Syntax returnstate EnableDDE pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Pointname bool A Boolean point that holds the required enable point 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 the
91. ed for clarity 4 5 3 Multiple Commands Typical Examples count 75 result log count count 75 result log count Both examples provide identical functionality but the use of the colon between statements allows both to reside on the same line 4 5 4 Parenthesis Typical Examples result 20 30 40 The result is 1220 result 20 30 40 The values in parenthesis are calculated first The result is 2000 References Refer to chapter 4 Logic and Arithmetic Arithmetric Operations for further details 4 5 5 Quotation Marks Typical Examples name Valve position The Text point name is assigned associated text contained within quotation marks Quotation marks must be used in this instance 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 4 5 6 Remarks Syntax REM rem comment or comment 31 Indirection within Script Commands and Expressions SECTION 4 CX Supervisor Remarks Argument Type Description Comment Descriptive text Typical Examples REM The following statement adds two numbers result 45 754 result 45 754 add two numbers 4 6 indirection within Script Commands and Expressions It is p
92. ed on point alt exceeds 400 then the fuel burner is turned off Point alt is measured in pixels between 140 and 1000 so the value of 400 is the height in pixels IF burner THEN fuel fuel ra Gl ca Z IF fuel lt 0 0 THI fuel 0 0 burner FALSE ENDIF ENDIF If the fuel burner is on the amount of fuel remaining decreases by the rate of ascent The rate of ascent point rate can be modified by moving the slider If point fuel currently has a value of less than 0 then there is no fuel left and the fuel burner is turned off IF burner AND fuel gt 0 0 AND rate gt 0 0 THEN lift lift rate 5 0 ELSE Balloon Script SECTION 7 Script Example IF alt gt 140 0 THEN lift lift 0 2 ENDIF ENDIF If the fuel burner is on and there is still fuel left and the rate of ascent exceeds O the balloon has taken off then point lift is incremented by the rate of ascent divided by 5 to allow the balloon to climb Otherwise the balloon must be descending and point lift is decremented by 0 2 IF lift lt 10 0 THEN Leth 10 80 ENDIF Once point lift reaches 10 it is not allowed to go lower alt alt lift The altitude of the balloon is incremented by point lift IF alt lt 140 0 THE IF distance gt 630 0 AND distance lt 660 0 AND lift gt 3 0 THEN winner TRUE burner FALSE ENDIF If the balloon has hit th
93. eing controlled e Access to any of the four Boolean points motor1 motor2 motor3 motor4 can be achieved by applying indirection to textpoint using the notation and changing the contents of textpoint For instance in order to dynamically change the Boolean point a toggle button is linked to follow these steps 32 Point Arrays within Script Commands and Expressions SECTION 4 CX Supervisor 1 2 3 1 Link the toggle button to a textpoint using indirection e g textpoint 2 Link the following script code to run as required e g on clicking a button e Text ValueToText index e TextPoint motor text 3 The ValueToText function converts the integer value of the point index into a string held in the textpoint text Therefore the point text contains either 1 2 3 or 4 The expression motor text appends the contents of the point text to the literal string motor Therefore textpoint contains either motor1 motor2 motor3 or motor4 dependant on the value of index Change the value of the index to determine which Boolean point to control e g via the Edit Point Value Analogue animation 4 7 Point Arrays within Script Commands and Expressions It is possible to access the elements of a point array directly or indirectly from within scripts or expressions Setting the value of an array point directly arraypoint 2 30 e Getting the value of an array point directly v
94. emarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise filename string Pathname of file to be written offset integer An offset from the beginning of the file in characters indicating where to start writing If the offset is 1 then the message is appended to the end of the file text string The text to be written into the file linefeed bool A flag to indicate a carriage return and line feed should be appended 84 Recipe Commands SECTION 6 Functions and Methods Note Typical Example WriteMessage C CX SUPERVISOR TESTFILE TXT 0 Hello World TRUE The text Hello World is written at the start of the CACX 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 When the text is written into the file it overwrites any existing text that may exist at this location 6 10 Recipe Commands 6 10 1 DisplayRecipes Syntax returnstate DisplayRecipes Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example DisplayRecipes The current recipes is displayed References Refer to the CX Supervisor User Manual for details of recipes 6 10 2 DownloadRecipe Syntax returnstate DownloadRecipe recipename Remarks Argument Type
95. emplate GetBit point command All Retrieves a bit from a point SECTION 6 Functions and Methods Function Name Function Type Type Remarks GetPerformancelnfo general All Retrieves internal performance command and diagnostic values GetPLCMode PLC command All Retrieves the mode of a PLC GetTextLength text command All Specifies the number of characters in a text point height object command OP Specifies the height of an object horizontal fill object command OP Specifies the horizontal fill of an object InputPoint point command Scr Reads a value from a point IsAlarmAcknowledged alarm command Scr Tests if a specified alarm has been acknowledged IsAlarmActive alarm command Scr Tests if a specified alarm is currently active Left statement Scr Extracts characters from the left of a string log unary function All Calculates the natural logarithm on a number log10 unary function All Calculates the base 10 logarithm on a number LogError error command Scr Logs an error message with the error logger LogEvent error command Scr Logs an event message with the error logger Login security Scr Logs a user into a run time command application Logout security Scr Logs a user out of a run time command application Message textcommand Scr Outputs a string in a message box Mid textcommand Scr Extracts a substri
96. endix B CX Server Communications Control B 2 Value B 3 Values 130 Active Function for returning the connection status of a specified PLC TCGetStatus Function for returning the device status of a specified temperature controller TCRemoteLocal Function for switching a specified temperature controller into Remote or Local mode SetDeviceAddress Sets PLC Network Node and Unit number and IP address SetDeviceConfig Sets any element of device configuration GetDeviceConfig Gets any element of device configuration UploadProgram Uploads a program from a PLC DownloadProgram Downloads a program to a PLC Protect Protects or releases protection on program memory LastErrorString Description of last error that occurred 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 intVal CXServer Value BoilerTemp or intVal CXServer BoilerTemp In these examples the PLC address associated with BoilerTemp will be read from the PLC and stored in intVal Value is the default property and does not have to be specified Example 2 Writing a value to the PLC using a logical name CXServer Value BoilerTemp 50 or CXServer BoilerTemp 50 In these examples the value 50 will be written to the PLC address associated with BoilerTemp
97. ent Description Expression The value forming a conditional statement The expression may include the following operators with points and constants e Greater than gt e Less than lt e Greater than or equal to gt e Less than or equal to lt Not equal to Equal to Typical Example IF fuel lt 0 THEN fuel 0 ENDIF 23 Control Statements SECTION 4 CX Supervisor Script Language The point fuel is assigned the value O 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 4 3 Control Statements 4 3 1 Simple Conditional Statements Syntax IF condition THEN statementblockl ENDIF or IF condition THEN statementblockl ELSE statementblock2 ENDIF Remarks Argument Description Condition The condition is made up of points and constants using relational logical or arithmetical notation as a test The condition can evaluate Boolean state TRUE and FALSE Integer or Real numbers or a text string Statementblock1 One or more statements which are performed if the condition is met Statementblock2 One or more statements which are performed if the condition is not met Typical Examples IF fuel lt 0 THEN fuel 0 EN
98. er and takes full advantage of the graphics displays of computers A GUI employs pull down menus and dialog boxes for ease of use Like all Microsoft Windows based applications CX Supervisor has a GUI Input Output type An attribute of a point that defines the origin and destination of the data for that point The data for a point can originate be input from and is destined is output to to the internal computer memory or PLC Pictorial representations of computer resources and functions The CX Supervisor development environment and run time environment are run from icons Each recipe consists of at least one ingredient Each ingredient must be related to an existing point A type of point where the value of the point can only be a whole positive or negative number Within the CX Supervisor script language Item is a generic term for a point OPC item or Temperature Controller item A Java style scripting language supported by Microsoft s Windows Scripting Host Java Virtual Machine A spreadsheet application A windowing environment that is noted for its GUI and for features such as multiple typefaces desk accessories such as a clock calculator calendar and notepad and the capability of moving text and graphics from one application to another via a clipboard CX Supervisor will run only under Microsoft Windows DDE functions communicating with other applications supported by CX Supervisor use Microsoft Windows as
99. erver Server Application A Parameter Association enables values either constant or stored in a point to be passed to a Server Query A single displayable point on the screen from which a displayed image is constructed The screen resolution of the computer s Visual Display Unit VDU is defined by the number of pixels across and the number of pixels down e g 1024 x 768 See also SVGA mode and VGA mode Programmable Logic Controller A point within the CX Supervisor script language that stores a value or string assigned to that 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 an 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 See also Boolean type Integer type point variable Real type and Text type A CX Supervisor application will consist of one or a number of pages linked together The pages may contain passive or active graphics text or animations and may be grouped together logically to form a project A project may consist of many pages or simply a single page Projects may be built and tested within the CX Supervisor development environment and run stand alone under the CX Supervisor run time environment Only one project at a time may be open for editing within the CX Supervisor development environment
100. es all changes and ends all transactions 105 Database Commands SECTION 6 Functions and Methods Command Connection Description Level RollbackTransAll Connection Cancels all changes and ends all transactions TransCount Connection Returns the number of pending transactions Requery Recordset Re run the Recordset Query CancelUpdate Recordset Cancel a DBAddNew operation Find Recordset Find the specified criteria in a Recordset FinNext Recordset Combined DBMove Next DBFind operation Source Recordset Modify the Recordset source Filter Recordset Apply a filter to a Recordset Save Recordset Saves a Recordset in XML format 6 17 5 DBGetLastError Description Returns the last error string generated by the Database provider and displays it in a message box Syntax returnstate DBGetLastError level display Remarks Argument Type Description returnstate text The error message from the provider level text A text point or constant specifying the connection level This must be a Connection level display bool Optional flag By default DBGetLastError will display the providers error message ina message box Setting this flag to FALSE prevents this action Typical Examples DBGetLastError Northwind or DBGetLastError Northwind TRUE Both the above lines will get and display the last error to occur fo
101. f new applications through a Graphical User Interface GUI Words phrases or numbers that can be entered on the same line as acommand or statement to expand or modify the command or statement within the CX Supervisor script language The command acts on the argument In essence the command is a verb and the argument is the object of the verb An example of an argument in CX Supervisor is DDETerminate channel where DDETerminate is a command within the script language and channel is the argument upon which the command will act An old standard defining a set of characters Officially using only 7 bits allows definitions for only 127 characters and does not include any accented characters The representation of an image stored in a computer s memory Each picture element pixel is represented by bits stored in the memory In CX Supervisor a bitmap image can be installed as a single object A type of point where the value of the point can be one of two states Essentially the two states are 0 and 1 but these states can be assigned a meaningful designation Examples are State Example Example Example Example 0 OFF FALSE OUT CLOSED 1 ON TRUE IN OPEN COM is a Microsoft technology that allows components used to interact 153 Appendix E Glossary of Terms 154 Communications Driver Constant Control Object CX Server Database connection Database Connection Level Database Recordset Data
102. h certain commands For Connection this parameter should hold the new connection string For Find and FindNext this parameter should be the search criteria For Source this is the Recordset source For Filter this is the Recordset filter Typical Examples Pos DBExecute Northwind Order Details End UnitPrice gt 14 00 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 gt 6 99 Only single search values are allowed using multiple values with AND or OR will fail DBExecute Connectionl Recordset1 Source Table2 Modify the Recordsets source to open a different table than configured DBExecute Northwind Shippers Filter CompanyName United Package Apply a filter to display only records with a company name United Package DBExecute Northwind Shippers Filter Cancel an existing filter by passing an empty string DBExecute Commands Command Connection Description Level Connection Connection Modify the connection string BeginTrans Connection Begins a new Transaction CommitTrans Connection Saves any pending changes and ends the current transaction RollbackTrans Connection Cancels any changes made and ends the transaction CommitTransAll Connection Sav
103. he chosen trend graph e Display Data loads the currently selected data sample i e either the current screen data or a snapshot of the data into the trend graph e Snapshot stores the current data buffer associated with the trend graph The snapshot is given a time stamped default description Description provides the ability to change the description associated with the snapshot Import Data provides the ability to load in a previously saved trend graph file Export Data provides the ability to store a snapshot to a file either in internal CX Supervisor format or as a text file that can be imported into other applications e Delete removes the currently selected snapshot This command is provided for compatibility with SCS v2 0 applications For newer applications the data logging facilities should be used in preference This command can only be used if the trend is set to log to a file 149 Graph Commands Appendix D Obsolete Features D 4 5 SaveGraph D 4 6 Snapshot Note D 4 7 GetPointValue 150 Syntax returnstate SaveGraph graphid Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to be saved pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples SaveGraph Graph_1 TestPagel T
104. he second and third parameters are not used returnstat 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 119 ActiveX Functions SECTION 6 Functions and Methods 120 Balloon Script SECTION 7 Script Example SECTION 7 Script Example This chapter provides an example application for a script The script is a typical script exercising the basic commands lt is described twice once as a whole and once on a line by line basis 7 1 Balloon Script The following script applies to a simple game E U He Reset a en 0 The user must attempt to land the balloon on the plateau on the right using the Max Min slider control throughout the flight Clicking Reset clears the current game and initialises a new game Clicking the on off pushbutton starts the game 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 The project consists of three page scripts and one object The three page scripts are initiated at varied intervals 10 milliseconds 100 milliseconds and 1000 milliseconds The page script initiated at intervals of 10 milliseconds determines
105. he 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 Syntax returnstate Snapshot graphid pagename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to have the snapshot pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples Snapshot Graph_1 TestPagel 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 This command is provided for compatibility with SCS v2 0 applications For newer applications the data logging facilities should be used in preference Syntax returnpoint GetPointValue pointname offset Remarks Graph Commands Appendix D Obsolete Features Argument Type Description pointname point This is the name of the point whose contents are to be returned offset integer This specifies the offset into an array point 0 if the point is not an array point returnpoint point Point that contains the return value
106. hould not be used at the same time as any other PLC communications The project and PLC will automatically be opened if required This function is for advanced users only Care should be taken with this function to ensure that the program written is valid for the PLC to which it is downloaded Example bValid CXServer DownloadProgram PBEGI tes Ntest2ibin Ll 0 The first parameter is the PLC name The second parameter is the local source file name A bin file extention is typical for a binary file To download the current program the third parameter should be an empty string but may also be set to the name of a file to download to the root directory of a memory card e g Example obj The 4th and 5th parameters are reserved and should always be 1 and O respectively The Protect function can be used to protect or remove protection from PLC program memory This function should not be used at the same time as any other PLC communications The project and PLC will automatically be opened if required This function is for advanced users only Example 1 sets protection for CS series PLC Dim SetProtection Dim PasswordString Dim PasswordNumber EnableProtection true LastErrorString Appendix B CX Server Communications Control PasswordString Password PasswordNumber 0 CXServer Protect PLC1 EnableProtection PasswordString PasswordNumber Example 2 unsets protection for C series PLC Dim Se
107. iar with the Omron FINS protocol only VBScript Example Dim sFINS Dim sResponse sFINS 0501 sResponse CXServer RawFINS sFins sPLC txtFINSResponse sRespons txtFINSResponse is a CX Supervisor point 135 Active Appendix B CX Server Communications Control B 21 Active B 22 TCGetStatus Returns the connection status of a specified PLC VBScript Example bActive CXServer Active MyPLC bActive is a CX Supervisor point In this example the connected status would be read from MyPLC and stored in CX Supervisor point bActive If MyPLC is connected bActive would be set to True Return status data for the specified temperature controller Example Dim bTCStatusResponse bTCStatusResponse CXServer TCGetStatus E5AK Heating output is bTCStatusResponse 21 Cooling output is bTCStatusResponse 22 Alarm 1 output is bTCStatusResponse Alarm 2 output is bTCStatusResponse Alarm 3 output is bTCStatusResponse Stopped status is bTCStatusResponse Remote status is bTCStatusResponse 30 In this example the device status is being read from E5AK as an array of bytes The response from the temperature controller is stored as an array of bytes in bTCStatusResponse 23 24 25 28 B 23 TCRemoteLocal The TCRemoteLocal command will execute the Remote Local command for the specified temperature controller Example in this example the E5AK device is be
108. ided by 5 Syntax objectname rotate angle context fixed xcoord ycoord Remarks Argument Description objectname This is the name of the object Where a script is directly attached to an object objectname is not required angle The angle of rotation can range between 0 to 360 ina clockwise direction Points alone or as part of an arithmetic expression may be used as an angle 51 Object Commands SECTION 6 Functions and Methods 6 1 10 Vertical Fill 52 Argument Description context This argument is not required and may be omitted May be one of TOPLEFT rotate around top left of object TOPCENTRE rotate around top centre of object TOPRIGHT rotate around top right of object CENTRELEFT rotate around centre left of object CENTRE rotate around centre of object CENTRERIGHT rotate around centre right of object BOTTOMLEFT rotate around bottom left of object BOTTEMCENTRE rotate around bottom centre of object BOTTOMRIGHT rotate around bottom right of object USERDEFINED user defined point specified in xcoord and ycoord fixed This argument may be omitted If this boolean value is true the rotation origin is fixed to the screen even if the object is moved Otherwise the rotation origin is relative to object position xcoord Only required if USERDEFINED is specified These ycoord integer variables specify the rotation origin in pixels Typical Example
109. iii d 85 6 10 2 DownldadRecipe ta e ld e lo 85 6 11053 Ubl0adReciDO ita coccion A gs uate AE AAE hughac lanbedabavasteiataueniete 85 Repot GOMMANAS eo a 86 6 11 1 GemerateReport ccoccccconiccconocccnonnccnnn cnn cc nr 86 611 2 PrintRepo eave e N E Na te ti deta 86 A O A ieee cbc A RAA eve eed peel Bek di he aa AAEE cede an eeepc 87 TEXT GOMMMAN AS Heron toi ous bets deny sag t Peek ant olas TE srunantesaat a caudenuatua TE E 87 A Sate ct eh Slated et eee ed ed nits bie is aie 87 oe aaa MN es 87 6212 3 GAP saved A 88 621224 Formatlext inaa a a ete ee ede 88 6 12 5 GetTexthengthiv cienteiee ead Ga a ad ee se de laa 89 621226 OK strait cteter ceed as tneet EEE A ehedeatecaeeextaube A A 89 GEV 2E7 A O a rag E teen vay ng OO 90 6 12 87 E A O ean E aS geese lah high iaas Secale 90 A o A P AAN 90 6 12 10 PrintMGSSage ensei aa ir ers ee ele eh aa a EEA 91 6 12 RIGMK ea aces 91 612 112 Texto Valle ore eE EA ENT EE T EEA I AAE EEEE EE 91 6212 13 Value TOTOR arrie i n a tias 92 Event Eror GOmMans r a a aa aa EA ERS 92 6 13 41 ClearError Logiran a 92 6 13 2 Glose Err rLog cit id iba E aa Na anaa 92 6 13 3 DisplayErrorLog coi A i eaves A ia a aad ade 92 6 13 4 EnableErrorLoggIO oir tad de 93 la A e oo 93 SM seisan Teke anan AEE ETE A ATRA EA EA A E EA EE E AREE EES 93 Printer GOMMANGSs mai a a A ia 94 614 1 ClearSpoolQueue enaa A A ad 94 6 14 2 Enable Printing EEEN ee cave edie EEEE A di 94 621423 PrintActiveP age iana e EE can
110. imum of 256 characters can be read from the file Syntax filename SelectFil filter path Remarks Argument Type Description Filename Text string returned Contains fully qualified filename including drive and path if OK was selected from OpenFile comms dialog otherwise contains empty string Filter string Optional argument If omitted will show all files This argument must be supplied if path is specified i e set to Specifies the filter string used by the Files of type list The string should contain 1 or more filters separated with a pipe character and end with 2 characters i e Each filter should have some user text and 1 or more file specs separated with a semicolon No spaces should be used except within the user text Path string Optional argument Specifies the path to show initially If omitted the dialog shows the current working directory Typical Example TFile SelectFile The File Open dialog will be displayed showing all files in the current working directory The users choice will be stored in tFile TFile SelectFile Text Files txt txt The File Oper dialog will be displayed showing just files with a txt extension in the current working directory TFile SelectFile Text Files ATRAE OSV FV exes Es vil The File Open dialog will be displayed showing files with either a txt or csv extension in the current
111. ing set to local mode Set the device to local mode CXServer TCRemoteLocal E5AK 1 Example in this example the E5AK device is being set to remote mode Set the device to remote mod CXServer TCRemoteLocal E5AK 0 B 24 SetDeviceAddress 136 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 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 Care should be taken to ensure that all data passed is valid This method should not be used while a PLC is open and communicating Example NetworkNum 1 NodeNum 2 UnitNum 1 iPAddress 10 0 0 1 bValid CXServer SetDeviceAddress PLCI NetworkNum NodeNum UnitNum IPAddress SetDeviceConfig Appendix B CX Server Communications Control Note The return Boolean value bValid is set to True if no errors were detected However this does not necessarily mean that all the parameters used were valid or appropriate for the PLC being used B 25 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
112. installed See Appendix C for a list of supported functions Syntax returnstate ExecuteJScriptFile scriptfile Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 scriptfile Text The name of the file with the Java Script to execute Typical Examples returnstate ExecuteJScriptFile c jscript txt This will execute the Java Script stored in c jscript txt 6 19 8 GenerateEvent Description This command is only used in conjunction with a remote connection using a CX Supervisor Communications control see User Manual Chapter 15 Connecting to remote applications This command allows the Server machine to post unsolicited data back to the client machine This data is captured in the client s OnEvent handler The data for the parameters is entirely at the designer s discretion depending on what the client needs to be informed of Syntax returnstate GenerateEvent paraml param2 param3 Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 param1 Text Optional Parameter of data to send param2 Text Optional Parameter of data to send param3 Text Optional Parameter of data to send Typical Examples returnstate GenerateEvent Archive An Archive event is sent to the client application that may force the client to perform some specified archive operation T
113. ion is for advanced users only Example Dim Setting Device PLC1 Section NET Entry IPADDR Setting CXServer GetDeviceConfig Device Section Entry Currently supported parameter values are as described for the SetDeviceConfig method 137 UploadProgram Appendix B CX Server Communications Control B 27 UploadProgram The UploadProgram function can be used to read a program from a PLC The program is read in binary form and stored in a user specified file This function should not be used at the same time as any other PLC communications The project and PLC will automatically be opened if required This function is for advanced users only Example Dim SourceFile Dim DestinationFile Sourcefile DestinationFile c testl bin CXServer UploadProgram PECES SourceFile DestinationFile 1 0 The first parameter is the PLC name 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 The third parameter is the name of the local file to store the program A bin file extention is typical for a binary file Note The 4th and 5th parameters are reserved and should always be 1 and O respectively B 28 DownloadProgram B 29 Protect 138 Note Note The DownloadProgram function can be used to write a program to a PLC This function s
114. ions and Methods Note 6 9 5 MoveFile 6 9 6 OpenFile Note 6 9 7 PrintFile Argument Type Description filename string This text string contains the file name returnpoint point 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 FileName is a text point which can be set to any string value Syntax returnstate MoveFile sourcename destname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise sourcename string Pathname of file to be moved destname string Pathname of destination of move Typical Example MoveFile c lautoexec bat c autoexec old The file c autoexec bat is moved to the file c autoexec old Syntax returnstate OpenFile filename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Filename string Pathname of file to be opened Typical Example OpenFile c filename 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 A file is created if it doesn t already exist Files can be shared for instance located on a network drive and accessed by
115. iption pointname bool The Boolean point name to be assigned a point value based on the test of an active alarm alarmname string 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 References Refer to the CX Supervisor User Manual for details of alarms File Commands CloseFile Note Syntax returnstate CloseFile pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname bool A Boolean point that holds the required status of whether blank spaces should be stripped from the file when it is closed 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 If blank spaces are stripped from the file then it greatly reduces in size but it takes slightly longer to close Blank spaces should not be stripped from the file if it is being used on a network drive by more than one system at a time In this example the currently open file is closed and any blank spaces are not stripped from the file 79 File Commands SECTION 6 Functions and Methods
116. ird record in the Recordset 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 107 Database Commands SECTION 6 Functions and Methods Note Note 6 17 7 DBOpen 6 17 8 DBProperty 108 Some Providers do not support moving in the Previous direction e cursors are Forward Only Some Forward Only providers do allow moving First while some are strictly Forward Only e the Recordset has to be Re queried effectively a combined Close then Open operation to reset the cursor back to the start of the Recordset Some Providers that do support moving Previous do not support moving to Position However in order to be consistent CX Supervisor ensures that that all operations except Bookmarks will work for any connection to any provider but you need to bear in mind when designing applications that use Forward Only cursors that there may be some long winded acrobatics being performed behind the scenes See DBSupports for details of how to check the type of cursor in force Bookmarks will only work if specifically supported by the Provider 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
117. is example applies is disabled PUSH_8 disable count AND flag The selectable object PUSH_8 is disabled provided Integer point count AND Boolean point flag return TRUE 49 Object Commands SECTION 6 Functions and Methods 6 1 6 Height 6 1 7 Horizontal Fill 50 Syntax objectname height expression context objectname height expression 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 a value point or an arithmetic expression returning a new height value in pixels context This argument is optional and may be omitted It defines which part of the object is the datum and remains static May be one of TOP uses object top as datum CENTRE uses object centre as datum BOTTOM uses object bottom as datum If omitted CENTRE is assumed Typical Examples height 100 or height 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 Syntax objectname horizontal fi11 expression context 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 arith
118. is successful otherwise 0 Typical Example ClearAlarmHistory The alarm history window is cleared and the log is cleared References Refer to the CX Supervisor User Manual for details of alarms 6 8 5 CloseAlarmHistory Syntax returnstate CloseAlarmHistory Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 Typical Example CloseAlarmHistory The alarm history window is closed References Refer to the CX Supervisor User Manual for details of alarms 6 8 6 CloseAlarmStatus Syntax returnstate CloseAlarmStatus Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 Typical Example CloseAlarmStatus The current alarm status window is closed References Refer to the CX Supervisor User Manual for details of alarms 6 8 7 DisplayAlarmHistory Syntax returnstate DisplayAlarmHistory Remarks 77 Alarm Commands SECTION 6 Functions and Methods Argument Type Description returnstate bool 1 if the function is successful otherwise 0 Typical Example DisplayAlarmHistory The alarm history window is displayed References Refer to the CX Supervisor User Manual for details of alarms 6 8 8 DisplayAlarmStatus 6 8 9 EnableAlarms Syntax returnstate DisplayAlarmStatus Remarks Argument Type Description returnstate bool 1 if
119. is the previous file etc outputtile string File name for output file May include full path which will be created automatically if it does not exist 98 Data Logging Commands SECTION 6 Functions and Methods 6 16 5 ExportLog 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 Typical Examples ExportAndViewLog Balloon or ExportAndViewLog Balloon Altitude Fuel Burning Lift Group 1 CSV BDIM 0 output or ItemList 0 Altitude ItemList 1 Fuel ItemList 2 Burning 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 as per ExportLog It then launches an appropriate viewer to display the file using the Windows file associations Syntax ExportLog datasetname item list format file outputfile or ExportLog datasetname TextArray format file output file Remarks Argument Type Description datasetname text Name of Data Set to close as text point or constant item list string List of Items and or Groups within the data set to export separated by commas
120. l Examples 151 Graph Commands 152 Appendix D Obsolete Features SetPrinterConfig SCSPRN LPT1 This uses standard CX Supervisor line print driver SetPrinterConfig This uses default Windows printer driver SetPrinterConfig Epson9 LPT2 This uses Epson printer driver attached to LPT2 SetPrinterConfig DriverNamePoint DeviceNamePoint PrintNamePoint This uses text points Terminator FormatText c c 13 10 Character 10 is If newline character 13 is cr carriage return SetPrinterConfig Epson9 LPT1 Terminator Appendix E Glossary of Terms ADO AND Application Arguments ASCII Bitmap Boolean type COM Appendix E Glossary of Terms ADO stands for Active Data Objects and is data access technology which uses OLE DB to access data sources in a uniform way e g MS Access databases MS Excel spreadsheets and Comma Separated Variable files 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 bisa statement AND returns TRUE if both a and b are TRUE If one or both statements return FALSE then AND returns FALSE A software program that accomplishes a specific task Examples of applications are CX Supervisor CX Server and Microsoft Excel CX Supervisor and its development environment allows the creation and testing o
121. l revert to the default specified by the application designer 6 3 9 GetPerformancelnfo 58 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 if the function is successful or 0 otherwise PLC string If specified is the name of the PLC to get the property of If the property is not a PLC property then specify empty string Point string If specified is the name of the Point to get the property of If the property is not a Point property then specify empty string Communications Commands SECTION 6 Functions and Methods Argument Type Description Property Name string Name of Property to read Must be identical to the displayed property name If both PLC and Point are empty strings then the Summary property is returned Typical Example GetPerformancelnfo Performance Index In this example the Summary Performance Index will be read GetPerformancelnfo Processing Time ms In this example the CPU Time processing time will be read GetPerformanceInfo MyPLC Actual CPS In this example the actual characters per second for MyPLC will be returned GetPerformancelnfo MyPoint Read Callbacks In this example the
122. les POLYGON_1 colour red POLYGON_1 colour red The specified object POLYGON_1 is set to be red in colour References Refer to CX Supervisor User Manual for details of object names Chapter 6 Blink for use of the blink command Chapter 6 Colour for use of the colour command Chapter 6 Disable for use of the disable command Chapter 6 Height for use of the height command Chapter 6 Horizontal Fill for use of the horizontal fill command Chapter 6 Move for use of the move command Chapter 6 Rotate for use of the rotate command Chapter 6 Vertical Fill for use of the vertical fill command Chapter 6 Visible for use of the visible command Chapter 6 Width for use of the width command Syntax objectname blink colour status Remarks Argument Description objectname This is the name of the object Where a script is directly attached to an object objectname is not required 47 Object Commands SECTION 6 Functions and Methods 6 1 4 Colour 48 Note Argument Description 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 Alternatively an integer value of 0x1000000 can be added to a number 0 65 to select a palette entry status This argument may be omitted May be on of TRUE turn blinking On FALSE turn blinking Off If omitted TRUE is assume
123. loadPLCProgram controlPLC Prog01l bin done The program in the PLC controlPLC is uploaded to the file Prog01 bin in the current directory Before continuing the script waits up to five seconds for the action to succeed Note The operation may not be complete 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 upload to be completed create an On 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 6 7 Temperature Controller Commands 6 7 1 TCAutoTune Syntax returnstate TCAutoTune TController mode Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 temperature controller mode point This is a point depicting the mode of operation and defines the operation to be carried out when a TCAutoTune command is issued 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 Typical Example 71 Temperature Controller Commands
124. lock3 END SELECT or SELECT CASE expression CASE expression statementblockl CASE expression statementblock2 CASE ELSE statementblock3 END SELECT Remarks Argument Description expression The expression may be a point or a calculation of constants and or points that produces a result statementblock1 One or more statements that are only performed if the preceding CASE expression is met statementblock2 One or more statements that are only performed if the preceding CASE expression is met statementblock3 One or more statements that are only performed if the preceding CASE expression is met Typical Examples SELECT CASE colourvalue CASE 1 colour blue CASE 2 colour green CASE 3 colour cyan CASE ELSE colour 0 END SELECT This example shows the assignment of a colour according to the value of a point The value of Integer point colourvalue is evaluated and compared with each case until a match is found When a match is found the sequence of actions associated with the CASE statement is performed When colourvalue is 1 the colour given to the current object is blue when colourvalue is 2 the colour given to the current object is green when colourvalue is 3 the colour given to the current object is cyan If colourvalue falls outside the integer range 1 3 then the colour given is O black Like ELS
125. metic expression that must return a value between 0 and 100 On return of a valid result the fill commences from left to right context This argument is optional and may be omitted It defines which side of the object is filled from May be one of LEFT fill from the left RIGHT fill from the right If omitted LEFT is assumed Typical Examples horizontal fi11 50 The current object to which this example applies is filled by 50 ELLIPSE 1 horizontal Sfill GAS_LEVEL RIGHT Object Commands SECTION 6 Functions and Methods 6 1 8 Move 6 1 9 Rotate The object ELLIPSE_1 is filled from the right provided the point GAS_LEVEL returns a valid result between 0 and 100 Syntax objectname move x co ordinate y co ordinate Remarks Argument Description objectname This is the name of the object 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 y co ordinate resultant position in 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 Typical Examples move 100 200 The current object to which this example applies is moved to the specified position POLYGON_1 move xpos ypos 5 The object POLYGON_1 is moved to the position specified by points xpos and ypos div
126. mmand Scr Calculates a random number Read file command Scr Reads data from an open file into a point ReadMessage file command All Reads text from an external file Right textcommand Scr Extracts characters from the right of a string rotate object command OP Rotates an object RunApplication gen command Scr Runs the specified application RunHelp gen command Scr Runs the specified help file SelectFile file command All Specifies a file name and path SetBit point command All Sets a specific bit from a point SetPLCMode PLC command All Sets the mode of a PLC SetPLCPhoneNumber PLC command All Sets a phone number to a PLC SetupUsers security Scr Defines users and passwords for command Login ShutDown gen command Scr Terminates CX Supervisor sin unary function All Applies unary expression sqrt unary function All Applies unary expression StartAuditTrail Data Logging Scr Starts Audit Trail logging command StopAuditTrail Data Logging Scr Stops Audit Trail logging command StartLogging Data Logging Scr Starts a data set logging command StopLogging Data Logging Scr Stops a data set logging command tan unary function All Applies unary expression TCAutoTune temp controller All Starts or stops a temperature command controller auto tune operation Object Commands SECTION 6 Functions and Methods 6 1 Note 6 1 1 Current Object Syntax objectcommand Remarks
127. n DDE is disabled EnableDDE TRUE DDE functions can also be enabled directly without using a point to hold the desired status 147 Graph Commands Appendix D Obsolete Features D 4 Graph Commands D 4 1 ClearGraph D 4 2 StartGraph Note D 4 3 StopGraph 148 Syntax returnstate ClearGraph graphid pagename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to be cleared pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples ClearGraph Graph_1 TestPagel 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 Syntax returnstate StartGraph graphid pagename Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise graphid string The identifier of the trend or scatter graph to be started pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples StartGraph Graph_1 TestPagel The trend or scatter graph on TestPage1 with the identifier Graph
128. nStop TController mode Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller mode point This is a point depicting the mode of operation and defines either auto output mode shift or manual output mode shift 0 This specifies manual output mode shift 1 This specifies auto output mode shift Typical Example templ TCRunStop e5ak temp2 This command was previously called TCModeShift Syntax returnstate TCSaveData TController Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller Typical Example templ TCSaveData e5ak temp2 6 7 9 TCSettingLevel1 6 7 10 TCReset Syntax returnstate TCSettingLevell TController Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller Typical Example templ TCSettingLevell e5ak Syntax returnstate TCReset TController Remarks 75 Alarm Commands SECTION 6 Functions and Methods Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string represen
129. ndpt STEP steppt statementblockl NEXT Remarks Argument Description pointname 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 steppt Amount to increase pointname by every pass of the loop Steppt can be negative to count backwards providing startpt is larger than endpt The STEP keyword and variable may be omitted in which case pointname is incremented at each pass of the loop identical to adding STEP 1 Typical Examples FOR loopcount 0 TO 100 Ellipse_l vertical fill loopcount NEXT In this example Ellipse_1 is gradually filled 100 times FOR loopcount 100 TO 0 STEP 5 Ellipse_l vertical fill loopcount NEXT Subroutines SECTION 4 CX Supervisor Script Language In this example the fill for Ellipse_1 is gradually removed 20 times 100 times 5 Note Loop statements should be used with caution as they consume processor time while they are running and some other parts of the system may not be updated 4 3 5 DO WHILE UNTIL Loop Syntax DO WHILE expression statementblock LOOP or DO statementblock LOOP WHILE expression or DO UNTIL expression statementblock LOOP or DO statementblock LOOP UNTIL expression Remarks Argument Description expression The expression may be a point
130. ng The text with appropriate formatting characters that the result expression is inserted into expression Integer The value s or expression s that is inserted real into formattext Typical Examples TextPoint FormatText Boiler temperatur is ld degrees BoilerTemp 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 TextPoint FormatText Boiler tld temperature is ld degrees BoilerNo BoilerTemp The value of BoilerNo point is inserted at the first ld marker and the value of the BoilerTemp point is inserted at the second ld marker and the resulting string is stored in the point TextPoint If the value of BoilerNo was 7 and the value of BoilerTemp was 43 then the resultant text stored in the TextPoint is as follows Boiler 7 temperature is 43 degrees Text Commands SECTION 6 Functions and Methods Note The formatting characters are standard C formatting characters as used by the C language sprintf function Some commonly used types are e ld Insert integer value e f Insert decimal value Prefix with decimal point and number to control position for instance 2f for 2 decimal places e s Insert string lX
131. ng a circle or a polyline A control is essentially a complex graphic object and is specifically either a pushbutton a toggle button a slider a trend graph a rotational gauge or a linear gauge OLE DB is the underlying database technology on which ADO relies OLE BD is designed to be the successor to ODBC The term used for constants or point variables A symbol used as a function with infix syntax if it has two arguments e g or prefix syntax if it has only one argument e g NOT The CX Supervisor script language uses operators for built in functions such as arithmetic and logic A logic operator used to interrogate Boolean type points OR returns 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 The combination and manipulation of pages containing objects within projects forms the basis of CX Supervisor More than one page can exist for each project The pages in a project provide the visual aspect of CX Supervisor corresponding to a display with the objects contained in each page providing a graphical representation of the system being monitored 157 Appendix E Glossary of Terms 158 Parameter Association Pixel PLC Point variable Point Project Real type Recipe Run Time Environment SCADA S
132. ng from a string move object command OP Moves an object MoveFile file command Scr Moves the specified file OpenComponent comms All Opens a component for a PLC command e g CX Server components OpenFile file command Scr Opens the specified file OpenLogFile Data Logging Scr Opens a data log file command OpenLogView Data Logging Scr Opens the Data Log Viewer command OpenPLC PLC command Scr Opens communications with a PLC OutputPoint point command Scr Displays the current value of a point PlayOLE gen command Scr_ Plays an OLE object PlaySound gen command Scr Plays a sound file 43 44 SECTION 6 Functions and Methods Function Name Function Type Type Remarks PLCCommsFailed PLC command All Specifies if the PLC communications have failed PLCMonitor PLC command Scr Monitors a PLC PointExists point command All Specifies the existence of a point PrintActivePage gen command Scr Prints the currently active page PrintFile file command Scr Prints the specified file PrintMessage text command _ All Prints messages to the configured Alarm message printer PrintPage gen command Scr Prints the specified page PrintReport report command All Prints a report PrintScreen gen command Scr Prints the current display screen PrintSpoolQueue printer All Prints all queued alarms or command messages Rand gen co
133. nt or text constant containing the name of the component to open PLCName text Text point or text constant containing the name of the PLC that the component to open is attached to Typical Examples OpenComponent PLC Data Monitor MyPLC In this example the PLC Data Monitor component monitoring the PLC MyPLC is opened Component Performance Monitor PLC PLCO6 OK OpenComponent Component PLC In this example the Performance Monitor component monitoring the PLC PLCO6 is opened OK is used to determine if the action was successful Point Commands CancelForce 6 5 2 CopyArray Syntax returnstate CancelForce pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point Name of point If the point is an array point then all elements within the array have the CancelForce command applied Typical Example CancelForce pointl 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 Syntax CopyArray SourceArray DestArray Remarks Argument Type Description SourceArray Name of point array to copy from DestArray Name of point array to copy to Typical Example 61 Point Commands SECTION 6 Functions and Methods InitArray DestArray 0 Fir
134. odd E bodednaseadeetaess needa esate de aaded gia ede agin 94 6214 4 PrintPagecs icici eee a elt eh ee ea ei eh tiles 95 65145 PRM SCheCM ETE tases A T Maeagh heh tase 95 6 14 6 PrintSpo0l Queue ii A dad dae Ab dada att 96 Security COMMANGS sce cccrass ces savidace a evi ada 96 GADEA 96 6 19 2 LOJOUteiaciattatd laeatadedtarelataeraes shcaldldg 96 SN ORO a eae ned 97 Data Logging Commands ite c lesen aie ei An dia 97 06 16 11 ClearlogFil ii A A AA eel eee ee aed 97 6 1 6 2 ClOSCLOQFING oniiir inaia Ba Aste ed ea ee en Ae 97 6 16 3 CIOSCLOQVIOW 0 eeecececteceeeeceeeeaeeeeeneeecaaecesaneeeaaaesesaaaeesaaeeseeaaeesaaaeeseaaaeeegaeeeseaaeesseeeessaeeesenaees 98 6216 4 ExportAndViewLoJ ete aan 98 6 16 5 Export inicias 99 6 16 6 OpenLOQFile ss cional AA Ra ada LEA deeds dex dieenevoads 100 6 16 7 Openkog Vi Wiiniiiniini id da 100 6 16 8 StartAuaitl rail ici at di A aitdenee 101 0 16 9 gt StopAlLd Trivia A A i a As 102 6 1621 0 StartlogginG titi dio da 102 AGS to 6 Kole a A e E T 102 6 17 Database Commands sei ido Da 103 6171 DBAJANE Win atarien On ecg nd ddd 103 6 17 2 DBGlOS iis neva nied ana bs 103 61723 DBDelete tac a di 104 6217 4 A A A deeed att dee cacc eonadtetgieti faust A AA A AA A N 104 6 17 5 DBGetLastError ita ds Sneath tee Oy eed dies 106 Gt 76 DBMOVGs att ed e Saale 106 6 17 27 DBOPeN ieat A Ne Ta eae a ee 108 621 728 DBP TOPE Vocacional diaria 108 6 17 9 DBRead iiini dns 109 6
135. of TRUE causes the print dialog to be shown allowing the user to configure or choose the printer 95 Security Commands SECTION 6 Functions and Methods 6 14 6 PrintSpoolQueue Syntax returnstate PrintspoolQueue Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example PrintSpoolQueue Any message typically printed alarms that are queued up waiting to be sent to the CX Supervisor Alarm Message printer is printed immediately 6 15 Security Commands 6 15 1 Login 6 15 2 Logout 96 Syntax returnstate 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 If used username must be specified even if only empty i e If omitted the login dialog will be shown Typical Examples Login The Login dialog is displayed for user entry Login Designer Designer The default Designer user is logged in automatically using matching password References Refer to the CX Supervisor User Manual for details of Login Syntax returnstate Logout Remarks Argument Type Description returnstate bool Returns
136. of identifying the individual members of array points It can also be used to associate names with numbers for example SecondsPerDay 86400 Alias definitions are stored in a simple text file in the project directory called lt project name gt pre The format of the file consists of any number of lines such as Testl 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 Any line which does not start with the symbol is also assumed to be a comment Typical Examples Declare boiler temperatures BoilerTemp1l InArray 0 for boiler room 1 BoilerTemp2 InArray 1 for boiler room 2 34 Using Aliases SECTION 4 CX Supervisor Script Language Note SecondsPerMinute 60 sets duration Aliases may also be used to create a complicated expression such as HYPOTENUSESqrt Opposite Opposite Adjacent Adjacent Calculates length of Hypotenuse This can be used in a script in the following way Opposite 8 45 Adjacent 9 756 length HYPOTENUSE where Opposite Adjacent and length are all REAL points 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 rec
137. oilerTemp In this example the OPC item Boilerlemp 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 Writes the value of an OPC item Example of synchronous write OMRONCXOPCCommunicationsControll Write MyGroup BoilerTemp NewValue In this example NewValue will be written to the OPC item BoilerTemp in the OPC group called MyGroup The script will wait for the write operation to complete before continuing to execute the next line This is identical to the operation of the Value method Functions Appendix B CX Server Communications Control B 1 Functions Appendix B CX Server Communications Control When the Project Settings gt Advanced settings option Allow advanced script access to PLC via CXServer control option is selected a CX Server Communications Control is automaticalled created to allow script access to CX Server functions This ActiveX control is always named CXServer without any hyphen and can always be used from any script This appendix contains a list of the available component properties and methods on the script interface Value Function for getting and setting an area of memory in a PLC This function allows logical names to b
138. om 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 Syntax returnstate DBRead level reset Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise O level text A text point or constant specifying the connection level This must be a Recordset level reset bool This argument is optional and may be omitted If omitted or TRUE when the read is complete the record cursor is reset to the position prior to reading Typical Examples DBRead Northwind Customers Read the next page of records from the Customers Recordset DBRead Northwind Customers FALSE 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 Use with reset TRUE is useful if the read operation is being combined with a subsequent Write operation i e you can read in a set of records resetting the cursor make modifications to some of the fields and then Write the changes back to the Recordset Use with reset FALSE will leave the current position at the start of the next set of records This option can be of benefit if the Provider only supports forward moving
139. ompiled by pressing the OK button in order to apply the changes 35 Using Aliases 36 SECTION 4 CX Supervisor Script Language List of Features SECTION 5 VBScript Language Reference 5 1 SECTION 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 List of Features Category Keyword Feature Array handling Array Dim Private Public ReDim IsArray Erase LBound UBound Assignments Set Comments Comments using or Rem Constants Literals Empty Nothing Null True False Control flow Do Loop For Next For Each Next If Then Else Select Case While Wend With Conversions Abs Asc AscB AscW Chr ChrB Chrw CBool CByte CCur Cdate CDbl Cint CLng CSng CSir DataSerial DateValue Hex Oct Fix Int Sgn TimeSerial TimeValue Date Times Date Time DateAdd DateDiff DatePart DateSerial DateValue Day Month MonthName Weekday weekdayName Year Hour Minute Second Now TimeSerial TimeValue 37 List of Features SECTION 5 VBScript Language Reference 38
140. on Sends an ASCII text message out through the designated serial communications port Syntax ReturnState OutputCOMPort PortNumber Message Remarks Argument Type Description ReturnState bool True if successful else false PortNumber Integer The number of the port previously configured using the function SetupCOMPort and opened with OpenCOMPort message Text Text point to hold ASCII text message to send through the port Typical Example bState OutputCOMPort 1 Msg 114 Serial Port Functions SECTION 6 Functions and Methods 6 18 3 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 Remarks Argument Type Description ReturnState bool True if successful else false PortNumber Integer The number of the port previously configured using the function SetupCOMPort and opened with OpenCOMPort Typical Example bState CloseCOMPort 1 6 18 4 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 Type Description ReturnState bool True if successful else false PortNumber Integer The number of the port previously
141. on 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 Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 level text A text point or constant specifying the connection level This should be a field or recordset level quantity int Number of records to delete Typical Examples Result DBDelete Northwind Order Details 10 Delete the next 10 records in the recordset DBMove First Result DBDelete Northwind Order Details 10 Delete the first 10 records Description The DBExecute function allows the execution of miscellaneous commands and allows for future expansion by supporting new commands without the need to create more new DB functions Syntax Database Commands SECTION 6 Functions and Methods return DBExecute level command parameter Remarks Argument Type Description return 1 if the function is successful otherwise O except for Find and FindNext commands which return the record number if found or if not set the current record to EOF and return 1 level text A text point or constant specifying the connection level which depends on the command specified command text Command to execute May be one of the commands listed below parameter text Command parameter only required wit
142. operation When using a Field level connection the operation may be cancelled at any stage before the DBUpdate function is called by calling the DBExecute command CancelUpdate Only Fields with a property type of Add can be added to a Recordset The value s of the associated points at the time DBUpdate is called will be used to create the record Depending on the ADO provider the added record may not be visible until the Recordset is requeried See DBExecute parameter Requery for more information Description 103 Database Commands SECTION 6 Functions and Methods 6 17 3 DBDelete 6 17 4 DBExecute 104 Closes a Connection or Recordset Closing a Connection will automatically close all recordsets associated with it Recordsets can be closed in isolation by selecting the appropriate level Syntax returnstate DBClose level Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 level text A text point or constant specifying the connection level This should be a field or recordset level Typical Examples Result DBClose Northwind Order Details Closes the Order Details Recordset Result DBClose Northwind Closes the connection to the Northwind database and also any Recordsets which may be open Description Deletes the specified number of records from the current record position This functi
143. ormation colours 16 to 65 are dithered from the sixteen base colours Higher colour based resolutions are not dithered No Colour No Colour 0 black 12 purple 1 blue 13 olive 2 green 14 dark_grey 3 cyan 15 light grey 4 red 16 pale green 5 magenta 17 light blue 6 yellow 18 off white 7 white 19 grey 8 dark_blue 20 cherry 9 dark_green 21 silver 10 blue green 22 apple 11 brown 23 orange 24 65 Not used 125 SECTION 8 Colour Palette 126 Component Properties Appendix A OPC Communications Control Appendix A 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 The Script Interface defines the Visual Basic script interface for the OPC communications control See ExecuteVBScript script functions for more information on running Visual Basic Script A 1 Component Properties Property Title Example Description DisplayErrors True When set True the object will display a False message box for any errors If set to False error messages are not displayed ProjectName Name of OPC file containing the client setup ServerComputerName MyPC This is the name of the PC with the OPC Server ServerName Name of
144. ory leaks both in the native Operating Systems and tools like Microsoft Excel This technology has now been replaced and the CX Supervisor Communications Control should be used instead The following DDE script commands are obsolete D 3 1 DDEExecute Syntax returnstate DDEExecute channel command Remarks Argument Type Description returnstate Bool Returnstate is 1 if the function is successful or 0 otherwise channel Integer This is an integer point which contains the point return value of the DDEInitiate command Both server and topic parameters applied to the channel based on the DDE Initiate command must be open or an error is reported command String This is a command as recognised by the server application specified within the channel Typical Example channelname DDEInitiate Excel Sheet1 xls DDEExecute cha OPEN C nnelname EXCEL WORK SHEET2 XLS The file SHEET2 XLS within path C EXCEL WORK is opened in Microsoft Excel as specified by the Integer point channelname The file SHEET1 XLS is already open in Microsoft Excel D 3 2 DDElnitiate Syntax channel DDEInitiate server topic Remarks Argument Type Description channel Integer This is an integer point which contains the point return value of the DDEInitiate command server String This contains the application that supports
145. ossible 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 e Using a string literal PlayOLE ole_1 0 Using a textpoint directly textpoint ole_1 PlayOLE textpoint 0 e Using a textpoint indirectly via the notation text ole_1 textpoint text PlayOLE textpoint 0 It is possible to use text points indirectly in place of point name arguments within script commands For instance each of the following commands has the same effect Using a point name directly verbnumber 0 PlayOLE ole_1 verbnumber e Using a textpoint indirectly via the notation verbnumber 0 textpoint verbnumber PlayOLE ole_1 textpoint An example using Indirection The value of point indirection 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 points e The four Boolean points to be controlled are called motor1 motor2 motor3 and motor4 e The text point textpoint is used to store the name of the Boolean point to be controlled The text point text is used to store the string value of the integer point index The integer point index which has a range 1 4 is used to dynamically change the point b
146. perty 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 PutProperty Gaugel Value 25 2 This will write the value 25 2 to the object Gauge1 Description Execute a method of an OLE object Syntax Execute object method Remarks Argument Type Description object Text The name of the OLE object method Text The name of the method to execute n a Any number of parameters for the method Typical Examples Execute OLE1 Start This will call the method Start on the object OLE1 Execute CXComms1 OpenPLC MyPLC This will call the method OpenPLC with one text parameter MyPLC on the OLE object CXComms1 117 ActiveX Functions SECTION 6 Functions and Methods 6 19 4 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 ENDSCRIPT This Visual Basic Script will write the value from the point PointName into the property Left
147. plays either the User defined aliases or the preset System aliases and is toggled between these two displays by pressing the User System Alias button 33 Using Aliases SECTION 4 CX Supervisor Script Language The following illustration shows the Alias Definitions dialog displaying a number of User defined aliases The System aliases are pre defined and can not be edited or added to Alias Definitions x BOTTOMCENTRE Bottom Centre OK Left Top Cancel USERDEFINED User Defined BOTTOM Bottom BOTTOMLEFT Bottom Left CENTRE Centre UP Up CENTRERIGHT Centre Right RIGHT Right TOPLEFT Top Left CENTRELEFT Centre Left DOWN Down BOTTOMRIGHT Bottom Right FRAME Indicates Frame Colour should be set TOPRIGHT Top Right TOPCENTRE Top Centre FILL Indicates Fill Colour should be set E Syntax AliasNameAlias definition optional comment Remarks Argument Type Description AliasName string The string name of the alias Alias definition string This is a string representing the actual text or expression of the expanded alias comment string This is an optional comment The symbol at the beginning of each line initiates each alias command For example the text string SomePoint could be used to represent any sequence of characters in a script or expression e g it could be defined as SomePoint InArray 1 or even SomePoint Inarray 1 Inarray 2 2 This is an easy way
148. point IsFailing is set to true if the PLC called controlPLC is currently not communicating Otherwise it is set to false Note This function returns to TRUE from the time when a communications timeout error with the named PLC occurs until successful communication with the PLC takes place Syntax returnstate PLCMonitor plcname Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 69 PLC Commands SECTION 6 Functions and Methods Argument Type Description plcname string Name of PLC to be monitored Typical Example PLCMonitor controlPLC The monitor dialog for the PLC called controlPLC is invoked This dialog can be used to check PLC status change mode etc 6 6 7 SetPLCMode Syntax returnstate SetPLCMode plcname mode processed Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 plcname string Name of PLC mode string A value for the new PLC mode Valid modes are STOP DEBUG RUN and MONITOR processed bool processed is set to TRUE when the operation is actually completed Typical Examples SetPLCMode controlPLC STOP done In this example the mode of the PLC called controlPLC is changed to STOP Note The mode may not be changed immediately after the statement has been executed The processed flag done is set a
149. r more statements which are performed if conditionB is not met Typical Examples IF burner AND fuel gt 0 AND rate gt 0 THEN lift lift rate 5 ELSE count 1 IF altitude gt 140 THEN lift lift 0 2 ENDIF ENDIF 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 IF burner AND fuel gt 0 AND rate gt 0 THEN Phe Sart tates ELSE IF altitude gt 140 THEN LIFE Lift 202 ENDIF ENDIF IF burner AND fuel gt 0 AND rate gt 0 THEN lift lift rate 5 ELSEIF altitude gt 140 THEN lift lift 0 2 ENDIF These two examples are identical The use of the ELSEIF statement combines the ELSE statement and the IF ENDIF statements for brevity lt is acceptable to have more than one ELSEIF statement in an IF THEN ELSE ELSEIF ENDIF construct References 26 Control Statements SECTION 4 CX Supervisor Script Language Refer to chapter 4 Punctuation for details of the use of indentation 4 3 3 Case Select Syntax SELECT CASE expression CASE expression statementblockl CASE expression statementblock2 CASE expression statementb
150. r 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 6 17 6 DBMove Description 106 Database Commands SECTION 6 Functions and Methods The DBMove function enables you to navigate around a Recordset by moving the position of the current record in the Recordset When a Recordset is first opened the first record is the current record Syntax returnstate DBMove level direction position Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise O level text A text point or constant specifying the connection level This must be a Recordset level direction text A text string indicating where to move to May be one of First Last Next Previous Position FirstPage LastPage NextPage PreviousPage Page Bookmark position int real This optional parameter is only required when directions of Position Page and Bookmark are used When used with Position and Page this parameter must be an integer and is the record or page number to move to When used with Bookmark this parameter must be a real Typical Examples DBMove Northwind Order Details First Go to the first record in the Recordset pos 3 DBMove Northwind Order Details Position pos Go to the th
151. read callbacks for MyPoint point will be returned 6 3 10 ShutDown Description Closes the CX Supervisor application Syntax returnstate ShutDown Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example ShutDown CX Supervisor runtime operation is terminated 6 4 Communications Commands 6 4 1 CloseComponent Syntax Returnstate CloseComponent ComponentName PLCName Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise ComponentName text A Text point or text constant containing the name of the component to close PLCName text 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 59 Communications Commands SECTION 6 Functions and Methods In this example the PLC Data Monitor component monitoring the PLC MyPLC is closed Component Performance Monitor PLC PLCO6 OK CloseComponent Component PLC In this example the Performance Monitor component monitoring the PLC PLCO is closed OK is used to determine if the action was successful 6 4 2 EnableOLE Syntax returnstate EnableOLE pointname Remarks Argument Type Description returnstat
152. rency subtype vbDate 7 Date subtype vbString 8 String subtype vbObject 9 Object vbError 10 Error subtype vbBoolean 11 Boolean subtype lvbVariant 12 Variant used only for arrays of variants lvbDataObject 13 Data access object lvoDecimal 14 Decimal subtype voByte 17 Bytesubtype 132 WriteArea Appendix B CX Server Communications Control B 10 WriteArea B 11 RunMode B 12 TypeName B 13 IsPointValid Constant Value Description vbArray 8192 Array Writes a block of memory to a specified area in a PLC Examples of synchronous write MyString TestString CXServer WriteArea MyPLC DM50 10 MyString Dim newValue 2 newValue 1 0 newValue 2 1 CXServer WriteArea BoilerTemp 2 newValue 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 The second example shows that a logical name can be used The script will wait for the write operation to complete before continuing to execute the next line Reads the current operating mode of a PLC Stop Program Debug Monitor Run where O Stop Program mode 1 Debug mode 2 Monitor mode and 4 Run mode Example intMode CXServer
153. rintMessage message Remarks Argument Type Description message string Contains the text string that is sent to the printer Typical Example PrintMessage Print this message 6 12 11 Right 6 12 12 TextToValue 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 Syntax righttext Right textpoint noofchars Remarks Argument Type Description textpoint text The text point containing the string that is to be manipulated noofchars integer The number of characters to extract from the string righttext text Text point containing the specified range of characters Typical Example textpoint abcdefgh righttext Right textpoint 3 The text point righttext contains the string fgh Syntax valuepoint TextToValue textpoint Remarks Argument Type Description textpoint text The text point containing the string that is to be converted into a number valuepoint integer A point containing the value returned after conversion from a string Typical Examples textpoint 10 valuepoint TextToValue textpoint The value 10 is assigned to the point valuepoint 91 Event Error Commands SECTION 6 Functions and Metho
154. ript is directly attached to an object objectname is not required expression The expression can be made up of points resulting in TRUE or FALSE Typical Examples visible TRUE The current object to which this example applies becomes visible POLYLINE_8 visible count AND flag The object POLYLINE_8 is made visible provided Integer point count AND Boolean point flag return TRUE Syntax objectname width expression context 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 a value point or an arithmetic expression returning a new width value in pixels context This argument may be omitted May be one of LEFT use left of object as datum CENTRE use centre of object as datum RIGHT use right of object as datum If omitted CENTRE is assumed Typical Examples width 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 53 Page Commands SECTION 6 Functions and Methods 6 2 Page Commands 6 2 1 Close Page Note Note 54 Display Page Syntax display pagename or display pagename X Y Remarks Argument Description pagename Thi
155. rnnnnn nano 24 4 3 2 Nested Conditional Statement ooonncinnnccnnnnncnnnonnccncnnnnnonnn cnn cn narran nc crac ranma 25 4 3 3 ASEO Ole eri lia 27 4 34 FOR NEXT GOOD cad AAA a tt be 28 4 3 5 DO WHILE UNTIL LOOP ines A aa dad 29 4 4 Vlore Tora E E A ll ad 29 A E e A e a T E E 29 Aed PROU arrn rs aro 30 4 5 PUNCIUAION cuca ETT AN 30 4 5 1 Command String Delimiters oonnocinnnnnninnccnnnnnnnnn coco canaria 30 A522 IndentallONy lado a Ad 30 4 5 3 Multiple Command ccccsccecsssssceceecssceeecescsseaueceesseneeceesssseauecsseseauecesssenaeecessseneecesessenaess 31 4 5 4 UParontlesiS ii als 31 4 5 5 Quotation Marks raaa aaa cnn nn 31 4 56 ROMAR ca btt 31 4 6 Indirection within Script Commands and Expressions c ccceceeeeeeeeeeeceeeeeeeeeeeeeeeeeeaeeseeeessaeeneaes 32 4 7 Point Arrays within Script Commands and Expressions ccccceeeseeeceeeeeeeeseeeeeeeeeseeeeesecaeeesaaeeeeaas 33 Table of Contents 4 8 USINGLAlASES ii A A A ci 33 SECTION 5 VBScript Language Reference ccccccssssssseseeeeeeeeeseeeesssesseeeees OL 5 1 Liston Features ii A Gee iso enh ih dae 37 SECTION 6 Functions and MethOdS 0ccccecescececeecececcececeenecuceececuceeececeeneeas4 d 6 1 6 2 6 3 6 4 6 5 Object COMME dd ia 45 621 1 A cd dieuna aaran aa Eaa aTa aa aa Aena a eaaa aaan 45 6 1 2 Other OBESA A ee aa 46 Gta Blinken aa e dd elle ed eee e Ao 47 OO 48 0 15 D ET o S vom
156. rs A string starts following an opening quotation mark and ends before a closing question mark in the example name spot the point name holds the string spot A mode of video display that provides 800 600 pixel resolution or higher with 16 or more colours and is supported on Super Video Graphics Adapter systems A SCADA software application which creates and maintains graphical user interfaces and communicates with PLCs and other I O mechanisms 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 An integral part of Microsoft Windows which allows Microsoft Windows based applications to be started CX Supervisor is run from the Taskbar In CX Supervisor a text object is a string on a page Attributes such as typeface point size embolden italicise underline left justify flush right and centre can be applied to enhance its presentation A type of point that holds a string A Multi Byte Character Set which not only includes European Characters like DBCS but can also include global support including for Japanese Chinese and Cyrillic fonts However Unicode is not supported on all Windows platforms Recipe validation code is CX Supervisor script language which is used to check point values before downloading a recipe A Visual Basic style scripting language supported by Microsoft s Windows Scripting Host
157. rver Communications Control 2 c ccscesceesceecesceseeeeeeees 129 B 1 B 2 B 3 B 4 B 5 B 6 B 7 B 8 B 9 B 10 B 11 B 12 B 13 B 14 B 15 B 16 B 17 B 18 B 19 B 20 B 21 B 22 B 23 B 24 B 25 B 26 B 27 B 28 B 29 B 30 FUNCIONA ii Ao eee 129 A A O O 130 A want dee Mesias Saeed i a a da a D ee Se aed 130 S etDeraultPLC 0 aa ete eesti a eaten ee ein haan eee 131 OPEREN o Doct ECCT ere eT Ree TERE ne rc eee eee ere 131 GIOSCPLC aida tt tada et 131 AS dt e a ee 131 MIO teak eed ateieeds ethene ae tid es 131 REAGAL Cars es cere see AA A endvetetelesdet ay bebeeyctebelene 132 Writ AVe assis s s tgs tox Shag Aa aaa calecedee cies 133 RunMode ARa E E A A REE aie Rie inhi ee ae Aisin she beeline 133 IPN Mit cd rrrerrerrerece rr T A reece AER 133 SPAM E AA a cd eee 133 PLC Memory Functions c ooooocinnccccnoccconaccccnnnccc conc nnnncccnnnrnnnnrcrr 133 ISTP Geet O tt teers 134 LAST POS 2c4 fore EE A abc 134 ISBad ality 2 2 253 niche se E O T 135 ClockReadizciisa tank oti ieee aie ese a hese tis ce ee ec 135 GIOCK Write Tia ito ad 135 RIWEIN Sit AS EA Ciel RATA A ee 135 A O Atte A E A E Se aedee eel awtay ahd SU de 136 TECOS e Messi A Mae ea hele el iT eee th me beet cokes ee ae Weed cee csi 136 MG REMOtGLOCAll reieverefalstteweeccet secede tesciven ebel eeteccceebetethenteds vocebesanteled O A 136 MEIDEVICEACOIESS ue A ae cane data 136 SetDeviceConlg cia A ena la ia 137 GetDevice Oise AAA IA AAA iia 137 A E
158. s rotate 45 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 Syntax objectname vertical fill expression context 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 context This argument may be omitted May be one of DOWN Fill object downwards UP Fill object upwards If omitted UP is assumed Object Commands SECTION 6 Functions and Methods 6 1 11 Visible 6 1 12 Width Typical Examples vertical fi11 50 The current object to which this example applies is filled by 50 ELLIPSE_1 vertical fi11 OIL_QUANTITY DOWN The object ELLIPSE_1 is filled provided the point OIL QUANTITY returns a valid result between 0 and 100 Syntax objectname visible expression Remarks Argument Description objectname This is the name of the object Where a sc
159. s 16 bits to define character codes With this larger range it can include accented characters extended ASCII characters Nordic characters and symbols DCOM is a distributed version of COM that allows components on different PCs to interact over a network Dynamic Data Exchange A channel through which correctly prepared programs can actively exchange data and controls other applications within Microsoft Windows DDE technology was notoriously unstable and was replaced with OLE technology See also Item Server server application and Topic SCADA applications are created and tested using the development environment within CX Supervisor On completion the finished application can be delivered as a final customer application to be run by the run time environment Dynamic Link Library A program file that although cannot be run stand alone as an executable can be utilised by one or more applications or programs as a common service DLL files have a DLL extension DLL s comprise a number of stand alone functions In CX Supervisor a DLL containing icons can be accessed to represent the display part of an OLE object One such DLL MORICONS DLL is provided in the standard Microsoft Windows installation A recipe is downloaded during runtime This process involves identifying the appropriate recipe and executing the validation code if any exists The download is complete when each ingredient has set its point to the target value
160. s for each subsequent call cycling back to the beginning when all pages have been returned Set takes three text parameters for Schema Name Criteria and Filter Typical Examples NumberOfRecords DBSchema Invoice Data Types RecordCount Read the Number of records in the Schema DBSchema Invoice Data types Read 2 Read Schema page 2 results into the associated point DBSchema Invoice Data Types Set Columns COLUMN_NAME Set a new Schema to return column names Description Reports if the specified level is in the requested state Syntax return DBState level state Remarks Argument Type Description return bool 1 if the specified level is in the requested state otherwise 0 111 Database Commands SECTION 6 Functions and Methods 6 17 12 DBSupports Note 6 17 13 DBUpdate 112 Note Argument Type Description 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 or Closed Typical Examples State DBState Invoice Closed Checks if the Connection Invoice is currently closed State DBState Northwind Customers Open Checks if the Recordset Customers is currently open Description Returns TRUE if the specified Recordset supports the requested operation Syntax ret
161. s is the name of the page for display based on its filename without the file extension e g the pagename for CAR PAG is simply CAR Typical Examples display CAR The page CAR PAG is displayed textpoint 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 Syntax close pagename Remarks Argument Description pagename This is the name of the page for closure based on its filename without the file extension e g the pagename for CAR PAG is simply CAR The pagename for closure must be currently open The close operation will cause the page to be unloaded including all objects ActiveX controls and scripts Care must be taken not to attempt to access them after the close instruction Where the script containing the close instruction is on the page to be closed this should be the last instruction in the script as it will cause the script to be unloaded Typical Examples close CAR The page CAR PAG is closed textpoint CAR close textpoint The page CAR PAG is closed General Commands SECTION 6 Functions and Methods 6 3 6 3 1 Exponential 6 3 2 PlayOLE General Commands Description Mathematical function to calculate a value raised to a power Syntax
162. sary Of Terms ci aa DO REVISION ISTO iia dra 0 10 SECTION 1 Introduction SECTION 1 Introduction This reference manual describes the script language syntax as a supplement to the CX Supervisor User Manual It provides detailed definition of the syntax of CX Supervisor scripts that drive project page object actions and CX Supervisor expressions as used by objects and scripts Typographic conventions used in the examples in this reference manual are as follows Script commands and reserved words are shown in the preferred case which may be either lower upper or mixed case e Points are shown in lower case Objects are shown in upper case The following terms are used in this reference manual e Application A set of files containing an executable file that carry out certain tasks This reference manual refers to the Microsoft Excel and Microsoft Word for Windows applications e Constant A point or object within a script that takes only one specific value Executable A file that contains programs or commands and has an EXE extension e Nesting To incorporate one or more IF THEN ELSE ELSEIF ENDIF statements inside a structure of the same kind e Operands Constants or point variables e Operators Relational arithmetic and logical statements for instance lt or AND Or The symbol is used to represent or where there are two or more forms of the same syntax e Point
163. se pointname integer This is the name of the point to set the bit for real Indirection or point arrays may be used bit point This specifies the bit to set value bool This specifies the value to set the bit to Typical Example testpoint 0 SetBit testpoint 4 TRUE The point testpoint contains the value 16 6 6 PLC Commands 6 6 1 ClosePLC Syntax returnstate ClosePLC plcname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise plcname string Name of PLC to be opened If the PLC is being accessed using a communications component e g the Omron CX Communications Control this parameter should be the control name and PLC name separated by a dot e g OMRONCXCommunicationsControl controlPL Cc Typical Example ClosePLC controlPLC 67 PLC Commands SECTION 6 Functions and Methods The PLC called controlPLC is closed No further communications with the PLC will take place until it is reopened 6 6 2 DownloadPLCProgram Syntax returnstate DownloadPLCProgram plcname filename processed Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise plcname string Name of PLC to download the program to filename string Name of the file on disk to download to the PLC If a drive and path are not specified the current
164. several running CX Supervisor applications simultaneously this can be used for data exchange An extension csf will always be added to the filename so it must not be specifed as part of the argument Syntax returnstate PrintFile filename Remarks 81 File Commands SECTION 6 Functions and Methods 6 9 8 Read 6 9 9 ReadMessage 82 Note Note Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Filename string Pathname of file to be printed Typical Example PrintFile c autoexec bat The file c autoexec bat is sent to the currently configured printer Script commands that have textual arguments can take either literal strings within quotes or text points CX Supervisor uses the OLE registration information file extension associations to decide how to print a file It invokes the parent application associated with a particular file extension instructing the application to start minimised and passing the print command For example if the file extension txt is associated with Notepad then Notepad is invoked to print the file Syntax returnstate Read RecordId pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Recordld integer An index into the file Pointname point Name s of point s to be updated with the data
165. st initialise DestArray SourceArray 0 1 SourceArray 1 2 SourceArray 2 3 Then initialise SourceArray to 1 2 3 CopyArray SourceArray DestArray 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 O s If DestArray is smaller than SourceArray i e it contains two elements then only elements 0 and 1 are set to 1 and 2 respectively Note CopyArray accepts arrays of different type i e Boolean arrays can be copied into Real arrays the only restriction is that Text arrays cannot be copied into numeric arrays and vice versa 6 5 3 DisableGroup Syntax returnstate DisableGroup groupname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise groupname text Name of the group containing the points to disable Typical Example DisableGroup lt Default gt All points belonging to the lt Default gt group is disabled thus preventing values from being read written 6 5 4 DisablePoint Syntax returnstate DisablePoint pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or
166. sword string or number is ignored The correct password must be provided however when disabling the password protection B 30 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 CXServer LastErrorString 139 LastErrorString Appendix B CX Server Communications Control 140 Appendix C JScript Features Appendix C JScript Features This appendix provides a summary of JScript features available for use with the ExecuteJScript and ExecuteJScriptFile script functions These features are provided by the Windows Scripting Host included by default with 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 For details of the latest versions and support contact Microsoft at http msdn microsoft com scripting Category Keyword Feature Array Handing Array join length reverse sort Assignments Assign Compound Assign OP Booleans Boolean Comments or Constants Literals NaN null true false Infinity undefined Control flow break continue for for in if else return while Dates and Time Date getDate ge
167. t 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 done 6 6 8 SetPLCPhoneNumber Syntax Returnstate SetPLCPhoneNumber plcname numbertext Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 plcname string Name of PLC to change the number of numbertext string New phone number for the PLC Typical Example SetPLCPhoneNumber controlPLC 01234 987654 The phone number for the PLC is changed to the required value 6 6 9 UploadPLCProgram Syntax returnstate UploadPLCProgram plcname filename processed 70 Temperature Controller Commands SECTION 6 Functions and Methods Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 plcname string Name of PLC to upload the program from filename string Name of the file on disk to upload the program to If a drive and path are not specified the file is created in the current directory which may not be the same as the application directory If a filename is specified as the user is prompted at runtime for a filename processed bool processed is set to TRUE when the operation is actually completed Typical Example Up
168. t is optional an may be omitted It defines which part of the object has it s colour changed May be one or more of FILL change fill colour FRAME changes frame colour If omitted both are changed Equivalent to FILL FRAME Typical Examples EXT_3 colour blue or EXT_3 colour blue The object TEXT_3 is set to blue BALL colour 35 0x1000000 The object BALL is set to colour 35 from the colour palette BALL colour OxFF0000 FILL The object BALL is set to blue shade tintl tint2 IF shade gt 65 OR shade lt 0 THEN shade 0 ENDIF 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 ELLIPSE_1 is set to the palette colour of the value of shade References Refer to chapter 6 Colour Palette for details of colour names and colour numbers Syntax objectname disable expression 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 The expression can be made up of points resulting in TRUE or FALSE Typical Examples disable TRUE The current pushbutton object to which th
169. tB Mid MidB Right RightB Replace Space Split StrComp String StrReverse LTrim RTrim Trim Variants IsArray IsDate IsEmpty IsNull IsNumeric IsObject TypeName VarType 39 List of Features 40 SECTION 5 VBScript Language Reference SECTION 6 Functions and Methods SECTION 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 Function Name Function Type Type Remarks AcknowledgeAlarm alarm command Scr Acknowledges an alarm AcknowledgeAllAlarms alarm command Scr Acknowledges all alarms AcknowledgeLatestAlarm alarm command Scr Acknowledge the latest alarm Acos unary function All Applies unary expression Asin unary function All Applies unary expression Atan unary function All Applies unary expression CancelForce point command Scr Removes the forcing of values on a point Chr text command All Displays a character based on the ASCII character set ClearAlarmHistory alarm command All Clears the alarm history ClearErrorLog event error All Clears the error log commands ClearLogFile Data Logging Scr Clears a data log file command ClearSpoolQueue printer All Discards any queued messages command or
170. tDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getYear getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTC Minutes getUTCMonth getUTCSeconds setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setYear setUTCDate setUTCFullYear setUTCHours setUTCmillisecinds setUTCMinutes setUTCMonth setUTCSeconds toGMTString toLocaleString toUTCSiring parse UTC Declarations function new this var with Function Creation Function arguments length 141 Appendix C JScript Features 142 Category Keyword Feature Global Methods Global escape unescape eval isFinite isNaN parselnt parseFloat 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 NaN NEGATIVE_INFINITY POSITIVE_INFINITY Object Creation Object new constructor prototype toString valueOf Operators Addition Subtraction Modulus arithmetic Multiplication Division Negation Equality Inequality Less Than lt Less Than or Equal To lt Greater Than gt Greater Than or Equal To gt Logical And amp amp Or Not Bitwise And amp Or Not Xor Bitwise Left Shift
171. tProtection Dim PasswordString Dim PasswordNumber EnableProtection false PasswordString PasswordNumber 12345678 CXServer Protect PEC EnableProtection PasswordString PasswordNumber The parameters of this command are in order e PLC Name of PLC EnableProtection true to set password protection false to unset it e 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 12345678 For C series PLCs this should be a string of up to 4 characters containing a hexadecimal number e g 1234 e PasswordNumber currently this is only used for C and CV series PLCs and only when the password string is empty In those circumstances it is simply a number representing the value of the 4 or 8 digit password Please note that the password is entered in CX Programmer as a hexadecimal string as with the PasswordString parameter above and that for example the value 1234 in decimal is the equivalent to 04d2 as a hexadecimal password string Additional C Series PLC notes For C series the PLC program needs code the first line of the application in the PLC to enable password setting release and this fixes the password value e g LD AR10 01 FUN49 0 0 1234 1234 password value in Hex When setting the password this value is used rather than the value passed i e the pas
172. tate applied If the point is an array point then all elements within the array have the 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 Syntax returnstate ForceReset pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point Name of point If the point is an array point then all elements within the array have the ForceReset command applied Typical Example ForceReset point1 Point Commands SECTION 6 Functions and Methods The Boolean point point1 has its value set to FALSE References Refer to PLC operation manuals for a detailed description of ForceSet and ForceReset 6 5 10 ForceSet Syntax returnstate ForceSet pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname point Name of point If the point is an array point then all elements within the array have the ForceReset 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 6 5 1
173. tate is 1 if the function is successful or 0 otherwise Typical Example Logout Data Logging Commands SECTION 6 Functions and Methods 6 15 3 Setup Users The user is logged out References Refer to the CX Supervisor User Manual for details of Logout Syntax returnstate SetupUsers Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example SetupUsers The Setup Users dialog is displayed for user entry References Refer to the CX Supervisor User Manual for details of setting and modifying user details 6 16 Data Logging Commands 6 16 1 ClearLogFile 6 16 2 CloseLogFile Syntax ClearLogFile datasetname Remarks Argument Type Description datasetname string 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 Syntax returnstate CloseLogFile datasetname or returnstate CloseLogFile databaselink Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise datasetname text Name of Data Set to close as text point or constant databaselink text Name of Database link to close as text point or constant
174. the OPC Server to connect to e g OMRON OpenDataServer 1 ServerProjectName Optional filename which if specified causes the OPC Server to use the specified file if supported by the server A 2 Script Interface The Script Interface defines the methods for the OPC communications control A 3 Functions Value Function for getting and setting an OPC item value Read Function to read the value of an OPC item Write Function to write the value of an OPC item A 3 1 Value Reads or writes the value of an OPC item Example 1 Reading a value intVal OMRONCXOPCCommunicationsControll Value MyGroup BoilerTemp In this example the OPC item Boilerlemp in the OPC group called MyGroup will be read from the OPC Server and will be stored in intVal Example 2 Writing a value OMRONCXOPCCommunicationsControll Value MyGroup BoilerTemp 50 In this example the value 50 will be written to the OPC item BoilerTemp 127 Functions Appendix A OPC Communications Control A 3 2 Read A 3 3 Write 128 Note Value is the default property so is assumed if omitted Therefore the following examples are the same intVal OMRONCXOPCCommunicationsControll Value MyGroup BoilerTemp and intVal OMRONCXOPCCommunicationsControll MyGroup BoilerTemp Reads the value of an OPC item Example of synchronous read intVal OMRONCXOPCCommunicationsControll Read MyGroup B
175. the effect of doubling the value so two shifts quadruple the value 4 2 3 Logical Operators Syntax pointname expression or IF expression or DO WHILE expression or DO UNTIL expression Remarks Argument Description Pointname The point name to be assigned a value based on a logical expression 22 Logic and Arithmetic SECTION 4 CX Supervisor Script Language Argument Description Expression The Boolean value to be assigned to pointname or the Boolean value forming a conditional statement The expression includes the following operators with points and constants And AND e Or OR Not NOT Typical Examples flag temp AND speed 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 or speed supplies FALSE or 0 to flag IF flag AND temp AND speed THEN flag FALSE ENDIF The Boolean point flag is assigned FALSE on the condition that flag AND point temp AND point speed are all not zero If the condition fails then flag is not assigned FALSE References Refer to chapter 4 Control Statements for details of the use of the IF THEN ELSE ELSEIF ENDIF statements 4 2 4 Relational Operators Syntax IF expression or DO WHILE expression or DO UNTIL expression Remarks Argum
176. ting the name of the temperature controller Typical Example templ TCReset e5ak 6 8 Alarm Commands 6 8 1 AcknowledgeAlarm Syntax returnstate AcknowledgeAlarm alarmname Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 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 6 8 2 AcknowledgeAllAlarms Syntax returnstate AcknowledgeAllAlarms Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 Typical Example AcknowledgeAllAlarms All alarms are acknowledged References Refer to the CX Supervisor User Manual for details of alarms 6 8 3 AcknowledgeLatestAlarm Syntax returnstate AcknowledgeLatestAlarm Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 Typical Example AcknowledgeLatestAlarm The most current alarm of the highest priority is acknowledged 76 Alarm Commands SECTION 6 Functions and Methods References Refer to the CX Supervisor User Manual for details of alarms 6 8 4 ClearAlarmHistory Syntax returnstate ClearAlarmHistory Remarks Argument Type Description returnstate bool 1 if the function
177. upMode 13 AutoTuneMode 14 OverFlow Bool E5 F E5 X E5 J 15 UnderFlow Bool E5 F E5 X E5 J 16 SensorMalfunction Bool E5 F E5 X E5 J 17 ADConvertorFailure Bool E5 F E5 X E5 J 18 RAMAbnormality Bool E5 F E5 X E5 J 19 RAMMismatch Bool E5 F E5 X E5 J 20 StatusWordsOnly Bool E5 K only TRUE indicates valid words below 21 StatusO word E5 K only 22 Status1 word E5 K only value point The returned status parameter value Refer to realor paramlD above for details int Typical Example templ TcGetStatusParameter e5ak temp2 temp3 6 7 4 TCRemoteLocal Syntax returnstate TCRemoteLocal TController mode Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller 73 Temperature Controller Commands SECTION 6 Functions and Methods Argument Type Description mode point This is a point depicting the mode of operation and defines the operational mode of a temperature controller 0 This specifies the temperature controller is in remote mode 1 This specifies that the temperature controller is in local mode Typical Example templ TCRemoteLocal e5ak temp2 Note This command was previously called TCOperationalMode 6 7 5 TCRequestStatus Syntax returnstate TCRequestStatus Tcontroller ret
178. urn DBSupports level operation 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 operation text The requested operation may be one of AddNew Bookmark Delete Find MovePrevious Update Typical Example Result DBSupports CSV Recordsetl Delete Checks if records can be deleted in Recordset1 If the MovePrevious operation is not supported then only Forward Only cursor movements are supported Description Update the record being added in a Recordset Used in conjunction with DBAddNew to commit a new record DBUpdate is ONLY required when DBAddNew has been used at the Field level When DBAddNew is used at the Recordset level an additional DBUpdate is not required as this is performed automatically Syntax returnstate DBUpdate level Database Commands SECTION 6 Functions and Methods 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 Typical Example DBAddNew Northwind Order Details OrderID DBAddNew Northwind Order Details ProductID DBAddNew Northwind Order Details Quantity
179. urnflag Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string This is a string representing the name of the temperature controller returnflag point This is a point depicting that the status has been returned and is available for the command TCGetStatusParameter Typical Example templ 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 6 7 6 TCRspLsp Syntax returnstate TCRspLsp Tcontroller mode Remarks Argument Type Description returnstate bool 1 if the function is successful otherwise 0 TController string 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 Typical Example templ TCRspLsp e5ak temp2 74 Temperature Controller Commands SECTION 6 Functions and Methods Note 6 7 7 TCRunStop Note 6 7 8 TCSaveData This command was previously called TCSetpoint Syntax returnstate TCRu
180. w Balloon Altitude Fuel Burning Lift Group 1 or ItemList 0 Altitude ItemList 1 Fuel ItemList 2 Burning ItemList 3 Lift ItemList 4 Group 1 OpenLogView Balloon ItemList Both these commands will open the Data Log Viewer and load the Balloon log file and show the named items 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 6 16 8 StartAuditTrail Syntax returnstate StartAuditTrail Remarks Argument Type Description returnstate bool Optional 1 if the function is successful otherwise 0 Typical Example StartAuditTrail This command will start audit trail logging of all items configured to be logged into the audit trail database based on the chosen target i e Microsoft Access or SQL By default data will be appended to the audit trail database if one already exists otherwise a new database will be created The Audit Trail Configuration dialog can be used to configure how audit trail data is logged to a Microsoft Access or SQL database 101 Data Logging Commands SECTION 6 Functions and Methods 6 16 9 StopAuditTrail 6 16 10 StartLogging 6 16 11 StopLogging 102 Syntax StopAuditTrail Typical Ex
181. x returnstate RunHelp helpfile helpindex Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise helpfile string Pathname of helpfile to be run helpindex integer Index into a help topic as defined by the help file being run 57 General Commands SECTION 6 Functions and Methods 6 3 8 SetLanguage Typical Example RunHelp c myhelp hlp 0 The helpfile c myhelp hlp is run and topic 0 shown Description 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 option Syntax SetLanguage language name Remarks Argument Type Description language name string Name of language to set to Must be identical to filename of related file with Ing file extension Standard options are English Czech Danish Deutsch Espa ol Finnish French Italiano Nederlands Belgi Norwegian Portugu s Slovenija and Swedish In addition Default will load the designers default language Typical Example SetLanguage Espanol In this example the Spanish language files will be loaded SetLanguage Default In this example the language wil
Download Pdf Manuals
Related Search
Related Contents
la version pdf 取扱説明書 - シャープ Televisor Trinitron A Color Onvif Filter Solicitud Privada de Oferta SPVA 2015 Philips Genie Stick energy saving bulb 872790086127300 Curtis PLEDV2452A LED TV Séquence des opérations USER MANUAL - Quark Nova Project Copyright © All rights reserved.
Failed to retrieve file