Rockwell-automation 1771-DB BASIC MODULE Uživatelský manuál Strana 1

Procházejte online nebo si stáhněte Uživatelský manuál pro Zařízení Rockwell-automation 1771-DB BASIC MODULE. Rockwell Automation 1771-DB BASIC MODULE User Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 394
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků

Shrnutí obsahu

Strany 1 - Allen-Bradley

UserManualBASIC ModuleSeries B(Cat. No. 1771-DB)Allen-Bradley

Strany 2 - Important User Information

Preface ASummary of ChangesSOC-8Notes:

Strany 3

ChapterUsing BASIC Module Statements7 7 -10Use these calls to monitor the status of the BASIC module. You canexecute these calls from a BASIC program

Strany 4 - Five New LED Indicators

8 Chapter 8 -1Data TypesThis chapter describes: On page:argument stack8 -1control stack 8 -1string data types 8 -2numeric data types 8 -3backplane con

Strany 5 - DH-485 Network Support

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

Strany 6 - Reset Switch Support

ChapterData Types8 8 -3Two numeric data types exist: integer floating-pointYou can enter and display these numeric data types in four formats: integer

Strany 7

ChapterData Types8 8 -4The BASIC module communicates with the local processor through the I/O chassis backplane. All data communicated to and from th

Strany 8 - 1746-BAS Compatibility

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

Strany 9 - Since the Last Printing

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

Strany 10 - Summary of Changes

ChapterData Types8 8 -76-Digit, Signed, Fixed Decimal BCDThis value requires two words of the processor data table. The first wordcontains overflow,

Strany 11 - Using This Manual

ChapterData Types8 8 -83.3-Digit, Signed, Fixed Decimal BCDThis value requires two words of the processor data table. The first wordcontains the over

Strany 12 - How To Use This Manual

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

Strany 13 - Terms and Abbreviations

publication 1771-6.5.113PrefaceBUsing-1Using This ManualThis introduction describes how to properly and efficiently use thismanual.This introduction t

Strany 14 - Related Publications

ChapterData Types8 8 -10Notes:

Strany 15 - Getting Started

9 Chapter 9 -1Expressions, Variables and OperatorsThis chapter describes: On page:expressions9 -1relational expressions 9 -1constants 9 -1variables 9

Strany 16 - Allen-Bradley Support

ChapterExpressions, Variables and Operators9 9 -2Variables may represent either numeric values or strings. Numeric valuesare floating point variables

Strany 17 - Chapter 4

ChapterExpressions, Variables and Operators9 9 -3Eight types of operators may act on an expression:G arithmetic G functionalG logical G logarithmic

Strany 18 - Chapter 8

ChapterExpressions, Variables and Operators9 9 -4Operator Function PageABSreturn the absolute value of expression 9 -11+ add expressions together 9 -5

Strany 19 - Operators

ChapterExpressions, Variables and Operators9 9 -5The BASIC module contains a complete set of two-operand andone-operand arithmetic operators.The gener

Strany 20

ChapterExpressions, Variables and Operators9 9 -6Negation ( – )Use the negation operator to change an expression from positive tonegative.>PRINT -(

Strany 21 - Call Routines 0 - 68

ChapterExpressions, Variables and Operators9 9 -7The BASIC module contains a complete set of bitwise logical operators.Bitwise operators perform their

Strany 22 - Call Routines 69-127

ChapterExpressions, Variables and Operators9 9 -8.OR.Use the bitwise .OR. operator to perform a bitwise OR on two expressions.The .OR. operator compar

Strany 23

ChapterExpressions, Variables and Operators9 9 -9Relational expressions involve the operators =, < >, >, >=, <, and <=. In the BASI

Strany 24 - Appendix E

Preface BUsing This ManualUsing-2This manual is designed so you can follow it to install your hardware andprogram your BASIC module.TroubleshootingA12

Strany 25 - Installing the BASIC Module

ChapterExpressions, Variables and Operators9 9 -10The BASIC module contains a complete set of trigonometric operators.These operators are one-operand

Strany 26 - (Cat. No. 1771-DB)

ChapterExpressions, Variables and Operators9 9 -11ATNUse the ATN operator to return the arctangent of the argument. The result is in radians. Calcul

Strany 27 - Configure the Jumpers

ChapterExpressions, Variables and Operators9 9 -12INTUse the INT operator to return the integer portion of the expression.>PRINT INT(3.7) Result: 3

Strany 28

ChapterExpressions, Variables and Operators9 9 -13The BASIC module contains a complete set of logarithmic operators.These operators are one-operand op

Strany 29

ChapterExpressions, Variables and Operators9 9 -14Two operators in the BASIC module can manipulate strings. These operators are ASC and CHR.ASCUse th

Strany 30

ChapterExpressions, Variables and Operators9 9 -15The numbers printed in this example represent the ASCII characters Athrough L.>NEW>1 REM EXAM

Strany 31

ChapterExpressions, Variables and Operators9 9 -16CHRUse the CHR operator to convert a numeric expression to an ASCIIcharacter.>PRINT CHR(65)Result

Strany 32

ChapterExpressions, Variables and Operators9 9 -17The BASIC module contains a complete set of special function operators.These operators manipulate th

Strany 33

ChapterExpressions, Variables and Operators9 9 -18MTOPUse the MTOP operator to retrieve the last valid memory address in RAMthat is available to the B

Strany 34 - Placement

ChapterExpressions, Variables and Operators9 9 -19XBYUse the XBY operator to retrieve or assign data to or from the externalRAM data memory of the BAS

Strany 35 - Key the Backplane Connector

Preface BUsing This ManualUsing-3Throughout this manual, we abbreviate some terms. The terms andabbreviations listed in this table are specific to th

Strany 36 - 1771 I/O Chassis

ChapterExpressions, Variables and Operators9 9 -20You can change the fraction portion of TIME by manipulating the contentsof internal memory location

Strany 37 - Reset the Module

10 Chapter 10 -1CommandsBASIC commands are programming instructions that you execute duringthe Command mode except for Ctrl+C. Ctrl+C takes you fromR

Strany 38 - Read the Indicator Lights

ChapterCommands10 10 -2Use the BRKPNT command to set a program break point at the linenumber you specify with this command. Program execution stops j

Strany 39 - Using the Communication Ports

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)

Strany 40 - Communication

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

Strany 41 - DH485 Port

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

Strany 42 - Handshaking

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

Strany 43 - Hardware Handshaking

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

Strany 44 - Communication Rates

ChapterCommands10 10 -8Use the ERASE command to delete the last BASIC program stored inEEPROM through a PROG command (page 10 -11).SyntaxERASE ReturnE

Strany 45 - Operating

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

Strany 46 - ASCII Port

Preface BUsing This ManualUsing-4We use these conventions in this manual:In this manual, we show: Like this:prompts and messagesPress a function keyli

Strany 47 - Program Port

ChapterCommands10 10 -10Use the NEW command to delete the program and all variables currentlystored in RAM. In addition, all variables are set equal

Strany 48 - DF1 Protocol

ChapterCommands10 10 -11Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. See also C

Strany 49 - Network Port

ChapterCommands10 10 -12Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. Also see C

Strany 50

ChapterCommands10 10 -13Important: Before you attempt to program an EEPROM, read the PROG,PROG1, PROG2, and MODE sections of this chapter. Also see

Strany 51

ChapterCommands10 10 -14StartErase RAMIsbattery back-upenabled?programHasPROG1 or PROG2been executed?Isbattery backedRAM MTOP andPrint sign-onmessageE

Strany 52

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

Strany 53 - Chapter

ChapterCommands10 10 -16Use the REN command to renumber program lines.Important: REN command updates the destination of GOSUB, GOTO, ONERR,ONTIME an

Strany 54 - Remove the BASIC Module

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

Strany 55 - Disassemble the BASIC

ChapterCommands10 10 -18Use the RROM command to tell the BASIC module interpreter to selectthe current program out of EEPROM or EPROM and then execute

Strany 56 - Install Optional Memory

ChapterCommands10 10 -19Use the RUN command to set all variables equal to zero, clear all BASICevoked interrupts, and begin program execution with the

Strany 57

Preface BUsing This ManualUsing-5To install and program the BASIC module follow the flowchart below.Do you need information on configuring/using commu

Strany 58

ChapterCommands10 10 -20Use the SNGLSTP command to initiate single-step program execution. If the number you specify with this command is zero, singl

Strany 59

ChapterCommands10 10 -21Use the VER command to print the BASIC module sign-on message thatdisplays the current version of the firmware.SyntaxVER Retur

Strany 60 - Install the Battery

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

Strany 61 - Screwdriver Slots

11 Chapter 11 -1StatementsBASIC statements are programming instructions that control program flowor manipulate I/O or memory. Every statement begins

Strany 62

ChapterStatements11 11 -2Use the CLEAR statement to set all variables equal to 0 and reset allBASIC evoked interrupts and stacks. This means that afte

Strany 63 - Reassemble the BASIC

ChapterStatements11 11 -3Use the CLEARI statement to clear all of the BASIC evoked interrupts.The ONTIME (page 11 -25) interrupt is disabled after you

Strany 64

ChapterStatements11 11 -4Use the CLOCK0 (zero) statement to disable or turn off the free runningclock resident on the BASIC module. After you execute

Strany 65 - Programming the BASIC Module

ChapterStatements11 11 -5Use the CLOCK1 statement to enable the free running clock resident onthe BASIC module. The special function operator TIME (p

Strany 66 - Create a Program

ChapterStatements11 11 -6Use the DATA statement to specify the expressions that you can retrievewith a READ statement (page 11 -31). If you use multi

Strany 67 - ASCII Terminal Emulator

ChapterStatements11 11 -7Use the DIM statement to reserve storage for arrays. The storage area isfirst assumed to be zero. Arrays in the BASIC modul

Strany 68

Preface BUsing This ManualUsing-6Allen-Bradley offers support services worldwide, with over 75sales/support offices, 512 authorized distributors and 2

Strany 69

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

Strany 70 - Number Program Lines

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

Strany 71 - All rights reserved

ChapterStatements11 11 -10Use the END statement to terminate program execution. CONT (page10 -3) does not operate if you use the END statement to ter

Strany 72

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

Strany 73

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

Strany 74

ChapterStatements11 11 -13Use the GOSUB statement to cause the BASIC module to transfer controlof the program to the line number the GOSUB statement r

Strany 75 - Programming Block-Transfers

ChapterStatements11 11 -14Use the GOTO statement to cause BASIC to transfer control to the linenumber you specify. If line number you specify does no

Strany 76 - Data Tables

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

Strany 77 - Input Image Table

ChapterStatements11 11 -16Use the INPL statement to read an entire line (up to 254 characters) fromthe program port buffer. The line must be stored

Strany 78 - Block-Transfer Buffers

ChapterStatements11 11 -17Use the INPUT statement to enter data from the console device duringprogram execution. You may assign data to one or more v

Strany 79 - Block-Transfers and the

Table of ContentsTOC-1Chapter 1What’s in This Chapter? 1-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guard Against Electrostatic Da

Strany 80 - Programming Block-T

ChapterStatements11 11 -18Use the LD@ statement to retrieve floating point numbers stored with aST@ statement (page 11 -35). The expression following

Strany 81

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

Strany 82 - Ladder Logic

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

Strany 83

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

Strany 84 - Asynchronous Block Transfer

ChapterStatements11 11 -22Use the ONDF1 statement to enable or disable the DF1 packet interruptcapability. (ONDF1 is equivalent to CALL 16, page 12 -

Strany 85 - Synchronous Block Transfer

ChapterStatements11 11 -23Use the ONERR statement to handle arithmetic errors, if they occur, duringprogram execution. The ONERR statement only traps

Strany 86

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

Strany 87 - Edit a Program Line

ChapterStatements11 11 -25Use the ONTIME expr, ln num statement to compensate for theincompatibility between the timer/counters on the microprocessor

Strany 88

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

Strany 89 - Renumber a Program

ChapterStatements11 11 -27Use the PH0. and PH1. statements to direct the BASIC module to print anumber in hexadecimal format to the console device. T

Strany 90 - Debug a Program

Table of ContentsTOC-2Chapter 5What’s in This Chapter? 5-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BASIC Module Memory Organizati

Strany 91 - Using BASIC Module Statements

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

Strany 92 - Port Communication Calls

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

Strany 93 - Block-Transfer Support

ChapterStatements11 11 -30Use the PUSH statement to place the arithmetic expression or expressionsin the BASIC module argument stack. This statement

Strany 94 - Clock/Calendar Calls

ChapterStatements11 11 -31Use the READ statement to retrieve the expressions that you specified inthe DATA statement (page 11 -6) and assign the value

Strany 95 - DH-485 Communication

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

Strany 96 - Background Operations

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

Strany 97 - Interrupt Support Calls

ChapterStatements11 11 -34Use the RETURN statement to return control to the statement followingthe most recently executed GOSUB (page 11 -13). Use on

Strany 98

ChapterStatements11 11 -35Use the ST@ statement to store BASIC module floating point numbers to aspecified address. The expression following the ST@

Strany 99 - Setup Calls

ChapterStatements11 11 -36Use the STOP statement to break program execution at specific points in aprogram. After a program is stopped you can displa

Strany 100 - What’s Next?

ChapterStatements11 11 -37Use the STRING statement to allocate memory for strings. Initially, memory is not allocated for strings. If you attempt to

Strany 101 - Data Types

Table of ContentsTOC-3Chapter 9What’s in This Chapter? 9-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions 9-1. . . . . . . .

Strany 102 - String Data Types

ChapterStatements11 11 -38Important: Define strings in your program first, unless you are executinga CALL 77 (page 13 -6). Then, execute the CALL 77

Strany 103 - Numeric Data Types

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

Strany 104 - Backplane Conversion

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

Strany 105 - 16-Bit Binary (4 Hex Digits)

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

Strany 106 - 4-Digit, Signed, Octal

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

Strany 107

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

Strany 108

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

Strany 109

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

Strany 110

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

Strany 111 - Constants

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

Strany 112 - Variables

Because of the variety of uses for the products described in thispublication, those responsible for the application and use of this controlequipment m

Strany 113 - Order of Operations

Table of ContentsTOC-4Chapter 11What’s in This Chapter? 11-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLEAR 11-2. . . . . . . . .

Strany 114

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

Strany 115

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

Strany 116 - Arithmetic Errors

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

Strany 117 - Bitwise Operators

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

Strany 118

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

Strany 119 - Relational Operators

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

Strany 120

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

Strany 121 - Functional Operators

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

Strany 122

ChapterCall Routines 0–6812 12 -18Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use CALL 29 in

Strany 123 - Logarithmic Operators

ChapterCall Routines 0–6812 12 -19SyntaxPUSH 49, 50, 122, or 123 for the CALL you want to activateCALL 29POP status of transactionExampleCALL 122 must

Strany 124 - String Operators

Table of ContentsTOC-5Chapter 12What’s in This Chapter? 12-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CALL 0: Reset Module 12-2. .

Strany 125

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

Strany 126

ChapterCall Routines 0–6812 12 -21SyntaxPUSH number of bits/wordPUSH parityPUSH number of stop bitsPUSH software handshakingPUSH hardware handshaking

Strany 127 - Special Function Operators

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

Strany 128

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

Strany 129

ChapterCall Routines 0–6812 12 -241. When data is available from the port, the BASIC moduleautomatically transfers the data into the BTR buffer. The

Strany 130

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

Strany 131 - Commands

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

Strany 132

ChapterCall Routines 0–6812 12 -27Input Argument FiveThe fifth input argument should always be 1.Input Argument SixThe sixth input argument is the str

Strany 133

ChapterCall Routines 0–6812 12 -28SyntaxPUSH source port numberPUSH maximum number of characters to be transferredPUSH decimal value of character deli

Strany 134

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

Strany 135

Table of ContentsTOC-6CALL 39: 3.3-Digit Signed, Fixed Decimal BCD to BASIC Floating Point 12-38. . . . . . . . . . . . . . . . . . . . . . . CALL 40:

Strany 136

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

Strany 137 - Backspace

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

Strany 138

ChapterCall Routines 0–6812 12 -32Input Argument TwoThe second input argument is always 0.Input Argument ThreeThe third input argument is always 1.Inp

Strany 139

ChapterCall Routines 0–6812 12 -33SyntaxPUSH destination port number and/or internal stringPUSH 0PUSH 1PUSH string numberPUSH byte swap selectionCALL

Strany 140

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

Strany 141

ChapterCall Routines 0–6812 12 -35Use this routine to retrieve the number of characters in the buffer youchoose.Input and Output ArgumentsThis routine

Strany 142

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

Strany 143

ChapterCall Routines 0–6812 12 -37DescriptionStatus code17no DATA available for READ18 DF1 cannot be enabled (JW4 in wrong position)19• illegal use of

Strany 144

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

Strany 145

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

Strany 146 - Examples

Table of ContentsTOC-7CALL 90: Read Remote DH-485 Data File to BASIC Input Buffer 13-18. . . . . . . . . . . . . . . . . . . . . . .

Strany 147

ChapterCall Routines 0–6812 12 -40Use this routine to set the wall clock date functions.Input and Output ArgumentsThis routine has three input argumen

Strany 148

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

Strany 149

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

Strany 150

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

Strany 151

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

Strany 152 - Line Calls

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

Strany 153 - Statements

ChapterCall Routines 0–6812 12 -46This call is active until you re-execute it with different input parameters.Input and Output ArgumentsThis call has

Strany 154

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

Strany 155

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 =

Strany 156

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

Strany 157

Table of ContentsTOC-8Appendix AWhat’s in This Appendix? A-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Features A-1. . . . . . . .

Strany 158

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

Strany 159

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

Strany 160 - rel expr

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

Strany 161 - DO-WHILE

ChapterCall Routines 0–6812 12 -53Once this call is active, it remains active and sends data to the remote nodewhenever the PLC processor handshaking

Strany 162

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

Strany 163 - FOR-TO-(STEP)-NEXT

ChapterCall Routines 0–6812 12 -55Input Argument EightThe eighth input argument is the selection of the source BTW buffer or theinternal string: 0 =

Strany 164

ChapterCall Routines 0–6812 12 -56SyntaxPUSH type of DH-485 WRITE commandPUSH remote DH-485 device node numberPUSH remote DH-485 device file numberPU

Strany 165

ChapterCall Routines 0–6812 12 -57Sample Ladder Logic(L)O:00115BTWBLOCK TRANSFER WRITERack Group Module 0010N7:0N10:1064Control BlockData fil

Strany 166

ChapterCall Routines 0–6812 12 -58Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use CALL 52 to

Strany 167 - IF-THEN-ELSE

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

Strany 168

1 Chapter 1 -1Installing the BASIC ModuleThis chapter describes: On page:guard against electrostatic discharge1 -1unpack the module 1 -2calculate powe

Strany 169

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

Strany 170

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

Strany 171

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

Strany 172

ChapterCall Routines 0–6812 12 -63Use this routine to find a string within a string. It locates the firstoccurrence (position) of this string. This

Strany 173

ChapterCall Routines 0–6812 12 -64Use this routine to replace a string within a string.Input and Output ArgumentsThis routine has three input argument

Strany 174

ChapterCall Routines 0–6812 12 -65Use this routine to insert a string within another string.Input and Output ArgumentsThis routine has three input arg

Strany 175

ChapterCall Routines 0–6812 12 -66Use this routine to delete a string from within another string.Important: This routine deletes only the first occurr

Strany 176 - ON-GOSUB

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

Strany 177

ChapterCall Routines 0–6812 12 -68Notes:

Strany 178

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

Strany 179 - PH0. and PH1

ChapterInstalling the BASIC Module1 1 -2Verify all the items in your package against the packing sheet. If any ofthe items are missing or incorrect,

Strany 180

ChapterCall Routines 69–12713 13 -2Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.”Use this routi

Strany 181

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

Strany 182

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

Strany 183

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

Strany 184

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

Strany 185

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

Strany 186

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

Strany 187

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

Strany 188

ChapterCall Routines 69–12713 13 -10Use CALL 81 before storing a program in the EEPROM memory. This routine: determines the number of memory module

Strany 189

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

Strany 190

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

Strany 191 - Call Routines 0 – 68

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

Strany 192 - Transfer-Read Buffer

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

Strany 193 - Transfer-Write Buffer

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

Strany 194 - Transfer-Read Length

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

Strany 195 - Read Buffer

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

Strany 196 - Input and Output Arguments

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

Strany 197 - Call Routines 0–68

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

Strany 198

ChapterCall Routines 69–12713 13 -19Input Argument FourThe fourth input argument is the starting element offset within the file onthe remote device (0

Strany 199 - SLC 16-Bit Unsigned Integer

ChapterCall Routines 69–12713 13 -20Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call

Strany 200 - DF1 Packet Interrupt

ChapterCall Routines 69–12713 13 -21SyntaxPUSH remote device node addressPUSH remote device file numberPUSH remote device file typePUSH starting eleme

Strany 201 - C Break Function

ChapterInstalling the BASIC Module1 1 -4Set Watchdog Timer Enable Jumper (JW1)Use JW1 to enable the watchdog timer. Unless you are using assemblylang

Strany 202

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

Strany 203

ChapterCall Routines 69–12713 13 -23Input Argument FourThe fourth input argument is the starting element offset within the file onthe remote device (0

Strany 204 - Decimal BCD

ChapterCall Routines 69–12713 13 -24Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call

Strany 205 - 16-Bit Signed Integer

ChapterCall Routines 69–12713 13 -25SyntaxPUSH remote device node addressPUSH remote device file numberPUSH remote device file typePUSH starting eleme

Strany 206 - 16-Bit Binary

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

Strany 207

ChapterCall Routines 69–12713 13 -27Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call

Strany 208

ChapterCall Routines 69–12713 13 -28SyntaxPUSH remote device node addressPUSH starting element offset (x2) of remote device filePUSH number of words t

Strany 209

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

Strany 210 - Support Parameter Set

ChapterCall Routines 69–12713 13 -30Output Argument OneThe output argument specifies the status of the message instruction. Upon return from the call

Strany 211 - Parameters

ChapterCall Routines 69–12713 13 -31SyntaxPUSH remote device node addressPUSH starting element offset (x2) of remote device filePUSH number of words t

Strany 212 - Processor Interrupt

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

Strany 213 - BTR Buffer

ChapterCall Routines 69–12713 13 -32Use CALL 94 to display the current PRT1 port configuration on theterminal screen.Input and Output ArgumentsThis ro

Strany 214

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

Strany 215

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

Strany 216

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

Strany 217

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

Strany 218 - Sample Ladder Logic

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

Strany 219

ChapterCall Routines 69–12713 13 -38Undefined. If you execute an undefined call, you receive the errormessage, “ERROR–UNSUPPORTED CALL.” Use CALL 108

Strany 220

ChapterCall Routines 69–12713 13 -39Operational Codes for Half-Duplex Mode:OperationalcodeCorresponding mode of operation Special operational code(sam

Strany 221

ChapterCall Routines 69–12713 13 -40Modem Handshaking for Half-Duplex ModeModem handshaking Operational codes Descriptionhalf-duplex nohandshaking0–3•

Strany 222

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

Strany 223

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

Strany 224 - Input Character from PRT2

ChapterInstalling the BASIC Module1 1 -6Set Operating Mode Jumper (JW4)Use JW4 to configure your communication ports as a program port, ASCIIport, net

Strany 225 - Port Buffers

ChapterCall Routines 69–12713 13 -42Modem Handshaking for Full-Duplex ModeModem handshaking Operational codes Descriptionfull-duplex with nohandshakin

Strany 226 - CALL 38: Expanded ONERR

ChapterCall Routines 69–12713 13 -43Input Argument ThreeThe third input argument specifies the number of message retries when inhalf-duplex mode or th

Strany 227

ChapterCall Routines 69–12713 13 -44SyntaxPUSH operational codePUSH poll timeout or ACKnowledge timeoutPUSH message retries or ENQuiry retriesPUSH RTS

Strany 228 - BCD to BASIC Floating

ChapterCall Routines 69–12713 13 -45Use CALL 110 to print the complete PRT2 transmit buffer with addresses,front pointer and the number of characters

Strany 229 - Second)

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

Strany 230

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

Strany 231 - Numeric (Day, Month, Year)

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

Strany 232

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

Strany 233

ChapterCall Routines 69–12713 13 -50Use this call to execute a user generated assembly language routine. This call performs some preliminary checks.

Strany 234 - DH-485 SLC Data File

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

Strany 235

ChapterInstalling the BASIC Module1 1 -7Set Backplane Configuration (JW5)Use JW5 to set the BASIC module backplane configuration. The BASICmodule can

Strany 236

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

Strany 237

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

Strany 238

ChapterCall Routines 69–12713 13 -54Input and Output ArgumentsThis routine has five input arguments and one output argument.Argument Description Pagei

Strany 239

ChapterCall Routines 69–12713 13 -55Input Argument FourThe fourth input argument is the string number. If the second inputargument does not select in

Strany 240 - DH-485 SLC Data

ChapterCall Routines 69–12713 13 -56Example>1 REM EXAMPLE PROGRAM>10 REM ENABLE PLC/SLC UNSOLICITED WRITE INTERRUPT>15 PUSH 64: CALL 4: REM

Strany 241

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

Strany 242

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

Strany 243

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

Strany 244

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

Strany 245

ChapterCall Routines 69–12713 13 -61Input Argument OneThe first input argument is the type of PLC READ command you issued: 0 = disable the previously

Strany 246

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

Strany 247

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

Strany 248 - CALL 53 – 59

ChapterCall Routines 69–12713 13 -63Output Argument OneThe output argument is the status of the call. It has these values: 0 = successful 1 = disab

Strany 249 - CALL 60: String Repeat

ChapterCall Routines 69–12713 13 -64IndicatesCodeCArequest is too large; transaction size plus word address is toolargeCB access denied, privilege vio

Strany 250 - (Concatenation)

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

Strany 251 - Conversion

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

Strany 252 - CALL 63: String to Number

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

Strany 253 - CALL 64: Find a String

ChapterCall Routines 69–12713 13 -686. The BASIC module clears bit 13 in the input image table.PLC ProcessorClear Input ImageTable Bit 13BASIC ModuleP

Strany 254 - 65: Replace a String

ChapterCall Routines 69–12713 13 -6910. The BASIC module detects a successful block transfer and resets theinput image table bit 4.PLC ProcessorBASIC

Strany 255 - CALL 66: Insert String in a

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

Strany 256 - CALL 67: Delete String

ChapterCall Routines 69–12713 13 -71Input Argument SevenThe seventh input argument is the message time-out value. This value (1through 255) correspon

Strany 257 - CALL 68: Determine Length

ChapterInstalling the BASIC Module1 1 -9Set Battery Enable Jumper (JW7)Use JW7 to enable the battery. To conserve the battery, your module isshipped

Strany 258

ChapterCall Routines 69–12713 13 -72Code Indicates0transfer OK1 transmission failed2 enquiry time out3• with handshaking selected – either a loss of C

Strany 259 - Call Routines 69–127

ChapterCall Routines 69–12713 13 -73IndicatesCodeD5data conversion errorD6 the scanner is not able to communicate with a 1771 chassisadapterD7 the ada

Strany 260 - Program T

ChapterCall Routines 69–12713 13 -74Sample Ladder Logic(L)O:00113BTWBLOCK TRANSFER WRITERack Group Module 0010N7:5N10:11064Control BlockData

Strany 261 - CALL 71: ROM/RAM to ROM

A Appendix A –1Product OverviewThis appendix introduces you to the BASIC module.This appendix describes: On page:features A –1programming interfaces

Strany 262 - CALL 72: RAM/ROM Return

Product OverviewAppendixA A –2Hardware FeaturesHardware element DescriptionReset switchWhen you press this switch (located behind the module ejector

Strany 263 - CALL 75 – 76

Product OverviewAppendix A A –3Software FeaturesSoftware element DescriptionProgramming languageIntel BASIC-52 with enhancements• high-level math fun

Strany 264 - CALL 77: Protected Variable

Product OverviewAppendixA A –4Diagnostic FeaturesThe BASIC module has 10 indicator LED indicators. Use these LEDindicators for diagnostics and opera

Strany 265

Product OverviewAppendix A A –5Program the BASIC module using a subset of the Intel BASIC 52programming language. You can program the BASIC module

Strany 266 - Operation)

Product OverviewAppendixA A –6BASIC Development Software Use a personal computer with the BASIC Development software (PBASE)to create a BASIC program

Strany 267 - Condition

Product OverviewAppendix A A –7Your BASIC module may communicate with a DH-485 network. It canalso communicate with a remote device through a modem

Strany 268 - CALL 81: User PROM Check

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

Strany 269 - Port Parameters

Product OverviewAppendixA A –81747-AIC Link Coupler/1784-KR DH-485 Interface CardConfigurationThis configuration shows the BASIC module interfaced wi

Strany 270 - BASIC Input Buffer

Product OverviewAppendix A A –9DF1 Protocol ConfigurationThe BASIC module can use DF1 to control communications with amodem. In this configuration,

Strany 271 - Common Interface File

Product OverviewAppendixA A –10The BASIC module offers two types of memory modules for BASICprogramming. A 24K byte battery-backed RAM to store BASI

Strany 272 - Interface File Remote Write

Product OverviewAppendix A A –11Environmental ConditionsCondition RangeOperating temperature0° C to 60° C (32° F to 140° F)Storage temperature–40° C

Strany 273 - Interface File Remote Read

Product OverviewAppendixA A –12Port IsolationPort Isolation Isolation voltagePRT1backplane to port 500V dcPRT2 backplane to port 500V dcPRT1 and PRT2

Strany 274 - Point to PLC-5 Floating

Product OverviewAppendix A A –13Product Catalog number8K byte EEPROM memory module (supports turbo mode)8K byte EEPROM memory module (supports normal

Strany 275 - Point to BASIC Floating

Product OverviewAppendixA A –14Notes:

Strany 276 - Input Buffer

B Appendix B –1Conversion TableThe table below lists the decimal, hexadecimal, octal, and ASCIIconversions. Refer to Chapter 8 for information on dat

Strany 277

AppendixB B –2Notes:

Strany 278 - Output Argument One

C Appendix C –1TroubleshootingThis appendix describes: On page:interpret the indicator lights C –1error messages from BASIC C –2error messages from C

Strany 279

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.

Strany 280 - DH-485 Data File

TroubleshootingAppendixC C –2When BASIC is in Run mode the format of the error messages is:Error:XXX - IN LINE YYYYYY BASIC STATEMENT-------XWhere:X

Strany 281

TroubleshootingAppendix C C –3Occurs when:This errormessage:BAD ARGUMENTthe argument of an operator is not within the limits of the operatorfor exam

Strany 282

TroubleshootingAppendixC C –4Your module generates these messages if an error occurs while the moduletries to execute a CALL routine.PRT2 Port Suppor

Strany 283

TroubleshootingAppendix C C –5String Support CALL Error MessagesThis error message: Occurs when:INSUFFICIENTSTRING SIZEthe resulting string cannot ho

Strany 284 - File to BASIC Input Buffer

TroubleshootingAppendixC C –6Miscellaneous CALL Error MessagesThis error message: Occurs when:INVALID BAUD RATEENTEREDa communication rate other than

Strany 285

D Appendix D –1Series A Configuration PlugsThis appendix gives you the configuration plug settings for the Series ABASIC module. If you have a Series

Strany 287 - Buffer to Remote DH-485

E Appendix E –1Quick ReferenceThis appendix gives you an alphabetical quick reference table to thedifferent, operators (Chapter 9), commands (Chapter

Strany 288

Quick ReferenceAppendixE E –2PageDescriptionBASICCALL 31display PRT2 port parameters 12 -21CALL 32 enable/disable processor interrupt 12 -22CALL 33 t

Strany 289

Quick ReferenceAppendix E E –3PageDescriptionBASICCALL 87check DH-485 interface file remote read status 13 -15CALL 88 BASIC floating point to PLC-5 f

Strany 290 - Characters in PRT1 Buffers

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

Strany 291 - DTR Signal

Quick ReferenceAppendixE E –4PageDescriptionBASICCTRL Qrestart a LIST or PRINT interrupted by CTRL-S 10 -5CTRL S interrupt the scrolling of code duri

Strany 292 - CALL 99: Reset Print Head

Quick ReferenceAppendix E E –5PageDescriptionBASICON-GOSUBtransfer control to subroutine when expressionfollowing ON is encountered11 -24ON-GOTO tran

Strany 293

Quick ReferenceAppendixE E –6PageDescriptionBASICVERprint current version of the firmware 10 -21XBY read/assign external data memory 9 -19XFER transf

Strany 294 - Transmit Buffer and Pointer

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

Strany 295 - Default Settings

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-

Strany 296 - Driver Communications

IndexI-3BAD ARGUMENT, C-3BAD POSITION, C-5BAD SYNTAX, C-3BASIC, definition, Using-3BASIC Development Software,ordering, A-13BASIC Development Soft

Strany 297

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

Strany 298

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

Strany 299

IndexI-6CALL 31, display PRT2 portparameters, 12-21CALL 32, enable/disableprocessor interrupt, 12-22CALL 33, transfer data fromPRT1 or PRT2 to the BTR

Strany 300

IndexI-7CALL 77, protected variablestorage, 13-6See also LD@, MTOP, ST@CALL 78, set program portcommunication rate, 13-8CALL 79, no operation, 13-8CA

Strany 301

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

Strany 302 - Argument Stack

IndexI-8CALL 116, call user definedassembly language routine, 13-50CALL 117, DF1 packet length,13-51CALL 118, PLC/SLC unsolicitedwrites, 13-52CALL 119

Strany 303 - Port Transmit Buffer and

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

Strany 304 - Port Receive Buffer and

IndexI-10leased phone line, 2-10radio link, 2-10components needed for DH-485communication1747-AIC Isolated LinkCoupler, 2-111747-KE DH-485/RS-232CComm

Strany 305

IndexI-11CALL 52, 12-58setting, CALL 41, 12-40date retrieve numeric, CALL 44,12-41date/time retrieve string, CALL43, 12-41day of weekretrieve numeric,

Strany 306 - 14: Transmit DF1

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,

Strany 307 - 15: Check DF1

IndexI-13DH-485/RS-232G InterfaceModule (1747-NU001),Using-4DH, DH+, DH-485 Protocoland Command Set ReferenceManual, Using-4National Electrical Code,U

Strany 308 - Defined Assembly Language

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,

Strany 309 - 17: Get DF1 Packet

IndexI-15hardware handshaking, 2-5, 2-8,11-27hardware specification, powerrequirements, A-11hardware specificationsclock/calendar accuracy, A-12envi

Strany 310 - Unsolicited Writes

IndexI-16INVALID DATE/TIME PUSHED,C-4INVALID INPUT DATA, C-4INVALID MTOP ADDRESSENTERED, C-5INVALID NUMBER PUSHED,C-4INVALID VALUE PUSHED, C-4JJEDE

Strany 311

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

Strany 312

ChapterInstalling the BASIC Module1 1 -14The BASIC module has 10 indicator LEDs:This LED: Indicates:ACTIVEthe module mode and whether the BASIC module

Strany 313

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

Strany 314 - Port to Default Settings

IndexI-19pinout for connectors, 2-2PLC processordefinition, Using-3read remote DF1 PLC data file,CALL 122, 13-58unsolicited write, CALL 118,13-52write

Strany 315 - CALL 121

IndexI-20ROM to RAM, 13-2ROM/RAM to ROM, 13-3PROGRAMMING, C-3programmingASCII terminal emulator, 4-3BASIC Development Software,4-4BASIC module output

Strany 316 - DF1 PLC Data File

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

Strany 317

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

Strany 318

IndexI-23relational expressions, 9-1relational operator, 9-9equal to (=), 9-9greater than (>), 9-9greater than or equal to (>=),9-9less than (&l

Strany 319

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-

Strany 320

IndexI-25SQR, functional operator, 9-12ST@, 11-35See also LD@, CALL 77statement, IDLE, 11-14statements, 4-2, 11-1See also Chapter 11CLEAR, 11-2CLEARI,

Strany 321

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

Strany 322

IndexI-27contacting Allen-Bradley,Using-6error messages from BASIC,C-2error messages from CALLroutines, C-4LED indicators, C-1memory support errorme

Strany 323

2 Chapter 2 -1Using the Communication PortsThis chapter describes: On page:communication ports overview2 -1communication modes 2 -2handshaking 2 -4com

Strany 324 - 123: W

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

Strany 325

Allen-BradleyPublication Problem ReportIf you find a problem with our documentation, please complete and return this form.Pub. NameCat. No.Pub. No. Pu

Strany 326

PLEASE FASTEN HERE (DO NOT STAPLE)Other CommentsPLEASE FOLD HEREPLEASE REMOVENO POSTAGE NECESSARY IF MAILED IN THE UNITED STATESBUSINESS REPLY MAILFir

Strany 328

32With major offices worldwide.Algeria • Argentina • Australia • Austria • Bahrain • Belgium • Brazil • Bulgaria • Canada • Chile • China, PRC • Colom

Strany 329

Preface ASummary of ChangesSOC-2EEPROM Programming SupportThe Series B module has two sockets for memory modules: one forEEPROM and the other for EPRO

Strany 330

ChapterUsing the Communication Ports2 2 -2PRT1 and PRT2 Port You can configure ports PRT1 and PRT2 for these communication modes: RS-232C – communica

Strany 331

ChapterUsing the Communication Ports2 2 -3PRT1 and PRT2 Transmit and Receive BuffersPorts PRT1 and PRT2 each have a 256-character receive (input) buf

Strany 332 - 124–127

ChapterUsing the Communication Ports2 2 -4The BASIC module support both hardware and software handshaking.You turn hardware and software handshaking o

Strany 333 - Product Overview

ChapterUsing the Communication Ports2 2 -5Hardware HandshakingThe BASIC module uses these rules when hardware handshaking isenabled. The BASIC module

Strany 334 - Hardware Features

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

Strany 335 - Software Features

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

Strany 336 - Diagnostic Features

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

Strany 337 - Programming Interfaces

ChapterUsing the Communication Ports2 2 -9Program Port You can configure either PRT1 or DH485 as your program port.PRT1 Configured as Program PortIf y

Strany 338 - BASIC Development Software

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

Strany 339 - Network Configurations

ChapterUsing the Communication Ports2 2 -11Network PortIf you set JW4 to one of the configurations shown at the left, your BASICmodule can be interfac

Strany 340 - Appendix

Preface ASummary of ChangesSOC-3Error-Trapping SupportThe ONERR statement (page 11 -23) traps overflow, underflow, anddivide-by-zero errors in the Ser

Strany 341 - DF1 Protocol Configuration

ChapterUsing the Communication Ports2 2 -121747-PIC Interface/Converter/1747-AIC Isolated Link CouplerUse the 1747-PIC interface/converter to convert

Strany 342 - Memory Requirements

ChapterUsing the Communication Ports2 2 -131747-AIC Link Coupler/1784-KR DH-485 Interface CardThe 1784-KR DH-485 Interface Card enables your personal

Strany 343 - Connector

ChapterUsing the Communication Ports2 2 -14Notes:

Strany 344 - .99999999E

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

Strany 345 - Related Products

ChapterInstalling and Replacing Components3 3 -2Before you can add or replace components, you must remove the modulefrom the I/O chassis. Go to page

Strany 346

ChapterInstalling and Replacing Components3 3 -3Before you can install the optional memory module or battery, you have todisassemble the BASIC module.

Strany 347 - Conversion Table

ChapterInstalling and Replacing Components3 3 -4The BASIC module supports these Allen-Bradley Memory Modules: 8K EEPROM (Cat. Nos. 1771-DBMEM1 or 174

Strany 348

ChapterInstalling and Replacing Components3 3 -5To install your optional memory module:Refer to this table when installing your memory module.Catalog

Strany 349 - Troubleshooting

ChapterInstalling and Replacing Components3 3 -64. Place the board on a flat surface.20371–MSKT1 (PROMs with Carriers)SKT2(PROMs without Carriers)5. I

Strany 350 - Error Messages from BASIC

ChapterInstalling and Replacing Components3 3 -7Use a chip insertion tool with memory modules that have no carrier.SKT2(PROMs without Carriers)20373–M

Strany 351

Preface ASummary of ChangesSOC-4Turbo Speed Allows Faster Program ExecutionThe BASIC module operates up to four times faster than before.With a C tool

Strany 352 - Routines

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

Strany 353

ChapterInstalling and Replacing Components3 3 -9To replace the battery:1. Remove the BASIC module from the I/O chassis. If you need furtherinstruction

Strany 354

ChapterInstalling and Replacing Components3 3 -104. Remove the battery and insert a fresh one. Make sure you install thebattery in the correct orient

Strany 355 - Series A Configuration Plugs

ChapterInstalling and Replacing Components3 3 -11After installing the memory module or battery, reassemble the BASICmodule as follows:1. Insert the bo

Strany 356

ChapterInstalling and Replacing Components3 3 -12Notes:

Strany 357 - Quick Reference

4 Chapter 4 -1Programming the BASIC ModuleThis chapter describes: On page:programming instructions4 -1create a program 4 -2number program lines 4 -6en

Strany 358

ChapterProgramming the BASIC Module4 4 -2BASIC StatementsBASIC statements are programming instructions that control program flowor manipulate I/O and

Strany 359

ChapterProgramming the BASIC Module4 4 -3You can create and edit your BASIC program using a personal computeralong with BASIC Development Software (PB

Strany 360

ChapterProgramming the BASIC Module4 4 -4BASIC Development Software (PBASE)Use a personal computer with the BASIC Development software (PBASE)to creat

Strany 361

ChapterProgramming the BASIC Module4 4 -5DH-485 InterfaceIn this configuration, you interface the serial port on the personal computerwith port DH485

Strany 362

Preface ASummary of ChangesSOC-5Call Routine Changes and AdditionsThese calls are new to the Series B, BASIC module:Statement PageCALL 0reset the modu

Strany 363

ChapterProgramming the BASIC Module4 4 -6BASIC program lines always begin with a line number ranging from 0 to65535. The line numbers indicate the or

Strany 364

ChapterProgramming the BASIC Module4 4 -7To enter a BASIC program using an ASCII terminal follow these steps.Important: Refer to the BASIC Development

Strany 365 - See also BTW buffer

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

Strany 366

ChapterProgramming the BASIC Module4 4 -9Run the ProgramTo run a BASIC program, type RUN (page 10 -19) at the system prompt [>].READY>RUN HELLO

Strany 367

ChapterProgramming the BASIC Module4 4 -10Notes:

Strany 368

5 Chapter 5 -1Programming Block-TransfersThis chapter describes: On page:BASIC module memory organization5 -1data tables 5 -2block-transfer buffers 5

Strany 369

ChapterProgramming Block-Transfers5 5 -2The BASIC module communicates with any PLC processor that hasblock-transfer capability. Your ladder logic pro

Strany 370

ChapterProgramming Block-Transfers5 5 -3Input Image TableInput Image Table Bit DescriptionUsed with CALL①00 Do not use–Reserved –01 BTW Req 3 and 602

Strany 371

ChapterProgramming Block-Transfers5 5 -4Block-Transfer Write BufferThe BASIC module processor maintains a block-transfer-write (BTW)buffer containing

Strany 372

ChapterProgramming Block-Transfers5 5 -5The BASIC module is a bi-directional block-transfer module.Bi-directional means that the module performs both

Strany 373

Preface ASummary of ChangesSOC-6The definitions of these calls have changed:Important: The Series A definitions are not supported in the Series B.CALL

Strany 374

ChapterProgramming Block-Transfers5 5 -6Block-Transfer Programming TipsRemember these block-transfer programming tips: Block lengths PUSHed for CALLs

Strany 375

ChapterProgramming Block-Transfers5 5 -7Sample BASIC Block-Transfer ProgramThis sample program assumes that the application requires a singleblock-tra

Strany 376

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

Strany 377

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

Strany 378

ChapterProgramming Block-Transfers5 5 -10Asynchronous Block TransferYou can use this ladder logic program with PLC-5 processors forasynchronous block

Strany 379

ChapterProgramming Block-Transfers5 5 -11Synchronous Block TransferYou can use this ladder logic program only with PLC-5 processors toperform synchron

Strany 380

ChapterProgramming Block-Transfers5 5 -12You can use this ladder logic program with PLC-5/250 Family processors.This program assumes that your applica

Strany 381

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

Strany 382

ChapterEditing and Debugging a BASIC Program6 6 -2You can perform any of these edit operations:Operation Function Key Strokesdeleteuse the delete op

Strany 383

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

Strany 384

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

Strany 385

ChapterEditing and Debugging a BASIC Program6 6 -4The BRKPNT (page 10 -2) command and SNGLSTP command (page10 -20), along with the STOP statement (p

Strany 386

7 Chapter 7 -1Using BASIC Module StatementsThis chapter groups the statements and calls required to manipulate thevarious hardware parts of the BASIC

Strany 387

ChapterUsing BASIC Module Statements7 7 -2MiscellaneousStatement PageCALL 18re-enable control C break function 12 -11CALL 19 disable the control C bre

Strany 388

ChapterUsing BASIC Module Statements7 7 -3PRT2 PortStatement PageMODE11 -20PRINT# 11 -29GET# 11 -12INPL# 11 -16INPS# 11 -16INPUT# 11 -17EOF# 9 -17LIST

Strany 389

ChapterUsing BASIC Module Statements7 7 -4Use these calls to convert numbers between integer and BASICfloating-point. Use these calls also to transfe

Strany 390

ChapterUsing BASIC Module Statements7 7 -5Use theses calls to manipulate string data structures within a BASICprogram or from the command line.Statem

Strany 391

ChapterUsing BASIC Module Statements7 7 -6Use these calls when you have PRT2 port configured for DF1 protocol.Important: CALL 108 must be used before

Strany 392 - BUSINESS REPLY MAIL

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

Strany 393

ChapterUsing BASIC Module Statements7 7 -8Use these calls to allow the BASIC module to read input data from itsexternal ports. You can execute these

Strany 394 - Copyright

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

Komentáře k této Příručce

Žádné komentáře