Remote-processing CAMBASIC Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Komputery Remote-processing CAMBASIC. Remote Processing CAMBASIC User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 208
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 0
COPYRIGHT
Copyright 1988-1994 – Octagon Systems and Remote Processing Corp. All rights reserved.
Modifications by Remote Processing Cor poration, Copyright 1995 - 2003
The software described in this manual is furnished under a license agreement and may be used only in accordance with the
terms of the agreement.
The contents of this manual and the specifications herein may change without notice.
TRADEMARKS
CAM BASIC™, M icro PC , PC Sma rtLINK™ and Event M ultitasking™ are tradem arks of Octago n Systems.
IBM PC® is a registered trademark of IBM Corporation.
QBASIC® is a registered trademark of M icrosoft Corporation.
Remote Processing Corp.
7975 E. Harvard Ave.
Denver, CO 80231
Phone:303– 690– 1588
FAX: 303-690-1875
www. rp3.com
Order #1042
Rev 1.6
Przeglądanie stron 0
1 2 3 4 5 6 ... 207 208

Podsumowanie treści

Strona 1 - TRADEMARKS

COPYRIGHTCopyright 1988-1994 – Octagon Systems and Remote Processing Corp. All rights reserved.Modifications by Remote Processing Co

Strona 2 - HOW TO USE THIS MANUAL

Concepts - 4Below is a list of CAMBASIC commands. Some CPU Cards do not use all of the commands. Refer to your hardwaremanual for ex

Strona 3 - PRODUCT SUPPORT

Commands - 67KEYPAD$Process FunctionSYNTAX: a$= KEYPAD$(0)a= KEYPAD$(1)PURPOSE: To return a one– character string in response to a key

Strona 4 - ABOUT CAMBASIC

Commands - 68LEFT$String FunctionSYNTAX: n$ = LEFT$(m$,p)PURPOSE: To return the leftm ost p characters of m$.REMARK S: If p is great

Strona 5

Commands - 69LENNumeric Fun ctionSYNTAX: n = LEN(m$)PURPOSE: To return the number of characters in m$.REMARK S: Unprintable and blan

Strona 6

Commands - 70LINEProcess FunctionSYNTAX: a = LINE(terminal #)PURPOSE: To return the status of an input on a STB-26 terminal board.REM

Strona 7 - Line Renumbering

Commands - 71LINEProcess StatementSYNTAX: LINE terminal #, valuePURPOSE: To write directly to the STB-26 terminal board.REMARK S: The

Strona 8 - Real time Multitasking

Commands - 72LISTCommandSYNTAX: LIST [line [– [line]]]LIST #n, [line [– [line]]]LIST!PURPOSE: To list a part or all of the program cur

Strona 9 - Character Set

Commands - 73ERROR: < Line not found> – if line does not exist

Strona 10

Commands - 74LOADCommandSYNTAX: LOADLOAD programLOAD program RUNLOAD to RAM segment, RAM address, from me mory segm ent, memo r

Strona 11

Commands - 75LOCKUNLOCKTasking StatementsSYNTAX: LOCKUNLOCK [RETURN]UNLOCK E XITPURPOSE: To lock out interrupts from time critical por

Strona 12

Commands - 76LOGNumeric Fun ctionSYNTAX: n = LOG(m)PURPOSE: To return the natural logarithm of m.REMARK S: The natural logarithm is t

Strona 13

Concepts - 5Software and Hardware InterruptsCAMBASIC supports multiple hardware and software interrupts. These interrupts causes the

Strona 14

Commands - 77MID$String FunctionSYNTAX: n$ = MID$(m$,p[,q])PURPOSE: To return the requested part of a given string.REMARK S: The func

Strona 15

Commands - 78MID$String StatementSYNTAX: MID$(a$,s [,n]) = b$PURPOSE: To replace a portion of one string with another.REMARK S: A com

Strona 16

Commands - 79MODOperatorSYNTAX: n = a MOD bPURPOSE: To return the rem ainder of an integer division.REMARK S: a is divided by b and t

Strona 17 - AND Operand 2

Commands - 80MONCommandSYNTAX: MON PURPOSE: To invoke the Mini– MonitorREMARK S: The Mini– Monitor is used primarily for debugging obj

Strona 18 - Expression Evaluation

Commands - 81NEW and UNNEWCommandsSYNTAX: NEWUNNEWPURPOSE: NEW initializes CAMBASIC for a new program.UNNEW restor es a program erase

Strona 19

Commands - 82ONStatementSYNTAX: ON expression GOSUB line [,line] ...ON expression GOTO line [,line] ...PURPOSE: In the ON. .. GOT O s

Strona 20 - CAMBASIC EDITOR

Commands - 83ON BITTasking StatementSYNTAX: ON BIT task numbe r,ad dress, bit GOS UB line/labelPURPOSE: To declare an I/ O line to be

Strona 21 - LINE EDITING COMMANDS

Commands - 84ON COM$Tasking StatementSYNTAX: ON COM$ n GOS UB line/labelON COM$ n GOSUBPURPOSE: To define a program branch when a task

Strona 22

Commands - 85ON COUNTTasking StatementSYNTAX: ON COUNT n GOSUB line/labelON COUNT n GOSUBPURPOSE: To execute a subroutine when a prese

Strona 23

Commands - 86ON ERR GOTOStatementSYNTAX: ON ERR GOTO line/labelPURPOSE: To enable error trapping and specify the first line of the err

Strona 24

Concepts - 6AUTORUN OPERATIONOnce a program has been stored in nonvolatile memory, it can autorun on power – up.PROTECTING YOUR PROGR

Strona 25 - Other Tips

Commands - 87ON INPTasking StatementSYNTAX: ON INP n, address, mask, compare GOSUB line/labelPURPOSE: To cause an interr upt when a pr

Strona 26

Commands - 88ON ITRTasking StatementSYNTAX: ON ITR n GOSUB line/labelON ITR n GOSUBPURPOSE: To enable or disable a progr am br anch d

Strona 27

Commands - 89ON KEYPAD$Tasking StatementSYNTAX: ON KEY PAD $ GO SUB line/labelON KEYPAD$ GOSUBON KEYPAD $ size GOSUB line/lableON KEYP

Strona 28 - Command Summary - 2

Commands - 90ON TICKTasking StatementSYNTAX: ON TICK n,t GOSUB line/labelON TICK n,t GOSUBPURPOSE: To cause periodic program branchin

Strona 29

Commands - 91OPTOProcess FunctionSYNTAX: a = OPTO (channel)PURPOSE: To return the status of an input on an on board opto isolator rac

Strona 30

Commands - 92OPTOProcess StatementSYNTAX: OPTO channel, valuePURPOSE: To turn output modules on and off on 24 position opto-isolator

Strona 31

Commands - 93OUTI/O StatementSYNTAX: OUT I/O address, dataPURPOSE: Sends a byte to an I/O address.REMARK S: The I/O addre ss is any o

Strona 32 - Command Summary - 6

Commands - 94PEEK and POKEMemory Function and StatementSYNTAX: n = PEEK(address)n = PEEK(address,segment)POKE address, dataPOKE add

Strona 33

Commands - 95PEEK$ and POKE$Memory Function and StatementSYNTAX: x$ = PEEK$(address)x$ = PEEK$(address, segment)POKE $ address, X$PO

Strona 34

Commands - 96PRINTStatementPR [#n,] [expression] [; or , ] [expression]..PRINT [#n,] [expression] [; or , ] [expression]..PURPOSE: To

Strona 35

Concepts - 7For example,GOTOE is not okEGOTO is okString variables are limited to 255 characters. Arrays may be any leng th, may be

Strona 36

Commands - 97In the example below, the semicolon at the end of line 20 causes both PRINT statements to beprinted on the same line.10 I

Strona 37

Commands - 98PRINT USINGStatementSYNTAX: PRINT [#n,]USING"format string"; expr essionPURPOSE: To print strings or number s

Strona 38

Commands - 99Leading zeros to the left of the first digit to the left of the decimal point are suppressed.A=25.5555PRINT #10,USING &qu

Strona 39

Commands - 100PRINT$StatementSYNTAX: PRINT [#n,] $ character [,character]...PR [#n,] $ character [,character]...PURPOSE: Used to send

Strona 40

Commands - 101PULSEProcess FunctionSYNTAX: n= PULSE(m)PURPOSE: To return the r emaining time of a pulsed output.REMARK S: The resolut

Strona 41

Commands - 102PULSETasking StatementSYNTAX: PULSE n,a ddress, bit,tim e,p olarityPURPOSE: To configure a digital output line as a time

Strona 42

Commands - 103READStatementSYNTAX: READ variable [,variable] . . .PURPOSE: To read values fr om a D ATA statement and assign them

Strona 43

Commands - 104REMARKStatementSYNTAX: ' any charactersPURPOSE: To allow explanator y remarks to be inserted in a progr am or desi

Strona 44

Commands - 105RENUMCommandSYNTAX: RENUM [newline] [,increment] [,oldline]PURPOSE: To renum ber prog ram lines.REMARK S: newline is the

Strona 45

Commands - 106RESTOREStatementSYNTAX: RESTORE [line]PURPOSE: To reset the RE AD pointer to the b eginning of the DAT A list.REMARK S:

Strona 46

Concepts - 8Lower– case characters have a higher ASC II value than upper– case characters. If two strings are identical up to the poi

Strona 47

Commands - 107RESUMEStatementSYNTAX: RESUMERESUME NEXTRESUME linePURPOSE: To continue program execution after an error recovery proced

Strona 48

Commands - 108RESUME COUNTTasking StatementSYNTAX: RESUME COUNT m [,m1] [,m2] . . . [,mn]PURPOSE: To reenable a software event counter

Strona 49

Commands - 109RETURNStatementSYNTAX: RETURN [line/label]RETURN ITR numberPURPOSE: To resume execution after a GOSUB, interrupt, multit

Strona 50 - CLEAR COM$

Commands - 110RIGHT$String FunctionSYNTAX: n$ = RIGHT$(m$,p)PURPOSE: To return the r ight– most p characters of m$ as a string.REMARK

Strona 51 - CLEAR COUNT

Commands - 111RNDNumeric Fun ctionSYNTAX: n = RND(m)PURPOSE: To return a pseudo– random number between 0 and 1.REMARK S: The RND func

Strona 52 - CLEAR TICK

Commands - 112RUNCommandSYNTAX: RUN [line]PURPOSE: To begin the execution of a program.REMARK S: RUN resets the numeric variables to z

Strona 53 - CLEAR PULSE

Commands - 113SAVECommandSYNTAX: SAVE SAVE programSAVE to Flash segme nt, to Flash address, from RA M segm ent, from RA M addres

Strona 54

Commands - 114< 21> < Hardw are> - If Flash EPROM or jumper missing or bad F lash

Strona 55

Commands - 115SGNNumeric Fun ctionSYNTAX: n = SGN(m)PURPOSE: Determines if number is positive or negative.REMARK S: m is any number.

Strona 56

Commands - 116SINNumeric Fun ctionSYNTAX: n = SIN(m)PURPOSE: To calculate the trigonometric sine function.REMARK S: m is an angle in

Strona 57

Concepts - 9NOTE: Attempting to enter a line with more than 24 constants will cause the remainder of the line to beterminated. CAM BA

Strona 58

Commands - 117SOUNDCOMMANDSYNTAX: SOUND frequencySOUNDPURPOSE: Gener ates a squar e wave signal at frequency.REMARK S: frequency is f

Strona 59

Commands - 118SPIFUNCTIONSYNTAX: a = SPI(channel,out_length,data, delay,in_length)Where:channel = 0 to 2, the SPI channel number.out

Strona 60

Commands - 119SQRNumeric Fun ctionSYNTAX: n = SQR(m)PURPOSE: Calculates the square root of a number.REMARK S: m is any positive numbe

Strona 61

Commands - 120START BITTasking StatementSYNTAX: START BIT task number [,task number]. . .PURPOSE: To enable a BIT task that has previo

Strona 62

Commands - 121START COUNTTasking StatementSYNTAX: START COUNT n [,n1] [,nm]PURPOSE: To activate a software counter task that was previ

Strona 63 - DEC & DECF

Commands - 122START INPTasking StatementSYNTAX: START INP n [,n1] [,n2] PURPOSE: To enable one or m ore IN P tasks dec lared by the ON

Strona 64

Commands - 123STOPStatementSYNTAX: STOPPURPOSE: To terminate pr ogram execution and return to comm and level.REMARK S: STOP statemen

Strona 65

Commands - 124STOP BITTasking StatementSYNTAX: STOP BIT task [,task] . . .PURPOSE: To disable a bit that has previously been defined w

Strona 66

Commands - 125STOP COUNTTasking StatementSYNTAX: STOP COUNT n [,n1] [,nn]PURPOSE: To deactivate a software counter task that was previ

Strona 67

Commands - 126STOP INPTasking StatementSYNTAX: STOP INP n [,n1] [,n2]PURPOSE: To disable one or m ore IN P tasks declared by the ON IN

Strona 68

Concepts - 10> greater than X> Y < less than X< Y>= greater than X> = Y or equal to<= less than X< = Yor equal

Strona 69

Commands - 127STR$String FunctionSYNTAX: n$ = STR$(m)PURPOSE: To convert a number to a string.REMARK S: For positive numbers, the st

Strona 70

Commands - 128SYSSystem FunctionSYNTAX: a = SYS(n)PURPOSE: To access system data and addresses.REMARK S: n is the system number.The f

Strona 71 - DO/ENDDO

Commands - 129SYS(3) is used by assembly language programmers to determine jump vector location.SYS(4) and SYS (5) return the status o

Strona 72 - DO/UNTIL

Commands - 130TABPrint FunctionSYNTAX: PRIN T TA B(m)PURPOSE: To tab to position m.REMARK S: m ranges from 0 to 255If the current prin

Strona 73 - DPEEK and DPOKE

Commands - 131TANNumeric Fun ctionSYNTAX: n = TAN(m)PURPOSE: To return the trigonometric tangent of m.REMARK S: The angle m must be i

Strona 74

Commands - 132TICKProcess FunctionSYNTAX: a= TICK(n)PURPOSE: To return the time from the TICK timers.REMARK S: n is from 0 to 2, corre

Strona 75

Commands - 133TIME$FunctionSYNTAX: a$ = TIME$(n)PURPOSE: The TIME$ function is used to read the system calendar/clock. The system cl

Strona 76

Commands - 134TIME$StatementSYNTAX: TIME$ = time stringPURPOSE: TIME$ is used to set the time on the system calendar/clock. The clo

Strona 77

Commands - 135TRON/TROFFStatementSYNTAX: TRONTROFFPURPOSE: To trace program execution.REMARK S: Execute TRON to turn on the trace and

Strona 78

Commands - 136VALNumeric Fun ctionSYNTAX: n = VAL(m$)PURPOSE: To convert a string to a number.REMARK S: The VAL function strips leadi

Strona 79 - EXIT and EXIT CLEAR

Concepts - 11AND Operand 2

Strona 80

Commands - 137VARPTRNumeric Fun ctionSYNTAX: VARPTR(variable)PURPOSE: To return the address in RAM of the variable. This command is s

Strona 81

Commands - 138Strings ar e stored in tw o ways. A literal str ing (e. g., A$ = "string") is stor ed in the program line

Strona 82

Commands - 139the value returned will not change.

Strona 83 - FOR / NEXT / STEP

Commands - 140XORNumeric Fun ctionSYNTAX: n = a XOR b PURPOSE: Performs bitwise XOR operation on two numbers. XOR'ing is usuall

Strona 84 - FPEEK and FPOKE

CONFIG C ommands - 1CONFIG AINStatementSYNTAX: CONFIG AIN channel, input, rangeWhere: channel is 0 to range of inputs for your card.in

Strona 85

CONFIG C ommands - 2CONFIG BAUDStatementSYNTAX: CONFIG BAUD port,baud rate, mode, parity [,com]PURPOSE: To change the ser ial port par

Strona 86

CONFIG C ommands - 3within one character time after the last char acter is sent.0 = RS-232 (default)1 = RS-422 (transmitter always

Strona 87

CONFIG C ommands - 4CONFIG BREAKStatementSYNTAX: CONF IG BREAK com port,modePURPOSE: To enable or disable response to a break charac

Strona 88

CONFIG C ommands - 5CONFIG CLOCKStatementSYNTAX: CONF IG CLOC K mode,runCONF IG CLOC K run (RPC-2350 series only)PURPOSE: Configures r

Strona 89

CONFIG C ommands - 6CONFIG COM$Tasking StatementSYNTAX: CONFIG C OM$ n,terminator, length,XON ,echoPURPOSE: To configure a communicati

Strona 90 - IF / THEN / ELSE

Concepts - 12The NOT operator performs a logical negative of a value.Operand 1 0001 0111 = 23NOT Operand 1 1110 1000 = 232Value of exp

Strona 91 - INC and INCF

CONFIG C ommands - 7CONFIG COUNTTasking StatementSYNTAX: CONFIG COUNT number,address,bit [,preset] [,AUTO]PURPOSE: To define the chara

Strona 92

CONFIG C ommands - 8CONFIG DISPLAYStatementSYNTA X: CONFIG DISPLAY address,type,cursorPURPOSE: To install a driver for a displayREMAR

Strona 93

CONFIG C ommands - 9EXAMPLE: The example below is for a vacuum florescent 2x20 display. It illustrates both continuous updatingand pe

Strona 94

CONFIG C ommands - 10CONFIG PIOStatementSYNTAX: CONFIG PIO init,port A, port B, p ort LC, port UC [,address]PURPOSE: To initialize an

Strona 95 - Commands - 62

Program debugging - 1PROGRAM DEBUGGINGCAM BASIC has several constructs which can be used to debug a program. This section will outli

Strona 96 - INPUT KEYPAD$

Program debugging - 250 NEXT60 TROFF70 END80 S = 090 INC H100 RETURNRUN.30..40..90..100..50..40..90..100..50..40..90..100..50..60.USI

Strona 97

Error Messages - 1The following list of error messages are returned by CAM BASIC. These indicate clearly, what is wrong, within th

Strona 98

Error Messages - 2NUM MESSAGE EXPLANATION12 < Illegal imm ediate> A statement that is illegal in Immediate M ode is enter ed as

Strona 99

Error Messages - 3

Strona 100

Error Messages - 4NUM MESSAGE EXPLANATION27 < Data > 255> The argument or parameter may not exceed 255.28 < Data > 6

Strona 101

Concepts - 136. relational operators= (equal)<> (not equal)< (less than)> (greater than)<= (less than or equal to)>=

Strona 102

Event Multitasking - 1Event MultitaskingEvent Multitasking was developed to give faster response to real time events. It is different

Strona 103

Event Multitasking - 2Between each program statement CAM BASIC checks to see if any interrupt flags are set. If so, it branches to th

Strona 104

Event Multitasking - 3COUNT MULTITASKINGIntroductionCAM BASIC supports eight event counters. These ar e generated in software and are

Strona 105

Event Multitasking - 4Theoretically, a 100 Hz square wave can be counted. However, due to sample timing variations (dependent upon ot

Strona 106 - Commands - 73

Event Multitasking - 5The second is the interrupt mode. When the preset count is reached, a software interrupt is generated and the p

Strona 107

Event Multitasking - 6NOTE: It is theoretically possible for the subroutine to take so long to execute that another 20 00 counts isre

Strona 108

Event Multitasking - 7Line 110 prints the count in the counter.Line 120 returns execution to the place where the one– second interrupt

Strona 109

Event Multitasking - 840 DELAY .2550 GOTO 3060 PRINT "match"70 RETURNLine 10 defines the INP task 0 to look at address 2.

Strona 110

Event Multitasking - 92. KEYPA D$ function returns either a one– character string that has been assigned to each key or thenumerical p

Strona 111

Event Multitasking - 10Line 80 returns program execution to the place that it was executing before the key was pressed.Inputting Multi

Strona 112

Preface - 1HOW TO USE THIS MANUALThis manual contains information on CAMBASIC and its commands. You will find that some information

Strona 113

Program Editing - 1CAMBASIC EDITORUsing the Line EditorWhen using a CRT terminal to write program s, the resources of the PC are not

Strona 114 - NEW and UNNEW

Event Multitasking - 11Intercepting these keys in the form of strings provides a slower response than using the key positions. The fo

Strona 115

Event Multitasking - 12the COM1 ser ial port. In an actual application, the characters would prob ably be echoed to a multiline dis

Strona 116

Event Multitasking - 13MULTITASKING ON A CLOCK TICKThe three 200 Hz (100 Hz in 9 MHz systems) tick timers are used for a number of mul

Strona 117

Event Multitasking - 14PULSE MULTITASKINGIntroductionCAM BASIC supports eight timed (or pulsed) outputs. These ar e gener ated in s

Strona 118 - ON COUNT

Event Multitasking - 15executed and then go low.The PU LSE function r eturns the rem aining time of each stage. The example below d

Strona 119 - ON ERR GOTO

Event Multitasking - 16..emergency'Emergency stop pressed. Turn off all outputsout 2,255return'..headup'Head has moved

Strona 120

Differences - 1DIFFERENCES—CAMBASIC vs QBASIC1. CAM BASIC is a multitasking language while the others are not. This adds features to

Strona 121

Mini-Monitor - 1THE CAMBASIC MINI– MONITORThe Mini– Monitor is included in CAMBASIC primar ily for those who will be combining object

Strona 122 - ON KEYPAD$

Mini-Monitor - 2Edit MemoryThis routine lets you poke hex values into memor y. For example, to edit at A000, you enter the command be

Strona 123

Program Editing - 2Executing the EDIT statement will cause the target line to be displayed. Below this line the line number will be

Strona 124

Program Editing - 3H Hack Remainder Of The Line And E nter InsertThe Hack command deletes from the cursor position to the end of the

Strona 125

Program Editing - 4R ReplaceThe Replace command does a delete and insert on a character basis. For example: EDIT 1010 PRINT "Th

Strona 126

Program ing Tips - 1How to Maximize Execution Speed1. Use the pre-compiled variable A% to Z%. In an average program these will run 5

Strona 127 - PEEK and POKE

Program ing Tips - 2can use PC SmartLINK to strip out the remar ks in the final program. H owever, this may have a significantimpact

Strona 128 - PEEK$ and POKE$

Program ing Tips - 3b. Erroneous error m essage for a good line.c. A < System corruption> error message.d. The system will not

Strona 129

Command Summary - 1Command Syntax PurposeABS n= ABS(m) Returns absolute value of a numberAIN n= AIN(channel) Returns result of A/D con

Strona 130

Command Summary - 2DISPLAY DISPLAY a$ Writes data to display

Strona 131 - PRINT USING

Command Summary - 3Command Syntax PurposeDO/UNT IL DO list UNTIL expr. Executes until expression is trueDO/ENDDO DO n Fast loop struct

Strona 132

Preface - 2PRODUCT SUPPORTIf you have a question about CAMBASIC and you cannot find the answer in this manual, call Technical Support

Strona 133

Command Summary - 4Command Syntax PurposeLINE a = LINE(n) Read a single line on a STB-26LINE n, m Write to a line number on a STB-26L

Strona 134

Command Summary - 5Command Syntax PurposePRINT$ PRINT $ char [,char] Prints string of charactersPULSE n= PULSE(m) Returns time from

Strona 135

Command Summary - 6

Strona 136

Command Summary - 7Command Syntax PurposeTIME$ n$= TIME$(n) Reads calendar/clockTIME$= n$ Writes to calendar/clockTROFF TROFF Stops th

Strona 137

Commands - 1ABSNumeric Fun ctionSYNTAX: n = ABS(m)PURPOSE: To return the absolute value of the expression m.REMARK S: The absolute va

Strona 138

Commands - 2AINProcess FunctionSYNTAX: a = AIN(channel)PURPOSE: To return the analog input value.REMARK S: The channel is the channel

Strona 139

Commands - 3ANDNumeric Fun ctionSYNTAX: n = a AND b PURPOSE: Performs bitwise or logical operation on two numbers. AND'ing is u

Strona 140

Commands - 4AOTProcess StatementSYNTAX: AOT channel,valuePURPOSE: To wr ite data to a analog output port.REMARK S: AOT causes the an a

Strona 141 - RESUME COUNT

Commands - 5ASCNumeric Fun ctionSYNTAX: n = ASC(m$) PURPOSE: To return the ASC II code for the first character of the string m$.REMAR

Strona 142

Commands - 6ATNNumeric Fun ctionSYNTAX: n = ATN(m)PURPOSE: To return the arctangent of m.REMARK S: The result, n, of the ATN function

Strona 143

Introduction - 1ABOUT CAMBASICCAMBASIC is the result of 18 years of industrial language development at Octagon. Its major strengths a

Strona 144

Commands - 7AUTOCOMMANDSYNTAX: AUTO [line] [,increment]PURPOSE: Generate a line number automatically each time you press < Enter&g

Strona 145

Commands - 8BCDNumeric Fun ctionSYNTAX: n = BCD(m)PURPOSE: To return four digits in packed BCD format from a number.REMARK S: The fou

Strona 146

Commands - 9BINNumeric Fun ctionSYNTAX: n = BIN(m)PURPOSE: To return a number from a packed BCD number.REMARK S: This function assume

Strona 147 - Commands - 114

Commands - 10BIN$String FunctionSYNTAX: n$ = BIN$(m)PURPOSE: Returns an 8– bit binary representation of a number.REMARK S: The most s

Strona 148

Commands - 11BITProcess FunctionSYNTAX: n = BIT(I/O address, bit)PURPOSE: To read a specified bit at a specified I/O address.REMARK S

Strona 149

Commands - 12BITProcess StatementSYNTAX: BIT I/O address,bit,valueBIT I/O address, bit,ONBIT I/O address, bit,OFFBIT I/O address, bit,

Strona 150

Commands - 13CALLStatementSYNTAX: CALL address [,m1] [,m2]. . .PURPOSE: To execute an assembly language program at the specified add

Strona 151

Commands - 14NOTE2: CAMBASIC internal routines are not accessible by the object code programmer exceptthose listed in the SYS functi

Strona 152

Commands - 15CHR$String FunctionSYNTAX: n$ = CHR$(m)n$ = CHR$(m,n)PURPOSE: To convert an ASCII cod e to its character equivalent. A

Strona 153 - START BIT

Commands - 16CLEARStatementSYNTAX: CLEAR [string space] PURPOSE: To set all numeric variables to zero, set all string variables to nul

Strona 154 - START COUNT

Introduction - 2 OUT HEAT,0All you need is the addition of the AUTO command at the beginning of the program. N o programlines can be

Strona 155 - START INP

Commands - 17CLEAR COM$Process StatementSYNTAX: CLEAR CO M$ nPURPOSE: To reset a serial port input buffer to the power– up condition.R

Strona 156

Commands - 18CLEAR COUNTTasking StatementSYNTAX: CLEAR COUNT n [,n1] . . . [,nm]PURPOSE: To clear the accumulated count in a software

Strona 157 - STOP BIT

Commands - 19CLEAR TICKTasking StatementSYNTAX: CLEAR TICK nPURPOSE: To reset the internal TICK clock to zero. This does not affect

Strona 158 - STOP COUNT

Commands - 20CLEAR PULSETasking StatementSYNTAX: CLEAR PULSE n [,n1] . . . [,nm]PURPOSE: To clear the remaining time in a software tim

Strona 159 - STOP INP

Commands - 21CLSStatementSYNTAX: CLS [#n]PURPOSE: To clear the screen of a terminal connected to a serial port using PC SmartLINK.REMA

Strona 160

Commands - 22COM$Process FunctionSYNTAX: n$ = COM$(n)PURPOSE: To return a string from the serial input buffer. This function is usual

Strona 161

Commands - 23CONFIGStatementSYNTAX: CONFIG com mand [list]PURPOSE: The CONFIG statement is used to set parameters for a number of indu

Strona 162

Commands - 24CONTCommandSYNTAX: CONTPURPOSE: To resume program execution after a break.REMARK S: The CONT comm and may be used to re

Strona 163

Commands - 25COSNumeric Fun ctionSYNTAX: n = COS(m)PURPOSE: To return the trigonometric cosine function.REMARK S: m must be in radian

Strona 164

Commands - 26COUNTProcess FunctionSYNTAX: n = count(channel)PURPOSE: To return the count in the software event counters and r eturn th

Strona 165

Introduction - 313. Process Functions Simplify ProgrammingMost functions return the result of a numeric or string calculation. A proc

Strona 166

Commands - 27DATAStatementSYNTAX: DATA constant [,constant] . . . .PURPOSE: To provide a means to store numeric and string constants

Strona 167

Commands - 28DATE$System StatementSYNTAX: DATE$ = date stringPURPOSE: DATE$ is used to set the date on the system calendar clock. Th

Strona 168 - TRON/TROFF

Commands - 29DATE$System FunctionSYNTAX: a$ = DATE$(n)PURPOSE: The DAT E$ function is used read the date of the system calendar clock

Strona 169

Commands - 30DEC & DECFStatementsSYNTAX: DEC variableDEC F var iablePURPOSE: To decrement a variable by one (DEC) or four (DEC F

Strona 170

Commands - 31DELETECommandSYNTAX: DEL [– ] line [– line] [– ]PURPOSE: To delete CA MBASIC program lines.REMARK S: The DEL command er

Strona 171

Commands - 32DELAYStatementSYNTAX: DELAY nPURPOSE: To create a precision delay. T he resolution is 5 mS (10 mS on 9 MHz systems).REM

Strona 172 - Commands - 139

Commands - 33DIMStatementSYNTAX: DIM variable (value) [,variable (value)] . . .PURPOSE: To specify the maximum size for array variabl

Strona 173

Commands - 34DISPLAYProcess StatementSYNTAX: DISPLAY data [,][;][ data ] . . .DISPLA Y$ data [,da ta] . . .DISPLA Y! "format&qu

Strona 174 - CONFIG AIN

Commands - 35Random access mode is most commonly used when presenting data or during operator feedback. You specify a row and column w

Strona 175 - CONFIG BAUD

Commands - 36A point is erased using the CLEAR DISPLAY P(x, y) command. Gr aphics dots in a line are clearedusing the CLEAR DISPLA Y

Strona 176

Concepts - 1Getting StartedTo program in CAMBASIC you will need a terminal to interface with your CPU card. This may be a CRT termina

Strona 177 - CONFIG BREAK

Commands - 37Lines 20 to 50 define the four strings to be printedLines 60 to 90 display the strings in the random access modeLine 100

Strona 178 - CONFIG CLOCK

Commands - 38DO/ENDDOStatementsSYNTAX: DO value...ENDDO PURPOSE: To execute a loop a number of times quickly.REMARK S: value range is

Strona 179 - CONFIG COM$

Commands - 39DO/UNTILStatementsSYNTAX: DO...UNTIL expression is true PURPOSE: To execute a conditional loop structure.REMARK S: The DO

Strona 180 - CONFIG COUNT

Commands - 40DPEEK and DPOKEMemory Function and StatementSYNTAX: n = DPEE K(address)n = DPEE K (address, segment)DPOKE address, dat

Strona 181 - CONFIG DISPLAY

Commands - 41EDITCommandSYNTAX: EDIT line“ . ”PURPOSE: To display a line for editing.REMARK S: The EDIT statement simply displays the

Strona 182

Commands - 42ENDStatementSYNTAX: ENDPURPOSE: To halt execution of a pr ogram at a given point.REMARK S: END causes execution to cease

Strona 183 - CONFIG PIO

Commands - 43ERLSystem VariableSYNTAX: n = ERLPURPOSE: To return the line number associated with an error.REMARK S: The function ret

Strona 184 - PROGRAM DEBUGGING

Commands - 44ERRSystem VariableSYNTAX: n = ERRPURPOSE: To return the error code associated with an error.REMARK S: The function retu

Strona 185

Commands - 45ERRORSystem StatementSYNTAX: ERR nPURPOSE: To simulate the occurrence of a run time error.REMARK S: This statement is us

Strona 186

Commands - 46EXIT and EXIT CLEARStatementSYNTAX: EXIT [line/label]EXIT CLEARPURPOSE: To allow legal branching out of a loop structure.

Strona 187

Concepts - 2Line LabelsYou can write a program to GOTO or GOSUB to a label instead of a line number. This makes for more readable cod

Strona 188 - Error Messages - 3

Commands - 47EXPNumeric Fun ctionSYNTAX: n = EXP(m)PURPOSE: To return the exponential function of “e. ”REMARK S: This function retur

Strona 189

Commands - 48FINDCommandSYNTAX: FIND argumentPURPOSE: Used to locate variables, keyw ords, and labels.REMARK S: This is a useful tool

Strona 190 - Event Multitasking

Commands - 4960 UNTIL RUNAMPS >5310 RUNAMPS = 1.5*AIN(2)>FIND GOSUB20 GOSUB . . confirm50 GOSUB . . current_test>FIND . .200

Strona 191 - COM$ TASKING

Commands - 50FOR / NEXT / STEPStatementsSYNTAX: FOR variable = n TO m [STEP z]...NEXTPURPOSE: To perfor m a loop oper ation a given n

Strona 192 - COUNT MULTITASKING

Commands - 51FPEEK and FPOKEMemory Function and StatementSYNTAX: a = FPEE K(address)a = FPEE K(address,segment)FPOKE address, dataF

Strona 193

Commands - 52FREFunctionSYNTAX: a = FRE(0)a = FRE(c$)PURPOSE: Returns the number of bytes of unused but allocated string space, or t

Strona 194

Commands - 53GOSUBStatementSYNTAX: GOS UB line/label...RETURNPURPOSE: To branch to and return from a subroutine.REMARK S: line/label

Strona 195

Commands - 54The following shows the use of labels:90 A3 = AIN(0)100 GOSUB ..FILTER110 PR FL . . .3000 ..FILTER3010 FL = .875 * FL

Strona 196 - INP TASKING

Commands - 55GOTOStatementSYNTAX: GOTO line/labelPURPOSE: To branch unconditionally out of the norm al progr am sequence to a specif

Strona 197 - KEYPAD MULTITASKING

Commands - 56HEX$String FunctionSYNTAX: n$ = HEX$(m)PURPOSE: To return a hex representation of a number.REMARK S: The value of m may

Strona 198 - Applications Examples

Concepts - 3Reserved WordsCAM BASIC comprises a set of statements, com mands and function names which are treated as reser ved words a

Strona 199

Commands - 57IF / THEN / ELSEStatementSYNTAX: IF m THEN statement(s) [ELSE statement(s)]IF m GOTO line/labelIF m THEN line/labelPURPO

Strona 200

Commands - 58INC and INCFStatementsSYNTAX: INC variableINCF variablePURPOSE: To increment a variable by one (INC) or four (INC F). I

Strona 201 - Event Multitasking - 12

Commands - 59INKEY$FunctionSYNTAX: a$ = INKEY$(n)PURPOSE: To return a single character from a serial input buffer.REMARK S: The retur

Strona 202 - MULTITASKING ON A CLOCK TICK

Commands - 60INPI/O FunctionSYNTAX: n = INP(I/O addre ss)OUT I/O a ddress, dataPURPOSE: INP returns a byte from an I/O address.OUT w

Strona 203 - PULSE MULTITASKING

Commands - 61INPUTStatementSYNTAX: INPUT [#n,][;] var [,var] ...INPUT [#n,][;] "prompt message"; var [,var] ...INPUT [#n

Strona 204

Commands - 62

Strona 205

Commands - 63INPUT KEYPAD$StatementSYNTAX: INPUT KEYP AD$ echo port,variableINPUT KEYP AD$ echo port,"text" ,variableINPUT K

Strona 206

Commands - 64EXAMPLE: 10 ON KEYPAD$ 24 GOSUB 500 20 DISPLAY (1,0);30 INPUT KEYPAD$ 10,"Enter weight",WEIGHT 40 PRINT WEIGHT5

Strona 207 - THE CAMBASIC MINI– MONITOR

Commands - 65INSTRFunctionSYNTAX: a = INSTR(n,string,substring)PURPOSE: Returns the position of the first occurrence on a sub-string

Strona 208

Commands - 66INTNumeric Fun ctionSYNTAX: a = INT(b)PURPOSE: To return an integer that is equal to or less tha n the argument.REMARK S

Komentarze do niniejszej Instrukcji

Brak uwag