Remote-processing CAMBASIC User Manual

Browse online or download User Manual for Computers Remote-processing CAMBASIC. Remote Processing CAMBASIC User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 208
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 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
Page view 0
1 2 3 4 5 6 ... 207 208

Summary of Contents

Page 1 - TRADEMARKS

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

Page 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

Page 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

Page 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

Page 5

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

Page 6

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

Page 7 - Line Renumbering

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

Page 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

Page 9 - Character Set

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

Page 10

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

Page 11

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

Page 12

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

Page 13

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

Page 14

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

Page 15

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

Page 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

Page 17 - AND Operand 2

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

Page 18 - Expression Evaluation

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

Page 19

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

Page 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

Page 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

Page 22

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

Page 23

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

Page 24

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

Page 25 - Other Tips

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

Page 26

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

Page 27

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

Page 28 - Command Summary - 2

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

Page 29

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

Page 30

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

Page 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

Page 32 - Command Summary - 6

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

Page 33

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

Page 34

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

Page 35

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

Page 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

Page 37

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

Page 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

Page 39

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

Page 40

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

Page 41

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

Page 42

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

Page 43

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

Page 44

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

Page 45

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

Page 46

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

Page 47

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

Page 48

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

Page 49

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

Page 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

Page 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

Page 52 - CLEAR TICK

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

Page 53 - CLEAR PULSE

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

Page 54

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

Page 55

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

Page 56

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

Page 57

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

Page 58

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

Page 59

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

Page 60

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

Page 61

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

Page 62

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

Page 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

Page 64

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

Page 65

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

Page 66

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

Page 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

Page 68

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

Page 69

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

Page 70

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

Page 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

Page 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

Page 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

Page 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

Page 75

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

Page 76

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

Page 77

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

Page 78

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

Page 79 - EXIT and EXIT CLEAR

Concepts - 11AND Operand 2

Page 80

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

Page 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

Page 82

Commands - 139the value returned will not change.

Page 83 - FOR / NEXT / STEP

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

Page 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

Page 85

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

Page 86

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

Page 87

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

Page 88

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

Page 89

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

Page 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

Page 91 - INC and INCF

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

Page 92

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

Page 93

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

Page 94

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

Page 95 - Commands - 62

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

Page 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

Page 97

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

Page 98

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

Page 99

Error Messages - 3

Page 100

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

Page 101

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

Page 102

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

Page 103

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

Page 104

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

Page 105

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

Page 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

Page 107

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

Page 108

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

Page 109

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

Page 110

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

Page 111

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

Page 112

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

Page 113

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

Page 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

Page 115

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

Page 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

Page 117

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

Page 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

Page 119 - ON ERR GOTO

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

Page 120

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

Page 121

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

Page 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

Page 123

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

Page 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

Page 125

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

Page 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

Page 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

Page 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

Page 129

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

Page 130

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

Page 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

Page 132

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

Page 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

Page 134

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

Page 135

Command Summary - 6

Page 136

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

Page 137

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

Page 138

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

Page 139

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

Page 140

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

Page 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

Page 142

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

Page 143

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

Page 144

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

Page 145

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

Page 146

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

Page 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

Page 148

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

Page 149

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

Page 150

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

Page 151

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

Page 152

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

Page 153 - START BIT

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

Page 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

Page 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

Page 156

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

Page 157 - STOP BIT

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

Page 158 - STOP COUNT

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

Page 159 - STOP INP

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

Page 160

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

Page 161

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

Page 162

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

Page 163

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

Page 164

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

Page 165

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

Page 166

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

Page 167

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

Page 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

Page 169

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

Page 170

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

Page 171

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

Page 172 - Commands - 139

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

Page 173

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

Page 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

Page 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

Page 176

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

Page 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

Page 178 - CONFIG CLOCK

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

Page 179 - CONFIG COM$

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

Page 180 - CONFIG COUNT

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

Page 181 - CONFIG DISPLAY

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

Page 182

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

Page 183 - CONFIG PIO

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

Page 184 - PROGRAM DEBUGGING

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

Page 185

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

Page 186

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

Page 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

Page 188 - Error Messages - 3

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

Page 189

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

Page 190 - Event Multitasking

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

Page 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

Page 192 - COUNT MULTITASKING

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

Page 193

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

Page 194

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

Page 195

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

Page 196 - INP TASKING

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

Page 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

Page 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

Page 199

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

Page 200

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

Page 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

Page 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

Page 203 - PULSE MULTITASKING

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

Page 204

Commands - 62

Page 205

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

Page 206

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

Page 207 - THE CAMBASIC MINI– MONITOR

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

Page 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

Comments to this Manuals

No comments