Rockwell-automation 2708-NBD VBASIC Language Development Kit Manual de usuario

Busca en linea o descarga Manual de usuario para Equipo Rockwell-automation 2708-NBD VBASIC Language Development Kit. Rockwell Automation 2708-NBD VBASIC Language Development Kit User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 84
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
ALLEN-BRADLEY
A-B VBASIC Language Development Kit
(Catalog No. 2708-NBD)
User Manual
Vista de pagina 0
1 2 3 4 5 6 ... 83 84

Indice de contenidos

Pagina 1 - User Manual

ALLEN-BRADLEYA-B VBASIC Language Development Kit(Catalog No. 2708-NBD)User Manual

Pagina 2 - Important User Information

Chapter 1Introduction to BASIC1–2Almost no one is using the original ANSI standard BASIC any more. Thelanguage only allowed 26 variables, had no strin

Pagina 3 - Chapter 3

Chapter 1Introduction to BASIC1–3A-B VBASIC is a subset of Microsoft’s Visual BASIC, consisting of thosecommands which are relevant in the workstation

Pagina 4 - Special Devices

A–B2Chapter2–1Developing and Runningan A-B VBASIC ProgramStep #1 – PlanningThe 2708-DH5Axx workstations have approximately 96K bytes dedicated forprog

Pagina 5 - Appendix B

an A-B VBASIC ProgramChapter 2Developing and Running2–2In order to emulate programs on a PC the A-B Application Library wasdeveloped (see Chapter 5).

Pagina 6 - Table of Contents

an A-B VBASIC ProgramChapter 2Developing and Running2–3The .LXE “download” file produced the the A-B VBASIC cross-compilermust be transmitted, through

Pagina 7 - Subroutines

an A-B VBASIC ProgramChapter 2Developing and Running2–4Prefix digits 9 and 10 of the network record: are 01. (Refer to AttendedWorkstation User’s Manu

Pagina 8 - A-B VBASIC Limits

an A-B VBASIC ProgramChapter 2Developing and Running2–5All errors encountered by the A-B VBASIC pseudo-code interpreter areserious enough to result in

Pagina 9 - Introduction to BASIC

an A-B VBASIC ProgramChapter 2Developing and Running2–6Circuitry within a workstation is capable of detecting and reporting to theprocessor an imminen

Pagina 10 - What is Visual BASIC ?

A–B3Chapter3–1The A-B VBASICCROSS-COMPILER (LXB)The Visual BASIC Development Environment alone will not generate aprogram for a workstation. Visual BA

Pagina 11 - What is A-B VBASIC?

CROSS-COMPILER (LXB)Chapter 3The A-B VBASIC3–2The LXB compiler is executed on a PC by entering the following command.You must be in the right director

Pagina 12 - Developing and Running

DisclaimerSolid state equipment has operational characteristics differing from those ofelectromechanical equipment. “Safety Guidelines for the Applica

Pagina 13 - (cont’d)

CROSS-COMPILER (LXB)Chapter 3The A-B VBASIC3–3Examples:LXBIn the case above, the operator is prompted for 3 file names.LXB Prog1In this case, the file

Pagina 14 - Start-up Condition of

CROSS-COMPILER (LXB)Chapter 3The A-B VBASIC3–4B – Downloaded Executable FileThe usual extension of a file that is produced by most other compilers is“

Pagina 15 - A-B VBASIC Program

A–B4Chapter4–1Special Devices in A-B VBASICMost I/O in A-B VBASIC is performed by accessing special device nameswhich are unique to the workstation. I

Pagina 16 - Run-Time Errors

Chapter 4Special Devices in A-B VBASIC4–2Some statements and intrinsic functions implicitly refer to a specific device.These are:Front panel LCD CLS,

Pagina 17 - Power Failure

Chapter 4Special Devices in A-B VBASIC4–3Note: See the description of PRINT USING and WRITE for details on otherformatting options supported.See also

Pagina 18 - CROSS-COMPILER (LXB)

Chapter 4Special Devices in A-B VBASIC4–4Reserved device name: BAROpen Modes: INPUTStatements: LINE INPUTFunctions: EOF returns TRUE when a complete r

Pagina 19 - Invoking the Compiler

Chapter 4Special Devices in A-B VBASIC4–5This means that:1. EOF and LOF may be called any number of times before LINE INPUT,and they will return the i

Pagina 20

Chapter 4Special Devices in A-B VBASIC4–6Reserved device names: HOST, NET, and QUEIt is very easy to forward the data collected by a workstation to th

Pagina 21

Chapter 4Special Devices in A-B VBASIC4–7Note: There is no queue for data FROM the host, only a single buffer. Inputoperations from HOST and NET acces

Pagina 22 - Special Devices in A-B VBASIC

Chapter 4Special Devices in A-B VBASIC4–8For example:PRINT #NETDEV, “BAD INVENTORY NUMBER”may be trapped by the host computer as a BASIC ERROR because

Pagina 23 - Device: LCD Display

A–BBulletin 2708BASIC Language Development KitTable of ContentsiChapter 1What is BASIC? 1–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 24 - Device: Keypad

Chapter 4Special Devices in A-B VBASIC4–9CLOSE “HOST”Note: When HOST is CLOSEd, the A-B VBASIC interpreter always tellsthe network task that no data i

Pagina 25 - Device: Barcode Scanners

Chapter 4Special Devices in A-B VBASIC4–10LINE INPUT # for HOST and NETGET # for HOST and NET (OPEN with RANDOM)These statements will read one record

Pagina 26

Chapter 4Special Devices in A-B VBASIC4–11IOCTL$ (intrinsic function) for HOST and NETThis function returns a string formatted as follows:Byte 0: ‘0’

Pagina 27 - Device: Host Computer

Chapter 4Special Devices in A-B VBASIC4–12A – Output to a Communication PortThe BASIC Language Development Kit (Catalog No. 2708-NBD) containssubrouti

Pagina 28

Chapter 4Special Devices in A-B VBASIC4–13C – Modem Control LinesThe primary communication port is equipped with DTR and RTS. These canbe set through

Pagina 29

Chapter 4Special Devices in A-B VBASIC4–14For example, in a new file:PUT #X, 1, somethingPUT #X, 1000, somethingwill result in space being allocated f

Pagina 30 - Chapter 4

Chapter 4Special Devices in A-B VBASIC4–15The LED in the lower left corner of alphanumeric keyboards is used as ashift lock indicator by the operating

Pagina 31 - ‘ Do something else

Chapter 4Special Devices in A-B VBASIC4–16Reserved device name: EGGDescription:The egg timer is a word of memory which, when non-zero, is decrementedb

Pagina 32 - Auxiliary

A–B5Chapter5–1A-B VBASIC Application LibraryThe BASIC Language Development Kit (Catalog No. 2708-NBD) consists ofa set of BASIC source files which you

Pagina 33 - Auxiliary (cont’d)

Chapter 5A-B VBASIC Application Library5–2Installation consists of installing the diskette in drive A: and typing:A:INSTALIB d:Where d is the destinat

Pagina 34 - Device: RAM Files

Bulletin 2708BASIC Language Development KitTable of ContentsiiChapter 4Introduction 4–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 35 - Device: Front Panel LEDs

Chapter 5A-B VBASIC Application Library5–3If you don’t want to type this in, you will find this sample program underENVEX1.BAS. Now, assuming that the

Pagina 36 - User Status Display

Chapter 5A-B VBASIC Application Library5–4Figure 5.1ENVPC Main Screen (Running ENVEX1)Library TestDo somethingTimeout of 1000 has 900 left.123456789 1

Pagina 37 - Device: The Egg Timer

Chapter 5A-B VBASIC Application Library5–5Since that is all that your BASIC program would input.TAB C or ALT C: Com port manual input. You key in a re

Pagina 38 - Introduction

Chapter 5A-B VBASIC Application Library5–6The lower ASCII characters from 0 to 31 and 127 are named. These are:NUL = 0 BS = 8 DLE = 16 CAN = 24SOH = 1

Pagina 39 - Using the Library

Chapter 5A-B VBASIC Application Library5–7MODIFIED%: True when a read changes the default value. . . . . . TIMEOUT%: YOU set to 100th seconds before a

Pagina 40 - Writing Programs

Chapter 5A-B VBASIC Application Library5–8Display and KeyboardYou may use the full range of PRINT, LOCATE, etc. functions to write to thedisplay. Do n

Pagina 41 - Using the ENVPC Simulator

Chapter 5A-B VBASIC Application Library5–9Status DisplayThe application status display (one of the special status displays described inthe Attended Wo

Pagina 42

A–BAAppendixA–1A-B VBASIC and Visual BASIC TipsMisspellingsDon’t misspell names. BASIC is unforgiving of such errors since it will justcreate a new v

Pagina 43

Appendix AA-B VBASIC and Visual BASIC TipsA–2The programmer assumed that this statement would clear the second line ofthe display and then print “This

Pagina 44

A–BBAppendixB–1Differences BetweenA-B VBASIC and Visual BASICThis document describes the differences between Allen-Bradley VBASICand Microsoft Visual

Pagina 45

Bulletin 2708BASIC Language Development KitTable of ContentsiiiChapter 5Introduction 5–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 46

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–2b. # suffix on variablesc. Floating–point constants with 8 or more significant digitsd. AS

Pagina 47 - Appendix

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–3LINE INPUT Request$IF Request$ = “JUMP” THEN CHAIN “JUMP”The interpreter does not tolerate

Pagina 48 - Appendix A

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–4statements produce executable code, they should be placed at the start of aprogram.CONST FA

Pagina 49 - A-B VBASIC and Visual BASIC

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–5DECLARE FUNCTION GetTime$()DECLARE SUB SetTime$()The generic name for declaring a procedure

Pagina 50 - Keywords

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–6OPTION BASE is not supported, so in order to set the lower subscript usethe following: DIM

Pagina 51 - CLOSE #1

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–7EXIT DOEND IFLOOPCLOSE #1EXIT {DO/FOR/FUNCTION/SUB}Exits a DO...LOOP or FOR...NEXT loop, FU

Pagina 52

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–8may not return the same file numbers, even in identical programs. Justbecause a file numbe

Pagina 53

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–9END IFLOOPUpdateTime:LOCATE 1, 1, 0PRINT LEFT$(CurrTime$,2); “:”; RIGHT$(CurrTime$,2);RETUR

Pagina 54 - EOF(filenumber)

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–10INSTR([start,]stringexpression1,stringexpression2)Returns the character position of the fi

Pagina 55

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–11LBOUND(array[,dimension])Returns the lower bound (smallest available subscript) for the in

Pagina 56

Bulletin 2708BASIC Language Development KitTable of ContentsivDECLARE {FUNCTION | SUB} name(parameters) B–4. . . . . . . . . . . DEFINT letterrange[,l

Pagina 57 - IF...THEN...ELSE

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–12OPEN “COM” FOR INPUT AS #1 ‘Must be a normal terminal.DODO WHILE LOC(1) = 0: LOOP ‘Wait fo

Pagina 58 - KILL “filespec”

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–13OCT$(numeric–expression)Returns a string representing the octal value of the numeric argum

Pagina 59

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–14OPEN “EMPLOYEE” FOR APPEND AS #1Format$ = “$####.##”A = 123.459PRINT #1, USING Format$; A

Pagina 60 - MKD$, MKI$, MKL$, MKS$

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–15RETURNReturns control from a sub routine. No line number or line label clauses aresupport

Pagina 61

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–16statementsEND SELECTSGN(numeric–expression)Indicates the sign of a numeric expression. Se

Pagina 62 - ‘ remark

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–17SOUND 1400, 2 ’1400 Hz for 2 clock ticks (20 ticks per second).SPACE$(n)Returns a string o

Pagina 63

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–18SUB GetName (Name$)DOCLSLINE INPUT “Enter your name: “;Name$PRINT Name$;“Correct? “;LINE I

Pagina 64 - SOUND frequency,duration

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–19TIME$ = “15450000” ‘ Sets time to 3:45:00.00TIMERReturns the number of seconds elapsed si

Pagina 65

A-B VBASIC and Visual BASICAppendix BDifferences BetweenB–20WENDExecutes a series of statements in a loop, as long as a given condition is true.A-B VB

Pagina 66 - TIME$ = stringexpression

A–BCAppendixC–1Application Library SubroutinesIn ENV.BAS and ENVPC.BASOpenLINX Opens all devices to be used by low level I/O routines. . . . . . TestE

Pagina 67

Bulletin 2708BASIC Language Development KitTable of ContentsvPOS(0) B–13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 68

Appendix CApplication Library SubroutinesC–2In TRIG.BASFullArcTangent! Returns arc tangent using numerator and denominator. . ArcTangent! Relturns the

Pagina 69

Appendix CApplication Library SubroutinesC–3The most important events are:TimeoutEvent The input timer has expired. . . . NetEvent Read from network h

Pagina 70 - SUB OpenLINX

Appendix CApplication Library SubroutinesC–4SetDTR Sets the state of Data Terminal Ready.SetRTS Sets the state of Request To Send for a comm port.Set

Pagina 71 - Appendix C

Appendix CApplication Library SubroutinesC–5PENDING% TRUE if Send will result in a pause.This should be checked before any Send, to prevent pauses in

Pagina 72

Appendix CApplication Library SubroutinesC–6Note: In EnvPC, dashes are returned, not slashes (MM-DD-YYYY).CL1 Clears the top line of the display and h

Pagina 73

Appendix CApplication Library SubroutinesC–7The global MODIFIED% is TRUE when the string was changed in anyway. The strlength is the maximum number

Pagina 74

Appendix CApplication Library SubroutinesC–8ReadPassword% Inputs a password from the keyboard.e = ReadPassword% ( length%, string$ ) ;FUNCTION Read

Pagina 75

Appendix CApplication Library SubroutinesC–9The menu string is a string in which each menu entry is preceded by a “ | ”(vertical bar). Thus a menu$ su

Pagina 76

Appendix CApplication Library SubroutinesC–10FullArcTangent! Returns arc tangent using numerator and denominator.This is similar to ArcTangent (numera

Pagina 77

Appendix CApplication Library SubroutinesC–11SineH! Returns the hyperbolic sine.y! = SineH! ( x! )FUNCTION SineH! ( x )CosineH! Returns the hype

Pagina 78

Bulletin 2708BASIC Language Development KitTable of ContentsviIn TRIG.BAS C–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 79

A–BDAppendixD–1A-B VBASIC LimitsFirmware Version 1.1. . . . . . . . . . . . . . . . . Maximum PRINT USING clause 80 characters. . . . . Maximum line t

Pagina 80

Appendix DA-B BASIC LimitsD–2When compiling programs with the LXBC command, the statistics in theLST listing file show the percent of total compiler c

Pagina 81 - A-B BASIC Limits

IndexI–2AA–B VBASIC and Visual BASICTips, A–1PRINT “text”, A–2A–B VBASIC Application Library,5–1BASIC Language DevelopmentKit, 5–1Using the ENVPC Simu

Pagina 82

IndexI–3MMID$, B–10OOPEN, B–10PPRINT, B–10SSHARED, B–16SOUND, B–10Special Devices in A–B VBASIC,4–1#9 User Status Display, 4–15Barcode Scanners, 4–4Re

Pagina 83

With offices in major cities worldwide.WORLD HEADQUARTERSAllen-Bradley1201 South Second StreetMilwaukee, WI 53204 USATel:(414) 382–2000Telex:43 11 016

Pagina 84 - ALLEN-BRADLEY

A–B1Chapter1–1Introduction to BASICThe BASIC Language Development Kit (Catalog No. 2708-NBD) softwareconsists of BASIC source files which you may use

Comentarios a estos manuales

Sin comentarios