Rockwell-automation 1746-BAS BASIC LANGUAGE User Manual

Browse online or download User Manual for Equipment Rockwell-automation 1746-BAS BASIC LANGUAGE. Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 280
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews

Summary of Contents

Page 1 - BASIC Language

BASIC Language(Catalog Numbers 1746-BAS and 1746-BAS-T)Reference Manual

Page 2 - Information

Publication 1746-RM001A-US-P P-2Purpose of this ManualThis manual is a reference guide for programming the BASIC or BASIC-T module. This manua

Page 3 - Table of Contents

Publication 1746-RM001A-US-P8-4 Execution Control and Interrupt Support FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM ENABLE PROCESSOR IN

Page 4 - Table of Contents ii

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-5The POP shows the status of the SLC processor:• 0 - SLC proce

Page 5 - Table of Contents iii

Publication 1746-RM001A-US-P8-6 Execution Control and Interrupt Support FunctionsIf you perform an XBY in the error routine, this is a list of

Page 6 - Chapter 12

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-7SyntaxPUSH [0 or 1]CALL 38Example>1 REM EXAMPLE PROGRAM>

Page 7 - Table of Contents v

Publication 1746-RM001A-US-P8-8 Execution Control and Interrupt Support FunctionsCALL 70 – ROM to RAM Program TransferPurposeUse CALL 70 to shi

Page 8 - Table of Contents vi

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-9CALL 71 – ROM/RAM to ROM Program TransferPurposeUse CALL 71 to

Page 9 - Who Should Use This

Publication 1746-RM001A-US-P8-10 Execution Control and Interrupt Support FunctionsSyntaxCALL 72ExampleProgram in ROM 1>1 REM EXAMPLE PROGRAM

Page 10 - Purpose of this Manual

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-11GOSUBPurposeUse the GOSUB statement to cause the module to tr

Page 11 - How to Use this Manual

Publication 1746-RM001A-US-P8-12 Execution Control and Interrupt Support Functions>20 GOSUB 100>30 NEXT I>40 END>100 REM USER SUBRO

Page 12 - Conventions Used in this

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-13Example>1 REM EXAMPLE PROGRAM>10 ONERR 500>20 FORI=5

Page 13 - Rockwell Automation

Publication 1746-RM001A-US-P P-3Related DocumentationThe following documents contain additional information regarding Rockwell Automation produ

Page 14 - P-6

Publication 1746-RM001A-US-P8-14 Execution Control and Interrupt Support FunctionsON-GOSUBPurposeUse the ON-GOSUB statement to transfer control

Page 15 - Language Elements

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-15Example>1 REM EXAMPLE PROGRAM>10 TIME = 0>15 DBY(71)

Page 16 - BASIC Line Length

Publication 1746-RM001A-US-P8-16 Execution Control and Interrupt Support FunctionsYou can push more than one expression onto the argument stack

Page 17 - Data Types

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-17POPPurposeUse the POP statement to remove values from the mod

Page 18 - Example 3

Publication 1746-RM001A-US-P8-18 Execution Control and Interrupt Support FunctionsRETIPurposeUse the RETI statement to exit from an interrupt (

Page 19 - Numeric Data Types

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-19ExamplesSimple Subroutine>1 REM EXAMPLE PROGRAM>10 FORI

Page 20 - Variables

Publication 1746-RM001A-US-P8-20 Execution Control and Interrupt Support FunctionsSTOPPurposeUse the STOP statement to break program execution

Page 21 - Variable Types

1 Publication 1746-RM001A-US-PChapter 9Math and Backplane Conversion FunctionsThis chapter describes and illustrates commands that convert numbers bet

Page 22 - 2-6 Data Types

Publication 1746-RM001A-US-P9-2 Math and Backplane Conversion FunctionsCALL 15 – 16-Bit Unsigned Integer to BASIC Floating-PointPurposeUse CALL

Page 23 - Expressions and Operators

Publication 1746-RM001A-US-PMath and Backplane Conversion Functions 9-3SyntaxPUSH [value to be converted]PUSH [word number of module output buf

Page 24 - Operators

Publication 1746-RM001A-US-P P-4Terms and AbbreviationsThe following terms and abbreviations are specific to this product. For a complete list

Page 25 - Arithmetic Operators

Publication 1746-RM001A-US-P9-4 Math and Backplane Conversion FunctionsExample>1 REM EXAMPLE PROGRAM>40 PUSH 9E+1 : REM THE VALUE TO BE C

Page 26 - Negation ( - )

Publication 1746-RM001A-US-PMath and Backplane Conversion Functions 9-5SyntaxThis routine has two input arguments and no output arguments. The

Page 27 - Overflow and Division by Zero

Publication 1746-RM001A-US-P9-6 Math and Backplane Conversion FunctionsSLC floating-point numbers are stored in two 16-bit words.SyntaxThis rou

Page 28 - Logical Operators

1 Publication 1746-RM001A-US-PChapter 10Clock/Calendar FunctionsThis chapter describes and illustrates commands that set and display the real time clo

Page 29 - Relational Operators

Publication 1746-RM001A-US-P10-2 Clock/Calendar FunctionsExampleProgram the wall clock for 1:35 P.M. (programmed as 13:35; only a 24-hour clock

Page 30 - Trigonometric Operators

Publication 1746-RM001A-US-PClock/Calendar Functions 10-3ExampleProgram the clock/calendar for the 16th day of June 1991.>1 REM EXAMPLE PROG

Page 31 - Functional Operators

Publication 1746-RM001A-US-P10-4 Clock/Calendar FunctionsCALL 43 – Retrieve Date/Time StringPurposeUse CALL 43 to return the current date and t

Page 32 - SQR([expr])

Publication 1746-RM001A-US-PClock/Calendar Functions 10-5Example>1 REM EXAMPLE PROGRAM>10 REM DATE RETRIEVE - NUMERIC EXAMPLE>20 CALL

Page 33 - Logarithmic Operators

Publication 1746-RM001A-US-P10-6 Clock/Calendar FunctionsCALL 46 – Retrieve Time NumericPurposeUse CALL 46 to return the time of day in numeric

Page 34 - String Operators

Publication 1746-RM001A-US-PClock/Calendar Functions 10-7>20 PUSH 0 :CALL 47>30 PRINT “TODAY IS ”,$(0)READY>RUNTODAY IS FRIREADY>CA

Page 35

Publication 1746-RM001A-US-P P-5Rockwell Automation SupportAllen-Bradley offers support services worldwide, with over 75 Sales/Support Offices,

Page 36 - CHR([expr])

Publication 1746-RM001A-US-P10-8 Clock/Calendar FunctionsSyntaxPUSH [string number]CALL 52Example>1 REM EXAMPLE PROGRAM>10 STRING 100,20&

Page 37 - Special Function

1 Publication 1746-RM001A-US-PChapter 11Status FunctionsThis chapter describes and illustrates commands that monitor the status of the BASIC or BASIC-

Page 38 - DBY([expr])

Publication 1746-RM001A-US-P11-2 Status FunctionsCALL 36 – Get Number of Characters in PRT2 BuffersPurposeUse CALL 36 to retrieve the number of

Page 39 - XBY([expr])

Publication 1746-RM001A-US-PStatus Functions 11-3CALL 51 – Check CPU Output Image BufferPurposeUse CALL 51 to determine if the SLC 500 controll

Page 40

Publication 1746-RM001A-US-P11-4 Status FunctionsCALL 55 – Check CPU Input Image BufferPurposeUse CALL 55 to determine if the SLC 500 controlle

Page 41 - BASIC Commands

Publication 1746-RM001A-US-PStatus Functions 11-5CALL 58 – Check M0 FilePurposeUse CALL 58 to determine if the Module File M0 located in the mo

Page 42

Publication 1746-RM001A-US-P11-6 Status FunctionsCALL 59 – Check M1 FilePurposeUse CALL 59 to determine if the Module File M1 located in the mo

Page 43

Publication 1746-RM001A-US-PStatus Functions 11-7CALL 75 – Check SLC 500 Controller CPU StatusPurposeUse CALL 75 to check the mode (Run/Program

Page 44 - Control-C

Publication 1746-RM001A-US-P11-8 Status FunctionsCALL 80 – Check Battery ConditionPurposeUse CALL 80 to check the module battery condition. If

Page 45 - Function

Publication 1746-RM001A-US-PStatus Functions 11-9>110 POP X : REM GET THE STATUS>120 IF(X<>1) THEN GOTO 100 : REM WAIT ON THE DATAR

Page 46 - CALL 19 – Disable the

Publication 1746-RM001A-US-P P-6

Page 47 - Control-S

Publication 1746-RM001A-US-P11-10 Status FunctionsCALL 95 – Get Number of Characters in PRT1 Buffers PurposeUse CALL 95 to retrieve the number

Page 48 - Control-Q

Publication 1746-RM001A-US-PStatus Functions 11-11CALL 97 – Enable Port PRT2 DTR SignalPurposeUse CALL 97 to enable the Data Terminal Ready (DT

Page 49

Publication 1746-RM001A-US-P11-12 Status FunctionsCALL 108 – Enable DF1 Driver Communications PurposeUse CALL 108 to enable DF1 driver communic

Page 50

Publication 1746-RM001A-US-PStatus Functions 11-13 IMPORTANTOther port parameters, such as baud rate, number of stop bits, and parity are selec

Page 51

Publication 1746-RM001A-US-P11-14 Status FunctionsHalf-Duplex No Handshaking Modem ControlHalf-duplex no handshaking modem control, selected by

Page 52 - 4-12 BASIC Commands

Publication 1746-RM001A-US-PStatus Functions 11-15Half-Duplex With Continuous Carrier Modem ControlHalf-duplex with continuous carrier modem co

Page 53 - BASIC Commands 4-13

Publication 1746-RM001A-US-P11-16 Status FunctionsFull-Duplex With No HandshakingFull-duplex with no handshaking, selected by operation codes 1

Page 54

Publication 1746-RM001A-US-PStatus Functions 11-17The second input argument specifies the Poll Time-out period when in half-duplex mode or the

Page 55

Publication 1746-RM001A-US-P11-18 Status FunctionsSyntaxPUSH [operational code]PUSH [Poll timeout or ACKnowledge timeout]PUSH [message retries

Page 56 - >PROG1

Publication 1746-RM001A-US-PStatus Functions 11-19that corresponds to the module input and output buffers, as shown in the table below: You mus

Page 57 - >PROG2

1 Publication 1746-RM001A-US-PChapter 1Language ElementsThis chapter introduces you to the elements of a BASIC program. These elements include BASIC:

Page 58

Publication 1746-RM001A-US-P11-20 Status FunctionsSyntaxCALL 121POP [program ID number]Example>1 REM EXAMPLE PROGRAM>10 CALL 121>20 PO

Page 59

1 Publication 1746-RM001A-US-PChapter 12Output FunctionsThis chapter describes and illustrates commands that allow the transfer of data from the BASIC

Page 60

Publication 1746-RM001A-US-P12-2 Output FunctionsCALL 23 – Transfer Data from the CPU Files to Port 1 or 2 PurposeUse CALL 23 to transfer data

Page 61

Publication 1746-RM001A-US-POutput Functions 12-32.2.2.2. The ladder logic program of the SLC processor must set the output file word 0, bit 6

Page 62

Publication 1746-RM001A-US-P12-4 Output FunctionsTransfers continue in this manner until the CALL for the port is re-executed with different in

Page 63 - Variations

Publication 1746-RM001A-US-POutput Functions 12-5The fifth input argument is the byte swap selection. It has the following values:• 0 - Data b

Page 64

Publication 1746-RM001A-US-P12-6 Output FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM ENABLE CALL 23 INTERRUPTS>20 PUSH 2 : REM SEND D

Page 65

Publication 1746-RM001A-US-POutput Functions 12-7If an internal string is chosen, the first character (transaction number) is incremented on su

Page 66 - >XFER

Publication 1746-RM001A-US-P12-8 Output Functions6.6.6.6. The SLC retrieves the status and resets output file word 0, bit 11. The data buffer c

Page 67 - Command Line CALLs

Publication 1746-RM001A-US-POutput Functions 12-9If the file type is not one of these listed below, the status equals 2 and the write message d

Page 68 - Variable Storage

Publication 1746-RM001A-US-P1-2 Language ElementsTypically, the line numbers of a program start out looking like the first column and end up lo

Page 69 - Description

Publication 1746-RM001A-US-P12-10 Output Functionsoffset should not be 0 since this word is reserved for the data transfer handshaking bits. Th

Page 70 - Memory Module Code to

Publication 1746-RM001A-US-POutput Functions 12-11SyntaxPUSH [type of WRITE command] PUSH [remote node address] PUSH [remote file number]PUSH [

Page 71 - Output Buffer and

Publication 1746-RM001A-US-P12-12 Output Functions0000I:20 O:111 OSRB3:00COPCopy FileSource #N7:0Dest #M0:1.0Length 20LO:

Page 72 - Input Buffer and Pointer

Publication 1746-RM001A-US-POutput Functions 12-13CALL 29 – Read/Write to a PLC/SLC from the Module Internal StringPurposeUse CALL 29, in conju

Page 73 - Argument Stack

Publication 1746-RM001A-US-P12-14 Output FunctionsExampleCALL 122 must be enabled with internal string only prior to executing CALL 29 in this

Page 74 - Input Buffer Pointer

Publication 1746-RM001A-US-POutput Functions 12-15CALL 37 – Clear PRT2 Input/Output BuffersPurposeUse CALL 37 to clear the peripheral port inpu

Page 75 - PRT2 Input Queue

Publication 1746-RM001A-US-P12-16 Output FunctionsBit 13 of word 200 is the battery status bit. It can have one of the following values:• 0 -

Page 76

Publication 1746-RM001A-US-POutput Functions 12-17SyntaxPUSH [number of words to be transferred]CALL 57POP [processor mode]Example>1 REM EXA

Page 77 - Assignment Functions

Publication 1746-RM001A-US-P12-18 Output FunctionsExample>1 REM EXAMPLE PROGRAM>40 PUSH 31 : REM OFFSET ADDRESS = 31>50 PUSH 3 : REM W

Page 78

Publication 1746-RM001A-US-POutput Functions 12-19The fifth input argument is the number of elements to be transferred. If the number is not wi

Page 79

1 Publication 1746-RM001A-US-PChapter 2Data TypesThis chapter provides you a method of defining or displaying data within the BASIC programming langua

Page 80

Publication 1746-RM001A-US-P12-20 Output FunctionsThis CALL is implemented as a Protected Typed Logical Write with two address fields.Table 12.

Page 81

Publication 1746-RM001A-US-POutput Functions 12-21SyntaxPUSH [remote device node address]PUSH [remote device file number]PUSH [remote device fi

Page 82

Publication 1746-RM001A-US-P12-22 Output FunctionsCALL 93 – Write Output Buffer to Remote DH485 Common Interface FilePurposeUse CALL 93 to writ

Page 83

Publication 1746-RM001A-US-POutput Functions 12-23SyntaxPUSH [remote device node address]PUSH [starting element offset (x2) of remote device fi

Page 84

Publication 1746-RM001A-US-P12-24 Output FunctionsExample>1 REM EXAMPLE PROGRAM>30 PUSH 1 : REM REMOTE NODE ADDRESS = 1>40 PUSH 0 : RE

Page 85 - Control Functions

Publication 1746-RM001A-US-POutput Functions 12-25SyntaxPUSH [buffer selection]CALL 96Example>1 REM EXAMPLE PROGRAM>10 PUSH 0 : CALL 96 :

Page 86

Publication 1746-RM001A-US-P12-26 Output FunctionsExample>1 REM EXAMPLE PROGRAM>100 PUSH 1 : REM TURN ON LED1>110 PUSH 0 : REM TURN OF

Page 87 - DO-WHILE

Publication 1746-RM001A-US-POutput Functions 12-27Example>1 REM EXAMPLE PROGRAM>10 CALL 114>20 ENDCALL 115 – Check DF1 XMIT Status Pur

Page 88 - DO-UNTIL

Publication 1746-RM001A-US-P12-28 Output FunctionsCALL 123 – Write to Remote DF1 PLC Data FilePurposeUse CALL 123 to write up to 64 words of da

Page 89

Publication 1746-RM001A-US-POutput Functions 12-293.3.3.3. The module places the status of the transaction in input file word 1, bits 0-7.4.4.4

Page 90 - FOR-TO-(STEP)-NEXT

Publication 1746-RM001A-US-P2-2 Data TypesWhen allocating memory for a string, you must account for the overhead bytes used by BASIC to manipul

Page 91

Publication 1746-RM001A-US-P12-30 Output FunctionsThe second input argument is the decimal node address of the PLC remote device (0 through 254

Page 92 - IF-THEN-ELSE

Publication 1746-RM001A-US-POutput Functions 12-31The seventh input argument is the message time-out value. This value (1 through 255) correspo

Page 93

Publication 1746-RM001A-US-P12-32 Output FunctionsTable 12.11 Transaction Status CodesCode Indicates0 Transfer OK.1 Transmission failed.2 Enqui

Page 94

Publication 1746-RM001A-US-POutput Functions 12-33SyntaxPUSH [type of PLC WRITE command] PUSH [remote PLC node address] PUSH [file number of re

Page 95

Publication 1746-RM001A-US-P12-34 Output FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM ENABLE DF1 PLC REMOTE WRITE COMMAND>20 PUSH 5 :

Page 96 - 7-12 Control Functions

Publication 1746-RM001A-US-POutput Functions 12-35PRINTPurposeUse the PRINT statement to direct the module to output a value to the console dev

Page 97 - Functions

Publication 1746-RM001A-US-P12-36 Output FunctionsUse the PRINT CR expression to output a carriage return without a line feed. >1 REM EXAMPL

Page 98 - Packet Interrupt

Publication 1746-RM001A-US-POutput Functions 12-37>1 REM EXAMPLE PROGRAM>10 PRINT USING(###.##),>20 PRINT 4.67890, 123.456>30 PRINT

Page 99 - CALL 20 – Enable

Publication 1746-RM001A-US-P12-38 Output FunctionsSyntaxPH0., PH1.Example>PH0.2*204H>PH1.2*20004H>PH0. 10064H>PH0. 10003E8H>PH1.

Page 100 - Interrupt

Publication 1746-RM001A-US-POutput Functions 12-39P. MTOP-10*624455>PUSH 24455 : CALL 77>P. MTOP24455>1 REM EXAMPLE PROGRAM>5 DIM A

Page 101 - ONERR Restart

Publication 1746-RM001A-US-PData Types 2-3Numeric Data TypesThere are two different numeric data types:• integer numbers• floating-point numb

Page 102 - Publication 1746-RM001A-US-P

Publication 1746-RM001A-US-P12-40 Output Functions

Page 103 - PUSH [0 or 1]

1 Publication 1746-RM001A-US-PChapter 13Input FunctionsThis chapter describes and illustrates commands that allow the BASIC or BASIC-T module to read

Page 104 - Program Transfer

Publication 1746-RM001A-US-P13-2 Input FunctionsCALL 22 – Transfer Data from Port 1 or 2 to the CPU FilesPurposeUse CALL 22 to transfer data fr

Page 105 - CALL 72 – RAM/ROM

Publication 1746-RM001A-US-PInput Functions 13-32.2.2.2. The module places the byte count of the valid data into the lower byte of the first a

Page 106 - With ROM 1 selected:

Publication 1746-RM001A-US-P13-4 Input Functions6.6.6.6. The ladder logic program of the SLC resets output file word 0, bit 8 or bit 9. The mo

Page 107 - Examples

Publication 1746-RM001A-US-PInput Functions 13-5The third input argument is the decimal value of the ASCII character delimiter. Any valid ASCII

Page 108

Publication 1746-RM001A-US-P13-6 Input FunctionsThe last CALL 22 or CALL 23 executed determines the byte swap option for all active CALL 22 com

Page 109

Publication 1746-RM001A-US-PInput Functions 13-7Example>1 REM EXAMPLE PROGRAM>10 REM ENABLE CALL 22 INTERRUPTS>20 PUSH 1 : REM PRT1 AC

Page 110 - ON-GOSUB

Publication 1746-RM001A-US-P13-8 Input FunctionsCALL 27 – Read Remote DH485 SLC Data FilePurposeUse CALL 27 to read up to 64 words of data from

Page 111

Publication 1746-RM001A-US-PInput Functions 13-94.4.4.4. The module places the status in the input file word 1, bits 0-7.5.5.5.5. The module

Page 112

Important User InformationBecause of the variety of uses for the products described in this publication, those responsible for the application and use

Page 113

Publication 1746-RM001A-US-P2-4 Data TypesBackplane Conversion DataThe module communicates with the local processor through the SLC 500 I/O bac

Page 114

Publication 1746-RM001A-US-P13-10 Input FunctionsThe first input argument is the type of SLC READ command issued:• 0 - Disable the previously

Page 115

Publication 1746-RM001A-US-PInput Functions 13-11The seventh input argument is the message time-out value. This value (1 through 255) correspon

Page 116

Publication 1746-RM001A-US-P13-12 Input FunctionsWhenever an attempt is made to read a remote packet, the status of the read is placed into inp

Page 117 - Floating-Point

Publication 1746-RM001A-US-PInput Functions 13-13CALL 29 – Read/Write to a PLC/SLC from the Module Internal StringPurposeUse CALL 29, in conjun

Page 118

Publication 1746-RM001A-US-P13-14 Input FunctionsWhen CALL 29 is executed, the transfer is attempted. If the selected CALL (27, 28, 122, or 123

Page 119 - Floating-Point to 16-Bit

Publication 1746-RM001A-US-PInput Functions 13-15CALL 35 – Get Numeric Input Character from PRT2PurposeUse CALL 35 to retrieve the current char

Page 120 - Floating-Point to SLC

Publication 1746-RM001A-US-P13-16 Input FunctionsExample 2>1 REM EXAMPLE PROGRAM>10 REM PERIPHERAL PORT INPUT USING CALL 35>20 STRING

Page 121 - Floating-Point to BASIC

Publication 1746-RM001A-US-PInput Functions 13-17CALL 53 – Transfer CPU Output Image to BASIC Input BufferPurposeUse CALL 53 to transfer words

Page 122 - IMPORTANT

Publication 1746-RM001A-US-P13-18 Input FunctionsCALL 56 – Transfer CPU M0 File to BASIC Input BufferPurposeUse CALL 56 to transfer up to 64 wo

Page 123 - Clock/Calendar Functions

Publication 1746-RM001A-US-PInput Functions 13-19CALL 84 – Transfer DH485 Interface File to BASIC Input BufferPurposeUse CALL 84 to transfer up

Page 124 - Calendar Date

Publication 1746-RM001A-US-PData Types 2-5Variable NamesVariables may represent either numeric values or strings. Variable names can only be ei

Page 125 - CALL 42 – Set Day of

Publication 1746-RM001A-US-P13-20 Input FunctionsCALL 90 – Read Remote DH485 Data File to BASIC Input BufferPurposeUse CALL 90 to read up to 40

Page 126 - CALL 44 – Retrieve Date

Publication 1746-RM001A-US-PInput Functions 13-21The sixth input argument is the message time-out value. This value is the number of hundreds o

Page 127 - CALL 45 – Retrieve Time

Publication 1746-RM001A-US-P13-22 Input FunctionsSyntaxPUSH [remote device node address]PUSH [remote device file number]PUSH [remote device fil

Page 128 - CALL 47 – Retrieve Day

Publication 1746-RM001A-US-PInput Functions 13-23CALL 92 – Read Remote DH485 Common Interface File to BASIC Input BufferPurposeUse CALL 92 to r

Page 129 - CALL 52 – Retrieve Date

Publication 1746-RM001A-US-P13-24 Input FunctionsSyntaxPUSH [remote device node address]PUSH [starting element offset (x2) of remote device fil

Page 130 - PUSH [string number]

Publication 1746-RM001A-US-PInput Functions 13-25Example>1 REM EXAMPLE PROGRAM>30 PUSH 1 : REM REMOTE NODE ADDRESS = 1>40 PUSH 0 : REM

Page 131 - Status Functions

Publication 1746-RM001A-US-P13-26 Input FunctionsCALL 118 – PLC/SLC Unsolicited WritesPurposeUse CALL 118 to allow the module to receive data p

Page 132 - Characters in PRT2

Publication 1746-RM001A-US-PInput Functions 13-273.3.3.3. The module places the byte count into the lower byte of the first available word of

Page 133 - Output Image Buffer

Publication 1746-RM001A-US-P13-28 Input FunctionsThe SLC processor must not set, then reset, the output file word 0, bit 12 on the same ladder

Page 134 - Input Image Buffer

Publication 1746-RM001A-US-PInput Functions 13-29If the DH485 port is used for data transfer, an offset of greater than 40 hex (64 decimal) wor

Page 135 - CALL 58 – Check M0 File

Publication 1746-RM001A-US-P2-6 Data Types

Page 136 - CALL 59 – Check M1 File

Publication 1746-RM001A-US-P13-30 Input FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM ENABLE PLC/SLC UNSOLICITED WRITE INTERRUPT>20 PU

Page 137 - Controller CPU Status

Publication 1746-RM001A-US-PInput Functions 13-31If an internal string is chosen, the first character (transaction number) is incremented upon

Page 138 - Write Status

Publication 1746-RM001A-US-P13-32 Input Functions5.5.5.5. The module sets the input file word 0, bit 10 to inform the SLC processor that valid

Page 139 - Read Status

Publication 1746-RM001A-US-PInput Functions 13-33The third input argument is the file number to be read on the PLC remote device (0 through 255

Page 140 - Buffers

Publication 1746-RM001A-US-P13-34 Input FunctionsThe seventh input argument is the message time-out value. This value (1 through 255) correspon

Page 141 - CALL 98 – Disable Port

Publication 1746-RM001A-US-PInput Functions 13-35The output argument is the status of the CALL. It has the following values:• 0 – Successful •

Page 142 - Driver Communications

Publication 1746-RM001A-US-P13-36 Input FunctionsC5 Illegal address format – symbol is 0 or greater than the maximum number of characters suppo

Page 143 - Status Functions 11-13

Publication 1746-RM001A-US-PInput Functions 13-37SyntaxPUSH [type of PLC READ command] PUSH [remote PLC node address] PUSH [file number of remo

Page 144 - 11-14 Status Functions

Publication 1746-RM001A-US-P13-38 Input FunctionsGETPurposeUse the GET operator in the Run mode. It returns a result of zero in the Command mod

Page 145 - Status Functions 11-15

Publication 1746-RM001A-US-PInput Functions 13-39SyntaxGETExample>1 REM EXAMPLE PROGRAM>10A=GET>20 IF (A<>0) THEN PRINT A : REM

Page 146 - Full-Duplex Modem (FDM)

1 Publication 1746-RM001A-US-PChapter 3Expressions and OperatorsThis chapter describes and illustrates how you manipulate and/or evaluate expressions

Page 147 - Status Functions 11-17

Publication 1746-RM001A-US-P13-40 Input FunctionsExample>1 REM EXAMPLE PROGRAM>10 STRING 270,254 : REM ONE STRING OF < 254 BYTES>20

Page 148 - Input and Output Buffers

Publication 1746-RM001A-US-PInput Functions 13-41SyntaxINPUTExamples>INPUT A,C>INPUT A,C causes a question mark (?) to print on the conso

Page 149 - Processor Program ID

Publication 1746-RM001A-US-P13-42 Input FunctionsENTER A NUMBER - 255READY>You can also assign strings with an INPUT statement. Strings are

Page 150 - POP [program ID number]

Publication 1746-RM001A-US-PInput Functions 13-43LD@PurposeUse the LD@ statement to retrieve floating point numbers that were stored with a ST@

Page 151 - Output Functions

Publication 1746-RM001A-US-P13-44 Input FunctionsREADY>RUN 20212223242526272829READY>PUSH 5FFFH : CALL 77>P. MTOP24575

Page 152 - Port 1 or 2

Publication 1746-RM001A-US-PInput Functions 13-45READPurposeUse the READ statement to retrieve the expressions that are specified in the DATA s

Page 153

Publication 1746-RM001A-US-P13-46 Input Functions

Page 154 - 12-4 Output Functions

1 Publication 1746-RM001A-US-PChapter 14Setup FunctionsThis chapter describes and illustrates commands used to set port parameters within the BASIC pr

Page 155 - Output Functions 12-5

Publication 1746-RM001A-US-P14-2 Setup FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM CALL 30 INPUT PARAMETERS:>20 REM FIRST PUSH : 5,

Page 156 - Remote DH485 SLC Data

Publication 1746-RM001A-US-PSetup Functions 14-3SyntaxPUSH [baud rate]CALL 78Example>1 REM EXAMPLE PROGRAM>10 PUSH 4800>20 CALL 78CALL

Page 157

Publication 1746-RM001A-US-P3-2 Expressions and OperatorsExpressions and OperatorsAn expression is a logical mathematical expression that invol

Page 158 - • 2 - SLC Typed Write

Publication 1746-RM001A-US-P14-4 Setup FunctionsCALL 105 – Reset PRT1 to Default SettingsPurposeUse CALL 105 to reset the port parameters of po

Page 159 - • 2 - Internal string

Publication 1746-RM001A-US-PSetup Functions 14-5MODEPurposeUse the MODE command to set the port parameters of ports PRT1, PRT2, and DH485. The

Page 160 - handshaking

Publication 1746-RM001A-US-P14-6 Setup FunctionsSyntaxMODE (port name, baud rate, arg1, arg2, arg3, arg4, arg5)Example>1 REM EXAMPLE PROGRAM

Page 161 - >1 REM EXAMPLE PROGRAM

1 Publication 1746-RM001A-US-PChapter 15String FunctionsThis chapter describes and illustrates commands used to manipulate string data structures with

Page 162

Publication 1746-RM001A-US-P15-2 String FunctionsExample>1 REM EXAMPLE PROGRAM>10 REM STRING REPEAT EXAMPLE PROGRAM>20 STRING 200,48&g

Page 163 - Module Internal String

Publication 1746-RM001A-US-PString Functions 15-3Example>1 REM EXAMPLE PROGRAM>10 STRING 200,20>20 $(1) = “How are ”>30 $(2) = “you

Page 164 - Current PRT2 Port Setup

Publication 1746-RM001A-US-P15-4 String FunctionsExample>1 REM EXAMPLE PROGRAM>10 STRING 100,14>20 INPUT “ENTER A NUMBER TO CONVERT TO

Page 165 - CPU Input Image

Publication 1746-RM001A-US-PString Functions 15-5Example>1 REM EXAMPLE PROGRAM>20 INPUT “INPUT A STRING TO CONVERT ”,$(1)>30 PUSH 1 :

Page 166 - CPU M1 File

Publication 1746-RM001A-US-P15-6 String FunctionsCALL 64 – Find a String in a String PurposeUse CALL 64 to find a string within a string. It lo

Page 167 - Interface File

Publication 1746-RM001A-US-PString Functions 15-7CALL 65 – Replace a String in a String PurposeUse CALL 65 to replace a string within a string.

Page 168 - DH485 Data File

Publication 1746-RM001A-US-PExpressions and Operators 3-3Hierarchy of OperatorsThe hierarchy of operators is the order that the operations in a

Page 169 - Output Functions 12-19

Publication 1746-RM001A-US-P15-8 String FunctionsCALL 66 – Insert a String in a String PurposeUse CALL 66 to insert a string within another str

Page 170 - 12-20 Output Functions

Publication 1746-RM001A-US-PString Functions 15-9CALL 67 – Delete a String in a String PurposeUse CALL 67 to delete a string from within anothe

Page 171

Publication 1746-RM001A-US-P15-10 String FunctionsCALL 68 – Find the Length of a String PurposeUse CALL 68 to determine the length of a string.

Page 172 - Common Interface File

Publication 1746-RM001A-US-PString Functions 15-11STRINGPurposeUse the STRING statement to allocate memory for strings. Initially, no memory is

Page 173 - Output Functions 12-23

Publication 1746-RM001A-US-P15-12 String FunctionsExamples>1 REM EXAMPLE PROGRAM>10 STRING 100,30>20 $(0) = “-----MONTHLY REPORT-----”

Page 174 - CALL 96 – Clear PRT1

1 Publication 1746-RM001A-US-PAppendix ADecimal/Hexadecimal/Octal/ASCIIConversion TableMathematical Conversion OverviewThe table below lists the decim

Page 175 - CALL 112 – User LED

Publication 1746-RM001A-US-PA-2 Decimal/Hexadecimal/Octal/ASCII Conversion Table

Page 176 - CALL 114 – Transmit DF1

1 Publication 1746-RM001A-US-PAppendix BBASIC Command, Statement, and CALL Quick Reference GuideMnemonic List OverviewThe table below lists the variou

Page 177 - XMIT Status

Publication 1746-RM001A-US-PB-2 BASIC Command, Statement, and CALL Quick Reference GuideCALL 24 PUSH [value to be converted]PUSH [word number o

Page 178 - Remote DF1 PLC Data

Publication 1746-RM001A-US-PBASIC Command, Statement, and CALL Quick Reference Guide B-3CALL 40 PUSH [hours]PUSH [minutes]PUSH [seconds]Set clo

Page 179

Publication 1746-RM001A-US-P3-4 Expressions and OperatorsDivide ( / )Use the Division operator to divide the first expression by the second exp

Page 180 - on the PLC-2

Publication 1746-RM001A-US-PB-4 BASIC Command, Statement, and CALL Quick Reference GuideCALL 64 PUSH [string number to be found]PUSH [base stri

Page 181 - Output Functions 12-31

Publication 1746-RM001A-US-PBASIC Command, Statement, and CALL Quick Reference Guide B-5CALL 90 PUSH [remote device node address]PUSH [remote d

Page 182 - 12-32 Output Functions

Publication 1746-RM001A-US-PB-6 BASIC Command, Statement, and CALL Quick Reference GuideCALL 108 PUSH [operational code]PUSH [poll timeout or A

Page 183 - Output Functions 12-33

Publication 1746-RM001A-US-PBASIC Command, Statement, and CALL Quick Reference Guide B-7CALL 123 PUSH [type of PLC WRITE command]PUSH [remote P

Page 184

Publication 1746-RM001A-US-PB-8 BASIC Command, Statement, and CALL Quick Reference GuideGET Read console input device. 13-38GET# Read console i

Page 185

Publication 1746-RM001A-US-PBASIC Command, Statement, and CALL Quick Reference Guide B-9ONERR Go to line number when an error is detected. 8-12

Page 186

Publication 1746-RM001A-US-PB-10 BASIC Command, Statement, and CALL Quick Reference GuideREM Specify a remark or comment line. 4-19REN Renumber

Page 187 - PH0., PH1

Publication 1746-RM001A-US-PIndexSymbols# and @quick reference guide B-10special function operator 3-15.AND.logical operator 3-6quick reference guide

Page 188

Publication 1746-RM001A-US-Pii IndexCALL 112 - User LED Controloutput function 12-25quick reference guide B-6CALL 113 - Disable DF1 Driver Comm

Page 189

Publication 1746-RM001A-US-PIndex iiiCALL 37 - Clear PRT2 Input/Output Buffersoutput function 12-15quick reference guide B-2CALL 38 - Expanded

Page 190 - 12-40 Output Functions

Publication 1746-RM001A-US-PExpressions and Operators 3-5Overflow and Division by ZeroDuring the evaluation of an expression if an overflow, un

Page 191 - Input Functions

Publication 1746-RM001A-US-Piv IndexCALL 73 - Battery-Backed RAM Disablecommand line CALL 5-1quick reference guide B-4CALL 74 - Battery-Backed

Page 192 - CPU Files

Publication 1746-RM001A-US-PIndex vCLEARSassignment function 6-3quick reference guide B-7clock/calendar functionretrieve date numeric 10-4retri

Page 193

Publication 1746-RM001A-US-Pvi IndexDisableControl-C 4-6DF1 Driver Communications 11-18DF1 Packet Interrupt 8-3Port PRT2 DTR Signal 11-11Proces

Page 194

Publication 1746-RM001A-US-PIndex viiHhierarchy of operations 3-3IIDLEBASIC command 4-10quick reference guide B-8IF-THEN-ELSEcontrol function 7

Page 195 - Input Functions 13-5

Publication 1746-RM001A-US-Pviii IndexMTOPquick reference guide B-8special function operator 3-16Multiply (*)arithmetic operator 3-4quick refer

Page 196 - 13-6 Input Functions

Publication 1746-RM001A-US-PIndex ixPRINT@output function 12-35quick reference guide B-9Processor Interruptdisable 8-4enable 8-3PROGBASIC comma

Page 197

Publication 1746-RM001A-US-Px IndexROM/RAM to ROM Program Transfer 8-9RROMBASIC command 4-21quick reference guide B-10RS-232 network 13-2RS-422

Page 198 - DH485 SLC Data File

Publication 1746-RM001A-US-PIndex xiUUnsolicited Writes 13-26Upload User Memory Module Code to Host 5-4User LED Control 12-25User Memory Module

Page 199

Publication 1746-RM001A-US-Pxii Index

Page 201 - Input Functions 13-11

Publication 1746-RM001A-US-P3-6 Expressions and OperatorsLogical OperatorsThe module contains a complete set of logical operators that are divi

Page 202

Publication 1746-RM001A-US-P - April 2000 13Supercedes Publication 1746-6.3 - November 1994 © 2000 Rockwell International Corporation. Printed in the

Page 203

Publication 1746-RM001A-US-PExpressions and Operators 3-7Relational OperatorsRelational expressions involve the operators =, < >, >, &

Page 204 - • 0 – Successful completion

i Publication 1746-RM001A-US-PTable of ContentsPrefaceWho Should Use This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-1Purpo

Page 205 - Input Character from

Publication 1746-RM001A-US-P3-8 Expressions and OperatorsTrigonometric OperatorsThe module contains a complete set of trigonometric operators.

Page 206

Publication 1746-RM001A-US-PExpressions and Operators 3-9Comments on Trigonometric FunctionsThe SIN, COS, and TAN operators use a Taylor series

Page 207 - Input Buffer

Publication 1746-RM001A-US-P3-10 Expressions and OperatorsINT([expr])Use the INT operator to return the integer portion of the expression.PIPI

Page 208 - M0 File to BASIC Input

Publication 1746-RM001A-US-PExpressions and Operators 3-11RNDUse the RND operator to return a pseudo-random number in the range between 0 and 1

Page 209 - BASIC Input Buffer

Publication 1746-RM001A-US-P3-12 Expressions and OperatorsString OperatorsTwo operators in the module can manipulate STRINGS. These operators a

Page 210 - DH485 Data File to

Publication 1746-RM001A-US-PExpressions and Operators 3-13When you use the ASC operator as shown above, the $([expr]) denotes what string is ac

Page 211 - Input Functions 13-21

Publication 1746-RM001A-US-P3-14 Expressions and OperatorsCHR([expr])Use the CHR operator to convert a numeric expression to an ASCII character

Page 212 - (x2) of remote device file]

Publication 1746-RM001A-US-PExpressions and Operators 3-15Special Function OperatorsThe module contains a complete set of special function oper

Page 213 - Interface File to BASIC

Publication 1746-RM001A-US-P3-16 Expressions and OperatorsMTOPUse the MTOP operator to retrieve the last valid memory address in RAM that is av

Page 214

Publication 1746-RM001A-US-PExpressions and Operators 3-17XBY([expr])Use the XBY operator to retrieve or assign data to or from the external da

Page 215 - Packet Length

Publication 1746-RM001A-US-PTable of Contents iiNULL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 216 - Unsolicited Writes

Publication 1746-RM001A-US-P3-18 Expressions and OperatorsYou can change the fraction portion of TIME by manipulating the contents of internal

Page 217

1 Publication 1746-RM001A-US-PChapter 4BASIC CommandsThis chapter describes and illustrates words and expressions that cause a function to occur withi

Page 218 - 13-28 Input Functions

Publication 1746-RM001A-US-P4-2 BASIC CommandsBRKPNTPurposeUse the BRKPNT command to set a program break point at the line number specified by

Page 219 - Input Functions 13-29

Publication 1746-RM001A-US-PBASIC Commands 4-3STOP - IN LINE 160READY>PRINT D,SU,AV.86042573 0 0>D=.5>PRINT D,SU,AV.500>CONTTHE AVE

Page 220 - DF1 PLC Data File

Publication 1746-RM001A-US-P4-4 BASIC CommandsExample>NEW>1 REM EXAMPLE PROGRAM>10 FOR I = 1 TO 10000>20 PRINT I>30 NEXT I>40

Page 221

Publication 1746-RM001A-US-PBASIC Commands 4-5>20 PRINT I>30 NEXT I>40 END>RUN12345 [CTRL-C]pressedSTOP – IN LINE 20READY>PRINT

Page 222

Publication 1746-RM001A-US-P4-6 BASIC CommandsSyntaxCALL 18Example>1 REM EXAMPLE PROGRAM>10 CALL 19.>90 CALL 18CALL 19 – Disable the C

Page 223 - Input Functions 13-33

Publication 1746-RM001A-US-PBASIC Commands 4-7Control-SPurposeUse the [CTRL-S] command to interrupt the scrolling of a BASIC program during the

Page 224 - • 2 – Internal string

Publication 1746-RM001A-US-P4-8 BASIC CommandsControl-QPurposeUse the [CTRL-Q] command to restart a LIST command or PRINT output that is interr

Page 225 - Input Functions 13-35

Publication 1746-RM001A-US-PBASIC Commands 4-9SyntaxEDITExample>EDIT 150Displays program line number 150 for editing.ERASEPurposeUse the ERA

Page 226 - 13-36 Input Functions

Publication 1746-RM001A-US-PTable of Contents iiiNEXT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 227

Publication 1746-RM001A-US-P4-10 BASIC CommandsExample>ERASE>ROM 13 ERASEDThe last program stored in EEPROM (ROM 13 in this example) is e

Page 228

Publication 1746-RM001A-US-PBASIC Commands 4-11LISTPurposeUse the LIST command to print the program to the console device. Spaces are inserted

Page 229

Publication 1746-RM001A-US-P4-12 BASIC CommandsLIST@PurposeUse the LIST@ command to print the program to the device attached to port PRT1. All

Page 230

Publication 1746-RM001A-US-PBASIC Commands 4-13SyntaxMODE(port name, baud rate, arg1, arg2, arg3, arg4, arg5)Table 4.3 PRT1 and PRT2 Port Param

Page 231

Publication 1746-RM001A-US-P4-14 BASIC CommandsExample>1 REM EXAMPLE PROGRAM>10 MODE(DH485,19200,0,1,2,,R)...>25 MODE(PRT1,1200,N,8,,,

Page 232

Publication 1746-RM001A-US-PBASIC Commands 4-15PROGPurposeUse the PROG command to program the resident EEPROM with the current program in RAM.

Page 233

Publication 1746-RM001A-US-P4-16 BASIC CommandsPROG1PurposeUse the PROG1 command to program the resident EEPROM with port information for all t

Page 234

Publication 1746-RM001A-US-PBASIC Commands 4-17PROG2PurposeUse the PROG2 command the same as you would the PROG1 command except for the followi

Page 235

Publication 1746-RM001A-US-P4-18 BASIC CommandsFigure 4.1 Operation of PROG1 or PROG2Isbattery backupenabled?HasPROG1 or PROG2been executed?Isb

Page 236 - 13-46 Input Functions

Publication 1746-RM001A-US-PBASIC Commands 4-19RAMPurposeUse the RAM command to tell the module interpreter to select the current program out o

Page 237 - Setup Functions

Publication 1746-RM001A-US-PTable of Contents ivChapter 11Status FunctionsCALL 36 – Get Number of Characters in PRT2 Buffers . . . . . . . . .

Page 238 - Port Baud Rate

Publication 1746-RM001A-US-P4-20 BASIC CommandsSyntaxREMExample>10 REM THIS IS A COMMENT LINE>20 NEW : REM THIS IS ALSO A COMMENT LINEREN

Page 239 - Head Pointer

Publication 1746-RM001A-US-PBASIC Commands 4-21When you enter ROM [integer], the module selects that program out of EEPROM memory and makes it

Page 240 - CALL 119 – Reset PRT2 to

Publication 1746-RM001A-US-P4-22 BASIC CommandsWhen you enter RROM [integer], the module selects that program out of EEPROM memory, makes it th

Page 241 - Setup Functions 14-5

Publication 1746-RM001A-US-PBASIC Commands 4-23VariationsSome BASIC interpreters allow a line number to follow the RUN command (example: RUN 10

Page 242

Publication 1746-RM001A-US-P4-24 BASIC CommandsExample>1 REM EXAMPLE PROGRAM>10FORI=1TO5>20 PRINT I>30 NEXT I>40 PRINT “PASSED F

Page 243 - String Functions

Publication 1746-RM001A-US-PBASIC Commands 4-25READY>VERPurposeUse the VER command to print the module sign-on message that displays the cur

Page 244 - CALL 61 – String Append

Publication 1746-RM001A-US-P4-26 BASIC CommandsXFERPurposeUse the XFER command to transfer the current selected program in ROM to RAM and selec

Page 245 - String Conversion

1 Publication 1746-RM001A-US-PChapter 5Command Line CALLsThis chapter describes and illustrates CALLs that cause a function to occur within the BASIC

Page 246 - Number Conversion

Publication 1746-RM001A-US-P5-2 Command Line CALLsCALL 74 – Battery-Backed RAM EnablePurposeUse CALL 74 to enable the battery-backed RAM. When

Page 247

Publication 1746-RM001A-US-PCommand Line CALLs 5-3Example: (For saving 2 variables)>PRINT MTOP24575>PRINT MTOP-1224563>PUSH 24563:REM

Page 248 - CALL 64 – Find a String

Publication 1746-RM001A-US-PTable of Contents vChapter 13Input FunctionsCALL 22 – Transfer Data from Port 1 or 2 to the CPU Files . . . . . .

Page 249 - String in a String

Publication 1746-RM001A-US-P5-4 Command Line CALLsExample>CALL 81Number of BASIC programs in (E)EPROM... 3Available bytes to end of u

Page 250 - CALL 66 – Insert a String

Publication 1746-RM001A-US-PCommand Line CALLs 5-5SyntaxPUSH [starting address]PUSH [ending address]CALL 101Example>PUSH 8000 : PUSH 804FH :

Page 251 - CALL 67 – Delete a

Publication 1746-RM001A-US-P5-6 Command Line CALLsExample>CALL 103PRT1 Output Queue6D00H 3AH 31H 30H 38H 30H 34H 30H 30H 30H 39H 37H 34H 39H

Page 252 - Length of a String

Publication 1746-RM001A-US-PCommand Line CALLs 5-7Example>CALL 104PRT1 Input Queue6C00H 33H 0DH 43H 41H 4CH 4CH 20H 31H 30H 34H 7FH 7FH 7FH

Page 253 - ERROR: MEMORY

Publication 1746-RM001A-US-P5-8 Command Line CALLsCALL 110 – Print PRT2 Output Buffer PointerPurposeUse CALL 110 to print the complete output b

Page 254

Publication 1746-RM001A-US-PCommand Line CALLs 5-9Example>CALL 111PRT2 Input Queue6E00H 00H 00H 00H 00H 00H 00H 00H 00H 00H 00H 00H 00H 00H

Page 255 - Conversion Table

Publication 1746-RM001A-US-P5-10 Command Line CALLs

Page 256

1 Publication 1746-RM001A-US-PChapter 6Assignment FunctionsThis chapter describes and illustrates commands that assign storage, reset data storage, an

Page 257 - Reference Guide

Publication 1746-RM001A-US-P6-2 Assignment FunctionsExample>CLEAR>LIST1 REM EXAMPLE PROGRAM10 DIM A(4)20 DATA 10,20,30,4030 FOR I=0 TO 34

Page 258 - within source file]

Publication 1746-RM001A-US-PAssignment Functions 6-3CLEARIPurposeUse the CLEARI statement to clear all of the BASIC evoked interrupts. The ONTI

Page 259

Publication 1746-RM001A-US-PTable of Contents viAppendix ADecimal/Hexadecimal/Octal/ASCIIConversion TableMathematical Conversion Overview . . .

Page 260

Publication 1746-RM001A-US-P6-4 Assignment FunctionsDATAPurposeUse the DATA statement to specify the expressions that you can retrieve with a R

Page 261

Publication 1746-RM001A-US-PAssignment Functions 6-5Once a variable is dimensioned in a program it may not be re-dimensioned. An attempt to re-

Page 262

Publication 1746-RM001A-US-P6-6 Assignment FunctionsExamples>1 REM EXAMPLE PROGRAM>10 LET A = 10*SIN(C)/100>1 REM EXAMPLE PROGRAM>1

Page 263 - [CTRL-S].4-8

Publication 1746-RM001A-US-PAssignment Functions 6-7RESTOREPurposeUse the RESTORE statement to reset the internal read pointer to the beginning

Page 264

Publication 1746-RM001A-US-P6-8 Assignment Functions

Page 265

1 Publication 1746-RM001A-US-PChapter 7Control FunctionsThis chapter describes and illustrates commands executed within the BASIC program or from the

Page 266

Publication 1746-RM001A-US-P7-2 Control FunctionsExample>NEW>1 REM EXAMPLE PROGRAM>10 TIME = 0>15 DBY(71) = 0>20 CLOCK1>30 ON

Page 267

Publication 1746-RM001A-US-PControl Functions 7-3DO-WHILEPurposeUse the DO-WHILE statement to set up loop control within a module program. The

Page 268

Publication 1746-RM001A-US-P7-4 Control Functions>1 REM EXAMPLE PROGRAM>10 A=0 : C=0>20 DO>30 A=A+1>40 DO>45 C=C+1>50 PRIN

Page 269 - Index iii

Publication 1746-RM001A-US-PControl Functions 7-5ExamplesSimple DO-UNTIL Nested DO-UNTIL>1 REM EXAMPLE PROGRAM >1 REM EXAMPLE PROGRAM>

Page 270

P-1 Publication 1746-RM001A-US-P PrefaceRead this preface to familiarize yourself with the rest of the manual. This preface covers the following topic

Page 271 - Index v

Publication 1746-RM001A-US-P7-6 Control FunctionsFOR-TO-(STEP)-NEXTPurposeUse the FOR- TO-(STEP)-NEXT statement to set up and control program l

Page 272

Publication 1746-RM001A-US-PControl Functions 7-7In the first example, since E-0, C-10, D-2, and the PRINT statement at line 20 executes 6 time

Page 273 - Index vii

Publication 1746-RM001A-US-P7-8 Control FunctionsIf line 100 exists, this statement causes execution of the program to resume at line 100. If l

Page 274

Publication 1746-RM001A-US-PControl Functions 7-9Example 2You may execute multiple statements following the THEN or ELSE if you use a colon to

Page 275 - Index ix

Publication 1746-RM001A-US-P7-10 Control FunctionsExample>1 REM EXAMPLE PROGRAM>5 E=0 : C=10 : D=2>10 FOR A=E TO C STEP D>20 PRINT

Page 276

Publication 1746-RM001A-US-PControl Functions 7-11ON-GOTOPurposeUse the ON-GOTO statement to transfer control to the line(s) specified by the G

Page 277 - Index xi

Publication 1746-RM001A-US-P7-12 Control Functions

Page 278

1 Publication 1746-RM001A-US-PChapter 8Execution Control and Interrupt Support FunctionsThis chapter describes and illustrates commands that control d

Page 279

Publication 1746-RM001A-US-P8-2 Execution Control and Interrupt Support FunctionsCALL 16 – Enable DF1 Packet InterruptPurposeUse CALL 16 to ena

Page 280 - Back Cover

Publication 1746-RM001A-US-PExecution Control and Interrupt Support Functions 8-3CALL 17 – Disable DF1 Packet InterruptPurposeUse CALL 17 to di

Comments to this Manuals

No comments