Remote-processing CAMBASIC Manual do Utilizador

Consulte online ou descarregue Manual do Utilizador para Computadores Remote-processing CAMBASIC. Remote Processing CAMBASIC User Manual Manual do Utilizador

COPYRIGHT

Copyright 1988-1994 – Octagon Systems and Remote Pr ocessing Corp. All rights reserved.
Modifications by Remote Processing Cor poration, C opyright 1995 - 2003
The software described in this manual is furnished under a license agreement and may be used only in accordance w ith the
terms of the agreemen t.
The contents of this manual and the specifications herein may change without notice.

TRADEMARKS

CAM BASIC™, M icro PC ™, P C Sma rtLIN K™ and Event M ultitasking™ are tradem arks of Octago n Systems.
IBM PC ® is a registered trademark of IBM Corpora tion.
QBASIC® is a registered trademark of M icrosoft Corporation.
Remote Pr ocessing Corp.
7975 E. Har vard Ave.
Denver, CO 80231
Phone:303– 690– 1588
FAX : 303-690-1875
www. rp3.c om
Order #1042
Rev 1.6

Ficheiro PDF · ·

Imprimir

Imprimir documento

Partilha

Resumo do Conteúdo

Página 1 - TRADEMARKS

COPYRIGHT Copyright 1988-1994 – Octagon Systems and Remote Processing Corp. All rights reserved. Modifications by Remote Processing Cor poration…

Página 2 - HOW TO USE THIS MANUAL

Preface - 1 HOW TO USE THIS MANUAL This manual contains information on CAMBASIC and its commands. You will find that some information is duplicated in…

Página 3 - PRODUCT SUPPORT

Preface - 2 PRODUCT SUPPORT If you have a question about CAMBASIC and you cannot find the answer in this manual, call Technical Support at the number…

Página 4 - ABOUT CAMBASIC

Introduction - 1 ABOUT CAMBASIC is the result of 18 years of industrial language development at Octagon. Its major strengths are ease– of– use…

Página 5

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

Página 6

Introduction - 3 13. Process Functions Simplify Programming Most functions return the result of a numeric or string calculation. A process function…

Página 7 - Line Renumbering

Getting Started To program in CAMBASIC you will need a terminal to interface with your CPU card. This may be a CRT terminal or a PC configured as a…

Página 8 - Real time Multitasking

Line Labels You can write a program to GOTO or GOSUB to a label instead of a line number. This makes for more readable code. 90 A3 = AIN(0) 100 GOSUB…

Página 9 - Character Set

Reserved Words CAM BASIC comprises a set of statements, com mands and function names which are treated as reser ved words and cannot be used at the…

Página 10

Below is a list of CAMBASIC commands. Some CPU Cards do not use all of the commands. Refer to your hardware manual for exceptions, if any. ABS AIN AND…

Página 11

Software and Hardware Interrupts CAMBASIC supports multiple hardware and software interrupts. These interrupts causes the program to branch to an…

Página 12

AUTORUN OPERATION Once a program has been stored in nonvolatile memory, it can autorun on power – up. PROTECTING YOUR PROGRAMS You can cause your…

Página 13

For example, GOTOE is not ok EGOTO is ok String variables are limited to 255 characters. Arrays may be any leng th, may be multidimensional, and…

Página 14

Lower– case characters have a higher ASC II value than upper– case characters. If two strings are identical up to the point that one string ends, the…

Página 15

NOTE: Attempting to enter a line with more than 24 constants will cause the remainder of the line to be terminated. CAM BASIC does this to prevent…

Página 16

> greater than X> Y < less than X< Y >= greater than X> = Y or equal to <= less than X< = Y or equal to Relational operations return a value of “0” if…

Página 18 - Expression Evaluation

The NOT operator performs a logical negative of a value. Operand 1 0001 0111 = 23 NOT Operand 1 1110 1000 = 232 Value of expression Value of NOT…

Página 19

relational operators = (equal) <> (not equal) < (less than) > (greater than) <= (less than or equal to) >= (greater than or equal to) 7. NOT (logical…

Página 20 - CAMBASIC EDITOR

Program Editing - 1 CAMBASIC EDITOR Using the Line Editor When using a CRT terminal to write program s, the resources of the PC are not available.…

Página 21 - LINE EDITING COMMANDS

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

Página 22

Program Editing - 3 H Hack Remainder Of The Line And E nter Insert The Hack command deletes from the cursor position to the end of the line and enters…

Página 23

Program Editing - 4 R Replace The Replace command does a delete and insert on a character basis. For example: EDIT 10 10 PRINT "This is";:PRINT" a…

Página 24

Program ing Tips - 1 How to Maximize Execution Speed 1. Use the pre-compiled variable A% to Z%. In an average program these will run 50% faster. U se…

Página 25 - Other Tips

Program ing Tips - 2 can use PC SmartLINK to strip out the remar ks in the final program. H owever, this may have a significant impact on clarity. Do…

Página 26

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

Página 27

Command Summary - 1 Command Syntax Purpose ABS n= ABS(m) Returns absolute value of a number AIN n= AIN(channel) Returns result of A/D conversion AND n…

Página 28 - Command Summary - 2

Command Summary - 2 DISPLAY a$ Writes data to display

Página 29

Command Summary - 3 Command Syntax Purpose DO/UNT IL DO list UNTIL expr. Executes until expression is true DO/ENDDO DO n Fast loop structure DPEEK n=…

Página 30

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

Mostrar as 208 páginas
Página 31

Command Summary - 5 Command Syntax Purpose PRINT$ PRINT $ char [,char] Prints string of characters PULSE n= PULSE(m) Returns time from pulsed output…

Página 33

Command Summary - 7 Command Syntax Purpose TIME$ n$= TIME$(n) Reads calendar/clock TIME$= n$ Writes to calendar/clock TROFF TROFF Stops the trace TRON…

Página 34

ABS Numeric Fun ction SYNTAX: n = ABS(m) PURPOSE: To return the absolute value of the expression m. REMARK S: The absolute value of a number is always…

Página 35

AIN Process Function SYNTAX: a = AIN(channel) PURPOSE: To return the analog input value. REMARK S: The channel is the channel number of the A/D…

Página 36

AND Numeric Fun ction SYNTAX: n = a AND b PURPOSE: Performs bitwise or logical operation on two numbers. AND'ing is usually performed during I/O…

Página 37

AOT Process Statement SYNTAX: AOT channel,value PURPOSE: To wr ite data to a analog output port. REMARK S: AOT causes the an alog output voltage to…

Página 38

ASC Numeric Fun ction SYNTAX: n = ASC(m$) PURPOSE: To return the ASC II code for the first character of the string m$. REMARK S: The result of the ASC…

Página 39

ATN Numeric Fun ction SYNTAX: n = ATN(m) PURPOSE: To return the arctangent of m. REMARK S: The result, n, of the ATN function is a value in radians in…

Página 40

AUTO COMMAND SYNTAX: AUTO [line] [,increment] PURPOSE: Generate a line number automatically each time you press < Enter> after a program line. REMARK…

Página 41

BCD Numeric Fun ction SYNTAX: n = BCD(m) PURPOSE: To return four digits in packed BCD format from a number. REMARK S: The four BCD digits are stor ed…

Página 42

BIN Numeric Fun ction SYNTAX: n = BIN(m) PURPOSE: To return a number from a packed BCD number. REMARK S: This function assumes that the BCD digits are…

Página 43

BIN$ String Function SYNTAX: n$ = BIN$(m) PURPOSE: Returns an 8– bit binary representation of a number. REMARK S: The most significant bit (bit 7) is…

Página 44

BIT Process Function SYNTAX: n = BIT(I/O address, bit) PURPOSE: To read a specified bit at a specified I/O address. REMARK S: This function returns a…

Página 45

BIT Process Statement SYNTAX: BIT I/O address,bit,value BIT I/O address, bit,ON BIT I/O address, bit,OFF BIT I/O address, bit,NOT PURPOSE: To set or…

Página 46

CALL Statement SYNTAX: CALL address [,m1] [,m2]. . . PURPOSE: To execute an assembly language program at the specified address and, optionally, to…

Página 47

NOTE2: CAMBASIC internal routines are not accessible by the object code programmer except those listed in the SYS function (if any). NOTE3: The CALL…

Página 48

CHR$ String Function SYNTAX: n$ = CHR$(m) n$ = CHR$(m,n) PURPOSE: To convert an ASCII cod e to its character equivalent. Also, to return a string of…

Página 49

CLEAR Statement SYNTAX: CLEAR [string space] PURPOSE: To set all numeric variables to zero, set all string variables to null, restore the data…

Página 50 - CLEAR COM$

CLEAR COM$ Process Statement SYNTAX: CLEAR CO M$ n PURPOSE: To reset a serial port input buffer to the power– up condition. REMARK S: Executing this…

Página 51 - CLEAR COUNT

CLEAR COUNT Tasking Statement SYNTAX: CLEAR COUNT n [,n1] . . . [,nm] PURPOSE: To clear the accumulated count in a software event counter. REMARK S…

Página 52 - CLEAR TICK

CLEAR TICK Tasking Statement SYNTAX: CLEAR TICK n PURPOSE: To reset the internal TICK clock to zero. This does not affect a calendar/clock or the…

Página 53 - CLEAR PULSE

CLEAR PULSE Tasking Statement SYNTAX: CLEAR PULSE n [,n1] . . . [,nm] PURPOSE: To clear the remaining time in a software timer and restore the I/O…

Página 54

CLS Statement SYNTAX: CLS [#n] PURPOSE: To clear the screen of a terminal connected to a serial port using PC SmartLINK. REMARK S: This statement…

Página 55

COM$ Process Function SYNTAX: n$ = COM$(n) PURPOSE: To return a string from the serial input buffer. This function is usually used in conjunction with…

Página 56

CONFIG Statement SYNTAX: CONFIG com mand [list] PURPOSE: The CONFIG statement is used to set parameters for a number of industrial commands REMARK S…

Página 57

CONT Command SYNTAX: CONT PURPOSE: To resume program execution after a break. REMARK S: The CONT comm and may be used to resume program execution…

Página 58

COS Numeric Fun ction SYNTAX: n = COS(m) PURPOSE: To return the trigonometric cosine function. REMARK S: m must be in radians. To conver t from…

Página 59

COUNT Process Function SYNTAX: n = count(channel) PURPOSE: To return the count in the software event counters and r eturn the count of the hardware…

Página 60

DATA Statement SYNTAX: DATA constant [,constant] PURPOSE: To provide a means to store numeric and string constants and object code programs. The data…

Página 61

DATE$ System Statement SYNTAX: DATE$ = date string PURPOSE: DATE$ is used to set the date on the system calendar clock. The system clock keeps time on…

Página 62

DATE$ System Function SYNTAX: a$ = DATE$(n) PURPOSE: The DAT E$ function is used read the date of the system calendar clock. The system clock keeps…

Página 63 - DEC & DECF

DEC & DECF Statements SYNTAX: DEC variable DEC F var iable PURPOSE: To decrement a variable by one (DEC) or four (DEC F). REMARK S: This is a fast way…

Página 64

DELETE Command SYNTAX: DEL [– ] line [– line] [– ] PURPOSE: To delete CA MBASIC program lines. REMARK S: The DEL command erases the specified range of…

Página 65

DELAY Statement SYNTAX: DELAY n PURPOSE: To create a precision delay. T he resolution is 5 mS (10 mS on 9 MHz systems). REMARK S: Program execution is…

Página 66

DIM Statement SYNTAX: DIM variable (value) [,variable (value)] . . . PURPOSE: To specify the maximum size for array variables and reserve m emory…

Página 67

DISPLAY Process Statement SYNTAX: DISPLAY data [,][;][ data ] . . . DISPLA Y$ data [,da ta] . . . DISPLA Y! "format";data [,][;] DISPLAY "text"…

Página 68

Random access mode is most commonly used when presenting data or during operator feedback. You specify a row and column where you want the first…

Página 69

A point is erased using the CLEAR DISPLAY P(x, y) command. Gr aphics dots in a line are cleared using the CLEAR DISPLA Y LINE command. ON enables…

Página 70

Lines 20 to 50 define the four strings to be printed Lines 60 to 90 display the strings in the random access mode Line 100 has a 2 second delay Lines…

Página 71 - DO/ENDDO

DO/ENDDO Statements SYNTAX: DO value . . . ENDDO PURPOSE: To execute a loop a number of times quickly. REMARK S: value range is 1 to 65535. It can be…

Página 72 - DO/UNTIL

DO/UNTIL Statements SYNTAX: DO . . . UNTIL expression is true PURPOSE: To execute a conditional loop structure. REMARK S: The DO/ UNT IL statements…

Página 73 - DPEEK and DPOKE

DPEEK and DPOKE Memory Function and Statement SYNTAX: n = DPEE K(address) n = DPEE K (address, segment) DPOKE address, data DPOKE address, data, segm…

Página 74

EDIT Command SYNTAX: EDIT line “ . ” PURPOSE: To display a line for editing. REMARK S: The EDIT statement simply displays the line specified, and…

Página 75

END Statement SYNTAX: END PURPOSE: To halt execution of a pr ogram at a given point. REMARK S: END causes execution to cease without any message.…

Página 76

ERL System Variable SYNTAX: n = ERL PURPOSE: To return the line number associated with an error. REMARK S: The function returns the line number of the…

Página 77

ERR System Variable SYNTAX: n = ERR PURPOSE: To return the error code associated with an error. REMARK S: The function returns the error code for the…

Página 78

ERROR System Statement SYNTAX: ERR n PURPOSE: To simulate the occurrence of a run time error. REMARK S: This statement is usually used to test error…

Página 79 - EXIT and EXIT CLEAR

EXIT and EXIT CLEAR Statement SYNTAX: EXIT [line/label] EXIT CLEAR PURPOSE: To allow legal branching out of a loop structure. REMARK S: Within FOR/…

Página 80

EXP Numeric Fun ction SYNTAX: n = EXP(m) PURPOSE: To return the exponential function of “e. ” REMARK S: This function returns the result of the number…

Página 81

FIND Command SYNTAX: FIND argument PURPOSE: Used to locate variables, keyw ords, and labels. REMARK S: This is a useful tool especially in long…

Página 82

60 UNTIL RUNAMPS >5 310 RUNAMPS = 1.5*AIN(2) >FIND GOSUB 20 GOSUB . . confirm 50 GOSUB . . current_test >FIND . . 200 . . confirm 300 . . current_test…

Página 83 - FOR / NEXT / STEP

FOR / NEXT / STEP Statements SYNTAX: FOR variable = n TO m [STEP z] . . . NEXT PURPOSE: To perfor m a loop oper ation a given number of times. REMARK…

Página 84 - FPEEK and FPOKE

FPEEK and FPOKE Memory Function and Statement SYNTAX: a = FPEE K(address) a = FPEE K(address,segment) FPOKE address, data FPOKE address, data, segm…

Página 85

FRE Function SYNTAX: a = FRE(0) a = FRE(c$) PURPOSE: Returns the number of bytes of unused but allocated string space, or the number of bytes left for…

Página 86

GOSUB Statement SYNTAX: GOS UB line/label . . . RETURN PURPOSE: To branch to and return from a subroutine. REMARK S: line/label is the beginning of…

Página 87

The following shows the use of labels: 90 A3 = AIN(0) 100 GOSUB ..FILTER 110 PR FL . . . 3000 ..FILTER 3010 FL = .875 * FL + .125 * A3 3020 RETURN…

Página 88

GOTO Statement SYNTAX: GOTO line/label PURPOSE: To branch unconditionally out of the norm al progr am sequence to a specified line number or label.…

Página 89

HEX$ String Function SYNTAX: n$ = HEX$(m) PURPOSE: To return a hex representation of a number. REMARK S: The value of m may range from 0 to 65,535. If…

Página 90 - IF / THEN / ELSE

IF / THEN / ELSE Statement SYNTAX: IF m THEN statement(s) [ELSE statement(s)] IF m GOTO line/label IF m THEN line/label PURPOSE: To make decisions…

Página 91 - INC and INCF

INC and INCF Statements SYNTAX: INC variable INCF variable PURPOSE: To increment a variable by one (INC) or four (INC F). INCF is usually used to…

Página 92

INKEY$ Function SYNTAX: a$ = INKEY$(n) PURPOSE: To return a single character from a serial input buffer. REMARK S: The returned value is a null or…

Página 93

INP I/O Function SYNTAX: n = INP(I/O addre ss) OUT I/O a ddress, data PURPOSE: INP returns a byte from an I/O address. OUT writes a byte to an I/O…

Página 94

INPUT Statement SYNTAX: INPUT [#n,][;] var [,var] INPUT [#n,][;] "prompt message"; var [,var] INPUT [#n,][; ] "prompt message", var [,var ] PURPOSE…

Página 95

Commands - 62

Página 96 - INPUT KEYPAD$

INPUT KEYPAD$ Statement SYNTAX: INPUT KEYP AD$ echo port,variable INPUT KEYP AD$ echo port,"text" ,variable INPUT KEYP AD$ echo port, "text" ;variable…

Página 97

EXAMPLE: 10 ON KEYPAD$ 24 GOSUB 500 20 DISPLAY (1,0); 30 INPUT KEYPAD$ 10,"Enter weight",WEIGHT 40 PRINT WEIGHT 50 INPUT KEYPAD$ 10,"Enter name…

Página 98

INSTR Function SYNTAX: a = INSTR(n,string,substring) PURPOSE: Returns the position of the first occurrence on a sub-string within a string. REMARK S…

Página 99

INT Numeric Fun ction SYNTAX: a = INT(b) PURPOSE: To return an integer that is equal to or less tha n the argument. REMARK S: The integer portion is…

Página 100

KEYPAD$ Process Function SYNTAX: a$= KEYPAD$(0) a= KEYPAD$(1) PURPOSE: To return a one– character string in response to a keypad input or return the…

Página 101

LEFT$ String Function SYNTAX: n$ = LEFT$(m$,p) PURPOSE: To return the leftm ost p characters of m$. REMARK S: If p is greater than the length of m$…

Página 102

LEN Numeric Fun ction SYNTAX: n = LEN(m$) PURPOSE: To return the number of characters in m$. REMARK S: Unprintable and blank characters are counted.…

Página 103

LINE Process Function SYNTAX: a = LINE(terminal #) PURPOSE: To return the status of an input on a STB-26 terminal board. REMARK S: The terminal # has…

Página 104

LINE Process Statement SYNTAX: LINE terminal #, value PURPOSE: To write directly to the STB-26 terminal board. REMARK S: The terminal # has a…

Página 105

LIST Command SYNTAX: LIST [line [– [line]]] LIST #n, [line [– [line]]] LIST! PURPOSE: To list a part or all of the program currently in memory. REMARK…

Página 106

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

Página 107

LOAD Command SYNTAX: LOAD LOAD program RUN LOAD to RAM segment, RAM address, from me mory segm ent, memo ry address, length PURPOSE: LOAD with no…

Página 108

LOCK UNLOCK Tasking Statements SYNTAX: LOCK UNLOCK [RETURN] UNLOCK E XIT PURPOSE: To lock out interrupts from time critical portions of a program.…

Página 109

LOG Numeric Fun ction SYNTAX: n = LOG(m) PURPOSE: To return the natural logarithm of m. REMARK S: The natural logarithm is the logarithm to the base e…

Página 110

MID$ String Function SYNTAX: n$ = MID$(m$,p[,q]) PURPOSE: To return the requested part of a given string. REMARK S: The function returns a string of…

Página 111

MID$ String Statement SYNTAX: MID$(a$,s [,n]) = b$ PURPOSE: To replace a portion of one string with another. REMARK S: A common usage for the MID$…

Página 112

MOD Operator SYNTAX: n = a MOD b PURPOSE: To return the rem ainder of an integer division. REMARK S: a is divided by b and the remainder is placed in…

Página 113

MON Command SYNTAX: MON PURPOSE: To invoke the Mini– Monitor REMARK S: The Mini– Monitor is used primarily for debugging object code programs. Its use…

Página 114 - NEW and UNNEW

NEW and UNNEW Commands SYNTAX: NEW UNNEW PURPOSE: NEW initializes CAMBASIC for a new program. UNNEW restor es a program erased b y NEW or a hardw are…

Página 115

ON Statement SYNTAX: ON expression GOSUB line [,line] ... ON expression GOTO line [,line] ... PURPOSE: In the ON. .. GOT O statement, the value of the…

Página 116

ON BIT Tasking Statement SYNTAX: ON BIT task numbe r,ad dress, bit GOS UB line/label PURPOSE: To declare an I/ O line to be m onitored fo r changes in…

Página 117

ON COM$ Tasking Statement SYNTAX: ON COM$ n GOS UB line/label ON COM$ n GOSUB PURPOSE: To define a program branch when a task defined by the CONFIG…

Página 118 - ON COUNT

ON COUNT Tasking Statement SYNTAX: ON COUNT n GOSUB line/label ON COUNT n GOSUB PURPOSE: To execute a subroutine when a preset count is reached.…

Página 119 - ON ERR GOTO

ON ERR GOTO Statement SYNTAX: ON ERR GOTO line/label PURPOSE: To enable error trapping and specify the first line of the error handling subroutine.…

Página 120

ON INP Tasking Statement SYNTAX: ON INP n, address, mask, compare GOSUB line/label PURPOSE: To cause an interr upt when a preset inpu t bit pattern is…

Página 121

ON ITR Tasking Statement SYNTAX: ON ITR n GOSUB line/label ON ITR n GOSUB PURPOSE: To enable or disable a progr am br anch due to an hardw are inter…

Página 122 - ON KEYPAD$

ON KEYPAD$ Tasking Statement SYNTAX: ON KEY PAD $ GO SUB line/label ON KEYPAD$ GOSUB ON KEYPAD $ size GOSUB line/lable ON KEYPAD $ size GOSUB PURPOSE…

Página 123

ON TICK Tasking Statement SYNTAX: ON TICK n,t GOSUB line/label ON TICK n,t GOSUB PURPOSE: To cause periodic program branching. REMARK S: This…

Página 124

OPTO Process Function SYNTAX: a = OPTO (channel) PURPOSE: To return the status of an input on an on board opto isolator rack. REMARK S: Inputs and…

Página 125

OPTO Process Statement SYNTAX: OPTO channel, value PURPOSE: To turn output modules on and off on 24 position opto-isolator racks that are external to…

Página 126

OUT I/O Statement SYNTAX: OUT I/O address, data PURPOSE: Sends a byte to an I/O address. REMARK S: The I/O addre ss is any on- or off-card address in…

Página 127 - PEEK and POKE

PEEK and POKE Memory Function and Statement SYNTAX: n = PEEK(address) n = PEEK(address,segment) POKE address, data POKE address, data, segm ent…

Página 128 - PEEK$ and POKE$

PEEK$ and POKE$ Memory Function and Statement SYNTAX: x$ = PEEK$(address) x$ = PEEK$(address, segment) POKE $ address, X$ POKE$ address, X$, segment…

Página 129

PRINT Statement PR [#n,] [expression] [; or , ] [expression].. PRINT [#n,] [expression] [; or , ] [expression].. PURPOSE: To output data through the…

Página 130

In the example below, the semicolon at the end of line 20 causes both PRINT statements to be printed on the same line. 10 INPUT X 20 PRINT X; "Squared…

Página 131 - PRINT USING

PRINT USING Statement SYNTAX: PRINT [#n,]USING"format string"; expr ession PURPOSE: To print strings or number s using a specified form at. REMARK S…

Página 132

Leading zeros to the left of the first digit to the left of the decimal point are suppressed. A=25.5555 PRINT #10,USING "##.##";A; 25.56 Note that…

Página 133

PRINT$ Statement SYNTAX: PRINT [#n,] $ character [,character]... PR [#n,] $ character [,character]... PURPOSE: Used to send any char acter fr om 0 to…

Página 134

PULSE Process Function SYNTAX: n= PULSE(m) PURPOSE: To return the r emaining time of a pulsed output. REMARK S: The resolution of the software pulse…

Página 135

PULSE Tasking Statement SYNTAX: PULSE n,a ddress, bit,tim e,p olarity PURPOSE: To configure a digital output line as a timed, or pulsed o utput.…

Página 136

READ Statement SYNTAX: READ variable [,variable] . . . PURPOSE: To read values fr om a D ATA statement and assign them to variables. Se e the DA TA…

Página 137

REMARK Statement SYNTAX: ' any characters PURPOSE: To allow explanator y remarks to be inserted in a progr am or designate a line/ label. REMARK S…

Página 138

RENUM Command SYNTAX: RENUM [newline] [,increment] [,oldline] PURPOSE: To renum ber prog ram lines. REMARK S: newline is the first line number to be…

Página 139

RESTORE Statement SYNTAX: RESTORE [line] PURPOSE: To reset the RE AD pointer to the b eginning of the DAT A list. REMARK S: After a RESTORE statement…

Página 140

RESUME Statement SYNTAX: RESUME NEXT RESUME line PURPOSE: To continue program execution after an error recovery procedure has been performed. REMARK…

Página 141 - RESUME COUNT

RESUME COUNT Tasking Statement SYNTAX: RESUME COUNT m [,m1] [,m2] . . . [,mn] PURPOSE: To reenable a software event counter. REMARK S: The statement…

Página 142

RETURN Statement SYNTAX: RETURN [line/label] RETURN ITR number PURPOSE: To resume execution after a GOSUB, interrupt, multitasking or communications…

Página 143

RIGHT$ String Function SYNTAX: n$ = RIGHT$(m$,p) PURPOSE: To return the r ight– most p characters of m$ as a string. REMARK S: If p is greater than or…

Página 144

RND Numeric Fun ction SYNTAX: n = RND(m) PURPOSE: To return a pseudo– random number between 0 and 1. REMARK S: The RND function returns a pseudo…

Página 145

RUN Command SYNTAX: RUN [line] PURPOSE: To begin the execution of a program. REMARK S: RUN resets the numeric variables to zero, string variables to…

Página 146

SAVE Command SYNTAX: SAVE SAVE program SAVE to Flash segme nt, to Flash address, from RA M segm ent, from RA M addres s, len gth PURPOSE: Saves…

Página 147

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

Página 148

SGN Numeric Fun ction SYNTAX: n = SGN(m) PURPOSE: Determines if number is positive or negative. REMARK S: m is any number. SGN returns the following…

Página 149

SIN Numeric Fun ction SYNTAX: n = SIN(m) PURPOSE: To calculate the trigonometric sine function. REMARK S: m is an angle in radians. To convert degrees…

Página 150

SOUND COMMAND SYNTAX: SOUND frequency SOUND PURPOSE: Gener ates a squar e wave signal at frequency. REMARK S: frequency is from about 8 Hz to about 60…

Página 151

SPI FUNCTION SYNTAX: a = SPI(channel,out_length,data, delay,in_length) Where: channel = 0 to 2, the SPI channel number. out_length = 0 to 16, data…

Página 152

SQR Numeric Fun ction SYNTAX: n = SQR(m) PURPOSE: Calculates the square root of a number. REMARK S: m is any positive number. RELATED: ^ (raise to…

Página 153 - START BIT

START BIT Tasking Statement SYNTAX: START BIT task number [,task number]. . . PURPOSE: To enable a BIT task that has previously been defined with an…

Página 154 - START COUNT

START COUNT Tasking Statement SYNTAX: START COUNT n [,n1] [,nm] PURPOSE: To activate a software counter task that was previously defined. REMARK S…

Página 155 - START INP

START INP Tasking Statement SYNTAX: START INP n [,n1] [,n2] PURPOSE: To enable one or m ore IN P tasks dec lared by the ON INP statement. REMARK S…

Página 156

STOP Statement SYNTAX: STOP PURPOSE: To terminate pr ogram execution and return to comm and level. REMARK S: STOP statements m ay be used anywher e in…

Página 157 - STOP BIT

STOP BIT Tasking Statement SYNTAX: STOP BIT task [,task] . . . PURPOSE: To disable a bit that has previously been defined with an ON BIT statement and…

Página 158 - STOP COUNT

STOP COUNT Tasking Statement SYNTAX: STOP COUNT n [,n1] [,nn] PURPOSE: To deactivate a software counter task that was previously active. REMARK S…

Página 159 - STOP INP

STOP INP Tasking Statement SYNTAX: STOP INP n [,n1] [,n2] PURPOSE: To disable one or m ore IN P tasks declared by the ON INP statement. REMARK S: The…

Página 160

STR$ String Function SYNTAX: n$ = STR$(m) PURPOSE: To convert a number to a string. REMARK S: For positive numbers, the string generated by STR$ has a…

Página 161

SYS System Function SYNTAX: a = SYS(n) PURPOSE: To access system data and addresses. REMARK S: n is the system number. The following is a list of…

Página 162

SYS(3) is used by assembly language programmers to determine jump vector location. SYS(4) and SYS (5) return the status of the console output buffer…

Página 163

TAB Print Function SYNTAX: PRIN T TA B(m) PURPOSE: To tab to position m. REMARK S: m ranges from 0 to 255 If the current print position is at or…

Página 164

TAN Numeric Fun ction SYNTAX: n = TAN(m) PURPOSE: To return the trigonometric tangent of m. REMARK S: The angle m must be in radians. To conver t…

Página 165

TICK Process Function SYNTAX: a= TICK(n) PURPOSE: To return the time from the TICK timers. REMARK S: n is from 0 to 2, corresponding to a tick timer.…

Página 166

TIME$ Function SYNTAX: a$ = TIME$(n) PURPOSE: The TIME$ function is used to read the system calendar/clock. The system clock keeps time on a 24 hour…

Página 167

TIME$ Statement SYNTAX: TIME$ = time string PURPOSE: TIME$ is used to set the time on the system calendar/clock. The clock keeps time on a 24 hour…

Página 168 - TRON/TROFF

TRON/TROFF Statement SYNTAX: TRON TROFF PURPOSE: To trace program execution. REMARK S: Execute TRON to turn on the trace and TROFF to turn the trace…

Página 169

VAL Numeric Fun ction SYNTAX: n = VAL(m$) PURPOSE: To convert a string to a number. REMARK S: The VAL function strips leading spaces fr om m$ before…

Página 170

VARPTR Numeric Fun ction SYNTAX: VARPTR(variable) PURPOSE: To return the address in RAM of the variable. This command is similar to VARPTR found in…

Página 171

Strings ar e stored in tw o ways. A literal str ing (e. g., A$ = "string") is stor ed in the program line in which it appears. Other strings that are…

Página 172

the value returned will not change.

Página 173

XOR Numeric Fun ction SYNTAX: n = a XOR b PURPOSE: Performs bitwise XOR operation on two numbers. XOR'ing is usually performed during I/O operations…

Página 174 - CONFIG AIN

CONFIG C ommands - 1 CONFIG AIN Statement SYNTAX: CONFIG AIN channel, input, range Where: channel is 0 to range of inputs for your card. input…

Página 175 - CONFIG BAUD

CONFIG C ommands - 2 CONFIG BAUD Statement SYNTAX: CONFIG BAUD port,baud rate, mode, parity [,com] PURPOSE: To change the ser ial port param eters.…

Página 176

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

Página 177 - CONFIG BREAK

CONFIG C ommands - 4 CONFIG BREAK Statement SYNTAX: CONF IG BREAK com port,mode PURPOSE: To enable or disable response to a break charac ter on a…

Página 178 - CONFIG CLOCK

CONFIG C ommands - 5 CONFIG CLOCK Statement SYNTAX: CONF IG CLOC K mode,run CONF IG CLOC K run (RPC-2350 series only) PURPOSE: Configures real time…

Página 179 - CONFIG COM$

CONFIG C ommands - 6 CONFIG COM$ Tasking Statement SYNTAX: CONFIG C OM$ n,terminator, length,XON ,echo PURPOSE: To configure a communication port to…

Página 180 - CONFIG COUNT

CONFIG C ommands - 7 CONFIG COUNT Tasking Statement SYNTAX: CONFIG COUNT number,address,bit [,preset] [,AUTO] PURPOSE: To define the characteristics…

Página 181 - CONFIG DISPLAY

CONFIG C ommands - 8 CONFIG DISPLAY Statement SYNTA X: CONFIG DISPLAY address,type,cursor PURPOSE: To install a driver for a display REMARK S: CAM…

Página 182

CONFIG C ommands - 9 EXAMPLE: The example below is for a vacuum florescent 2x20 display. It illustrates both continuous updating and periodic updating…

Página 183 - CONFIG PIO

CONFIG C ommands - 10 CONFIG PIO Statement SYNTAX: CONFIG PIO init,port A, port B, p ort LC, port UC [,address] PURPOSE: To initialize an 82C55…

Página 184 - PROGRAM DEBUGGING

Program debugging - 1 PROGRAM DEBUGGING CAM BASIC has several constructs which can be used to debug a program. This section will outline the methods…

Página 185

Program debugging - 2 50 NEXT 60 TROFF 70 END 80 S = 0 90 INC H 100 RETURN RUN .30..40..90..100..50..40..90..100..50..40..90..100..50..60. USING MON…

Página 186

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

Página 187

Error Messages - 2 NUM MESSAGE EXPLANATION 12 < Illegal imm ediate> A statement that is illegal in Immediate M ode is enter ed as an Im mediate Mode…

Página 189

Error Messages - 4 NUM MESSAGE EXPLANATION 27 < Data > 255> The argument or parameter may not exceed 255. 28 < Data > 65,535> The argument or…

Página 190

Event Multitasking was developed to give faster response to real time events. It is different than the multitasking that was originally designed for…

Página 191 - COM$ TASKING

Between each program statement CAM BASIC checks to see if any interrupt flags are set. If so, it branches to the line number that was specified for…

Página 192 - COUNT MULTITASKING

COUNT MULTITASKING Introduction CAM BASIC supports eight event counters. These ar e generated in software and are intended for low– speed counting.…

Página 193

Theoretically, a 100 Hz square wave can be counted. However, due to sample timing variations (dependent upon other multitasking events), the maximum…

Página 194

The second is the interrupt mode. When the preset count is reached, a software interrupt is generated and the program branches to a subroutine which…

Página 195

NOTE: It is theoretically possible for the subroutine to take so long to execute that another 20 00 counts is reached. In this unlikely case, the…

Página 196 - INP TASKING

Line 110 prints the count in the counter. Line 120 returns execution to the place where the one– second interrupt occurred. You can try this by…

Página 197 - KEYPAD MULTITASKING

40 DELAY .25 50 GOTO 30 60 PRINT "match" 70 RETURN Line 10 defines the INP task 0 to look at address 2. The bits of interest are set by the seven…

Página 198 - Applications Examples

KEYPA D$ function returns either a one– character string that has been assigned to each key or the numerical position of the key. The two variations…

Página 199

Line 80 returns program execution to the place that it was executing before the key was pressed. Inputting Multi– digit Numbers The basic examples…

Página 200

Intercepting these keys in the form of strings provides a slower response than using the key positions. The following program does an instant branch…

Página 201

the COM1 ser ial port. In an actual application, the characters would prob ably be echoed to a multi line display. Enter the data and then press the…

Página 202 - MULTITASKING ON A CLOCK TICK

MULTITASKING ON A CLOCK TICK The three 200 Hz (100 Hz in 9 MHz systems) tick timers are used for a number of multitasking functions in CAMBASIC. In…

Página 203 - PULSE MULTITASKING

PULSE MULTITASKING Introduction CAM BASIC supports eight timed (or pulsed) outputs. These ar e gener ated in softwa re and have a re solution of 5…

Página 204

executed and then go low. The PU LSE function r eturns the rem aining time of each stage. The example below demonstrates this. 10 PULSE 0,0,1,.05,1 30…

Página 205

..emergency 'Emergency stop pressed. Turn off all outputs out 2,255 return ' ..headup 'Head has moved up. Time to move product over pulse 3,2,16,.5,0…

Página 206

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

Página 207 - THE CAMBASIC MINI– MONITOR

Mini-Monitor - 1 THE CAMBASIC MINI– MONITOR The Mini– Monitor is included in CAMBASIC primar ily for those who will be combining object code (either…

Página 208

Mini-Monitor - 2 Edit Memory This routine lets you poke hex values into memor y. For example, to edit at A000, you enter the command below. The “ * ”…

Perguntas sobre Remote-processing CAMBASIC

Ainda não há perguntas sobre este manual. Faça a primeira.

Fazer uma pergunta

Respondemos a partir do manual e indicamos a página. A pergunta é publicada no site depois de verificada.

Todas as perguntas e respostas ›