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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
COPYRIGHT
TRADEMARKS
Ficheiro PDF · ·
Resumo do Conteúdo
COPYRIGHT Copyright 1988-1994 – Octagon Systems and Remote Processing Corp. All rights reserved. Modifications by Remote Processing Cor poration…
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…
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…
Introduction - 1 ABOUT CAMBASIC is the result of 18 years of industrial language development at Octagon. Its major strengths are ease– of– use…
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…
Introduction - 3 13. Process Functions Simplify Programming Most functions return the result of a numeric or string calculation. A process function…
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…
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…
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…
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…
Software and Hardware Interrupts CAMBASIC supports multiple hardware and software interrupts. These interrupts causes the program to branch to an…
AUTORUN OPERATION Once a program has been stored in nonvolatile memory, it can autorun on power – up. PROTECTING YOUR PROGRAMS You can cause your…
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…
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…
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…
> 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…
AND Operand 2
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…
relational operators = (equal) <> (not equal) < (less than) > (greater than) <= (less than or equal to) >= (greater than or equal to) 7. NOT (logical…
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.…
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…
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…
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…
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…
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…
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…
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…
Command Summary - 2 DISPLAY a$ Writes data to display
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=…
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
Command Summary - 5 Command Syntax Purpose PRINT$ PRINT $ char [,char] Prints string of characters PULSE n= PULSE(m) Returns time from pulsed output…
Command Summary - 6
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…
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…
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…
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…
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…
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…
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…
AUTO COMMAND SYNTAX: AUTO [line] [,increment] PURPOSE: Generate a line number automatically each time you press < Enter> after a program line. REMARK…
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…
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…
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…
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…
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…
CALL Statement SYNTAX: CALL address [,m1] [,m2]. . . PURPOSE: To execute an assembly language program at the specified address and, optionally, to…
NOTE2: CAMBASIC internal routines are not accessible by the object code programmer except those listed in the SYS function (if any). NOTE3: The CALL…
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…
CLEAR Statement SYNTAX: CLEAR [string space] PURPOSE: To set all numeric variables to zero, set all string variables to null, restore the data…
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…
CLEAR COUNT Tasking Statement SYNTAX: CLEAR COUNT n [,n1] . . . [,nm] PURPOSE: To clear the accumulated count in a software event counter. REMARK S…
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…
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…
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…
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…
CONFIG Statement SYNTAX: CONFIG com mand [list] PURPOSE: The CONFIG statement is used to set parameters for a number of industrial commands REMARK S…
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…
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…
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…
DATA Statement SYNTAX: DATA constant [,constant] PURPOSE: To provide a means to store numeric and string constants and object code programs. The data…
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…
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…
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…
DELETE Command SYNTAX: DEL [– ] line [– line] [– ] PURPOSE: To delete CA MBASIC program lines. REMARK S: The DEL command erases the specified range of…
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…
DIM Statement SYNTAX: DIM variable (value) [,variable (value)] . . . PURPOSE: To specify the maximum size for array variables and reserve m emory…
DISPLAY Process Statement SYNTAX: DISPLAY data [,][;][ data ] . . . DISPLA Y$ data [,da ta] . . . DISPLA Y! "format";data [,][;] DISPLAY "text"…
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…
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…
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…
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…
DO/UNTIL Statements SYNTAX: DO . . . UNTIL expression is true PURPOSE: To execute a conditional loop structure. REMARK S: The DO/ UNT IL statements…
DPEEK and DPOKE Memory Function and Statement SYNTAX: n = DPEE K(address) n = DPEE K (address, segment) DPOKE address, data DPOKE address, data, segm…
EDIT Command SYNTAX: EDIT line “ . ” PURPOSE: To display a line for editing. REMARK S: The EDIT statement simply displays the line specified, and…
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.…
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…
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…
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…
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/…
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…
FIND Command SYNTAX: FIND argument PURPOSE: Used to locate variables, keyw ords, and labels. REMARK S: This is a useful tool especially in long…
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…
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…
FPEEK and FPOKE Memory Function and Statement SYNTAX: a = FPEE K(address) a = FPEE K(address,segment) FPOKE address, data FPOKE address, data, segm…
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…
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…
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…
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.…
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…
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…
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…
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…
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…
INPUT Statement SYNTAX: INPUT [#n,][;] var [,var] INPUT [#n,][;] "prompt message"; var [,var] INPUT [#n,][; ] "prompt message", var [,var ] PURPOSE…
Commands - 62
INPUT KEYPAD$ Statement SYNTAX: INPUT KEYP AD$ echo port,variable INPUT KEYP AD$ echo port,"text" ,variable INPUT KEYP AD$ echo port, "text" ;variable…
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…
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…
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…
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…
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$…
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.…
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…
LINE Process Statement SYNTAX: LINE terminal #, value PURPOSE: To write directly to the STB-26 terminal board. REMARK S: The terminal # has a…
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…
ERROR: < Line not found> – if line does not exist
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…
LOCK UNLOCK Tasking Statements SYNTAX: LOCK UNLOCK [RETURN] UNLOCK E XIT PURPOSE: To lock out interrupts from time critical portions of a program.…
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…
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…
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$…
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…
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…
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…
ON Statement SYNTAX: ON expression GOSUB line [,line] ... ON expression GOTO line [,line] ... PURPOSE: In the ON. .. GOT O statement, the value of the…
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…
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…
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.…
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.…
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…
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…
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…
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…
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…
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…
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…
PEEK and POKE Memory Function and Statement SYNTAX: n = PEEK(address) n = PEEK(address,segment) POKE address, data POKE address, data, segm ent…
PEEK$ and POKE$ Memory Function and Statement SYNTAX: x$ = PEEK$(address) x$ = PEEK$(address, segment) POKE $ address, X$ POKE$ address, X$, segment…
PRINT Statement PR [#n,] [expression] [; or , ] [expression].. PRINT [#n,] [expression] [; or , ] [expression].. PURPOSE: To output data through the…
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…
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…
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…
PRINT$ Statement SYNTAX: PRINT [#n,] $ character [,character]... PR [#n,] $ character [,character]... PURPOSE: Used to send any char acter fr om 0 to…
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…
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.…
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…
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…
RENUM Command SYNTAX: RENUM [newline] [,increment] [,oldline] PURPOSE: To renum ber prog ram lines. REMARK S: newline is the first line number to be…
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…
RESUME Statement SYNTAX: RESUME NEXT RESUME line PURPOSE: To continue program execution after an error recovery procedure has been performed. REMARK…
RESUME COUNT Tasking Statement SYNTAX: RESUME COUNT m [,m1] [,m2] . . . [,mn] PURPOSE: To reenable a software event counter. REMARK S: The statement…
RETURN Statement SYNTAX: RETURN [line/label] RETURN ITR number PURPOSE: To resume execution after a GOSUB, interrupt, multitasking or communications…
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…
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…
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…
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…
< 21> < Hardw are> - If Flash EPROM or jumper missing or bad F lash
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…
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…
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…
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…
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…
START BIT Tasking Statement SYNTAX: START BIT task number [,task number]. . . PURPOSE: To enable a BIT task that has previously been defined with an…
START COUNT Tasking Statement SYNTAX: START COUNT n [,n1] [,nm] PURPOSE: To activate a software counter task that was previously defined. REMARK S…
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…
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…
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…
STOP COUNT Tasking Statement SYNTAX: STOP COUNT n [,n1] [,nn] PURPOSE: To deactivate a software counter task that was previously active. REMARK S…
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…
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…
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…
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…
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…
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…
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.…
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…
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…
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…
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…
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…
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…
the value returned will not change.
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…
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…
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.…
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…
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…
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…
CONFIG C ommands - 6 CONFIG COM$ Tasking Statement SYNTAX: CONFIG C OM$ n,terminator, length,XON ,echo PURPOSE: To configure a communication port to…
CONFIG C ommands - 7 CONFIG COUNT Tasking Statement SYNTAX: CONFIG COUNT number,address,bit [,preset] [,AUTO] PURPOSE: To define the characteristics…
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…
CONFIG C ommands - 9 EXAMPLE: The example below is for a vacuum florescent 2x20 display. It illustrates both continuous updating and periodic updating…
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…
Program debugging - 1 PROGRAM DEBUGGING CAM BASIC has several constructs which can be used to debug a program. This section will outline the methods…
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…
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…
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…
Error Messages - 3
Error Messages - 4 NUM MESSAGE EXPLANATION 27 < Data > 255> The argument or parameter may not exceed 255. 28 < Data > 65,535> The argument or…
Event Multitasking was developed to give faster response to real time events. It is different than the multitasking that was originally designed for…
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…
COUNT MULTITASKING Introduction CAM BASIC supports eight event counters. These ar e generated in software and are intended for low– speed counting.…
Theoretically, a 100 Hz square wave can be counted. However, due to sample timing variations (dependent upon other multitasking events), the maximum…
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…
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…
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…
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…
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…
Line 80 returns program execution to the place that it was executing before the key was pressed. Inputting Multi– digit Numbers The basic examples…
Intercepting these keys in the form of strings provides a slower response than using the key positions. The following program does an instant branch…
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…
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…
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…
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…
..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…
Differences - 1 DIFFERENCES—CAMBASIC vs QBASIC 1. CAM BASIC is a multitasking language while the others are not. This adds features to the language…
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…
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.