ge fanuc automation - infoplc · ge fanuc automation cimplicity® monitoring and control products...

of 534 /534
GE Fanuc Automation CIMPLICITY® Monitoring and Control Products CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283G July 2001

Author: trandan

Post on 18-Jul-2018

282 views

Category:

Documents


8 download

Embed Size (px)

TRANSCRIPT

  • GE Fanuc Automation

    CIMPLICITY Monitoring and Control Products

    CIMPLICITY HMI

    Basic Control EngineLanguage Reference Manual

    GFK-1283G July 2001

  • GFL-005Following is a list of documentation icons:

    Warning notices are used in this publication to emphasize that hazardous voltages,currents, temperatures, or other conditions that could cause personal injury exist inthe equipment or may be associated with its use.

    In situations where inattention could cause either personal injury or damage toequipment, a Warning notice is used.

    Caution provides information when careful attention must be taken in order to avoiddamaging results.

    Important flags important information.

    To do calls attention to a procedure.

    Note calls attention to information that is especially significant to understanding andoperating the equipment.

    Tip provides a suggestion.

    Guide provides additional directions for selected topics.

    This document is based on information available at the time of publication. While efforts have been made to be accurate,the information contained herein does not purport to cover all details or variations in hardware or software, not to providefor every possible contingency in connection with installation, operation, or maintenance. Features may be describedherein which are not present in all hardware and software systems. GE Fanuc Automation assumes no obligation ofnotice to holders of this document with respect to changes subsequently made.

    GE Fanuc Automation makes no representation of warranty, expressed, implied, or statutory with respect to, and assumesno responsibility for the accuracy, completeness, sufficiency, or usefulness of the information contained herein. Nowarranties of merchantability or fitness for purpose shall apply.

    CIMPLICITY is a registered trademark of GE Fanuc Automation North America, Inc.Windows, Windows NT, Windows 98 and Windows 2001 are registered trademarks of Microsoft Corporation

    This manual was produced using Doc-To-Help, by WexTech Systems, Inc.

    Copyright 1995-2001 GE Fanuc Automation North America, Inc.All rights reserved

  • GFK-1283G iii

    Preface

    Contents of this ManualChapter 1. Introduction: Gives a brief description of the Basic Control Enginelanguage syntax, and lists the language elements by category.

    Chapter 2. Symbols: Defines the symbols used by the Basic Control Enginelanguage.

    Chapter 3. A: Discusses language elements - Abs through Atn.

    Chapter 4. B: Discusses language elements - Basic.Capability through ByVal.

    Chapter 5. C: Discusses language elements - Call through CVErr.

    Chapter 6. D: Discusses language elements - Date through DropListBox.

    Chapter 7. E: Discusses language elements - ebAbort through Expression.

    Chapter 8. F: Discusses language elements - False through Fv.

    Chapter 9. G: Discusses language elements - Get through GroupBox.

    Chapter 10. H: Discusses language elements - Hex through Hour.

    Chapter 11. I: Discusses language elements - If..Then...Else through ItemCount.

    Chapter 12. K: Discusses language elements- Keywords through Kill.

    Chapter 13. L: Discusses language elements - LBound through LTrim$.

    Chapter 14. M: Discusses language elements - Main through MsgBox.

    Chapter 15. N: Discusses language elements - Name through Null.

    Chapter 16. O: Discusses language elements - Object through Or.

    Chapter 17. P: Discusses language elements - Pi through Pv.

    Chapter 18. R: Discusses language elements - Random through RTrim$.

    Chapter 19. S: Discusses language elements - SaveFilename$ through SYD.

    Chapter 20. T: Discusses language elements - Tab through Type.

    Chapter 21. U: Discusses language elements - UBound through User-DefinedTypes.

    Chapter 22. V: Discusses language elements - Val through VarType.

  • iv CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Chapter 23. W: Discusses language elements - Weekday through WriteIni.

    Chapter 24. X: Discusses language elements - Xor.

    Chapter 25. Y: Discusses language elements - Year.

    Chapter 26. CIMPLICITY Extensions to Basic: Discusses the CIMPLICITYextensions to the Basic Control Engine language - Acquire through TraceEnable.

    Related PublicationsFor more information, refer to these publications:

    CIMPLICITY MMI and MES/SCADA Products User Manual (GFK-1180)

    CIMPLICITY MMI and MES/SCADA Products Basic Control Engine ProgramEditor Operation Manual (GFK-1305)

    CIMPLICITY MMI and MES/SCADA Products Event Editor Operation Manual(GFK-1282)

  • GFK-1283G Contents-v

    Contents

    Introduction 1-1About the Basic Control Syntax ............................................................................................. 1-1Using the Basic Control Engine Language Reference............................................................ 1-2Language Elements By Category ........................................................................................... 1-3

    Arrays....................................................................................................................... 1-3Clipboard ................................................................................................................. 1-3Comments ................................................................................................................ 1-3Comparison operators .............................................................................................. 1-3Controlling other programs...................................................................................... 1-4Controlling program flow ........................................................................................ 1-4Controlling the operating environment .................................................................... 1-5Conversion ............................................................................................................... 1-5Data types ................................................................................................................ 1-6Database................................................................................................................... 1-6Date/time.................................................................................................................. 1-6DDE ......................................................................................................................... 1-7Error handling .......................................................................................................... 1-7File I/O..................................................................................................................... 1-8File system ............................................................................................................... 1-8Financial................................................................................................................... 1-9Getting information from Basic Control Engine ...................................................... 1-9INI Files ................................................................................................................. 1-10Logical/binary operators ........................................................................................ 1-10Math....................................................................................................................... 1-10Miscellaneous ........................................................................................................ 1-10Numeric operators.................................................................................................. 1-11Objects ................................................................................................................... 1-11Parsing ................................................................................................................... 1-11Predefined dialogs.................................................................................................. 1-11Printing .................................................................................................................. 1-12Procedures.............................................................................................................. 1-12String operators...................................................................................................... 1-12Strings .................................................................................................................... 1-12User dialogs ........................................................................................................... 1-13Variables and constants.......................................................................................... 1-14Variants.................................................................................................................. 1-14

  • Contents-vi CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Symbols 2-1& (operator)............................................................................................................................ 2-1' (keyword).............................................................................................................................. 2-1() (keyword)............................................................................................................................ 2-2* (operator)............................................................................................................................. 2-3+ (operator) ............................................................................................................................ 2-4- (operator) ............................................................................................................................. 2-5. (keyword) ............................................................................................................................. 2-6/ (operator).............................................................................................................................. 2-7< (operator) ............................................................................................................................ 2-7 (operator) ............................................................................................................................ 2-8>= (operator) .......................................................................................................................... 2-9\ (operator).............................................................................................................................. 2-9^ (operator)........................................................................................................................... 2-10_ (keyword) .......................................................................................................................... 2-11

    A 3-1Abs (function)......................................................................................................................... 3-1And (operator) ........................................................................................................................ 3-2AnswerBox (function) ............................................................................................................ 3-3Any (data type) ....................................................................................................................... 3-4AppActivate (statement)......................................................................................................... 3-5AppClose (statement) ............................................................................................................. 3-6AppFind$ (function)............................................................................................................... 3-7AppGetActive$ (function)...................................................................................................... 3-7AppGetPosition (statement) ................................................................................................... 3-8AppGetState (function) .......................................................................................................... 3-9AppHide (statement) ............................................................................................................ 3-10AppList (statement) .............................................................................................................. 3-11AppMaximize (statement) .................................................................................................... 3-12AppMinimize (statement)..................................................................................................... 3-13AppMove (statement)........................................................................................................... 3-14AppRestore (statement) ........................................................................................................ 3-15AppSetState (statement) ....................................................................................................... 3-16AppShow (statement) ........................................................................................................... 3-17AppSize (statement) ............................................................................................................. 3-18AppType (function) .............................................................................................................. 3-19ArrayDims (function) ........................................................................................................... 3-20Arrays (topic) ....................................................................................................................... 3-21ArraySort (statement) ........................................................................................................... 3-23Asc (function)....................................................................................................................... 3-23AskBox$ (function) .............................................................................................................. 3-24AskPassword$ (function) ..................................................................................................... 3-25Atn (function) ....................................................................................................................... 3-26

  • GFK-1283G Contents Contents-vii

    B 4-1Basic.Capability (method)...................................................................................................... 4-1Basic.Eoln$ (property) ........................................................................................................... 4-2Basic.FreeMemory (property) ................................................................................................ 4-2Basic.HomeDir$ (property).................................................................................................... 4-2Basic.OS (property)................................................................................................................ 4-3Basic.PathSeparator$ (property) ............................................................................................ 4-3Basic.Version$ (property) ...................................................................................................... 4-4Beep (statement)..................................................................................................................... 4-4Begin Dialog (statement)........................................................................................................ 4-5Boolean (data type) ................................................................................................................ 4-7ByRef (keyword).................................................................................................................... 4-7ByVal (keyword).................................................................................................................... 4-8

    C 5-1Call (statement) ...................................................................................................................... 5-1CancelButton (statement) ....................................................................................................... 5-2CBool (function) .................................................................................................................... 5-3CCur (function) ...................................................................................................................... 5-4CDate, CVDate (functions) .................................................................................................... 5-5CDbl (function) ...................................................................................................................... 5-6ChDir (statement) ................................................................................................................... 5-6ChDrive (statement) ............................................................................................................... 5-7CheckBox (statement) ............................................................................................................ 5-8Choose (function)................................................................................................................... 5-9Chr, Chr$ (functions) ........................................................................................................... 5-10CInt (function)...................................................................................................................... 5-11Clipboard$ (function)........................................................................................................... 5-12Clipboard$ (statement)......................................................................................................... 5-12Clipboard.Clear (method)..................................................................................................... 5-13Clipboard.GetFormat (method) ............................................................................................ 5-13Clipboard.GetText (method) ................................................................................................ 5-14Clipboard.SetText (method)................................................................................................. 5-14CLng (function).................................................................................................................... 5-15Close (statement).................................................................................................................. 5-15ComboBox (statement)......................................................................................................... 5-16Command, Command$ (functions)....................................................................................... 5-17Comments (topic) ................................................................................................................. 5-17Comparison Operators (topic) .............................................................................................. 5-18Const (statement).................................................................................................................. 5-20Constants (topic) .................................................................................................................. 5-22Cos (function)....................................................................................................................... 5-23CreateObject (function)........................................................................................................ 5-23CSng (function) .................................................................................................................... 5-25CStr (function) ..................................................................................................................... 5-26CurDir, CurDir$ (functions)................................................................................................. 5-27Currency (data type)............................................................................................................. 5-27CVar (function) .................................................................................................................... 5-28CVErr (function) .................................................................................................................. 5-29

  • Contents-viii CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    D 6-1Date (data type) ...................................................................................................................... 6-1Date, Date$ (functions) .......................................................................................................... 6-2Date, Date$ (statements) ........................................................................................................ 6-3DateAdd (function)................................................................................................................. 6-4DateDiff (function)................................................................................................................. 6-6DatePart (function) ................................................................................................................. 6-7DateSerial (function) .............................................................................................................. 6-8DateValue (function) .............................................................................................................. 6-9Day (function) ........................................................................................................................ 6-9DDB (function) .................................................................................................................... 6-10DDEExecute (statement) ...................................................................................................... 6-11DDEInitiate (function).......................................................................................................... 6-12DDEPoke (statement)........................................................................................................... 6-13DDERequest, DDERequest$ (functions).............................................................................. 6-14DDESend (statement)........................................................................................................... 6-15DDETerminate (statement)................................................................................................... 6-16DDETerminateAll (statement).............................................................................................. 6-17DDETimeout (statement) ..................................................................................................... 6-18Declare (statement)............................................................................................................... 6-19DefType (statement)............................................................................................................. 6-25Dialog (function) .................................................................................................................. 6-27Dialog (statement) ................................................................................................................ 6-28Dim (statement) .................................................................................................................... 6-29Dir, Dir$ (functions)............................................................................................................. 6-31DiskDrives (statement) ......................................................................................................... 6-33DiskFree (function) .............................................................................................................. 6-33DlgControlId (function)........................................................................................................ 6-34DlgEnable (function) ............................................................................................................ 6-35DlgEnable (statement) .......................................................................................................... 6-36DlgFocus (function).............................................................................................................. 6-37DlgFocus (statement)............................................................................................................ 6-38DlgListBoxArray (function) ................................................................................................. 6-39DlgListBoxArray (statement) ............................................................................................... 6-40DlgProc (function)................................................................................................................ 6-41DlgSetPicture (statement)..................................................................................................... 6-44DlgText (statement).............................................................................................................. 6-45DlgText$ (function).............................................................................................................. 6-46DlgValue (function).............................................................................................................. 6-48DlgValue (statement)............................................................................................................ 6-49DlgVisible (function)............................................................................................................ 6-50DlgVisible (statement).......................................................................................................... 6-51Do...Loop (statement)........................................................................................................... 6-53DoEvents (function) ............................................................................................................. 6-55DoEvents (statement) ........................................................................................................... 6-55Double (data type) ................................................................................................................ 6-56DropListBox (statement) ...................................................................................................... 6-57

  • GFK-1283G Contents Contents-ix

    E 7-1ebAbort (constant).................................................................................................................. 7-1ebAbortRetryIgnore (constant)............................................................................................... 7-1ebApplicationModal (constant).............................................................................................. 7-2ebArchive (constant) .............................................................................................................. 7-2ebBold (constant) ................................................................................................................... 7-2ebBoldItalic (constant) ........................................................................................................... 7-3ebBoolean (constant).............................................................................................................. 7-3ebCancel (constant) ................................................................................................................ 7-3ebCritical (constant) ............................................................................................................... 7-4ebCurrency (constant) ............................................................................................................ 7-4ebDataObject (constant)......................................................................................................... 7-4ebError (constant) .................................................................................................................. 7-5ebDate (constant) ................................................................................................................... 7-5ebDefaultButton1 (constant) .................................................................................................. 7-6ebDefaultButton2 (constant) .................................................................................................. 7-6ebDefaultButton3 (constant) .................................................................................................. 7-6ebDirectory (constant)............................................................................................................ 7-7ebDos (constant)..................................................................................................................... 7-7ebDouble (constant) ............................................................................................................... 7-8ebEmpty (constant) ................................................................................................................ 7-8ebExclamation (constant) ....................................................................................................... 7-8ebHidden (constant) ............................................................................................................... 7-9ebIgnore (constant)................................................................................................................. 7-9ebInformation (constant) ...................................................................................................... 7-10ebInteger (constant).............................................................................................................. 7-10ebItalic (constant)................................................................................................................. 7-11ebLong (constant)................................................................................................................. 7-11ebNo (constant) .................................................................................................................... 7-11ebNone (constant) ................................................................................................................ 7-12ebNormal (constant)............................................................................................................. 7-12ebNull (constant) .................................................................................................................. 7-13ebObject (constant) .............................................................................................................. 7-13ebOK (constant) ................................................................................................................... 7-13ebOKCancel (constant) ........................................................................................................ 7-14ebOKOnly (constant) ........................................................................................................... 7-14ebQuestion (constant)........................................................................................................... 7-14ebReadOnly (constant) ......................................................................................................... 7-15ebRegular (constant) ............................................................................................................ 7-15ebRetry (constant) ................................................................................................................ 7-16ebRetryCancel (constant) ..................................................................................................... 7-16ebSingle (constant)............................................................................................................... 7-17ebString (constant) ............................................................................................................... 7-17ebSystem (constant) ............................................................................................................. 7-18ebSystemModal (constant) ................................................................................................... 7-18ebVariant (constant) ............................................................................................................. 7-18ebVolume (constant) ............................................................................................................ 7-19ebWin32 (constant) .............................................................................................................. 7-19ebYes (constant)................................................................................................................... 7-20ebYesNo (constant) .............................................................................................................. 7-20ebYesNoCancel (constant) ................................................................................................... 7-20Empty (constant) .................................................................................................................. 7-21End (statement) .................................................................................................................... 7-21

  • Contents-x CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Environ, Environ$ (functions) .............................................................................................. 7-22EOF (function) ..................................................................................................................... 7-23Eqv (operator) ...................................................................................................................... 7-24Erase (statement) .................................................................................................................. 7-25Erl (function) ........................................................................................................................ 7-26Err (function)........................................................................................................................ 7-27Err (statement)...................................................................................................................... 7-28Error (statement) .................................................................................................................. 7-29Error Handling (topic) .......................................................................................................... 7-30Error, Error$ (functions) ...................................................................................................... 7-31Exit Do (statement) .............................................................................................................. 7-32Exit For (statement).............................................................................................................. 7-33Exit Function (statement) ..................................................................................................... 7-33Exit Sub (statement) ............................................................................................................. 7-34Exp (function) ...................................................................................................................... 7-34Expression Evaluation (topic) .............................................................................................. 7-35

    F 8-1False (constant) ...................................................................................................................... 8-1FileAttr (function) .................................................................................................................. 8-2FileCopy (statement) .............................................................................................................. 8-3FileDateTime (function) ......................................................................................................... 8-4FileDirs (statement) ................................................................................................................ 8-5FileExists (function) ............................................................................................................... 8-6FileLen (function)................................................................................................................... 8-6FileList (statement)................................................................................................................. 8-7FileParse$ (function) .............................................................................................................. 8-9Fix (function)........................................................................................................................ 8-10For...Next (statement)........................................................................................................... 8-11Format, Format$ (functions)................................................................................................. 8-13FreeFile (function)............................................................................................................... 8-18Function...End Function (statement)..................................................................................... 8-18Fv (function)......................................................................................................................... 8-22

    G 9-1Get (statement) ....................................................................................................................... 9-1GetAttr (function)................................................................................................................... 9-4GetObject (function)............................................................................................................... 9-5Global (statement) .................................................................................................................. 9-6GoSub (statement) .................................................................................................................. 9-6Goto (statement) ..................................................................................................................... 9-7GroupBox (statement) ............................................................................................................ 9-8

    H 10-1Hex, Hex$ (functions) .......................................................................................................... 10-1HLine (statement)................................................................................................................. 10-2Hour (function)..................................................................................................................... 10-2HPage (statement) ................................................................................................................ 10-3HScroll (statement)............................................................................................................... 10-3HWND (object).................................................................................................................... 10-4HWND.Value (property)...................................................................................................... 10-5

  • GFK-1283G Contents Contents-xi

    I 11-1If...Then...Else (statement) ................................................................................................... 11-1IIf (function)......................................................................................................................... 11-2Imp (operator) ...................................................................................................................... 11-3Inline (statement).................................................................................................................. 11-4Input# (statement) ................................................................................................................ 11-4Input, Input$ (functions)....................................................................................................... 11-7InputBox, InputBox$ (functions) ......................................................................................... 11-8InStr (function)..................................................................................................................... 11-9Int (function) ...................................................................................................................... 11-10Integer (data type) .............................................................................................................. 11-10IPmt (function) ................................................................................................................... 11-11IRR (function) .................................................................................................................... 11-13Is (operator)........................................................................................................................ 11-14IsDate (function) ................................................................................................................ 11-15IsEmpty (function) ............................................................................................................. 11-15IsError (function) ............................................................................................................... 11-16IsMissing (function) ........................................................................................................... 11-17IsNull (function)................................................................................................................. 11-17IsNumeric (function) .......................................................................................................... 11-18IsObject (function) ............................................................................................................. 11-19Item$ (function).................................................................................................................. 11-20ItemCount (function) .......................................................................................................... 11-21

    K 12-1Keywords (topic).................................................................................................................. 12-1Kill (statement)..................................................................................................................... 12-2

    L 13-1LBound (function)................................................................................................................ 13-1LCase, LCase$ (functions) ................................................................................................... 13-2Left, Left$ (functions) .......................................................................................................... 13-2Len (function)....................................................................................................................... 13-3Let (statement)...................................................................................................................... 13-4Like (operator) ..................................................................................................................... 13-5Line Input# (statement) ........................................................................................................ 13-6Line Numbers (topic) ........................................................................................................... 13-6Line$ (function).................................................................................................................... 13-7LineCount (function) ............................................................................................................ 13-8ListBox (statement) .............................................................................................................. 13-9Literals (topic).................................................................................................................... 13-11Loc (function)..................................................................................................................... 13-12Lock (statement)................................................................................................................. 13-13Lof (function) ..................................................................................................................... 13-15Log (function) .................................................................................................................... 13-15Long (data type) ................................................................................................................. 13-16LSet (statement) ................................................................................................................. 13-17LTrim, LTrim$ (functions)................................................................................................. 13-18

  • Contents-xii CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    M 14-1Main (statement)................................................................................................................... 14-1MCI (function) ..................................................................................................................... 14-2Mid, Mid$ (functions) .......................................................................................................... 14-4Mid, Mid$ (statements) ........................................................................................................ 14-5Minute (function) ................................................................................................................. 14-6MIRR (function)................................................................................................................... 14-6MkDir (statement) ................................................................................................................ 14-7Mod (operator) ..................................................................................................................... 14-8Month (function) .................................................................................................................. 14-8MsgBox (function) ............................................................................................................... 14-9MsgBox (statement) ........................................................................................................... 14-11Msg.Close (method) ........................................................................................................... 14-11Msg.Open (method)............................................................................................................ 14-12Msg.Text (property) ........................................................................................................... 14-13Msg.Thermometer (property) ............................................................................................. 14-14

    N 15-1Name (statement).................................................................................................................. 15-1Named Parameters (topic) .................................................................................................... 15-2Net.AddCon (method) .......................................................................................................... 15-3Net.Browse$ (method) ......................................................................................................... 15-4Net.CancelCon (method) ...................................................................................................... 15-5Net.GetCon$ (method) ......................................................................................................... 15-6Net.User$ (property) ............................................................................................................ 15-6New (keyword)..................................................................................................................... 15-7Not (operator)....................................................................................................................... 15-8Nothing (constant) ................................................................................................................ 15-9Now (function) ..................................................................................................................... 15-9NPer (function)................................................................................................................... 15-10Npv (function) .................................................................................................................... 15-11Null (constant).................................................................................................................... 15-12

    O 16-1Object (data type) ................................................................................................................. 16-1Objects (topic)...................................................................................................................... 16-2Oct, Oct$ (functions) ............................................................................................................ 16-5OKButton (statement) .......................................................................................................... 16-6On Error (statement)............................................................................................................. 16-7Open (statement) .................................................................................................................. 16-9OpenFilename$ (function).................................................................................................. 16-11Operator Precedence (topic)............................................................................................... 16-12Operator Precision (topic) .................................................................................................. 16-13Option Base (statement) ..................................................................................................... 16-13Option Compare (statement) .............................................................................................. 16-14Option CStrings (statement) ............................................................................................... 16-15OptionButton (statement) ................................................................................................... 16-16OptionGroup (statement).................................................................................................... 16-17Or (operator) ...................................................................................................................... 16-18

  • GFK-1283G Contents Contents-xiii

    P 17-1Pi (constant) ......................................................................................................................... 17-1Picture (statement)................................................................................................................ 17-2PictureButton (statement)..................................................................................................... 17-4Pmt (function) ...................................................................................................................... 17-6PopupMenu (function) ......................................................................................................... 17-7PPmt (function) .................................................................................................................... 17-8Print (statement) ................................................................................................................... 17-9Print# (statement) ............................................................................................................... 17-10Private (statement).............................................................................................................. 17-12Public (statement)............................................................................................................... 17-14PushButton (statement) ...................................................................................................... 17-16Put (statement) ................................................................................................................... 17-17Pv (function)....................................................................................................................... 17-19

    R 18-1Random (function) ............................................................................................................... 18-1Randomize (statement)......................................................................................................... 18-2Rate (function) ..................................................................................................................... 18-3ReadIni$ (function) .............................................................................................................. 18-4ReadIniSection (statement) .................................................................................................. 18-5Redim (statement) ................................................................................................................ 18-6Rem (statement) ................................................................................................................... 18-7Reset (statement) .................................................................................................................. 18-7Resume (statement) .............................................................................................................. 18-8Return (statement) ................................................................................................................ 18-9Right, Right$ (functions)...................................................................................................... 18-9RmDir (statement).............................................................................................................. 18-10Rnd (function) .................................................................................................................... 18-11RSet (statement) ................................................................................................................. 18-12RTrim, RTrim$ (functions) ................................................................................................ 18-13

    S 19-1SaveFilename$ (function) .................................................................................................... 19-1Screen.DlgBaseUnitsX (property)........................................................................................ 19-3Screen.DlgBaseUnitsY (property)........................................................................................ 19-3Screen.Height (property) ...................................................................................................... 19-4Screen.TwipsPerPixelX (property) ...................................................................................... 19-4Screen.TwipsPerPixelY (property) ...................................................................................... 19-5Screen.Width (property)....................................................................................................... 19-5Second (function) ................................................................................................................. 19-6Seek (function) ..................................................................................................................... 19-7Seek (statement) ................................................................................................................... 19-8Select...Case (statement) ...................................................................................................... 19-9SelectBox (function) .......................................................................................................... 19-11SendKeys (statement)......................................................................................................... 19-12Set (statement).................................................................................................................... 19-15SetAttr (statement) ............................................................................................................. 19-16Sgn (function)..................................................................................................................... 19-17Shell (function)................................................................................................................... 19-18Sin (function) ..................................................................................................................... 19-19

  • Contents-xiv CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Single (data type)................................................................................................................ 19-19Sleep (statement) ................................................................................................................ 19-20Sln (function)...................................................................................................................... 19-20Space, Space$ (functions) .................................................................................................. 19-21Spc (function) ..................................................................................................................... 19-21SQLBind (function)............................................................................................................ 19-22SQLClose (function) .......................................................................................................... 19-23SQLError (function) ........................................................................................................... 19-24SQLExecQuery (function).................................................................................................. 19-25SQLGetSchema (function) ................................................................................................. 19-26SQLOpen (function)........................................................................................................... 19-29SQLQueryTimeout (statement) .......................................................................................... 19-30SQLRequest (function)....................................................................................................... 19-30SQLRetrieve (function) ...................................................................................................... 19-32SQLRetrieveToFile (function) ........................................................................................... 19-34Sqr (function) ..................................................................................................................... 19-35Stop (statement).................................................................................................................. 19-35Str, Str$ (functions) ............................................................................................................ 19-36StrComp (function)............................................................................................................. 19-36String (data type) ................................................................................................................ 19-38String, String$ (functions) .................................................................................................. 19-39Sub...End Sub (statement) .................................................................................................. 19-40Switch (function) ................................................................................................................ 19-42SYD (function) ................................................................................................................... 19-43System.Exit (method) ......................................................................................................... 19-44System.FreeMemory (property) ......................................................................................... 19-44System.FreeResources (property)....................................................................................... 19-45System.MouseTrails (method)............................................................................................ 19-45System.Restart (method) .................................................................................................... 19-45System.TotalMemory (property) ........................................................................................ 19-46System.WindowsDirectory$ (property).............................................................................. 19-46System.WindowsVersion$ (property) ................................................................................ 19-46

    T 20-1Tab (function)....................................................................................................................... 20-1Tan (function)....................................................................................................................... 20-2Text (statement).................................................................................................................... 20-2TextBox (statement) ............................................................................................................. 20-3Time, Time$ (functions)....................................................................................................... 20-5Time, Time$ (statements)..................................................................................................... 20-6Timer (function) ................................................................................................................... 20-6TimeSerial (function) ........................................................................................................... 20-7TimeValue (function) ........................................................................................................... 20-7Trim, Trim$ (functions)........................................................................................................ 20-8True (constant) ..................................................................................................................... 20-8Type (statement)................................................................................................................... 20-9

  • GFK-1283G Contents Contents-xv

    U 21-1UBound (function) ............................................................................................................... 21-1UCase, UCase$ (functions) .................................................................................................. 21-2Unlock (statement) ............................................................................................................... 21-2User-Defined Types (topic).................................................................................................. 21-4

    V 22-1Val (function) ....................................................................................................................... 22-1Variant (data type)................................................................................................................ 22-2VarType (function)............................................................................................................... 22-5VLine (statement)................................................................................................................. 22-6VPage (statement) ................................................................................................................ 22-6VScroll (statement) .............................................................................................................. 22-7

    W 23-1Weekday (function).............................................................................................................. 23-1While...Wend (statement)..................................................................................................... 23-2Width# (statement)............................................................................................................... 23-3WinActivate (statement)....................................................................................................... 23-4WinClose (statement) ........................................................................................................... 23-5WinFind (function)............................................................................................................... 23-6WinList (statement).............................................................................................................. 23-6WinMaximize (statement) .................................................................................................... 23-7WinMinimize (statement)..................................................................................................... 23-8WinMove (statement)........................................................................................................... 23-9WinRestore (statement)...................................................................................................... 23-10WinSize (statement) ........................................................................................................... 23-11Word$ (function)................................................................................................................ 23-12WordCount (function) ........................................................................................................ 23-12Write# (statement).............................................................................................................. 23-13WriteIni (statement) ........................................................................................................... 23-14

    X 24-1X or (operator) ..................................................................................................................... 24-1

    Y 25-1Year (function) ..................................................................................................................... 25-1

    CIMPLICITY Extensions to Basic 26-1Acquire (Function) ............................................................................................................... 26-1Acquire, Release (Statements).............................................................................................. 26-2AlarmGenerate (Method) ..................................................................................................... 26-4AlarmUpdate (Method) ........................................................................................................ 26-6ChangePassword (Method) .................................................................................................. 26-7CimEMAlarmEvent (Object) ............................................................................................... 26-8CimEMAlarmEvent.AlarmID (Property, Read) ................................................................... 26-8CimEMAlarmEvent.FinalState (Property, Read) ................................................................. 26-9CimEMAlarmEvent.GenTime (Property, Read) .................................................................. 26-9CimEMAlarmEvent.Message (Property, Read) ................................................................. 26-10

  • Contents-xvi CIMPLICITY Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    CimEMAlarmEvent.PrevState (Property, Read) ................................................................ 26-10CimEMAlarmEvent.RefID (Property, Read) ..................................................................... 26-11CimEMAlarmEvent.ReqAction (Property, Read) .............................................................. 26-11CimEMAlarmEvent.ResourceID (Property, Read) ............................................................ 26-11CimEMEvent (Object) ....................................................................................................... 26-12CimEMEvent.ActionID (Property, Read) .......................................................................... 26-12CimEMEvent.AlarmEvent (Function) ................................................................................ 26-12CimEMEvent.EventID (Property, Read) ............................................................................ 26-13CimEMEvent.ObjectID (Property, Read) .......................................................................... 26-13CimEMEvent.PointEvent ................................................................................................... 26-13CimEMEvent.TimeStamp (Property, Read) ....................................................................... 26-14CimEMEvent.Type (Property, Read) ................................................................................. 26-14CimEMPointEvent (Object) ............................................................................................... 26-15CimEMPointEvent.Id ......................................................................................................... 26-15CimEmPointEvent.Quality (Property, Read)...................................................................... 26-16CimEmPointEvent.QualityAlarmed (Property, Read) ........................................................ 26-16CimEmPointEvent.QualityAlarms_Enabled (Property, Read) ........................................... 26-16CimEmPointEvent.QualityDisable_Write (Property, Read)............................................... 26-17CimEmPointEvent.QualityIs_Available (Property, Read) ................................................. 26-17CimEmPointEvent.QualityIs_In_Range (Property, Read) ................................................. 26-17CimEmPointEvent.QualityLast_Upd_Man (Property, Read)............................................. 26-18CimEmPointEvent.QualityManual_Mode (Property, Read) .............................................. 26-18CimEmPointEvent.QualityStale_Data (Property, Read) .................................................... 26-18CimEMPointEvent.State (Property, Read) ......................................................................... 26-19CimEMPointEvent.TimeStamp (Property, Read................................................................ 26-19CimEmPointEvent.UserFlags (Property, Read}................................................................. 26-19CimEMPointEvent.Value (Property, Read) ....................................................................... 26-20CimGetEMEvent (Function) .............................................................................................. 26-20CimIsMaster (Function) ..................................................................................................... 26-20CimLogin (Procedure)........................................................................................................ 26-21CimLogout (Procedure)...................................................................................................... 26-21CimProjectData (Object).................................................................................................... 26-22CimProjectData.Project (Property, Read/Write) ................................................................ 26-22CimProjectData.Entity (Property, Read/Write) .................................................................. 26-23CimProjectData.Attributes (Property, Read/Write)............................................................ 26-28CimProjectData.Filters (Property, Read/Write) ................................................................. 26-28CimProjectData.GetNext (Function) .................................................................................. 26-29CimProjectData.Reset (Method) ........................................................................................ 26-30GetKey (Function).............................................................................................................. 26-30GetSystemWindowsDirectory (Function)........................................................................... 26-30GetTSSessionId (Function) ................................................................................................ 26-31IsTerminalServices (Function) ........................................................................................... 26-31LogStatus (Property, Read/Write) ...................................................................................... 26-32Point (Subject).................................................................................................................... 26-33Point (Object) ..................................................................................................................... 26-36Point.AlarmAck (Property, Read) ...................................................................................... 26-36Point.Cancel (Method) ....................................................................................................... 26-37Point.DataType (Property, Read) ....................................................................................... 26-37Point.DisplayFormat (Property, Read) ............................................................................... 26-38Point.DownloadPassword (Property, Read) ....................................................................... 26-38Point.Elements (Property, Read) ........................................................................................ 26-39Point.EnableAlarm (Method) ............................................................................................. 26-39Point.Enabled (Property, Read).......................................................................................... 26-39Point.EuLabel (Property, Read) ......................................................................................... 26-40Point.Get (Method)............................................................................................................. 26-40

  • GFK-1283G Contents Contents-xvii

    Point.GetArray (Method) ................................................................................................... 26-41Point.GetNext (Function) ................................................................................................... 26-42Point.GetNext (Method)..................................................................................................... 26-42Point.GetRawArray (Method) ............................................................................................ 26-43Point.GetValue (Property, Read) ....................................................................................... 26-44Point.HasEuConv (Property, Read).................................................................................... 26-44Point.Id (Property, Read/Write) ......................................................................................... 26-45Point.InUserView (Property, Read) ................................................................................... 26-45Point.Length (Property, Read)............................................................................................ 26-46Point.OnAlarm (Method) ................................................................................................... 26-46Point.OnAlarmAck (Method)............................................................................................. 26-47Point.OnChange (Method) ................................................................................................. 26-48Point.OnTimed (Method) ................................................................................................... 26-49Point.PointTypeId (Property, Read)................................................................................... 26-49Point.Quality (Property, Read)........................................................................................... 26-50Point.QualityAlarmed (Property, Read) ............................................................................. 26-50Point.QualityAlarms_Enabled (Property, Read) ................................................................ 26-50Point.QualityDisable_Write (Property, Read).................................................................... 26-51Point.QualityIs_Available (Property, Read)....................................................................... 26-51Point.QualityIs_In_Range (Property, Read)....................................................................... 26-51Point.QualityLast_Upd_Man (Property, Read) .................................................................. 26-52Point.QualityManual_Mode (Property, Read).................................................................... 26-52Point.QualityStale_Data (Property, Read) ......................................................................... 26-53Point.RawValue (Property, Read/Write) ............................................................................ 26-53Point.ReadOnly (Property, Read)....................................................................................... 26-54Point.Set (Method) ............................................................................................................. 26-55Point.SetArray (Method) .................................................................................................... 26-56Point.SetElement (Method) ................................................................................................ 26-57Point.SetpointPriv (Property, Read)................................................................................... 26-57Point.SetRawArray (Method)............................................................................................. 26-58Point.SetValue (Property, Write) ....................................................................................... 26-59Point.State (Property, Read)............................................................................................... 26-60Point.TimeStamp (Property, Read) .................................................................................... 26-61Point.UserFlags (Property, Read)....................................................................................... 26-61Point.Value (Property, Read/Write) ................................................................................... 26-62PointGet (Function)............................................................................................................ 26-63PointGetMultiple (Function) .............................................................................................. 26-63PointGetNext (Function) .................................................................................................... 26-64PointSet (Statement)........................................................................................................... 26-65Trace (Command) .............................................................................................................. 26-65TraceEnable/TraceDisable (Command) ............................................................................. 26-66

    Index i

  • GFK-1283G 1-1

    Introduction

    About the Basic Control SyntaxThis chapter contains a complete, alphabetical listing of all keywords in the BasicControl Engine script language. When syntax is described, the following notationsare used:

    Notation DescriptionWhile...Wend Elements belonging to the Basic Control Engine script

    language, referred to in this manual as keywords, appear inthe typeface shown to the left.

    variable Items that are to be replaced with information that yousupply appear in italics. The type of replacement is indicatedin the following description.

    text$ The presence of a type-declaration character following aparameter signifies that the parameter must be a variable ofthat type or an expression that evaluates to that type.

    If a parameter does not appear with a type-declarationcharacter, then its type is described in the text.

    [parameter] Square brackets indicate that the enclosed items areoptional.

    In Basic Control Engine script language, you cannot end astatement with a comma, even if the parameters are optional:

    MsgBox "Hello",,"Message" '

  • 1-2 CIMPLICITY HMI Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Using the Basic Control Engine Language ReferenceThe Reference chapter is organized like a dictionary containing an entry for eachlanguage element. The language elements are categorized as follows:

    Category Descriptiondata type Any of the support data types, such as Integer, String, and

    so on.

    function Language element that takes zero or more parameters, performsan action, and returns a value

    keyword Language element that doesn't fit into any of the other categories

    operator Language elements that cause an evaluation to be performedeither on one or two operands

    statement Language element that takes zero or more parameters andperforms an action.

    topic Describes information about a topic rather than a languageelement

    Each entry in the Reference chapter contains the following headings:

    Heading DescriptionSyntax The syntax of the language element. The conventions used in

    describing the syntax are described in Chapter 1.

    Description Contains a one-line description of that language element.

    Comments Contains any other important information about that languagekeyword.

    Example Contains an example of that language keyword in use. Anexample is provided for every language keyword.

    See Also Contains a list of other entries in the Reference section thatrelate either directly or indirectly to that language element.

  • GFK-1283G Introduction 1-3

    Language Elements By CategoryThe following subsections list Basic Control Engine language elements by category.

    ArraysArrayDims Return the number of dimensions of an array

    ArraySort Sort an array

    Erase Erase the elements in one or more arrays

    LBound Return the lower bound of a given array dimension

    Option Base Change the default lower bound for array declarations

    ReDim Re-establish the dimensions of an array

    UBound Return the upper bound of a dimension of an array

    ClipboardClipboard$ (function) Return the content of the clipboard as a string

    Clipboard$ (statement) Set the content of the clipboard

    Clipboard.Clear Clear the clipboard

    Clipboard.GetFormat Get the type of data stored in the clipboard

    Clipboard.GetText Get text from the clipboard

    Clipboard.SetText Set the content of the clipboard to text

    Comments' Comment to end-of-line

    REM Add a comment

    Comparison operators< Less than

    Greater than

    >= Greater than or equal to

  • 1-4 CIMPLICITY HMI Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Controlling other programsAppActivate Activate an application

    AppClose Close an application

    AppFind Return the full name of an application

    AppGetActive$ Return the name of the active application

    AppGetPosition Get the position and size of an application

    AppGetState Get the window state of an application

    AppHide Hide an application

    AppList Fill an array with a list of running applications

    AppMaximize Maximize an application

    AppMinimize Minimize an application

    AppMove Move an application

    AppRestore Restore an application

    AppSetState Set the state of an application's window

    AppShow Show an application

    AppSize Change the size of an application

    AppType Return the type of an application

    SendKeys Send keystrokes to another application

    Shell Execute another application

    Controlling program flowCall Call a subroutine

    Choose Return a value at a given index

    Do...Loop Execute a group of statements repeatedly

    DoEvents (function) Yield control to other applications

    DoEvents (statement) Yield control to other applications

    End Stop execution of a script

    Exit Do Exit a Do loop

    Exit For Exit a For loop

    For...Next Repeat a block of statement a specified number oftimes

    GoSub Execute at a specific label, allowing control to returnlater

    Goto Execute at a specific label

    If...Then...Else Conditionally execute one or more statements

    IIf Return one of two values depending on a condition

  • GFK-1283G Introduction 1-5

    Main Define a subroutine where execution begins

    Return Continue execution after the most recent GoSub

    Select...Case Execute one of a series of statements

    Sleep Pause for a specified number of milliseconds

    Stop Suspend execution, returning to a debugger (ifpresent)

    Switch Return one of a series of expressions depending on acondition

    While...Wend Repeat a group of statements while a condition is True

    Controlling the operating environmentCommand, Command$ Return the command line

    Environm Environ$ Return a string from the environment

    ConversionAsc Return the value of a character

    CBool Convert a value to a Boolean

    CCur Convert a value to Currency

    CDate Convert a value to a Date

    CDbl Convert a value to a Double

    Chr, Chr$ Convert a character value to a string

    CInt Convert a value to an Integer

    CLng Convert a value to a Long

    CSng Convert a value to a Single

    CStr Convert a value to a String

    CVar Convert a value to a Variant

    CVDate Convert a value to a Date

    CVErr Convert a value to an error

    Hex, Hex$ Convert a number to a hexadecimal string

    IsDate Determine if an expression is convertible to a date

    IsError Determine if a variant contains a user-defined errorvalue

    IsNumeric Determine if an expression is convertible to a number

    Oct, Oct$ Convert a number to an octal string

    Str, Str$ Convert a number to a string

    Val Convert a string to a number

  • 1-6 CIMPLICITY HMI Basic Control Engine Language Reference ManualJuly 2001 GFK-1283G

    Data typesBoolean Data type representing True of False values

    Currency Data type used to hold monitary values

    Date Data type used to hold dates and times

    Double Data type used to hold real number with 15-16 digitsof precision

    HWND Data type used to hold windows

    Integer Data type used to hold whole numbers with 4 digits ofprecision

    Long Data type used to hold whole numbers with 10 digitsof precision

    Object Data type used to hold OLE automation objects

    Single Data type used to hold real number with 7 digits ofprecision

    String Data type used to hold sequences of characters

    Variant Data type that holds a number, string, or OLEautomation objects

    DatabaseSQLBind Specify where to place results with SQLRetrieve

    SQLClose Close a connection to a database

    SQLError Return error information when an SQL function fails

    SQLExecQuery Execute a query on a database

    SQLGetSchema Return information about the structure of a database

    SQLOpen Establishes a connection with a database

    SQLRequest Run a query on a database

    SQLRetrieve Retrieve all or part of a query

    SQLRetrieve