© 2005 ESA Technology
SOFTWARE MANUAL
Supports Winbuild 5000 Version 2.0+
p/n 50-00222-01 Rev 1.8 8 Feb. 2005
Winbuild 5000Introduction
WinBuild 5000, ESA Technology's configuration softwarepackage, was developed to program the 5000 Family in aWindows® environment. Use it to create your operatorinterface and program your ESA Tech ET5000LX FamilyHMI. WinBuild 5000 is flexible and easy to use.
Choose your connected device from simple pull downmenus, associate tags with your registers, and the rest iseasy!
The interface builder closely models Visual Basic--you canuse easy macro codes to associate with certain terms oractions with objects on screen. Customize yourapplication!
- Construct your smart HMI.- Connect devices together.- Control application with code.- Communicate to devices easily
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic,electronic, or mechanical, including photocopying, recording, taping, or information storage andretrieval systems - without the written permission of the publisher.
Products that are referred to in this document may be either trademarks and/or registered trademarksof the respective owners. The publisher and the author make no claim to these trademarks.
While every precaution has been taken in the preparation of this document, the publisher and theauthor assume no responsibility for errors or omissions, or for damages resulting from the use ofinformation contained in this document or from the use of programs and source code that mayaccompany it. In no event shall the publisher and the author be liable for any loss of profit or any othercommercial damage caused or alleged to have been caused directly or indirectly by this document.
Printed: February 2005 in Windsor, CA 95492 USA
Winbuild 5000
© 2005 ESA Technology
Publisher
Technical Editors
ESA Technology Inc
Brian Jaeger
Alex Pavloff
Paul Eason
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Table of ContentsSoftware that lets you construct, connect, control and communicate.
0
Part I
Getting Started 12
..... 14Ethernet Setup .....
..... 16Unit Congfiguration .......... 17System Information .....
..... 17Touchscreen Calibration .....
..... 18System Password .....
..... 18Networking Configuration .....
..... 19System Date .....
..... 19System Time .....
Part II
Using Winbuild 5000 21
..... 21Using the Main Workspace .....
..... 23Report Writer .....
..... 24Mail Program .....
..... 25Screen List .....
..... 25Tag Watch Window .....
..... 27Recipe Menu .....
..... 27Downloader Utility .....
Part III
Project Menu 30
..... 30Hardware .....
..... 31Drivers .......... 31Adding Devices .....
..... 31Data Acquisition .....
..... 32Data Acquisition Setup .....
..... 33Data Acquisition Usage .....
..... 34Internal System Driver .....
..... 35PLC Drivers .....
..... 35Automation Direct (Koyo) .....
..... 36Automation Direct Driver Setup .....
..... 36Automation Direct Cabling .....
..... 37TI305 or 405 .....
..... 37TI335 or DL340 .....
Winbuild 50001
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
..... 37DL240 .....
..... 38Automation Direct Driver Registers .....
..... 39Allen-Bradley DF1 .....
..... 39Allen-Bradley DF1 Driver Setup .....
..... 40Allen-Bradley DF1 Driver Registers .....
..... 41Allen-Bradley DF1 Cabling .....
..... 41Modbus RTU .....
..... 42Modbus Driver Setup .....
..... 43Modbus Driver Registers .....
..... 43Modicon Modbus Cabling .....
..... 44Modbus TCP .....
..... 44Modbus TCP Setup .....
..... 44Modbus TCP Properties .....
..... 45Modbus TCP Registers .....
..... 46Mitsubishi FX .....
..... 46Mitsubishi FX Setup .....
..... 47Mitsubishi FX Registers .....
..... 47Motion Control Drivers .....
..... 48Compumotor Serial .....
..... 48Compumotor Serial Driver Setup .....
..... 49Compumotor Serial Driver Registers .....
..... 49Emerson Axima .....
..... 50AXIMA Driver Setup .....
..... 51AXIMA Driver Registers .....
..... 51Emerson E Series .....
..... 51Emerson E Series Setup .....
..... 52Emerson E Series Registers .....
..... 52Galil Serial .....
..... 53Galil Serial Driver Setup .....
..... 53Galil Serial Driver Registers .....
..... 54Configuring External Galil Controller .....
..... 54Galil TCP .....
..... 55Galil TCP Setup .....
..... 55Galil TCP Driver Registers .....
..... 56Indramat DKC .....
..... 56Indramat DKC Driver Configuration .....
..... 57Indramat DKC Driver Registers .....
..... 57Indramat CLC/PPC .....
..... 57Indramat CLC/PPC Driver Setup .....
..... 58Indramat CLC/PPC Driver Tags .....
..... 59MTS FLX .....
..... 59MTS FLX Driver Setup .....
..... 59MTS FLX Driver Registers .....
..... 60Yaskawa .....
..... 60Yaskawa Driver Setup .....
..... 61Yaskawa Driver Registers .....
..... 61Yaskawa RS422 Cabling .....
..... 62Yaskawa RS485 Cabling .....
2Contents
II
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
..... 62Yaskawa SMC .....
..... 62Yaskawa SMC Setup .....
..... 63Yaskawa SMC Registers .....
..... 63PC104 Cards .....
..... 64CIB (Communication Interface Board) .....
..... 64Adding the CIB Driver .....
..... 66Select CIB Protocol .....
..... 66Select CIB Device .....
..... 67Create CIB Driver Tags .....
..... 68PC104-05 Digital 48 I/O .....
..... 69PC104-13A Motion Control 1.5 Axis .....
..... 69PC104-13B-I Motion Control 1-8 Axis .....
..... 70PC104-15 Analog I/O .....
..... 70PC104-15 Setup .....
..... 71PC104-15 Registers .....
..... 71PC104-15 Tag Configuration .....
..... 72Timers .....
..... 73Timer Variables .....
..... 73Timers (Graphically) .....
..... 74Tags .......... 74Adding Tags .....
..... 74Tag Names .....
..... 75Tag Properties .....
..... 75Tag Source .....
..... 76Tag Address .....
..... 76Tag Types .....
..... 76Tag Defaults .....
..... 76Tag Scaling .....
..... 77Modbus Register Mapping .....
..... 78Tasks .....
..... 78Subroutines .....
Part IV
Build Menu 80
Part V
Tools 83
..... 83Downloader Utility .....
..... 84Tag Watcher .....
..... 856501 IO Module Configuration .....
Part VI
Recipe System 87
Winbuild 50003
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
..... 87Recipe Quick-Step .....
..... 87Adding Recipe Records .....
..... 88Adding Recipe Ingredients .....
..... 89Recipe BASIC Codes .....
..... 89Recipe System Rules .....
..... 90Recipe System Screens .......... 90Recipe Select Screen .....
..... 91Recipe Edit Screen .....
..... 92Recipe MessageBox Screen .....
..... 92Recipe Copy Screen .....
Part VII
Options Menu 94
..... 94Communications .....
..... 95Editor .....
Part VIII
Screens 97
..... 97Screen List .....
..... 97Adding Screens .....
..... 98Renaming Screens .....
..... 98Copying Screens .....
..... 98Deleting Screens .....
..... 98Pop-Up Screens .....
..... 99Subscreens .....
Part IX
Screen Objects 102
..... 102BarGraphs .......... 102BarGraphs: General .....
..... 103BarGraphs: Data .....
..... 104BarGraphs: Bargraph .....
..... 104BarGraphs: Basic Code .....
..... 105Buttons .......... 105Buttons: Text .....
..... 105Buttons: Button .....
..... 106Buttons: General .....
..... 107Buttons: Font .....
..... 107Buttons: Basic Code .....
..... 108Data Entry/Display .....
4Contents
IV
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
..... 108Data: Data .....
..... 108Data: General .....
..... 109Data: Font .....
..... 110Data: Entry/Display .....
..... 111Data: Basic Code .....
..... 111Gauges .......... 111Gauge: Gauge .....
..... 112Gauge: Data .....
..... 113Gauge: General .....
..... 114Gauge: Indicator .....
..... 114Gauge: Font .....
..... 115Gauge: Basic Code .....
..... 115Indicators .......... 116Indicator: Data .....
..... 116Indicator: General .....
..... 117Indicator: Indicator .....
..... 117Indicator: Basic Code .....
..... 118Lines, Circles, Rectangles .......... 118Properties .....
..... 119Basic Code .....
..... 119Messaging .......... 119Messaging Setup .....
..... 120Displaying Messages .....
..... 120Pictures (Bitmaps) .......... 120Pictures: Picture .....
..... 121Pictures: General .....
..... 122Pictures: Basic Code .....
..... 122Recipe List Box .....
..... 122Subscreens .....
..... 123Static Text .......... 124Text: Text .....
..... 124Text: General .....
..... 125Text: Font .....
..... 125Text: Basic Code .....
..... 126Super Buttons .......... 126SuperButton: Data .....
..... 127SuperButton: General .....
..... 127SuperButton: ColorRanges .....
..... 129SuperButton: Button Font .....
..... 130SuperButton: Caption Font .....
..... 130SuperButton: Button .....
..... 132SuperButton: Basic Code .....
..... 132Trend Charts .....
Winbuild 50005
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
..... 133Trend Chart Setup .....
..... 133Trend: General .....
..... 134Trend: Elements .....
..... 134Trend: Axes .....
..... 135Trend: Legend Font .....
..... 136Trend: Axes Font .....
..... 137Trend: Label Font .....
..... 138Trend: Basic Code .....
Part X
BASIC Codes 140
..... 140About ESA Tech BASIC .......... 140Adding/Editing BASIC Code .....
..... 141ESA Tech BASIC Codes (Pseudocodes) .....
..... 142BASIC Constants .....
..... 143BASIC Operators .....
..... 145BASIC Variables .....
..... 145Mathematics With Data Types .....
..... 146Commands & Functions .......... 149Arrays .....
..... 150Creating Arrays .....
..... 150Using Arrays .....
..... 150CALL ARRAYSETNUMERIC .....
..... 151CALL SETARRAYSTRING .....
..... 152Binary Functions .....
..... 152About Binary Functions .....
..... 153BIN2BYTE .....
..... 153BIN2UBYTE .....
..... 154BIN2DREAL .....
..... 154BIN2REAL .....
..... 155BIN2WORD .....
..... 155BIN2DWORD .....
..... 156BIN2UWORD .....
..... 156BIN2UDWORD .....
..... 157BYTE2BIN$ .....
..... 157DREAL2BIN$ .....
..... 158DWORD2BIN$ .....
..... 158UBYTE2BIN$ .....
..... 159REAL2BIN$ .....
..... 159UDWORD2BIN$ .....
..... 160UWORD2BIN$ .....
..... 160WORD2BIN$ .....
..... 161Bitwise Functions .....
..... 161BITAND .....
..... 162BITAT .....
..... 162BITCLEAR .....
6Contents
VI
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
..... 163BITNOT .....
..... 163BITOR .....
..... 164BITSET .....
..... 164BITSHIFTL .....
..... 165BITSHIFTR .....
..... 165BITXOR .....
..... 166Control Statements .....
..... 166CASE .....
..... 167DO WHILE...LOOP .....
..... 168DO...LOOP UNTIL .....
..... 168FOR-NEXT .....
..... 170GOSUB .....
..... 170GOTO .....
..... 171IF...THEN...ELSE...ENDIF .....
..... 172LABEL .....
..... 173REM .....
..... 173RETURN .....
..... 174WAIT .....
..... 175WAITFORNONZERO .....
..... 175Communication Ports .....
..... 176COMCLEAR .....
..... 176COMGET$ .....
..... 177COMGETBIN$ .....
..... 177COMGETBINUNTIL$ .....
..... 178COM INIT .....
..... 179COMPUT .....
..... 179COMPUTBIN .....
..... 179COMPUTGET$ .....
..... 180COMPUTGETBIN$ .....
..... 180COMPUTGETBINUNTIL$ .....
..... 181INBUFFERCOUNT .....
..... 181INKEY .....
..... 182INKEY$ .....
..... 182INPORTB .....
..... 183INPORTW .....
..... 183OUTPORTB .....
..... 184OUTPORTW .....
..... 184Date & Time Functions .....
..... 184CALL SETDATE .....
..... 185CALL SETTIME .....
..... 185CLOCK .....
..... 186DATE .....
..... 186DATE$ .....
..... 187DAYOFWEEK .....
..... 187MSECTOTIME$ .....
..... 188TIME .....
..... 188TIME$ .....
..... 189Object Properties .....
Winbuild 50007
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
..... 189CALL CLOSEPOPUPCANCEL .....
..... 190CALL CLOSEPOPUPOK .....
..... 190POPUP .....
..... 190SETBACKGROUNDCOLOR .....
..... 191SETCAPTIONFILLCOLOR .....
..... 191SETCAPTIONFONT .....
..... 192SETCAPTIONTEXT .....
..... 193SETCAPTIONTEXTCOLOR .....
..... 193SETDISABLED .....
..... 194SETENABLED .....
..... 194SETFILLCOLOR .....
..... 195SETFILENAME .....
..... 195SETFONT .....
..... 196SETINVISIBLE .....
..... 197SETLINECOLOR .....
..... 197SETPOSITION .....
..... 198SETSIZE .....
..... 198SETTEXT .....
..... 199SETTEXTCOLOR .....
..... 200SETTRENDRANGE .....
..... 200SETVISIBLE .....
..... 201Math Functions .....
..... 202ABS .....
..... 202ACOS .....
..... 203ASC .....
..... 203ASIN .....
..... 204ATAN .....
..... 204BCC .....
..... 205BCC8W .....
..... 205BIN .....
..... 206BIN$ .....
..... 206COS .....
..... 207CRC16 .....
..... 208CRC32 .....
..... 208DEG .....
..... 209EXP .....
..... 209FRAC .....
..... 209HEX .....
..... 210HEX$ .....
..... 211INT .....
..... 211LOG .....
..... 212LOG10 .....
..... 212LOG2 .....
..... 213MAX .....
..... 213MIN .....
..... 214MOD .....
..... 214OCT .....
..... 215OCT$ .....
8Contents
VIII
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
..... 215PI .....
..... 216RAD .....
..... 216RND .....
..... 217ROUND .....
..... 217SGN .....
..... 218SIN .....
..... 218SQRT .....
..... 219TAN .....
..... 219^ .....
..... 220String Functions .....
..... 220CHR$ .....
..... 221FILLSTRING$ .....
..... 221FORMAT$ .....
..... 222LEFT$ .....
..... 223LEN .....
..... 223LOWER$ .....
..... 224LTRIM$ .....
..... 224MID$ .....
..... 225POS .....
..... 226RIGHT$ .....
..... 226RTRIM$ .....
..... 227STR$ .....
..... 227TRIM$ .....
..... 228UPPER$ .....
..... 228VAL .....
..... 229System Calls .....
..... 229CALL CONFIGMODE .....
..... 229CALL DOWNLOADMODE .....
..... 230CALL REBOOT .....
..... 230CALL RESTART .....
..... 230LOCKMUTEX .....
..... 231SYSTEM .....
Part XI
Reference 233
..... 233ASCII Character Codes .....
..... 234Error Codes .....
..... 236Ethernet Cabling .....
..... 237Glossary .....
..... 239Modbus Master ActiveX Component .....
..... 240Null Modem Cable .....
..... 240Reserved Word List .....
..... 244Supported Data Types .....
..... 244GNU General Public License .....
Winbuild 50009
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Index 249
10Contents
X
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Getting Started
I
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Getting Started 12
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Getting Started
1. Connect ESA Technology Null Modem Cable to Programming Port on unit.
2. Connect other end of cable to available COM port on PC. (Usually COM1 on laptops,COM2 on desktop systems.)
3. Start the WinBuild 5000 software, go to menu "OPTIONS COMMUNICATIONS"
4. Select corresponding COM port on your PC you want to use. (See separate section onEthernet setup)
Winbuild 500013
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
5. Select "FILE OPEN" and select a demo or sample program.
Getting Started 14
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
6. Use the "BUILD, COMPILE, DOWNLOAD, RESTART!" button to load the program intothe unit.
Ethernet Setup
1. Connect Ethernet Cable to Ethernet port on unit.
2. Connect your PC up to your Ethernet network. (Use a null-ethernet cable if connect unit &PC directly, otherwise use hub or switch with standard Ethernet cabling between them.)ESA requires standard TCP/IP networking to be installed and already configured on your PC.
Winbuild 500015
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
3. Start the WinBuild 5000 software, go to menu "OPTIONS COMMUNICATIONS"
4. Select the IP address of the ESA unit to which you are connecting. (IP address is setusing the CONFIG SCREEN on the unit.) Click OK when done.
5. Select "FILE OPEN" and select a demo or sample program. Click OPEN to select theprogram.
Getting Started 16
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
6. Use the "BUILD, COMPILE, DOWNLOAD, RESTART!" button to load the program intothe unit.
Unit Congfiguration
To reach the unit's configuration screen:
· Apply power or reboot the unit.· As the unit boots, when the penguin appears in the upper left of the screen, touch &
hold your finger on the penguin.· When the unit finishes booting to a blank screen, continue to press & hold finger in
upper left. Count to 5, and the unit will enter the configuration screen.
OR
· With the ESA unit already connected to your PC & powered up, in Winbuild 5000select the menu option "BUILD CONFIGURATION MODE".
OR
· If the unit boots to the blank bootup screen, touch the screen anywhere and select"Configuration" from the pop-up menu.
Winbuild 500017
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
OR
· If you have a keyboard attached to the unit, hold down left "ALT" key and press "F7".
System Information
The system holds several parameters useful in the configuration and maintenance of yourunit:
Model: ESA model/product number.Revision: Hardware revision level.Serial Number: Assigned serial number to hardware.Build Date: Date of manufacture.Service Date: Date unit was last serviced. (By ESA)Battery Status: Indicates if battery voltage is good/bad.CPU Voltages: Displays status of +5, +12, -12V on the CPU board.CPU Temperature: Displays temperature of CPU.Input Voltage: Displays externally supplied voltage level.
Note: Default system configuration password is "5000".
Touchscreen Calibration
To calibrate the unit's touch screen:· Boot the unit to the configuration screen.· Select the "Calibrate" button.· Touch the dots as they appear on the screen.
OR
· If you have a keyboard attached to the unit, hold down left "ALT" key and press "F9".· Touch the dots as they appear on the screen.
OR
Getting Started 18
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
· With the unit already connected to your PC, in Winbuild 5000 select "BUILD CALIBRATE TOUCHSCREEN".
· Touch the dots as they appear on the screen.
New system calibration immediately takes effect.
System Password
Note: System default configuration password is "5000".
To change the system configuration password:
· Boot the unit to the configuration screen.· Select the "Configuration" button.· Enter system password.· Select the "Set Password" button.· Type the new password and touch "OK".
The new password will immediately be effective.
Networking Configuration
At a minimum, to begin networking your ESA Technology 5000 Family unit via Ethernet toother devices requires assigning an IP address to the ESA unit. This IP address must beunique on your network and not conflict with any other device.
To set the IP address:
· Boot the unit to the configuration screen.· Select the "Configuration" option.· Enter system password.· Select "TCP/IP configuration".· Touch the "IP:" button· Type a new valid IP address for the unit and touch "OK".· Reboot/restart unit for new IP address to take effect.
The other networking parameters (Gateway, DNS) are not required for most simpleinstallations. When required, they can be obtained from your facility networkingprofessional.
Winbuild 500019
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
System Date
To change the system date:
· Boot the unit to the configuration screen.· Select the "Configuration" button.· Enter system password.· Select the "Set Date" button.· Use the Prev/Next buttons to select a new Month & Year.· Touch the calendar to set appropriate day of the week & date.· Touch "OK" when done.
The new date will immediately be effective.
Note: The system date can also be set through BASIC code in your application. See theWinbuild 5000 Help for the "Date & Time" functions.
System Time
To change the system time:
· Boot the unit to the configuration screen.· Select the "Configuration" button.· Enter system password.· Select the "Set Time" button.· Touch the Hour, Minute, Second parameter you wish to change.· A numeric pop-up screen will then allow you to enter a new value.· To set AM or PM, touch respective button.· Touch "OK" when done.
The new time will immediately be effective.
Note: The system time can also be set through BASIC code in your application. See theWinbuild 5000 Help for the "Date & Time" functions.
Using Winbuild 5000
II
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 500021
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Using Winbuild 5000
This section will briefly outline some of the software functions available in WinBuild 5000.
Using the Winbuild 5000 Workspace
Report Writer
Mail Program
Screen List
Tag Watcher
Recipe Menu
Downloader Utility
Using the Main Workspace
Here is where you can build how you want your HMI to look. Use the toolbars to click &drop your objects onto the screen.
Click on objects to move or resize them with your mouse, or use arrow keys to nudgeobjects.
Using Winbuild 5000 22
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Double-click on objects to configure them, and edit their properties. (And add BASIC code)
Additional screens are listed in the screen list to left. Just click on the name to view thatscreen.
Winbuild 500023
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Report Writer
The report writer generates an HTML document that includes project information such as:Drivers, Tasks, Subroutines, Tags, Scaling, Messages, Screen Shots, Screen Objects, and allthe code associated with those objects.
· Click File Generate Report.
· Select which features you would like to document.
· Select a location for your report under the "Save As" box.
· Click "Generate Report" (This may take several minutes, depending on programcomplexity, and speed of your PC.)
· Report will then open on its own in Internet Explorer. (IE 5.0 required)
Using Winbuild 5000 24
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The report is an HTML hyperlinked document to allow quick navigation of the program,which aids in debugging. The simple HTML layout also easily lends itself to cutting andpasting into other programs for creating manuals & training materials.
Screen shots are created in PNG format- a compact, lossless format that can easily beinserted into most software packages like MS-WORD or Powerpoint.
Note that the file generated can end up being quite large. Do a "Print Preview" beforeactually printing the file to confirm how many pages the document will be. (Help savetrees!)
Mail Program
Use this feature to email your program to ESA Technology Technical Support, or to anyother email address you specify. This automatically attaches any required application files tothe email in a zipped format. (Program files, bitmaps, motion programs, etc.)
Zipping the files together allows the file size to be dramatically compressed and helps keepsall relevant files together.
Note this requires an email service like Outlook to be installed on your PC.
Winbuild 500025
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Screen List
This lists out the screens used by your program. They are listed in alphabetical order, notexecution order. Click on the respective screen you wish to currently view or work on.
The screen with an "M" icon next to it indicates the "MAIN" screen of yourproject. This is the screen that will first appear when the project boots onthe unit.
The "P" icon means that this is a pop-up screen.
The "S" icon means that this screen is a sub-screen.
This icon means that this is a normal screen.
Tag Watch Window
The Tag Watch Window tool is available to allow you to view application tags in the ESA unitremotely from your PC as the application is running. To start the Tag Watch Window, selectthe menu option TOOLS Tag Watcher.Multiple instances of the watch window can be opened at once.
Using Winbuild 5000 26
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Tag: Type name of tag to read here.Value: The value of the data tag will bereported here. Also, you can type avalue into this location to CHANGE tagvalue back in the unit.Start Update: Begins reading valuesfrom unit, and specified update interval.Read Once: Reads tag values one timefrom the unit.Update Interval: Sets how often thetag watcher utility will try to readvalues from the unit.Configuration: Lets you set connectiontype to device. (See below)Exit: Exits tag watcher utility.
Serial: Select serial port on your PC touse as connection to your unit.-or-TCP/IP: Enter IP address of unit toconnect with.
See the "TagWatch Tutorial" for a step-through on using the Tag Watch Window. Thetutorial is included on the install CD or available from the ESA web site.
Winbuild 500027
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Recipe Menu
New Recipe System
· Invokes Recipe Wizard to start a completely new recipe setup.
Maintain Recipe System
· Invokes Recipe Wizard system to allow changes to tags, source file, and synchronizing.
Edit Recipe Data
· Invokes EXCEL editor to allow modifying and adding recipe data.
Download Recipe Data
· Download recipe data to ESA display.
Upload Recipe Data
· Upload Recipe Data from ESA display.
Downloader Utility
The ESA Technology Downloader Utility provides a means to distribute and update programsin the 5000 Family unit without requiring the end user to own a full installed copy ofWinBuild 5000.
By using the "BUILD DOWNLOAD EVERYTHING TO IMAGE" option in WinBuild 5000, thedeveloper can create a compiled, packaged file (.EDI) that can then be distributed to theend user. Nonvolatile values, recipe setups, and ethernet configurations are also exported.
The end user can then take the .EDI file, and download the files into the ESA unit with theDownloader Utility.
The utility is simple to use, and requires only 3 steps:1. Connect unit to PC.2. Specify file to download.3. Click "download button"
Using Winbuild 5000 28
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
For more information on setting up and using the utility, just start the utility (Start Programs Winbuild5000 ProgramDownloader). The simple steps documenting theprocess are right there on the application screen.
NOTE: This feature is not yet available from Winbuild 5000. When the CompactFlash creation toolis available for users, the Image Downloader utility will be functional, and allow users to downloadprograms to an image file. Contact ESA Technology for latest information on tools available.
Project Menu
III
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Project Menu 30
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Project Menu
Hardware
Drivers
Tags
Tasks
Subroutines
Hardware
Model: This option lets you select ESA Technology 5000 Model to which you areconnecting/downloading.
WARNING: changing the terminal type during or after project development will not causeWinbuild to resize or adapt any onscreen objects. (You'll have to adjust this yourself.)
Show Mouse Cursor: Selecting this option will make the mouse/touch cursor display onscreen. (This is useful for applications where a user wants to add a mouse instead of usingthe touchscreen. Contact ESA Tech for details)
Use Fast Screen Switch: This option sets up the unit to quick transition between screens,and does not wait for valid data from connected devices first. After the screen is drawn, theunit then reads data & populates the screen as best it can.
Winbuild 500031
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Drivers
When interfacing devices with your ESA unit, special drivers may be required tocommunicate to that device.
To add drivers for your device, use "Project Drivers", or see the "Adding Devices" sectionof help.
Other devices that communicate serially do not need a special driver. Just initialize the COMport with the correct port settings, and the ESA COM codes will enable you to quickly andeasily send & receive data serially. See COM codes for more help on using this customfeature.
Adding Devices
To add an internal or external device driver to your projoct, select the "PROJECT DRIVERS" menu item.
Select the ADD button and select the device you wish to add to the project. More than onedevice can be added, like a recipe engine, and nonvolatile data storage, along with anycombination of PLCs.
Once you add a device, you can highlight it and click the PROPERITES button. This will letyou edit which COM port the device is connected to, and its designated node address.
Besides PLCs there are several "internal" data types that can be used to construct internalvariables for use with serial communication and internal soft-logic. Internal volatilerepresents data that is created but destroyed once the power is removed from the unit.Internal non-volatile data types are saved in battery-backed RAM. These data types arepreserved when the power is removed.
You can also select the WinBuild 5000 recipe engine here.
Data Acquisition
The Data Acquisition driver allows the user to capture data, either on a timed basis ortriggered by an event.
Multiple data acq. drivers can be added to log groups of data, and can be volatile or storednon-volatile in battery-backed RAM.
The Data Acquisition driver is required in order to use the Trend Chart feature.
Setting up Data Acquisition Driver
Project Menu 32
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Using the Data Acquisition Driver
Data Acquisition Setup
Driver Name: You can give your Data Acq. driver a new name if you wish.
Data Points: Define how many data points you want the driver to log into memory.
Storage Type: Select volatile or non-volatile (battery-backed) storage.
Buffer Type: Once means the driver will fill the array buffer once, and then stop. Circularmeans the buffer will fill, then wrap around and continue logging back at the beginningindex.
Acquisition Type: This will determine if the buffer is filled on a timed basis (TimerInterval) or based on a triggered value (The Enable tag set to non-zero).
Internal Enable: Identify the internal memory tag to use as the data acq enable ortrigger.
External Enable: Identify the external tag to use as the data acq enable or trigger.
Timer Interval: Interval (in msec) that the buffer will log a value.
Current Index Tag Name: Specify name of the internal system tag that will hold where inthe current buffer index the data acq. driver is indexing.
Total Acquired Tag Name: Specify name of internal system tag that will hold how manytotal data points have been acquired.
Winbuild 500033
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Data Acquisition Usage
After adding the Data Acquisition driver to your project, you can now specify tags values tolog.
Open the tag table. (PROJECT -> TAGS) You'll notice some of the default variables from thedriver already entered here. (The current index, total index, and the enable tags.) You canonly rename these variables in the driver properties page. These tags are accessible byname anywhere in your project for viewing onscreen or using in BASIC code)
In the tag table, add a new tag, and source it to the Data Acq. driver.
Project Menu 34
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
In the address column, enter the NAME of the tag you want the Data Acq driver to log. Inthis example, we will be logging the tag "Temperature" that is coming from the PC104-15analog card.
Now, when you set the variable "DataAcq_ENABLE" to a non-zero value, the driver will startlogging your data. (Either on a timed interval, or everytime your trigger value is set.)
Values are stored in the array, given the tag name you set up here. In this example thearray is called "TempLog". You can use this array to upload to a host PC, displayingonscreen, or using the TREND CHART object.
Internal System Driver
Adding the "Internal System Driver" to your project gives you access to several internalvariables within the unit:
Winbuild 500035
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BATTERYSTATE Battery State (0=bad)
CLOCK Milliseconds since program start
CPUTEMP CPU Temperature (C)
DATE Numeric Date (YYDDD)
DATE$ String Date
DAY_OF_WEEK Day of Week (1=Sunday, 7=Saturday)
MSEC Milliseconds since midnight
SERIAL System serial number
TIME Seconds since midnight
TIME$ String time
VOLT12 12V system voltage
VOLT12M -12V system voltage
VOLT5 5V system voltage
VOLTAUX Auxiliary voltage
VOLTIN Input voltage
YEAR Last 2 digits of year
After adding the driver, you can then access these variables in the tag table. Just create anew tag, source it to the INTERNAL SYSTEM DRIVER, and in the address column, type theabove register name. You can now access any of the above system variables by using yournew tag name.
PLC Drivers
Automation Direct (Koyo)
Allen Bradley DF1
Modicon Modbus RTU
Mitsubishi FX
Automation Direct (Koyo)
Driver Setup
Driver Registers
Automation Direct (Koyo) Cabling
Project Menu 36
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
PLC Address/ID: This is the address or ID of the device you are connecting. (Mainprocessor ID)
Port: This is the ESA unit port to use to connect with your device.
Autobaud: Selecting this option will make the ESA unit search for your device, tryingvarious baud rates and parity. This is useful, but can take time. Select a specific baud rateif you already know your device's settings.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Parity: Select parity rate your device communicates at. Or, use the AUTOBAUD function.
Timeout: The period of time the ESA unit will wait for a response from your device.Typically 250-500ms is long enough.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
TI304 or 405
TI335 or DL340
DL240
Winbuild 500037
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Project Menu 38
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The Koyo 205/405 Driver supports the following addresses:
V0-V377 WORD/DWORD Timer Accumulator
V400-V777 WORD/DWORD System Status
V1000-V1377 WORD/DWORD Counter Accumulator
V1400-V7377 WORD/DWORD Variable
V7400-V7777 WORD/DWORD System Status
V10000-V37777 WORD/DWORD Variable
GX0-GX3777 BIT Global Input
GY0-GY3777 BIT Global Output
X0-X1777 BIT Input
Y0-Y1777 BIT Output
C0-C3777 BIT Variable
S0-S1777 BIT Stage Status
T0-T377 BIT Timer Status
CT0-CT377 BIT Counter Status
SP0-SP777 BIT System Status
SNote: Register data (WORD/DWORD) defaults to WORD format. DWORD format may bespecified by placing an "L" after the address specification. Register data defaults to BCDdata. Binary data my be specified by placing a "B" after the address and the optionalDWORD specifier. Example: V1423LB will read variable 1423 as a long integer (DWORD) inbinary mode.
The Koyo 305 Driver supports the following addresses:
CT100-CT107 BIT Counter Status
CT600-CT677 BIT Counter Status
T600-T677 BIT Timer Status
IO0-IO157 BIT Input/Output
IO700-IO767 BIT Input/Output
C160-C277 BIT Variable
C770-C777 BIT Variable
S0-S177 BIT Stage Status
R400-R577 WORD/DWORD Variable
R600-R677 WORD/DWORD Counter Accumulator
R600-R677 WORD/DWORD Timer Accumulator
ANote: Register data (WORD/DWORD) defaults to WORD format. DWORD format may bespecified by placing an "L" after the address specification. Register data defaults to BCD
Winbuild 500039
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
data. Binary data my be specified by placing a "B" after the address and the optionalDWORD specifier. Example: V1423LB will read variable 1423 as a long integer (DWORD) inbinary mode.
Allen-Bradley DF1
Driver Setup
Driver Registers
Allen-Bradley DF1 Cabling
When you add your AB driver to the device listing in WinBuild 5000, set up thefollowing parameters:
Select your appropriate model and error checking. (our example uses CRC)
· Micrologix/SLC500 - CRC {or} SLC500-BCC
Then select other relevant communication parameters:
· Port: Select ESA unit port to which SLC is attached.
· Address: Put your processor address here. (9 in our example)
· Use Autobaud, select 19200 baud otherwise. (502,503 processors may not likeAutobaud selected)
· No Parity
· Timeout 500
· Interchar Delay: 0
Your AB PLC then needs to be setup to communicate with the same parameters.Using the Rockwell RS-Logix Software, set your Channel Configuration:
· General: Channel 1
· Driver: DH485
· NOT Write Protected (unchecked)
· Passthru Link ID (dec):2
· General: Channel 0
· DF1 Full Duplex
· Mode: System
· NOT Write Protected (unchecked)
· Passthru Link ID (dec):1
· User Driver: ASCII
· Chan.1 - System
· Driver: HD485
Project Menu 40
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
· Baud: 19200
· Node Address: 1
· Chan. 0 - System
· Driver: DF1 Full Duplex
· Baud: 19200
· Parity: NONE
· Stop Bits: 1
· Source ID: 9 ( your PLC address)
· Chan. 0 - Protocol Control
· Control Line: No Handshaking
· Error Detection: CRC (or BCC for SLC500 if appropriate)
· Embedded Responses: Enabled
· ACK Timeout (x20ms): 50
· Chan. 0 - User
· Driver: ASCII
· Baud: 1200
· Parity: NONE
· Stop Bits: 1
· Data Bits: 8
· Control Line: No Handshaking
· NO Echo (unchecked)
· NO Xon/Xoff (unchecked)
Bits:Bf:e/bf = file (3, 10-255)e = element (0-255)b = bit position (0-15)example: B3:1/4 is bit 4, element 1 of file 3
Timers:Tf:e/bf = file (4, 10-255)e = element (0-255)b = bit position (0-15)
Counters:Cf:e/bf = file (5, 10-255)e = element (0-255)b = bit position (0-15)
Winbuild 500041
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Integers:Nf:e/bf = file (7, 10-255)e = element (0-255)b = bit position (0-15) – optional
Inputs:I:s/bs = slotb = bit position (0-15)
I:s.ws = slotw = word number
Outputs:O:s/bs = slotb = bit position (0-15)
O:s.ws = slotw = word number
PLC ESA Unit
Modbus RTU
Driver Setup
Driver Registers
Modicon PLC Cabling
Project Menu 42
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
PLC Address/ID: This is the address or ID of the device you are connecting. (Mainprocessor ID)
Port: This is the ESA port to use to connect with your device.
Autobaud: Selecting this option will make the ESA unit search for your device, tryingvarious baud rates and parity. This is useful, but can take time. Select a specific baud rateif you already know your device's settings.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Parity: Select parity rate your device communicates at. Or, use the AUTOBAUD function.
Timeout: The period of time the ESA unit will wait for a response from your device.Typically 250-500ms is long enough.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
Multidrop: Select mode of operation: RS232 / RS422 / RS485
Modbus Base: See the built-in help for explanation here. For questions on this, contactESA Tech support.
Winbuild 500043
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Modbus RTU driver supports the following addresses
00001 to 09999 Bit Outputs(read/write)
10001 to 19999 Bit Inputs (read only)
30001 to 39999 Word Input Registers (read only)
40001 to 49999 Word Holding Registers (read/write)
40001L to 49999L Double Word Holding Registers , uses two consecutive addresses
40001F to 49999F Real Holding Registers, uses two consecutive addresses
40001D to 49999D Double Real Holding Registers, uses four consecutive addresses
Input registers and Holding registers default to type WORD. Add the following specifier tospecify a different data type:
SPECIFIER TYPE BYTE ORDER
.UW Unsigned Word
.DW Double Word ( High word - Low word)
.DWX Double Word ( Low word - High word)
.UDW Unsigned Double Word ( High word - Low word)
.UDWX Unsigned Double Word ( Low word - High word)
.R Real ( High word - Low word)
.RX Real ( Low word - High word)
.DR Double Real ( Byte order is High to Low)
.DRX Double Real ( Byte order is Low to High)
.Sn String in n registers ( Second char - First char )
.SXn String in n registers ( First char - Second char )
Project Menu 44
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Modbus TCP
Driver Setup
Modbus TCP Properties
Driver Registers
To connect your ESA Technology 5000 to an Ethernet Modbus TCP enabled controller, usethe Modbus TCP driver.
In the ADDRESS property type the IP address or hostname.
Select TCP/UDP for appropriate protocol for your controller.
Address/Modbus Slave ID is the device ID of the device to which you are connecting.
See relevant help in dialog box regarding 0-based or 1-based controllers.
Winbuild 500045
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Modbus TCP driver supports the following addresses
00001 to 09999 Bit Outputs(read/write)
10001 to 19999 Bit Inputs (read only)
30001 to 39999 Word Input Registers (read only)
40001 to 49999 Word Holding Registers (read/write)
40001L to 49999L Double Word Holding Registers , uses two consecutive addresses
40001F to 49999F Real Holding Registers, uses two consecutive addresses
40001D to 49999D Double Real Holding Registers, uses four consecutive addresses
Input registers and Holding registers default to type WORD. Add the following specifier tospecify a different data type:
Project Menu 46
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SPECIFIER TYPE BYTE ORDER
.UW Unsigned Word
.DW Double Word ( High word - Low word)
.DWX Double Word ( Low word - High word)
.UDW Unsigned Double Word ( High word - Low word)
.UDWX Unsigned Double Word ( Low word - High word)
.R Real ( High word - Low word)
.RX Real ( Low word - High word)
.DR Double Real ( Byte order is High to Low)
.DRX Double Real ( Byte order is Low to High)
.Sn String in n registers ( Second char - First char )
.SXn String in n registers ( First char - Second char )
Mitsubishi FX
Driver Setup
Driver Registers
Port: This is the ESA port to use to connect with your device.
Multidrop: Select mode of operation: RS232 / RS422 / RS485
Winbuild 500047
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Mitsubishi FX Driver supports the following addresses:
X0 (octal) through X177 (octal) - CONTACT Inputs
Y0 (octal) through Y177 (octal) - CONTACT Outputs
D0 through D511 - INTEGER Register
D8000 through D8255 - INTEGER Register
M0 through M1023 - CONTACT Internal
M8000 through M8255 - CONTACT Internal
T0 through T255 - CONTACT Timer Contacts
C0 through C255 - CONTACT Counter Contacts
CV0 through CV199 - INTEGER Counter Values
TV0 through TV255 - INTEGER Counter Values
S0 through S999 - CONTACT States
Motion Control Drivers
Compumotor Serial
Emerson Axima
Emerson Epsilon
Galil DMC 1500, 2000
Indramat CLC/PPC
Project Menu 48
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Indramat DKC
Yaskawa Memobus
Yaskawa SMC
Compumotor Serial
Compumotor Serial Driver Setup
Compumotor Serial Driver Registers
Model: Use this pull-down menu to select to which Compumotor serial device you areconnection. (Compumotor 6000, 6K or GT6/GV6)
Port: Select ESA unit serial port to use in connecting to Compumotor.
Address: Specify address of Compumotor device.
Timeout: How long (in msec) the ESA unit will wait for responses from Compumotor.
Baud: Select baud rate for connecting to Compumotor.
Parity: Select parity.
Inter-char send delay: Use at advice of ESA Technology Tech support. Normally set tozero.
Flow Control: Select flow control options to match your Compumotor settings. (Default isXON/XOFF)
Winbuild 500049
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Compumotor driver supports the following syntax:
Compumotor 6000 series:VAR1 through VAR150 RealsVARS1 through VARS25 Strings
Compumotor 6K series:VAR1 through VAR225 RealsVARI1 through VARI225 Double WordsVARS1 through VARS25 Strings
All other parameters and variables can be read with the built-in COM commands tosend/receive info out the communications ports. (See "Serial Tutorial" for introductory helpon using the serial ports.)
Emerson Axima
AXIMA Driver Setup
AXIMA Driver Registers
Project Menu 50
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
PLC Address/ID: This is the address or ID of the device you are connecting. (Mainprocessor ID)
Port: This is the ESA unit port to use to connect with your device.
Autobaud: Selecting this option will make the ESA unit search for your device, tryingvarious baud rates and parity. This is useful, but can take time. Select a specific baud rateif you already know your device's settings.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Parity: Select parity rate your device communicates at. Or, use the AUTOBAUD function.
Timeout: The period of time the ESA unit will wait for a response from your device.Typically 250-500ms is long enough.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
Multidrop: Select RS232 / RS422 / RS485 communication mode.
Winbuild 500051
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Emerson AXIMA driver supports the following addresses:
REGISTER TYPE
00001 to 09999 Bit (read/write)
10001 to 19999 Bit (read only)
30001 to 39999 Double Word or Real (read only)
40001 to 49999 Double Word or Real (read/write)
Note that 3xxxx and 4xxxx default to Double Word types. All variables are 32-bit, so only odd addresscan be used. Specifiers may be added to change the type:
SPECIFIER TYPE
.DW Double Word
.UDW Unsigned Double Word
.R Real
Emerson E Series
Emerson E Series Driver Setup
Emerson E Series Driver Registers
PLC Address/ID: This is the address or ID of the device you are connecting. (Mainprocessor ID)
Port: This is the ESA unit port to use to connect with your device.
Autobaud: Selecting this option will make the ESA unit search for your device, tryingvarious baud rates and parity. This is useful, but can take time. Select a specific baud rateif you already know your device's settings.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Parity: Select parity rate your device communicates at. Or, use the AUTOBAUD function.
Timeout: The period of time the ESA unit will wait for a response from your device.Typically 250-500ms is long enough.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
Multidrop: Select RS232 / RS422 / RS485 communication mode.
Project Menu 52
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The Emerson Epsilon and E-Series driver supports the following addresses:
00001 to 09999 Bit (read/write)10001 to 19999 Bit (read only)30001 to 39999 Word (read only)40001 to 49999 Word (read/write)
3xxxx and 4xxxx addresses default to Words. Add the following specifiersto specify an different type:
SPECIFIER TYPE.W Word.UW Unsigned Word.DW Double Word.UDW Unsigned Double Word.Sn String in n registers
Galil Serial
Galil Serial Driver Setup
Galil Serial Driver Registers
Configuring your Galil Controller
Winbuild 500053
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Address: This is the address or ID of the Galil controller you are connecting.
Serial Port: This is the ESA unit port to use to connect with your device.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Echo: Select this option if you are using RS232 multidrop mode, and have the motorsecho.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
Multidrop: Select RS232 / RS422 / RS485 communication mode.
Flow Control: Select the handshaking mode compatible with your Galil controller.(Typically hardware handshaking only)
WinBuild 5000 has a driver that allows the user to easily communicate to your Galil MotionController.Adding this driver allows you to create Tags that will automatically be updated by WinBuild5000 through the communication port to your device.
· Add the driver under "PROJECT DRIVERS".
· Click on the driver and select "Properties" button to configure.
Project Menu 54
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
· Then click to the tag table under "PROJECT TAGS".
· Click "New Tag" to add a new Tag to your table, and sourced to the Galil serialdriver.
In the address column, enter:<command>.R to read the value as a real<command>.DW to read the value as a double real
The following commands can be issued (with or without axis specifiers) to read values fromthe Galil:QR, RL, RP, TD, TE, TP, TS, TT, TVIt is also possible to use a variable by using the variable name as your address, and thismethod will work for most other commands dealing with numeric values. Use brackets[] tospecify array elements to access.
TPX to return position of x-axis
IN1 to return status of input1
VAR1 will return value of VAR1, or send down a new value if one entered
FOO.R Read the variable 'FOO' in as a real.
ACX.DW Use the value of linear accel of the x-axis as a double-word
PART[5].R Will access array 'part', element number five.
Set your Galil Motion Controller to the following communication settings:
19200 Baud8 data bits1 stop bitParity: NoneRTS/CTS hardware handshakingXON software handshaking turned off
Galil TCP
Galil TCP Driver Setup
Galil TCP Driver Registers
Winbuild 500055
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
To connect your ESA Technology 5000 to a Galil Ethernet enabled controller, use the GalilTCP driver.
In the ADDRESS property type the IP address or hostname.
Select TCP/UDP for appropriate protocol for your Galil controller.
WinBuild 5000 has a driver that allows the user to easily communicate to your Galil MotionController.Adding this driver allows you to create Tags that will automatically be updated by WinBuild5000 through the Ethernet port to your device.
· Add the driver under "PROJECT DRIVERS".
· Click on the driver and select "Properties" button to configure.· Then click to the tag table under "PROJECT TAGS".
· Click "New Tag" to add a new Tag to your table, and sourced to the Galil ethernetdriver.
In the address column, enter:<command>.R to read the value as a real<command>.DW to read the value as a double real
The following commands can be issued (with or without axis specifiers) to read values fromthe Galil:QR, RL, RP, TD, TE, TP, TS, TT, TVIt is also possible to use a variable by using the variable name as your address, and thismethod will work for most other commands dealing with numeric values. Use brackets[] tospecify array elements to access.
Project Menu 56
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
TPX to return position of x-axis
IN1 to return status of input1
VAR1 will return value of VAR1, or send down a new value if one entered
FOO.R Read the variable 'FOO' in as a real.
ACX.DW Use the value of linear accel of the x-axis as a double-word
PART[5].R Will access array 'part', element number five.
Indramat DKC
Indramat DKC Driver Configuration
Indramat DKC Driver Registers/Variables
Unit ID: This is the address or ID of the motor you are connecting.
Serial Port: This is the ESA unit port to use to connect with your device.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Mode: Select communication mode: RS232 / RS485
Winbuild 500057
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Parameter: Select Indramat parameter to access.
Element number: When using arrays, you can specify element number.
Indramat CLC/PPC
Indramat CLC/PPC Driver Setup
Indramat CLC/PPC Driver Registers (Tags)
Unit Address: The main ID/Address of Indramat CLC or PPC.
Serial Port: Select ESA unit serial port to use as connection to the Indramat.
Baud: Select ESA unit serial port baud rate to use as connection to the Indramat.
Serial Port Mode: Select between RS232 and RS-422 connection mode to Indramat.
Project Menu 58
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The Indramat CLC/PPC driver supports the following address specification:
[COMMAND CLASS][SUBCLASS] [SET].[NUMBER]/[TYPE]
Parameter Data Tupe
[COMMAND CLASS] Character
[SUBCLASS] Character
[SET] Integer
[NUMBER] Integer
[TYPE] DR Double Real
DW Double Word
S String
W Word
Examples:
I/O Registers RD 0.1/WInteger Variables IP 0.34/DWFloat Variables FP 0.45/DRSERCOS Drive Status DP 1.50/SCLC System Status CP 0.122/SFeedback Position AP 0.102/DWFeedback Velocity AP 0.112/DW
Winbuild 500059
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
MTS FLX
MTS FLX Driver Setup
MTS FLX Driver Registers
Port: This is the ESA ET unit port to use to connect with your device.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Multidrop: Select communication mode: RS232 / RS485
The MTS FLX supports the following address format:
GVARaddress Read global variableVARaddress Read serial addresscommand Anything else is sent to controller directly
EXAMPLES: (For IndexBlok, firmware 0239)
GVAR1.DW Reads Gvar1 as a double wordVAR4983.DW Reads serial address 4983 as a double wordVLX5700 Velocity command for X axisVAR3.R Reads 3 as a real
The default type is a WORD. Add the following specifiers to specify data tag as a different
Project Menu 60
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
type:
SPECIFIER TYPE BYTE ORDER.UW Unsigned Word.DW Double Word (High word - Low word).UDW Unsigned Double Word (High word - Low word).R Real (High word - Low word)
Yaskawa
Yaskawa Driver Setup
Yaskawa Driver Registers
Yaskawa RS422 Cabling
Yaskawa RS485 Cabling
Address: This is the address or ID of the Yaskawa controller you are connecting.
Port: This is the ESA unit port to use to connect with your device.
Autobaud: Selecting this option will make the ESA unit search for your device, tryingvarious baud rates and parity. This is useful, but can take time. Select a specific baud rateif you already know your device's settings.
Baud: Select baud rate your device communicates at. Or, use the AUTOBAUD function.
Parity: Select parity rate your device communicates at. Or, use the AUTOBAUD function.
Send Delay: An option for slower devices, but not normally needed for most situations.Use on advice of ESA Technology Tech support.
Multidrop: Select RS232 / RS422 / RS485 communication mode.
Winbuild 500061
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The Yaskawa Memobus protocol supports the following addresses:
REGISTER TYPE NOTES
IB00 through IB2047F Input Bits read only bits
IW0 through IW2047 Input Words read only words
IL0 through IL2046 Input Long Words read only long words
IF0 through IF2046 Input Floats read only floats
MB00 through MB32767F Data Bits read or write bits
MW0 through MW32767 Data Words read or write words
ML0 through ML32766 Data Long Words read or write long words
MF0 through MF32766 Data Floats read or write floats
Project Menu 62
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Yaskawa SMC
Yaskawa SMC Driver Setup
Yaskawa SMC Driver Registers
In the ADDRESS property type the IP address or hostname.
Winbuild 500063
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
WinBuild 5000 has a driver that allows the user to easily communicate to your YaskawaSMC Motion Controller.Adding this driver allows you to create Tags that will automatically be updated by WinBuild5000 through the Ethernet port to your device.
· Add the driver under "PROJECT DRIVERS".
· Click on the driver and select "Properties" button to configure.· Then click to the tag table under "PROJECT TAGS".
· Click "New Tag" to add a new Tag to your table, and sourced to the Yaskawa SMCethernet driver.
In the address column, enter:<command>.R to read the value as a real<command>.DW to read the value as a double real
The following commands can be issued (with or without axis specifiers) to read values fromthe controller:QR, RL, RP, TD, TE, TP, TS, TT, TVIt is also possible to use a variable by using the variable name as your address, and thismethod will work for most other commands dealing with numeric values. Use brackets[] tospecify array elements to access.
TPX to return position of x-axis
IN1 to return status of input1
VAR1 will return value of VAR1, or send down a new value if one entered
FOO.R Read the variable 'FOO' in as a real.
ACX.DW Use the value of linear accel of the x-axis as a double-word
PART[5].R Will access array 'part', element number five.
PC104 Cards
CIB (Communication Interface Board)
PC104-05 Digital 48 I/O
PC104-13A Motion Controller 1.5 axis
PC104-13B-I Motion Controller 1-8 axis
PC104-15 Analog I/O
Project Menu 64
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CIB (Communication Interface Board)
The communication interface board (CIB) allows integration of a broad new range of deviceinterface drivers for the ET5000LX family. By adding this card, your ET terminal will nowhave access to 150+ new drivers.
Adding the CIB Driver
Select CIB Protocol
Select CIB Devices
Create CIB Driver Tags
See "Complete PC104 Manual" for assistance in physical installation of PC104 cards into ETproduct.
See "VT Hardware Manual" for cabling diagrams for MSP, ASP, and CAN ports.
To add the CIB driver to your project, click "PROJECT DRIVERS" menu. Select the "CIB:Multiprotocol" driver.
There are several CIB drivers to choose from, select the card that fits the device you haveinstalled. (Using either Main Serial Port (MSP), Auxilliary Serial Port (ASP) or the CANopeninterface (CAN)
Note: if you plan on using BOTH the MSP and ASP on the CIB board, you will add the CIBdriver TWICE, once selecting MSP and the next ASP, and defining a protocl for each port
Winbuild 500065
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
separately. (see example below)
Project Menu 66
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Once the driver has been added, click on the driver name, and then click "Properties" buttonto select the protocol the CIB board will be using.
If the device protocol requires further setup, the "Line Parameters" section will allow youdefine baud rate, parity, timeout etc as required.
Under the "Devices" tab select which hardware devices to which you will be connecting.
If you are setting up a multi-drop configuration with many devices sharing the port andusing the same protocol, add MORE devices, and configure their device address.
Winbuild 500067
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
To create a project tag that accesses a variable in your CIB connected device· Select the "PROJECT TAGS" menu item.· The PLC Contact and Tag Setup dialog box will appear.· To add a TAG to your project, click on the "New Tag" button· In the SOURCE column, select your CIB protocol
· In the ADDRESS column, a pull-down menu will allow you to select available dataregisters appropriate to that configured device protocol.
Now use these data tags just as you would any other Winbuild 5000 project data tag.The CIB interface driver will take care of all read/writing information for you.
Project Menu 68
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
PC104-05 Digital 48 I/O
Driver Name: Driver you have selected to configure.
Bank: First bank of 24 IO is 1. Subsequent banks are 2 to n, depending on how many -05cards are added. (Note each -05 card has two banks).
Address: Device address of the PC104 card. Use Default Address unless you havespecifically changed card configuration.
Default Names: Resets TAG names to default.
In/Out: Each bit can be selected as either an input or output.
Tag Names: Each corresponding bit has a TAG name. Names can be changed for use inyour project.
Winbuild 500069
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
PC104-13A Motion Control 1.5 Axis
Once you have added the Galil driver to your project, you can easily set up project tags toshare data between the ESA HMI and the motion controller.
Model: Select Motion Control Card interface you are using. 13A or 13B-I controller.
Base Address: This is address selected by jumpers on motion control card. Default is 320.
Use Motion Program: For 13A cards, specify the .DMC motion control file you want todownload to the controller on bootup.
PC104-13B-I Motion Control 1-8 Axis
Once you have added the Galil driver to your project, you can easily set up project tags toshare data between the ESA HMI and the motion controller.
Model: Select Motion Control Card interface you are using. 13A or 13B-I controller.
Base Address: This is address selected by jumpers on motion control card. Default is 320.
Use Motion Program: For 13A cards, specify the .DMC motion control file you want todownload to the controller on bootup. For 13B-I cards, this file will just be downloadedto the FLASH drive on the unit, and stored. ESA Technology advises you use the Galilcontroller's onboard battery-backed storage for actually saving the motion program.
Project Menu 70
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
PC104-15 Analog I/O
PC104-15 Driver Setup
PC104-15 Driver Registers
PC104-15 Driver Tag Configuration
Base Address: Use the default B00h unless otherwise configured.
Winbuild 500071
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
POINT TYPE Physical range Range (12bit) Range (16bit)
IN1 to IN8 -10 to +10V -2048 to2047
-32768 to 32767
IN9 to IN12 4 to 20mA 409 to 2047 6554 to 32767
IN13 tied to OUT3 -10 to +10V -2048 to2047
-32768 to 32767
IN14 tied to OUT4 -10 to +10V -2048 to2047
-32768 to 32767
IN15 tied to OUT1 4 to 20mA 409 to 2047 6554 to 32767
IN16 Ground 0 to +10V -2048 to2047
-32768 to 32767
Outputs arealways 12 bit:
OUT1 & OUT2 Current Output 4 to 20mA 0 to 2047
OUT3 & OUT4 Voltage Output -10 to +10V -2048 to 2047
How to add & configure PC104-15 tags
After the PC104-15 driver has been added to your project, click to to "PROJECT TAGS."Click "Add" to add a new tag to your project.
Give the tag a name.
Select the SOURCE as the PC104-15 card.
Project Menu 72
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
For Address, use the conventions listed in the PC104-15 registers list.
Timers
Timers give you the ability to regulate the execution of code on a timed basis. Timers areused in conjunction with the WAITFORNONZERO statement.
HOW TIMERS WORK:
By setting ENABLE to a 1, the ACCUMULATOR will start incrementing at the PRESETvalue until the LIMIT is reached. The accumulator will increment by 1 once everyINTERVAL milliseconds. When the LIMIT is reached, the OUTPUT will turn to a 1. Bysetting RESET to a 1, the ACCUMULATOR and RESET will automatically set back tozero by the system.
TIMER TYPES:
Autoload - This timer will continue to operate as long as it is enabled. It will accumulatebased off the set interval, activate the output, reset, and then continue accumulatingagain. (The OUTPUT must be cleared manually to acknowledge the timer has beenserviced.)
One Shot - This timer will accumulate only once, then set output and stop. User willhave to reset if they want the timer to start accumulating again.
CLICK HERE to see a graphical representation of how timers work.
CLICK HERE to see further explaination of the timer parameters
Winbuild 500073
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Timer Variables
Enable: Set enable=1 to start the timer. Set to zero to stop it.
Reset: By setting reset=1, accumulator and output will reset. Reset automatically goesback to zero.
Output: Watch this value- when accumulator reaches its limit, this will turn to 1. Use thisvariable in conjunction with WAITFORNONZERO statement.
Accumulator: Accumulated value in the timer. This variable increments by 1 every intervalms.
Limit: Upper limit of accumulator. When this value is reached, the output will be set to 1.
Initial Value: Initial values loaded into memory when unit boots up- in your code, changelimit, preset, interval as you see fit.
Preset: You can specify a value from which the accumulator will start counting.
Initial Value: Initial values loaded into memory when unit boots up- in your code, changelimit, preset, interval as you see fit.
Interval (ms): Time (ms) between increments to the accumulator.
Initial Value: Initial values loaded into memory when unit boots up- in your code, changelimit, preset, interval as you see fit.
Timers (Graphically)
Project Menu 74
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Tags
The ESA Technology interface coordinates data items with TAGS (registers) just like a PLC.The TAG system is name-based, so specific addresses for use internal to the unit do notneed to be specified. The exception to this is when storing information in a non-volatilelocation. (See further text.) If the information source is external (PLC) then specific Taglocations from the device need to be designated.
If you wish to share data items across a network, see the "Networking" section of thismanual for more specifics on setting up networks and shared data items.
Before TAGS can be utilized in your project, a data source needs to be added to yourproject. A data source can be an internal memory location driver, or an external device likea PLC. See section on "Adding Devices to Project" to add a data source.
Adding Tags
· Select the "PROJECT TAGS" menu item.
· The PLC Contact and Tag Setup dialog box will appear.
· To add a TAG to your project, click on the "New Tag" button
Tag Names
·Click on the DEFAULT NAME, and type in your own tag name here.·Tags are limited to 16 characters in length. Anything longer than that will get truncated.·Names cannot start with an underscore unless they are system reserved names.·Names cannot start with a number.
Winbuild 500075
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Tag Properties
· Clicking on the "Properties" button allows you to edit the properties of each individualtag. This is where you can specify scaling and other special properties associated withthe data item.
· The scaling feature allows you to modify the incoming data to display to apredetermined representative scale. Depending on the data source, the data will have aparticular range in raw form. (Source Data)
· To scale this information for use in your MMI, enter in the upper and lower ranges thatyou want the data to be scaled. (Scale To)
· The "Description" tab is where you can set up the significant digits for each tag, with a #sign representing each digit. You can also enter in a short descriptive text of the tagitem.
· For features available under the "Messaging" tab, see the corresponding section in thismanual.
Tag Source
· Click on the Source column, and use the pull down menu to select the source forTAG. This is where the TAG data will be stored and referenced from.
Project Menu 76
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Tag Address
· The address column can be left blank for internal devices, except for a letter designationassigning it a type. This letter should coordinate with the TYPE of data you've selected inthe TYPE column. (i.e. W for WORD, B for BIT, S for string, etc.)
· External devices will require you to enter a valid PLC address for the device type you areworking with.
· If you leave address column blank, or type in an incorrect value, a box willappear listing valid addresses for your device.
· For data items that will be utilizing the internal non-volatile driver, the TAGS need to begiven an address to help differentiate them. This can be simply done by typing anumbered location after the letter prefix in the Address column. For example, W1, W2...or R1, R2..
Tag Types
· This sets the data type your TAG will be.· Often when you specify the TAG address first, the data TYPE will change to reflect
your tag address selected. (Different addresses in devices hold certain types ofdata.)
Tag Defaults
· Click here to create a default value for the tag.· Download these default values to the ESA unit under the "BUILD|DOWNLOAD DEFAULT
VALUES" menu button.· This value will reside in the unit until you decide to change it when the program is
running.
Tag Scaling
· To set up a tag scaling, select the "PROJECT|TAGS" menu item, and go into the TAGsetup table.
· Select the TAG item you want to set up, and click on PROPERTIES.· This brings up the Tag Properties box.· Under the SCALING tab, you can enter in how you want the data to be scaled
internally in the unit. For example, you may want to scale a value calledTEMPERATURE from 0-100.
Winbuild 500077
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
A few words about scaling:· Source -- what the data coming directly from the driver looks like. (Analog card,
encoder etc)· Scaled -- the values you, the user, wants to use.
For example:
An analog card puts out numbers between -4096 and 4095, but you want to dealwith it as a 0-100.
· Set your source to -4096 min, 4095 max· Set scaled to 0 min, 100 max.
Then, anything you read will be in the range of 0 to 100. The numbers you write willbe in the range 0-100, but the actual number the driver gets will be between -4096and 4095. It's a simple slope/intercept calculation.
If you want to get the data directly from the driver without any scaling, you just make surethat the source and scale values are equal, getting simple unscaled data. If you want to setlimits on the the "unscaled data", you have to do it for both, otherwise the data will beingscaled.
Any code you (the user) writes will deal with scaled data only.
One should also realize that massive scaling of data can, like in any math lead to roundingerrors.
Modbus Register Mapping
All of your tags (registers) in the ESA unit program can be mapped to Modbus registersaccessible by other devices connected to the ESA Technology unit. Registers are accessibleover Modbus TCP/IP connection.
Project Menu 78
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Tasks
The multitasking system in WinBuild 5000 allows you to build background tasks into yourapplication. These background tasks run continuously regardless of the screen displayed onthe HMI. This is useful for creating alarms, or polling information continually from anexternal device and monitoring and controlling systems.
Subroutines
Subroutines are sections of code that can be run at any time from your program by usingthe GOSUB statement. These codes execute, finish, and then RETURN back to the code fromwhich they were called.
Build Menu
IV
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Build Menu 80
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Build Menu
Compile Program· Once your program has been completely set up, it needs to be compiled before
downloading to the ESA Technology unit. To compile your program, select "BUILD COMPILE" from the menu.
· A progress bar will appear, gathering up information from the database, and then theprogram is converted to executable code for downloading to the unit.
Download Program· After a successful compile, the program is then available for download. Select "BUILD
DOWNLOAD" to perform this function. A progress bar will appear. The downloadtime will then vary depending on size of program, and number of images in theproject.
· After downloading is complete, the ESA unit will automatically restart using thenewly downloaded program. If this does not occur, just cycle power to the unit -OR-push the RESET button on the bottom of the unit -OR- select the "BUILD RESTARTPROGRAM" item in Winbuild 5000.
Download Non-Volatile Default Data· This function will download the default values you've specified in the "Default"
column of the PLC Contact and tag Setup dialog box.
Download Everything· This option forces a full download of all program files, recipes, and nonvolatile
variables. (Great for when first downloading all the new files to a unit.)
Download Everything to Image...· This packages your program into a file that can be distributed to end users, who then
use the Downloader Utility to update their units. File is stored in a zipped format. (Tobe implemented soon)
Download Everything to CompactFlash· Selecting this option allows the user to download all program files to a CompactFlash
card attached to the PC. This allows the user to create a brand new ET5000LXsystem disk at their PC, and transfer all program files onto a flash that can then besent to a remote unit's location for installation.
Restart Program· This forces the ESA unit to quit the current application, and restart it.
Configuration Mode· This option puts the unit into a configuration mode that will allow you set the IP
address of the unit, and calibrate the touch screen. (More tools to be implemented intime)
Calibrate Touchscreen· Selecting this option will put the ESA 5000 terminal into the touchscreen calibration
mode.
Winbuild 500081
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Standby/Downloadmode· This option puts the unit into a mode that safely allows download of program files to
the unit.
Reboot Unit· Selecting this option will force the unit to fully reboot.
Tools
V
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 500083
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Tools
Alarm WizardHelps you set up an alarm system that triggers off tag values. Logs events, and creates ascreen to display them where you can acknowledge them. Alarm Wizard not available at thistime.
Tag WatcherAllows you to watch volatile tags on your unit from your PC. Good for debugging programs.Also allows you to set values back down in the unit from PC.
6501 IO Module ConfigurationThis utility allows you to setup your 6501 IO modules. See documentation in the ET6500manual for full instructions on using this utility.
Downloader Utility
The ESA Technology Downloader Utility provides a means to distribute and update programsin the 5000 Family unit without requiring the end user to own a full installed copy ofWinBuild 5000.
By using the "BUILD DOWNLOAD EVERYTHING TO IMAGE" option in WinBuild 5000, thedeveloper can create a compiled, packaged file (.EDI) that can then be distributed to theend user. Nonvolatile values, recipe setups, and ethernet configurations are also exported.
The end user can then take the .EDI file, and download the files into the ESA unit with theDownloader Utility.
The utility is simple to use, and requires only 3 steps:1. Connect unit to PC.2. Specify file to download.3. Click "download button"
For more information on setting up and using the utility, just start the utility (Start Programs Winbuild5000 ProgramDownloader). The simple steps documenting theprocess are right there on the application screen.
NOTE: This feature is not yet available from Winbuild 5000. When the CompactFlash creation toolis available for users, the Image Downloader utility will be functional, and allow users to downloadprograms to an image file. Contact ESA Technology for latest information on tools available.
Tools 84
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Tag Watcher
The Tag Watch Window tool is available to allow you to view application tags in the ESA unitremotely from your PC as the application is running. To start the Tag Watch Window, selectthe menu option TOOLS Tag Watcher.Multiple instances of the watch window can be opened at once.
Tag: Type name of tag to readhere.Value: The value of the data tagwill be reported here. Also, youcan type a value into thislocation to CHANGE tag valueback in the unit.Start Update: Begins readingvalues from unit, and specifiedupdate interval.Read Once: Reads tag valuesone time from the unit.Update Interval: Sets howoften the tag watcher utility willtry to read values from the unit.Configuration: Lets you setconnection type to device. (Seebelow)Exit: Exits tag watcher utility.
Serial: Select serial port onyour PC to use as connection toyour unit.-or-TCP/IP: Enter IP address ofunit to connect with.
Winbuild 500085
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
6501 IO Module Configuration
See the ET6500 IO module manual for documentation regarding use of the configurationsoftware. (Part Number 50-00220-01)
Recipe System
VI
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 500087
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Recipe System
The ESA Technology WinBuild 5000 software provides recipe services that allow users tocreate a predefined data structure using Tags (ingredients) in the Tag database. Users canthen add, delete, and edit individual records in the recipe database within their WinBuild5000 programs.
The offline database can then be downloaded to the ESA unit to provide the online versionof the recipe database to the panel operator. The operator can add, delete, and edit theindividual records in the online recipe database as necessary. This recipe data can then beuploaded from the ESA unit back into the offline database (PC) to maintain the offlinedatabase as the master copy of the database.
Recipe Quick Step-Through
Recipe Quick-Step
· RECIPE NEW RECIPE SYSTEM to initiate wizard.
· Follow steps to designate XLS file as recipe file
· Add recipe tags to database.
· Designate a KEY value. (Value which records will be indexed from, ie. 'part number')
· Click OK when done.
· Use the RECIPE DOWNLOAD RECIPE DATA to load values to ESA unit.
Adding Recipe Records
· Open "RECIPE|MAINTAIN RECIPE DATA" from the main menu. The recipe wizardwill invoke.
· Select "Edit Tags" from the menu.· Fill in your tag names, data types, and default values into the grid.· Select a KEY value. While there may be duplicate values for the key item, a unique
key value will help the search function to find the correct record.· Finish the wizard by clicking "Finish"
Now to add values to your records:
· Open the "RECIPE|EDIT RECIPE DATA" menu item.· This will invoke EXCEL editor to allow you to enter values into your records.· Add values to each row to create records.· Spare records can be added by creating blank cells with the value _SPARE_, with just
the header "Recipe# X...."
Recipe System 88
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Adding Recipe Ingredients
· Open "RECIPE|MAINTAIN RECIPE" from the main menu.
· Click on "Edit Recipe"
· Use the grid to enter in new records, data type & default values.
-OR-
· Open "RECIPE|EDIT RECIPE DATA" to invoke the EXCEL editor.
· Add more ingredients to the EXCEL spreadsheet by adding them below the existingingredients in your file.
· Be sure to add values to your record columns.
Winbuild 500089
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Recipe BASIC Codes
Note: These codes become available to use after you have added the recipe driverto your project. They will be listed in the BASIC Editor box in the 'pseudocodes'list.
RECIPE: ADD - System will add a new, blank record to the data set.
RECIPE: COPY - System will copy the current record & its data to a spare record.
RECIPE: DELETE - Will delete currently viewed record & designate it as an empty spare.
RECIPE: FIND BY KEY - Will make recipe system load a record based off key value youhave entered.
RecipeFindRecord(string$ ) - This BASIC code will find the recipe record string$ andreturn a 1 or 0 if the record is found.
RECIPE: LOAD DEFAULT - System will load default values into the currently viewedrecord.
RECIPE: NEXT - This code will make the recipe system index to the next available record.
RECIPE: PREVIOUS - This code will make the recipe system index back one record.
RECIPE: SAVE - This will make the system save the currently viewed record & its data.
Recipe System Rules
If you plan on editing the source EXCEL spreadsheet file, keep the following rules in mind:
· The recipe data must be the first worksheet in the workbook· The name of the key tag MUST be in cell B4· The data MUST start at cell B12· There are the description rows:
Name, Description, Type, Min, Max, Read Only, Default
· Below the description rows are the data rows. The system figures out how manyrecords (including spares) you have by counting the number of data rows.
· The columns describe the recipe elements. If a column has an empty first row, it isjust ignored.
· The first row of data that isn't completely full of data is counted as the first sparerecord, and any records below it are ignored.
Recipe System 90
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Recipe System Screens
Recipe Select Screen
Winbuild 500091
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Prev - Selects previous record in dataset.Next - Selects next record in dataset.Add - Adds a new record to the dataset. (Created from a spare)Copy - Will copy the current record and its values into a new record. (Created from a spare)Create - Will create a new record with the entered key value. (Created from a spare)Delete - Deletes the current record and all its values. (Creating a spare)Edit - Allows you to edit the current record you are viewing.Exit- Will exit current screen, and return to where you came from
Status- This box will display any messages regarding the record your'e viewing- or promptyou if you need there is a problem.
Recipe Edit Screen
Use this screen to change the values of your recipe record. Touch the recipe tag on-screen &change the value. Use the arrow keys on the scroll bar to move up/down in the list ifnecessary.
Exit - leave recipe edit screen.
Recipe System 92
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Recipe MessageBox Screen
This screen is used to prompt the user when deleting/copying recipes, and shouldn't bemodified. The system will use this screen when necessary.
Recipe Copy Screen
This screen is used to prompt the user when copying recipes, and shouldn't be modified.The system will use this screen when necessary.
Options Menu
VII
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Options Menu 94
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Options Menu
Communications
Editor
Communications
Select which serial port on your PC you wish to use for program downloading, or selectTCP/IP connection, and specify IP address of ESA unit.
Winbuild 500095
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Editor
Use this menu to set up default configuration for the builder's editor environment. Whenobjects are placed on screen, they will use these default colors/text settings.
Screens
VIII
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 500097
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Screens
WinBuild 5000 uses "Screens" to manage data, objects, and code to be contained at anyparticular point in the program. Each "Screen" is represented in a WSYWIG display inWinBuild 5000. Object items are displayed onscreen just like they will be presented whenthe program is running on the unit.
Screen List
Adding Screens
Renaming Screens
Copying screens
Deleting Screens
Screen List
This lists out the screens used by your program. They are listed in alphabetical order, notexecution order. Click on the respective screen you wish to currently view or work on.
The screen with an "M" icon next to it indicates the "MAIN" screen of your project. This isthe screen that will first appear when the project boots on the unit.
Adding Screens
To add a screen to your project, select the "EDIT NEW SCREEN" menu item. A newscreen will be inserted into your project.
· Renaming Screens
Screens 98
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Renaming Screens
WinBuild 5000 lets you rename your screens to make constructing and navigating yourprograms easier. To rename an existing screen, just double click on the background ofthe screen to bring up the Screen Properties dialog box.
In the Name: entry box, retype the new name you wish the screen to be called.
Click OK when done.
Copying Screens
To duplicate a current screen in your project, select "EDIT COPY SCREEN" and thenselect "EDIT PASTE". This will copy every object on your screen to a new screen(including BASIC code on the objects).
Renaming Screens
Deleting Screens
To delete a screen from your project, highlight the screen you wish to delete in the ScreenList and then select the "EDIT DELETE SCREEN" menu item.
Pop-Up Screens
Pop-up Screens allow you to create your own input menu pop-up screens for data entryboxes. To make a screen a pop-up screen, just double click on the background of yourscreen, and in the "Properties" box, click on the "Popup Screen" button.
Here you can also set the X/Y size of the pop-up screen. (pop up will always show upcentered on your normal screen)
Winbuild 500099
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Then construct your own data entry screen as you want it to look- and then use thecommands CALL CLOSEPOPUPCANCEL and CALL CLOSEPOPUPOK commands to close thescreen, and return to your original normal screen.
Subscreens
Subscreens allow you to construct commonly-used HMI items into a "panel" or "boilerplate"that can be then placed many times throughout your program without having to re-createthose objects again for each individual screen.
Make edits in only one place (on the subscreen) and all other screens that reference thatsubscreen will automatically update.
To create a subscreen: Add a normal screen to your project. "EDIT New Screen" Double-click on the background of the screen to bring up its properties, and check thebox to it as a "Subscreen"
To use a subscreen:
Click the SUBSCREEN tool from the toolbar. Click & drop the subscreen to a location on your normal screen. Double-click on subscreen object, and select in the pull-down menu which subscreen youwant displayed here. If you want to resize/reshape the space the subscreen takes onscreen, do this on thesubscreen properties itself. (Edit X Y size)
Screens 100
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Screen Objects
IX
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Screen Objects 102
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Screen Objects
WinBuild 5000 contains tools to easily allow you to place objects on screen for your MMI:
· BarGraphs· Bitmaps (Pictures)· Buttons· Data Entry/Display· Gauges· Messaging· Indicators· Lines, Boxes, Circles· Recipe List Box· Subscreens· Super Buttons· Static Text· Trend Charts
ESA BASIC in WinBuild 5000 now gives you the ability to edit the properties of your screenobjects through code.
· Editing Object Properties in BASIC
BarGraphs
General
Data
Bargraph
Basic Code
BarGraphs: General
Name: Name the object (for reference later when editing object properties through BASIC).
Fill Color: Here you can also set the fill color for the object.
Winbuild 5000103
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BarGraphs: Data
Tag: Select what tag value the object will present.
Element: If tag selected is an array, you can select an individual element number from thatarray to present.
Screen Objects 104
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
BarGraphs: Bargraph
Bargraph Color: Select color of the bar itself.
Orientation: Select direction bargraph will increment.
Min/Max: Set the scaling for the bargraph. (If this is different than the regular scalingused by the tag.)
BarGraphs: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Winbuild 5000105
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Buttons
General
Text
Font
Button
Basic Code
Buttons: Text
Type the object's displayed text here.
Buttons: Button
Screen to Goto: Use this pull-down menu to have the button switch to a screen whenpressed.
Change Tag: Use this pull-down menu to have the button change a tag value whenpressed. Then select a SET value, MOMENTARY, or TOGGLE.
Screen Objects 106
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Buttons: General
Name: Name the object (for reference later when editing object properties through BASIC).
Fill Color: Here you can also set the fill color for the object.
Winbuild 5000107
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Buttons: Font
Select properties of the object's font text.
Buttons: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Screen Objects 108
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Data Entry/Display
General
Font
Entry/Display
Data
Basic Code
Data: Data
Tag: Select what tag value the object will present.
Element: If tag selected is an array, you can select an individual element number from thatarray to present.
Data: General
Name: Name the object (for reference later when editing object properties through BASIC).
Fill Color: Here you can also set the fill color for the object.
Winbuild 5000109
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Data: Font
Font: Select properties of the object's font text.
Screen Objects 110
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Data: Entry/Display
Select:Data Display: Will display value of selected tag.Message Display: Uses built-in messaging system to display a text message based offthe value off the tag.Data Entry: Allows user to edit/change the displayed value.PopUp Data Entry: Creates a pop-up data entry box for user when the value is touchedonsreen.
Format String: Select decimal placement of the display number.
Winbuild 5000111
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Data: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Gauges
Gauge
Data
General
Indicator
Font
Basic Code
Gauge: Gauge
Start: The starting angle for your gauge, from a 360-degree circle.
Arc: The degree swing your gauge will make, from the start point.
Minor: How many divisions there will be between major tick marks.
Major: How many divisions there will be between the start & end points of the gauge.
Min/Max: Specify the scaling used for your data, if you don't want to use the standarddefault scaling that comes with your tag.
Screen Objects 112
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Gauge: Data
Tag: Select tag to associate with this gauge.
Winbuild 5000113
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Gauge: General
Name: Name the object (for reference later when editing object properties through BASIC).
Gauge Color: Select color for the dial itself.
Tick Color: Select color for major/minor ticks on dial.
Background Color: Select color for background of object.
Needle Color: Select color for needle on dial.
Show Labels: Check box to show value labels on the gauge.
Screen Objects 114
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Gauge: Indicator
Min/Max: Select range for a particular color value. Set the min/max to the same value tohave the indicator function off a distinct value.
Gauge: Font
Font: Select properties of the font text.
Winbuild 5000115
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Gauge: Basic Code
Basic Code: Add your own customized BASIC code to this object.
SetFillColor changes the needle colorSetBackgroundColor changes the background colorSetTextColor changes the text color of the labelsSetFont changes the font of the labelsSetSize, SetPosition, SetVisible, SetInvisible will also do the normal things.
Indicators
Indicator: General
Indicator: Data
Indicator: Indicator
Indicator: Basic Code
Screen Objects 116
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Indicator: Data
Tag: Select what tag value the object will present.
Indicator: General
Name: Name the object (for reference later when editing object properties through BASIC).
Winbuild 5000117
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Indicator: Indicator
Min/Max: Select range for a particular color value. Set the min/max to the same value tohave the indicator function off a distinct value.
Indicator: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Screen Objects 118
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Lines, Circles, Rectangles
Properties
Basic Code
Properties
Note also that object properties can be edited through BASIC CODE.
Winbuild 5000119
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Basic Code
Basic Code: Add your own customized BASIC code to this object.
Messaging
Messaging Setup
Displaying Messages
Messaging Setup
· To set up a message select the "PROJECT|Tags" menu item.
· Select the TAG item you want to set up, and click on PROPERTIES.
· Move to the Messages tab.
Messages Tab
· Push the NEW button to add a text message to our TAG.
· Here you can set up a range of values to evaluate, and display correspondingmessage. Combination of text/numbers OK. To make a multi-line message display,add \r\n to middle of message. For example: HELLO\r \nALEX will display:
HELLOALEX
(note there are no spaces between your text and the \r\n codes)
· To select a message to display on a particular FIXED value, just enter in the samevalue in the MIN/MAX columns.
· Text message entry is limited to 64 characters.
Screen Objects 120
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Displaying Messages
After setting up your messaging with your TAG in the Tag Table, you can then display themessages on screen:
· Use the DATA ENTRY tool (the ## signs) to click and drop a data display box ontothe screen.
· Double click on the box you have placed onto the screen.
· Select the DATA ENTRY/DISPLAY tab.
· Click the "Message Display" button. This will display your text message in place ofthe numerical value of the data you've set up.
· Go to the DATA Tab, and pull down the TAG data you want to be displayed.
This will now associate this display item with the TAG you've selected. Depending on thevalue of your TAG, different text messages will be displayed based the tag properties youset up in the TAG TABLE.
Pictures (Bitmaps)
General
Picture
Basic Code
Pictures: Picture
Picture Filename: Select name of file to display onscreen. Use the "..." button to browse& select.
Reset Picture Size: This will set onscreen picture back to its native resolution. (if it hasbeen resized manually) Note that pictures that have been scaled on screen will take a bitlonger to display. For best screen performance, scale the images first before inserting intothe project so that the ESA unit isn't burdened with scaling the image every time it is drawnon the screen.
Winbuild 5000121
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Pictures: General
Name: Name the object (for reference later when editing object properties through BASIC).
Screen Objects 122
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Pictures: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Recipe List Box
This object is only used by the Recipe Wizard when creating your recipe screens. Unlessyou are hand-building your own recipe editor screens, you do not need to ever use orconfigure this object.
Subscreens
Subscreens allow you to construct commonly-used HMI items into a "panel" or "boilerplate"that can be then placed many times throughout your program without having to re-createthose objects again for each individual screen.
Make edits in only one place (on the subscreen) and all other screens that reference thatsubscreen will automatically update.
To create a subscreen: Add a normal screen to your project. "EDIT New Screen" Double-click on the background of the screen to bring up its properties, and check thebox to it as a "Subscreen"
To use a subscreen:
Click the SUBSCREEN tool from the toolbar. Click & drop the subscreen to a location on your normal screen. Double-click on subscreen object, and select in the pull-down menu which subscreen you
Winbuild 5000123
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
want displayed here. If you want to resize/reshape the space the subscreen takes onscreen, do this on thesubscreen properties itself. (Edit X Y size)
Static Text
Text: Text
Text: General
Text: Font
Text: Basic Code
Screen Objects 124
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Text: Text
Text: Type here the text you wish to display.
Text: General
Name: Name the object (for reference later when editing object properties through BASIC).
Winbuild 5000125
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Text: Font
Font: Select properties of the font text.
Text: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Screen Objects 126
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Super Buttons
Data
General
Color Ranges
Button Font
Caption Font
Button
Basic Code
SuperButton: Data
Caption: Enter text for the caption above the button.
Tag: If desired, select a tag to use for displaying text on the button. Otherwise, use theTEXT box to enter a string.
Size: Move the slider to adjust how much of the SuperButton space is taken up by thebutton itself.
Winbuild 5000127
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
SuperButton: General
Name: Name the object (for reference later when editing object properties through BASIC).
Fill Color/Background Color: Select colors for object.
SuperButton: ColorRanges
Tag: Select what tag value the object will base its button color on present.
Min/Max: Select range for a particular color value. Set the min/max to the same value tohave the indicator function off a distinct value.
Screen Objects 128
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 5000129
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
SuperButton: Button Font
Font: Select properties of the button's font text.
Screen Objects 130
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SuperButton: Caption Font
Font: Select properties of the superbutton's caption text font.
SuperButton: Button
Screen to Goto: Use this pull-down menu to have the button switch to a screen whenpressed.
Change Tag: Use this pull-down menu to have the button change a tag value whenpressed. Then select a SET value, MOMENTARY, or TOGGLE.
Winbuild 5000131
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Screen Objects 132
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SuperButton: Basic Code
Basic Code: Add your own customized BASIC code to this object.
Trend Charts
Trend charts are also known as run charts, and are used to show trends in data over time.All processes vary, so single point measurements can be misleading. Displaying data overtime increases understanding of the real performance of a process, particularly with regardto an established target or goal. Trend charts use the Data Acquisition Driver to plot dataonto the screen.
Quick-Step Setup
General
Elements
Axes
Legend Font
Axes Font
Label Font
Basic Code
Winbuild 5000133
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Trend Chart Setup
Here is a quick step-through on how to get a trend chart set up and going.
1. Add Data Acquisition driver to project.2. Add a tag to project that references Data Acquisition driver (create a tag that
the Data Acq driver will log).3. Click & add a trend chart to your project screen.4. Set up the trend chart, and select Data Acq driver to associate with the chart.5. Set chart properties for circular or rolling display, number of points to plot, and
other properties.
Trend: General
Name: Name the object (for reference later when editing object properties through BASIC).Canvas Color: Select background color for trend chart.Border Color: Select color for border of trend chart.Graph Color: Select color for graph on the chart.Legend Color: Select color for legend on chart. (Use check box to select option to displaylegend)Grid Style: Select style for lines in the chart.Grid Color: Select color of grid lines.Grid Width: Select width for grid lines.
Screen Objects 134
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Trend: Elements
Data Acquisition Driver: Select which data driver you want to associate with this trendchart.
The tags associated with this driver will then appear, allowing you to choose the line style,color, width, symbol & style of the plot.
Trend: Axes
Title: Give title for each axis.Points to Display: Specify how many points to plot onto the trend chart. (Thus must beequal or lesser than total number of points used in your data acquisition driver.)Major Interval: This is how far apart each major "tick" on the graph will be displayed.Minor Ticks: This is how many "ticks" will be displayed in between each major mark.Circular Display: Check this box to have the trend chart wrap-around and start plottingfrom the beginning. (Rather than continue rolling to the right)Show Labels: Check this box to display axis labels on the graph.
Winbuild 5000135
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Trend: Legend Font
Font: Select properties of the trend chart's legend font.
Screen Objects 136
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Trend: Axes Font
Font: Select properties of the trend chart's axes label font.
Winbuild 5000137
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Trend: Label Font
Font: Select properties of the trend chart's label font.
Screen Objects 138
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Trend: Basic Code
Basic Code: Add your own customized BASIC code to this object.
BASIC Codes
X
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BASIC Codes 140
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
BASIC Codes
BASIC is an easy-to-use computer programming language that uses simple commandswritten in English. The code editor in WinBuild 5000 allows the user to insert BASIC codemodules into their application. This code can DRAMATICALLY INCREASEFUNCTIONALITY of the application software by allowing the user to create customizedcode specific for their application, all without having to become advanced programmers.See "Adding code" section of the Manual and/or Help System for information on adding andmodifying code within your program.
This manual will outline the BASIC commands available in the WinBuild 5000 BASIC system.Syntax, function, and occasionally example code is included to illustrate usage.
About ESA Tech BASIC
· TAGS: Constants & Variables· Using The Editor· BASIC Subroutines· BASIC Tasks· BASIC Operators· Reserved Words· ASCII Character Codes· BASIC Functions & Commands
Adding/Editing BASIC Code
To add BASIC Code to your project,select one of the options.
In the Basic Code Editor dialog box,you can easily switch to anothertrigger by using the pull down menuin the upper left.
In fact the upper menu allows youto quickly edit the Basic Code of anyobject in your program by selecting
Winbuild 5000141
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
ESA Tech BASIC Codes (Pseudocodes)
The following section will briefly describe the BASIC codes (pseudocodes) available, theirfunction, and parameters.
See RECIPES for explanation of recipe psuedocodes.
COM: GET COM port NUMBER OF CHARACTERS character TAG tagThis BASIC code will retrieve the specified number of characters from the communicationport, and place them into a tag. Note: if there are fewer than the specified number ofcharacters in the incoming buffer, those characters will be deleted, and a null stringreturned. Use in conjunction with the INBUFFERCOUNT function.
COM: PURGE COM port BUFFERThis code will clear the buffer for the COM port you specify.
COM: GET COM port TAG tagThis code will retrieve information from the COM port you specify, and then place it into aparticular TAG. A <CR> is used as termination character for the incoming string.
COM: INITThis command will initialize the COM port you specify, with particular parameters.Selecting this brings up a pull down menu system where you can configure port settingssuch as baud rate, parity, echo features, etc. Choose these settings carefully to match thecommunication setups in your external devices.
COM: PUT COM port VALUE expressionThis code will send a particular value from the specified TAG out the COM port you choose.A <CR> is added to the outgoing string.
COM: PUT COM port VALUE expression RESPONSE tagThis code will send a particular value from the specified TAG (or text string) out the COMport you choose, and then read the response into the second TAG chosen. A <CR> isadded to the outgoing string. Also, <CR> is used as termination character for theincoming response string.
COM: PUT COM port VALUE expression VALUE expressionThis code will send out a mixture of ASCII TEXT of your creation, as well as TAG data. A<CR> is added to the outgoing string.
COM: PUT COM port VALUE expression VALUE expression RESPONSE tagThis code will send out a mixture of ASCII TEXT of your creation, as well as TAG data, andthen read the response back into a TAG. A <CR> is added to the outgoing string. Also,<CR> is used as termination character for the incoming response string.
DRIVER: PURGE BUFFERThis code will clear the buffer for the device driver/COM port you specify.
DRIVER: PUTThis code will take your text or tag string, formulate it into the appropriate driver protocol,
BASIC Codes 142
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
and send it out the port.
DRIVER: PUT MIXEDThis code will take your text and tag string, formulate it into the appropriate driverprotocol, and send it out the port.
DRIVER: PUT MIXED RESPONSEThis code will take your text and tag string, formulate it into the appropriate driverprotocol, and send it out the port. The response from your device driver will then be putinto a destination tag.
DRIVER: PUT RESPONSEThis code will take your text or tag string, formulate it into the appropriate driver protocol,and send it out the port. The response from your device driver will then be put into adestination tag.
GET DRIVER STATUS driver tagUse this code to get the status of a driver and place it into tag. 0-offline, 1-suspended, 2-online.
SWITCH TO SCREEN screenSwitch to the screen you choose. Code following this statement will still get executed, andat next screen redraw, the screen will be switched.
SET DRIVER driver statusUse this code to set a driver online, offline, or suspend.
SWITCH TO PREVIOUS SCREENUtilization of the BASIC code will make your HMI screen switch back to the last screen itwas displaying. This is particularly useful in exiting HELP screens that are accessed frommultiple screen locations in your program.
BASIC Constants
Use system tags for all program values, variable or constant. Add these system tags in thesystem tag table under "PROJECT|Tags".
Constants are static values the BASIC Interpreter uses during execution of your program.There are two types of constants: string and numeric .
A string constant is a sequence of 0 to 127 alphanumeric characters enclosed in doublequotation marks. The following are string constants:
"HELLO""$25,000.00""Number of Employees"
Winbuild 5000143
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Numeric constants can be positive or negative. When entering a numeric constant in BASIC,you should not type the commas. For instance, if the number 10,000 were to be entered asa constant, it would be typed as 10000. There are five types of numeric constants: integer,long integer, and floating-point.
When planning to use such data types in your application, you must enter these into the tagtable under 'PROJECT|Tags." When entering tag names, be sure to specify the tag type inthe 'type' column. See Supported Data Types.
Constants can be specified using Hex, Octal, or Binary notation as well:
X = FFFFhX = 777oX = 10101b
Respectivally, hex, octal, and binary numbers (in this case 65535, 511, and 21). Thesework in all cases where decimal numbers would be expected.
In addition, the following escape sequences have been added for string literals (which arejust to bring it inline with C, not because I think anyone will really use them). Check
BEL \a aka 07hBS \b aka 08hFF \f aka 0ChHT \t aka 09hVT \v aka 0Bh
In addition, hex and octal (but not binary, sorry) escape sequences will be supported instring literals.
So:
mystring$ = "\h48\h45\h4c\h4c\h4f"mystring$ = "\o110\o105\o114\o114\o117"
are the same as
mystring$ = "HELLO"
BASIC Operators
Logical operators perform tests on multiple relations, bit manipulation, or Booleanoperations. The logical operator returns a bit-wise result which is either true (not zero) orfalse (zero). In an expression, logical operations are performed after arithmetic andrelational operations. The outcome of a logical operation is determined as shown in the
following table. The operators listed in order of precedence. SEE BITWISE OPERATORS
Results Returned by Logical Operations
BASIC Codes 144
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Operation Value Value Result
NOT X - NOT X
T - F
F - T
AND X Y X AND Y
T T T
T F F
F T F
F F F
OR X Y X OR Y
T T T
T F T
F T T
F F F
XOR X Y X XOR Y
T T F
T F T
F T T
F F F
Just as the relational operators can be used to make decisions regarding program flow,logical operators can connect two or more relations and return a true or false value to beused in a decision.
For example:IF D<200 AND F<4 THEN A=1IF I>10 OR K<0 THEN P=50IF NOT P THEN A=0
Logical operators convert their operands to 16-bit, signed, two's complement integers withinthe range of –32768 to +32767. If the operands are not within this range, an error results.If both operands are supplied as 0 or –1. The given operation is performed on these integersin bits; that is, each bit of the result is determined by the corresponding bits in the twooperands.Thus, it is possible to use logical operators to test bytes for particular bit pattern. Forinstance, the AND operator may be used to mask all but one of the bits of a status byte at amachine I/O port. The OR operator may be used to merge two bytes to create a particularbinary value. The following examples demonstrate how the logical operators work:
Example Explanation
63 AND 16=16 63=binary 111111 and 16=binary 10000, so 63 AND 16=16
15 AND 14=14 15=binary 1111 and 14=binary 1110, so 15 AND 14=14 (binary 1110)
-1 AND 8=8 -1 binary 1111111111111111 and 8=binary 1000, so –1 and 8=8
4 OR 2=6 4=binary 100 and 2=binary 10, so 4 OR 2=6 (binary 110)
10 OR 10=10 10=binary 1010, so 1010 OR 1010=1010(10)
Winbuild 5000145
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
-1 OR –2 = -1 -1 binary 1111111111111111 and –2 binary 1111111111111110, so
–1 OR –2=.1. The bit complement of 16 zeros is 16 ones, which is the two's complement
representation of –1.
NOT X = - (X+1) The two's complement of any integer is the bit complement plus one.
BASIC Variables
Variables are the names that you have chosen to represent values used in a BASICprogram. The value of a variable may be assigned specifically, or may be the result ofcalculations in your program. If a variable is assigned no value, BASIC assumes thevariable's value to be zero.
Variable names may be up to 16 characters long. The characters allowed in a variable (thusTAG) name are letters and numbers.
Reserved words (all the words used in BASIC commands, statements, functions, andoperators) can't be used as variable names. However if the reserved word is embeddedwithin the variable name, it will be allowed. The ESA unit tag table will verify tag names asyou enter them for conflicts with reserved words. If a conflict is detected, the tag name willbe slightly altered to differentiate it, or the system will notify you of the conflict, and promptyou to alter the tag name.
Variables may represent either numeric values or strings.
Mathematics With Data Types
Constant TypesConstants without decimal points will be a DWORD, if they will overflow a DWORD, they willbe of type UDWORD. Constants outside the range of a DWORD and UDWORD will bepromoted to DREAL.
If you want a number interpreted as a REAL, you will have to use a decimal. ex. 1 – typeDWORD 1. – type REAL 2E28 – type REAL -3e300 – type DREAL 4294967295 – typeUDWORD 594587896423 – type DREAL
Type ConversionFor operator +, -, /, *: overload resolution will promote BYTEs and UBYTEs to WORDs, andREALs to DREALs. For example: my_word = my_byte + my_other_byte The result of'my_byte + my_other_byte' is a word. If both operands were -128, the result will be 256. Ifthe result of the operation overflows the return type, the result of the operation will bezero.
BASIC Codes 146
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
ScalingThe 'scale to' properties of a tag will be respected in BASIC. ex. My_word is a WORD withlimits of 0 to 100 for both source data and scaled data. After the following two statements:my_word = 15 my_word = 200 My_word will be equal to 15.
Function Return TypesThe return type of the trigonometric functions is REAL. OR, NOT, AND all return WORDs.Bitwise operations return the type of the largest type, or the unsigned if the types are of thesame size (e.g. BITAND( my_byte, my_uword) returns a UWORD, BITOR( my_word,my_uword) returns a UWORD).
Operator PrecedenceThe order of operations is left to right. are as follows, from highest precedence to lowestprecedence:
Level Onepower - ^
Level Twomultiply - *divide - /
Level Threeplus - +minus - -
Level FourORANDNOT
Commands & Functions
ArraysARRAYS
Binary FunctionsBIN2BYTEBIN2UBYTEBIN2WORDBIN2UWORDBIN2DWORDBIN2UDWORDBIN2REALBIN2DREALBYTE2BIN$
Winbuild 5000147
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
DREAL2BIN$DWORD2BIN$REAL2BIN$UBYTE2BIN$UDWORD2BIN$UWORD2BIN$WORD2BIN$
Bitwise OperatorsBITANDBITXORBITNOTBITSETBITCLEARBITATBITSHIFTLBITSHIFTR
Communication CodesCOMCLEARCOMGET$COMGETBIN$COMGETBINUNTILCOM INITCOMPUTCOMPUTBINCOMPUTGET$COMPUTGETBIN$COMPUTGETBINUNTIL$INBUFFERCOUNTINKEYINKEY$INPORTBINPORTWOUTPORTBOUTPORTW
Control StatementsCASEDO WHILE...LOOPFOR/NEXTGOSUBGOTOIF...THEN...ELSE...ENDIFLABELREMRETURNWAIT
Date and Time FunctionsCALL SETDATE
BASIC Codes 148
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CALL SETTIME CLOCKDATEDATE$DAYOFWEEKTIMETIME$
Object Properties
CALL CLOSEPOPUPOK
CALL CLOSEPOPUPCANCEL
SETBACKGROUNDCOLOR
SETCAPTIONFILLCOLOR
SETCAPTIONTEXT
SETCAPTIONTEXTCOLOR
SETDISABLED
SETENABLED
SETFILLCOLORSETFILENAMESETFONTSETINVISIBLE
SETLINECOLOR
SETPOSITION SETSIZESETTEXTSETTEXTCOLOR
Mathematical FunctionsABSACOSASCASINATANBCC8WBINBIN$COSCRC16CRC32DEGEXPFRACHEXHEX$INTLOGLOG10LOG2MAXMIN
Winbuild 5000149
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
MODOCTOCT$PIRADRNDROUNDSGNSINSQRTTAN^
String FunctionsCHR$FILLSTRING$FORMAT$LENLEFT$LOWER$LTRIM$MID$POSRIGHT$RTRIM$ STR$TRIM$UPPER$VAL
System CallsCALL CONFIGMODECALL DOWNLOADMODECALL REBOOTCALL RESTART
Arrays
Arrays are indexed collections of numbers or strings. An array value is typically regarded asa distinct entity rather than an indexed collection of entities. With ESA Technology BASIC,single dimension arrays are supported- and there is no need to pre-dimension the array.
Creating Arrays
Using Arrays
CALL ARRAYSETNUMERIC
CALL ARRAYSETSTRING
BASIC Codes 150
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Creating Arrays
Create an array in the 'PROJECT|TAGS' table, under the 'Address' column. Specify the datatype with as you normally would for any other internal volatile- then add the maximum sizeyou wish the array to be in parenthesis.
For example to create a word tag called 'ESATECH' with dimension of 100.
Arrays can be sourced either from the internal volatile memory, or stored via internal non-volatile memory.
Using Arrays
When programming in BASIC, refer to each array value by its indexed value. Numericvariables can be used for the index value.
For example to set tag 'NEWTEMP' to index value 10 in the array called 'ESATECH':
NEWTEMP = ESATECH(10)
-or-NEWTEMP = ESATECH(FRED)
(Where FRED is a variable with any value 1 to n)
CALL ARRAYSETNUMERIC
Purpose:
Quickly sets the value of numeric array elements.
Syntax:
CALL ARRAYSETNUMERIC( "array_name", start_element, end_element, value ) where:
array_name$ contains the name of the arraystart_element contains the lower range of the array element rangeend_element contains the upper range of the array element range
Winbuild 5000151
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
value contains the number to write to each element
Comment:
The first parameter is a string value containing the name of the array, e.g. "x" for anarray named x.
Example:
CALL ARRAYSETNUMERIC( "my_array", 20, 30, -1 )
The value of –1 will be written to array elements 20 through 30 for my_array.
CALL SETARRAYSTRING
Purpose:
Quickly sets the value of string array elements.
Syntax:
CALL ARRAYSETSTRING( array_name$, start_element, end_element, value$ ) where:
array_name$ contains the name of the arraystart_element contains the lower range of the array element rangeend_element contains the upper range of the array element rangevalue$ contains the string to write to each element
Comment:
The first parameter is a string value containing the name of the array, e.g. "name" foran array named name.
Example:
CALL ARRAYSETNUMERIC( "my_string_array", 3, 10, "blank" )
The value of "blank" will be written to array elements 3 through 10 formy_string_array$.
BASIC Codes 152
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Binary Functions
ABOUT BINARY FUNCTIONS
BIN2BYTE
BIN2UBYTE
BIN2WORD
BIN2UWORD
BIN2DWORD
BIN2UDWORD
BIN2REAL
BIN2DREAL
BYTE2BIN$
DREAL2BIN$
DWORD2BIN$
REAL2BIN$
UBYTE2BIN$
UDWORD2BIN$
UWORD2BIN$
WORD2BIN$
About Binary Functions
The binary functions take a binary string (the new type in the volatile and nonvolatilefunctions), and covert the binary data in the string to the specified data type.
This is not a text string containing 0s and 1s. You cannot view the data in a binary string,because it is quite possible that the characters in the string are not human-readablecharacters.
So, for example, a binary string containing the following bytes (displayed here in hex)0x8E 0x81 0x19 0x98
Would have the following results for the binary functions.BIN2BYTE would return -114 (only takes one byte, in this case, 0x8E)BIN2UBYTE would return 142 (only takes one byte, in this case, 0x8E)BIN2WORD would return -32370 (takes the 0x8E (low byte) and 0x81 (high byte) )BIN2UWORD would return 33166 (takes the 0x8E (low byte) and 0x81 (high byte) )BIN2DWORD would return -1743158898 (take all four bytes)BIN2UWORD would return 2551808398 (take all four bytes)BIN2REAL and BIN2DREAL do the same, but require IEEE format (4 byte for REAL, 8 bytesfor DREAL)
Winbuild 5000153
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BIN2BYTE
Purpose:
This function converts a binary string to a byte
Syntax:
BYTETAG = BIN2BYTE( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string. Floating point number areread as IEEE 754 format, 4 bytes for REALs, 8 bytes for DREALs.
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
BYTETAG = BIN2BYTE( BINSTRING$ )
BYTETAG contains -1
BIN2UBYTE
Purpose:
This function converts a binary string to a unsigned byte
Syntax:
UBYTETAG = BIN2UBYTE( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
BYTETAG = BIN2BYTE( BINSTRING$ )
BASIC Codes 154
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
-- BYTETAG contains -1
UBYTETAG = BIN2UBYTE( BINSTRING$ )
-- UBYTETAG contains 255
BIN2DREAL
Purpose:
This function converts a binary string to a dreal
Syntax:
DREALTAG = BIN2DREAL( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.
Floating point number are read as IEEE 754 format, 4 bytes for REALs, 8 bytes forDREALs.
BIN2REAL
Purpose:
This function converts a binary string to a real
Syntax:
REALTAG = BIN2REAL( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.
Floating point number are read as IEEE 754 format, 4 bytes for REALs, 8 bytes forDREALs.
Winbuild 5000155
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BIN2WORD
Purpose:
This function converts a binary string to a word
Syntax:
WORDTAG = BIN2WORD( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.Words (signed or unsigned) are read little-endian (low-byte high-byte), so that thenumber (0x12) (0x34) is actually read as 0x3412.
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
WORDTAG = BIN2WORD( BINSTRING$ )
-- WORDTAG contains -1
BIN2DWORD
Purpose:
This function converts a binary string to a double word
Syntax:
DWORDTAG = BIN2DWORD( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.
Words (signed or unsigned) are read little-endian (low-byte high-byte), so that thenumber (0x12) (0x34) is actually read as 0x3412.
Similarly, for double words (signed or unsigned), the string (0x12) (0x34) (0x56) (0x78)would actually be read as 0x78563412.
BASIC Codes 156
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
DWORDTAG = BIN2DWORD( BINSTRING$ )
-- DWORDTAG contains –16711681
BIN2UWORD
Purpose:
This function converts a binary string to a unsigned word
Syntax:
UWORDTAG = BIN2UWORD( BINSTRING$ )
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.Words (signed or unsigned) are read little-endian (low-byte high-byte), so that thenumber (0x12) (0x34) is actually read as 0x3412.
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
UWORDTAG = BIN2UWORD( BINSTRING$ )
-- UWORDTAG contains 65535
BIN2UDWORD
Purpose:
This function converts a binary string to a unsigned double word
Syntax:
UDWORDTAG = BIN2UDWORD( BINSTRING$ )
Winbuild 5000157
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Comments:
These functions will take a binary string, and return, as the desired type, the valuerepresented by the first 1,2,4 or 8 bytes of the binary string.
Similarly, for double words (signed or unsigned), the string (0x12) (0x34) (0x56) (0x78)would actually be read as 0x78563412.
Example:
BINSTRING$ is a 4 byte binary string containing the bytes:(0xFF) (0xFF) (0x00) (0xFF)
UDWORDTAG = BIN2UDWORD( BINSTRING$ )
- UDWORDTAG contains 4278255615
BYTE2BIN$
Purpose:
These function return the binary string equivalent of a value
Syntax:
BINSTRING$ = BYTE2BIN$( BYTETAG )
Comments:
These functions will return the binary representation of number.
Example:
BINSTRING$ = BYTE2BIN$( -1 )
-- BINSTRING$ contains (0xFF)
DREAL2BIN$
Purpose:
This function returns the binary string equivalent of a value
Syntax:
BASIC Codes 158
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
BINSTRING$ = DREAL2BIN$( DREALTAG )
Comments:
These functions will return the binary representation of number.
Floating point number are output in IEEE 754 format, 4 bytes for REALs, 8 bytes forDREALs.
DWORD2BIN$
Purpose:
These function return the binary string equivalent of a value
Syntax:
BINSTRING$ = DWORD2BIN$( DWORDTAG )
Comments:
These functions will return the binary representation of number.Similarly, for double words, the number 0x12345678 would actually be read as (0x78)(0x56) (0x34) (0x12).
Example:
BINSTRING$ = DWORD2BIN$( -16711681 )
-- BINSTRING$ contains (0xFF) (0xFF) (0x00) (0xFF)
UBYTE2BIN$
Purpose:
This function returns the binary string equivalent of a value
Syntax:
BINSTRING$ = UBYTE2BIN$( UBYTETAG )
Comments:
These functions will return the binary representation of number.
Winbuild 5000159
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Example:
BINSTRING$ = UBYTE2BIN$( 255 )
-- BINSTRING$ contains (0xFF)
REAL2BIN$
Purpose:
These function return the binary string equivalent of a value
Syntax:
BINSTRING$ = REAL2BIN$( REALTAG )
Comments:
These functions will return the binary representation of number.
Floating point number are output in IEEE 754 format, 4 bytes for REALs, 8 bytes forDREALs.
UDWORD2BIN$
Purpose:
This function returns the binary string equivalent of a value
Syntax:
BINSTRING$ = UDWORD2BIN$ ( UDWORDTAG )
Comments:
These functions will return the binary representation of number.Similarly, for double words, the number 0x12345678 would actually be read as (0x78)(0x56) (0x34) (0x12).
Example:
BINSTRING$ = UDWORD2BIN$(4278255615 )
BASIC Codes 160
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
-- BINSTRING$ contains (0xFF) (0xFF) (0x00) (0xFF)
UWORD2BIN$
Purpose:
This function returns the binary string equivalent of a value
Syntax:
BINSTRING$ = UWORD2BIN$( UWORDTAG )
Comments:
These functions will return the binary representation of number.Words are output little-endian (low-byte high-byte), so that the number 0x1234 isactually output as (0x34) (0x12).
Example:
BINSTRING$ = UWORD2BIN$( 65535 )
-- BINSTRING$ contains (0xFF) (0xFF)
WORD2BIN$
Purpose:
These function return the binary string equivalent of a value
Syntax:
BINSTRING$ = WORD2BIN$( WORDTAG )
Comments:
These functions will return the binary representation of number.Words are output little-endian (low-byte high-byte), so that the number 0x1234 isactually output as (0x34) (0x12).
Example:
BINSTRING$ = WORD2BIN$( -1 )
Winbuild 5000161
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
-- BINSTRING$ contains (0xFF) (0xFF)
Bitwise Functions
BITAND
BITAT
BITCLEAR
BITNOT
BITOR
BITSET
BITSHIFTL
BITSHIFTR
BITXOR
BITAND
Purpose:
To return the result of doing a bitwise AND of two integral numbers X and Y.
Syntax:
BITAND(X,Y)
Example:
FRED=12JOE=8RESULT=BITAND(FRED,JOE)
è RESULT=8
When FRED of value 12 (1100 binary) is bitwise AND'd with JOE of value 8 (decimal) or(1000 binary) the result is 8 (1000 binary).
1100AND 1000
1000
BASIC Codes 162
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
BITAT
Purpose:
Returns 1 if the bit as position M in integral number is set, 0 if it is not.
Syntax:
BITAT(X,M)
Comments:
M must be in the range (0,7) for bytes and unsigned bytes, (0,15) for words andunsigned words, and (0,31) for double words and unsigned double words. Any othervalue outside this range will return a zero.X is any integral value or variable.
Example:
IF BITAT(FRED,3)=1 THENDONE=1ENDIF
This code will look at variable FRED, bit position three, and evaluates if it is 1. If it is, thecode then proceeds to set the variable DONE equal to 1.
BITCLEAR
Purpose:
To return the result of setting a bit at position M in an integral number X to 0.
Syntax:
BITCLEAR(X,M)
Comments:
M must be in the range (0,7) for bytes and unsigned bytes, (0,15) fro words andunsigned words, and (0,31) for double words and unsigned double words.
Example:
FRED=8JOE=BITCLEAR(FRED,3)
è JOE=0
Winbuild 5000163
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
This example code takes variable FRED (8, or 1000 (b)) and clears the third position. Inclearing third position, the result is 0000(b), or 0(d)
BITNOT
Purpose:
To return the result of doing a bitwise NOT of an integral number X.
Syntax:
BITNOT(X)
BITOR
Purpose:
To return the result of doing a bitwise OR of two integral numbers X and Y.
Syntax:
BITOR(X,Y)
Example:
FRED=12RESULT=BITOR(FRED,2)
è RESULT=14
When FRED of value 12 (1100 binary) is bitwise OR'd with a of value 2 (decimal) or(0010 binary) the result is 14 (1110 binary).
1100OR0010
1110
BASIC Codes 164
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
BITSET
Purpose:
To return the result of setting a bit at position M in an integral number X to 1.
Syntax:
BITSET(X,M)
Comments:
M must be in the range (0,7) for bytes and unsigned bytes, (0,15) fro words andunsigned words, and (0,31) for double words and unsigned double words.
Example:
FRED=8JOE=BITSET(FRED,2)
è JOE=12
This example code takes FRED which is equal to 8(d) or 1000(binary) and sets thesecond bit. The result, variable JOE, is then 12(d) or 1100(binary).
BITSHIFTL
Purpose:
Returns the result of shifting the integral number X to the left by M bit positions.
Syntax:
BITSHIFTL(X,M)
Example:
FRED=4JOE=BITSHIFTL(FRED,1)
è JOE=8
This example code takes the variable FRED which is equal to 4 (decimal) or 100(binary)and the shifts the bits one to the left. The result variable JOE is then 8 (decimal) or 1000(binary).
Winbuild 5000165
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BITSHIFTR
Purpose:
Returns the result of shifting the integral number X to the right by M bit positions.
Syntax:
BITSHIFTR(X,M)
Example:
FRED=4JOE=BITSHIFTR(FRED,1)
è JOE=2
This example code takes the variable FRED which is equal to 4 (decimal) or 100(binary)and the shifts the bits one to the right. The result variable JOE is then 2 (decimal) or 10(binary).
BITXOR
Purpose:
To return the result of doing a bitwise XOR of two integral numbers X and Y.
Syntax:
BITXOR(X,Y)
Example:
FRED=12JOE=8RESULT=BITXOR(FRED,JOE)
è RESULT=4
When FRED of value 12 (1100 binary) is bitwise XOR'd with JOE of value 8 (decimal) or(1000 binary) the result is 4 (100 binary).
1100XOR 1000
0100
BASIC Codes 166
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Control Statements
CASE
DO WHILE...LOOP
DO LOOP...UNTIL
FOR/NEXT
GOSUB
GOTO
IF...THEN...ELSE...ENDIF
LABEL
REM
RETURN
WAIT
WAITFORNONZERO
CASE
Purpose:
To facilitate evaluation of variables for situations. Eliminates the need for extensiveIF/THEN/ELSE routines.
Syntax:
SELECT CASE expression CASE constant statement list CASE ELSE statement listEND SELECT
Comments:
Where expression is any numerical or string expression. If the expression is numerical,the case constants must be numerical. Same goes for string expressions. The expressioncan include other BASIC math and string functions like MID$, LEFT$, OCT, SIN etc. TheCASE ELSE is optional.
Examples:
SELECT CASE ALARMCASE 1Switch To Screen "Motor_Fault"CASE 2Switch To Screen "Door_Open"
Winbuild 5000167
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
CASE ELSESwitch To Screen "UnknownError"END SELECT
In this example, the CASE statement examines the variable ALARM, and based if thevalue is 1, it will go to the screen "Motor_Fault". If the value of ALARM is 2, then it willswitch to screen "Door_Open". If the value of ALARM is anything else, the screen willswitch to screen "UnknownError".
SELECT CASE PART$CASE "WIDGET"RecipeRecCurr=1STATUS=3CASE "DONGLE"RecipeRecCurr=2STATUS=4END SELECT
In this example, the CASE statement examines the string variable PART$. If the part is"WIDGET", then the recipe system will switch to record 1, and turn variable STATUS to3. If PART$ is equal to "DONGLE" then recipe record 2 will be brought up, and variableSTATUS set to 4.
DO WHILE...LOOP
Purpose:
Execute statements only while a condition is true.
Syntax:
DO WHILE {condition}{statement list}LOOP
Comment:
This loop structure will evaluate the condition first. As long as the condition is true, thestatement list shall be executed.
Example:
N = 0DO WHILE N < 5N = N + 1LOOP
When the loop is done executing, the variable N will equal 5.
BASIC Codes 168
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
DO...LOOP UNTIL
Purpose:
Continue executing statements loop until a condition is true.
Syntax:
DO{statement list}LOOP UNTIL {condition}
Comment:
This loop structure will execute the statement list first. The exit condition is then tested.If the condition is false, program execution will resume at the top of the statement list.
Example:
N = 0DON = N + 1LOOP UNTIL N > 0
When the loop is done executing, the variable N will equal 1.
FOR-NEXT
Purpose:
To execute a series of instructions a specified number of times in a loop.
Syntax:
FOR variable = x TO y [STEP z]...NEXT [variable ]
Comments:
variable is used as a counter and can only be a signed numeric variable. x,y,z are onlysigned numeric expressions (BYTE, WORD, DWORD, REAL). Unsigned expressions orvariable will not compile or will produce unsupported results.The first numeric expression (x) is the initial value of the counter. The second numericexpression (y) is the final value of the counter. Step z specifies the counter increment
Winbuild 5000169
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
for each loop, and is optional. If not specified, step is assumed to be 1.
Program execution continues after the FOR, up to the NEXT statement. Then, thecounter is incremented. A check is performed to see if the value of the counter is nowgreater than the final value (y). If it is not greater, BASIC branches back to thestatement after the FOR statement, and process is repeated. If it is greater, executioncontinues with the statement following the NEXT statement. This is a FOR-NEXT loop.The body of the loop is always executed at least once, even if the initial value of the looptimes the sign of the step exceeds the final value times the sign of the step.
If STEP is negative, the final value of the counter is set to be less than the initial value.The counter is decremented each time through the loop, and the loop is executed untilthe counter is less than the final value.
All of the numeric expressions must evaluate to a signed integer.FOR I(INT) = X(INT) TO Y(INT)If you put an unsigned integer in there the for loop will not execute even once
Nested Loops:
FOR-NEXT loops may be nested; that is, a FOR-NEXT loop may be placed within thecontext of another FOR-NEXT loop. When loops are nested, each loop much have aunique variable name as its counter.
The NEXT statement for the inside loop must appear before that for the outside loop.The variable in the NEXT statement may be omitted, in which case the NEXT statementwill match with the most recent FOR statement.
If a NEXT statement is encountered before its corresponding FOR statement, a warningmessage in the editor will be displayed.
WARNING: be very careful about nesting FOR-NEXT loops, and leaving them withGOSUB and GOTO statements. This can result in erratic program execution and memoryleaks- eventually resulting in a program crash.
Examples:
K=10FOR I=1 TO K STEP 2NEXT I
èSystem count from 1 to 10, in increments of 2.è1, 3, 5, 7, 9
BASIC Codes 170
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
GOSUB
Purpose:
To branch to a subroutine.
Syntax:
GOSUB routinename
Comments:
routinename must be the name of a valid subroutine. A subroutine may be called any
number of times in a program, and a subroutine may be called from within anothersubroutine.
Example:
IF STOP=1 THENGOSUB ESTOPENDIF
GOTO
Purpose:
To branch unconditionally out of the normal program sequence to a specified label.
Syntax:
GOTO label
Comments:
label must be the name of a valid subroutine, contained within the object that calls it.Labels outside the object cannot be called.
Example:
IF STOP=1 THENGOTO ESTOPENDIF
Winbuild 5000171
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
IF...THEN...ELSE...ENDIF
Purpose:
To make a decision regarding program flow based on the result returned by anexpression.
Syntax:
IF expression[,] THEN statement(s) [ELSE statement(s)]... ENDIF
Comments:
If the result of expression is non zero (logical true), the THEN part of the statement isexecuted, until the ENDIF statement is reached.
If the result of expression is zero (false), the THEN is ignored and the ELSE function isexecuted. Otherwise, execution continues with the next executable statement.
If you are nesting multiple IF/THEN statements, each IF will require a correspondingENDIF. (See examples below)Testing Equality
When using IF to test equality for a value that is the result of a floating pointcomputation, remember that the internal representation of the value may not be exact.Therefore, test against the range over which the accuracy of the value may vary.
For example, to test a computed variable A against the value 1.0, use the followingstatement:
100 IF ABS (A-1.0) < 1.0E -6 THEN ...This test returns true if the value of A is 1.0 with a relative error of less than 1.0E-6.
Example:
This first example evaluates the variable called BIT01. (Possibly a digital I/O point,aliased with the name BIT01). If the variable is equal to 1, the second variable, BIT02 isset to 0. If the first condition is not true, the ELSE statement is then executed.
IF BIT01=1 THENBIT02=0ELSEBIT02=1ENDIF
This example will evaluate the variable TEMP. If TEMP is greater than 100, the unit willswitch display to the screen called "Error"
IF TEMP>100 THENSWITCH TO SCREEN "Error"ENDIF
BASIC Codes 172
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The third example shows a series of tasks that are excuted if the statement is true,ending when the ENDIF statement is finally reached.
IF TEMP>100 THENSTOP=1PARTCOUNT=0SWITCH TO SCREEN "Done"ENDIF
This last example shows how to close out nested IF/THEN statements with acorresponding ENDIF statement.
IF TEMP>100 THENIF A=66 THENMESSAGE$="Temperature is over 100, and A=66"ELSEMESSAGE$="Temperature is over 100, but A does not equal 6"ENDIF (REM: this closes out the above IF A=66)ENDIF (REM: this closes out the above IF TEMP>100)
LABEL
Purpose:
To allocate a program label.
Syntax:
LABEL labelname
Comments:
labelname is an eight character alpha label which allows the user to direct control ofprogram execution. Labels can only be called from the object in which they arecontained. Other object code cannot goto or gosub labels contained in other objects.
Example:
IF STOP=1 THENGOTO LABEL ESTOPENDIF
LABEL ESTOPmessage$="THE PROGRAM HAS STOPPED!
If the variable STOP is equal to one, the code will skip ahead to the program labelESTOP.
Winbuild 5000173
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
REM
Purpose:
To remark (comment) a section of code or text.
Syntax:
REM
Comments:
REM essentially causes the compiler to ignore any text behind it. Useful for commentingcode, or debugging by disabling individual lines of code. REM can be placed anywherewithin the line of code.
Example:
REM THIS PROGRAM WILL DO NOTHINGREM BECAUSE IT IS COMPLETELY COMMENTED OUTREM WITH THE REM STATEMENTREM A+A+1REM B=EXP(A)REM THIS SHOWS HOW YOU CAN COMMENT MID-LINEA=B*C REM THIS IS JUST A COMMENT
RETURN
Purpose:
To end execution of a subroutine.
Syntax:
RETURN
Comment:
In ESA Technology BASIC, a RETURN statement is not necessary for most subroutinescreated with the Editor. When the subroutine is finished, execution is then returned tothe point where the subroutine had been called from. However a RETURN statement canbe used to prematurely finish a subroutine.
Example:
IF STOP=1 THENGOSUB ESTOPENDIF
BASIC Codes 174
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
A=A+1C=EXP(A) ....(Subroutine Estop)LABEL ESTOPIF A=3 THENRETURNENDIFERROR=3VELOCITY=0RETURN
The subroutine ESTOP will be executed if STOP=1. Once the subroutine has beenexecuted, the RETURN statement sends execution back to the main code that called it.Even more, the second line of code evaluates if A=3, and will return execution back tothe main routine without completing the rest of 'ESTOP'.
WAIT
Purpose:
Pause execution of current task.
Syntax:
WAIT n
Comments:
The WAIT function pauses execution of the current task for specified n milliseconds.Note: A value of zero for n will result in handing over multitasking processing to the nexttask. (When multitasking is utilized.)
Examples:
WAIT 1500
è System will pause for 1500 milliseconds. (System goes to other tasks, and returnsapproximately in 1500 ms. to continue executing code.)
WAIT 0
è System will switch to next task, then return.
Winbuild 5000175
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
WAITFORNONZERO
Purpose:
To halt the execution of BASIC code until a specified value is non-zero.
Syntax:
WAITFORNONZERO(x)
where x is some numerical variable
Example:
LABEL BEGINWAITFORNONZERO(gotag)COUNT = COUNT + 1GOTO BEGIN
This example will halt the execution of the task if the variable gotag is zero. This freesup the processor to execute other code and tasks within the application. To resume theBASIC code, set the tag x (gotag in our example) to anything other than zero.
Using WAITFORNONZERO is recommended in Background Tasks only. Use in aforeground object such as a button, screen, or subroutine will cause a total halt of theapplication- and the only way to resume execution would be to have a background taskchange your variable.
This command is used best with the TIMERS function- and use the timer_outputvariables to have the timer control when code gets executed. (See TIMERS for moreinformation and example code.)
Communication Ports
COMCLEAR
COMGET$
COMGETBIN$
COMGETBINUNTIL
COM INIT
COMPUT
COMPUTBIN
COMPUTGET$
COMPUTGETBIN$
COMPUTGETBINUNTIL$
INBUFFERCOUNT
BASIC Codes 176
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
INKEY
INKEY$
INPORTB
INPORTW
OUTPORTB
OUTPORTW
COMCLEAR
Purpose:
To clear communication port buffer
Syntax:
COMCLEAR( number )
Comments:
Clears communication buffer in port number. Same as using the pseudocode PURGECOM BUFFER.
COMGET$
Purpose:
To get text strings from the communication port.
Syntax:
tag$ = COMGET$( number )
Comments:
Takes a string from serial port number and returns it to the tag$. The terminationcharacter used is the one defined by your COM INIT statement. (Default is carriagereturn.)
Example:
FRED$=COMGET$(1)
Winbuild 5000177
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
This example will get a string from port 1, and put it into the variable FRED$.
FRED$=COMGET$(2)
This example will get a string from port 2, and put it into the variable FRED$.
COMGETBIN$
Purpose:
Receives a binary string from the port
Syntax:
string_we_get$ = COMGETBIN$ ( port , number_of_characters )
Comments:
Will receive from port and put into the variable string_we_get$. The command will onlyread in the number_of_characters specified and then stop.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
COMGETBINUNTIL$
Purpose:
Receives a binary string from the port
Syntax:
string_we_get$ = COMGETBINUNTIL$( port, termination_string )
Comments:
Will receive from port and put into the variable string_we_get$. The command will readuntil the termination_string is reached.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
BASIC Codes 178
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
COM INIT
Purpose:
To initialize the communication port with set parameters.
Syntax:
COMINIT ( port , baud , data_bits , parity , stop_bits ,autobaud , timeout , multidrop ,handshaking , outputdelimiter , useroutputdelimiter , inputdelimiter, userinputdelimiter, eatecho , intercharacterdelay )
Comments:
Same as the COM: INIT pseudocode, with a bunch of parameters you can set:
port - 1 = COM1, 2 = COM2, ...baud - 110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600,115200data bits - 5,6,7,8parity - "N", "E", "O"stop bits - 1, 2autobaud - ignoredtimeout - in millisecondsmultidrop - 0=RS232, 1=RS422/RS485 4-wire, 2=RS485 2 wirehandshaking - 0=none, 1=XON/XOFF software, 2=RTS/CTS hardware,3=hardware&softwareoutputdelimiter - 0=linefeed, 1=carriage return/linefeed,2=carriage return,3=useruseroutputdelimiter - ascii character to be used for delimter if output delimiter = userinputdelimiter - 0=linefeed, 1=carriage return/linefeed,2=carriage return,3=useruserinputdelimiter - ascii character to be used for delimter if input delimiter = usereatecho - do we eat echos? Some devices echo what you send them. Use thisoption to eat the echo that comes back.intercharacterdelay - # of ms between characters (if you do this communication will slowway down)
Also note that the COM INIT code only needs to appear once somewhere in yourprogram. The port settings will then be remembered and will apply to all COM codes youuse in your program. (for instance, place at the 'ON OPEN' of your first program screen)
Winbuild 5000179
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
COMPUT
Purpose:
To send text strings out the communication port.
Syntax:
COMPUT( number, string$ )
Comments:
Will send text string$ out port number
COMPUTBIN
Purpose:
Sends a binary string out the port
Syntax:
COMPUTBIN ( port , string$ )
Comments:
Sends a binary string$ out the port.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
COMPUTGET$
Purpose:
To get text strings from the communication port.
Syntax:
tag$ = COMPUTGET$( number, stringtoput$ )
BASIC Codes 180
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Comments:
Sends a stringtoput$ out the port number , and reads the response and returns it to thetag$. The termination character used is the one defined by your COM INIT statement.(Default is carriage return.)
Example:
FRED$=COMPUTGET$(1,"VAR1=")
This example will send the string "VAR1=" out port 1, then read response into thevariable FRED$.
FRED$=COMPUTGET$(2,JOE$)
This example will send the string variable JOE$ out port 2, and put it into the responseinto variable FRED$.
COMPUTGETBIN$
Purpose:
Sends a binary string out the port, and puts the response string into a tag.
Syntax:
string_resp$ = COMPUTGETBIN$ ( port , string_to_send$, number_of_chars )
Comments:
Sends out the string_to_send$ out the specified port. The response string is then putinto the string_resp$ variable, pulling out only the numer_of_chars specified.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
COMPUTGETBINUNTIL$
Purpose:
Sends a binary string out the port, and puts the response string into a tag.
Syntax:
Winbuild 5000181
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
string_resp$ = COMPUTGETBINUNTIL$( port, string_to_put, termination_string )
Comments:
Sends out the string_to_put out the specified port. The response string is then put intothe string_resp$ variable, pulling out until the termination_string is reached.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
INBUFFERCOUNT
Purpose:
Determine the number of characters in the communication port incoming buffer.
Syntax:
tag=INBUFFERCOUNT(port)
Comments:
port must be a valid communication port number 1-8.
Example:
FRED=INBUFFERCOUNT(1)
è FRED=13
This means that there are 13 characters waiting in COM 1 input buffer.
INKEY
Purpose:
To get a single character from a com port and return the value as a number
Syntax:
INKEY(n)
Comments:
n is the com port from which to receive a character from
BASIC Codes 182
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Example:
X=INKEY(1)
This will trap a single character from communication port 1, and put it into the numericvariable X.
NOTE: that for most applications, you want to use the COM PSEUDOCODES. Usethe above INKEY$ function for special cases.
INKEY$
Purpose:
To get a single character from a com port and return the value as a character
Syntax:
INKEY$(n)
Comments:
n is the com port from which to receive a character from
Example:
X$=INKEY$(1)
This will trap a single character from communication port 1, and put it into the stringvariable X$.
NOTE: that for most applications, you want to use the COM PSEUDOCODES. Usethe above INKEY$ function for special cases.
INPORTB
Purpose:
To read from a port into as a byte value.
Syntax:
something = INPORTB ( io_port )
Winbuild 5000183
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Comments:
Analogs to the C inport and outport functions.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
INPORTW
Purpose:
To read from a port into as a word value.
Syntax:
something = INPORTW ( io_port )
Comments:
Analogs to the C inport and outport functions.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
OUTPORTB
Purpose:
To send data out the port a byte value.
Syntax:
OUTPORTB ( io_port, value )
Comments:
Analogs to the C inport and outport functions.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
BASIC Codes 184
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
OUTPORTW
Purpose:
To send data out the port a word value.
Syntax:
OUTPORTW ( io_port, value )
Comments:
Analogs to the C inport and outport functions.
Note this command is usually reserved for more advanced users. See normalCOMMUNCIATION CODES for most transactions.
Date & Time Functions
CALL SETDATE
CALL SETTIME
CLOCK
DATE
DATE$
DAYOFWEEK
TIME
TIME$
CALL SETDATE
Purpose:
To set the date as a string.
Syntax:
CALL SETDATE(string$)
Comments:
string$ is a valid string literal or variable that lets you set the date. The string$ MUST bein the format MM/DD/YYYY.
Winbuild 5000185
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
If any of the values are out of range, an "illegal arguments" error is issued. The previoustime is retained.
Examples:
ESATECH$ = "09/03/1973"CALL SETDATE(ESATECH$)
è The date is now set for Sept 3, 1973
CALL SETTIME
Purpose:
To set the time in 24 hour format.
Syntax:
CALL SETTIME(string$ )
Comments:
string$ is a string of the format HH:MM:SS, and will set the time on the unit.
Example:
ESATECH$="08:01:22"CALL SETTIME(ESATECH$)
è The time in the unit is now set to 8:01am, and 22 seconds.
CLOCK
Purpose:
Returns the number of milliseconds since the start of the program.
Syntax:
x = CLOCK
Comments:
This will return the number of milliseconds from the start of the program. (Not sincestart of the unit.) This is an UNSIGNED DOUBLEWORD.
BASIC Codes 186
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Example:
oldtime = CLOCKPLC_TAG = 4time_elapsed = CLOCK - oldtime
The tag time_elapsed will contain roughly the number of milliseconds that the write tothe plc tag took. (by subtracting the old time from the new time)
DATE
Purpose:
Returns the year, month, and day as a number, in YYDDD format.
Syntax:
X=DATE
Example:
X=DATE
è X=99235
The function returns the year 99, 235th day.
DATE$
Purpose:
Returns the year, month, and day as a string.
Syntax:
X$=DATE$
Comments:
string x$ is returned in MM/DD/YYYY format
Example:
ESATECH$=DATE$
è X$="09/03/1973"
Winbuild 5000187
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
The function returns the year 1973, the 09 month, and 03 day of the year
DAYOFWEEK
Purpose:
To return the day of the week.
Syntax:
x = DAYOFWEEK
Comments:
x is any numeric variable, and will return with a value where:1 = Sunday2 = Monday3 = Tuesday4 = Wednesday5 = Thursday6 = Friday7 = Saturday
Example:
FRED=DAYOFWEEK
è FRED=3
If according to the unit's system clock today is Tuesday, the value of FRED will be 3.
MSECTOTIME$
Purpose:
To return the time elapsed since midnight in milliseconds.
Syntax:
string$ = MSECTOTIME$( number )
Comments:
string$ will now be a human-readable time format. Use this in combination with the
BASIC Codes 188
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
MSEC internal variable to read the current time.
Example:
(Where MSEC=12345678)
NOWTIME$=MSECTOTIME$(MSEC)
è NOWTIME$ = "03:25:45.678"
Meaning, it is 3:25 AM, and 45.678 seconds.
TIME
Purpose:
To return the time elapsed since midnight in seconds.
Syntax:
num exp = TIME
Comments:
num exp will be in seconds.
Example:
A=TIME
è A=40500
Meaning, it is 11:15 AM.
TIME$
Purpose:
To return the time in 24 hour format.
Syntax:
string exp = TIME$
Example:
Winbuild 5000189
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
A$=TIME$
è A$="14:23:04"
The time is 2:23pm.
Object Properties
CALL CLOSEPOPUPCANCEL
CALL CLOSEPOPUPOK
POPUP
SETBACKGROUNDCOLOR
SETCAPTIONFILLCOLOR
SETCAPTIONTEXT
SETCAPTIONTEXTCOLOR
SETDISABLED
SETENABLED
SETFILLCOLOR
SETFILENAME
SETFONT
SETINVISIBLE
SETLINECOLOR
SETPOSITION
SETSIZE
SETTEXT
SETTEXTCOLOR
SETTRENDRANGE
SETVISIBLE
CALL CLOSEPOPUPCANCEL
This command will close your pop-up screen, and throw out the new the data entry.
Place this code on a button of your custom pop-up screen.
BASIC Codes 190
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CALL CLOSEPOPUPOK
This command will close your pop-up screen, and accept the new data entry.
Place this code on a button of your custom pop-up screen.
POPUP
Purpose:
Brings up the specified pop-up screen.
Syntax:
POPUP ( screen_name$ )
where screen_name$ is the string name for a particular pop-up screen in your program.Note that on the pop-up screen you will need to include the properCALL CLOSEPOPUPCANCEL or CALL CLOSEPOPUPOK to close the window.
Example:
POPUP("password_check")
è will cause the pop-up screen called 'password_check' to pop up on the screen.
SETBACKGROUNDCOLOR
Purpose:
Sets the fill color of an object.
Syntax:
objectname .SETBACKGROUNDCOLOR("#HHHHHH")
Comments:
objectname is the name of the screen object you wish to change the properties ofThe fill color value is determined by a HEX color value in the format of #HHHHHH
Example:
Winbuild 5000191
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
bargraph_1.SETBACKGROUNDCOLOR("#00FF00")
è this code will turn the object 'bargraph_1' to a background color of green- whose hexcode is #00FF00.
SETCAPTIONFILLCOLOR
Purpose:
Sets the caption fill color of a superbuttom.
Syntax:
objectname .SETCAPTIONFILLCOLOR("#HHHHHH")
Comments:
objectname is the name of the superbutton screen object you wish to change theproperties of.The fill color value is determined by a HEX color value in the format of #HHHHHH
Example:
startbutton.SETCAPTIONFILLCOLOR("#00FF00")
è this code will turn the object 'startbutton' to a fill color of green- whose hex code is#00FF00.
SETCAPTIONFONT
Purpose:
Sets the caption font of a super button.
Syntax:
objectname .SETCAPTIONFONT(_string expression_)
Comments:
objectname is the name of the screen object you wish to change the properties of
_string expression_ is the name of any supported font in Winbuild 5000
"Helmet"
BASIC Codes 192
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
"Arioso""Chevara""ChevaraOutline""Conga""Luxi Mono""Luxi Serif""Luxi Sans""StarBats""StarMath""Timmons"
Example:
superbutton_1.SETCAPTIONFONT("Conga")
è this code will turn the font on the caption text of object 'superbutton_1' to the'Conga' font.
SETCAPTIONTEXT
Purpose:
Sets the caption text of a superbutton.
Syntax:
objectname .SETCAPTIONTEXT(string_expression )
Comments:
objectname is the name of the superbutton object you wish to change the properties of
string_expression is any string variable or expression in quotes you wish to use.
Example:
startbutton.SETCAPTIONTEXT("READY!")
è this code set the text on the object 'startbutton' to say "READY!"
startbutton.SETCAPTIONTEXT(STATUS$)
è this code will set the text on the object 'startbutton' to print whatever is in the stringvariable STATUS$
Winbuild 5000193
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
SETCAPTIONTEXTCOLOR
Purpose:
Sets the caption text color of a superbuttom.
Syntax:
objectname .SETCAPTIONTEXTCOLOR("#HHHHHH")
Comments:
objectname is the name of the superbutton screen object you wish to change theproperties of.The fill color value is determined by a HEX color value in the format of #HHHHHH
Example:
startbutton.SETCAPTIONTEXTCOLOR("#00FF00")
è this code will turn the caption text in the object 'startbutton' to a fill color of green-whose hex code is #00FF00.
SETDISABLED
Purpose:
To disable an object on onscreen (gray it out)
Syntax:
objectname. SETDISABLED
Example:
startbutton.SETDISABLED
è will set the object 'startbutton' to disabled, thus graying it out and not allowing theuser to press it
è
BASIC Codes 194
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SETENABLED
Purpose:
To enable an object on onscreen
Syntax:
objectname. SETENABLED
Example:
startbutton.SETENABLED
è will set the object 'startbutton' to enabled, thus allowing it to be used
è
SETFILLCOLOR
Purpose:
Sets the fill color of an object.
Syntax:
objectname .SETFILLCOLOR("#HHHHHH")
Comments:
objectname is the name of the screen object you wish to change the properties ofThe fill color value is determined by a HEX color value in the format of #HHHHHH
Example:
startbutton.SETFILLCOLOR("#00FF00")
è this code will turn the object 'startbutton' to a fill color of green- whose hex code is
Winbuild 5000195
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
#00FF00.
SETFILENAME
Purpose:
Set the filename for an object. (usually pictures)
Syntax:
object_name.SetFileName(string_expression)
Comment:
This function lets you change the file a particular object refers to. (Usually pictures)
Example:
IF ERROR=1 THEN picture_1.SETFILENAME("yikes.jpg")ELSE picture_1.SETFILENAME("its_ok.jpg")ENDIF
This code evaluates the variable called "ERROR" and if it is equal to 1, sets the object"picture_1" to display the "yikes.jpg" picture. Otherwise it will display the "its_ok.jpg"picture.
SETFONT
Purpose:
Sets the font of any object that has text on it.
Syntax:
objectname .SETFONT(_string expression_)
Comments:
objectname is the name of the screen object you wish to change the properties of
_string expression_ is the name of any supported font in Winbuild 5000
BASIC Codes 196
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
"Helmet""Arioso""Chevara""ChevaraOutline""Conga""Luxi Mono""Luxi Serif""Luxi Sans""StarBats""StarMath""Timmons"
To set the size and other properties of the new font, insert a space after the font name,and give the property. (Ie size, type)
Example:
mytext_1.SETFONT("Conga")
è this code will turn the font on the object 'mytext_1' to the 'Conga' font.
mytext_1.SETFONT("Conga 15 Bold")
è this code will turn the font on the object 'mytext_1' to the 'Conga' font, with size 15and make it bold.
SETINVISIBLE
Purpose:
To set an object invisible on screen.
Syntax:
objectname. SETINVISIBLE
Example:
startbutton.SETINVISIBLE
è will set the object 'startbutton' to be invisible on screen. (and cannot be pressed)
è ?
Winbuild 5000197
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
SETLINECOLOR
Purpose:
Sets the line color of an object.
Syntax:
objectname .SETLINECOLOR("#HHHHHH")
Comments:
objectname is the name of the screen object you wish to change the properties ofThe color value is determined by a HEX color value in the format of #HHHHHH
Example:
rectangle_8.SETLINECOLOR("#00FF00")
è this code will turn the object 'rectangle_8 to a line color of green- whose hex code is#00FF00.
SETPOSITION
Purpose:
To set an object's position onscreen.
Syntax:
objectname. SETPOSITION(string_expression )
where string_expression is in the format "X,Y" Note that the expression must be astring, and numeric variables must be converted to a string first, and a comma addedbetween them.
Example:
startbutton.SETPOSITION("50,75")
è will set the object 'startbutton' to be to the position 50,75 on the screen.
rectangle_1.SETPOSITION(STR$(PosnX) + "," + STR$(PosnY))
è will set the object 'rectangle_1' to be to the position of the numeric variables PosnXand PosnY on the screen.
BASIC Codes 198
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SETSIZE
Purpose:
To set an object's size onscreen.
Syntax:
objectname. SETSIZE(string_expression )
where string_expression is in the format "X,Y" Note that the expression must be astring, and numeric variables must be converted to a string first, and a comma addedbetween them.
Example:
startbutton.SETSIZE("50,75")
è will set the object 'startbutton' to be to the size of 50,75 on the screen.
rectangle_1.SETSIZE(STR$(PosnX) + "," + STR$(PosnY))
è will set the object 'rectangle_1' to be to the size of the numeric variables PosnX andPosnY on the screen.
SETTEXT
Purpose:
Sets the text of any object that has text on it.
Syntax:
objectname .SETTEXT(string_expression )
Comments:
objectname is the name of the screen object you wish to change the properties of
string_expression is any string variable or expression in quotes you wish to use.
Objects that can have their text color changed include: text, buttons, superbuttons, datadisplay etc.
To make a multi-line message display, add \r\n to middle of message. For example:"HELLO\r\nALEX" will display:
Winbuild 5000199
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
HELLO ALEX
Example:
startbutton.SETTEXT("READY!")
è this code set the text on the object 'startbutton' to say "READY!"
messagebox.SETTEXT(STATUS$)
è this code will set the text on the object 'messagebox' to print whatever is in thestring variable STATUS$
SETTEXTCOLOR
Purpose:
Sets the text color of any object that has text on it.
Syntax:
objectname .SETTEXTCOLOR("#HHHHHH")
Comments:
objectname is the name of the screen object you wish to change the properties of
The fill color value is determined by a HEX color value in the format of #HHHHHH
Objects that can have their text color changed include: text, buttons, superbuttons, datadisplay etc.
Example:
startbutton.SETTEXTCOLOR("#FFFFFF")
è this code will turn the object 'startbutton' text to a color of white- whose hex code is#FFFFFF.
BASIC Codes 200
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SETTRENDRANGE
Purpose:
Sets the trend chart x-axis range.
Syntax:
objectname .SETTRENDRANGE(" n , m ")
Comments:
objectname is the name of the screen object you wish to change the properties of
n parameter sets beginning
m parameter sets end range
setting n or m to a -1 sets trend back to original set paramenters (autoscroll on)
Example:
Trend_1.SETTRENDRANGE("1,10")
è this code will turn will turn off the autoscrolling and set the x range from 1 to 10.
Trend_1.SETTRENDRANGE("-1,-1")
è this code will turn will turn the autoscrolling back on.
SETVISIBLE
Purpose:
To set an object visible on screen.
Syntax:
objectname. SETVISIBLE
Example:
startbutton.SETVISIBLE
è will set the object 'startbutton' to be visible on screen.
Winbuild 5000201
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
? è
Math Functions
ABS
ACOS
ASC
ASIN
ATAN
BCC8W
BIN
BIN$
COS
CRC16
CRC32
DEG
EXP
FRAC
HEX
HEX$
INT
LOG
LOG10
LOG2
MAX
MIN
MOD
OCT
OCT$
PI
RAD
RND
ROUND
BASIC Codes 202
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
SGN
SIN
SQRT
TAN
^
ABS
Purpose:
To return the absolute value of a number.
Syntax:
ABS(x)
Example:
FRED=-24.5ESATECH=ABS(FRED)
è ESATECH=24.5
ACOS
Purpose:
To return the inverse cosine of the range of x, in radians.
Syntax:
ACOS(x)
Example:
X=ACOS(.6)
è X=0.927295
Winbuild 5000203
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
ASC
Purpose:
To return the ASCII value equivalent of the first character of X$.
Syntax:
ASC(X$)
Comments:
X$ is any ASCII character string.
Note: To return the character of an ASCII value, use the CHR$ function.
Example:
F$="?"X=ASC(F$)orX=ASC("?")
The ASCII character value for "?" is 63.
ASIN
Purpose:
To calculate the inverse trigonometric sine of x, in radians.
Syntax:
ASIN(x)
Example:
X=ASIN(.6)
è X=0.643501
The inverse sine of 0.6 is 0.643601 degrees
BASIC Codes 204
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
ATAN
Purpose:
To calculate the inverse trigonometric tangent of x, in radians.
Syntax:
ATAN(x)
Example:
X=ATAN(1)
è X=0.785398
The inverse tangent of 1 is PI/4 radians.
BCC
Purpose:
Takes a string and calculate the BCC. The result is a one-byte value that can beappended to the string and sent out the serial port.
Syntax:
v=BCC(x$)
Comments:
v will be your resultant BCC binary value (should be stored in an unsigned byte)x$ is your source string. Use the CHR$ function to then convert this value into a stringfor sending out the port if needed.
ESA Technology's BCC function does the following:· Byte value starts at 0· For each character in the string· XOR the character with the currrent value· Barrel shift the current value one bit to the left· Return the value
Example:
X$ = "1234"V = BCC(X$)
Winbuild 5000205
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
è V = 32
BCC8W
Purpose:
Takes a string and calculate the BCC. The result is a one-byte value that can beappended to the string and sent out the serial port. This is a special BCC function forWittenstein controllers. See normal BCC function for most devices.
Syntax:
v=BCC8W(x$)
Comments:
v will be your resultant BCC binary value (should be stored in a signed byte -128 to 127)x$ is your source string
ESA Technology's BCC8W function does the following:· Byte value starts at 0· For each character in the string· XOR the character with the currrent value· Return the inverse of the value
Example:
X$ = "1234"V = BCC8W(X$)
è V = 54
BIN
Purpose:
Returns the decimal value of a binary string.
Syntax:
x=BIN(v$)
Comments:
v$ contains the binary strings to be converted, the range from -2147483647 to
BASIC Codes 206
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
+2147483647.
Binary numbers are numbers to the base 2, rather than base 10 (decimal numbers).Conversion is terminated whenever an illegal character is parsed. The result is theevaluation of the string up to the illegal characters. If x is negateve, 2's (binary)complement form is used. BIN$ is the complement of this function.
Example:
x=BIN("101100")
è X=44
BIN$
Purpose:
Returns a string that represents the binary value of the numeric argument.
Syntax:
v$=BIN$(x)
Comments:
Binary numbers are numbers to the base 2, rather than base 10 (decimal numbers). x isrounded to an integer before BIN$(x) is evaluated. See the HEX$ and OCT$ functions forhexadecimal and octal conversions. If x is negative, 2's (binary) complement is used.
Example:
x=32A$=BIN$(x)
è A$=10000
COS
Purpose:
To return the cosine of the range of x.
Syntax:
Winbuild 5000207
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
COS(x)
Comments:
x must be in radians. To convert from degrees to radians, use the RAD(x) function.
Example:
X=2*COS(.4)
è 1.842121
CRC16
Purpose:
Compute the sixteen bit CCITT CRC.
Syntax:
x = CRC16( n$ )
where:x is an unsigned wordn$ is a string or binary string
Comment:
The return value for this math function is the computed CCITT CRC 16 value. Always usea binary string if there is
Example:
COM: GET COM 2 NUMBER OF CHARACTERS 16 TAG n$X = CRC16(n$)
The value of X will contain the sixteen bit CRC for the characters received over thecommunications port.
BASIC Codes 208
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CRC32
Purpose:
Compute the thirty-two bit CCITT CRC.
Syntax:
x = CRC32( n$ )
where:x is an unsigned double wordn$ is a string or binary string
Comment:
The return value for this math function is the computed CCITT CRC 16 value.
Example:
N$ = "123456"X = CRC32(N$)
The value of X will be 2879124794.
DEG
Purpose:
Translates radians to degrees.
Syntax:
DEG(x)
Comments:
x must be in radians. To convert from degrees to radians, use the RAD(x) function.
Example:
DEG(.785)
è 45
The function returns the value of 0.785 radians in degrees (45)
Winbuild 5000209
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
EXP
Purpose:
Returns the exponential of x.
Syntax:
EXP(x)
Comments:
The value returned is the value of the base of natural logarithms, raised to the power X.
Example:
X=EXP(1)
è X=2.71828
FRAC
Purpose:
To return the fractional part of x.
Syntax:
FRAC(x)
Example:
Y=FRAC(48.75)
è Y=.75
HEX
Purpose:
To return the decimal value of the hexadecimal string.
Syntax:
BASIC Codes 210
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
x=HEX(v$)
Comments:
v$ contains the hexadecimal string to be converted, the range of a double word (-2147483647 to 2147483647).
Hexadecimal numbers are numbers to the base 16, rather than base 10 (decimalnumbers). Conversion is terminated whenever an illegal character is parsed. The resultis the evaluation string up to the illegal character.
Example:
X$="FFFF"Y=HEX(X$)
è Y= 65535
The decimal value of FFFF (hex) is 65535.
HEX$
Purpose:
To return a string that represents the hexadecimal value of the numeric argument.
Syntax:
v$=HEX$(x)
Comments:
Hexadecimal numbers are numbers to the base 16, rather than base 10 (decimalnumbers). x is rounded to an integer before HEX$(x) is evaluated.
Example:
A$=HEX$(32)
è A$= 20
The decimal number 32 is 20 in hex.
Winbuild 5000211
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
INT
Purpose:
To truncate an expression to a whole number.
Syntax:
v=INT(x)
Comments:
Negative numbers return the next lowest number.
Note that numbers are TRUNCATED, not rounded up to nearest whole number. SeeROUND function to do this.
Example:
A=INT(98.89)
è A=98
B=INT(-12.11)
è B=-13
LOG
Purpose:
To return the natural logarithm x.
Syntax:
LOG(x)
Comments:
x must be a number greater than zero.
Example:
X=LOG(2)
è X=.693147
BASIC Codes 212
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
LOG10
Purpose:
To return the common logarithm of X.
Syntax:
LOG10(x)
Comments:
x shall be greater than zero.
Example:
A=LOG10(100)
è A=2
LOG2
Purpose:
To return the base 2 logarithm of X.
Syntax:
LOG2(x)
Comments:
x shall be greater than zero.
Example:
A=LOG2(100)
è A=10
Winbuild 5000213
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
MAX
Purpose:
Determine the larger of two numbers.
Syntax:
MAX(x,y)
Comments:
X,Y must be numeric values only.
Example:
A=555B=777C=MAX(A,B)
è C=777
C will become the larger of A or B. In this case B is larger and thus C = 777.
MIN
Purpose:
Determine the smaller of two numbers.
Syntax:
MIN(x,y)
Comments:
X,Y must be numeric values only.
Example:
A=555B=777C=MIN(A,B)
è C=555
C will become the smaller of A or B. In this case A is smaller and thus C = 555.
BASIC Codes 214
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
MOD
Purpose:
X modulo Y.
Syntax:
result = MOD(number1,number2)
Comments:
result = remainder of number1/number2
result, number1 and number2 must be a numeric type. The Modulus of two numbers isthe remainder of their division.
Example:
Y=MOD(2, 2)=0
è Y=0 Remainder=0 for 2/2
Y=MOD(10,5)=0
è Remainder=0 for 10/5
Y=MOD(5,10)=5
è Remainder=5 for 5/10
OCT
Purpose:
To convert an octal string to a decimal value.
Syntax:
OCT(x$)
Comments:
x$ is a string that contains the octal string. Any illegal characters such as a letter or thedigit 9 will terminal evaluation at that point and the result will be the conversion up tothat part of the string. This statement converts a decimal value within the range of -2147483647 to +2147483647 to an octal string expression. OCT$ is the complement of
Winbuild 5000215
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
this function.
Example:
x=OCT("1234")
è X=668
OCT$
Purpose:
To convert a decimal value to an octal value.
Syntax:
OCT$(x)
Comments:
x is rounded to an integer before OCT$(x) is evaluated. This statement converts adecimal value within the range of -2147483647 to +2147483647 to an octal stringexpression. Octal numbers are numbers to base 8 rather than base 10 (decimalnumbers). OCT is the complement of this function. See the BIN$ and HEX$ functions forbinary and hexadecimal conversions.
Example:
X=OCT$(18)
è X=22
Decimal 18 equals octal 22.
PI
Purpose:
Value of pi.
Syntax:
PI
BASIC Codes 216
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Example:
Z=PI*2
è Z= 6.2831853
RAD
Purpose:
Translates degrees to radians.
Syntax:
RAD(x)
Comments:
The expression x may be any numeric type. The evaluation of RAD is performed in singleprecision unless x is specified as a double precision number (i.e. x& or x#).
Example:
X=180Y=RAD(X)
è Y= 3.14159
Converting X (180 degrees) to radians results in Y=3.14
RND
Purpose:
To return a pseudo random number between 0 and 1.
Syntax:
RND
Comments:
RND without argument generates a pseudo random number between 0 and 1.
Winbuild 5000217
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Example:
A=RND
è A=0.3476
Generated a pseudo-random number within the range of 0-1.
ROUND
Purpose:
To return the value of X rounded to the N decimal digits to the right of the decimalpoint.
Syntax:
ROUND(X,N)
Comments:
Can also specify -N digits to the left if N<0.
Example:
A=123.456789B=ROUND(A,1)
è B=123.5
SGN
Purpose:
To return the sign of an expression.
Syntax:
SGN(expression)
Comments:
returns 1 if the number is positivereturns 0 if the number is 0
BASIC Codes 218
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
returns -1 if the number is negative
Example:
FRED=-123.456X=SGN(FRED)
è X=-1
The sign of -123.456 is -1, because it is negative.
SIN
Purpose:
To calculate the trigonometric sine of x, in radians.
Syntax:
SIN(x)
Comments:
To obtain SIN(x) when x is in degrees, use SIN(RAD(x)).
Example:
X=SIN(1.5)
è X=.9974948
The sine of 1.5 radians is .9974948 (single-precision)
SQRT
Purpose:
Returns the square root of x.
Syntax:
SQRT(x)
Comments:
Winbuild 5000219
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
x must be greater than or equal to 0.
Examples:
X=10Y=15Z=20A=SQRT(X)B=SQRT(Y)C=SQRT(Z)
è A=3.162277è B=3.872982è C=4.472135
TAN
Purpose:
To calculate the trigonometric tangent of x, in radians.
Syntax:
TAN(x)
Example:
X=TAN(PI/4)
è X=1
The tangent of PI/4 radians is 1
^
Purpose:
Raises x to the power of y.
Syntax:
result = x^y
Example:
BASIC Codes 220
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
if B=3 and C=2 then:
A=B^C
è A=9
because 3^2 = 9
String Functions
CHR$
FILLSTRING$
FORMAT$
LEN
LEFT$
LOWER$
LTRIM$
MID$
POS
RIGHT$
RTRIM$
STR$
TRIM$
UPPER$
VAL
CHR$
Purpose:
To convert an ASCII code to its equivalent character.
Syntax:
CHR$(n)
Comments:
n is a value from 0 to 255. CHR$ is commonly used to send a special character to the
terminal or printer. For example, you could send CHR$(12), a form feed, to the printer.
Winbuild 5000221
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
See the ASC function for ASCII-to-numeric conversion.
Examples:
CHR$(66)è B
This prints the ASCII character code 66, which is the uppercase letter B.CHR$(13)
è<CR> This command prints a carriage return.
FILLSTRING$
Purpose:
Returns a string of the specified length, chopping off extra letters (from the left) ifnecessary, and prefixing fill_char$ to the right, if needed.
Syntax:
fillstring$( source_string$, fill_char$, length )
Comments:
fill_char$ can only be one character
Example:
A$="BASIC"B$="B"C$=fillstring$(A$,B$,8)
è C$="BBBBASIC"The result is extra "B" characters added to the source string, to result in a string of 8chars.
FORMAT$
Purpose:
Adjust the format of an output string.
Syntax:
BASIC Codes 222
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
FORMAT$( a, "b" )
Where:a is the number or variable you wish to formatb is the format in which to place the number
Comments:
"0" A zero placed anywhere in the format string will allow for zeroes to be prepended
to a number (but only if there is no decimal point in the format string).
"+" A + placed anywhere in the format string will ensure that a +/- will be printed in
front of a number (but only when not using hex or octal)
"H" A H placed in the format string will cause the number to be output in upper case
hex . Using h will output in lower case. This only works if there is no decimal point in theformat string.
"o" An o (or O) will cause the number to be output in octal. Again, decimals in the
format string make this not work.
"#" Using # signs will force a certain number of places (like it does now). If the
number does not have a decimal place, 0s or spaces will be prepended (depending onwhether or not a 0 is present in the format string). If a decimal place IS present, thanonly spaces will be printed, and hex/octal don't work.Also note that a data entry set to display in hex numbers will NOT automatically convertentered data.Using Format$ to convert negative numbers to hex should always use a RIGHT$command to ensure the proper length.
Example:
COM_PUT( 1, FORMAT$( 30, "##H") + FORMAT$( 34, "0####" ) )
will put "1E0034" put out the com 1 port- because: the Hex value of 30 is 1E, and 34 with four places (####)with zeros appended will result in 0034. Thus 1E0034
LEFT$
Purpose:
To return a string that comprises the leftmost n characters of X$.
Syntax:
v$=LEFT$(x$,n)
Comments:
n must be within the range of 1 to 127.
Winbuild 5000223
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
If n>LEN(x$), the entire string (x$) will be returned.If n equals 0, the null string (length zero) is returned. (see the MID$ and RIGHT$substring functions.)
Example:
A$="BASIC"B$=LEFT$(A$,3)
è B$="BAS"
LEN
Purpose:
To return the number of characters in X$.
Syntax:
LEN(x$)
Comments:
Non printing characters and blanks are counted. x$ is any string expression.
Example:
X$="PORTLAND, OREGON"Y=LEN(X$)
è Y=16
Note that the comma and space are included in the character count of 16.
LOWER$
Purpose:
To change letters in a string to all lowercase.
Syntax:
LOWER$(x$)
Comments:
BASIC Codes 224
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
X$ is any String expression.
Example:
X$="Esa TEcHnoLogy"Y$=LOWER$(x$)
è Y$="esa technology"
LTRIM$
Purpose:
Remove leading blanks from a string.
Syntax:
LTRIM(x$)
Comments:
x$ is any string expression.
Example:
X$=" ESATECH"Y$=LTRIM(X$)
è Y$="ESATECH"
MID$
Purpose:
To return a string of m characters from x$, beginning with the nth character.
Syntax:
MID$(x$,n,m)
Comments:
n must be within the range of 1 to 128.m must be within the range of 0 to 127.If there are fewer than m characters to the right of n, all rightmost characters beginning
Winbuild 5000225
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
with n are returned.If n>LEN(x$), the MID$ function returns a null string.If m equals 0, the MID$ function returns a null string.If either n or m is out of range, an "out of range" error is returned.
For more information and examples, see LEFT$ and RIGHT$ functions.
Example:
A$="MORNING EVENING AFTERNOON"B$=MID$(A$,8,8)
è B$="EVENING"
POS
Purpose:
Returns the character position, within the value associated with A$, of the first characterof the first occurrence of the value associated with B$
Syntax:
POS(A$, B$)
POS(A$, B$, m)
Comments:
Note: Position is from left to right.
If there is no such occurrence, then POS(A$,B$) shall be zero. POS(A$,B$), where B$ isan empty string, shall be one for all values of A$.
Note: An additional parameter m can be added to start the search at the mth characterof A$. If there is no such occurrence, or if m is greater than the lenght of A$, the valuereturned is zero. Using POS (A$, B$), where B$ is an empty string, will return a alsozero.
Example: POS(FRED$, "E", 2) will check string FRED$ for the first occurence of "E"starting from position 2.
BASIC Codes 226
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
RIGHT$
Purpose:
To return a string that comprises the rightmost n characters of X$.
Syntax:
v$=RIGHT$(x$,n)
Comments:
If n is equal or greater than LEN(x$), RIGHT$ returns x$.If n equals zero, the null string (length zero) is returned (see the the MID$ and LEFT$functions).
Example:
A$="ESATECH BASIC"B$=RIGHT$(A$,5)
è B$="BASIC"
RTRIM$
Purpose:
Remove trailing spaces from a string.
Syntax:
RTRIM$(x$)
Comments:
x$ is any string expression.
Null characters will not be trimmed.
Example:
X$="ESATECH "Y$=RTRIM(X$)
è Y$="ESATECH"
Winbuild 5000227
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
STR$
Purpose:
To return a string representation of the value of x.
Syntax:
STR$(x)
Comments:
STR$(x) is the complementary function to VAL(x$) (see the VAL function).
Example:
A=123B$=STR$(A)
è B$="123"
TRIM$
Purpose:
Remove leading and trailing blanks from a string.
Syntax:
TRIM(x$)
Comments:
x$ is any string expression.
Example:
X$=" ESATECH "Y$=TRIM(X$)
è Y$="ESATECH"
BASIC Codes 228
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
UPPER$
Purpose:
Changes all letters in a string to uppercase.
Syntax:
UPPER$(x$)
Comments:
X$ is any string expression.
Example:
X$="ESA Technology"Y$=UPPER$(X$)
è Y$="ESA TECHNOLOGY"
VAL
Purpose:
Returns the numerical value of string x$.
Syntax:
VAL(x$)
Comments:
The VAL function also strips leading blanks, tabs, and line feeds from the argumentstring. The STR$ function (for numeric to string conversion) is the complement to the
VAL(x$) function. If the first character of x$ is not numeric, the VAL(x$) function will
return zero. The VAL command will also convert strings in exponential format to regularnumerical format.
Example:
A$="123"Z=VAL(A$)
è Z=123
Z is now a numeric value.
Winbuild 5000229
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
A$="2.2E-8"Z=VAL(A$)
è Z=0.000000022
Z is now a numeric value.
System Calls
CALL CONFIGMODE
CALL DOWNLOADMODE
CALL REBOOT
CALL RESTART
LOCKMUTEX
SYSTEM
CALL CONFIGMODE
Purpose:
Quits the current application, and puts the into into configuration mode.
Syntax:
CALL CONFIGMODE
CALL DOWNLOADMODE
Purpose:
Quits current program, and sends unit into "Download Mode".
Syntax:
CALL DOWNLOADMODE
BASIC Codes 230
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CALL REBOOT
Purpose:
Reboots the unit, and restarts current application.
Syntax:
CALL REBOOT
CALL RESTART
Purpose:
Quits the currently running program, and restarts the application.
Syntax:
CALL RESTART
LOCKMUTEX
Purpose:
There are 20 mutexes. When a task or the screen has a mutex, identified by thenumber, locked, then anyone else that calls LOCKMUTEX for that specific number willwait until that task or screen calls UNLOCKMUTEX.
Syntax:
LOCKMUTEX( n )UNLOCKMUTEX( n )
Comments:
n is any number 1-20.
Winbuild 5000231
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
SYSTEM
Purpose:
This command is identical to the UNIX system(3) command.
Syntax:
returnval = SYSTEM ( commandstring$ )
Comments:
returnval is any numeric integer that will store returned value from the systemcommand
commandstring$ is any string variable.
Reference
XI
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Winbuild 5000233
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Reference
ASCII Character Codes
Ethernet Cabling
Fill Color Values
Glossary
Null Modem Cable
Reserved Word List
Supported Data Types
ASCII Character Codes
Reference 234
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
The below character set is supported in the ESA Technology 5000 Family products:
The below characters are not supported for display on ESA Technology 5000 Familyproducts:
Error Codes
General errors start at 0 SUCCESS = 0 UNSPECIFIED_ERROR = 1 GENERAL_ERROR = 2
Serial errors start at 100 GENERAL_SERIAL_ERROR = 100 SERIAL_NO_READ_DATA = 101 SERIAL_TIMEOUT = 102 SERIAL_INCOMPLETE_READ = 103 SERIAL_PACKET_SIZE = 104 SERIAL_BAD_PARITY = 105 SERIAL_BAD_PORT = 106
Tag errors start at 500 INVALID_TYPE = 500 NO_MESSAGE_FOR_TAG = 501 SCALING_DIVIDE_BY_ZERO = 502 TAG_PARAM_OUT_OF_RANGE = 503 UNABLE_TO_FIND_TAG = 504
Driver errors start at 1000 INVALID_DRIVER_COMMAND = 1001 OUT_OF_BOUNDS_ARRAY = 1002 INVALID_TAG_NUMBER = 1003 SERIALIZATION_ERROR = 1004 UNABLE_TO_UNLINK_SOCKET = 1005
Winbuild 5000235
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
DRIVER_LIST_INVALID = 1006 UNRECOGNIZED_CLASS_NAME = 1007 DRIVER_SOCKET_BROKEN = 1008 DRIVER_NOT_ONLINE = 1009 MODBUS_EXCEPTION = 1010 MODBUS_BAD_CRC = 1011 DRIVER_AUTOBAUD_FAILED = 1012 STRINGS_NOT_SUPPORTED = 1013 INVALID_DATA_PACKET = 1014 BAD_NONVOL_ARRAY = 1015 RECIPE_CANT_FIND_RECORD = 1016 RECIPE_NO_FREE_RECORDS = 1017 RECIPE_NO_USED_RECORDS = 1018 RECIPE_INVALID_FILE = 1019 RECIPE_INVALID_VERSION = 1020 MODBUS_OVERLARGE_PACKET = 1021 DRIVER_READ_TIMEOUT = 1022 DF1_READ_FAIL = 1023 DF1_INVALID_BCCCRC = 1024 DF1_DECODE_PACKET_FAIL = 1025 DF1_INVALID_COMMAND = 1026 DF1_ERROR_STS = 1027 DF1_ERROR_EXTSTS = 1028 DF1_UNEXPECTED_PACKET = 1029 DF1_OVERSIZE_WRITE = 1030 GALIL_ISA_READ_ERROR = 1031 GALIL_ISA_TIMEOUT = 1032 INDRAMAT_CLCPPC_ERROR = 1033 INDRAMAT_CLCPPC_CRC_ERROR = 1034 AUTOMATIONDIRECT_ERROR = 1035
Basic errors start at 2000 BASIC_CODE_OUT_OF_RANGE = 2000 BASIC_INVALID_OPCODE = 2001 BASIC_DIVIDE_BY_ZERO = 2002 BASIC_LOG_ZERO = 2003 BASIC_SQRT_NEG = 2004 BASIC_ASIN = 2005 BASIC_NUMERIC_OVERFLOW = 2006 BASIC_TYPE_ERROR_STRING = 2007 BASIC_TYPE_MISMATCH = 2008 INVALID_BASIC_COMMAND = 2009 BASIC_SOCKET_BROKEN = 2010
HMI ERRORS - range from HMI_START_ERROR to HMI_END_ERROR HMI_START_ERROR = 10000 HMI_SCREEN_NOT_FOUND = 10000 HMI_SCREEN_LIST_EMPTY = 10001 HMI_UNRECOGNIZED_WIDGET = 10002 HMI_SOCKET_BROKEN = 10003 HMI_END_ERROR = 19999
Reference 236
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Ethernet Cabling
For full details, see Technical Note #78.
Winbuild 5000237
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Glossary
Application – The program you create that will be compiled and downloaded into the ESATechnology unit.
Archive – Create a fully packaged compressed file that contains all the necessarycomponents for this application. Can then be stored or emailed easily.
BASIC – Beginners All-Purpose Symbolic Instructional Code. A popular high-levelprogramming language that is easy to use and learn. ESA Technology's BASIC usesstandard ANSI language, and adds some object-oriented capabilities.
Compile – The WinBuild 5000 takes your current project and creates the executable filesthat will run on the target ESA unit.
CSV – Comma separated file, used to organized series of data (like arrays). Can use Excelor even a text editor to create/edit for uploading/downloading data to unit.
Driver – Driver - Software to control a hardware component or peripheral device. A devicedriver is responsible for accessing the hardware registers of the device. Drivers often formpart of the lowest level of the operating system kernel, with which they are linked when thekernel is built.
HMI – Human-Machine Interface or MMI (Man/Machine Interface) Essentially the screensand objects that the operator will interact with.
Reference 238
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Image – A compiled collection of files that represent what the 'drive' on the ESA would looklike. Thus this 'image' can be transferred from one PC to another, and then downloaded intothe ESA unit- thus effectively updating its system with the new program.
Indicator – A 'light' that will change color based on a tag value. (Example: Green for aninput being ON and red for input OFF.)
Key Field – This is the tag the recipe system will use for its 'index' value or a way touniquely identify each recipe record.
Messaging – This feature lets you display text message on screen instead of a number.(For example, instead of displaying STATUS=1, you can display "Machine Stopped".)
Message Display – Option to make a data entry box display a TEXT MESSAGE instead of anumeric value. (See Messaging.)
Non-Volatile – Data that is stored in battery-backed memory, and will be retained if poweris interrupted to the unit.
On Close – Code that gets executed once when the object is closed or deleted from thescreen. (Basically when switching screens.)
On Enter – Code that gets executed once when the data is finished being typed in, and theuser hits the "enter" key.
On Open – Code that gets executed once when the object is drawn onto the screen.
On Press – Code that gets executed once when the button is pressed.
On Release – Code that gets executed once when the button is released.
Safe Mode – A state that will allow you to download programs into the unit if the previousapplication was corrupted or missing. Hold your finger in the upper left of the touch screen(or F1 on non-touch units) while the unit is booting to reach Safe Mode.
Subroutine – A section of code that only gets run when you call it using the GOSUBstatement. When the code is done (with a RETURN) it will then go back to executing wherethe subroutine was called from.
SuperButton – This feature lets you create a button/text object that can be dynamic, andchange this color/label based on the status of variables. (Great for toggle start/stopbuttons.)
Tag – A register or variable contained in your program. Can be sourced to any driver inyour project, and given a register address. A tag is referenced by its TAG NAME in theproject.
Tag Table – Listing of all the variables (tags) used in your project. This is also where youcan set scaling and messaging for each tag as well.
Target – the ESA unit are downloading to.
Winbuild 5000239
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
Task – A stand-alone background program that runs in parallel with your HMI program. Thetask uses the same variables and drivers as your project- and is great for building alarmmonitoring, state-machine processes. Tasks run always in the background, regardless ofother code or screens that are running.
Timer – Feature in WinBuild 5000 that allows you to execute a set of code on a periodicbasis.
Volatile – Data variables that will get lost if power is interrupted to the unit.
While Open – Code that gets continuously run while that object is on screen. The code isexecuted once for eachredraw of the screen. (Typically several times a second.)
Modbus Master ActiveX Component
The ESA Technology ActiveX object enables the transfer of information between a ET 5000-series HMI or ET 6500-series IO modules and a PC. It is a standard ActiveX control withboth general Modbus commands and ET 5000-specific commands.
Examples in this document are provided for Visual Basic 6.0. The ActiveX object is fullyfunctional from any COM-enabled programming language, including C++, Visual Basic.NET,C#, Java, and most all modern programming languages that run on a Windows platform.Please consult your documentation for details on how to create and use ActiveX/COMobjects in other programming languages.
For more information, documentation and example programs:
C:\Program Files\Common Files\ESA Technology
Reference 240
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Null Modem Cable
The ESA Technology supplied null-modem cable has special black dots painted onto theends to identify it. The cable has the following pinout:
Reserved Word List
AbsAcosAddAndArraySetNumericArraySetStringAscAsinAtanBaudBccBcc8wBellBinBin2ByteBin2DRealBin2DWordBin2RealBin2UByteBin2UDWordBin2UWordBin2WordBitAndBitAtBitClearBitNotBitOrBitSet
Winbuild 5000241
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BitShiftLBitShiftRBitXorBlackBlueBreakBrownBufferByte2BinCallCaseChrClockClosePopupCancelClosePopupOKComComGetComPutConfigmodeContinueCopyCosCrc16Crc32CyanDarkGrayDateDayOfWeekDecrement_ContrastDefault_ContrastDegDelayDeleteDoDownloadmodeDReal2BinDriverDriverClearDriverGetDriverGetStatusDriverPutDriverPutGetDriverSetSTatusDWord2BinElseEndEndifExpFiFillstringFor
Reference 242
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
FormatFracGetGosubGotoGreenHexIfInBufferCountIncrement_ContrastInitIntIsLabelLeftLenLightBlueLightCyanLightGrayLightGreenLightMagentaLightRedLogLog10Log2LoopLowerLtrimMagentaMaxMidMinModMultidropNextNextNotOctOrParityPIPopupPosPreviousPurgePutRadReal2BinRebootRedResponse
Winbuild 5000243
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
RestartRightRndRoundRtrimSaveSelectSetBackgroundColorSetCaptionFillColorSetCaptionFontSetCaptionTextSetDateSetDisabledSetEnabledSetFileNameSetFillColorSetFontSetInvisibleSetPositionSetSizeSetTextSetTextColorSettimeSetVisibleSgnSinSoundSqrtStepStrTagTagDescriptionTanThenTimeTimeoutToTrimUByte2BinUDWord2BinUntilUpperUWord2BinValValueWaitWaitForNonZeroWhileWhiteWord2BinYellow
Reference 244
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Supported Data Types
Data Type Name Abv Bits Digit Range
Bit Bit 1 1 0 0 X 1
Byte Byte B 8 0 -128 X 127
Unsigned byte Ubyte UB 8 0 0 X 255
Word Word W 16 0 -32,768 X 32,767
Unsigned Uword UW 16 0 0 X 65,535
Double Word Dword DW 32 0 -2,147,483,648 X 2,147,483,647
Unsigned Double Word Udword UDW 32 0 0 X 4,294,967,295
Double Real Dreal DR 64 15 4.19E-307 |X| 1.67E+308
String String S 130bytes
127 char
Binary String BS 62 char
GNU General Public License
Portions of the ESA Technology 5000 Family runtime image contain software licensed underthe GNU GPL.
GNU GENERAL PUBLIC LICENSEVersion 2, June 1991Copyright (C) 1989, 1991 Free Software Foundation, Inc.59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, butchanging it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and changeit. By contrast, the GNU General Public License is intended to guarantee your freedom toshare and change free software--to make sure the software is free for all its users. ThisGeneral Public License applies to most of the Free Software Foundation's software and toany other program whose authors commit to using it. (Some other Free SoftwareFoundation software is covered by the GNU Library General Public License instead.) You canapply it to your programs, too.When we speak of free software, we are referring to freedom, not price. Our General PublicLicenses are designed to make sure that you have the freedom to distribute copies of freesoftware (and charge for this service if you wish), that you receive source code or can get it
Winbuild 5000245
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
if you want it, that you can change the software or use pieces of it in new free programs;and that you know you can do these things.To protect your rights, we need to make restrictions that forbid anyone to deny you theserights or to ask you to surrender the rights. These restrictions translate to certainresponsibilities for you if you distribute copies of the software, or if you modify it.For example, if you distribute copies of such a program, whether gratis or for a fee, youmust give the recipients all the rights that you have. You must make sure that they, too,receive or can get the source code. And you must show them these terms so they knowtheir rights.We protect your rights with two steps: (1) copyright the software, and (2) offer you thislicense which gives you legal permission to copy, distribute and/or modify the software.Also, for each author's protection and ours, we want to make certain that everyoneunderstands that there is no warranty for this free software. If the software is modified bysomeone else and passed on, we want its recipients to know that what they have is not theoriginal, so that any problems introduced by others will not reflect on the original authors'reputations.Finally, any free program is threatened constantly by software patents. We wish to avoid thedanger that redistributors of a free program will individually obtain patent licenses, in effectmaking the program proprietary. To prevent this, we have made it clear that any patentmust be licensed for everyone's free use or not licensed at all.The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING,DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by thecopyright holder saying it may be distributed under the terms of this General Public License.The "Program", below, refers to any such program or work, and a "work based on theProgram" means either the Program or any derivative work under copyright law: that is tosay, a work containing the Program or a portion of it, either verbatim or with modificationsand/or translated into another language. (Hereinafter, translation is included withoutlimitation in the term "modification".) Each licensee is addressed as "you".Activities other than copying, distribution and modification are not covered by this License;they are outside its scope. The act of running the Program is not restricted, and the outputfrom the Program is covered only if its contents constitute a work based on the Program(independent of having been made by running the Program). Whether that is true dependson what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receiveit, in any medium, provided that you conspicuously and appropriately publish on each copyan appropriate copyright notice and disclaimer of warranty; keep intact all the notices thatrefer to this License and to the absence of any warranty; and give any other recipients ofthe Program a copy of this License along with the Program.You may charge a fee for the physical act of transferring a copy, and you may at your optionoffer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming awork based on the Program, and copy and distribute such modifications or work under theterms of Section 1 above, provided that you also meet all of these conditions:
Reference 246
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
· a) You must cause the modified files to carry prominent notices stating that youchanged the files and the date of any change.
· b) You must cause any work that you distribute or publish, that in whole or in partcontains or is derived from the Program or any part thereof, to be licensed as awhole at no charge to all third parties under the terms of this License.
· c) If the modified program normally reads commands interactively when run, youmust cause it, when started running for such interactive use in the most ordinaryway, to print or display an announcement including an appropriate copyright noticeand a notice that there is no warranty (or else, saying that you provide a warranty)and that users may redistribute the program under these conditions, and telling theuser how to view a copy of this License. (Exception: if the Program itself isinteractive but does not normally print such an announcement, your work based onthe Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of thatwork are not derived from the Program, and can be reasonably considered independent andseparate works in themselves, then this License, and its terms, do not apply to thosesections when you distribute them as separate works. But when you distribute the samesections as part of a whole which is a work based on the Program, the distribution of thewhole must be on the terms of this License, whose permissions for other licensees extend tothe entire whole, and thus to each and every part regardless of who wrote it.Thus, it is not the intent of this section to claim rights or contest your rights to work writtenentirely by you; rather, the intent is to exercise the right to control the distribution ofderivative or collective works based on the Program.In addition, mere aggregation of another work not based on the Program with the Program(or with a work based on the Program) on a volume of a storage or distribution mediumdoes not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) inobject code or executable form under the terms of Sections 1 and 2 above provided that youalso do one of the following:
· a) Accompany it with the complete corresponding machine-readable source code,which must be distributed under the terms of Sections 1 and 2 above on a mediumcustomarily used for software interchange; or,
· b) Accompany it with a written offer, valid for at least three years, to give any thirdparty, for a charge no more than your cost of physically performing sourcedistribution, a complete machine-readable copy of the corresponding source code, tobe distributed under the terms of Sections 1 and 2 above on a medium customarilyused for software interchange; or,
· c) Accompany it with the information you received as to the offer to distributecorresponding source code. (This alternative is allowed only for noncommercialdistribution and only if you received the program in object code or executable formwith such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modificationsto it. For an executable work, complete source code means all the source code for allmodules it contains, plus any associated interface definition files, plus the scripts used tocontrol compilation and installation of the executable. However, as a special exception, thesource code distributed need not include anything that is normally distributed (in eithersource or binary form) with the major components (compiler, kernel, and so on) of theoperating system on which the executable runs, unless that component itself accompaniesthe executable.If distribution of executable or object code is made by offering access to copy from a
Winbuild 5000247
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
designated place, then offering equivalent access to copy the source code from the sameplace counts as distribution of the source code, even though third parties are not compelledto copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expresslyprovided under this License. Any attempt otherwise to copy,modify, sublicense or distribute the Program is void, and will automatically terminate yourrights under this License. However, parties who have received copies, or rights, from youunder this License will not have their licenses terminated so long as such parties remain infull compliance.
5. You are not required to accept this License, since you have not signed it. However,nothing else grants you permission to modify or distribute the Program or its derivativeworks. These actions are prohibited by law if you do not accept this License. Therefore, bymodifying or distributing the Program (or any work based on the Program), you indicateyour acceptance of this License to do so, and all its terms and conditions for copying,distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), therecipient automatically receives a license from the original licensor to copy, distribute ormodify the Program subject to these terms and conditions. You may not impose any furtherrestrictions on the recipients' exercise of the rights granted herein. You are not responsiblefor enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for anyother reason (not limited to patent issues), conditions are imposed on you (whether bycourt order, agreement or otherwise) that contradict the conditions of this License, they donot excuse you from the conditions of this License. If you cannot distribute so as to satisfysimultaneously your obligations under this License and any other pertinent obligations, thenas a consequence you may not distribute the Program at all. For example, if a patent licensewould not permit royalty-free redistribution of the Program by all those who receive copiesdirectly or indirectly through you, then the only way you could satisfy both it and thisLicense would be to refrain entirely from distribution of the Program.If any portion of this section is held invalid or unenforceable under any particularcircumstance, the balance of the section is intended to apply and the section as a whole isintended to apply in other circumstances.It is not the purpose of this section to induce you to infringe any patents or other propertyright claims or to contest validity of any such claims; this section has the sole purpose ofprotecting the integrity of the free software distribution system, which is implemented bypublic license practices. Many people have made generous contributions to the wide rangeof software distributed through that system in reliance on consistent application of thatsystem; it is up to the author/donor to decide if he or she is willing to distribute softwarethrough any other system and a licensee cannot impose that choice.This section is intended to make thoroughly clear what is believed to be a consequence ofthe rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either bypatents or by copyrighted interfaces, the original copyright holder who places the Programunder this License may add an explicit geographical distribution limitation excluding thosecountries, so that distribution is permitted only in or among countries not thus excluded. Insuch case, this License incorporates the limitation as if written in the body of this License.
Reference 248
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
9. The Free Software Foundation may publish revised and/or new versions of the GeneralPublic License from time to time. Such new versions will be similar in spirit to the presentversion, but may differ in detail to address new problems or concerns.Each version is given a distinguishing version number. If the Program specifies a versionnumber of this License which applies to it and "any later version", you have the option offollowing the terms and conditions either of that version or of any later version published bythe Free Software Foundation. If the Program does not specify a version number of thisLicense, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whosedistribution conditions are different, write to the author to ask for permission. For softwarewhich is copyrighted by the Free Software Foundation, write to the Free SoftwareFoundation; we sometimes make exceptions for this. Our decision will be guided by the twogoals of preserving the free status of all derivatives of our free software and of promotingthe sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FORTHE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHENOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIESPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSEDOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TOTHE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAMPROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR ORCORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITINGWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/ORREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISINGOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TOLOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOUOR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHERPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Index- " -
"M" icon ...25
- . -
.DMC ...69
- ^ -
^ ...219
- 1 -
13A ...69
- 6 -
6000 ...48
6K ...48
- A -
ABS ...202
ACOS ...202
Adding Devices ...31
Allen-Bradley ...39
Application ...237
Archive ...237
array ...150
ASC ...203
ASCII ...233
ASIN ...203
ATAN ...204
Automation Direct ...35
- B -
BASIC ...237
BASIC codes ...141
BIN ...201, 205
BIN$ ...206
BIN2BYTE ...153
BIN2DREAL ...154
BIN2DWORD ...155
BIN2REAL ...154
BIN2UDWORD ...156
BIN2UWORD ...156
binary functions ...152
binary string ...152
BITAND ...161
Winbuild 5000249
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
BITAT ...162
BITNOT ...163
BITOR ...163
BITSET ...164
BITSHIFTL ...164
BITSHIFTR ...165
BITXOR ...165
BYTE2BIN$ ...157
- C -
CALL ARRAYSETNUMERIC ...150, 151
CALL CONFIGMODE ...229
CALL DOWNLOADMODE ...229
CALL REBOOT ...230
CALL RESTART ...230
CALL SETDATE ...184
Character Codes ...233
CHECK CODE ...140
CHR$ ...220
CIB ...64
circular ...133
CLOCK ...185
CLOSEPOPUPCANCEL ...189
CLOSEPOPUPOK ...190
COM: INIT ...141
COM: PUT COM port VALUE expression ...141
COM: PUT COM port VALUE expressionRESPONSE tag ...141
COM: PUT COM port VALUE expression VALUEexpression ...141
COM: PUT COM port VALUE expression VALUEexpression RESPONSE tag ...141
COMGET$ ...176
COMGETBINUNTIL ...177
Communications ...94
Compile ...237
Compile Program ...80
Compumotor ...48
COMPUT ...179
COMPUTGETBINUNTIL ...180
COPY SCREEN ...98
CRC16 ...207
CRC32 ...208
Index 250
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
CSV ...237
- D -
Data Acquisition ...133
DATE ...186
DATE$ ...186
DAYOFWEEK ...187
DEG ...208
DELETE SCREEN ...98
DF1 ...39
DO...LOOP UNTIL ...168
Download Non-Volatile Default Data ...80
Download Program ...80
Download Program to Image ...80
Downloader Utility ...27
DREAL2BIN$ ...157
Driver ...237
DRIVER: PURGE BUFFER ...141
DRIVER: PUT ...141
DRIVER: PUT MIXED RESPONSE ...141
DRIVER: PUT RESPONSE ...141
DWORD2BIN$ ...158
- E -
EDI ...27
Edit BASIC ...140
Editor ...95
ELSE ...171
Emerson E Series ...51
ENDIF ...171
escape sequences ...142
EXP ...209
- F -
Fast Screen Switch ...30
Force Full Download ...80
FORMAT$ ...221
FOR-NEXT ...168
- G -
Generate Report ...23
GET DRIVER STATUS driver tag ...141
GOSUB ...170
GOTO ...170
Winbuild 5000251
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
GT6 ...48
GV6 ...48
- H -
HEX ...209
HEX$ ...210
HMI ...237
HTML ...23
- I -
IF ...171
Image ...237
INBUFFERCOUNT ...181
Indicator ...237
INKEY ...181
INT ...211
IP ...94
IP address ...80
- K -
Key Field ...237
Koyo ...35
- L -
LABEL ...172
LEFT$ ...222
LOG ...211
LOG10 ...212
LOG2 ...212
LOWER$ ...223
LTRIM ...224
- M -
MAIN screen ...25
MAX ...213
Memobus ...61
Message Display ...237
Messaging ...237
MID$ ...224
milliseconds ...185
MIN ...213
Mitsubishi FX Driver ...47
MOD ...214
Modbus ...41
Index 252
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
Modbus Base ...42
Modbus TCP ...44
Modicon ...41
Modicon Modbus RTU ...41
- N -
NEW SCREEN ...97
Non-Volatile ...237
nudge ...21
null-modem cable ...240
- O -
OCT ...214
OCT$ ...215
On Close ...237
On Enter ...237
On Open ...237
On Press ...237
On Release ...237
- P -
PI ...215
PNG ...23
POPUP ...190
POS ...225
Programming ...12
pseudocodes ...141
- R -
RAD ...216
REAL2BIN$ ...159
RECIPE: ADD ...89
RECIPE: COPY ...89
RECIPE: DELETE ...89
RECIPE: FIND BY KEY ...89
RECIPE: LOAD DEFAULT ...89
RECIPE: NEXT ...89
RECIPE: PREVIOUS ...89
RECIPE: SAVE ...89
RECIPE: WAIT UNTIL COMMAND DONE ...89
REM ...173
REPORT WRITER ...23
Restart Program ...80
RETURN ...173
Winbuild 5000253
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology
RIGHT$ ...226
rolling display ...133
ROUND ...217
RTRIM ...226
RTU ...41
- S -
Safe Mode ...237
screen list ...21, 25
SET DRIVER driver status ...141
SET TAG tag TO value ...141
SETBACKGROUNDCOLOR ...190
SETCAPTIONFILLCOLOR ...191
SETCAPTIONFONT ...191
SETCAPTIONTEXT ...192
SETCAPTIONTEXTCOLOR ...193
SETDISABLED ...193
SETENABLED ...194
SetFileName ...195
SETFILLCOLOR ...194
SETFONT ...195
SETINVISIBLE ...196
SETLINECOLOR ...197
SETPOSITION ...197
SETSIZE ...198
SETTEXT ...198
SETTEXTCOLOR ...199
SETTIME ...185
SETTRENDRANGE ...200
SETVISIBLE ...200
SGN ...217
Show Mouse Cursor ...30
SIN ...218
SQRT ...218
STR$ ...227
string literals ...142
Subroutine ...237
SuperButton ...237
SWITCH TO PREVIOUS SCREEN ...141
SWITCH TO SCREEN screen ...141
Index 254
p/n 50-00222-01 Rev 1.8 8 Feb. 2005 © 2005 ESA Technology
- T -
Tag ...237
Tag Table ...237
Tag Watch ...25
TAG WATCH WINDOW ...25
TAN ...219
Target ...237
Task ...237
TCP/IP ...94
THEN ...171
TIME ...188
TIME$ ...188
Timer ...237
Timers ...72
trend chart ...133
trend chart set up ...133
- U -
UBYTE2BIN$ ...158
UDWORD2BIN$ ...159
UPPER$ ...228
UWORD2BIN$ ...160
- V -
VAL ...228
Volatile ...237
- W -
WAIT ...174
While Open ...237
WORD2BIN$ ...160
- Y -
Yaskawa ...61
Yaskawa RS485 Cabling ...62
Winbuild 5000255
p/n 50-00222-01 Rev 1.8 8 Feb. 2005© 2005 ESA Technology