UserManualBASIC ModuleSeries B(Cat. No. 1771-DB)Allen-Bradley
Preface ASummary of ChangesSOC-8Notes:
ChapterUsing BASIC Module Statements7 7 -10Use these calls to monitor the status of the BASIC module. You canexecute these calls from a BASIC program
8 Chapter 8 -1Data TypesThis chapter describes: On page:argument stack8 -1control stack 8 -1string data types 8 -2numeric data types 8 -3backplane con
ChapterData Types8 8 -2A string is a character or group of characters stored in memory. Usually, the characters stored in a string make up a word or
ChapterData Types8 8 -3Two numeric data types exist: integer floating-pointYou can enter and display these numeric data types in four formats: integer
ChapterData Types8 8 -4The BASIC module communicates with the local processor through the I/O chassis backplane. All data communicated to and from th
ChapterData Types8 8 -5SLC 16-Bit Unsigned Integer (SLC 16-Bit Binary) This value requires one word of the processor data table. The data isrepresent
ChapterData Types8 8 -64-Digit, Unsigned, Fixed Decimal BCDThis value requires one word of the processor data table. The data isrepresented by a 4-di
ChapterData Types8 8 -76-Digit, Signed, Fixed Decimal BCDThis value requires two words of the processor data table. The first wordcontains overflow,
ChapterData Types8 8 -83.3-Digit, Signed, Fixed Decimal BCDThis value requires two words of the processor data table. The first wordcontains the over
ChapterData Types8 8 -9Floating PointThe PLC-5 floating point number is a 7-digit binary floating point number(IEEE Float 32- bit value). The values
publication 1771-6.5.113PrefaceBUsing-1Using This ManualThis introduction describes how to properly and efficiently use thismanual.This introduction t
ChapterData Types8 8 -10Notes:
9 Chapter 9 -1Expressions, Variables and OperatorsThis chapter describes: On page:expressions9 -1relational expressions 9 -1constants 9 -1variables 9
ChapterExpressions, Variables and Operators9 9 -2Variables may represent either numeric values or strings. Numeric valuesare floating point variables
ChapterExpressions, Variables and Operators9 9 -3Eight types of operators may act on an expression:G arithmetic G functionalG logical G logarithmic
ChapterExpressions, Variables and Operators9 9 -4Operator Function PageABSreturn the absolute value of expression 9 -11+ add expressions together 9 -5
ChapterExpressions, Variables and Operators9 9 -5The BASIC module contains a complete set of two-operand andone-operand arithmetic operators.The gener
ChapterExpressions, Variables and Operators9 9 -6Negation ( – )Use the negation operator to change an expression from positive tonegative.>PRINT -(
ChapterExpressions, Variables and Operators9 9 -7The BASIC module contains a complete set of bitwise logical operators.Bitwise operators perform their
ChapterExpressions, Variables and Operators9 9 -8.OR.Use the bitwise .OR. operator to perform a bitwise OR on two expressions.The .OR. operator compar
ChapterExpressions, Variables and Operators9 9 -9Relational expressions involve the operators =, < >, >, >=, <, and <=. In the BASI
Preface BUsing This ManualUsing-2This manual is designed so you can follow it to install your hardware andprogram your BASIC module.TroubleshootingA12
ChapterExpressions, Variables and Operators9 9 -10The BASIC module contains a complete set of trigonometric operators.These operators are one-operand
ChapterExpressions, Variables and Operators9 9 -11ATNUse the ATN operator to return the arctangent of the argument. The result is in radians. Calcul
ChapterExpressions, Variables and Operators9 9 -12INTUse the INT operator to return the integer portion of the expression.>PRINT INT(3.7) Result: 3
ChapterExpressions, Variables and Operators9 9 -13The BASIC module contains a complete set of logarithmic operators.These operators are one-operand op
ChapterExpressions, Variables and Operators9 9 -14Two operators in the BASIC module can manipulate strings. These operators are ASC and CHR.ASCUse th
ChapterExpressions, Variables and Operators9 9 -15The numbers printed in this example represent the ASCII characters Athrough L.>NEW>1 REM EXAM
ChapterExpressions, Variables and Operators9 9 -16CHRUse the CHR operator to convert a numeric expression to an ASCIIcharacter.>PRINT CHR(65)Result
ChapterExpressions, Variables and Operators9 9 -17The BASIC module contains a complete set of special function operators.These operators manipulate th
ChapterExpressions, Variables and Operators9 9 -18MTOPUse the MTOP operator to retrieve the last valid memory address in RAMthat is available to the B
ChapterExpressions, Variables and Operators9 9 -19XBYUse the XBY operator to retrieve or assign data to or from the externalRAM data memory of the BAS
Preface BUsing This ManualUsing-3Throughout this manual, we abbreviate some terms. The terms andabbreviations listed in this table are specific to th
ChapterExpressions, Variables and Operators9 9 -20You can change the fraction portion of TIME by manipulating the contentsof internal memory location
10 Chapter 10 -1CommandsBASIC commands are programming instructions that you execute duringthe Command mode except for Ctrl+C. Ctrl+C takes you fromR
ChapterCommands10 10 -2Use the BRKPNT command to set a program break point at the linenumber you specify with this command. Program execution stops j
ChapterCommands10 10 -3Use the CONT command to resume execution of a program stopped by aCtrl+C (page 10 -4), BRKPNT(page 10 -2), SNGLSTP (page10 -20)
ChapterCommands10 10 -4Use the Ctrl+C command to stop execution of the current programand return the BASIC module to the Command mode. In some cases
ChapterCommands10 10 -5If software handshaking is enabled on the program port (page 2 -4), use theCtrl+Q command to restart a LIST command (page 10 -9
ChapterCommands10 10 -6 If software handshaking is enabled on the program port (page 2 -4), usethe Ctrl+S command to interrupt the scrolling of a BASI
ChapterCommands10 10 -7Use the EDIT command to access the BASIC line editor. Use this editor toedit a line of the current program in RAM.Operation Fu
ChapterCommands10 10 -8Use the ERASE command to delete the last BASIC program stored inEEPROM through a PROG command (page 10 -11).SyntaxERASE ReturnE
ChapterCommands10 10 -9Use the LIST command to print the program to the console device. Spaces are inserted after the line number and before and afte
Preface BUsing This ManualUsing-4We use these conventions in this manual:In this manual, we show: Like this:prompts and messagesPress a function keyli
ChapterCommands10 10 -10Use the NEW command to delete the program and all variables currentlystored in RAM. In addition, all variables are set equal
ChapterCommands10 10 -11Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. See also C
ChapterCommands10 10 -12Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. Also see C
ChapterCommands10 10 -13Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. Also see
ChapterCommands10 10 -14StartErase RAMIsbattery back-upenabled?programHasPROG1 or PROG2been executed?Isbattery backedRAM MTOP andPrint sign-onmessageE
ChapterCommands10 10 -15Use the RAM command to tell the BASIC module interpreter to select thecurrent program out of RAM. Use a LIST command (page 10
ChapterCommands10 10 -16Use the REN command to renumber program lines.Important: REN command updates the destination of GOSUB, GOTO, ONERR,ONTIME an
ChapterCommands10 10 -17Use the ROM command to tell the BASIC module interpreter to select thecurrent program out of EEPROM or EPROM. Use a LIST comma
ChapterCommands10 10 -18Use the RROM command to tell the BASIC module interpreter to selectthe current program out of EEPROM or EPROM and then execute
ChapterCommands10 10 -19Use the RUN command to set all variables equal to zero, clear all BASICevoked interrupts, and begin program execution with the
Preface BUsing This ManualUsing-5To install and program the BASIC module follow the flowchart below.Do you need information on configuring/using commu
ChapterCommands10 10 -20Use the SNGLSTP command to initiate single-step program execution. If the number you specify with this command is zero, singl
ChapterCommands10 10 -21Use the VER command to print the BASIC module sign-on message thatdisplays the current version of the firmware.SyntaxVER Retur
ChapterCommands10 10 -22These calls can only be executed from the command line. Use these callsto cause a function to occur within the BASIC module.C
11 Chapter 11 -1StatementsBASIC statements are programming instructions that control program flowor manipulate I/O or memory. Every statement begins
ChapterStatements11 11 -2Use the CLEAR statement to set all variables equal to 0 and reset allBASIC evoked interrupts and stacks. This means that afte
ChapterStatements11 11 -3Use the CLEARI statement to clear all of the BASIC evoked interrupts.The ONTIME (page 11 -25) interrupt is disabled after you
ChapterStatements11 11 -4Use the CLOCK0 (zero) statement to disable or turn off the free runningclock resident on the BASIC module. After you execute
ChapterStatements11 11 -5Use the CLOCK1 statement to enable the free running clock resident onthe BASIC module. The special function operator TIME (p
ChapterStatements11 11 -6Use the DATA statement to specify the expressions that you can retrievewith a READ statement (page 11 -31). If you use multi
ChapterStatements11 11 -7Use the DIM statement to reserve storage for arrays. The storage area isfirst assumed to be zero. Arrays in the BASIC modul
Preface BUsing This ManualUsing-6Allen-Bradley offers support services worldwide, with over 75sales/support offices, 512 authorized distributors and 2
ChapterStatements11 11 -8Use the DO-UNTIL statement to set up loop control within a moduleprogram. All statements between the DO and the UNTIL rel ex
ChapterStatements11 11 -9Use the DO-WHILE statement to set up loop control within a moduleprogram. This statement is similar to the DO-UNTIL rel expr
ChapterStatements11 11 -10Use the END statement to terminate program execution. CONT (page10 -3) does not operate if you use the END statement to ter
ChapterStatements11 11 -11Use the FOR-TO-(STEP)-NEXT statement to set up and control programloops.If the STEP statement and the value are omitted, the
ChapterStatements11 11 -12Use the GET statement in the Run mode. GET returns a result of zero inthe Command mode. The GET operator reads the consol
ChapterStatements11 11 -13Use the GOSUB statement to cause the BASIC module to transfer controlof the program to the line number the GOSUB statement r
ChapterStatements11 11 -14Use the GOTO statement to cause BASIC to transfer control to the linenumber you specify. If line number you specify does no
ChapterStatements11 11 -15Use the IF-THEN-ELSE statement to set up a conditional test.If you want to transfer control to different line numbers using
ChapterStatements11 11 -16Use the INPL statement to read an entire line (up to 254 characters) fromthe program port buffer. The line must be stored
ChapterStatements11 11 -17Use the INPUT statement to enter data from the console device duringprogram execution. You may assign data to one or more v
Table of ContentsTOC-1Chapter 1What’s in This Chapter? 1-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guard Against Electrostatic Da
ChapterStatements11 11 -18Use the LD@ statement to retrieve floating point numbers stored with aST@ statement (page 11 -35). The expression following
ChapterStatements11 11 -19Use the LET statement to assign a variable to the value of an expression.The = sign used in the LET statement is not an equa
ChapterStatements11 11 -20Use the MODE command to set the port parameters of ports PRT1, PRT2,and DH-485.Important: If a argument (other than port nam
ChapterStatements11 11 -21Use the NEXT statement to return the FOR-TO-(STEP)-NEXT loop(page 11 -11) to the beginning of the loop and add the value of
ChapterStatements11 11 -22Use the ONDF1 statement to enable or disable the DF1 packet interruptcapability. (ONDF1 is equivalent to CALL 16, page 12 -
ChapterStatements11 11 -23Use the ONERR statement to handle arithmetic errors, if they occur, duringprogram execution. The ONERR statement only traps
ChapterStatements11 11 -24Use the ON-GOSUB statement to transfer control to the line(s) youspecified with the GOSUB statement (page 11 -13) when the v
ChapterStatements11 11 -25Use the ONTIME expr, ln num statement to compensate for theincompatibility between the timer/counters on the microprocessor
ChapterStatements11 11 -26Use the ON-GOTO statement to transfer control to the line(s) youspecified with the GOTO statement (page 11 -14) when the val
ChapterStatements11 11 -27Use the PH0. and PH1. statements to direct the BASIC module to print anumber in hexadecimal format to the console device. T
Table of ContentsTOC-2Chapter 5What’s in This Chapter? 5-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BASIC Module Memory Organizati
ChapterStatements11 11 -28Use the POP statement to remove values from the BASIC moduleargument stack. The value at the top of the argument stack is a
ChapterStatements11 11 -29Use the PRINT statement to direct the BASIC module to output a value tothe console device. You may print the value of expre
ChapterStatements11 11 -30Use the PUSH statement to place the arithmetic expression or expressionsin the BASIC module argument stack. This statement
ChapterStatements11 11 -31Use the READ statement to retrieve the expressions that you specified inthe DATA statement (page 11 -6) and assign the value
ChapterStatements11 11 -32Use the REM command to specify a comment line in a BASIC program.Adding comment lines to a program makes the program easier
ChapterStatements11 11 -33Use the RETI statement to exit from an interrupt (ONDF1 (page 11 -22),ONTIME (page 11 -25), CALL 16 (page 12 -10,) or CALL
ChapterStatements11 11 -34Use the RETURN statement to return control to the statement followingthe most recently executed GOSUB (page 11 -13). Use on
ChapterStatements11 11 -35Use the ST@ statement to store BASIC module floating point numbers to aspecified address. The expression following the ST@
ChapterStatements11 11 -36Use the STOP statement to break program execution at specific points in aprogram. After a program is stopped you can displa
ChapterStatements11 11 -37Use the STRING statement to allocate memory for strings. Initially, memory is not allocated for strings. If you attempt to
Table of ContentsTOC-3Chapter 9What’s in This Chapter? 9-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions 9-1. . . . . . . .
ChapterStatements11 11 -38Important: Define strings in your program first, unless you are executinga CALL 77 (page 13 -6). Then, execute the CALL 77
12 Chapter 12 -1Call Routines 0 – 68Calls 0 – 68 are described here. Calls 69 – 127 are described in Chapter13. Chapter 7 gives you an overview of h
ChapterCall Routines 0–6812 12 -2This routine initiates a full reset. This is similar to a re-boot or pressingthe reset button. The BASIC module re
ChapterCall Routines 0–6812 12 -3Use this routine to receive data from the PLC processor. CALL 3 transfersthe block-transfer-write (BTW) buffer to th
ChapterCall Routines 0–6812 12 -4Use this routine to set the number of words (1-64) to transfer from the PLCprocessor to the BASIC module. The ladder
ChapterCall Routines 0–6812 12 -5Use this routine to receive data from the PLC processor. CALL 6 transfersthe block-transfer-write (BTW) buffer to th
ChapterCall Routines 0–6812 12 -6This routine was used during EPROM programming in the 1771-DB,Series A BASIC module. If you initiate this call with
ChapterCall Routines 0–6812 12 -7Use this routine to convert 16-bit binary from PLC processor to BASICfloating point. See also CALL 21.See Chapter 8
ChapterCall Routines 0–6812 12 -8Use this routine to convert 6-digit BCD from the PLC processor to BASICfloating point. See also CALL 23.See Chapter
ChapterCall Routines 0–6812 12 -9Use CALL 15 to convert an SLC 16-bit unsigned integer (or 16-bit binary)number from an SLC processor to a BASIC modul
Because of the variety of uses for the products described in thispublication, those responsible for the application and use of this controlequipment m
Table of ContentsTOC-4Chapter 11What’s in This Chapter? 11-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLEAR 11-2. . . . . . . . .
ChapterCall Routines 0–6812 12 -10Use this routine to enable or disable the DF1 packet interrupt capability.This call has the same functionality as th
ChapterCall Routines 0–6812 12 -11Use this routine to convert 4-digit BCD from the PLC processor to BASICfloating point. See also CALL 27.See Chapte
ChapterCall Routines 0–6812 12 -12Use CALL 19 to disable the Ctrl+C break function for LIST (page10 -9) and RUN (page 10 -19) operations. Execute CA
ChapterCall Routines 0–6812 12 -13Use this routine to convert BASIC floating point to 16-bit binary PLCnumber. This routine takes a value between 0 a
ChapterCall Routines 0–6812 12 -14This routine converts a value from BASIC floating point format to6-digit, signed, PLC BCD number in a 2 word format
ChapterCall Routines 0–6812 12 -15Use CALL 24 to convert a BASIC floating-point number to an SLC 16-bitsigned integer SLC number and place result in t
ChapterCall Routines 0–6812 12 -16Use CALL 25 to convert a BASIC module floating-point value between 0and 65535 to its 16-bit binary (or unsigned inte
ChapterCall Routines 0–6812 12 -17Use this routine to convert a variable in BASIC floating point format to asigned, 6-digit, fixed decimal point PLC n
ChapterCall Routines 0–6812 12 -18Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use CALL 29 in
ChapterCall Routines 0–6812 12 -19SyntaxPUSH 49, 50, 122, or 123 for the CALL you want to activateCALL 29POP status of transactionExampleCALL 122 must
Table of ContentsTOC-5Chapter 12What’s in This Chapter? 12-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CALL 0: Reset Module 12-2. .
ChapterCall Routines 0–6812 12 -20Use this routine to set up the parameters for the PRT2 port. The parameters you set are the number of bits/word, pa
ChapterCall Routines 0–6812 12 -21SyntaxPUSH number of bits/wordPUSH parityPUSH number of stop bitsPUSH software handshakingPUSH hardware handshaking
ChapterCall Routines 0–6812 12 -22Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 32 to allow the
ChapterCall Routines 0–6812 12 -23Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 33 to transfer
ChapterCall Routines 0–6812 12 -241. When data is available from the port, the BASIC moduleautomatically transfers the data into the BTR buffer. The
ChapterCall Routines 0–6812 12 -254. The ladder logic program of the PLC processor retrieves the datafrom the input image table and performs a block t
ChapterCall Routines 0–6812 12 -26Input Argument OneThe first input argument is the source port number (PRT1 or PRT2) of theBASIC module. A zero disa
ChapterCall Routines 0–6812 12 -27Input Argument FiveThe fifth input argument should always be 1.Input Argument SixThe sixth input argument is the str
ChapterCall Routines 0–6812 12 -28SyntaxPUSH source port numberPUSH maximum number of characters to be transferredPUSH decimal value of character deli
ChapterCall Routines 0–6812 12 -29Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 34 to transfer
Table of ContentsTOC-6CALL 39: 3.3-Digit Signed, Fixed Decimal BCD to BASIC Floating Point 12-38. . . . . . . . . . . . . . . . . . . . . . . CALL 40:
ChapterCall Routines 0–6812 12 -302. The ladder logic program of the PLC processor must latch the outputimage table, bit 11 or bit 13 to inform the BA
ChapterCall Routines 0–6812 12 -316. The BASIC module resets the input image table bit 11 or bit 13 onthe same end of scan cycle in which the output i
ChapterCall Routines 0–6812 12 -32Input Argument TwoThe second input argument is always 0.Input Argument ThreeThe third input argument is always 1.Inp
ChapterCall Routines 0–6812 12 -33SyntaxPUSH destination port number and/or internal stringPUSH 0PUSH 1PUSH string numberPUSH byte swap selectionCALL
ChapterCall Routines 0–6812 12 -34Use this routine to retrieve the current character in the 255 character, PRT2port receive buffer and convert it to i
ChapterCall Routines 0–6812 12 -35Use this routine to retrieve the number of characters in the buffer youchoose.Input and Output ArgumentsThis routine
ChapterCall Routines 0–6812 12 -36Use CALL 38 to expand the type of errors the ONERR statement (page11 -23) traps and handles.The ONERR statement only
ChapterCall Routines 0–6812 12 -37DescriptionStatus code17no DATA available for READ18 DF1 cannot be enabled (JW4 in wrong position)19• illegal use of
ChapterCall Routines 0–6812 12 -38Use this routine to convert 3.3-digit BCD from the PLC processor toBASIC floating point. See also CALL 26.See Chapt
ChapterCall Routines 0–6812 12 -39Use this routine to set the wall clock time functions.Important: The Series B, BASIC module does not update the wall
Table of ContentsTOC-7CALL 90: Read Remote DH-485 Data File to BASIC Input Buffer 13-18. . . . . . . . . . . . . . . . . . . . . . .
ChapterCall Routines 0–6812 12 -40Use this routine to set the wall clock date functions.Input and Output ArgumentsThis routine has three input argumen
ChapterCall Routines 0–6812 12 -41Use CALL 43 to retrieve the current date and time as a string.Input and Output ArgumentsThis routine has one input a
ChapterCall Routines 0–6812 12 -42Use CALL 45 to retrieve the current time in a string (hh:mm:ss).Input and Output ArgumentsThis routine has one input
ChapterCall Routines 0–6812 12 -43Use CALL 47 to retrieve the current day of week as a three characterstring.Input and Output ArgumentsThis routine ha
ChapterCall Routines 0–6812 12 -44Important: This call requires the BASIC module to be in 16 point mode(page 1 -7).Use CALL 49 to read up to 63 words
ChapterCall Routines 0–6812 12 -453. When data is available, the BASIC module transfers the data intoBTR buffer. The DH-485 status word is placed in
ChapterCall Routines 0–6812 12 -46This call is active until you re-execute it with different input parameters.Input and Output ArgumentsThis call has
ChapterCall Routines 0–6812 12 -47Input Argument FourThe fourth input argument is the file type to be read from the remotedevice. This number is igno
ChapterCall Routines 0–6812 12 -48Input Argument EightThe eighth input argument is the selection of the BTR buffer and/or string: 0 = BTR buffer 2 =
ChapterCall Routines 0–6812 12 -49Example>10 REM ENABLE REMOTE DH-485 READ COMMAND INTERRUPT>15 PUSH 64: CALL 4: REM SET BLOCK TRANSFER WRITE
Table of ContentsTOC-8Appendix AWhat’s in This Appendix? A-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Features A-1. . . . . . . .
ChapterCall Routines 0–6812 12 -50Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 50 to write up
ChapterCall Routines 0–6812 12 -513. The BASIC module sets bit 15 in the input image table to inform thePLC processor that a block transfer write will
ChapterCall Routines 0–6812 12 -527. The BASIC module assembles the DH-485 packet and sends it to theremote device on the DH-485 networkBASIC ModuleRe
ChapterCall Routines 0–6812 12 -53Once this call is active, it remains active and sends data to the remote nodewhenever the PLC processor handshaking
ChapterCall Routines 0–6812 12 -54Input Argument FourThe fourth input argument is the file type you want to write to the remotedevice. This number is
ChapterCall Routines 0–6812 12 -55Input Argument EightThe eighth input argument is the selection of the source BTW buffer or theinternal string: 0 =
ChapterCall Routines 0–6812 12 -56SyntaxPUSH type of DH-485 WRITE commandPUSH remote DH-485 device node numberPUSH remote DH-485 device file numberPU
ChapterCall Routines 0–6812 12 -57Sample Ladder Logic(L)O:00115BTWBLOCK TRANSFER WRITERack Group Module 0010N7:0N10:1064Control BlockData fil
ChapterCall Routines 0–6812 12 -58Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use CALL 52 to
ChapterCall Routines 0–6812 12 -59Use this routine to repeat a character and place it in a string. You can usethe string repeat when designing output
1 Chapter 1 -1Installing the BASIC ModuleThis chapter describes: On page:guard against electrostatic discharge1 -1unpack the module 1 -2calculate powe
ChapterCall Routines 0–6812 12 -60Use this routine to append one string to the end of another string. If the resulting string is longer than the maxi
ChapterCall Routines 0–6812 12 -61Use this routine to convert a number or numeric variable into a string. You must use the STRING statement (see pag
ChapterCall Routines 0–6812 12 -62Use this routine to convert the first decimal number found in the string youspecify to a number, and place this numb
ChapterCall Routines 0–6812 12 -63Use this routine to find a string within a string. It locates the firstoccurrence (position) of this string. This
ChapterCall Routines 0–6812 12 -64Use this routine to replace a string within a string.Input and Output ArgumentsThis routine has three input argument
ChapterCall Routines 0–6812 12 -65Use this routine to insert a string within another string.Input and Output ArgumentsThis routine has three input arg
ChapterCall Routines 0–6812 12 -66Use this routine to delete a string from within another string.Important: This routine deletes only the first occurr
ChapterCall Routines 0–6812 12 -67Use this routine to determine the length of a string. To properly determinethe length of a string you must terminat
ChapterCall Routines 0–6812 12 -68Notes:
13 Chapter 13 -1Call Routines 69–127There are 128 BASIC calls. Calls 69 – 127 are described here. Calls 0 – 68 are described in Chapter 12. Chapter
ChapterInstalling the BASIC Module1 1 -2Verify all the items in your package against the packing sheet. If any ofthe items are missing or incorrect,
ChapterCall Routines 69–12713 13 -2Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use this routi
ChapterCall Routines 69–12713 13 -3Use this routine to transfer from a running ROM or RAM program to thebeginning of any available ROM program.Importa
ChapterCall Routines 69–12713 13 -4Use this routine to return to the routine that called this ROM/RAM routine.Execution begins on the line after the l
ChapterCall Routines 69–12713 13 -5Use CALL 73 to disable the battery-backed RAM and purge reset. You see“Battery Backup Disabled” when you execute t
ChapterCall Routines 69–12713 13 -6Use CALL 77 to reserve the top of RAM memory for protected variablestorage. Values are saved if you enabled CALL 7
ChapterCall Routines 69–12713 13 -7>60 LD@ 14335:REM REMOVE K FROM PROTECTED AREA>70 POP K>80 LD@ 14329>90 POP L>100 REM USE LD@ AF
ChapterCall Routines 69–12713 13 -8Use CALL 78 to change the program port communication rate from itsdefault value (1200 bit/s) to one of the followin
ChapterCall Routines 69–12713 13 -9Use CALL 80 to check the module’s battery condition.Refer to Chapter 3 for information on how to change the battery
ChapterCall Routines 69–12713 13 -10Use CALL 81 before storing a program in the EEPROM memory. This routine: determines the number of memory module
ChapterCall Routines 69–12713 13 -11Use CALL 82 to check the user PROM and display a map of where all theBASIC programs are stored. Use this routine
ChapterInstalling the BASIC Module1 1 -3The BASIC module has nine sets of jumpers that you need to set. For future reference, place a ✔ next to the j
ChapterCall Routines 69–12713 13 -12Use CALL 84 to transfer up to 40 words starting at the designated offset ofthe DH-485 Common Interface File to the
ChapterCall Routines 69–12713 13 -13Use CALL 85 to transfer up to 40 words starting at the designated offset ofthe BASIC output buffer to the DH-485 C
ChapterCall Routines 69–12713 13 -14Use CALL 86 to determine if the DH-485 Common Interface File locatedin the BASIC module was updated since the last
ChapterCall Routines 69–12713 13 -15Use CALL 87 to determine if the DH-485 Common Interface File locatedin the BASIC module was read by a device on th
ChapterCall Routines 69–12713 13 -16Use this call to convert BASIC floating point to PLC-5 floating point in atwo-word format and place the converted
ChapterCall Routines 69–12713 13 -17Use this call to convert PLC-5 floating point to BASIC floating point. See also CALL 88. See Chapter 8 for more i
ChapterCall Routines 69–12713 13 -18Use CALL 90 to read up to 40 words from the designated node address,file number, file type, and element offset of
ChapterCall Routines 69–12713 13 -19Input Argument FourThe fourth input argument is the starting element offset within the file onthe remote device (0
ChapterCall Routines 69–12713 13 -20Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call
ChapterCall Routines 69–12713 13 -21SyntaxPUSH remote device node addressPUSH remote device file numberPUSH remote device file typePUSH starting eleme
ChapterInstalling the BASIC Module1 1 -4Set Watchdog Timer Enable Jumper (JW1)Use JW1 to enable the watchdog timer. Unless you are using assemblylang
ChapterCall Routines 69–12713 13 -22Use CALL 91 to write up to 40 words starting at word 100 of the BASICmodule output buffer to the remote DH-485 dat
ChapterCall Routines 69–12713 13 -23Input Argument FourThe fourth input argument is the starting element offset within the file onthe remote device (0
ChapterCall Routines 69–12713 13 -24Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call
ChapterCall Routines 69–12713 13 -25SyntaxPUSH remote device node addressPUSH remote device file numberPUSH remote device file typePUSH starting eleme
ChapterCall Routines 69–12713 13 -26Use CALL 92 to read up to 40 words from the remote DH-485 CommonInterface File of the designated node address, sta
ChapterCall Routines 69–12713 13 -27Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call
ChapterCall Routines 69–12713 13 -28SyntaxPUSH remote device node addressPUSH starting element offset (x2) of remote device filePUSH number of words t
ChapterCall Routines 69–12713 13 -29Use CALL 93 to write up to 40 words starting at word 100 of the BASICmodule output buffer to the remote DH-485 Com
ChapterCall Routines 69–12713 13 -30Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call
ChapterCall Routines 69–12713 13 -31SyntaxPUSH remote device node addressPUSH starting element offset (x2) of remote device filePUSH number of words t
ChapterInstalling the BASIC Module1 1 -5 Set CPU Speed Select Jumper (JW3)Use JW3 to select the operating speed of your BASIC module processor.Unless
ChapterCall Routines 69–12713 13 -32Use CALL 94 to display the current PRT1 port configuration on theterminal screen.Input and Output ArgumentsThis ro
ChapterCall Routines 69–12713 13 -33Use CALL 96 to clear port PRT1 receive and transmit buffers.Input and Output ArgumentsThis routine has one input a
ChapterCall Routines 69–12713 13 -34Use CALL 98 to disable the Data Terminal Ready (DTR) signal fromPRT2. CALL 97 re-enables the DTR signal.Input and
ChapterCall Routines 69–12713 13 -35Use this call to store a file in user EEPROM through the program port ofthe BASIC module. The file must be in Int
ChapterCall Routines 69–12713 13 -36Use CALL 103 to print the complete PRT1 transmit buffer with address,front pointer, and number of characters in th
ChapterCall Routines 69–12713 13 -37Use CALL 104 to print the complete PRT1 receive buffer with address,front pointer, and number of characters in the
ChapterCall Routines 69–12713 13 -38Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.” Use CALL 108
ChapterCall Routines 69–12713 13 -39Operational Codes for Half-Duplex Mode:OperationalcodeCorresponding mode of operation Special operational code(sam
ChapterCall Routines 69–12713 13 -40Modem Handshaking for Half-Duplex ModeModem handshaking Operational codes Descriptionhalf-duplex nohandshaking0–3•
ChapterCall Routines 69–12713 13 -41Operational Codes for Full-Duplex Mode:Legal values for the operational code are 16 to 31 for full-duplex mode:Ope
PrefaceASOC-1Summary of ChangesRead this preface if you are replacing a 1771-DB, Series A module with a1771-DB, Series B module or are using the BASIC
ChapterInstalling the BASIC Module1 1 -6Set Operating Mode Jumper (JW4)Use JW4 to configure your communication ports as a program port, ASCIIport, net
ChapterCall Routines 69–12713 13 -42Modem Handshaking for Full-Duplex ModeModem handshaking Operational codes Descriptionfull-duplex with nohandshakin
ChapterCall Routines 69–12713 13 -43Input Argument ThreeThe third input argument specifies the number of message retries when inhalf-duplex mode or th
ChapterCall Routines 69–12713 13 -44SyntaxPUSH operational codePUSH poll timeout or ACKnowledge timeoutPUSH message retries or ENQuiry retriesPUSH RTS
ChapterCall Routines 69–12713 13 -45Use CALL 110 to print the complete PRT2 transmit buffer with addresses,front pointer and the number of characters
ChapterCall Routines 69–12713 13 -46Use CALL 111 to print the complete PRT2 receive buffer with addresses,front pointer and the number of characters i
ChapterCall Routines 69–12713 13 -47Use CALL 112 to activate or de-activate the user LEDs (LED1 andLED2).When you change to Command mode your user-def
ChapterCall Routines 69–12713 13 -48Use CALL 114 to transmit the DF1 data packet. When you performCALL 114, the DF1 data is posted for the DF1 drive
ChapterCall Routines 69–12713 13 -49Use CALL 115 to check the DF1 transmit status.Input and Output ArgumentsThis routine has no input arguments and on
ChapterCall Routines 69–12713 13 -50Use this call to execute a user generated assembly language routine. This call performs some preliminary checks.
ChapterCall Routines 69–12713 13 -51Use CALL 117 to get the length of the DF1 data packet.When CALL 117 is read in a program, the BASIC module checks
ChapterInstalling the BASIC Module1 1 -7Set Backplane Configuration (JW5)Use JW5 to set the BASIC module backplane configuration. The BASICmodule can
ChapterCall Routines 69–12713 13 -52Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 118 to allow
ChapterCall Routines 69–12713 13 -532. The BASIC module transfers the data into the local PLC BTR bufferand places the byte count into the lower byte
ChapterCall Routines 69–12713 13 -54Input and Output ArgumentsThis routine has five input arguments and one output argument.Argument Description Pagei
ChapterCall Routines 69–12713 13 -55Input Argument FourThe fourth input argument is the string number. If the second inputargument does not select in
ChapterCall Routines 69–12713 13 -56Example>1 REM EXAMPLE PROGRAM>10 REM ENABLE PLC/SLC UNSOLICITED WRITE INTERRUPT>15 PUSH 64: CALL 4: REM
ChapterCall Routines 69–12713 13 -57Use this call to clear the BASIC module input and output buffers.Input and Output ArgumentsThis routine has one in
ChapterCall Routines 69–12713 13 -58Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 122 to read u
ChapterCall Routines 69–12713 13 -592. The BASIC module issues the appropriate READ command to theremote PLC. The data and status are received from t
ChapterCall Routines 69–12713 13 -605. The PLC receives the data and status from the block transfer andunlatches output image table bit 12 to inform t
ChapterCall Routines 69–12713 13 -61Input Argument OneThe first input argument is the type of PLC READ command you issued: 0 = disable the previously
ChapterInstalling the BASIC Module1 1 -8Set PRT2 Communication Rate Select Jumper (JW6)Use JW6 to set the communication rate for PRT2 at power-up. Se
ChapterCall Routines 69–12713 13 -62Input Argument SixThe sixth input argument is the number of elements to be transferred. If the number is not withi
ChapterCall Routines 69–12713 13 -63Output Argument OneThe output argument is the status of the call. It has these values: 0 = successful 1 = disab
ChapterCall Routines 69–12713 13 -64IndicatesCodeCArequest is too large; transaction size plus word address is toolargeCB access denied, privilege vio
ChapterCall Routines 69–12713 13 -65Example>15 PUSH 64: CALL 4:REM SET BLOCK TRANSFER WRITE LENGTH>16 PUSH 64: CALL 5: REM SET BLOCK TRANSFER
ChapterCall Routines 69–12713 13 -66Important: This call requires the BASIC module jumper JW5 to be in 16point mode (page 1 -7).Use CALL 123 to write
ChapterCall Routines 69–12713 13 -672. The PLC processor latches output image table bit 13 to inform theBASIC module that valid data is available.PLC
ChapterCall Routines 69–12713 13 -686. The BASIC module clears bit 13 in the input image table.PLC ProcessorClear Input ImageTable Bit 13BASIC ModuleP
ChapterCall Routines 69–12713 13 -6910. The BASIC module detects a successful block transfer and resets theinput image table bit 4.PLC ProcessorBASIC
ChapterCall Routines 69–12713 13 -70Input Argument ThreeThe third input argument is the file number to be written to on the PLCremote device (0 throug
ChapterCall Routines 69–12713 13 -71Input Argument SevenThe seventh input argument is the message time-out value. This value (1through 255) correspon
ChapterInstalling the BASIC Module1 1 -9Set Battery Enable Jumper (JW7)Use JW7 to enable the battery. To conserve the battery, your module isshipped
ChapterCall Routines 69–12713 13 -72Code Indicates0transfer OK1 transmission failed2 enquiry time out3• with handshaking selected – either a loss of C
ChapterCall Routines 69–12713 13 -73IndicatesCodeD5data conversion errorD6 the scanner is not able to communicate with a 1771 chassisadapterD7 the ada
ChapterCall Routines 69–12713 13 -74Sample Ladder Logic(L)O:00113BTWBLOCK TRANSFER WRITERack Group Module 0010N7:5N10:11064Control BlockData
A Appendix A –1Product OverviewThis appendix introduces you to the BASIC module.This appendix describes: On page:features A –1programming interfaces
Product OverviewAppendixA A –2Hardware FeaturesHardware element DescriptionReset switchWhen you press this switch (located behind the module ejector
Product OverviewAppendix A A –3Software FeaturesSoftware element DescriptionProgramming languageIntel BASIC-52 with enhancements• high-level math fun
Product OverviewAppendixA A –4Diagnostic FeaturesThe BASIC module has 10 indicator LED indicators. Use these LEDindicators for diagnostics and opera
Product OverviewAppendix A A –5Program the BASIC module using a subset of the Intel BASIC 52programming language. You can program the BASIC module
Product OverviewAppendixA A –6BASIC Development Software Use a personal computer with the BASIC Development software (PBASE)to create a BASIC program
Product OverviewAppendix A A –7Your BASIC module may communicate with a DH-485 network. It canalso communicate with a remote device through a modem
ChapterInstalling the BASIC Module1 1 -10You install the BASIC module in a 1771-I/O chassis. You can place yourmodule in any slot of the I/O chassis e
Product OverviewAppendixA A –81747-AIC Link Coupler/1784-KR DH-485 Interface CardConfigurationThis configuration shows the BASIC module interfaced wi
Product OverviewAppendix A A –9DF1 Protocol ConfigurationThe BASIC module can use DF1 to control communications with amodem. In this configuration,
Product OverviewAppendixA A –10The BASIC module offers two types of memory modules for BASICprogramming. A 24K byte battery-backed RAM to store BASI
Product OverviewAppendix A A –11Environmental ConditionsCondition RangeOperating temperature0° C to 60° C (32° F to 140° F)Storage temperature–40° C
Product OverviewAppendixA A –12Port IsolationPort Isolation Isolation voltagePRT1backplane to port 500V dcPRT2 backplane to port 500V dcPRT1 and PRT2
Product OverviewAppendix A A –13Product Catalog number8K byte EEPROM memory module (supports turbo mode)8K byte EEPROM memory module (supports normal
Product OverviewAppendixA A –14Notes:
B Appendix B –1Conversion TableThe table below lists the decimal, hexadecimal, octal, and ASCIIconversions. Refer to Chapter 8 for information on dat
AppendixB B –2Notes:
C Appendix C –1TroubleshootingThis appendix describes: On page:interpret the indicator lights C –1error messages from BASIC C –2error messages from C
ChapterInstalling the BASIC Module1 1 -11Use the plastic keying clips shipped with each I/O chassis to key the I/Oslot to accept only a BASIC module.
TroubleshootingAppendixC C –2When BASIC is in Run mode the format of the error messages is:Error:XXX - IN LINE YYYYYY BASIC STATEMENT-------XWhere:X
TroubleshootingAppendix C C –3Occurs when:This errormessage:BAD ARGUMENTthe argument of an operator is not within the limits of the operatorfor exam
TroubleshootingAppendixC C –4Your module generates these messages if an error occurs while the moduletries to execute a CALL routine.PRT2 Port Suppor
TroubleshootingAppendix C C –5String Support CALL Error MessagesThis error message: Occurs when:INSUFFICIENTSTRING SIZEthe resulting string cannot ho
TroubleshootingAppendixC C –6Miscellaneous CALL Error MessagesThis error message: Occurs when:INVALID BAUD RATEENTEREDa communication rate other than
D Appendix D –1Series A Configuration PlugsThis appendix gives you the configuration plug settings for the Series ABASIC module. If you have a Series
AppendixD D –2Notes:
E Appendix E –1Quick ReferenceThis appendix gives you an alphabetical quick reference table to thedifferent, operators (Chapter 9), commands (Chapter
Quick ReferenceAppendixE E –2PageDescriptionBASICCALL 31display PRT2 port parameters 12 -21CALL 32 enable/disable processor interrupt 12 -22CALL 33 t
Quick ReferenceAppendix E E –3PageDescriptionBASICCALL 87check DH-485 interface file remote read status 13 -15CALL 88 BASIC floating point to PLC-5 f
ChapterInstalling the BASIC Module1 1 -12You are now ready to install the module into the I/O chassis.ATTENTION: Disconnect and lockout all power from
Quick ReferenceAppendixE E –4PageDescriptionBASICCTRL Qrestart a LIST or PRINT interrupted by CTRL-S 10 -5CTRL S interrupt the scrolling of code duri
Quick ReferenceAppendix E E –5PageDescriptionBASICON-GOSUBtransfer control to subroutine when expressionfollowing ON is encountered11 -24ON-GOTO tran
Quick ReferenceAppendixE E –6PageDescriptionBASICVERprint current version of the firmware 10 -21XBY read/assign external data memory 9 -19XFER transf
IndexI-1Symbols.AND., logical operator, 9-7.OR., logical operator, 9-8.XOR., logical operator, 9-8# BYTES/STRING EXCEED 254,C-4# operator, SOC-3, 9-17
IndexI-24-digit BCD to BASIC floatingpoint, CALL 17, 12-11See also CALL 274-digit signed octal to BASICfloating point, CALL 12, 12-7See also CALL 224-
IndexI-3BAD ARGUMENT, C-3BAD POSITION, C-5BAD SYNTAX, C-3BASIC, definition, Using-3BASIC Development Software,ordering, A-13BASIC Development Soft
IndexI-4See also CALLs 73, 74, 80battery-backed RAM disable,CALL 73, 13-5See also JW7battery-backed RAM enable,CALL 74, 13-5See also JW7baud rates. Se
IndexI-5cable pinoutDB25, 2-2RJ45, 2-3cables, 2-11calendar, A-2calendar calls, 7-4CALL 0, reset module, 12-2CALL 1, no operation, 12-2CALL 2,timed-bl
IndexI-6CALL 31, display PRT2 portparameters, 12-21CALL 32, enable/disableprocessor interrupt, 12-22CALL 33, transfer data fromPRT1 or PRT2 to the BTR
IndexI-7CALL 77, protected variablestorage, 13-6See also LD@, MTOP, ST@CALL 78, set program portcommunication rate, 13-8CALL 79, no operation, 13-8CA
ChapterInstalling the BASIC Module1 1 -13Now that you have installed your BASIC module into the I/O rack,you need to connect your external devices to
IndexI-8CALL 116, call user definedassembly language routine, 13-50CALL 117, DF1 packet length,13-51CALL 118, PLC/SLC unsolicitedwrites, 13-52CALL 119
IndexI-9set date, CALL 41, 12-40set day of week, CALL 42,12-40set time, CALL 40, 12-39clock calls, 7-4clock/calendar accuracy, A-12CLOCK0, 11-4See al
IndexI-10leased phone line, 2-10radio link, 2-10components needed for DH-485communication1747-AIC Isolated LinkCoupler, 2-111747-KE DH-485/RS-232CComm
IndexI-11CALL 52, 12-58setting, CALL 41, 12-40date retrieve numeric, CALL 44,12-41date/time retrieve string, CALL43, 12-41day of weekretrieve numeric,
IndexI-12read remote data file, CALL 49,12-44read remote data file to BASICinput buffer, CALL 90, 13-18serial communication linkCALL 86, 13-14CALL 87,
IndexI-13DH-485/RS-232G InterfaceModule (1747-NU001),Using-4DH, DH+, DH-485 Protocoland Command Set ReferenceManual, Using-4National Electrical Code,U
IndexI-14example block transfer BASICprogram, 5-7example ladder logicCALl 118, 13-56CALL 122, 13-65CALL 123, 13-74CALL 32, 12-22CALL 33, 12-28CALL 34,
IndexI-15hardware handshaking, 2-5, 2-8,11-27hardware specification, powerrequirements, A-11hardware specificationsclock/calendar accuracy, A-12envi
IndexI-16INVALID DATE/TIME PUSHED,C-4INVALID INPUT DATA, C-4INVALID MTOP ADDRESSENTERED, C-5INVALID NUMBER PUSHED,C-4INVALID VALUE PUSHED, C-4JJEDE
IndexI-17memory manipulation calls, 7-1memory moduleconfiguration JW2, 3-7JW2, 1-4locations on board, 3-6memory modules, SOC-1, 3-4,A-2, A-10See also
ChapterInstalling the BASIC Module1 1 -14The BASIC module has 10 indicator LEDs:This LED: Indicates:ACTIVEthe module mode and whether the BASIC module
IndexI-18CALL 13, 12-8CALL 14, 12-8CALL 15, 12-9CALL 17, 12-11CALL 20, 12-12CALL 21, 12-13CALL 22, 12-13CALL 23, 12-14CALL 24, 12-15CALL 25, 12-16CALL
IndexI-19pinout for connectors, 2-2PLC processordefinition, Using-3read remote DF1 PLC data file,CALL 122, 13-58unsolicited write, CALL 118,13-52write
IndexI-20ROM to RAM, 13-2ROM/RAM to ROM, 13-3PROGRAMMING, C-3programmingASCII terminal emulator, 4-3BASIC Development Software,4-4BASIC module output
IndexI-21See also Chapter 2programming interface, A-5,A-6receive buffer, 2-3clear, CALL 96, 13-33number of characters in,CALL 95, 13-32print, CALL 10
IndexI-22set handshaking, CALL 30,12-20See also MODEset parameters, 11-20See also CALL 31CALL 30, 12-20See also MODEtransfer data from BTW buffer,12-2
IndexI-23relational expressions, 9-1relational operator, 9-9equal to (=), 9-9greater than (>), 9-9greater than or equal to (>=),9-9less than (&l
IndexI-24CALL 32, 12-22CALL 33, 12-28CALL 34, 12-33CALL 49, 12-49CALL 50, 12-57PLC-2 processor, 5-8PLC-3 processor, 5-9PLC-5 processor, 5-10, 5-11PLC-
IndexI-25SQR, functional operator, 9-12ST@, 11-35See also LD@, CALL 77statement, IDLE, 11-14statements, 4-2, 11-1See also Chapter 11CLEAR, 11-2CLEARI,
IndexI-26find a string in a string, CALL64, 12-63insert a string in a string, CALL66, 12-65repeat string, CALL 60, 12-59replace a string in a string,C
IndexI-27contacting Allen-Bradley,Using-6error messages from BASIC,C-2error messages from CALLroutines, C-4LED indicators, C-1memory support errorme
2 Chapter 2 -1Using the Communication PortsThis chapter describes: On page:communication ports overview2 -1communication modes 2 -2handshaking 2 -4com
IndexI-28PLC, PLC-2, PLC-3, PLC-5 are registered trademarks of the Allen-Bradley Company, Inc.PLC-5/250, SLC, SLC 500 are a trademarks of the Allen-Br
Allen-BradleyPublication Problem ReportIf you find a problem with our documentation, please complete and return this form.Pub. NameCat. No.Pub. No. Pu
PLEASE FASTEN HERE (DO NOT STAPLE)Other CommentsPLEASE FOLD HEREPLEASE REMOVENO POSTAGE NECESSARY IF MAILED IN THE UNITED STATESBUSINESS REPLY MAILFir
32With major offices worldwide.Algeria • Argentina • Australia • Austria • Bahrain • Belgium • Brazil • Bulgaria • Canada • Chile • China, PRC • Colom
Preface ASummary of ChangesSOC-2EEPROM Programming SupportThe Series B module has two sockets for memory modules: one forEEPROM and the other for EPRO
ChapterUsing the Communication Ports2 2 -2PRT1 and PRT2 Port You can configure ports PRT1 and PRT2 for these communication modes: RS-232C – communica
ChapterUsing the Communication Ports2 2 -3PRT1 and PRT2 Transmit and Receive BuffersPorts PRT1 and PRT2 each have a 256-character receive (input) buf
ChapterUsing the Communication Ports2 2 -4The BASIC module support both hardware and software handshaking.You turn hardware and software handshaking o
ChapterUsing the Communication Ports2 2 -5Hardware HandshakingThe BASIC module uses these rules when hardware handshaking isenabled. The BASIC module
ChapterUsing the Communication Ports2 2 -6You can operate PRT1 and PRT2 ports full-duplex and DH485 porthalf-duplex at 300, 600, 1200, 2400, 4800, 960
ChapterUsing the Communication Ports2 2 -7Depending on how you set jumper JW4 (see Set Operating Mode, page 1 -6), you can configure:Port PRT1 as: ASC
ChapterUsing the Communication Ports2 2 -8ASCII PortIf you set JW4 to one of the configurations shown at the left, PRT1 and/orPRT2 are ASCII ports (as
ChapterUsing the Communication Ports2 2 -9Program Port You can configure either PRT1 or DH485 as your program port.PRT1 Configured as Program PortIf y
ChapterUsing the Communication Ports2 2 -10DF1 ProtocolIf you set JW4 to the configuration shown at the left, PRT2 port can beconfigured via a BASIC p
ChapterUsing the Communication Ports2 2 -11Network PortIf you set JW4 to one of the configurations shown at the left, your BASICmodule can be interfac
Preface ASummary of ChangesSOC-3Error-Trapping SupportThe ONERR statement (page 11 -23) traps overflow, underflow, anddivide-by-zero errors in the Ser
ChapterUsing the Communication Ports2 2 -121747-PIC Interface/Converter/1747-AIC Isolated Link CouplerUse the 1747-PIC interface/converter to convert
ChapterUsing the Communication Ports2 2 -131747-AIC Link Coupler/1784-KR DH-485 Interface CardThe 1784-KR DH-485 Interface Card enables your personal
ChapterUsing the Communication Ports2 2 -14Notes:
3 Chapter 3 -1Installing and Replacing ComponentsRefer to this chapter if you are installing or replacing a memory module orthe battery. If not, go o
ChapterInstalling and Replacing Components3 3 -2Before you can add or replace components, you must remove the modulefrom the I/O chassis. Go to page
ChapterInstalling and Replacing Components3 3 -3Before you can install the optional memory module or battery, you have todisassemble the BASIC module.
ChapterInstalling and Replacing Components3 3 -4The BASIC module supports these Allen-Bradley Memory Modules: 8K EEPROM (Cat. Nos. 1771-DBMEM1 or 174
ChapterInstalling and Replacing Components3 3 -5To install your optional memory module:Refer to this table when installing your memory module.Catalog
ChapterInstalling and Replacing Components3 3 -64. Place the board on a flat surface.20371–MSKT1 (PROMs with Carriers)SKT2(PROMs without Carriers)5. I
ChapterInstalling and Replacing Components3 3 -7Use a chip insertion tool with memory modules that have no carrier.SKT2(PROMs without Carriers)20373–M
Preface ASummary of ChangesSOC-4Turbo Speed Allows Faster Program ExecutionThe BASIC module operates up to four times faster than before.With a C tool
ChapterInstalling and Replacing Components3 3 -8The battery backs up 24K bytes of user RAM and the clock/calendar.Drain on the battery should be less
ChapterInstalling and Replacing Components3 3 -9To replace the battery:1. Remove the BASIC module from the I/O chassis. If you need furtherinstruction
ChapterInstalling and Replacing Components3 3 -104. Remove the battery and insert a fresh one. Make sure you install thebattery in the correct orient
ChapterInstalling and Replacing Components3 3 -11After installing the memory module or battery, reassemble the BASICmodule as follows:1. Insert the bo
ChapterInstalling and Replacing Components3 3 -12Notes:
4 Chapter 4 -1Programming the BASIC ModuleThis chapter describes: On page:programming instructions4 -1create a program 4 -2number program lines 4 -6en
ChapterProgramming the BASIC Module4 4 -2BASIC StatementsBASIC statements are programming instructions that control program flowor manipulate I/O and
ChapterProgramming the BASIC Module4 4 -3You can create and edit your BASIC program using a personal computeralong with BASIC Development Software (PB
ChapterProgramming the BASIC Module4 4 -4BASIC Development Software (PBASE)Use a personal computer with the BASIC Development software (PBASE)to creat
ChapterProgramming the BASIC Module4 4 -5DH-485 InterfaceIn this configuration, you interface the serial port on the personal computerwith port DH485
Preface ASummary of ChangesSOC-5Call Routine Changes and AdditionsThese calls are new to the Series B, BASIC module:Statement PageCALL 0reset the modu
ChapterProgramming the BASIC Module4 4 -6BASIC program lines always begin with a line number ranging from 0 to65535. The line numbers indicate the or
ChapterProgramming the BASIC Module4 4 -7To enter a BASIC program using an ASCII terminal follow these steps.Important: Refer to the BASIC Development
ChapterProgramming the BASIC Module4 4 -8If a program is in RAM and you programmed the BASIC module toexecute from RAM, the program starts running on
ChapterProgramming the BASIC Module4 4 -9Run the ProgramTo run a BASIC program, type RUN (page 10 -19) at the system prompt [>].READY>RUN HELLO
ChapterProgramming the BASIC Module4 4 -10Notes:
5 Chapter 5 -1Programming Block-TransfersThis chapter describes: On page:BASIC module memory organization5 -1data tables 5 -2block-transfer buffers 5
ChapterProgramming Block-Transfers5 5 -2The BASIC module communicates with any PLC processor that hasblock-transfer capability. Your ladder logic pro
ChapterProgramming Block-Transfers5 5 -3Input Image TableInput Image Table Bit DescriptionUsed with CALL①00 Do not use–Reserved –01 BTW Req 3 and 602
ChapterProgramming Block-Transfers5 5 -4Block-Transfer Write BufferThe BASIC module processor maintains a block-transfer-write (BTW)buffer containing
ChapterProgramming Block-Transfers5 5 -5The BASIC module is a bi-directional block-transfer module.Bi-directional means that the module performs both
Preface ASummary of ChangesSOC-6The definitions of these calls have changed:Important: The Series A definitions are not supported in the Series B.CALL
ChapterProgramming Block-Transfers5 5 -6Block-Transfer Programming TipsRemember these block-transfer programming tips: Block lengths PUSHed for CALLs
ChapterProgramming Block-Transfers5 5 -7Sample BASIC Block-Transfer ProgramThis sample program assumes that the application requires a singleblock-tra
ChapterProgramming Block-Transfers5 5 -8The Mini-PLC-2 (cat. no. 1772-LN3) and PLC 2/20 (cat. no. 1772-LP1,-LP2) processors use multiple GET instructi
ChapterProgramming Block-Transfers5 5 -9You can use this ladder logic program with PLC-3 or PLC-3/10 processors.This program assumes that your applica
ChapterProgramming Block-Transfers5 5 -10Asynchronous Block TransferYou can use this ladder logic program with PLC-5 processors forasynchronous block
ChapterProgramming Block-Transfers5 5 -11Synchronous Block TransferYou can use this ladder logic program only with PLC-5 processors toperform synchron
ChapterProgramming Block-Transfers5 5 -12You can use this ladder logic program with PLC-5/250 Family processors.This program assumes that your applica
6 Chapter 6 -1Editing and Debugging a BASIC ProgramThis chapter describes: On page:edit a program line 6 -1delete a program line 6 -3renumber a p
ChapterEditing and Debugging a BASIC Program6 6 -2You can perform any of these edit operations:Operation Function Key Strokesdeleteuse the delete op
ChapterEditing and Debugging a BASIC Program6 6 -3When the BASIC module is in Command mode, you can delete an existingline of the BASIC program. To
Preface ASummary of ChangesSOC-7We have corrected these items that appeared in the previous version of thismanual (1771-6.5.113; November 1994). We s
ChapterEditing and Debugging a BASIC Program6 6 -4The BRKPNT (page 10 -2) command and SNGLSTP command (page10 -20), along with the STOP statement (p
7 Chapter 7 -1Using BASIC Module StatementsThis chapter groups the statements and calls required to manipulate thevarious hardware parts of the BASIC
ChapterUsing BASIC Module Statements7 7 -2MiscellaneousStatement PageCALL 18re-enable control C break function 12 -11CALL 19 disable the control C bre
ChapterUsing BASIC Module Statements7 7 -3PRT2 PortStatement PageMODE11 -20PRINT# 11 -29GET# 11 -12INPL# 11 -16INPS# 11 -16INPUT# 11 -17EOF# 9 -17LIST
ChapterUsing BASIC Module Statements7 7 -4Use these calls to convert numbers between integer and BASICfloating-point. Use these calls also to transfe
ChapterUsing BASIC Module Statements7 7 -5Use theses calls to manipulate string data structures within a BASICprogram or from the command line.Statem
ChapterUsing BASIC Module Statements7 7 -6Use these calls when you have PRT2 port configured for DF1 protocol.Important: CALL 108 must be used before
ChapterUsing BASIC Module Statements7 7 -7Use these calls to cause a function to occur within the BASIC module.You cannot execute these calls within t
ChapterUsing BASIC Module Statements7 7 -8Use these calls to allow the BASIC module to read input data from itsexternal ports. You can execute these
ChapterUsing BASIC Module Statements7 7 -9Use these calls to allow the transfer of data from the BASIC module toexternal ports PRT1, PRT2, and DH485 w
Commentaires sur ces manuels