Remote-processing BASIC 52 Bedienungsanleitung Seite 1

Stöbern Sie online oder laden Sie Bedienungsanleitung nach Computers Remote-processing BASIC 52 herunter. Remote Processing BASIC 52 User Manual Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 163
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 0
RPBASIC-52 PROGRAMMING GUIDE
i
COPYRIGHT
Copyright 1996 - R emote Proc essing Corporation.
All rights reserved.
The software described in this manual is furnished
under license.
The contents of this manual and the specifications
herein may change without notice.
Remote Processing Corportation
7975 E. Harvard Avenue
Denver, Co 80231
Phone: 303 690 1588
Fax: 303 690 1875
Internet: www.remotep.com
Document order # 1084
Revision 1.4
PRODUCT SUPPORT
If you have a question about RPBASIC-52 and
cannot find the answer in this manual, call us at the
number listed below during normal business hours.
When you call, please have the following at hand:
Your RPBASIC-52 programming guide
Your card hardware manual
A description of the problem
Seitenansicht 0
1 2 3 4 5 6 ... 162 163

Inhaltsverzeichnis

Seite 1 - RPBASIC-52 PROGRAMMING GUIDE

RPBASIC-52 PROGRAMMING GUIDEiCOPYRIGHTCopyright 1996 - R emote Proc essing Corporation. All rights reserved.The software described in this manual is

Seite 2

RPBASIC-52 PROGRAMMING GUIDE1-7HARDWARE AND SOFTWAREINTERRUPTSRPBASIC52 generates two kinds of interrupts: hardware and software. Hardware types are

Seite 3

RPBASIC-52 PROGRAMMING GUIDE2-81PEEK$Syntax: $(n) = PEEK$(segment,address)Where: segment = 0 to 7, specifies a 64K segmentaddress = 0 to 65535, starti

Seite 4

RPBASIC-52 PROGRAMMING GUIDE2-82PISyntax: PIFunction: Stored constant 3.1415926Mode: Command, runUse: PRINT PICards: AllDESCRIPTIONPI is closer to 3.1

Seite 5

RPBASIC-52 PROGRAMMING GUIDE2-83POKEBSyntax: POKEB segmen t,address,d ataWhere: segment = 0 to 7, specifies a 64K segmentaddress = 0 to 65535, specif

Seite 6

RPBASIC-52 PROGRAMMING GUIDE2-84POKEFSyntax: POKEF segmen t,address,d ataWhere: segment = 0 to 7, specifies the 64K segmentaddress = 0 to 65535, loca

Seite 7

RPBASIC-52 PROGRAMMING GUIDE2-85POKEWSyntax: POKEW segmen t,address,d ataWhere: segment = 0 to 7, specifies the 64K segmentaddress = 0 to 65535, loca

Seite 8

RPBASIC-52 PROGRAMMING GUIDE2-86POKE$Syntax: POKE$ segment,address,stringWhere: segment = 0 to 7, specifies the 64K segmentaddress = 0 to 65535, loc

Seite 9

RPBASIC-52 PROGRAMMING GUIDE2-87POPSyntax: POP variable [ ,variable,...]Function: Takes a valu e PU SHed to a sta ck and assigns it to the variable.

Seite 10

RPBASIC-52 PROGRAMMING GUIDE2-88PH0.PH1.Syntax: PH0. exprPH1. exprWhere: expr = any mathematical expressionFunction: Print in hexadecimal format fol

Seite 11

RPBASIC-52 PROGRAMMING GUIDE2-89PRINTPRINT #,P.?Syntax: PRINT expr P. expr? exprPRINT#port,exprP.#port,expr?#port,exprWhere: expr = any string, math

Seite 12

RPBASIC-52 PROGRAMMING GUIDE2-90PUSHSyntax: PUSH expr1 [,expr2,...]Where: expr is a numeric valueFunction: Puts the value of expr to the argument sta

Seite 13

RPBASIC-52 PROGRAMMING GUIDE1-8MULTITASKING CONSTRUCTSCOUNT M ultitaskingRPBASIC-52 on the RPC-3XX series of cards cancount pulses while a program is

Seite 14

RPBASIC-52 PROGRAMMING GUIDE2-91PWMSyntax: PWM line, ltime,htime[,cycles]Where: line = 0 to 8 or 100 to 123. This is card dependent. Refer to yo ur

Seite 15

RPBASIC-52 PROGRAMMING GUIDE2-92READSyntax: READ variable [,variable , ...]Function: Sequentially assigns the values of data provided in the DATA sta

Seite 16

RPBASIC-52 PROGRAMMING GUIDE2-93REMSyntax: REM any ASCII textFunction: Allows remarks in a program or on command lineMode: Command, runUse: 100 REM Yo

Seite 17 - COMMAND GROUPS

RPBASIC-52 PROGRAMMING GUIDE2-94RESTORESyntax: RESTOREFunction: Resets the READ instruction pointer to the beginning of the D ATA list.Mode: RunUse:

Seite 18

RPBASIC-52 PROGRAMMING GUIDE2-95RETISyntax: RETIFunction: Return from ONITR or ONTICK interrupt. RETI must be the last instruction of the interruptsu

Seite 19

RPBASIC-52 PROGRAMMING GUIDE2-96RETURNSyntax: RETURNFunction: Returns program to next instruction following a GOSUB command or software interrupt (ON

Seite 20

RPBASIC-52 PROGRAMMING GUIDE2-97RNDSyntax: RNDFunction: Returns a pseudo-random fractional number between zero and one inclusive.Mode: Command, runUse

Seite 21

RPBASIC-52 PROGRAMMING GUIDE2-98SAVESyntax: SAVE [segme nt]Where: segment = 0 up to 7Function: Save program to flash EPROM.Mode: Comm andUse: SAVE 1Ca

Seite 22

RPBASIC-52 PROGRAMMING GUIDE2-99SGNSyntax: SGN(expr)Function: Returns +1 if expr is greater than zero, zero if the expr equals zero, and -1 if expr is

Seite 23

RPBASIC-52 PROGRAMMING GUIDE2-100SINSyntax: SIN(expr)Function: Returns the trigonometric S INE of expr which is assum ed to be in radians. The value

Seite 24

RPBASIC-52 PROGRAMMING GUIDE1-9There are many communication protocols. For thisexample, the protocol looks something like this:>03MB1The protocol

Seite 25

RPBASIC-52 PROGRAMMING GUIDE2-101SPCSyntax: PRINT SPC(expr)Where: expr = number of spaces to printFunction: Sends expr number of space charac ters (20

Seite 26

RPBASIC-52 PROGRAMMING GUIDE2-102STOPSyntax: STOPFunction: Breaks program execution; resume with the CONT command.Mode: RunUse: STOPCards: AllDESCRIPT

Seite 27

RPBASIC-52 PROGRAMMING GUIDE2-103STRSyntax: A = STR(function,$(n)[,$(n)]))Where: function = 0 to 14, specifies string function to perform as described

Seite 28

RPBASIC-52 PROGRAMMING GUIDE2-104Syntax: A = STR(3,$(n))Description:Returns num bers in a string as a real number. Sim ilar to V AL i n othe r Basi

Seite 29

RPBASIC-52 PROGRAMMING GUIDE2-105Syntax: A = STR(7,$(put),$(get),position,length )Description:Extracts a portion of a string from $(get) and transfers

Seite 30

RPBASIC-52 PROGRAMMING GUIDE2-106Syntax: A = STR(10,$(n),format,va riable)Description:Converts and formats variable into a string and puts it into $(n

Seite 31

RPBASIC-52 PROGRAMMING GUIDE2-107STRINGSyntax: STRING total bytes,string lengthWhere: total bytes = total num ber of bytes in m emory to allocatestrin

Seite 32

RPBASIC-52 PROGRAMMING GUIDE2-108SQRSyntax: SQR(expr)Where: expr is any valid mathematical expression, number, or variable greater than 0 Function: Re

Seite 33

RPBASIC-52 PROGRAMMING GUIDE2-109ST@Syntax: ST@ exprWhere: expr = 0 to 65535Function: Takes a floating-point number from the argument stack and stores

Seite 34

RPBASIC-52 PROGRAMMING GUIDE2-110TABSyntax: PRINT TAB(position)Where: position = 1 to 255 Function: Specifies a column number at to begin printing.Mod

Seite 35

RPBASIC-52 PROGRAMMING GUIDE1-10processed unless the host "knows" this node has justreset. Any valid command, unless it is "E", r

Seite 36

RPBASIC-52 PROGRAMMING GUIDE2-111TANSyntax: TAN(expr)Function: Returns the trigonometric tan gent (sin/cos) of expr which is assu med to be in radian

Seite 37

RPBASIC-52 PROGRAMMING GUIDE2-112TICKSyntax: TICK(timer)Where: timer = 0 to 3. It specifies the tim er numbe r.Function: Returns a time from one of 4

Seite 38

RPBASIC-52 PROGRAMMING GUIDE2-113TIME (function)Syntax: A = TIME(n)Where: n = 0 to 40 = hours1 = minutes2 = seconds3 = hundredths of a second4 = secon

Seite 39

RPBASIC-52 PROGRAMMING GUIDE2-114TIME (command)Syntax: TIME hours,minutes,secondsWhere: hours = 0 to 23minutes = 0 to 59seconds = 0 to 59Function: Set

Seite 40

RPBASIC-52 PROGRAMMING GUIDE2-115UI0UI1Syntax: UInWhere: n = 0 or 1, is the serial port numberFunction: Directs serial input to COM 0 or COM 1 when u

Seite 41

RPBASIC-52 PROGRAMMING GUIDE2-116UO0UO1Syntax: UOnWhere: n = 0 or 1, is the serial port numberFunction: Directs PRINT output to COM 0 or COM 1 seria

Seite 42

RPBASIC-52 PROGRAMMING GUIDE2-117USINGU.Syntax: PRINT USING (format)PRIN T U.(format)Where: formatUSING(Fn) n is the number of significant digits. A

Seite 43

RPBASIC-52 PROGRAMMING GUIDE2-118WDOGSyntax: WDOG [time]Where: time = 0, 1, or 2no parameter = toggle watchdog timer0 = turn off watch dog timer1 = s

Seite 44

RPBASIC-52 PROGRAMMING GUIDE2-119XBYSyntax: XBY(addr)XBY( addr)=exprWhere: addr = 0 to 65535 (0FFFFH) is a memory addressexpr = 0 to 255 is data to sa

Seite 45

RPBASIC-52 PROGRAMMING GUIDE2-120CONFIG COMMANDSCONFIG comman ds configure various I/O to u ser defined p aram eters. All CONFIG com mands are uniqu

Seite 46

RPBASIC-52 PROGRAMMING GUIDE1-11 0 Wait for "RING" message. Modemauto answers. 1 Look for "CONNE CT". 2 Get password. If inva

Seite 47

RPBASIC-52 PROGRAMMING GUIDE2-121CONFIG BAUDSyntax: CONFIG BAUD 0,baudCONFIG BAUD 1,baud,rs-485Where: baud = Baud rate number. See tables below.rs-48

Seite 48

RPBASIC-52 PROGRAMMING GUIDE2-122CONFIG DISPLAYSyntax: CONFIG DISPLAY typeWhere: type = 0 to 3, defines the display type0 = LCD 4 x 40 character1 = LC

Seite 49

RPBASIC-52 PROGRAMMING GUIDE2-123CONFIG FREQSyntax: CONFIG FREQ channel,intervalWhere: channel = counter num ber, 0 or 1interval = number of 5 milli-s

Seite 50

RPBASIC-52 PROGRAMMING GUIDE2-124CONFIG LINESyntax: CONFIG LINE 0,configu ration 0,p ort CCONFIG LINE 100,configu ration 1,p ort A,port B,port CWhere:

Seite 51

RPBASIC-52 PROGRAMMING GUIDE2-125configuration 1 Port A Port B Upper C Lower C0 Output Output Output Output1 Output Output Output Input2 Output Input

Seite 52

RPBASIC-52 PROGRAMMING GUIDEA-1APPENDIX A - Network example programFile: NET3XX.BASrem RPC-3xx networkingrem Uses COM1 as network portrem To use com p

Seite 53

RPBASIC-52 PROGRAMMING GUIDEA-2rem 130 CONFIG BAUD 1,1,2rem set the display type for command D140 config display 1rem Read lines 0-3 to determine card

Seite 54

RPBASIC-52 PROGRAMMING GUIDEA-3rem if last two digits don't sum to message, then return a negativerem acknowledge error and bail out1170 if oc &l

Seite 55

RPBASIC-52 PROGRAMMING GUIDEA-41700 $(2) = "A"1710 GOTO 1510 rem Bad data1750 $(2) = "N4"1760 goto 1510REM set a line according

Seite 56

RPBASIC-52 PROGRAMMING GUIDEA-53030 oc = str(10,$(2),0,oc)rem Force letter A to first spot. This is a space as set by format above3040 asc($(2),1) =

Seite 57

RPBASIC-52 PROGRAMMING GUIDE1-12watchdog timer may be nec essary to restart the ca rd. Make sure call waiting is disabled.ON LINE MultitaskingON LINE

Seite 58

RPBASIC-52 PROGRAMMING GUIDEB-1APPENDIX B - Modem example programFile: MODEM.BASrem Modem communication programrem Based around BASIC-52 software for

Seite 59

RPBASIC-52 PROGRAMMING GUIDEB-2rem password. Enter 'password'. Use lower case. The password isrem set at line 2300.rem You are then promp

Seite 60

RPBASIC-52 PROGRAMMING GUIDEB-320 string 1000,50:rem 20 strings, 50 bytes30 dim flag(15) :rem flags for main task dispatcher40 okflg = 0 :rem OK recei

Seite 61

RPBASIC-52 PROGRAMMING GUIDEB-4rem 2 = looking for password. If ok send log on. If not, tell user 1500rem 3 = looking for command. If ok, set MCYCL

Seite 62

RPBASIC-52 PROGRAMMING GUIDEB-51685 print : print "Sent +++"1690 returnrem look for OKrem If have it, send hang uprem If not, set flag (nokf

Seite 63

RPBASIC-52 PROGRAMMING GUIDEB-6rem ON COM$ processingrem get current input2000 $(0) = com$(1)2010 atim = 0 : rem if anything came in, reset actual com

Seite 64

RPBASIC-52 PROGRAMMING GUIDEB-72240 cycle =4rem DEBUG2255 print "No CONNECT received. Input string=",$(0)2260 returnrem hold off any xmiss

Seite 65

RPBASIC-52 PROGRAMMING GUIDEB-8rem cycle 4rem Look for OKrem If have OK, then reset cycle to 0rem If message is not OK, simply leave2500 $(1) = "

Seite 66

RPBASIC-52 PROGRAMMING GUIDEC-1APPENDIX C- ERROR MESSAGESThe RPB ASIC-52 error processor helps identify errors.When running a program , error messages

Seite 67

RPBASIC-52 PROGRAMMING GUIDEC-2This exam ple produces an expected error:?le-100/le28ERROR: ARITH. UNDERFLOWREADYThis exam ple produces an incorrect ex

Seite 68

RPBASIC-52 PROGRAMMING GUIDE1-13OPERATORSOperator categories include:Arithmetic =, +, *, /, **, SQRRelational =, <>, <, >, <=, >=Log

Seite 69

RPBASIC-52 PROGRAMMING GUIDEC-3I-STACKThere is not enough internal stack space to evaluate an expression. Usually this is caused by an excessive numb

Seite 70

RPBASIC-52 PROGRAMMING GUIDED-1APPENDIX D - Data storageSTRING STORAGEBASIC-52 stores string variables between MTOP and top of variable space, call VA

Seite 71

RPBASIC-52 PROGRAMMING GUIDEE-1APPENDIX E - Software revision history;V1.02 added; 24 key keypad scanning; Took out BELL when backspacing beyond begin

Seite 72

RPBASIC-52 PROGRAMMING GUIDEE-2V1.13 01/12/96Added code to support IEE centry series display (3602-100-05420)Includes CONFIG DISPLAY 4Added PRINT #por

Seite 73

RPBASIC-52 PROGRAMMING GUIDE1-14Some com mands have been added to or otherwiseenhanced:IDLEINPUTPWMThe followin g com mands are n ew to BASIC-52. Not

Seite 74

RPBASIC-52 PROGRAMMING GUIDE1-15Data storage and retrievalBLOADBSAVECBYDBYDATADIMPOKEPEEKREADRESTOREXBYOperators/-+***<<=<>=>>=ABSAN

Seite 75

RPBASIC-52 PROGRAMMING GUIDE1-16String operationASCCHRSTRSTRINGStrings in RPBASIC-52 are one-dimensional arraysof characters. Strings are stored as a

Seite 76

RPBASIC-52 PROGRAMMING GUIDEiiTABLE OF CONTENTSPREFACE ... 1MANUAL CONVENTIONS ... 1Symbols and Terminology ...

Seite 77

RPBASIC-52 PROGRAMMING GUIDE2-1ABSSyntax: ABS(expr)Where: expr = any number in Basic's rangeFunction: Returns the absolute value of an expression

Seite 78

RPBASIC-52 PROGRAMMING GUIDE2-2AINSyntax: AIN(channel)Where: channel = 0 to 7, is channel to convert.Function: Converts analog input to digital number

Seite 79

RPBASIC-52 PROGRAMMING GUIDE2-3ASCSyntax: ASC(ASCII character)ASC(string,position expr)Where: ASCII character = number from 0 to 255string = any valid

Seite 80

RPBASIC-52 PROGRAMMING GUIDE2-4ATNSyntax: ATN(expr)Where: expr = value betw een 0 and PI/2Function: Returns a trigonometric arc-tangent of expr. Retu

Seite 81

RPBASIC-52 PROGRAMMING GUIDE2-5BLOADSyntax: BLOAD to RAM segmen t, RAM address, fro m EP ROM segmen t, EPRO M add ress, lengthWhere: to RAM segment

Seite 82

RPBASIC-52 PROGRAMMING GUIDE2-6BSAVESyntax: BSAVE to ROM segmen t,ROM address,fro m RA M segm ent, RAM address, len gthWhere: ROM segment = 0 to 7,

Seite 83

RPBASIC-52 PROGRAMMING GUIDE2-7many sectors, the last written sector is filled in with more data from R AM. Note that BL OAD allows dataretrieval of

Seite 84

RPBASIC-52 PROGRAMMING GUIDE2-8CALLSyntax: CALL addressWhere: address = address of assembly language program from 0 to 65535Function: Calls an assembl

Seite 85

RPBASIC-52 PROGRAMMING GUIDE2-9CARD$Syntax: CARD$(expr)Where: expr = 0 to 3, is the card reader to scan.Function: Checks card reader for data. If pr

Seite 86

RPBASIC-52 PROGRAMMING GUIDE2-10NOTE: This command takes approximately 27 ms to process. This is because the reader sends a bit ofinformation every 1

Seite 87

RPBASIC-52 PROGRAMMING GUIDEiiiON LINE ... 73ONTICK ... 75PEEKB ... 76PEE

Seite 88

RPBASIC-52 PROGRAMMING GUIDE2-11CBYSyntax: CBY(expr)Where: expr = address from 0 to 65535Function: Reads internal program codeMode: Command, runUse: P

Seite 89

RPBASIC-52 PROGRAMMING GUIDE2-12CHRSyntax: CHR(expr)CHR( string, positi on)Where: expr = number from 0 to 255string = string variableposition = 1 to l

Seite 90

RPBASIC-52 PROGRAMMING GUIDE2-13CLEARCLEAR SSyntax: CLEARCLEAR SFunction: Sets variables to zero, clears stacksMode: Command, runUse: CLEARCLEAR SCard

Seite 91

RPBASIC-52 PROGRAMMING GUIDE2-14The above e xample sho ws that ONTICK con tinues to run after a C LEA R stateme nt but variable s are cleared. If a pr

Seite 92

RPBASIC-52 PROGRAMMING GUIDE2-15CLEAR COMSyntax: CLEAR COM(port)Where: port = 0 or 1, the serial com mun ication port. port may be la rger. Check y

Seite 93

RPBASIC-52 PROGRAMMING GUIDE2-16CLEAR DISPLAYSyntax: CLEAR DISPLAY Clears character and, if available, graphics displays.CLEAR DISPLAY LINE Clears cha

Seite 94

RPBASIC-52 PROGRAMMING GUIDE2-17CLEAR TICKCLEAR KEYPADSyntax: CLEAR TICK(timer)Where: timer = 0 to 3CLEAR KEYPADFunction: Resets specified tick timer

Seite 95

RPBASIC-52 PROGRAMMING GUIDE2-18COMSyntax: COM(port)Where: port = 0 or 1, the serial com munication port. port may be larger. Check your hardwareman

Seite 96

RPBASIC-52 PROGRAMMING GUIDE2-19COM$Syntax: $(n) = COM$(port)Where: port = 0 or 1, the serial com munication port. port may be larger. Check your ha

Seite 97

RPBASIC-52 PROGRAMMING GUIDE2-20CONTSyntax: CONTFunction: Continue program ex ecution after a ST OP or Comm and-CMode: CommandUse: CONTCards: AllDESCR

Seite 98

RPBASIC-52 PROGRAMMING GUIDE1-1PREFACEThis programming guide is for Remote Processingcontrollers using RPBASIC-52 language. It wasderived from Intel

Seite 99

RPBASIC-52 PROGRAMMING GUIDE2-21COSSyntax: COS(expr)Where: expr = numeric value up to ±200,000Function: Returns the trigonometric co sine of expr whic

Seite 100

RPBASIC-52 PROGRAMMING GUIDE2-22CRSyntax: PRINT CR,Function: Used with P RIN T. Sends a carriage return w ithout a line feed. Mode: Command, runUse

Seite 101

RPBASIC-52 PROGRAMMING GUIDE2-23COUNT (statement)Syntax: COUNT counter ,dataWhere: counter = 0 or 1data = 0 to 16777215Function: Writes data to spec

Seite 102

RPBASIC-52 PROGRAMMING GUIDE2-24COUNT (function)Syntax: A = COUNT(counter)Where: counter = 0 - 1, or 4 - 11Function: Reads a multimode hardware or sof

Seite 103

RPBASIC-52 PROGRAMMING GUIDE2-25DATASyntax: DATA expr [,expr,...]Where: expr = numeric data.Function: It is an expression list used by READ.Mode: Run

Seite 104

RPBASIC-52 PROGRAMMING GUIDE2-26DATE (function)Syntax: A = DATE(n)Where: n = 0 to 30 = year (last two digits)1 = month2 = day3 = day of weekFunction:

Seite 105

RPBASIC-52 PROGRAMMING GUIDE2-27DATE (statement)Syntax: DATE year,month,day[,day of week]Where: year = 0 to 99month = 1 to 12day = 1 to 31day of week

Seite 106

RPBASIC-52 PROGRAMMING GUIDE2-28DBYSyntax: A=DBY(expr) DBY(expr)=variableWhere: expr = 0 to 255variable = 0 to 255Function: Read/write internal data

Seite 107

RPBASIC-52 PROGRAMMING GUIDE2-29DIMSyntax: DIM name(size)[,name(size)...]Where: name = Any valid variable namesize = 1 to 255 elem entsFunction: Reser

Seite 108

RPBASIC-52 PROGRAMMING GUIDE2-30DISPLAYSyntax: DISPLAY option[,option][,option]Where: option is one or more of the following"string" Print

Seite 109

RPBASIC-52 PROGRAMMING GUIDE1-2Basic InterpretersThere are several ty pes and levels of inte rpreters. Aslow, very basic type of interpreter figures

Seite 110

RPBASIC-52 PROGRAMMING GUIDE2-31(row,col,[,cursor]) positions the cursor and, optionally, turns it ON or OFF. This option affects the charactercursor

Seite 111

RPBASIC-52 PROGRAMMING GUIDE2-32DISPLAY OFF Turns off both character and graphics displays.DISPLAY OFF G Turns off graphic display only.DISPLAY OFF C

Seite 112

RPBASIC-52 PROGRAMMING GUIDE2-33DO-UNTILSyntax: DO {program statements} UNTIL relational exprWhere: relational expr is any logical evaluation such as

Seite 113

RPBASIC-52 PROGRAMMING GUIDE2-34DO-WHILESyntax: DO{program statements}WHILE {relational expr}Function: Executes {program statements} w hile {relationa

Seite 114

RPBASIC-52 PROGRAMMING GUIDE2-35ENDSyntax: ENDFunction: Terminates program execution and returns to command mode.Mode: RunUse: 65000 ENDCards: AllDESC

Seite 115

RPBASIC-52 PROGRAMMING GUIDE2-36EXECUTESyntax: EXECUTE [segme nt]Where: segment = program to execute Function: Loads and runs program specified by

Seite 116

RPBASIC-52 PROGRAMMING GUIDE2-37EXPSyntax: EXP(expr)Function: Raises "e" (2.71828) to the power of exprMode: Command, runUse: PRINT EXP(C OS

Seite 117

RPBASIC-52 PROGRAMMING GUIDE2-38FOR-TO-STEP-NEXTSyntax: FOR variable = initial index expr TO index limit expr [STEP step expr ]progra m statem entsNEX

Seite 118

RPBASIC-52 PROGRAMMING GUIDE2-39EXAMPLEThe following example gets characters from the receive buffer and generates a checksum. A string of 10characte

Seite 119

RPBASIC-52 PROGRAMMING GUIDE2-40FREESyntax: FREEFunction: Returns the bytes of available in program RAMMode: Command, runUse: PRINT FREECards: AllDESC

Seite 120

RPBASIC-52 PROGRAMMING GUIDE1-3else (laptop or main frame) is sending it c harac ters. The upload and download file does not contain anyspecial codes;

Seite 121

RPBASIC-52 PROGRAMMING GUIDE2-41FREQ (Function)Syntax: FREQ(channel)Where: channel = 0 or 1, depending upon card.Function: Returns a counter valueMod

Seite 122

RPBASIC-52 PROGRAMMING GUIDE2-42BAD DATA When channel is out of range for a card.EXAMPLEThe following example sets up frequency multitaskin g and prin

Seite 123

RPBASIC-52 PROGRAMMING GUIDE2-43GETSyntax: A = GETFunction: Gets character from buffer.Mode: RunUse: A = GETCards: AllDESCRIPTIONGET is similar to INK

Seite 124

RPBASIC-52 PROGRAMMING GUIDE2-44GOSUBSyntax: GOSUB line number...line number program statementsRETURNFunction: Transfers program control to the specif

Seite 125

RPBASIC-52 PROGRAMMING GUIDE2-45GOTOSyntax: GOTO line numberFunction: Routes program execution to line numberMode: Command, runUse: GOTO 100Cards: Al

Seite 126

RPBASIC-52 PROGRAMMING GUIDE2-46IDLESyntax: IDLE [option]Where: option specifies a card dependent mode.Function: Suspends program execution and w aits

Seite 127

RPBASIC-52 PROGRAMMING GUIDE2-47IF THEN ELSESyntax: IF expr [ THEN ] statement(s) [ ELSE statement(s)]Where: expr = any logical evaluation or variabl

Seite 128

RPBASIC-52 PROGRAMMING GUIDE2-48INPUTSyntax: INPUT ["prompt text"] [,] [,variable ...]Where: prompt text = optional textvariable = list of

Seite 129

RPBASIC-52 PROGRAMMING GUIDE2-49INTSyntax: INT(expr)Function: Returns an integer portion of exprMode: Command, runUse: PRINT INT(PI)Cards: AllDESCRIPT

Seite 130

RPBASIC-52 PROGRAMMING GUIDE2-50KEYPADSyntax: A = KEYPAD(function)Where: function = 0 or 10 = return keypad position pressed from buffer1 = returns nu

Seite 131

RPBASIC-52 PROGRAMMING GUIDE1-4Variables and Con stantsMore than 25,000 unique variable or constant namesmay be defined. Names may be up to eightchar

Seite 132

RPBASIC-52 PROGRAMMING GUIDE2-51LD@Syntax: LD@ exprWhere: expr = valid integer address of 00H through 0FFFFH (65535)Function: Retrieves a floating-poi

Seite 133

RPBASIC-52 PROGRAMMING GUIDE2-52LENSyntax: LENFunction: Returns length of the current program in RAMMode: Comm andUse: PRINT LENCards: AllDESCRIPTIONT

Seite 134

RPBASIC-52 PROGRAMMING GUIDE2-53LINE (Function)Syntax: A = LINE(line)Where: line = 0-9 o r 100 to 123 (L ine ranges m ay vary. Check you r hardw are

Seite 135

RPBASIC-52 PROGRAMMING GUIDE2-54LINE# (Function)Syntax: A = LINE#(line)Where: line = connecto r number from 101 to 125 (Line ranges m ay vary. Check

Seite 136

RPBASIC-52 PROGRAMMING GUIDE2-55LINEB (Function)Syntax: A = LINEB(i/o bank,add ress)Where: i/o bank = 0 to 7. Specific functions are card de pendent.

Seite 137

RPBASIC-52 PROGRAMMING GUIDE2-56LINE (Statement)Syntax: LINE line,dataWhere: line = 0 to 8 or 100 to 123 (L ine ran ges may vary. Che ck your hardw

Seite 138

RPBASIC-52 PROGRAMMING GUIDE2-57LINE# (Statement)Syntax: LINE# line,dataWhere: line = 101 to 125, is the digital I/O line connector number. (Line ran

Seite 139

RPBASIC-52 PROGRAMMING GUIDE2-58LINEB (Statement)Syntax: LINEB i/o bank,a ddress,da taWhere: i/o bank = 0 to 7. Specific functions are card de penden

Seite 140

RPBASIC-52 PROGRAMMING GUIDE2-59LISTSyntax: LISTLIST line numberLIST line number - line numberWhere: line number is a program line numberFunction: Pri

Seite 141

RPBASIC-52 PROGRAMMING GUIDE2-60LIST#Syntax: LIST# portLIST# port,line numberLIST# port,line number-line numberWhere: port = 0 or 1 or number of ser

Seite 142

RPBASIC-52 PROGRAMMING GUIDE1-5RPBASIC-52 Memory Mapsubroutines is limited to the amount of internal stackspace. Usually this is about 35 subroutines

Seite 143

RPBASIC-52 PROGRAMMING GUIDE2-61LOADSyntax: LOAD [segme nt]Where: segment = 0 to 7, see table below.Function: Loads a program from EPROMMode: Comm an

Seite 144

RPBASIC-52 PROGRAMMING GUIDE2-62LOGSyntax: LOG (expr)Function: Returns the natural logarithm (base "e") of expr which must evaluate to grea

Seite 145

RPBASIC-52 PROGRAMMING GUIDE2-63MTOPSyntax: MTOPMTOP = last valid RAM addressFunction: Reads or assigns the top of external data memory which will be

Seite 146

RPBASIC-52 PROGRAMMING GUIDE2-64NEWSyntax: NEWFunction Erases current program in RAM. All variables and strings are cleared.Mode: CommandUse: NEWCard

Seite 147

RPBASIC-52 PROGRAMMING GUIDE2-65NULLSyntax: NULL integerWhere: integer = 0 -255Function: Sets number of NULL cha racters output to user after a carr

Seite 148

RPBASIC-52 PROGRAMMING GUIDE2-66ON COM$Syntax: ON COM$port,length,terminator,program lineON COM$portWhere: port = the com port number 0 or 1length = n

Seite 149

RPBASIC-52 PROGRAMMING GUIDE2-67ON COUNTSyntax: ON COUNT number, line number, count, program lineON COUNT number, line numberON COUNT numberWhere: num

Seite 150

RPBASIC-52 PROGRAMMING GUIDE2-6810 ON COUNT 10,320 ONTICK 1,100030 GOTO 30...1000 PRINT COUNT(10)1010 RETURN

Seite 151

RPBASIC-52 PROGRAMMING GUIDE2-69ONERRSyntax: ONERR line numberFunction: Goes to line number on arithmetic error, b ad argument, and hardw are errors.

Seite 152

RPBASIC-52 PROGRAMMING GUIDE2-70ON GOSUBSyntax: ON expr GOSUB line0[,line1[,line2...]]Where: expr = 0 to number of subroutines after GOSUBlinen = subr

Seite 153

RPBASIC-52 PROGRAMMING GUIDE1-6OPERATING MODESCommand and Run M odesRPBASIC-52 operates in two modes, Command andRun. Command mode is the direct, int

Seite 154

RPBASIC-52 PROGRAMMING GUIDE2-71ON GOTOSyntax: ON expr GOTO line0[,line1[line2...]]Function: Branches to a program line based on expr value.valuate to

Seite 155

RPBASIC-52 PROGRAMMING GUIDE2-72ONITRSyntax: ONITR number,line numberONITR numberONITR line numberONITRWhere: number = interrupt line. This is card d

Seite 156

RPBASIC-52 PROGRAMMING GUIDE2-73EXAMPLEThe following example responds to an external interrupt on the RPC-330.10 ONITR 1,1000 Declare interrupt.. O

Seite 157

RPBASIC-52 PROGRAMMING GUIDE2-74ON KEYPADSyntax: ON KEYPAD subroutine lineON KEYPADWhere: subroutine line = program to executeFunction: Branches to a

Seite 158 - APPENDIX C- ERROR MESSAGES

RPBASIC-52 PROGRAMMING GUIDE2-75ON LINESyntax: ON LINE number,I/O line,subroutine lineON LINE numberON LINE ON/OFF [,CLEAR]Where: number = 0 to 7, is

Seite 159

RPBASIC-52 PROGRAMMING GUIDE2-76The overall speed of RPBASIC-52 slows down by about 3% when all ON LINE tasks are enabled.Review HARDWAR E AND SOFTWAR

Seite 160

RPBASIC-52 PROGRAMMING GUIDE2-77ONTICKSyntax: ONTICK time,line numberWhere: time = time interval from 0.01 to 327line number = line to branchFunction:

Seite 161 - APPENDIX D - Data storage

RPBASIC-52 PROGRAMMING GUIDE2-78PEEKBSyntax: PEEKB(segment,ad dress)Where: segment = 0 to 7, specifies a 64K segmentaddress = 0 to 65535, byte addres

Seite 162

RPBASIC-52 PROGRAMMING GUIDE2-79PEEKFSyntax: PEEKF(segment,ad dress)Where: segment = 0 to 7, specifies a 64K segmentaddress = 0 to 65535, byte addres

Seite 163

RPBASIC-52 PROGRAMMING GUIDE2-80PEEKWSyntax: PEEKW(segment,address)Where: segment = 0 to 7, specifies a 64K segment.address = 0 to 65535, w ord addres

Kommentare zu diesen Handbüchern

Keine Kommentare