background image

Cat. No. W09E-EN-01

CX-Supervisor

Software Release 2.0

SCRIPT REFERENCE

Cat. No. W09E-EN-01

Note: Specifi cations subject to change without notice.

Authorized Distributor:

Printed in Europe

Cat. No. W09E-EN-01

CX-Supervisor  Software Release 2.0 

SCRIPT REFERENCE

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

Page 1: ...Cat No W09E EN 01 CX Supervisor Software Release 2 0 SCRIPT REFERENCE Cat No W09E EN 01 CX Supervisor Software Release 2 0 SCRIPT REFERENCE...

Page 2: ...CX Supervisor Script Language Software Revision 2 0...

Page 3: ......

Page 4: ...on that if not heeded is likely to result in loss of life or serious injury WARNING Indicates information that if not heeded could possibly result in loss of life or serious injury Caution Indicates i...

Page 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...

Page 6: ...2007 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...

Page 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...

Page 8: ...vailable to script languages Chapter 7 Script Examples A description of the script language in practice using some examples Chapter 8 Colour Palette A description of the colour palette that can be app...

Page 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...

Page 10: ...e 9 Points 10 Logic and Arithmetic 12 Control Statements 15 Subroutines 22 Punctuation 23 Indirection within Script Commands and Expressions 26 Point Arrays within Script Commands and Expressions 27 U...

Page 11: ...105 Security Commands 109 Data Logging Commands 111 Database Commands 117 Serial Port Functions 130 ActiveX Functions 133 Chapter 7 Script Examples 137 Balloon Script 137 Chapter 8 Colour Palette 141...

Page 12: ...OMRON CX Supervisor Script Language Revision 2 0 Page ix Appendix D Obsolete Features 153 Glossary of Terms 161 Index 169...

Page 13: ......

Page 14: ...oft Excel and Microsoft Word for Windows applications 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...

Page 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...

Page 16: ...actions directly using the associated Expression or Digital Expression field Blink Close page Colour Change Analogue Colour Change Digital Display Status Text Display Text Point Display Value Edit poi...

Page 17: ...n 450 in value i e the value of position is between 300 and 450 then the expression has been met and an action is initiated in this instance the current object is made visible if the expression is met...

Page 18: ...when using VBScript Note 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...

Page 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...

Page 20: ...s a runtime action of an object then the script can affect the object of the action or any other depending on the actual content of the script Page Page scripts are concerned with manipulating points...

Page 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...

Page 22: ...odification or test arithmetic operators All Applies arithmetic expressions relational operators All Applies relational expressions AND logical operators All Applies logical expressions CALL statement...

Page 23: ...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 contai...

Page 24: ...eft SHL and Shift Right SHR Equal to and not equal to relational operators Bitwise AND XOR OR AND logical operator OR logical operator lowest Typical Examples lift height rate 5 0 The Integer or Real...

Page 25: ...Subtraction Multiplication Division Modulus Increment Decrement Typical Examples result 60 20 5 The Integer or Real point result is assigned the value calculated by the value of 20 divided by 5 plus 6...

Page 26: ...stants Bitwise AND BITAND or Bitwise OR BITOR or Bitwise XOR XOR or Bitwise Shift Left SHL or Bitwise Shift Right SHR or Typical Examples MSB value 128 The Boolean point MSB is set TRUE if the binary...

Page 27: ...int 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 t...

Page 28: ...ot equal to Equal to Typical Example IF fuel 0 THEN fuel 0 ENDIF The point fuel is assigned the value 0 on the condition that currently fuel is less than 0 If fuel is not less than 0 then it is not as...

Page 29: ...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 630 AND distance 660 AND lif...

Page 30: ...3 ENDIF ELSE statementblock2 ENDIF or IF conditionA THEN statementblock1 IF conditionB THEN statementblock3 ELSE statementblock4 ENDIF ELSE statementblock2 ENDIF or IF conditionA THEN statementblock1...

Page 31: ...re 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...

Page 32: ...1 CASE expression statementblock2 CASE expression statementblock3 END SELECT or SELECT CASE expression CASE expression statementblock1 CASE expression statementblock2 CASE ELSE statementblock3 END SEL...

Page 33: ...UE CASE temperature 0 AND temperature 10 colour blue CASE temperature 10 AND temperature 20 colour green CASE temperature 20 AND temperature 30 colour red CASE ELSE colour white ENDSELECT In this exam...

Page 34: ...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 T...

Page 35: ...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 ne...

Page 36: ...value limit ENDIF REM final part of script POLYGON_1 COLOUR red ELLIPSE_5 WIDTH value The integer point limit is tested for its value If its value exceeds 1000 then the condition is met and the RETUR...

Page 37: ...ypical Examples IF burner AND fuel 0 AND rate 0 THEN lift lift rate 5 ELSE IF altitude 140 THEN lift lift 0 2 ENDIF ENDIF IF burner AND fuel 0 AND rate 0 THEN lift lift rate 5 ELSE IF altitude 140 THE...

Page 38: ...e 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 argum...

Page 39: ...OLE ole_1 verbnumber 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...

Page 40: ...rol e g via the Edit Point Value Analogue animation Point Arrays within Script Commands and Expressions It is possible to access the elements of a point array directly or indirectly from within script...

Page 41: ...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...

Page 42: ...Alias definitions are stored in a simple text file in the project directory called project name pre The format of the file consists of any number of lines such as Test1 InArray 12 10 i e an symbol fo...

Page 43: ...ng 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 ac...

Page 44: ...t at http msdn microsoft com scripting List of Features Category Keyword Feature Array handling Array Dim Private Public ReDim IsArray Erase LBound UBound Assignments Set Comments Comments using or Re...

Page 45: ...rmatDateTime FormatNumber FormatPercent Input Output InputBox LoadPicture MsgBox Literals Empty False Nothing Null True Math Atn Cos Sin Tan Exp Log Sqr Randomize Rnd Miscellaneous Eval Function Execu...

Page 46: ...Abs Int Fix Round Sgn Script Engine ID ScriptEngine ScriptEngineBuildVersion ScriptEngineMajorVersion ScriptEngineMinorVersion Strings Asc AscB AscW Chr ChrB ChrW Filter InStr InStrB InStrRev Join Le...

Page 47: ...mand Scr Clears a data log file ClearSpoolQueue printer command All Discards any queued messages or alarms close object command Scr Closes a specified page CloseAlarmHistory alarm command All Closes t...

Page 48: ...rinter command All Permits printing of Alarms or messages ExportAndViewLog Data Logging command Scr Exports data log and views ExportLog Data Logging command Scr Exports data log FileExists file comma...

Page 49: ...r Opens the Data Log Viewer 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 Play...

Page 50: ...emp controller command All Retrieves the temperature controller status parameter TCRemoteLocal temp controller command All Defines the operational mode of a temperature controller TCRequestStatus temp...

Page 51: ...and therefore cannot be accessed or commands issued from external script languages like VBScript or Jscript Current Object Syntax objectcommand Remarks Argument Description objectcommand The expressi...

Page 52: ...f the Animation Editor Other Objects Syntax objectname objectcommand pagename objectname objectcommand Remarks Argument Description objectname This is the name of the object The object is provided wit...

Page 53: ...ate 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 Blink Synta...

Page 54: ...ctly 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 expressi...

Page 55: ...n 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 Refere...

Page 56: ...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...

Page 57: ...rizontal fill GAS_LEVEL RIGHT The object ELLIPSE_1 is filled from the right provided the point GAS_LEVEL returns a valid result between 0 and 100 Move Syntax objectname move x co ordinate y co ordinat...

Page 58: ...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 define...

Page 59: ...ards UP Fill object upwards If omitted UP is assumed Typical Examples vertical fill 50 The current object to which this example applies is filled by 50 ELLIPSE_1 vertical fill OIL_QUANTITY DOWN The ob...

Page 60: ...s 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 dat...

Page 61: ...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 pa...

Page 62: ...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...

Page 63: ...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 Positive nu...

Page 64: ...ySound 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 PlayS...

Page 65: ...ate 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 exec...

Page 66: ...ext 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 n...

Page 67: ...the property of If the property is not a Point property then specify empty string Property Name string Name of Property to read Must be identical to the displayed property name If both PLC and Point a...

Page 68: ...cessful 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 c...

Page 69: ...abled directly without using a point to hold the desired status EnablePLC Syntax returnstate EnablePLC pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is...

Page 70: ...ed Component Performance Monitor PLC PLC06 OK OpenComponent Component PLC In this example the Performance Monitor component monitoring the PLC PLC06 is opened OK is used to determine if the action was...

Page 71: ...e 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 small...

Page 72: ...nt Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Pointname point Name of point to be disabled Typical Example DisablePoint point1 The point point1 is...

Page 73: ...ity Typical Example EditPoint bFlag Select ON or OFF ON OFF A dialog is displayed to edit the Boolean point bFlag to ON or OFF with a caption Select ON or OFF EditPoint nValue Enter a new value 0 0000...

Page 74: ...oint1 is enabled thus allowing values to be read written Force Syntax returnstate Force pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0...

Page 75: ...efer to PLC operation manuals for a detailed description of ForceSet and ForceReset ForceSet Syntax returnstate ForceSet pointname Remarks Argument Type Description returnstate bool Returnstate is 1 i...

Page 76: ...point contains TRUE InitialiseArray Syntax InitArray arrayname value Remarks Argument Type Description arrayname Name of point array value Value to set all elements of the array to Typical Example Ini...

Page 77: ...within an On Condition script which has an expression of returnflag TRUE OutputPoint Syntax returnstate OutputPoint pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if th...

Page 78: ...Bit pointname bit value Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise pointname integer real This is the name of the point to set the...

Page 79: ...wnload 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 directory is assumed which may not be the same as the applicatio...

Page 80: ...this example the current mode of the PLC controlPLC is stored in the point currentmode OpenPLC Syntax Returnstate OpenPLC plcname processed Remarks Argument Type Description returnstate bool 1 if the...

Page 81: ...if the function is successful or 0 otherwise plcname string Name of PLC to be checked Typical Example IsFailing PLCCommsFailed controlPLC The point IsFailing is set to true if the PLC called controlP...

Page 82: ...not be changed immediately after the statement has been executed The processed flag done is set at a later time when the operation has been completed Therefore if using statements that require the op...

Page 83: ...ly completed Typical Example UploadPLCProgram controlPLC Prog01 bin done The program in the PLC controlPLC is uploaded to the file Prog01 bin in the current directory Before continuing the script wait...

Page 84: ...e change width to 40 2 This is used to start the auto tuning operation Typical Example temp1 TCAutoTune e5ak temp2 TCBackupMode Syntax returnstate TCBackupMode TController mode Remarks Argument Type D...

Page 85: ...Type 7 Output2 8 Alarm1 9 Alarm2 10 InputType Integer E5 F E5 X E5 J 11 OperationMode 12 BackupMode 13 AutoTuneMode 14 OverFlow Bool E5 F E5 X E5 J 15 UnderFlow Bool E5 F E5 X E5 J 16 SensorMalfunctio...

Page 86: ...onalMode TCRequestStatus Syntax returnstate TCRequestStatus Tcontroller returnflag Remarks Argument Type Description returnstate Bool Returnstate is 1 if the function is successful or 0 otherwise TCon...

Page 87: ...spLsp e5ak temp2 Note This command was previously called TCSetpoint TCRunStop Syntax returnstate TCRunStop TController mode Remarks Argument Type Description returnstate bool Returnstate is 1 if the f...

Page 88: ...gLevel1 TController Remarks Argument Type Description returnstate Bool Returnstate is 1 if the function is successful or 0 otherwise TController String This is a string representing the name of the te...

Page 89: ...entifier of the alarm Typical Example AcknowledgeAlarm temphigh The alarm temphigh is acknowledged References Refer to the CX Supervisor User Manual for details of alarms AcknowledgeAllAlarms Syntax r...

Page 90: ...of the highest priority is acknowledged References Refer to the CX Supervisor User Manual for details of alarms ClearAlarmHistory Syntax returnstate ClearAlarmHistory Remarks Argument Type Description...

Page 91: ...ils of alarms CloseAlarmStatus Syntax returnstate CloseAlarmStatus Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Example Clos...

Page 92: ...ol Returnstate is 1 if the function is successful or 0 otherwise Typical Example DisplayAlarmStatus The current alarm status is displayed References Refer to the CX Supervisor User Manual for details...

Page 93: ...oolean 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 Man...

Page 94: ...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 TRU...

Page 95: ...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 bac...

Page 96: ...le 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...

Page 97: ...s can be shared for instance located on a network drive and accessed by several running CX Supervisor applications simultaneously this can be used for data exchange Note An extension csf will always b...

Page 98: ...Returnstate is 1 if the function is successful or 0 otherwise RecordId integer An index into the file Pointname point Name s of point s to be updated with the data read from the open file Typical Exa...

Page 99: ...256 characters therefore a maximum of 256 characters can be read from the file SelectFile Syntax filename SelectFile filter path Remarks Argument Type Description Filename Text string returned Contain...

Page 100: ...lter 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 i...

Page 101: ...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 Typical E...

Page 102: ...0 otherwise recipename string The name of the recipe to be downloaded Typical Example DownloadRecipe recipe1 The recipe recipe1 is downloaded References Refer to the CX Supervisor User Manual for deta...

Page 103: ...eReport 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 w...

Page 104: ...ith current values and printed to the default Windows printer ViewReport Syntax returnstate ViewReport ReportTemplateFile Remarks Argument Type Description returnstate bool Returnstate is 1 if the fun...

Page 105: ...String containing binary representation of value Typical Example BStr Bin 20 In this example Bstr contains 10100 Chr Syntax result Chr value Remarks Argument Type Description value Extended ASCII val...

Page 106: ...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...

Page 107: ...textpoint text This is the point which has its text length counted returnpoint Integer real This is the point that holds the return value Typical Example textpoint Hello World count GetTextLength tex...

Page 108: ...tax 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 messa...

Page 109: ...nter 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 p...

Page 110: ...igned to the point valuepoint textpoint 10 34 realpoint TextToValue textpoint The real value 10 34 is assigned to the real point realpoint ValueToText Syntax textpoint ValueToText value Remarks Argume...

Page 111: ...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 DisplayErrorLo...

Page 112: ...lag is TRUE then error logging is enabled If flag is false then error logging is disabled LogError Syntax returnstate LogError message priority Remarks Argument Type Description returnstate bool Retur...

Page 113: ...log Printer Commands ClearSpoolQueue Syntax returnstate ClearSpoolQueue Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 otherwise Typical Exampl...

Page 114: ...ol 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 before printing Typical Example PrintActivePage TRUE Th...

Page 115: ...therwise 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 FA...

Page 116: ...meter 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...

Page 117: ...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 Data Logging Commands ClearLog...

Page 118: ...base link to close as text point or constant Typical Example CloseLogFile Process 1 This command will close the active log file for the data set Logging for this data set is automatically stopped Clos...

Page 119: ...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...

Page 120: ...array A text point which has an array size specified 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 followe...

Page 121: ...ile 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 ope...

Page 122: ...tions etc stored in the session file If omitted the previous settings are used Typical Example OpenLogView Balloon Altitude Fuel Burning Lift Group 1 or ItemList 0 Altitude ItemList 1 Fuel ItemList 2...

Page 123: ...losed it will be automatically opened StopLogging Syntax returnstate StopLogging datasetname or returnstate StopLogging databaselink Remarks Argument Type Description returnstate bool Optional 1 if th...

Page 124: ...te it is added by calling the DBUpdate function Note To use DBAddNew with a Recordset level the Recordset must be configured to perform this type of operation i e it will need to contain fields for an...

Page 125: ...Close 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 DBDelete Description...

Page 126: ...ion 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 with certain commands For Connec...

Page 127: ...es made and ends the transaction CommitTransAll Connection Saves all changes and ends all transactions RollbackTransAll Connection Cancels all changes and ends all transactions TransCount Connection R...

Page 128: ...s action Typical Examples DBGetLastError Northwind or DBGetLastError Northwind TRUE Both the above lines will get and display the last error to occur for the Northwind connection ErrMsg DBGetLastError...

Page 129: ...meter 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 w...

Page 130: ...t 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 Note Bookmarks will only work if specifically suppor...

Page 131: ...table for type level text A text point or constant specifying the connection level This may be a Recordset or Field level property text The name of the property to get For details see the Recordset Pr...

Page 132: ...of the Recordset Bool 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 p...

Page 133: ...BRead 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 Note Use with reset TRUE is useful if th...

Page 134: ...turns the number of pages in the current Schema CurrentPage Returns the current Schema page parameters Some commands require 1 or more extra parameters Read takes an optional parameter Page Number of...

Page 135: ...tly closed State DBState Northwind Customers Open Checks if the Recordset Customers is currently open DBSupports Description Returns TRUE if the specified Recordset supports the requested operation Sy...

Page 136: ...d Order Details OrderID DBAddNew Northwind Order Details ProductID DBAddNew Northwind Order Details Quantity DBAddNew Northwind Order Details UnitPrice DBUpdate Northwind Order Details Each required f...

Page 137: ...at the next set of records Serial Port Functions InputCOMPort Description Sets the serial communications port for receiving ASCII text messages Any message received is placed in the text point The bo...

Page 138: ...ugh the designated serial communications port Syntax ReturnState OutputCOMPort PortNumber Message Remarks Argument Type Description ReturnState Bool True if successful else false PortNumber Integer Th...

Page 139: ...smitting 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 el...

Page 140: ...ptional 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...

Page 141: ...marks 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 val...

Page 142: ...rt on the object OLE1 Execute CXComms1 OpenPLC MyPLC This will call the method OpenPLC with one text parameter MyPLC on the OLE object CXComms1 ExecuteVBScript Description Creates aliases allowing Vis...

Page 143: ...ot include the or characters To use these put the script in a text file and use the ExecuteJScriptFile function ExecuteVBScriptFile Description Allows Visual Basic script stored in a text file to be e...

Page 144: ...in c jscript txt 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 remo...

Page 145: ...sent to the client application that may force the client to perform some specified archive operation The second and third parameters are not used returnstate GenerateEvent Alarm Set Boiler alarm 95 5...

Page 146: ...ing 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...

Page 147: ...burner FALSE ENDIF ENDIF IF burner AND fuel 0 0 AND rate 0 0 THEN lift lift rate 5 0 ELSE IF alt 140 0 THEN lift lift 0 2 ENDIF ENDIF IF lift 10 0 THEN lift 10 0 ENDIF alt alt lift IF alt 140 0 THEN I...

Page 148: ...e 5 0 ELSE IF alt 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 0 the balloon has taken off then point lift is incremented b...

Page 149: ...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 0 0 then speed 0 0 ENDIF Point speed is c...

Page 150: ...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 Mi...

Page 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...

Page 152: ...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 the OP...

Page 153: ...RONCXOPCCommunicationsControl1 Read MyGroup BoilerTemp In this example the OPC item BoilerTemp in the OPC group called MyGroup will be read from the OPC Server and will be stored in intVal The script...

Page 154: ...on 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 th...

Page 155: ...g 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 Value is the default property and d...

Page 156: ...er ClosePLC MyPLC 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...

Page 157: ...erTemp 20 In the first example DM0 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 logi...

Page 158: ...h 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 RunMode Re...

Page 159: ...t 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 Example 2 CXServ...

Page 160: ...oints CXServer ListPoints sPLC nLbound LBound arrayOfPoints nUbound UBound arrayOfPoints For Count 1 To UBound arrayOfPoints MsgBox arrayOfPoints Count Next In this example the list of Points configur...

Page 161: ...me CXServer ClockWrite PLC1 NewDate RawFINS This function enables raw FINS commands to be sent to a specified PLC This function is for advanced users familiar with the Omron FINS protocol only VBScrip...

Page 162: ...being set to remote mode Set the device to remote mode CXServer TCRemoteLocal E5AK 0 SetDeviceAddress This function can be used to set key elements of a device address the network number node number...

Page 163: ...arily 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 Section AD...

Page 164: ...he 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 0 respec...

Page 165: ...ame of PLC EnableProtection true to set password protection false to unset it PasswordString Password as a string For CS series PLCs this should be a string of up to 8 characters For CV PLCs this shou...

Page 166: ...e the password string or number is ignored The correct password must be provided however when disabling the password protection LastErrorString This property which can be set as well as read is a text...

Page 167: ...rosoft 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 Inf...

Page 168: ...INFINITY POSITIVE_INFINITY Object Creation Object new constructor prototype toString valueOf Operators Addition Subtraction Modulus arithmetic Multiplication Division Negation Equality Inequality Less...

Page 169: ...ems It is recommended to upgrade to a later Windows version Sleep Description Pause execution of a script for specified duration Syntax Sleep duration Remarks Argument Type Description Duration Number...

Page 170: ...ses 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 s...

Page 171: ...t be returned and an error is reported 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...

Page 172: ...DETerminate using the Integer point channelname or the command DDETerminateAll DDEPoke Syntax returnstate DDEPoke channel item pointname Remarks Argument Type Description returnstate bool Returnstate...

Page 173: ...eadsheet 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 A...

Page 174: ...l previously initiated DDE links are closed EnableDDE Syntax returnstate EnableDDE pointname Remarks Argument Type Description returnstate bool Returnstate is 1 if the function is successful or 0 othe...

Page 175: ...ph on TestPage1 with the identifier Graph_1 has its data cleared ClearGraph Graph_2 The trend or scatter graph on the current page with the identifier Graph_2 has its data cleared StartGraph Syntax re...

Page 176: ...ter graph to be stopped pagename string Optional parameter indicating the name of the page that the graph is on Typical Examples StopGraph Graph_1 TestPage1 The trend or scatter graph on TestPage1 wit...

Page 177: ...oves the currently selected snapshot Note This command is provided for compatibility with SCS v2 0 applications For newer applications the data logging facilities should be used in preference Note Thi...

Page 178: ...h SCS v2 0 applications For newer applications the data logging facilities should be used in preference GetPointValue Syntax returnpoint GetPointValue pointname offset Remarks Argument Type Descriptio...

Page 179: ...e 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...

Page 180: ...ision 2 0 Page 167 SetPrinterConfig DriverNamePoint DeviceNamePoint PrintNamePoint This uses text points Terminator FormatText c c 13 10 Character 10 is lf newline character 13 is cr carriage return S...

Page 181: ...as a command 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 t...

Page 182: ...sed to access a data source This can either be via Data Source Name DSN filename or directory Database Connection Level A Database Connection Level is a string which determines what level in the datab...

Page 183: ...amic 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...

Page 184: ...o the internal computer memory or PLC Icon Pictorial representations of computer resources and functions The CX Supervisor development environment and run time environment are run from icons Ingredien...

Page 185: ...ine an arc a polygon including a square and rectangle a round rectangle an ellipse including a circle or a polyline A control is essentially a complex graphic object and is specifically either a pushb...

Page 186: ...arted from icons and for all applications to be organised CX Supervisor can be run from Program Manager Project A CX Supervisor application will consist of one or a number of pages linked together The...

Page 187: ...re application which creates and maintains graphical user interfaces and communicates with PLCs and other I O mechanisms Target Value An ingredient must specify a target value for its related point Th...

Page 188: ...ws 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 Windows Scripting Host A scripting...

Page 189: ...2 Bitmap 168 Pixel 173 Bitwise Operators Logic and Arithmetic 12 Blink Object Commands 40 C Call Subroutines 22 CancelForce Point Commands 57 Case Selected Control Statements 19 Chr Text Commands 92 C...

Page 190: ...66 DownloadRecipe Recipe Commands 89 Dynamic Data Exchange See DDE Dynamic Link Library See DLL E EditFile File Commands 82 EnableAlarms Alarm Commands 79 EnableErrorLogging Event Error Commands 99 En...

Page 191: ...oint Commands 63 Input Point Point Commands 63 Input Output type 171 Is AlarmAcknowledged Alarm Commands 80 IsAlarmActive Alarm Commands 80 Item 171 J Java Script See JScript Java Script Features 154...

Page 192: ...SetPLCMode 69 SetPLCPhoneNumber 69 UploadPLCProgram 70 PLC Memory Functions 146 PLCCommsFailed PLC Commands 68 PLCMonitor PLC Commands 68 Point 173 Point Arrays within Script Commands and Expressions...

Page 193: ...statements nesting 17 19 Control Statements 15 22 See also Control Statements Current object statement 38 Examples 133 Executable files use of 1 158 170 FALSE Boolean state 1 4 Logical functions 13 1...

Page 194: ...erature Controller Commands 71 TCGetStatusParameter Temperature Controller Commands 71 TCRemoteLocal Temperature Controller Commands 72 TCRequestStatus Temperature Controller Commands 73 TCReset Tempe...

Page 195: ...174 See VGA ViewReport Report Commands 91 Visible Object Commands 46 Visual Basic See VBScript VJM 171 W Width Object Commands 47 Windows Desktop 175 Windows Scripting Host 175 JScript 154 VBScript 3...

Reviews: