r
1Ć2 You should be familiar with the instruction manuals which describeyour system configuration. This may include, but is not
?3/%')6727,)/)*7-725&-7-*(28&/)-17)+)5'20)62**7,))1(!,)&-1%5<3/%')69%'%7)(&<
=7.31 ROTATER% Function250&7!!9&5.&'/*527&7*%(2817:-*5*9&5.&'/*.6&6.1,/*25)28'/*.17*,
D2/A+./-36+5D,3=,37+;B=8=2/./-36+5/:>3?+5/7=8998<3=/80=2/*$#0>7-=3877=2/08558@371/A+695/+<<>6/=2/?+5&
@ ,9.+*+89/3'9/43/8,47)+*'3*9.+84:7)+/8,47)+*9.+*+89/3'9/43,47)+*;'1:+</1157+;'/1".+#
;3,"6&!2&(*3"6"2*"#,&."-&/2&802&33*/./'490&342*.(2&02&3&.4*.(4)&
@&(9:&15->8.(&1&))7*884+9-*+.78914(&9.43439-*39*7+&(*24):1*+7424794<-.(-)&9&.894'*7*&
?#&/8*6*7851*)> 8((*66 #&5.&'/*127+281) &7&7<3*0.60&7(-25*;&03/*#%= !%
C7.40 FINDVAR! Function#019.;4+:1548-7;18-9:0-;:5)>56-8):14/9?9:-3=1:0:0-:0-84-:56:154583):$!<)84)3-=0-8-<)84)
7Ć20dest_subscript is only used if destination_variable is an array. It determines where in the array to begin writing. If not an array, the value sho
7Ć21This function returns false only under the following conditions:D #n is not assigned to an opened portD #n is not assigned to a serial communicati
1Ć36. M/N 57C413 or 57C423 Common Memory module. This moduleis used when there is more than one Processor module in therack.7. M/N 57C492 Battery Back
,%$%#&('&$$$% #"&% %%&'#$%#%# #"&a
8Ć18.0 ETHERNETCOMMUNICATIONFUNCTIONSThe following functions are used only with the Ethernet NetworkInterface (ENI) module (M/N 57C440). Before any of
8Ć2of the ENI will turn off for approximately 10 seconds while theinitialization is performed.Values Returned:ă1 Success-1 ENI failed self test-8 Bus
8Ć3function. This can be specified as a simple variable or as an element of an array.port% is the local port number you want to give to thesocket. Beg
8Ć4Values Returned:ă1 Success-2 ENI not initialized-9 No buffer space-12 Bad InterNet address-15 Bad socket number-102 Socket not connectedFor example
8Ć5 Format:SEND%( sn%, var, len% )where:sn% is the number of the socket through which themessage is to be sent. This is the value tha
8Ć6 Format:SENDL%( sn%, list! )where:sn% is the number of the socket through which themessage is to be sent. This is the value that
8Ć7 Format:RECV%( sn%, var, len% )where:sn% is the number of the socket through which themessage is to be received. This is the value
8Ć8 Format:RECVL%( sn%, list! )where:sn% is the number of the socket through which themessage is to be received. This is the value t
8Ć98.10 SETSOCKOPT% FunctionFormat:SETSOCKOPT%( sn%, opnum%, opval% )where:sn% is the number of socket whose option you want toset.opnum% is the numbe
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
8Ć108.11 GETSOCKOPT% FunctionFormat:GETSOCKOPT%( sn%, opnum%, opval% )where:sn% is the number of socket whose option you want toread.opnum% is the num
8Ć11For example, to test if the socket is connected:STATUS% = GETSOCKOPT%( SN%, 0800h, OPTION_VALUE%)8.12 SHUTDOWN% FunctionFormat:SHUTDOWN%( sn% )whe
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
AĆ1Appendix AConverting a DCS 5000 BASIC Task toAutoMaxYou can easily convert any DCS 5000 Version 4 task to AutoMax. SimplyreĆcompile the task using
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
BĆ1Appendix BBASIC Compiler and Run Time ErrorCodesThe following error codes are displayed on the screen when tasks are compiled.Control Block Error C
BĆ2297 Invalid data type for variable in Control Block298 Parameter keyword previously defined in Control Block299 Data structure symbol name too long
BĆ3343 Bad function variable344 Bad array; must be 1 dimension (integer)345Bad BLOCK_MOVE variable346 Variable in function call not defined as COMMON3
BĆ4412 Bad GET statement format413 Bad PUT statement format414 Bad INPUT statement format415 Cannot close a channel416 Cannot GET from a channel417 Ca
BĆ5484 New value must be same type as tunable in WRITE_TUNE485 Tunable variable expected486 Missing delimiter487Mis
2Ć12.0 PROGRAMMING FORAutoMax SYSTEMSIn AutoMax systems, application programs, also referred to as tasks,can be written in Ladder Logic/PC language, C
BĆ6533 Task not of type BASIC, CONTROL, or CONFIGURATION534 Invalid task statement format535 Invalid task priority536 Invalid task name537 Invalid slo
BĆ7590 Invalid value for WLG591 Invalid value for ORDER592 Control Blocks encountered before SCAN_LOOP593 Invalid val
BĆ8690 Error opening the object output file691 Error writing to object output file692 Task with READ statements but no DATA statements693 Too many LOC
BĆ9788 Hardware event ticks overflow789 Print buffer overflow; print field too long790 Device not open properly791 OPEN with bad device address792 Dev
BĆ10838 First substring position specification greater than string length839 Not assigned840 Not assigned841 Wrong data type input for boolean842 Anot
BĆ11888 BCD output number greater than 9999889 Bad bit number in function call890 Bad option number in function call891 Invalid GATEWAY transfer call
BĆ121008 Broken wire in resolver1009 (not used)1010 Overspeed trip1011 Power Technology module fault1012 PMI power supply fault1013 PMI bus fault1014
CĆ1Appendix CHardware Interrupt Line AllocationCurrent Minor Loop (CML) tasks or tasks that use BASIC hardware EVENTstatements require Processors to a
CĆ2Example #2xxxxSlot 1ProcessorModuleSlot 2ProcessorModule1 CML task 4 hardware EVENTstatements=ăInterrupt Line=ăHardware EVENT Statement=ăCML TaskxC
DĆ1The following BASIC statements are supported in UDC Control Blo
2Ć2The configuration task does not actually execute or run; it serves asa central storage location for systemĆwide information. Note thatlocal variabl
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
EĆ1The list that follows shows which AutoMax Processor modul
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
FĆ1Appendix FNew FeaturesThe following are either new or changed in BASIC for Version 3.0 of theAutoMax Programming Executive.1. ENI_INIT%2. SOCKET%3.
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
For additional information1 Allen-Bradley DriveMayfield Heights, Ohio 44124 USATel: (800) 241-2886 or (440) 646-3599http://www.reliance.com/automaxCop
2Ć3Each of these tasks would be assigned a priority level (either in thespecific configuration task for the rack, or in later versions of theProgrammi
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
3Ć13.0 STRUCTURE OF ANAutoMax ENHANCED BASICPROGRAMBASIC programs, or tasks, are created using a text editor.Note the following naming convention. App
3Ć22. To provide a reference for conditional and unconditionaltransfers of control (GOTO,GOSUB, etc).Line numbers can be consecutive numbers:1ăLET M%=
3Ć3 In BASIC, a statement can continue onto another line. When astatement is to be continued, the line is terminated with anam
E Copyright Reliance Electric Industrial Company 1998.Nortonr is a registered trademark of Peter Norton Computing, Inc. MODBUSr is a registered tradem
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
4Ć14.0 VARIABLES ANDCONSTANTSAll operations performed in BASIC use constants or variables.Constants are quantities with fixed value represented in num
4Ć2AutoMax Enhanced BASIC has variable types" just as standardBASIC does. The variable type indicates the kind of information thevariable is rep
4Ć34.1.1.2 Double Integer Variables (Long Integers)A double integer variable is a named location in which an integervalue can be stored. It is called
4Ć44.1.1.4 Boolean VariablesA boolean variable is a named location which represents aTRUE/FALSE or ON/OFF value. It is named using the rules listed in
4Ć5Array variables are specified by adding a subscript(s) after thevariable name, which includes the appropriate terminating characterto denote the ty
4Ć6an application task allocates space for 21 string values of 10characters each. Note that if no length is specified in the initial arrayreference, t
4Ć7considered outputs: command registers, application registers,the ISCR (interrupt status and control register), scans perinterrupt register, and sca
4Ć8 The following common memory variables are preĆdefined for everyrack. However, they do not appear on the fo
4Ć9 A hexadecimal constant also specifies an integer value in base 16 orhex" (hexadecimal) format. A hexadecimal numbe
ITable of Contents1.0 Introduction 1Ć1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Compatibility
4Ć10 A real constant is a number with a decimal point. For large numbers,use scientific notation in the following general format: a
4Ć11The following are invalid string constants and the reasons that theyare invalid:WRONG TERMINATOR' (Surrounding quotes must be of sametype.)`
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
5Ć15.0 EXPRESSIONSAn expression is a symbol or a group of symbols that BASIC canevaluate. These symbols can be numbers, strings, constants,variables,
5Ć2expression with a single or double integer variable, the result isalways integer.Table 5.1 lists the arithmetic operators and their meanings. Ingen
5Ć3BASIC evaluates expressions enclosed in parentheses before theoperator immediately outside the parentheses, even when theoperator enclosed in paren
5Ć4The relational operators="and < >" or > <" are used whenthere is a relational or comparison expression, such as that
5Ć5Table 5.3 Ć Truth Table for Boolean Operators 00 0 0 0 101 0 1 1 110 0 1 1 011 1 1 0 01= TRUE; 0 = FALSEThe AND bool
5Ć6D When a boolean value is combined with an integer value, theboolean is always treated as the value zero (0) if it is FALSE andone (1) if it is TRU
5Ć7The following are relational expressions:A% > B%((A%+3)/16) < > 32(((A%/25) +13)+B%) >= SPEED%(A% < > B%) OR (GAIN => 3.58867)
II6.4.1 GOTO (GO TO) Statement 6Ć7. . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.2 ON GOTO Statement 6Ć9. . . . . . . . . . . . . . . . . . .
5Ć84. The intermediate value of ([B% * C%) *D%] * REAL1), which isin real format, is now multiplied by REAL2, also in real format.The result is then a
6Ć16.0 AutoMax ENHANCED BASICSTATEMENT TYPESAs described in section 3.1, each BASIC statement begins with aline number followed by a keyword. The keyw
6Ć23. Tunable variables. These variables can be double integer,integer, or real type and can be read from, but cannot be writtento by any means except
6Ć3LOCAL variable [CURRENT=val1, HIGH=val2, LOW=val3, & ăăăăă ăĂ STEP=val4]where:variable = simple variable of double integer, integer, or realtyp
6Ć4Recall that BASIC tasks always use the most current value ofcommon variables when performing calculations, while ControlBlock and PC/Ladder Logic t
6Ć5The ! format is interchangeable with the REM format for a comment;however, the statements are treated differently by the compiler.The ! format comm
6Ć66.3 Variable Assignment(LET/SET_MAGNITUDE)There are two formats for assigning a value to a variable: the LETstatement and the SET_MAGNITUDE statem
6Ć710 SET_MAGNITUDE(A%,0FEFE2222H) Even if the result of the value field is more than 16 bits ofsignificance (all integer ar
6Ć8In the following example:30 GOTO 110BASIC branches control to line 110. BASIC interprets the statementexactly as it is written: go to line 110. The
6Ć9GOTO statements can use integer expressions instead of a constantas the transfer line number; however, the expression must have aninteger as its fi
III7.20 FIX Function 7Ć7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.21 CURPOS$ Function 7Ć7. . . . . . .
6Ć10line_number_1 through line_number_N = line numbers to which control istransferred depending on theevaluated expressionThe line numbers always corr
6Ć11When BASIC executes a GOSUB, it stores the return location of thestatement following a GOSUB.Each time a GOSUB is executed, BASIC stores another l
6Ć12 The IFĆTHENĆELSE statement provides a transfer of control basedon the result of a relational or comparison expression.
6Ć13(SWITCH_34% is not a boolean variable or a valid Ărelational expression)150IF A% > B% THEN GOTO 700 ELSE GOTO 400 END_IF (The keyword THEN must
6Ć14where:variable = simple numeric variable known as the loop index.expression_1 = initial value of the index; can be any numeric expression.express
6Ć154567891011In the above program, the initial value of the index variable is 1. Theterminating value is 10, and the STEP size is + 1(the default). E
6Ć16A loop can contain one or more loops provided that each inner loopis completely contained within the outer loop. Using one loop withinanother is c
6Ć1720 FOR B%=2 TO 10 STEP 230 X%(A%,B%)=A% + B%40 NEXT B%50 NEXT A%60 END The typical control applic
6Ć18where:event_name = symbolic name given to that particular event and thehandle" for further references to that event; not followedby a termin
6Ć19Note that it is possible to disable the timeout period for a hardwareevent. Disable the timeout for I/O modules that, unlike the Resolvermodule, d
IVConverting a DCS 5000 BASIC Task to AutoMax AĆ1. . . . . . . . . . . . . . . . BASIC Compiler and Run Time Error Codes
6Ć20Task ABC10 EVENT NAME=GAIN_OVER...90 IF GAIN>MAX_GAIN THEN SET GAIN_OVER...Task XYZ30 EVENT NAME=GAIN_OVER...105 WAIT ON GAIN_OVER...
6Ć21Any combination of the above variable types is permitted;however, a PRINT to or INPUT from this specific channelmust always pass the same number a
6Ć22Tasks do not have to call the variables by the same names whenreading and writing to the channel; they simply write an integerquantity (for an int
6Ć23 The START EVERY statement format is similar to the DELAYstatement format but is used to do a periodic reĆstart or scan
6Ć246.8 Communication CapabilitiesBASIC communicates with other processing elements in a system,including operator's terminals and other applicat
6Ć25How you use the OPEN statement depends on whether it is beingused with port A or port B. For port A, t
6Ć26When hardware handshaking is enabled for a port, the DTR(Data Terminal Ready) pin on the Processor port is false whenmore than 53 characters are i
6Ć27hex number0D001514131211109 87 6543210OPTIONAL TERMINATION CHARACTER FOR INPUT STATEMENTS1: XĆON,XĆOFF HANDSHAKE ENABLED (D)0: XĆON, XĆOFF HANDSH
6Ć28If the default setup or baud rate are not suitable for your application,use the following OPEN statement format to temporarily allocate theport fo
6Ć29port A and then closes the port. If USERNAME$ is blank, KYBD.BASprompts the user to enter his name. DISPLAY.BAS displays themessage Hello World&q
VTable 5.1Ć Arithmetic Operators 5Ć2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table 5.2Ć Relative Precedence
6Ć30For port B, you must use the OPEN statement in a task to allocatethe port before the task can communicate through the
6Ć31Port B Application Notes1. Port B requires port allocation and error handling to be handledby the application tasks.2. OPEN" the port to set
6Ć32100 COMMON USERNAME$110 COMMON KYBD_RDY@, DISP_RDY@ :900 USERNAME$ = "910 KYBD_RDY@ = FALSE :1000 IF DISP_RDY@ THEN DEL
6Ć336.8.2 CLOSE StatementThe CLOSE statement is used to deĆallocate a channel or port toallow other application tasks to have access to it. The CLOSEs
6Ć34system will prompt again, indicating that it is waiting for more data.The system will also prompt again if the operator enters just a<CR> by
6Ć35bits of the device characteristics word in the SETUP portion of theOPEN statement. For example, if you wanted to use a question mark(hexadecimal 3
6Ć36The following is a typical PRINT statement using the default port(PORTA):40 PRINT A%,B%, MESSAGE$,C% + D%The output line would be 13 29 MOTOR 53,
6Ć37This prints as follows:567THIS IS STRING1THIS IS STRING2 98 FALSE1 SPACE BEFORE BOOLEAN1 SPACE BEFORE NUMERICNO SPACES BEFORE STRING FIELDNO SPACE
6Ć38formatted_print_list = list of formatted data fieldsThe individual formatted data fields have the following form:<format_type> <field_wid
6Ć39The next print expression would start in column 41:column 1 column 41CHARACTERS40-CHARACTER FIELDPrint statements 20,30,40, and 50 would appear as
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
6Ć40places to the right of the decimal point is specified as greater thanzero.The following are all valid PRINT USING statements:20 PRINT USING L24:H
6Ć416.8.5 IOWRITE Statement (Accessing Foreign I/O)See JĆ3649, JĆ3750 or J2Ć3045 for the requirements for using foreignmodules in an AutoMax system. O
6Ć42Note that all taskĆtoĆtask communication information is managed bythe system on the Common Memory module (M/N 57C413). The GET s
6Ć43Refer to the OPEN statement description (6.8.1) for more informationon how the GET statement is used with the OPEN statement. T
6Ć44The number of variables in the READ statement does not have tomatch the number of expressions in a specific DATA statement.BASIC will simply go to
6Ć45The effect of the first format (with no line number) is to move theDATA statement pointer back to the first DATA statement in theprogram. The effe
6Ć466.9.2 RESUME StatementAfter BASIC has transferred control to an error handling routine,RESUME tells BASIC that the error handling is complete. The
6Ć47When you save a reconstructible task from the processor, thesystem will write the lines included back to a file with the samefilename as specified
fafadfdfdasfdsfdsdsdfdsfdsfdsfsdfdsaafdfdsfdsfdfdsfdsfsadfdaasfdfaddfdd
A ;:5(>4/(4*,+ 04*58658(:,94;3,85;904:80490*-;4*:05490,-;4*:0549:/(:*(4),;9,+=0:/04,>68,990549 53,(8,9:
1Ć11.0 INTRODUCTIONThe products described in this instruction manual are manufacturedby Reliance Electric Industrial Company.The AutoMax Programming E
& $#$! ! % ! !
17.5 LN Function&)$+/')**"&%.!)/')**"&%$,*+&%,$)""%+ )&))#+0&apos
@$0-.:4+91547-9:748)89714/+0)7)+9-7+577-8654,14/9590-,-+13)2#;)2:-5.90-146:9-=67-88154#$"!#" &a
B6<1.4*;<.@*584.<1./7:5*<7/<1.:.*46=5+.::.<=:6.-*;*;<:2602;<1.;*5.6=5+.:+=<26*-2//.:.6<:.8:.;.6
7Ć67.16 RIGHT$ FunctionFormat:RIGHT$(string,str_length)where:string can be a string variable or expression.str_length is the number of characters to t
H7.19 VAL Function;>9.@( ?@>6:4C52>2?@>6:40.:/2.?@>6:4B.>6./82;>2D<>2??6;:&523A:0@6;:>2@A>:?@5
?.2+361&8.32&'39846.28.2,&2)>32*)+.*0)7(&2'*+392).2 !8&8*1*287.27*(8.32
7Ć9ESC [2K Erase all of the line, inclusive.CLR_TO_ENDLINE% = 0PRINT;CLRLINE$(CLR_TO_ENDLINE%); Whe
A7.25 BIT_SET@ Function472'9!% !;'7/'(1+(/9A3:2(+7<.+7+;'7/'(1+/8'8/3-1+47*4:(1+/39+-+7;'7/&
=015+0/&'(+/'45*'%*#/)'50$'.#&'505*'$+5#/&.#:$'#/+/5')'303$00-'#/
Kommentare zu diesen Handbüchern