Home

Introduction - Artisan Technology Group

image

Contents

1. Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition Relay Ladder Action rung condition in is true EN bit is set no es POS lt 0 Y EM bit is cleared EM bit is set yes POS 0 DN is cleared no Y EM bit is set EM bit is cleared yes T DN bit is set Y no 8 yes EM bit is set POS or no LEN size of array yes POS gt LEN W DN bit is set yes no POS LEN gt P0S POS 1 88 no FIFO POS 1 source a postscan 398 Y rung condition out is set to true The rung condition out is set to false Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Example When enabled the FFL instruction loads va ve_1 into the next position in the FIFO which is array_dint 3 in this example FFL FIFO Load EN Source value 1 N5 FIFO array_dint O M gt Control control_1 Length 10 Position 5 before FIFO load after FIFO load array dint O 00000 00000 mmo 1111
2. Masked value 1 X X Xx X X X X XI X IXx x x 1 1 1 Masked value 2 X X X X X X XIX X X x x10 0 0 0 Relay Ladder MEQ light_1 Mask Equal Source value 1 280101 0101 1111 1111 ask mask 1 2 0000_0000_0000_1111 Compare value 2 2 0101_0101_1111_0000 M Structured Text light_1 value_1 AND mask_1 value 2 AND mask 2 Function Block lt a Compare Publication 1756 RMOO3K EN P July 2008 241 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Not Equal to NEQ The NEQ instruction tests whether Source A is not equal to Source B Operands Relay Ladder Neo Not Equal Ten Souro Operand Type Format Description Source A SINT immediate value to test against Source B Source B INT tag DINT REAL string Source B SINT immediate value to test against Source A INT tag DINT REAL string If you enter a SINT or INT tag the value converts to a DINT value by sign extension e String data types ate default STRING data type any new stting data type that you create e To test the characters of a string enter a string tag for both Source A and Source B E Structured Text IF sourceA sourceB THEN Use the less than and greater than sig
3. LEN lt 0 yes V POS lt 0 yes r EM is cleared EM is set yes EM is set no u E DN is set no q rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 409 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition Relay Ladder Action rung condition in is true EN bit is set no es POS 0 Y Y EM bit is cleared EM bit is set yes POS lt 0 DN is cleared no Y EM bit is set EM bit is cleared yes T DN bit is set Y no 8 yes EM bit is set POS or no LEN gt size of lt q array yes POS 2 LEN W DN bit is set yes no POS gt LEN gt P0S POS 1 8 no LIFO POS 1 source u rung condition out is set to true postscan The rung condition out is set to false 410 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Example Wh
4. Error Code Description Display In Software Hex 00D0 The scanner did not receive a block transfer response from the block transfer module unknown error within 3 5 seconds of the request 00D1 The checksum from the read response did not match the checksum of the data stream unknown error 00D2 The scanner requested either a read or write but the block transfer module responded with unknown error the opposite 00D3 The scanner requested a length and the block transfer module responded with a unknown error different length 00D6 The scanner received a response from the block transfer module indicating the write unknown error request failed OOEA The scanner was not configured to communicate with the rack that would contain this unknown error block transfer module OO0EB The logical slot specified is not available for the given rack size unknown error OOEC There is currently a block transfer request in progress and a response Is required before unknown error another request can begin OOED The size of the block transfer request is not consistent with valid block transfer unknown error size requests OOEE The type of block transfer request is not consistent with the expected BT READ unknown error or BT WRITE OOEF The scanner was unable to find an available slot in the block transfer table to unknown error accommodate the block transfer request OOFO The scanner received a request to reset the remote
5. Expression atray_1 control_1 pos array 3 control 1 pos FAL Expressions You program expressions in FAL instructions the same as expressions in CPT instructions Use the following sections for information on valid operators format and order of operation which are common to both instructions Valid operators Operator Description Optimal Operator Description Optimal 4 ad DINLRA 106 log base 10 REAL subtract negate DINT REAL MOD modulo divide DINT REAL P multiply DINT REAL NOT bitwise complement DINT divide DILRA OR bitwise OR DINT t exponent x to y DINT REAL RAD degrees to radians DINT REAL ABS absolute value DINT REAL SIN sine REAL ACS arc cosine REAL SOR square root DINT REAL AND bitwise AND DINT TAN tangent REAL ASN arc sine REAL TOD integer to BCD DINT AN actaget REA TRN o turae DINLREAL COS cosine REAL XOR bitwise exclusive OR DINT DEG radians to degrees DINT REAL FRD BCD to integer DINT LN natural log REAL 344 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Format Expressions For each operator that you use in an expression you have to provide one or two operands tags or
6. array_dint2 EM result 513 array dint3 485 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Diagnostic Detect DDT Operands DDT Diagnostic Detect I END Source DN Reference EFD5 Result LIN 5 Cmp Control L ER2 Length Position Result Control T Length Position 486 Special Instructions FBC DDT DTR PID array to determine changes of state The DDT instruction compares bits in a Source array with bits in a Reference ATTENTION A Relay Ladder Operand Type Format Description Source DINT array tag array to compare to the reference do not use CONTROL POS in the subscript Reference DINT array tag array to compare to the source do not use CONTROL POS in the subscript Result DINT array tag array to store the results do not use CONTROL POS in the subscript Cmp control CONTROL structure control structure for the compare Length DINT immediate number of bits to compare Position DINT immediate current position in the source initial value typically 0 Result CONTROL structure control structure for the results control Length DINT immediate number of storage locations in the result Position DINT immediate current position in the result initial value typically 0 Use different tags for the compare control
7. Y rung condition out is set to Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Condition Relay Ladder Action numeric mode Y EN bit 1 examine EN bit EN bit 2 0 POS POS 1 bit 1 examine internal bit my 0 internal bit is set yes yes no no b POS POS 1 mode LEN 2 gt yes Y DN bit is set rung condition out is set to EN bit is set m true loop_count LEN POS Y mode 2 loop count page 338 EN bit is set postscan The rung condition out is set to false Publication 1756 RMOOSK EN P July 2008 341 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 1 When enabled the FAL instruction copies each element of array_2 into the same po
8. examine EN bit ENT n bit 0 EN bit is set es LEN 0 y p DN bitis set no examine source bit soree bitai UL bit remains set es LEN lt 0 D ER bit is set source bit 0 no Y Y UL bit is set shift array left one position left source UL bit array Sait p Y rung condition out is set to true DN bit is set ostscan The rung condition out is set to false p g 388 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Example 1 When enabled the BSL instruction starts at bit 0 in array_dint 0 The instruction unloads array_dint 0 9 into the UL bit shifts the remaining bits and loads imput_1 into array dint 0 0 The values in the remaining bits 10 31 are invalid BSL Bit Shift Left Array array dint D Control control 1 Source Bit input 1 Lenath 987654321 0 0 a these bits shift left array dint 0 before shift cC C cC pm cC C cC pm C cC C C C cC cC C input 1
9. 3 3 3 4 4 4 The typed commands maintain data structure and value The word range commands fill the destination tag contiguously Data structure and value change depending on the destination data type Specify PLC 2 messages The PLC 2 message types are designed for PLC 2 processors Select this command If you want to PLC2 Unprotected Read read 16 bit words from any area of the PLC 2 data table or the PLC 2 compatibility file of another processor PLC2 Unprotected Write write 16 bit words to any area of the PLC 2 data table or the PLC 2 compatibility file of another processor The message transfer uses 16 bit words so make sure the Logix5000 tag appropriately stores the transferred data typically as an INT array Publication 1756 RMOO3K EN P July 2008 167 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT MSG Configuration Examples Message Path Logix5000 Logix5000 The folowing examples show source and destination tags and elements for different controller combinations Por MSG instructions originating from a Logix5000 controller and writing to another controller Example Source and Destination source tag array_1 0 destination tag array_2 0 You can use an alias tag for the source tag in originating Logix5000 controller You cannot use an alias for the destination
10. GEG Grtr Than or Eql amp B Source analogvalue 0 0 3 02 Breakpoint Format myformat Breakpoint The input Source B Trace This analogvalue LEQ Less Than or Eql amp B Source analogvalue 00 2 01 Source B You want to display the breakpoint information in the Format string myformat In this case the format string contains the following text Breakpoint The input value is f When the breakpoint triggers the breakpoint trace window shows the characters before the colon Breakpoint in the title bar of the trace window The other characters make up the traces In this example of represents the first and in this case the only tag to be traced analogvalue The resulting traces appear as shown here Slot 1 Breakpoint Fi rj F3 The input value is 3 040000 The input value is 3 030000 Freeze Display Freeze Log Clear Display 630 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Tracepoints TPT Operands TPT Tracepoint Format myformat Analog inputs trace Trace This analogvalue1 Trace This analogvalue2 Trace This analogvalue3 Description Publication 1756 RMOO3K EN P July 2008 Debug Instructions BPT TPT Chapter 20 Trace points log data you select when a rung is true Relay Ladder Operand Typ
11. Instruction Location Languages Instruction Location Languages ABL 609 relay ladder BNOT 326 structured text ASCII Test For Buffer Line structured tex Boolean NOT function block ABS 277 relay ladder BOR 320 structured text Absolute Value structured tex Boolean OR function block function block ACB 573 relay ladder EET 627 relay ladder ASCII Chars in Buffer structured tex Breakpoints ACL 575 relay ladder BRK 473 relay ladder ASCII Clear Buffer structured tex Break ACS 532 relay ladder BSL 386 relay ladder Arc Cosine structured text Bit Shift Left function block BSR 390 relay ladder ADD 252 relay ladder Bit Shift Right Add RS BTD 294 relay ladder Bit Field Distribute AFI 456 relay ladder Always False Instruction BIDT us 294 structured text Bit Field Distribute with function block AHL 577 relay ladder Target ASCII Handshake Li structured text eee BTR 144 relay ladder ALM process control structured text Message structured text Alarm function block BIW 144 relay ladder ALMA 42 relay ladder Message structured text Analog Al structured tex ume unction block BXOR 323 structured text Boolean Exclusive OR function block ALMD 30 relay ladder Digital Alarm structured tex CC process control structured text unction block Coordinated Control function block AND 303 relay ladder CLR 294 relay ladder Bitwise AND m Et Clear structured text ARD 581 relay ladder CMP 206 relay ladder ASCII Read structured tex Compare ARL 585 re
12. PLEASE FOLD HERE NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS MAIL PERMIT NO 18235 CLEVELAND OH POSTAGE WILL BE PAID BY THE ADDRESSEE Rockwell Automation 1 ALLEN BRADLEY DR MAYFIELD HEIGHTS OH 44124 9705 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com PLEASE REMOVE ASCII Character Codes Character Dec Hex Character Dec Hex Character Dec Hex Character Dec Hex ctr NUL 0 00 SPACE 32 20 m 40 96 60 ctrl A SOH 1 01 33 21 A 65 41 a 97 61 ctrl B STX 2 02 34 22 B 66 42 b 98 62 ctrl C ETX 3 03 35 23 C 67 43 C 99 63 ctrI D EOT 4 04 36 24 D 68 44 d 100 64 ctrl E ENQ 5 05 37 25 E 69 45 e 101 65 ctrl F ACK 6 06 amp 38 26 F 70 46 f 102 66 ctrl G BEL 7 07 39 27 G 71 47 g 103 67 ctrl H BS 8 08 40 28 H 72 48 h 104 68 ctrl I HT 9 09 41 29 l 73 49 i 105 69 etrJJLF 10 60 2 J 74 4A j 106 0 deuk jvT 11 B 43 8 K 75 48 k 17 8 ctrl L FF 12 0C 44 2C L 76 4C l 108 6C ctrl M CR 13 r 0D 45 2D M 77 4D m 109 6D ctrI N SO 14 0E 46 2E N 78 4E n 110 6E ctrl O SI 15 0F 47 2F 0 79 4F 0 111 6F ctrl P DLE 16 10 0
13. E c c ce c ce c ce c c c c Target Dest 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 2 The SourceBit and the Length specify which bits in Source to copy into Dest starting at DestBit Source and Target remain unchanged DestBit SourceBit l Source 1 1 1 1 1 1 1 1 1 1 11 11 111 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 i r Dest 1 1 1 1 1 1 1 11 1 111 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Structured Text BTDT 01 Source source BTDT 01 SourceBit source bit BTDT Ol Length length BTDT 01 DestBit dest bit BTDT Ol Target target BTDT BTDT 01 distributed value BTDT 01 Dest Function Block BTDT 01 0 BTDT El Bit Field Distribute with Target D s source_bit SourceBit i length 3 4 Length dest bit T C DestBit Target target a 296 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7
14. ACC 2 147 483 647 examine ACC ACC gt PRE Y ACC lt PRE DN is se TT bit is cleared true rung condition out is set to postscan The rung condition out is set to false 114 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example When imit_switch_1 is set light 1 is on for 180 msec zzer 2 is timing When Timer 3 acc reaches 180 Zigh 1 goes off and Zighz 2 goes on Light_2 remains until Zzer 2 is reset If Amit_switch_2 is cleared while Zer 3 is timing Zghz 1 remains on When zzit switch 2 is set the RES instruction resets zer 3 clears status bits and ACC value lirnit switch 1 TO Retentive Timer On N Timer timer_3 N5 Preset 180 Accum of timer_3 tt light_1 timer 3 dn light 2 linnit switch 2 timer 3 RES Publication 1756 RMOO3K EN P July 2008 115 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Timer On Delay with Reset TONR TONR TONR TONR Timer On Delay E TimerEnable Operands tag
15. LOWER item number item number lower case terminal read EM 0 END IF 626 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 20 Debug Instructions BPT TPT Introduction Use the debug instructions to monitor the state of your logic when it is in conditions that you determine These instructions are only compatible with RSLogix Emulate 5000 software with which you can emulate a Logix 5000 controller on your personal computer If You Want To Use This Instruction Available In These Languages See Page stop program emulation when a rung is true BPT relay ladder 627 log data you select when a rung is true TPT relay ladder 631 Breakpoints BPT Breakpoints stop program emulation when a rung is true l Operands Relay Ladder FI Breakpoint Operand Type Format Description gt gt gt Type Format Description koi M Lat nang Fomat Sting fg Astrngthatsetstheformattingforthetext A string that sets the formatting for the text reakpoint he input that appears in the trace window for the break point Trace This BOOL SINT INT tag The tag that has a value you want to DINT REAL EIER LL iSPlayinthetraee window Trace This analogvalue Breakpoints are programmed with the Breakpoint output instruction BPT When the inputs on a rung containing a BPT instruct
16. CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the FFL instruction is enabled DN BOOL The done bit is set to indicate that the FIFO is full POS LEN The DN bit inhibits loading the FIFO until POS LEN EM BOOL The empty bit indicates that the FIFO is empty If LEN 0 or POS 0 both the EM bit and DN bit are set LEN DINT The length specifies the maximum number of elements the FIFO can hold at one time POS DINT The position identifies the location in the FIFO where the instruction will load the next value Description Use the FFL instruction with the FFU instruction to store and retrieve data in a first in first out order When used in pairs the FFL and FFU instructions establish an asynchronous shift register Typically the Source and the FIFO are the same data type When enabled the FFL instruction loads the Source value into the position in the FIFO identified by the POS value The instruction loads one value each time the instruction is enabled until the FIFO is full IMPORTANT Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 You must test and confirm that the instruction doesn t change data that you don t want it to change The FFL instruction operates on contiguous memory In some cases the instruction loads data past the array into other members of the tag This happens if the length is too big and the
17. Publication 1756 RM003K EN P July 2008 467 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Notes 468 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 12 For Break Instructions FOR FOR DO BRK EXIT RET Introduction Use the FOR instruction to repeatedly call a subroutine Use the BRK instruction to interrupt the execution of a subroutine If You Want To Use This Instruction Available In These Languages See Page Repeatedly execute a routine FOR relay ladder 470 FOR pot structured text Terminate the repeated execution of a routine BRK relay ladder 473 EXIT structured text Return to the FOR instruction RET relay ladder 474 1 Structured text only Publication 1756 RMOO3K EN P July 2008 469 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 12 For Break Instructions FOR FOR DO BRK EXIT RET For FOR The FOR instruction executes a routine tepeatedly Operands Relay Ladder FOR For Routine name Operand Type Format Description Index Routine ROUTINE routine routine to execute Initial value name name Terminal value Inde
18. postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set postscan The instruction executes EnableOut is set No action taken 272 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Example Calculate the square root of va ve_1 and place the result in sqr resu r Relay Ladder QR Square Root Source value 1 Dest sqr result 00 Structured Text sqr result SQRT value 1 Function Block value 1 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 7 273 Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Negate NEG Operands NEG Negate Source Dest dest source Ei NEG 04 NEG Eal Negate 274 The NEG instruction changes the sign of the Source and places the result in the Destination Relay Ladder Operand Type Format Description Source SINT immediate value to negate INT tag DINT REAL A SINT or INT tag
19. Sequencer Instructions SQI SQO SOL The SQL instruction loads reference conditions into a sequencer array Relay Ladder Operand Type Format Description Array DINT array tag sequencer array specify the first element of the sequencer array do not use CONTROL POS in the subscript Source SINT tag input data to load into the sequencer array INT immediate DINT A SINT or INT tag converts to a DINT value by sign extension Control CONTROL tag control structure for the operation typically use the same CONTROL as the SQI and SQO instructions Length DINT immediate number of elements in the Array sequencer table to load Position DINT immediate current position in the array initial value is typically 0 CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the SOL instruction is enabled DN BOOL The done bit is set when all the specified elements have been loaded into Array ER BOOL The error bit is set when LEN lt POS 0 or POS gt LEN LEN DINT The length specifies the number of steps in the sequencer array POS DINT The position identifies the element that the controller is currently manipulating 428 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Description IMPORTANT Sequencer Instructions SQI SQO SQL Chapter 10 When enabled the S
20. TimingMode 1 v C Oversample timing v DeltaT OversampleDT If DeltaT lt 0 or DeltaT gt 4194 303 secs the instruction sets DeltaT 0 0 and sets the appropriate bit in Status TimingMode 2 C Real time timing DeltaT RTSTimeStamp RTSTimeStampy If DeltaT gt 0 the instruction executes d Event or Continuous task DeltaT task scan time DeltaT elapsed time since last execution Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 653 Appendix B Function Block Attributes Program Operator Control Several instructions support the concept of Program Operator control These instructions include e Enhanced Select ESEL e Totalizer TOT Enhanced PID PIDE Ramp Soak RMPS Discrete 2 State Device D2SD Discrete 3 State Device D3SD Program Operator control lets you control these instructions simultaneously from both your user program and from an operator interface device When in Program control the instruction is controlled by the Program inputs to the instruction when in Operator conttol the instruction is controlled by the Operator inputs to the instruction Program or Operator control is determined by using these inputs Input Description ProgProgReq A program request to go to Program control ProgOperReq A
21. rung condition in EN bit DN bit scan of the instruction 334 The following timing diagram shows the relationship between status bits and instruction operation Execution occurs only in a scan in which the rung condition in goes from false to true Each time this occurs only one element of the array is manipulated If the rung condition in remains true for more than one scan the instruction only executes during the first scan one scan 40014 I operation clears status bits and complete clears POS value The EN bit is set when rung condition in is true The DN bit is set when the last element in the array has been manipulated When the last element has been manipulated and the rung condition in goes false the EN bit the DN bit and the POS value are cleared The difference between incremental mode and numerical mode at a rate of one element per scan is Numerical mode with any number of elements per scan requires only one false to true transition of the rung condition in to start execution The instruction continues to execute the specified number of elements each scan until completion regardless of the state of the rung condition in ncremental mode requires the rung condition in to change from false to true to manipulate one element in the array Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instr
22. yes no compare ER bit is set result POS gt goto size of result array exit page 483 result result POS compare POS result POS result POS 1 result POS 2 result LEN result DN bit is set postscan The rung condition out is set to false 492 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Example When enabled the DDT instruction compares the source array_dint to the reference array dint2 and stores the locations of any mismatches in the result array dint3 The controller also changes the mismatched bits in the reference array dint2 to match the source array dint DDT Diagnostic Detect N Source array_dint1 0 N 5 Reference array dint2 0 FD5 Result array dint3 0 IN 5 Cmp Control control 1 R Lenath 10 Pasition of Result Control control 3 Length 10 Position of source 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 array_dint1 l l reference before compare 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 array dintZ AN result 513 array dint3 reference after compare
23. 580 Example get control line status ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT When get control fine status becomes set obtain the status of the control lines of the serial port and store the status in the Channel Status operand To view the status of a specific control line monitor the SerialPortControl tag and expand the POS member 2E Relay Ladder AHL ASCII Handshake Lines CEN Channel 0 AND Mask o E DN Em OR Mask 0 CER2 SerialPort Control serial port Channel Status Decimal 29 Structured Text osri l InputBit get control line status OSRI osri 1 IF osri l OutputBit THEN AHL 0 0 0 serial port END IF Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Read ARD ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 The ARD instruction removes characters from the buffer and stores them in the Destination Operands Relay Ladder ASCII Read Channel Destination SerialPort Control SerialPort Control Length Characters Read Operand Type Format Enter Notes Channel DINT immediate 0 tag Destination string tag tag into which the e f you want to compare convert or characters are moved manipulate the characters use a string data SINT read type String data t INT e F
24. Relay Ladder MV line EN ABL ASCII Test For Buffer Line EN Channel 0 N gt SerialPort Control MV_line EFRD Character Count 0 MV line FD ASCII Read Line Channel Destination SerialPort Control SerialPort Control Length Characters Read Structured Text ABL 0 MV line osri l InputBit MVLine FD OSRI osri 1 IF osri 1 OutputBit THEN mv read LEN 12 ARL 0 MV msg MV read END IF 588 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 ASCII Write Append AWA The AWA instruction sends a specified number of characters of the Source tag to a serial device and appends either one or two predefined characters Operands Relay Ladder AWA ASCII Write Append END Channel Source DND SerialPort Control CER SerialPort Control Length Characters Sent Operand Type Format Enter Notes Channel DINT immediate 0 tag Source string tag tag that contains the e f you want to compare convert or characters to send manipulate the characters use a string data SINT type e Fora string data type e String data types are INT enter the name of the tag e default STRING data type DINT e Fora SINT INT or DINT e any new string data type that you create array enter the first element of the array Serial
25. 36 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 State Diagrams when Acknowledgment Not Required Latched False foo n Condition MinDurationACC gt MinDurationPRE InAlarm False InAlarm True Acked True E A In Condition VL uu Latched True z T B In Condition MinDurationACC gt MinDurationPRE TUN InAlarm False InAlarm 7 True Acked True ja f In Condition Reset 1 Alarm can be reset by several different ways ProgReset OperReset clients RSLogix 5000 software RSView software Arithmetic Status Flags none Fault Conditions none Execution Condition Relay Ladder Action prescan The rung condition out is set to false InAlarm is cleared and Acked is set All operator requests timestamps and delivery flags are cleared rung condition in is false The rung condition out is set to false Enableln and EnableOut are cleared The In parameter is cleared and the instruction evaluates to determine the alarm state rung condition in is true The rung condition out is set to true Enableln and EnableOut are set The In parameter is set and the instruction evaluates to determine the alarm state postscan The rung condition out is set to false Publica
26. Example 2 Relay Ladder MainRoutine When abc is on subroutine_1 executes calculates the number of cookies and places a value in cookies 1 JSR Jump to Subroutine Routine name subroutine 1 Return par cookies 1 abc Adds the value in cookies 1to cookies 2and stores the result in tota cookies DD Add Source cookies 2 ge Source B cookies 1 ge Dest total cookies g Subroutine_1 When defis on the RET instruction returns value_1 to the JSR cookies 1 parameter and the rest of the subroutine is not scanned def RET Return Return par value 1 When defis off previous rung and ghi is on the RET instruction returns value 2to the JSR cookies 1 parameter and the rest of the subroutine is not scanned hi RET Return Return par value 2 When both defand ghi are off previous rungs the RET instruction returns value 3to the JSR cookies 1 parameter RET Return Retum par value 3 Publication 1756 RMOO3K EN P July 2008 445 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Example 3 Function Block JSR instruction in Routine_A JSR gx Jump to Subroutine Routine Add Three Inputs Add Input 1 Add Three Result D Add Input 2 Output 1 The
27. 2 282 In structured text the AND OR XOR and NOT operations can be bitwise or logical function block Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Move MOV Operands MOV Source EY dest source Description Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 The MOV instruction copies the Source to the Destination The Source remains unchanged Relay Ladder Operand Type Format Description Source SINT immediate value to move copy INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL Structured Text e Use an assignment with an expression This assignment moves the value in source to dest See Appendix C Structured Text Programming for information on the syntax of expressions and assignments within structured text The MOV instruction copies the Source to the Destination The Source remains unchanged Arithmetic status flags ate affected none 283 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT
28. Arithmetic Status Flags no affected Fault Conditions none Publication 1756 RMOO3K EN P July 2008 133 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Execution Condition Relay Ladder Action prescan The CD bit is set to prevent invalid decrements during the first program scan The rung condition out is set to false rung condition in is false The CD bit is cleared The rung condition out is set to false rung condition in is true examine CD bit pes ee ACC value yes rolls over ACC ACC 1 CD bit 1 Y examine UN bit s LUN bit 1 OV bit is cleared DN bit is cleared OV bit 1 examine OV bit examine OV bit QD l q UN bit is set OV bit 1 examine ACC ACC SPRE p ACC lt PRE DN bit is cleared DN bitis set true rung condition out is set to postscan 134 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example A conveyor brings parts into a buffer zone Each time a part enters l
29. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 array_dint2 Publication 1756 RMOO3K EN P July 2008 493 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Data Transitional DTR 494 Special Instructions FBC DDT DTR PID the tesult with the Reference value The DTR instruction passes the Source value through a Mask and compares Operands Relay Ladder DTR Data Transition Source Operand Type Format Description Mask 1 Source DINT immediate array to compare to the reference Reference tag Mask DINT immediate which bits to block or pass tag Reference DINT tag array to compare to the source Description The DTR instruction passes the Source value through a Mask and compares the result with the Reference value The DTR instruction also writes the masked Source value into the Reference value for the next compatison The Source remains unchanged A 1 in the mask means the data bit is passed A 0 in the mask means the data bit is blocked When the masked Source differs from the Reference the rung condition out goes true for one scan When the masked Source is the same as the Reference the rung condition out is false ATTENTION A Online programming with this instruction can be dangerous If the Refe
30. 8 9 00 time dependent node 01 time master node 10 time relay node 11 unused 10 15 unused CurrentValue DINT 2 GSV Current value of the timer DINT 0 contains the lower 32 DINT 1 contains the upper 32 bits The timer source is adjusted to match the value supplied in update services and from local communication network synchronization The adjustment is either a ramping to the requested value or an immediate setting to the request value as reported in the CurrentStatus attribute Publication 1756 RMOO3K EN P July 2008 183 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Access the DF1 object The DF1 object provides an interface to the DF1 communication driver that you can configure for the serial port Attribute Data Type Instruction Description ACKTimeout DINT GSV The amount of time to wait for an acknowledgment to a message transmission point to point and master only Valid value 0 32 767 Delay in counts of 20 msec periods Default is 50 1 second DiagnosticCounters INT 19 GSV Array of diagnostic counters for the DF1 communication driver word offset DF1 point to point DF1 slave master 0 signature 0x0043 signature 0x0042 signature 0x0044 1 modem bits modem bits modem bits 2 packets sent packets sent packets sent 3 packets received packets received packets received
31. 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 String Data Types You store ASCII characters in tags that use a string data type D aida name of controller You can use the default STRING data type It stores up to 82 characters asks 73 Trends You can create a new string data type that stores less or more characters a Data Types gt 2 8 Strings Name Data Type LEN DINT DATA SINT array C User Defined Mj STRING i Predefined Ca Module Defined 3 1 0 Configuration To create a new string data type see Logixd000 Controllers Common Procedures publication 1756 PM001 Each string data type contains the following members Description Notes number of characters The LEN automatically updates to the new count of characters whenever you in the string e use the String Browser dialog box to enter characters e use instructions that read convert or manipulate a string The LEN shows the length of the current string The DATA member may contain additional old characters which are not included in the LEN count ASCII characters of e To access the characters of the string address the name of the tag the string For example to access the characters of the string 1 tag enter string f e Each element of the DATA array contains one character e You can create new string data types that store less or mor
32. Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution end address start address Length number of bytes in a destination element end address gt end end address end of destination array of destination array source address Source gt Y destination address YES end address copy data in source addressto destination address rung condition out is set to Y true source address source address 1 y destination_address destination_address 1 postscan The rung condition out is set to false No action taken Publication 1756 RM003K EN P July 2008 357 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 358 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 1 Both array_4 and array_5 are the same data type When enabled the COP instruction copies the first 10 elements of a
33. No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set No action taken postscan 536 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Example Calculate the arc tangent of value and place the result in result Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Relay Ladder ATN Are Tangent Source value 0 85000001 Dest result 0 71027106 Structured Text result ATAN value Function Block value 537 Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Notes 538 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 15 Advanced Math Instructions LN LOG XPY Introduction The advanced math instructions include these instructions If You Want To Use This Instruction Available In These Languages See Page Take the natural log of a value LN relay ladder 540 structured text function block Take the log base 10 of a value LOG relay ladder 543 structured text function block Raise
34. OV BOOL The overflow bit indicates that the counter exceeded the upper limit of 2 147 483 647 The counter then rolls over to 2 147 483 648 and begins counting up again UN BOOL The underflow bit indicates that the counter exceeded the lower limit of 2 147 483 648 The counter then rolls over to 2 147 483 647 and begins counting down again PRE DINT The preset value specifies the value which the accumulated value must reach before the instruction sets the DN bit ACC DINT The accumulated value specifies the number of transitions the instruction has counted 128 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Description When enabled and the CU bit is cleared the CTU instruction increments the counter by one When enabled and the CU bit is set or when disabled the CTU instruction retains its ACC value rung condition in count up enable bit CU count up done bit DN preset es oss one c counter accumulated value ACC 16636 The accumulated value continues incrementing even after the DN bit is set To cleat the accumulated value use a RES instruction that references the counter structure or write 0 to the accumulated value Arithmetic Status Flags no affect
35. Preface Logix5000 Controllers General Instructions Introduction This manual is one of several Logix5000 based instruction manuals Task Goal Documents Program the controller for sequential Logix5000 Controllers General Instructions Reference Manual publication applications 1756 RM003 You are here Program the controller for process or drives Logix5000 Controllers Process Control and Drives Instructions Reference Manual applications publication 1756 RMO006 Program the controller for motion Logix5000 Controllers Motion Instruction Set Reference Manual publication applications 1756 RM007 Program the controller to use equipment PhaseManager User Manual publication LOGIX UMOO1 phases Import a text file or tags into a project Logix5000 Controllers Import Export Reference Manual publication 1756 RM084 Export a project or tags to a text file Convert a PLC 5 or SLC 500 application toa Logix5550 Controller Converting PLC 5 or SLC 500 Logic to Logix5550 Logic Reference Logix5000 application Manual publication 1756 6 8 5 Who Should Use This document provides a programmer with details about each available This Manual instruction for a Logix based controller You should already be familiar with how the Logix based controller stores and processes data Novice programmers should read all the details about an instruction before using the instruction Experienced programmers can refer to the instruction informati
36. Radians To Degrees value result Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 Radians RAD The RAD instruction converts the Source in degrees to radians and stores the result in the Destination Operands Relay Ladder RAD Degrees To Radians Operand Type Format Description Source 7 Source SINT immediate value to convert to radians Dest INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest RAD source Use RAD as a function This function converts source to radians and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Fal RAD 04 Function Block RAD Es Dagieas To Radians Operand Type Format Description RAD tag FBD_MATH_ADVANCED structure RAD structure Dest D FBD_MATH_ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the conversion instruction Valid any float Publication 1756 RM003K EN P July 2008 553 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 M
37. Select Input 1 for an active alarm when In 1 Select Input 0 for an active alarm when In 0 Input Level ALMA instruction Input Level High High High Low or Low Low or Input Rate of Change Positive or Negative to trigger an alarm Input Rate of Change ALMA instruction Select the alarm conditions and enter the limits for those conditions Disable rate of change conditions by entering a 0 for the period or limit Publication 1756 RMOOS3K EN P July 2008 Year 63 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Option Severity Description Select a severity range from 1 1000 to rank the importance of an alarm condition A severity of 1 is for low priority alarms a severity of 1000 is for an emergency condition By default in the FactoryTalk Alarms and Events system severity ranges are mapped to priorities as follows e 1 250 are low priority e 251 500 are medium priority e 501 750 are high priority e 751 1000 are urgent priority You can configure the severity to priority mapping in the FactoryTalk Alarms and Events system See the FactoryTalk help for details Minimum Duration Enter the amount of time in ms an alarm condition must be active before reporting the alarm Latched ALMD instruction Select Latched if you want the alarm to stay active InAl
38. A rtisan Artisan Technology Group is your source for quality TecmoogyGroup new and certified used pre owned equipment FAST SHIPPING AND SERVICE CENTER REPAIRS WE BUY USED EQUIPMENT DELIVERY Experienced engineers and technicians on staff Sell your excess underutilized and idle used equipment TENS OF THOUSANDS OF at our full service in house repair center We also offer credit for buy backs and trade ins IN STOCK ITEMS www artisantg com WeBuyEquipment EQUIPMENT DEMOS HUNDREDS OF InstraV ea REMOTE INSPECTION LOOKING FOR MORE INFORMATION MANUFACTURERS Remotely inspect equipment before purchasing with Visit us on the web at www artisantg com 7 for more our interactive website at www instraview com 7 information on price quotations drivers technical LEASING MONTHLY specifications manuals and documentation RENTALS ITAR CERTIFIED yop aed Contact us 888 88 SOURCE sales artisantg com www artisantg com Logix5000 Controllers General Instructions Reference Manual Catalog Numbers 1756 L1x 1756 L5x 1756 L6x 1768 L4x 1769 L30 1769 L31 1769 L32C 1769 L32E 1769 L35CR 1769 L35E 1789 L60 1794 L34 20D Rockwell ALLEN BRADLEY ROCKWELL SOFTWARE Automation Important User Information Solid state equipment has operational characteristics differing from those of electromechanical equipment Safety Guidelines for the Application Installation and Maintenance of Solid State Controls publicat
39. An expression lets you compate two string tags You cannot enter ASCII characters directly into the expression Only the following operators are permitted Operator Description equal lt less than lt less than or equal gt greater than gt greater than or equal lt gt not equal e Strings are equal if their characters match e ASCII characters are case sensitive Upper case A 41 is not equal to lower case a 61 e The hexadecimal values of the characters determine if one string is less than or greater than another string For the hex code of a character see the back cover of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater 354 Dn Nn DO DD e CD OO 93 ASCII Characters Hex Codes 1ab 31 61 62 1b 31 62 A 41 AB 41 42 B 42 a 61 ab 61 62 AB B fL a gt B Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Copy File COP The COP Ta instructions di 2 in the Source to the Destination S i Synchronous Copy File estination The Source remains unchange CPS Operands Relay Ladder COP ce iid 2 Operand Type Form
40. Boolean Not bool in1 p E In Out H o value result not If bool inf is cleared Zght is cleared off Otherwise Zghf is set on Structured Text IF NOT bool inl THEN lightl 0 ELSE lightl 1 END IF Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 327 Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Notes 328 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Introduction The file miscellaneous instructions operate on arrays of data If You Want To Use This Instruction Available In These Languages See Page perform arithmetic logic shift and function FAL relay ladder 335 operations on values in arrays structured text search for and compare values in arrays FSC relay ladder 346 copy the contents of one array into COP relay ladder 355 another array structured text copy the contents of one array into CPS relay ladder 355 another array without interruption structured text fill an array with specific data FLL relay ladder 361 structured text calculate the average of an array of values AVE relay ladder 365 structured text sort one dimension o
41. Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 2 Calculate the standard deviation of dint_array which is DINT 4 5 dimension 1 Y 4 i27 m 0 1 2 3 4 115 14 13 12 11 dimension 0 2 10 9 8 7 6 AYERS 205199183 174 16 90 44 5 5 3 5 4 3 2 1 oo Se eee 1 581139 5 1 real_std 1 581139 Relay Ladder STD Standard Deviation N Array dint_array 0 0 Dim to vary 1 NS Dest R Control D Length 5e Position of Structured Text SIZE dint array l length sum 0 FOR position 0 TO length 1 DO sum sum dint array position END FOR average sum length sum 0 FOR position 0 TO length 1 DO sum sum dint array position average 2 END FOR real std SQRT sum length 1 380 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Size In Elements SIZE The SIZE instruction finds the size of a dimension of an array Operands Relay Ladder SIZE Size in Elements Operand Type Format Description Source S EA AVE E EE EOT EEE EE E EEE E Source SINT array tag array on which the instruction is to operate Dim To Vary 7 Size INT DINT REAL struct
42. EN BOOL When set the enable bit indicates that the JXR The external routine sets this bit instruction is enabled ReturnsValue BOOL If set this bit indicates that a return parameter Display only this information is derived from was entered for the instruction If cleared this the instruction entry bit indicates that no return parameter was entered for the instruction DN BOOL The done bit is set when the external routine The external routine sets this bit has executed once to completion ER BOOL The error bit is set if an error occurs The The external routine sets this bit instruction stops executing until the program clears the error bit FirstScan BOOL This bit identifies whether this is the first scan The controller sets this bit to reflect scan after switching the controller to Run mode Use status FirstScan to initialize the external routine if needed EnableOut BOOL Enable output The external routine sets this bit Enableln BOOL Enable input The controller sets this bit to reflect rung condition in The instruction executes regardless of rung condition The developer of the external routine should monitor this status and act accordingly User BOOL These bits are available for the user The Either the external routine or the user User0 BOOL controller does not initialize these bits program can set these bits ScanType1 BOOL These bits identify the current scan type The controller sets these bits to reflect scan stat
43. EXAMPLE Zero filling of immediate values If You Enter The Controller Stores 1 16 ffff ffff 1 16 ffff 1 16 0000 ffff 65535 8 1234 668 16 0000 029c 668 2 1010 10 16 0000 000a 10 Data Conversions Data conversions occur when you mix data types in your programming When Programming in Conversions Can Occur When You Relay Ladder Logic Mix data types for the parameters within one instruction Function Block Wire two parameters that have different data types Publication 1756 RM003K EN P July Year 635 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix A Common Attributes Instructions execute faster and require less memory if all the operands of the instruction use the same data type an optimal data type n the Operands section of each instruction in this manual a bold data type indicates an optimal data type The DINT and REAL data types are typically the optimal data types Most function block instruction only support one data type the optimal data type for its operands If you mix data types and use tags that are not the optimal data type the controller converts the data according to these rules Are any of the operands a REAL value If Then input operands for example source tag in an expression limit convert to Yes REALs No DINTs e After instruction execution the result a DINT or REAL
44. Loop update time Enter the update time UPD for the instruction CV high limit Enter a high limit for the control variable MAXO CV low limit Deadband value No derivative smoothing Enter a low limit for the control variable MINO Enter a deadband value DB Enable or disable this selection NDF No bias calculation Enable or disable this selection NOBC No zero crossing in deadband Enable or disable this selection NOZC PV tracking Enable or disable this selection PVT Cascade loop Enable or disable this selection CL Cascade type If cascade loop is enabled select either slave or master CT Specifying Alarms Select the Alarms tab You must click OK or Apply for any changes to take effect In This Field Specify PV high Enter a PV high alarm value PVH PV low Enter a PV low alarm value PVL PV deadband Enter a PV alarm deadband value PVDB positive deviation Enter a positive deviation value DVP negative deviation Enter a negative deviation value DVN deviation deadband Enter a deviation alarm deadband value DVDB Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com In this field Special Instructions FBC DDT DTR PID Chapter 13 Specifying Scaling Select the Scaling tab You must click OK or Apply for any cha
45. Operand Type Format Description Timer CDND Timer TIMER tag timer structure Preset Accum Preset DINT immediate how long to delay accumulate time Accum DINT immediate total msec the timer has counted initial value is typically 0 TIMER Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the TON instruction is enabled TT BOOL The timing bit indicates that a timing operation is in process DN BOOL The dore bit is set when ACC gt PRE PRE DINT The preset value specifies the value 1 msec units which the accumulated value must reach before the instruction sets the DN bit ACC DINT The accumulated value specifies the number of milliseconds that have elapsed since the TON instruction was enabled Description The TON instruction accumulates time until e the TON instruction is disabled e the ACC 2 PRE The time base is always 1 msec For example for a 2 second timer enter 2000 for the PRE value 104 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 When the TON instruction is disabled the ACC value is cleared rung condition in timer enable bit EN timer timing bit TT timer done bit DN ON gt delay preset Ce de ae ties oe
46. Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT The JSR instruction jumps execution to a different routine The SBR and RET instructions are optional instructions that exchange data with the JSR instruction Relay Ladder Operand Type Format Description Routine ROUTINE name routine to execute that is subroutine name Input BOOL immediate data from this routine that you want to copy parameter to a tag in the subroutine SINT tag e Input parameters are optional INT array tag e Enter multiple input parameters if DINT needed REAL structure Return BOOL tag tag in this routine to which you want to copy parameter a result of the subroutine SINT array tag e Return parameters are optional INT e Enter multiple return parameters if DINT needed REAL structure Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 JSR Operands Continued Structured Text JSR RoutineName InputCount Operand Type Format Description InputPar ReturnPar Bowed einer es Routine ROUTINE name routine to execute that is subroutine name Input count SINT immediate number of input parameters INT DINT REAL Input BOOL immediate
47. Publication 1756 RM003K EN P July 2008 455 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Always False Instruction The AFI instruction sets its rung condition out to false AFI Operands Relay Ladder AFI none Description The AFI instruction sets its rung condition out to false Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The rung condition out is set to false postscan The rung condition out is set to false Example Use the AFI instruction to temporarily disable a rung while you are debugging a program When enabled the AFI disables all the instructions on this rung H AFI 456 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 No Operation NOP The NOP instruction functions as a placeholder Operands Relay Ladder NOP none Description You can place the NOP instruction anywhere on a rung When
48. True LAcked True HHAcked True LLAcked True Where a new sample is collected on the next scan after the ROCPeriod has elapsed ROCPeriod ROC gt ROCPosLimit P adi le RocPoslnAlarm False J RocPoslnAlarm True RocPosAcked True Se P d ROC ROCPosLimit m d 1 ROC ROCNegLimit Pa S gt N I RocNeglnAlarm False RocNeglnAlarm True K JA Arithmetic Status Flags Fault Conditions Minor Fault ROC overflow Execution Condition prescan rung condition in is false Publication 1756 RM003K EN P July 2008 Year N ROC gt ROCNegLimit Arithmetic status flags are set for the ROC output Fault Type 4 Relay Ladder Action The rung condition out is set to false All the xInAlarm parameters are cleared conditions are acknowledged RocNegAcked True Fault Code 4 and all alarm All operator requests timestamps and delivery flags are cleared The instruction does not execute EnableOut is cleared 55 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Condition Relay Ladder Action rung condition in is true The instruction executes EnableOut is set postscan The rung condition out is set to false 56 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation G
49. structured text 663 Boolean AND 317 Boolean Exclusive OR 323 Boolean NOT 326 Boolean OR 320 BOR 320 break 473 BRK instruction 473 BSL instruction 386 BSR instruction 390 BTD instruction 291 BTDT instruction 294 BXOR 323 C cache connection 173 CASE 675 clear 297 CLR instruction 297 CMP instruction 206 comments structured text 687 common attributes 635 converting data types 635 immediate values 635 compare 206 compare instructions CMP 206 EQU 211 expression format 209 352 GEO 215 GRT 219 introduction 205 LEO 223 LES 227 LIM 231 MEQ 237 NEO 242 order of operation 209 353 valid operators 208 352 COMPARE structure 479 487 compute 248 compute instructions ABS 277 ADD 252 CPT 248 DIV 261 expression format 250 345 introduction 247 MOD 266 MUL 258 NEG 274 order of operation 251 345 SOR 270 SUB 255 valid operators 250 344 CONCAT instruction 601 configuring 159 MSG instruction 159 PID instruction 502 connection cache 173 connector function block diagram 641 construct Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com structured text 671 CONTROL structure 336 346 366 370 3 5 386 390 395 401 406 407 413 420 424 428 control structure 448 CONTROLLER object 180 CONTROLLERDEVICE object 181 conversion instructions DEG 550 FRD 559 introduction 549 RA
50. 14 30 P 80 50 p 112 70 ctrl Q DO1 17 11 1 49 31 Q 81 51 q 113 71 ctrl R DC2 18 12 2 50 32 R 82 52 r 114 72 ctrl S DC3 19 13 3 51 33 S 83 53 S 115 73 ctrl T DC4 20 14 4 52 34 84 54 t 116 74 ctrl U NAK 21 15 5 53 35 U 85 55 u 117 75 ctrl V SYN 22 16 6 54 36 V 86 56 V 118 76 ctrl W ETB 23 17 7 55 37 W 87 57 Ww 119 77 ctrl X CAN 24 18 8 56 38 X 88 58 X 120 78 ctrl Y EM 25 19 9 57 39 Y 89 59 y 121 79 ctrl Z SUB 26 1A 58 3A Z 90 5A 2 122 7A ctri ESC 2 1B 59 3B 91 5B 123 7B tr FS 28 1C 8 3 92 5C 124 7C ctrl GS 29 1D 61 3D 93 5D 125 7D ctrI RS 30 1E gt 62 3E A 94 5E 126 7E ctrl JUS 31 1F 63 3F 95 5F DEL 127 7F Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Rockwell Automation Support www rockwellautomation com Rockwell Automation provides technical information on the web to assist you in using its products At http support rockwellautomation com you can find technical manuals a knowledge base of FAQs technical and application notes sample code and links to software service packs and a MySupport feature that you can customize to make the best use of these tools For an additional level of technical phone support for installation configuration and troubleshooting we offer TechConnect Support programs For more information co
51. 386 to the UL bit shifts the remaining bits one position left and loads Source bit into bit 0 of Array You must test and confirm that the instruction doesn t change data that you don t want it to change The BSL instruction operates on contiguous memory In some cases the instruction shifts bits past the array into other members of the tag This happens if the length is too big and the tag is a user defined data type not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Execution Condition Relay Ladder Action prescan The EN bit is cleared The DN bit is cleared The ER bit is cleared The POS value is cleared The rung condition out is set to false rung condition in is false The EN bit is cleared The DN bit is cleared The ER bit is cleared The POS value is cleared The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 387 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition rung condition in is true Relay Ladder Action
52. 4 56 The Start or Quantity value is invalid 1 Check that the Start value is between 1 and the DATA size of the Source 2 Check that the Start value plus the Quantity value is less than or equal to the DATA size of the Source Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction copies the specified characters from a string and stores them in another string postscan The rung condition out is set to false No action taken Example Ina baggage handling conveyor of an airport each bag gets a bar code Characters 9 17 of the bar code are the flight number and destination airport of the bag After the bar code is read bag read EM is set the MID instruction copies the flight number and destination airport to the bag f and dest string Relay Ladder bag read EM 610 Structured Text IF bag read MID Middle String Source bag barcod NWA HOP 5058 AMS O01 Qty 9 Start Dest bag flt and dest 5058 AMS EM TH EN MID bar barcode 9 9 bag flt and dest bag read END IF EM F E s
53. Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI 90 On any scan for which zi switch 1 is cleared ot storage_1 is set this rung has no affect On any scan for which Zu switch 1 is set and storage 1 is cleared the ONS instruction sets s orage 1 and the ADD instruction increments sz by 1 As long as Amit_switch_1 stays set sum stays the same value The limit switch 1 must go from cleared to set again for sum to be incremented again Relay Ladder limit switch 1 storage 1 Add Source Source B Dest Structured Text IF limit switch 1 AND NOT storage 1 THEN sum sum 1 END IF storage 1 limit switch 1 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 One Shot Rising OSR The OSR instruction sets or clears the output bit depending on the status of the storage bit This instruction is available in structured text and function block as OSRI see page 96 Operands Relay Ladder OSR Operand Type Format Description One Shot Rising OB y Pp yp p Storage Bit SB5 storage bit BOOL tag internal storage bit Dutput Bit stores the rung condition in from the last time t
54. Asia Pacific Rockwell Automation Level 14 Core F Cyberport 3 100 Cyberport Road Hong Kong Tel 852 2887 4788 Fax 852 2508 1846 Publication 1756 RMOOS3K EN P July 2008 Supersedes Publication 1756 RMO003J EN P July 2007 Copyright 2008 Rockwell Automation Inc All rights reserved Printed in the U S A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com A rtisan Artisan Technology Group is your source for quality TecmoogyGroup new and certified used pre owned equipment FAST SHIPPING AND SERVICE CENTER REPAIRS WE BUY USED EQUIPMENT DELIVERY Experienced engineers and technicians on staff Sell your excess underutilized and idle used equipment TENS OF THOUSANDS OF at our full service in house repair center We also offer credit for buy backs and trade ins IN STOCK ITEMS www artisantg com WeBuyEquipment EQUIPMENT DEMOS HUNDREDS OF InstraV ea REMOTE INSPECTION LOOKING FOR MORE INFORMATION MANUFACTURERS Remotely inspect equipment before purchasing with Visit us on the web at www artisantg com 7 for more our interactive website at www instraview com 7 information on price quotations drivers technical LEASING MONTHLY specifications manuals and documentation RENTALS ITAR CERTIFIED yop aed Contact us 888 88 SOURCE sales artisantg com www artisantg com
55. DVPA BOOL deviation is alarmed high O no 1 yes PVLA BOOL PV is alarmed low 0 no 1 yes PVHA BOOL PV is alarmed high O no 1 yes Description The PID instruction typically receives the process variable PV from an analog input module and modulates a control variable output CV on an analog output module in order to maintain the process variable at the desired setpoint The EN bit indicates execution status The EN bit is set when the rung condition in transitions from false to true The EN bit is cleared when the rung condition in becomes false The PID instruction does not use a DN bit The PID instruction executes every scan as long as the rung condition in is true EN bit rung state execution of the PID instruction Arithmetic Status Flags not affected Fault Conditions IMPORTANT These faults were major faults in the PLC 5 controller A Minor Fault Will Occur If Fault Type Fault Code UPD x0 4 35 setpoint out of range 4 36 Publication 1756 RMOOS3K EN P July 2008 501 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Execution Condition Action Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to
56. File Sort SRT Sort File Array Dim to vary Control Lenath Position Operands SRT Array Dimtovary The SRT instruction sorts a set of values in one dimension Dim to vary of the Array into ascending order Relay Ladder Operand Type Format Description Array SINT array tag array to sort INT specify the first element of the group of elements to sort DINT do not use CONTROL POS in the subscript REAL Dimension DINT immediate which dimension to use to vary 0 1 2 depending on the number of dimensions the order is array dim_0 dim_1 dim_2 array dim_0 dim_1 array dim 0 Control CONTROL tag control structure for the operation Length DINT immediate number of elements of the array to sort Position DINT immediate current element in the array initial value is typically 0 Structured Text Control The operands are the same as those for the relay ladder SRT instruction However you specify the Length and Position values by accessing the LEN and POS members of the CONTROL structure rather than by including values in the operand list CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the SRT instruction is enabled DN BOOL The done bit is set when the specified elements have been sorted ER BOOL The error bit is set when either LEN 0 or POS 0 Either of these conditions also generates a major fault LEN DINT The length specifies the number
57. Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 Example Remove the fractional part of float_value_1 leaving the non fractional part the Publication 1756 RMOO3K EN P July 2008 same and place the result in float_value_1_truncated Relay Ladder TRN Truncate Source float_value_1 7883 55554 Dest flnat value 1 truncated 799 04 Structured Text float value 1 truncated TRUNC float value 1 Function Block TRN 04 TRN Truncate float_value_1_truncated float_value_1 563 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Notes 564 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Introduction Use the ASCII serial port instructions to read and write ASCII characters IMPORTANT Ma use the ASCII serial port instructions you must configure the serial port of the controller See the Logix5000 Controllers Common Procedures publication 1756 PM001 If You Want To For Example Use This Available In These See Page Instruction Languages determine when the buffer contains check for data that contains ABL relay ladder 570 termination charact
58. PID structure 498 postscan structured text 662 product codes 181 program control instructions AFI 456 EOT 458 EVENT 464 introduction 433 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com JMP 434 627 631 JSR 436 LBL 434 627 631 MCR 452 NOP 457 RET 436 SBR 436 TND 450 UID 454 UIE 454 PROGRAM object 192 program operator control overview 654 proportional integral and derivative 497 RAD instruction 553 radians 553 REAL to String 621 relational operators structured text 666 REPEAT UNTIL 684 RES instruction 141 reset 141 reset SFC instruction 462 RESULT structure 479 487 RET instruction 436 474 retentive timer on 112 retentive timer on with reset 124 return 436 474 ROUTINE object 193 RTO instruction 112 RTOR instruction 124 RTOS instruction 621 S SBR instruction 436 scaling 505 scan delay function block diagram 647 search mode 490 488 search string 605 sequencer input 420 sequencer instructions introduction 419 SQI 420 SQL 428 S00 424 sequencer load 428 sequencer output 424 Publication 1756 RMO03K EN P July 2008 Index serial port instructions ABL 570 ACB 573 ACL 575 AHL 577 ARD 581 ARL 585 AWA 589 AWT 594 introduction 565 SERIAL PORT CONTROL structure 566 568 570 573 578 582 586 590 595 SERIALPORT object 193 set system value 176 SFP
59. The rung condition out is set to false Function Block Action No action taken instruction first scan No action taken instruction first run Enableln is cleared No action taken EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan Publication 1756 RMOO3K EN P July 2008 No action taken 521 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 522 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Relay Ladder SIN Sine Source value 0 78539819 Dest result 0 70710677 Structured Text result SIN value Function Block value Example Calculate the sine of value and place the result in resu t result Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Cosine COS The COS instruction takes the cosine of the Source value in radians and stotes the result in the Destination Operands Relay Ladder cos pi Operand Type Format Description Dest Source SINT immediate find the cosine of this value INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest COS source Use COS as a
60. condition is unacknowledged Default is cleared ROCNegOperAck BOOL Negative rate of change operator acknowledge Set by the operator interface to acknowledge a negative rate of change condition Requires a cleared to set transition while the alarm condition is unacknowledged The alarm instruction clears this parameter Default is cleared Progsuppress BOOL Set by the user program to suppress the alarm Default is cleared OperSuppress BOOL Set by the operator interface to suppress the alarm The alarm instruction clears this parameter Default is cleared ProgUnsuppress BOOL Set by the user program to unsuppress the alarm Takes precedence over Suppress commands Default is cleared OperUnsuppress BOOL Set by the operator interface to unsuppress the alarm Takes precedence over Suppress commands The alarm instruction clears this parameter Default is cleared 46 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Input Parameter Data Type Description ProgDisable BOOL Set by the user program to disable the alarm Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperDisable BOOL Set by the operator interface to disable the alarm The alarm instruction clears this pa
61. data from this routine that you want to copy parameter to a tag in the subroutine SINT tag e nput parameters are optional INT array tag e Enter multiple input parameters if needed DINT REAL structure Return BOOL tag tag in this routine to which you want to copy parameter a result of the subroutine SINT array tag e Return parameters are optional INT e Enter multiple return parameters if needed DINT REAL structure Function Block E Input Parameters Return Parameters Jump to Subroutine m Routine X Jk mj Jump to Subroutine Routine T The operands are the same as those for the relay ladder JSR instruction Publication 1756 RMOOS3K EN P July 2008 437 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT For each parameter in a SBR or RET instruction use the same data type including any array dimensions as the corresponding parameter in the JSR instruction Using different data types may produce unexpected results SBR Operands The SBR instruction must be the first instruction in a relay ladder or structured text routine Relay Ladder SBR Subroutine Ahoy i isliuag NCC Input par Operand Type Format Description Input BOOL tag tag in this routine into which you want to parameter copy the corresponding input parameter from S
62. do not use CONTROL POS in the subscripts Cmp control CONTROL structure control structure for the compare Length DINT immediate number of bits to compare Position DINT immediate current position in the source initial value is typically 0 Result CONTROL structure control structure for the results control Length DINT immediate number of storage locations in the result Position DINT immediate current position in the result initial value is typically 0 Use different tags for the compare control structure and the result control structure Using the same tag for both could result in unpredictable operation possibly causing equipment damage and or injury to personnel Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 COMPARE Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the FBC instruction is enabled DN BOOL The done bit is set when the FBC instruction compares the last bit in the Source and Reference arrays FD BOOL The found bit is set each time the FBC instruction records a mismatch one at a time operation or after recording all mismatches all per scan operation JN BOOL The inhibit bit indicates the FBC search mode 0 2 all mode 1 one mismatch at a time mode ER BOOL The error bit is set if the compare POS 0 the
63. ge Relay Ladder Absolute Value Source T Operand Type Format Description Dest Source SINT immediate value of which to take the absolute value INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL Structured Text dest ABS source Use ABS as a function This expression computes the absolute value of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text ABS 01 Function Block ABS E Absolute Value Operand Type Format Description s ABS tag FBD MATH ADVANCED structure ABS structure Publication 1756 RMOO3K EN P July 2008 277 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Value of which to take the absolute value Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The ABS instruction takes the absolute value of the Source and pla
64. lt DINT REAL string greater than gt DINT REAL string greater than or equal gt DINT REAL string not equal lt gt DINT REAL string Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Use This Format valuel operator value2 For example Example Structured Text Programming Appendix C For This Situation If temp is a DINT tag and your specification says If temp is less than 100 then You d Write IF temp lt 100 THEN stringtagl operator stringtag2 If bar code and dest are string tags and your specification says If bar_code equals dest then IF bar code dest THEN charl operator char2 To enter an ASCII character directly into the expression enter the decimal value of the character If bar codeis a string tag and your specification says If bar code DATA 0 equals A then IF bar code DATA 0 65 THEN bool tag bool expressions Publication 1756 RMOO3K EN P July 2008 If countand length are DINT tags done is a BOOL tag and your specification says If count is greater than or equal to ength you are done counting How Strings Are Evaluated done count gt length The hexadecimal values of the ASCII characters determine if one string is less than or greater than another string When the two strings are sorted as in a
65. na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The current routine terminates The current routine terminates postscan The rung condition out is set to false No action taken 450 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Example You can use the TND instruction when debugging or troubleshooting to execute logic up to a certain point Progressively move the TND instruction through the logic as you debug each new section When the TND instruction is enabled the controller stops scanning the current routine Relay Ladder lt CTND Structured Text TND Publication 1756 RMOO3K EN P July 2008 451 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Master Control Reset MCR Operands CMCR Description Arithmetic Status Flags Fault Conditions 452 The MCR instruction used in pairs creates a program zone that can disable all rungs within the MCR instructions Relay Ladder none When the MCR zone i
66. rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction removes the specified characters from the buffer and stores them in the destination The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan The rung condition out is set to false No action taken Example Continuously test the buffer for a message from a MessageView terminal Since each message ends in a carriage return r the carriage return is configured as the termination character in the Controller Properties dialog box User Protocol tab When the ABL finds a carriage return its sets the FD bit When the ABL instruction finds the carriage return MV Zne FD is set the controller has received a complete message The ARL instruction removes the characters from the buffer up to and including the carriage return and places them in the DATA member of the MlV_msg tag which is a string Publication 1756 RMOO3K EN P July 2008 587 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT
67. see Logix5000 Controllers Common Procedures publication 1756 PM001 e Program logic to coordinate the execution of messages For more information see Logix5000 Controllers Common Procedures publication 1756 PM001 6 Keep the number of unconnected and The controller can have 10 40 unconnected buffers The default number is 10 uncached MSGs less than the number of e f all the unconnected buffers are in use when an instruction leaves the message unconnected buffers g queue the instruction errors and does not transfer the data e You can increase the number of unconnected buffers 40 max but continue to follow guideline 5 e To increase the number of unconnected buffers see Logix5000 Controllers Common Procedures publication 1756 PM001 Publication 1756 RMOO3K EN P July 2008 175 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter4 Input Output Instructions MSG GSV SSV IOT Get System Value GSV and The GSV SSV instructions get and set controller system data that is stored in bjects Set System Value SSV pue Operands Relay Ladder GSV Sy Get System Value Set System Value Class name Class name Instance name Instance name Attribute Name Attribute Name Dest Source Operand Type Format Description Class name name name of object Instance name name name of specific object when object requires name Attribute Name name attribute of object
68. the tag No major fault is generated NOT user defined data If the Length is too big the instruction stops at the end of the type array No major fault is generated The Length is too big if it is more than the total number of elements in the Destination array For best results the Source and Destination should be the same type If you want to fill a structure use the COP instruction see example 3 on page 359 If you mix data types for the Source and Destination the Destination elements are filled with converted Source values IfTheSourcels And The DestinationIs TheSourcels Converted To SINLINLDINLorREL SNNT SN SINT INT DINT or REAL INT INT SINT INT DINT or REAL DINT DINT SINT INT DINT or REAL REAL REAL SINT structure SINT not converted INT structure INT not converted DINT structure DINT not converted REAL structure REAL not converted not affected Fault Conditions none 382 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true end address start address Length number of bytes in
69. use the following elements Elements input reference IREF function block output reference OREF 4 output wire connector OCON input wire connector ICON Use the following table to choose your function block elements z If You Want To Usea supply a value from an input device or tag input reference IREF send a value to an output device or tag output reference OREF Publication 1756 RMO03K EN P July 2008 641 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Latching Data 642 Function Block Attributes If You Want To perform an operation on an input value or values and produce an output value or values Use a function block transfer data between function blocks when they are e far apart on the same sheet e on different sheets within the same routine output wire connector OCON and an input wire connector ICON disperse data to several points in the routine single output wire connector OCON and multiple input wire connectors ICON If you use an IREF to specify input data for a function block instruction the data in that IREF is latched for the scan of the function block routine The IREF latches data from program scoped and controller scoped tags The controller updates all IREF data at the beginning of each scan IREF 3H In this example the value of tagA is stored at the beginning of the rout
70. 0301 No buffer memory 0109 Invalid connection size 0302 Bandwidth not available 0110 Module not configured 0303 No screeners available 0111 EPR not supported 0305 Signature match 0114 Wrong module 0311 Port not available 0115 Wrong device type 0312 Link address not available 0116 Wrong revision 0315 Invalid segment type 0118 Invalid configuration format 0317 Connection not scheduled 011A Application out of connections These are the extended error codes for error code 001F Extended Error Description Code Hex 0203 Connection timeout These are the extended error codes for error code 0004 and 0005 Extended Error Description Code Hex 0000 extended status out of memory 0001 extended status out of instances 154 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 These are the extended error codes for error code 00FF Extended Description Extended Description Error Code Error Code Hex Hex 2001 Excessive IOI 2108 Controller in upload or download mode 2002 Bad parameter value 2109 Attempt to change number of array dimensions 2018 Semaphore reject 210A Invalid symbol name 201B Size too small 210B Symbol does not exist 201C Invalid size 210E Search failed 2100 Privilege failure 210F Task cannot start 2101 Invalid keyswitch position 2110 Unable
71. 171 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT For Block Transfers For block transfer messages add the following modules to the I O configuration of the controller For Block transfers Over Add These Modules To The 1 0 Configuration This Network ControlNet e local communication module for example 1756 CNB module e remote adapter module for example 1771 ACN module universal remote 0 e local communication module for example 1756 DHRIO module e one emote adapter module for example 1771 ASB module for each rack or portion of a rack in the chassis e block transfer module optional Specify a Communication Method Or Module Address Use the following table to select a communication method or module address for the message If The Destination Devicelsa Then Select And Specify Logix5000 controller CIP no other specifications required LC 5 controller over an therNet IP network LC 5 controller over a ontrolNet network P E P C SLC 5 05 controller P n S n LC 5 controller over a DH DH Channel Channel A or B of the 1756 DHRIO module that etwork is connected to the DH network LC controller over a DH Source Link Link ID assigned to the backplane of the etwork controller in the routing table of the 1756 DHRIO module The source node in the routing table is automatically the s
72. 1756 RMOO3K EN P July 2008 returns to the instruction that follows the calling FOR instruction lt r 473 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 12 For Break Instructions FOR FOR DO BRK EXIT RET Return RET The RET instruction returns to the calling FOR instruction Operands Relay Ladder RET Return Return par none Description IMPORTANT Do not place a RET instruction in the main routine If you place a RET instruction in the main routine a major fault occurs type 4 code 31 When enabled the RET instruction returns to the FOR instruction The FOR instruction increments the Index value by the Step size and executes the subroutine again If the Index value exceeds the Terminal value the FOR instruction completes and execution moves on to the instruction that follows the FOR instruction The FOR instruction does not use parameters The FOR instruction ignores any parameters you enter in a RET instruction You could also use a TND instruction to end execution of a subroutine Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code main routine contains a RET instruction 4 31 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Returns th
73. 19 fis 17 Ji Ave 19140904 46 445 4 4 1115 14 13 12 441 imension dint ave 12 2 10 9 8 7 6 3 Relay Ladder VE Average File N Array array dint 0 1 Dim to vary 0 N Dest dint ave pe R Control control 1 Length 4 Position pe Structured Text SIZE array dint 0 length sum 0 FOR position 0 TO length 1 DO sum sum array dint position END FOR dint ave sum length 368 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 2 Average array_dint which is DINT 4 5 5 dimension 1 Gy Br 0 1 2 3 4 0 20 19 18 fiz 16 AVE 354 53 2 1 15 _ 5 5 1115 14 13 12 11 dimension 0 dint ave 3 2 10 9 8 7 l6 i 35 4 3 2 1 Relay Ladder VE Average File N Array array dint 3 0 Dim to vary 1 N5 Dest dint ave of RH Control control_1 Lenath 5 Position of Structured Text SIZE array dint l length sum 0 FOR position 0 TO length 1 DO sum sum array dint position END FOR dint ave sum length Publication 1756 RMOO3K EN P July 2008 369 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE
74. 2 Then the instruction copies timer 2 values to timer w array_timer 3 Then the instruction copies timer 3 values to timer 4 array timer 4 array timer 9 Finally the instruction copies timer 9 values to timer 10 MUN array timer 10 Relay Ladder S FS JE Move Move Source 500 Source 0 Dest aray_timer 0 pre Dest aray_timer 0 acc 0 0 co Copy File Source array_timer 0 Dest array_timer 1 Length 10 Structured Text IF S FS THEN array timer 0 pre 500 array timer 0 acc 0 COP array timer 0 array timer 1 10 END IF 360 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 File Fill FLL The FLL instruction fills elements of an array with the Source value The Source remains unchanged Operands Relay Ladder Fill File i inti Sauce Operand Type Format Description Dest Source SINT immediate element to copy Lenath INT tag Important the Source and Destination operands should be the same data type or DINT unexpected results may occur REAL Destination SINT tag initial element to be overwritten by the Source INT Important the Source and Destination DINT operands should be the same data type or unexpec
75. 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Description The syntax is FOR count initial value TO final value optional BY increment If you don t specify an increment the loop increments by 1 DO statement iH bool expression THEN EO a If there are conditions when you want to optional exit the loop early use other statements END IF such as an IF THEN construct to condition an EXIT statement END FOR The following diagrams show how a FOR DO loop executes and how an EXIT statement leaves the loop eatly Donexnumber yes Donexnumber yes d of times ad of times no no statement 1 statement 1 statement 2 statement 2 J statement 3 statement 3 yes rest of the routine oe no v rest of the routine The FOR DO loop executes a specific To stop the loop before the count reaches the last number of times value use an EXIT statement Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code the construct loops too long 6 1 Publication 1756 RMOO3K EN P July 2008 679 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Example 1 If You Want This Enter This Structured Text Clear bits 0 31 in an array of BOOL
76. 2008 17 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT The size of each element depends on the data types you specify and the type of message command you use connection with EN CC 1 rung condition in EN bit EW bit connection with EN CC 2 0 ST bit DN bit or ER bit 41382 148 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Where Input Output Instructions MSG GSV SSV IOT Chapter 4 Description Where Description 1 rung condition in is true 5 message is sent EN is set ST is set EW is set EW is cleared connection is opened 2 message is sent 6 message is done or errored ST is set rung condition in is still true EW is cleared DN or ER is set ST is cleared connection is closed if EN CC 0 3 message is done or errored 7 rung condition in goes false and DN or ER is set rung condition in is false EN is cleared DN or ER is set ST is cleared connection is closed if EN CC 0 EN is cleared rung condition in is false 4 rung condition in is true DN or ER was previously set EN is set EW is set connection is opened DN or
77. 217 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example If va ve_7 is greater than or equal to value_2 set light_b If value_1 is less than value_2 clear light_b Relay Ladder EQ mel light b Grtr Than or Egl 4 gt B gt Source value 1 o Source B value 2 pe Structured Text light b value 1 gt value 2 Function Block GEQ 01 GEQ Grtr Than or Eq A gt B e wee C SourceA value 1 value 2 SourceB 218 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 The GRT instruction tests whether Source A is greater than Source B Greater Than GRT g Operands Relay Ladder GAT Greater Than AB Source Operand Type Format Description Source A SINT immediate value to test against Source B Source B 2 INT tag DINT REAL string Source B SINT immediate value to test against Source A INT tag DINT REAL string e If you enter a SINT or INT tag the value converts to a DINT value by sign extension e String data types are default STRING data type any new string data type that you create To test the characters o
78. 32 767 This command also writes REAL type data from the Logix5000 controller to a PLC 3 floating point file PLC3 Word Range Read read a contiguous range of 16 bit words in PLC 3 memory regardless of data type This command starts at the address specified as the Source Element and reads sequentially the number of 16 bit words requested The data from the Source Element is stored starting at the address specified as the Destination Tag PLC3 Word Range Write write a contiguous range of 16 bit words from Logix5000 memory regardless of data type to PLC 3 memory This command starts at the address specified as the Source Tag and reads sequentially the number of 16 bit words requested The data from the Source Tag is stored starting at the address specified as the Destination Element in the PLC 3 processor Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 The following diagrams show how the typed and word range commands differ The example uses read commands from a PLC 3 processor to a Logix5000 controller Typed read command Word range read command 16 bit words in 32 bit words in 16 bit words in 32 bit words in PLC 3 processor Logix5000 controller PLC 3 processor Logix5000 controller 2 p 2 2 p 4 3
79. 666 REPEAT UNTIL 684 WHILE DO 681 structures COMPARE 479 487 CONTROL 336 346 366 370 375 386 390 395 401 406 407 413 420 424 428 COUNTER 128 132 FBD BIT FIELD DISTRIBUTE 294 FBD_BOOLEAN_AND 317 FBD_BOOLEAN_NOT 326 FBD_BOOLEAN_OR 320 FBD_BOOLEAN_XOR 323 FBD_COMPARE 212 216 220 224 228 243 FBD_CONVERT 556 559 FBD_COUNTER 136 FBD_LIMIT 232 FBD_LOGICAL 304 307 311 315 FBD_MASK_EQUAL 238 FBD_MASKED_MOVE 288 FBD_MATH 253 256 259 262 267 275 547 FBD_MATH_ADVANCED 271 278 520 524 527 529 532 535 540 544 550 553 FBD_ONESHOT 96 99 FBD TIMER 116 120 124 FBD_TRUNCATE 561 MESSAGE 144 PID 498 RES instruction 141 RESULT 479 487 SERIAL PORT CONTROL 566 568 570 573 578 582 586 590 595 STRING 567 600 613 string 567 600 613 TIMER 104 108 112 SUB instruction 255 subroutine 436 subtraction 255 swap byte 299 SWPB instruction 299 synchronous copy 355 T TAN instruction 526 tangent 526 task configure programmatically 195 inhibit 195 monitor 195 trigger event task 464 trigger via consumed tag 201 TASK object 195 temporary end 450 timeout configure for event task 195 timer instructions introduction 103 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com RES 141 RTO 112 RTOR 124 TOF 108 TOFR 120 TON 104 TONR 116 timer off delay 108 timer off delay with reset 12
80. 78 relay ladder SSV 176 relay ladder Examine If Closed Set System Value structured text XIO 80 relay ladder STD 375 relay ladder Examine If Open File Standard Deviation XOR 310 relay ladder STOD 614 relay ladder Bitwise Exclusive OR structured text String To DINT structured text function block STOR 616 relay ladder UN a 546 ey an o the Power o String To REAL structured text function block SUB 255 relay ladder Subtract structured text function block SWPB 299 relay ladder Swap Byte structured text TAN 526 relay ladder Tangent structured text function block TND 450 relay ladder Temporary End TOD 556 relay ladder Convert to BCD function block TOFR 120 structured text Timer Off Delay with Reset function block TOF 108 relay ladder Timer Off Delay TONR 116 structured text Timer On Delay with Reset function block TON 104 relay ladder Timer On Delay TOT process control structured text Totalizer function block TPT 631 relay ladder Tracepoints TRN 561 relay ladder Truncate function block TRUNC 561 structured text Truncate UID 454 relay ladder User Interrupt Disable structured text Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation 21 Guaranteed 888 88 SOURCE www artisantg com Instruction Locator Notes 22 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
81. 888 88 SOURCE www artisantg com 433 Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Jump to Label JMP The JMP and LBL instructions skip portions of ladder logic Label LBL Operands Relay Ladder CJMP Operand Type Format Description gt JMP instruction LBL Label name label name enter name for associated LBL instruction LBL instruction Label name label name execution jumps to LBL instruction with referenced label name Description When enabled the JMP instruction skips to the referenced LBL instruction and the controller continues executing from there When disabled the JMP instruction does not affect ladder execution The JMP instruction can move ladder execution forward or backward Jumping forward to a label saves program scan time by omitting a logic segment until it s needed Jumping backward lets the controller repeat iterations of logic Be careful not to jump backward an excessive number of times The watchdog timet could time out because the controller never reaches the end of the logic which in turn faults the controller Jumped logic is not scanned Place critical logic outside the jumped zone A The LBL instruction is the target of the JMP instruction that has the same labelname MakesuretheLBLinstruction is the firstinstructionon its rung A label name must be unique within a routine The name ca
82. ACB instruction continuously counts the characters in the buffer When the buffer contains at least 24 characters the controller has received a bar code The ARD instruction moves the bar code to the DATA member of the bag bar code tag which is a string Relay Ladder bar code count EN ACB ASCII Chars in Buffer EN Channel 0 DN SerialPort Control bar code 2 Character Count GEQ Grtr Than or Eql A gt B Source A bar code count 0 24 ASCII Read Channel 0 Destination Source B SerialPort Control bar cod SerialPort Control Length Characters Read Publication 1756 RMOO3K EN P July 2008 583 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Structured Text ACB 0 bar code count IF bar code count POS 24 THI bar code read LEN 24 ARD 0 bag bar code bar code read END IF 584 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Read Line ARL ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT them in the Destination Chapter 17 The ARL instruction removes specified characters from the buffer and stores Operands Relay Ladder ARL ASCII Read Line END Channel Des
83. ALMD ALMA Chapter 1 Configure an Alarm After you enter an ALMD or ALMA instruction and specify the alarm tag Instruction name use the Alarm Configuration dialog to specify the details of the message Digital Alarm ALMD Motor1 01 Fau ProgAck Motor101 Ack ProgReset ProgDisable ProgEnable MinDurationPRE MinDuration amp CC Click here to configure the instruction The Properties dialog for the alarm instruction includes a Configuration tab ALMD Properties Motor101Fault Rung 1 ALMA Properties Tank32Level Rung 2 Configuration Status Parameters Tag Configuration Messages Status Parameters Tag Conditionc Latched Input Level Input Rate of Change Limit Severity Limit Severity mu z I7 Acknowledgement Required I High High sm Pose 00 s m 3 Miniur Ducelion z F Hiat wu fou Negative UU s ow v Low 0 0 500 Period nn IV Lem Lowe nn m Miniman Duration O J ms Doadband 0 0 IV Ackniowelgemeni Resp ited Album Cass Now Tan Factory ak View Command PactoryT ak View Command Status OK Alamc Normal Disabled a he ELEM ye Status UK OS sed Acknosledged D Suppress e sas hone Delivery Q Disabled nk Cancel Al Acknowledged Suppressed Delivery For each alarm instruction configure this information Option Description Condition ALMD instruction Condition to trigger the alarm
84. ATN relay ladder 535 structured text ATANU function block Structured text only Publication 1756 RMO03K EN P July 2008 You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the overflow status bit S V to see whether the result was truncated For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL 519 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Sine SIN Operands SIN Source Dest dest SIN source Fal SIN 04 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN The SIN instruction takes the sine of the Source value in radians and stores the result in the Destination Relay Ladder Operand Type Format Description Source SINT immediate find the sine of this value INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text Use SIN as a function This function computes the sine of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block Operand Type SIN tag FBD MATH ADVANCED Structure FBD
85. AVE seda rrisiesr VAR ha ERO Na E adde dei ba 365 File Sort SRT MP P UI L E ete aE ai 370 File Standard Deviation STD iiis vas kae ek daa cada a 375 Size In Elements SIZE nena varitiarenmianed aeiia ae 381 Chapter 9 Tntrod ct t petii fad iy CARR Rh EERE a i 385 Bit Shift Left BSE i is d ainin e Roca o e dete 386 Bit Shift Right BOK o caceucbackaciodcod a d aden 1 dote aded arisi dd 390 PIFO Load PEL ara trae 4d s Reb add LE uc P dcin d 394 FIFO Unload EE aguda aca Sinn te Rad d RU e ded Codi ac 400 LIFO Coad LED o sees c P Pa d CRURA EP PE ERPURCPRER S ER 406 LIFO Unload LFU adesse a a accra baile cepe a tw ebd des 412 Chapter 10 D tradude EOEL 5 2063 Pact C cap RICE E ER a ha eee ee ew RA 419 Sequeticet Input SOD os user E RERAWREEYX GR waar RES S 420 Enter an Immediate Mask Value isses socer n 421 Lise SQI without SOO uussesd bas rab nbrdi e ed 423 Sequencer Output SQO Less each pO ee S Cb ed aes e 424 Enter an Immediate Mask Values ss wat eex Ero RR 425 Using SQI with SQQ serene oid tb ERE RAE E dite n 427 Resetting the position of SQO Lou acd ee eked ele 427 Sequencer Load SOL aito Patou Ne ue Y sek eK ea HORROR RA 428 Chapter 11 Tntrod ctot tesise reais s kadaa TTE EET T Qo 433 Jump to Label JMP Label CN se sree ea oh e CARE dede i or S dao Ee e t 434 Jump to Subroutine JSR Subroutine SBR Return RET iius tesa ba Re Fai REA 436 Jump to External Routine JXR sac
86. Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Execution Condition prescan Relay Ladder Action The EN bit is cleared The DN bit is cleared The ER bit is cleared The POS value is cleared The rung condition out is set to false rung condition in is false Publication 1756 RMOO3K EN P July 2008 The EN bit is cleared The DN bit is cleared The ER bit is cleared The POS value is cleared The rung condition out is set to false 391 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition Relay Ladder Action rung condition in is true examine EN bit ANOS EN bit is set yes LEN 20 p gt DNbit is set examine source bit BURN UL bit remains set ER bit is set source bit 0 no Y UL bit is set shift array left one position left p Eu w e us gt _ gt 988 rung condition out is set to true DN bit is set postscan The rung condition out is set to false 392 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructi
87. CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example When enabled the XOR instruction performs a bitwise XOR operation on SourceA and SourceB and places the result in the destination tag value 1 0 0 0 0 0 0 0 0 00 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 vaue2 0 010 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 00 0 0 0 0 0 0 0 0 value result xor i0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 11 1 1 1 1 1 1 Relay Ladder OF Bitwise Exclusive OR Soue value 1 2 0000_0000_0000_0101_0101_0101_1111_1111 Source B value 2 2 0000_0000_0000_1111_1111_0000_0000_0000 Dest value result or 2 0000_0000_0000_1010_1010_0101_1111_1111 Structured Text value result xor value 1 XOR value 2 312 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Function Block value result xor valu
88. CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example Add float value 1 to float value 2 and place the result in add_result Relay Ladder ADD Add Source float value 1 00 Source B float value 2 0 0 E Dest add_result 00E Structured Text add result float value 1 float value 2 Function Block ADD 08 float value 1 C SourceA add result SourceB float value 2 254 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Subtract SUB The SUB instruction subtracts Source B from Source A and places the result in the Destination Operands sij Relay Ladder Subtract Source A Operand Type Format Description Source B Source A SINT immediate value from which to subtract Source B en INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Source B SINT immediate value to subtract from Source A INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extensi
89. Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Resume executing the SFC routine SFC Reset SFR Operands SFR SFC Reset SFC Routine Name Step Name SFR SFCRoutineName StepName Description Arithmetic Status Flags Fault Conditions 462 Artisan Technology Group IF sfp en e THEN SFP normal executing sfp en e 0 END IF The SFR instruction resets the execution of a SFC routine at a specified step Relay Ladder Operands Operand Type Format Description SFCRoutine ROUTINE name SFC routine to reset Name Step Name SFC STEP tag target step where to resume execution Structured Text The operands are the same as those for the relay ladder SFR instruction When the SFR instruction is enabled n the specified SFC routine all stored actions stop executing reset e The SFC begins executing at the specified step If the target step is 0 the chart will be reset to its initial step The Logix implementation of the SFR instruction differs from that in a PLC 5 controller In the PLC 5 controller the SFR executed when the rung condition was true After reset the SFC would remain paused until the rung containing the SFR became false This allowed the execution following a reset to be delayed This pause un pause feature of the PLC 5 SFR instruction was decoupled from the rung condition and moved into the SFP instruction not affe
90. DINT REAL Source Y SINT immediate exponent INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text Use two adjacent multiply signs as an operator within an expression This expression takes sourceX to the power of sourceY and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block Operand Type XPY tag FBD_MATH Format Description structure XPY structure Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Advanced Math Instructions LN LOG XPY Chapter 15 FBD MATH Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source X REAL Base value Valid any float Source Y REAL Exponent Output Parameter Data Type EnableOut BOOL Dest REAL Description Arithmetic Status Flags Fault Conditions Execution Condition prescan Valid any float Description The instruction produced a valid result Result of the math instruction Arithmetic status flags are set for this output If Source X is negative Source Y must be an integer value or a minor fault will occur The XPY instruction uses this algorithm Destination X Y The control
91. Destination SINT tag tag to store the result INT DINT REAL Expression SINT immediate an expression consisting of tags and or INT immediate values separated by operators DINT tag REAL A SINT or INT tag converts to a DINT value by sign extension E Structured Text Structured text does not have a CPT instruction but you can achieve the same results using an assignment and expression destination numeric expresion See Appendix C Structured Text Programming for information on the syntax of assignments and expressions within structured text Description The CPT instruction performs the arithmetic operations you define in the expression When enabled the CPT instruction evaluates the expression and places the result in the Destination The execution of a CPT instruction is slightly slower and uses more memory than the execution of the other compute math instructions The advantage of the CPT instruction is that it allows you to enter complex expressions in one instruction TIP There is no limit to the length of an expression Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions none 248 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Execution Condition Relay Ladder Action prescan The run
92. E Structured Text IF sourceA sourceB THEN Use adjacent greater than and equal signs gt as an operator within an statements expression This expression evaluates whether sourceA is greater than or equal to sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Publication 1756 RMOO3K EN P July 2008 215 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Ps GEQ 04 Function Block GEO LJ Grtr Than or Eql A gt B Operand Type Format Description GEQ tag FBD COMPARE structure GEQ structure SourceA Dest C SourceB FBD COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder GEQ instruction Description The GEQ instruction tests whether Source A is greater than or equal to Source B When you compare strings The hexadecimal values of the characters determi
93. EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 When the TOF instruction is disabled the ACC value is cleared rung condition in timer enable bit EN NEN timer timing bit TT timer done bit DN R OFF delay preset a cetera d RC eee Vv timer accumulated value ACC ri J 0 A 16650 timer did not reach PRE value A timer runs by subtracting the time of its last scan from the time now ACC ACC current_time last_time_scanned After it updates the ACC the timer sets last_ time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 minutes while it runs Otherwise the ACC value won t be correct The last_time_scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minutes if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags no affected Fault Conditions A Major Fault Will Occur lf Fault Type Fa
94. EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example When enabled the OR instruction performs a bitwise OR operation on SourceA and SourceB and places the result in Dest SouceA 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 SouceB 010 00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 Dest 0 0 0 0 00 0 0 0 0 0 0 1 1 1 1 11 1 1 0 1 0 1 1 1 1 11 1 1 1 Relay Ladder OF Bitwise Inclusive OF Source value 1 2HO000_O0000_0000_0101_0101_0101_1111_1111 Source B value 2 2 0000_0000_0000_1111_1111_0000_0000_0000 Dest value_result_or 2 0000_0000_0000_1111_1111_0101_1111_1111 Structured Text value result or value 1 OR value 2 308 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Function Block OR 01 OR mi Bitwise Inclusive OR O SourceA o value result or O SourceB Publication 1756 RMOO3K EN P July 2008 309 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical
95. FRD TRN TRUNC ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT ASCII String Instructions CONCAT DELETE FIND INSERT MID Publication 1756 RMOO3K EN P July 2008 Table of Contents Chapter 14 L ibbOR db Ohi qa eia nk teed M Cn CV ct D Cae a CR Ca d ss SIE SEND puc aes Ra uci tr eeu RUP RR Ee eee en Pn Cosine COS Tangent PLAN es eod doit A in A tcd d e ac op esci RT do Rain At Sine ASN ccs ada doe uo a Cia yadda eae EROR Adee tens Ate Cosine AGO eissa orga bac d dedu U ado EO ede o ded aot bee de Arc Tangent ATN oa souockadecterd e RE bd dea ue dtd Chapter 15 TuttOdUcloti esed Bae ee ER E WU Wu vo cR ET EN atur EOL og wa RR EUER RR EQ RO RROCN URS RO ERR Log Base 10 LOG X tothe Power of Y QUEM oua ed a o ru a Y M a RE P d Chapter 16 LttoduobOBe c xexauaue dca a RR RR RERO Pees A RR GG ARR KR CERRO Degrees DEG R dians RAD Pr Convert to BCD TOD Convert to Integer FRD Truncate TRN Chapter 17 Lote ae UE esee dace par a e rac dole EE ad T Instr ction Pel On s ces qoe em oe eb eed ego eo d ED ASCII Error Codes String Data Types ASCII Test For Buffer Line ABL ciae Ra ERR RERO wa ASCII Chars in Buffer ACB ASCII Clear Buffer ACL suacsesadue RR RO REX RE ERA ASCII Handshake Lines AHL ASCII Read ARD ASCL Read Line CAELO doi s darscdctoeka kei eet aedi d edad da ASCII Write Append AWA ASCII Write AW Da uices pate CR niii ERE REN ER Chapter 18 Tatrodyc gi
96. Fault Conditions none Example 1 IF THEN If You Want This Enter This Structured Text IF rejects 3 then IF rejects 3 THEN conveyor off 0 conveyor 0 alarm on 1 alarm 1 END IF Example 2 IF THEN ELSE If You Want This Enter This Structured Text If conveyor direction contact forward 1 then IF conveyor direction THEN light off light 0 Otherwise light on ELSE light 1 END IF The tells the controller to clear Aght whenever the controller enters the RUN mode leaves the step of an SFC if you configure the SFC for Automatic reset This applies only if you embed the assignment in the action of the step of use the action to call a structured text routine via a JSR instruction Publication 1756 RMOO3K EN P July 2008 673 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Example 3 IF THEN ELSIF If You Want This Enter This Structured Text If sugar low limit switch low on and sugar high limit IF Sugar Low amp Sugar High THEN switch not high on then inlet valve open on Sugar Inlet 1 Until sugar high limit switch high off ELSIF NOT Sugar High THEN Sugar Inlet 0 END IF The tells the controller to clear Sugar In et whenever the controller enters the RUN mode leaves the step of an SFC if you configure t
97. FaultCode E disc in 2 FaultInfo disc in 2 info FaultInfo E disc in 2 Mode disc in 2info Mode Structured Text GSV PROGRAM DISCR discrete inf GSV PROGRAM DISCR GSV GSV Get system value Get system value Object class PROGRAM Object class PROGRAM Object name DISCRETE Object name DISCRETE Attribute name LASTSCANTIME Dest discrete_info LastScanTime 496 Attribute name M XSCANTIME Dest discrete_info MaxScanTime 4500 E LASTSCANTI Fi LastScanTime E MAXSCANTIME discrete info MaxScanTime Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Example 3 This example gets status information about task JO es and places the data in Publication 1756 RMOO3K EN P July 2008 a user defined structure o esz ifo Relay Ladder GSV GSV GSV Get system value Get system value Get system value Object class TASK Object class TASK Object class TASK Object name ID TEST bject name IO TEST Object name IO TEST Attribute name LASTSCANTIME Attribute name MAXSCANTIME Attribute name WATCHDOG Dest io test info LastScanTime Dest io test info MaxScanTime 0 Dest io test info W atchDog 2998 6847 500000 Structured Text GSV TASK IO TEST LASTSCANTIM GSV TASK IO_TEST
98. Functions can only be used in expressions 660 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Term construct see page 671 Definition A conditional statement used to trigger structured statements n n Terminate the construct with a semi colon Examples text code i e other IF THEN CASE FOR DO WHILE DO REPEAT UNTIL EXIT comment see page 687 Assignments Text that explains or clarifies what a section of structured text does comment e Use comments to make it easier to interpret the structured text e Comments do not affect the execution of the st e Comments can appear anywhere in structured text this syntax ructured text start of comment end of comment start of comment end of comment Use an assignment to change the value stored within a tag An assignment has tag expression where Component tag Description represents the tag that is getting the new value the tag must be a BOOL SINT INT DINT or REAL is the assignment symbol expression represents the new value to assign to the tag If tag isthis data type Use this type of expression BOOL BOOL expression SINT numeric expression INT DINT REAL Publication 1756 RMOO3K EN P July
99. Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example Each time switch 1 goes from cleared to set the OSR instruction sets output bit 1 and the ADD instruction increments sum by 5 As long as limit_switch_1 stays set sum stays the same value The Amit_switch_1 must go from cleared to set again for sw to be incremented again You can use output bit 1 on multiple rungs to trigger other operations lirnit_switch_1 05A One Shot Rising Storage Bit storage_bit_1 Output Bit output_bit_1 output_bit_1 DD Add Source Source B Dest Publication 1756 RMOO3K EN P July 2008 93 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI One Shot Falling OSF The OSF instruction sets or clears the output bit depending on the status of the storage bit This instruction is available in structured text and function block as OSFI see page 99 Operands Relay Ladder Operands OSF Operand Type Format Description alli DB E se i T storage bit BOOL tag internal storage bit Output Bit EM stores the rung condition in from the last time the instruction was executed output bit BOOL tag bit to be set Description When disabled and the storage bit is set the OSF
100. Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The UID instruction prevents interruption by higher priority tasks The UIE instruction enables interruption by higher priority tasks postscan The rung condition out is set to false No action taken Example When an error occurs error bit is on the FSC instruction checks the error code against a list of critical errors If the FSC instruction finds that the error is ctitical error check FD is on an alarm is annunciated The UID and UIE instructions prevent any other tasks from interrupting the error checking and alarming Relay Ladder UID 7 error bit FSC JE File Search Compare EN 4 Control error chec DN Length 10 ER Position 8 Mode ALL Expression error code error list error_ch eck POS error check FD alarm JE UIE 2 Structured Text UID lt statements gt UIE
101. Indicates the number of milliseconds that have elapsed since the alarm condition was met ALMD ALMD In ProgAck ProgReset ProgDisable ProgEnable 30 Structured Text The operands are the same as those for the relay ladder ALMD instruction with a few exceptions as indicated above Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com s A Dig jj In Input Parameter Enableln LMD 01 ALMD ital Alarm Suppressed f Disabled Data Type BOOL FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Function Block Operand Type Format Description ALMD tag ALARM DIGITAL Structure ALMD structure ALARM DIGITAL Structure Description Relay Ladder Corresponds to the rung state Does not affect processing Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction always executes BOOL The digital signal input to the instruction Default is cleared Relay Ladder Follows the rung condition Set if the rung condition is true Cleared if the rung condition is false Structured Text Copied from instruction operand InFault BOOL Bad health indicator for the input The user application may set InFault to indicate the
102. Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Bitwise Exclusive OR XOR The XOR instruction performs a bitwise XOR operation using the bits in Source A and Source B and places the result in the Destination To perform a logical XOR see page 323 Operands Relay Ladder XOR Bitwise Exclusive OR Source Operand Type Format Description Source B Source A SINT immediate value to XOR with Source B Dest INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Source B SINT immediate value to XOR with Source A INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT E Structured Text dest A XOR B 9 Miss AER Use XOR as an operator within an expression This expression evaluates sourceA XOR sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text st XOR 01 Function Block xoR gg Bitwise Exclusive OR Operand Type Format Description d Sourcea Dest H XOR tag FBD_LOGICAL structure XOR structure SourceB 310 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 FBD LOGICAL Structure Input Parameter Data Type Description En
103. Instructions MSG GSV SSV IOT Chapter 4 Condition prescan Execution Relay Ladder Action The rung condition out is set to false Structured Text Action No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes The rung condition out is set to true na Enableln is set na Enableln is always set The instruction executes instruction execution The instruction e updates the connection of the specified tag e resets the RPI timer of the connection postscan The rung condition out is set to false No action taken Example 1 When the IOT instruction executes it immediately sends the values of the Local 5 0 tag to the output module Relay Ladder Structured Text Publication 1756 RMOO3K EN P July 2008 TOT Local 5 0 IOT Immediate Output Update Tag Local 5 0 203 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Example 2 This controller controls station 24 and produces data for the next station station 25 To use an IOT instruction to signal the transmission of new data the produced tag is configured as follows uU fo Tag Properties Produced Tag General Connection Maximum Consumers 4 Produced_Tag is configured to update its e
104. Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Term Definition Examples expression An expression is part of a complete assignment or construct statement An expression evaluates to a number numerical expression or to a true see page 663 or false state BOOL expression An expression contains tags A named area of the memory where data is stored valuel BOOL SINT INT DINT REAL string immediates A constant value 4 operators A symbol or mnemonic that specifies an operation tagl tag2 within an expression tagl gt valuel functions When executed a function yields one value Use function tagl parentheses to contain the operand of a function Even though their syntax is similar functions differ from instructions in that functions can only be used in expressions Instructions cannot be used in expressions instruction An instruction is a standalone statement instruction see page 670 An instruction uses parenthesis to contain its operands Depending on the instruction there can be zero one or multiple instruction operand operands When executed an instruction yields one or more values that are part of a data structure instruction operandl operand2 operand3 n n Terminate the instruction with a semi colon Even though their syntax is similar instructions differ from functions in that instructions cannot be used in expressions
105. Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false The instructions in the zone are scanned but the rung condition in is false and non retentive outputs in the zone are disabled rung condition in is true The rung condition out is set to true The instructions in the zone are scanned normally postscan The rung condition out is set to false Example When the first MCR instruction is enabled zzpat 1 input 2 and input 3 are set the controller executes the rungs in the MCR zone between the two MCR instructions and sets or clears outputs depending on input conditions When the first MCR instruction is disabled upu 1 input 2 and input_ are not all set the controller executes the rungs in the MCR zone between the two MCR instructions and the rung condition in goes false for all the rungs in the MCR zone regardless of input conditions input 1 input 2 input 3 Rm E eer input 4 output 1 input 11 input 12 output 2 input 3 input 9 input 10 output 3 em Publication 1756 RM003K EN P July 2008 453 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www arti
106. July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Condition prescan Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Execution Function Block Action No initialization required Chapter 3 Structured Text Action No initialization required instruction first scan instruction first run CUEnable and CDEnable are set CUEnable and CDEnable are set CUEnable and CDEnable are set CUEnable and CDEnable are set Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated na Enableln is set The instruction sets CUEnable and CDEnable On a cleared to set transition of Enableln e he instruction executes e EnableOut is set The instruction sets CUEnable and CDEnable Enableln is always set The instruction executes reset When set the instruction clears CUEnable When set the instruction clears CUEnable CDEnable CU CD DN OV and UN and sets CDEnable CU CD DN OV and UN and sets ACC zero ACC zero postscan No action taken No action taken Example When zz switch goes from cleared to set CUEnable is set for one scan and the CTUD instruction increments the ACC value by 1 When ACC 2 PRE the DN parameter is set which enables the function block instruction following the CT
107. LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Trigger Event Task EVENT Operands EVENT Trigger Event Task Task EVENT task name Description Status Attribute of the TASK Object The EVENT instruction triggers one execution of an event task Relay Ladder Operand Type Format Description Task TASK name event task to execute The instruction lets you choose other types of tasks but it does not execute them Structured Text The operands are the same as those for the relay ladder EVENT instruction Use the EVENT instruction to programmatically execute an event task Each time the instruction executes it triggers the specified event task Make sure that you give the event task enough time to complete its execution before you trigger it again If not an overlap occuts e If you execute an EVENT instruction while the event task is already executing the controller increments the overlap counter but it does not trigger the event task Programmatically Determine if an EVENT Instruction Triggered a Task To determine if an EVENT instruction triggered an event task use a Get System Value GSV instruction to monitor the Status attribute of the task Attribute Data Type Instruction Description Status DINT GSV Provides status information about the task Once the controller sets a bit you must manually clear the bit to determine if another fault of that type occurred d
108. MATH ADVANCED Format Description structure SIN structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction 520 Valid any float Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Parameter Data Type Output Parameter Data Type Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Description Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The Source must be greater than or equal to 205887 4 C2nx2D5 and less than Arithmetic Status Flags Fault Conditions Execution Condition prescan or equal to 205887 4 Qnx255 The resulting value in the Destination is always greater than or equal to 1 and less than or equal to 1 Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false rung condition in is false rung condition in is true The rung condition out is set to false The controller calculates the sine of the Source and places the result in the Destination The rung condition out is set to true postscan Condition prescan
109. MAXSCANTIM EI E io test info LastScanTime io test info MaxScanTime GSV TASK IO TEST WATCHDOG io test info WatchDog 199 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Set Enable And Disable Flags The following example uses the SSV instruction to enable or disable a program You could also use this method to enable or disable an I O module which is a similar to using inhibit bits with a PLC 5 processor Example Based on the status of SW 7 place the appropriate value in the disableflag attribute of program discrete Relay Ladder Sw MOV Move Source enable_prog p Dest discrete prog flag 0 SW MOV Move Source disable prog 1 Dest discrete_prog_flag p 55V Set system value Object class PROGRAM Object name DISCRETE Attribute name DISABLEFLAG Source discrete_prog_flag p Structured Text IF SW 1 THEN discrete prog flag enable prog ELSE discrete prog flag disable prog END_IF SSV PROGRAM DISCRETE DISABLEFLAG discrete prog flag 200 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Immediate Output IOT The IOT instruction immediately updates the specified
110. MM String Data Types String Concatenate CONCAT Strine Delete DELETE Geo ect ueg ac Re eR CROP ERES EA EO Find String FIND Insert String INSERT Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Table of Contents ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Debug Instructions BPT TPT Common Attributes Function Block Attributes Middle String MAID ice stows iiiew dea ew Fe Rao Eae a es d eite 609 Chapter 19 IntroducHof cs zie ieu tou eee pee EE 611 Strine Data TYPES e ior ara ioter fee ARR RM E a 613 String To DINT STOD iius spa aat eee tees teen ees 614 String To REAL STOR edd uio d acad dob ah doe Rac on t ac 616 DINT to String ITO sonra sieve bind Renee E pu a leid d 619 REAL toString RTOS ieu hrnatico des cnra We pe de dee ab 621 Upper Case UPPER ai riean ae na RR UAE WEN Y tees weedy E 623 Lower Case LOWER 14 id sich ee RR X RS Ede edere 625 Chapter 20 Introductiofi x2 ud du Qs I o ee el d SR 627 Breakpomis BPT cf aasekuawa eta ha Y RE RR PR AR REOR OR RR 627 Ss fe teense gcd detect tetas cited ot tea ete m 627 ied xo rri PNE 628 Trac points TPT uaeeacdcen n EA Et rl Beso e RO e rien aida 631 T 631 Sting FoOr5mab cvs atro ERR yess es n Ee a de Re RR ES 631 Appendix A IntfOdU Ctlof sc DOW e RP E qu 635 Immediate Values 0 eee e 635 Data Convetsions use Ru s dated S rre de a Rh eee S 635 SINT o
111. MOD structure Type FBD MATH structure Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 FBD_MATH Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source A REAL Value of the dividend Valid any float Source B REAL Value of the divisor Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description If Source B the divisor is zero a minor fault occurs Type 4 program fault Code 4 arithmetic overflow e the destination is set as follows If Source B Is Zero And And The Destination Is a And The Result Is Then The Destination Is Set To all operands are integers SINT INT gt gt Source A or DINT at least one operand is a REAL SINT INT or DINT positive 1 negative 0 REAL positive 1 positive infinity negative 1 negative infinity Publication 1756 RM003K EN P July 2008 To detect a possible divide by zero examine the minor fault bit S MINOR See Logix5000 Controllers Common Procedures publication 1756 PM001 267 Artisan Techn
112. Meaning 0 If set causes a major fault to be generated if any of the MODULE object connections fault while the controller is in Run mode 2 If set causes the MODULE object to enter Inhibited state after shutting down all the connections to the module Access The MOTIONGROUP Object The MOTIONGROUP object provides status information about a group of axes fot the servo module Specify the motion group tag name to determine which MOTIONGROUP object you want Attribute Data Type Instruction Description Instance DINT GSV Provides the instance number of this MOTION GROUP object Publication 1756 RMOOSK EN P July 2008 191 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Access The PROGRAM Object The PROGRAM object provides status information about a program Specify the program name to determine which PROGRAM object you want Attribute Data Type Instruction Description DisableFlag SINT GSV Controls this program s execution SSV Value Meaning 0 execution enabled 1 execution disabled Instance DINT GSV Provides the instance number of this PROGRAM object LastScanTime DINT GSV Time it took to execute this program the last time it was executed Time is in microseconds SSV MajorFaultRecord DINT 11 GSV Records major faults for this program SSV We recommend that you create a user defined structure to simplify acce
113. No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com No action taken 541 Chapter 15 Advanced Math Instructions LN LOG XPY 542 Relay Ladder Example LN Natural Log Source value 50 Dest result 1 6094378 Structured Text result LN value Function Block value Example Calculate the natural log of value and place the result in result Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Advanced Math Instructions LN LOG XPY Chapter 15 Log Base 10 LOG The LOG instruction takes the log base 10 of the Source and stores the result in the Destination Operands Relay Ladder LOG Log Base 10 Operand Type Format Description Source f Source SINT immediate find the log of this value Dest INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest LOG source Use LOG as a function This function computes the log of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions w
114. No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken 264 Example 1 Divide float value 1 by float value 2 and place the result in divide_result Relay Ladder DIY Divide Source 4 float value 1 00 Source B float value 2 00 Dest divide result 0 0 Structured Text divide result float value 1 float value 2 Function Block DIV 02 DIY Divide float value 1 float value 2 C SourceA C SourceB Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com divide result Publication 1756 RMO03K EN P July 2008 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Example 2 The DIV and MOV instructions work together to divide two integers round the result and place the result in an integer tag The DIV instruction divides dint_a by dint_b e To round the result the Destination is a REAL tag If the destination was an integer tag SINT INT or DINT the instruction would truncate the result e The MOV instruction moves the rounded result rea _temp from the DIV to divide_result_rounded Since divide result rounded is a DINT tag the value from rea _temp is rounded and plac
115. OR bitwise OR DINT me exponent x to y DINT REAL RAD degrees to radians DINT REAL ABS absolute value DINT REAL SIN sine REAL ACS arc cosine REAL SOR square root DINT REAL AND bitwise AND DINT TAN tangent REAL ASN arc sine REAL TOD integer to BCD DINT ATN arc tangent REAL TRN truncate DINT REAL COS cosine REAL XOR bitwise exclusive OR DINT DEG radians to degrees DINT REAL FRD BCD to integer DINT LN natural log REAL Format Expressions For each operator that you use in an expression you have to provide one or two operands tags or immediate values Use the following table to format operators and operands within an expression For Operators That Use This Format Examples Operate On one operand operator operand ABS tag a two operands operand_a operator operand_b e tag b45 e tag c AND tag d e tag e 2 MOD tag f tag gl 250 Publication 1758 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Determine the order of operation The operations you write into the expression are performed by the instruction in a prescribed order not necessarily the order you write them You can override the order of operation by grouping terms within parentheses forcing the instruction to perform an operation within the parentheses ahead of other operations Operations of equal
116. OTL instruction sets latches the data bit Relay Ladder Operand Type Format Description data bit BOOL tag bit to be set Structured Text Structured text does not have an OTL instruction but you can achieve the same results using an IE THEN construct and an assignment IF BOOL expression THEN data bit 1 END IF See Appendix 641B Function Block Attributes for information on the syntax of constructs expressions and assignments within structured text When enabled the OTL instruction sets the data bit The data bit remains set until it is cleared typically by an OTU instruction When disabled the OTL instruction does not change the status of the data bit not affected none Relay Ladder Action The data bit is not modified The rung condition out is set to false rung condition in is false The data bit is not modified The rung condition out is set to false rung condition in is true The data bit is set The rung condition out is set to true postscan 84 The data bit is not modified The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFIJ Chapter 2 Example When enabled the OTL instruction sets ght_2 This bit remains set until it is cleared typically by an OTU instructio
117. P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Introduction If You Want To Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC The math conversion instructions convert values Use This Instruction Available In These Languages See Page Convert radians to degrees DEG relay ladder 550 structured text function block Convert degrees to radians RAD relay ladder 553 structured text function bloc Convert an integer value to a BCD value TOD relay ladder 556 function bloc Convert a BCD value to an integer value FRD relay ladder 559 function bloc Remove the fractional part of a value TRN relay ladder 561 TRUNC structured text function block 1 Structured text only Publication 1756 RMO03K EN P July 2008 You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the S V bit to see whether the result was truncated For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL 549 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Degrees DEG Operands DEG Radians To Deg
118. P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B Resolve a Loop To create a feedback loop around a block wire an output pin of the block to an input pin of the same block The following example is OK The loop contains only a single block so execution order does not matter This input pin uses an output that the block produced on the previous scan 9 a a eee If a group of blocks are in a loop the controller cannot determine which block to execute first In other words it cannot resolve the loop To identify which block to execute first mark the input wire that creates the loop the feedback wire with the Assume Data Available indicator In the following example block 1 uses the output from block 3 that was produced in the previous execution of the routine This input pin uses the output j gt that block 3 produced on the previous scan Assume Data Available indicator The Assume Data Available indicator defines the data flow within the loop The arrow indicates that the data serves as input to the first block in the loop Publication 1756 RMOO3K EN P July 2008 645 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Do not mark all the wires
119. Position array_dint 0 00000 11111 22222 33333 array dint 5 44444 55555 00000 control 1 pos 6 00000 00000 00000 Publication 1756 RMOO3K EN P July 2008 FIFO array dint D Dest value 2 Control cotrol 1 after FIFO unload 11111 22222 33333 44444 55555 00000 00000 00000 00000 00000 control 1 pos 5 value 2 00000 405 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU LIFO Load LFL The LFL instruction copies the Source value to the LIFO Operands Relay Ladder LFL LIFO Load N Operand Type Format Description icum p Source SINT immediate data to be stored in the LIFO Control Length INT tag Position DINT REAL string structure The Source converts to the data type of the array tag A smaller integer converts to a larger integer by sign extension LIFO SINT array tag LIFO to modify INT specify the first element of the LIFO DINT do not use CONTROL POS in the subscript REAL string structure Control CONTROL tag control structure for the operation typically use the same CONTROL as the associated LFU Length DINT immediate maximum number of elements the LIFO can hold at one time Position DINT immediate next l
120. Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Condition Relay Ladder Action rung condition in is true examine compare EN 1 goto compare EN bit p ait m 0 compare EN bit is set e compare DN bit 1 examine compare DN bit goto exit compare DN bit 0 compare ER bit is cleared compare FD bit is cleared P compare LEN x0 compare POS lt 0 7073 no compare ER bit is set rung condition out is set to true goto om Cm page 492 Publication 1756 RMOO3K EN P July 2008 491 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Condition Relay Ladder Action compare p compare POS compare LEN goto exit compare POS gt compare LEN page 491 result DN 1 compare FD bit is set reference compare POS source compare POS result DN bit is cleared result POS value is cleared Source compare POS examine result DN eference compare POS bit result DN 0 ua compare POS compare POS 1 result POS lt 0
121. REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out of the relay ladder EQU instruction Description Use the EQU instruction to compare two numbers or two strings of ASCII Arithmetic Status Flags 212 Fault Conditions characters When you comparte strings e Strings are equal if their characters match e ASCII characters are case sensitive Upper case A 41 is not equal to lower case a 61 not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Chapter 5 Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Source A Source B rung condition out is set to true rung condition out is set to false postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action
122. REAL loop update time seconds PV REAL scaled PV value ERR REAL scaled error value QUT REAL output PVH REAL process variable high alarm limit PVL REAL process variable low alarm limit DVP REAL positive deviation alarm limit DVN REAL negative deviation alarm limit PVDB REAL process variable alarm deadband DVDB REAL deviation alarm deadband MAXI REAL maximum PV value unscaled input MINI REAL minimum PV value unscaled input TIE REAL tieback value for manual control MAXCV REAL maximum CV value corresponding to 10096 MINCV REAL minimum CV value corresponding to 096 MINTIE REAL minimum tieback value corresponding to 10096 MAXTIE REAL maximum tieback value corresponding to 096 Publication 1756 RMOOS3K EN P July 2008 499 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Mnemonic Data Type Description DATA REAL 17 The DATA member stores Element Description DATA O integral accumulation DATA 1 derivative smoothing temporary value DATA 2 previous PV value DATA 3 previous ERR value DATA 4 previous valid SP value DATA 5 percent scaling constant DATA 6 PV scaling constant DATA 7 derivative scaling constant DATA 8 previous KP value DATA 9 previous Kl value DATA 10 previous KD v
123. RTOR CTU CTD CTUD RES Chapter 3 Example Each scan that imit_switch7 is set the RTOR instruction increments the ACC value by elapsed time until the ACC value reaches the PRE value When ACC 2 PRE the DN parameter is set and mer_state3 is set Structured Text RTOR Ol Preset 500 RTOR Ol Reset reset RTOR Ol TimerEnable limit switchl RTOR RTOR 01 timer state3 RTOR_01 DN Function Block RTOR 01 RTOR j Retentive Timer On with Reset 0 limit switch1 a TimerEnable t i timer state3 Publication 1756 RMOO3K EN P July 2008 127 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Count Up Count Up Counter Preset Accum CTU CTU Operands The CTU instruction counts upward This instruction is available in structured text and function block as CTUD see page 136 Relay Ladder Operand Type Format Description Counter COUNTER tag counter structure Preset DINT immediate how high to count Accum DINT immediate number of times the counter has counted initial value is typically 0 COUNTER Structure Mnemonic Data Type Description CU BOOL The count up enable bit indicates that the CTU instruction is enabled DN BOOL The done bit indicates that ACC 2 PRE
124. Reset RET 436 and 474 relay ladder Return structured text function block 20 Instruction Languages RTO 112 relay ladder Retentive Timer On RTOR 124 structured text Retentive Timer On with function block Reset RTOS 621 relay ladder REAL to String structured text SBR 436 relay ladder Subroutine structured text function block SFP 460 relay ladder SFC Pause structured text SFR 462 relay ladder SFC Reset structured text SIN 520 relay ladder Sine structured text function block SIZE 381 relay ladder Size In Elements structured text sal 420 relay ladder Sequencer Input SQL 428 relay ladder Sequencer Load SQ0 424 relay ladder Sequencer Output SOR 270 relay ladder Square Root function block SORT 270 structured text Square Root Publication 1756 RMOO3K EN P July 2008 Instruction Locator Instruction Location Languages Instruction Location Languages SRT 370 relay ladder UIE 454 relay ladder File Sort structured text User Interrupt Enable structured text SRTP process control structured text UPDN process control structured text Split Range Time function block Up Down Accumulator function block Proportional p UPPER 623 relay ladder SSUM process control structured text Upper Case structured text Selected Summer function block XIC
125. Result of the math instruction Arithmetic status flags are set for this output The Source must be greater than or equal to 1 and less than or equal to 1 The resulting value in the Destination is always greater than or equal to 1 2 and less than or equal to 1 2 where m 3 141593 Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller calculates the arc sine of the Source and places the result in the Destination The rung condition out is set to true postscan Condition prescan instruction first scan The rung condition out is set to false Function Block Action No action taken No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set postscan 530 The instruction executes EnableOut is set No action taken Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Example Calculate the arc sine of value and place the result in result Relay Ladder ASN Arc Sine Source value 0 2 Dest result 0 20135795 Structured Text result ASIN value
126. Special Instructions FBC DDT DTR PID Selecting the Search Mode If You Want To Detect Select This Mode One mismatch at a time Set the IN bit in the compare CONTROL structure Each time the rung condition in goes from false to true the FBC instruction searches for the next mismatch between the Source and Reference arrays Upon finding a mismatch the instruction sets the FD bit records the position of the mismatch and stops executing All mismatches Clear the IN bit in the compare CONTROL structure Each time the rung condition in goes from false to true the FSC instruction searches for all mismatches between the Source and Reference arrays Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code Result POS gt size of Result array 4 20 480 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Execution Condition Relay Ladder Action prescan compare EN bit is cleared examine compare DN 0 compare DN bit pus 1 compare DN bit is cleared compare POS value is cleared result DN bit is cleared ui rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 481 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOUR
127. Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA DINT Value to AND with SourceB Valid any integer SourceB DINT Value to AND with SourceA Valid any integer Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of the instruction Arithmetic status flags are set for this output Description Arithmetic Status Flags Fault Conditions Condition prescan Execution When enabled the instruction evaluates the AND operation If the Bit In And the Bit In The Bit In the Source A Is Source B Is Destination Is 0 0 0 0 1 0 1 0 0 1 1 1 If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction performs a bitwise AND operation The rung condition out is set to true postscan The rung condition out is set to false 304 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Mov
128. Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Input Parameter Data Type Description Proglime LINT If UseProgTime is set this value is used to provide the timestamp value for all events This lets the application apply timestamps obtained from the alarm source such as a sequence of events input module Severity DINT Severity of the alarm This does not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 MinDurationPRE DINT Minimum duration preset milliseconds for the alarm condition to remain true before the alarm is marked as InAlarm and alarm notification is sent to clients The controller collects alarm data as soon as the alarm condition is detected so no data is lost while waiting to meet the minimum duration Valid 0 2 147 483 647 Default 0 Output Parameter Data Type Description EnableOut BOOL Enable output InAlarm BOOL Alarm active status Set when the alarm is active Cleared when the alarm is not active normal status Acked BOOL Alarm acknowledged status Set when the alarm is acknowledged Cleared when the alarm is not acknowledged Acked is always set when AckRequired is cleared InAlarmUnack BO
129. This instruction is available in structured text as MVMT Or you can combine GR Source AND Mask bitwise logic within an expression and assign the result to the destination This expression performs a masked move on Source See Appendix C Structured Text Programming for information on the syntax of expressions and assignments within structured text Description The MVM instruction uses a Mask to either pass or block Source data bits A 1 in the mask means the data bit is passed A 0 in the mask means the data bit is blocked If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Publication 1756 RMOO3K EN P July 2008 285 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Enter an immediate mask value When you enter a mask the programming software defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix Description 16 hexadecimal for example 16 0FOF 0f octal for example 8216 2 binary for example 2 00110011 Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions none Execution Condition Relay Ladder Action
130. UL bi 9878543210 array dint O 011 1 1 1 0 0 0 0 1 after shift Example 2 When enabled the BSL instruction starts at bit 0 in array_dint 0 The instruction unloads array dint 1 25 into the UL bit shifts the remaining bits and loads imput_1 into array dint 0 0 The values in the remaining bits 31 26 in array dint 1 are invalid Note how array dint 0 31 shifts across words to array dint 1 j 0 BSL Bit Shift Left N Array array dint 0 Control control 1 N35 Source Bit input 1 Length 58 3 0 amay din o 1 11 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 y input_1 3 0 array dinift 0 0 1111 1 1 0 0 0 0111 1 1 1 0 0 0 0 1 111 1 oJ 0 0 0 5 Pe thesebitsshiftlet ULbit Publication 1756 RMOO3K EN P July 2008 389 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Bit Shift Right Array File Shift Instructions BSL BSR FFL FFU LFL LFU Bit Shift Right BSR The BSR instruction shifts the specified bits within the Array one position right Operands Relay Ladder BSR Operand Type Format Description CEN 3 Array DINT array tag array to modify Array Control Lenath So
131. When enabled the LFU instruction unloads array_dint 5 into value 2 LFU LIFO Unload LIFO array dint O N5 Dest value 2 M Control control 1 Length 10 Position B before LIFO unload after LIFO unload array dint O 00000 p 00000 11111 11111 22222 22222 33333 33333 44444 44444 array dint 5 55555 00000 control 1 pos 5 00000 control 1 pos 6 00000 value 2 55555 00000 00000 00000 00000 00000 00000 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 417 Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Notes 418 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI S00 SQL Introduction No action taken Sequencer instructions monitor consistent and repeatable operations If You Want To Use This Instruction Available In These Languages See Page Detect when a step is complete sal relay ladder 420 Set output conditions for the next step S00 relay ladder 424 Load reference conditions into SQL relay ladder 428 Sequencer arrays Publication 1756 RMO03K EN P July 2008 For relay ladder instructions bold data types indicate optimal data types An ins
132. a destination element end address end qare end_address end of destination array of destination array source_address Source destination address end address yes copy data in source addressto destination address rung condition out is set to true destination address destination address 1 j postscan The rung condition out is set to false Publication 1756 RM003K EN P July 2008 363 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example The FLL instruction copies the value in va se f into dest_1 Relay Ladder FLL Fill File Source value 1 Dest dest 1 Length 1 Source value_1 Source value_1 Destination Destination Data Type Value dest_1 Data Type dest_1 Value After FLL SINT 16 80 128 DINT 16 FFFF FF80 128 DINT 16 1234 5678 SINT 16 78 SINT 16 01 REAL 1 0 REAL 2 0 INT 16 0002 SINT 16 01 TIMER 16 0101 0101 16 0101 0101 16 0101 0101 INT 16 0001 TIMER 16 0001 0001 16 0001 0001 16 0001 0001 DINT 16 0000 0001 TIMER 16 0000 0001 16 0000 0001 16 0000 0001 Structured Text dest 1 value 1 364 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Inst
133. an expression you have to provide one or two operands tags or immediate values Use the following table to format operators and operands within an expression For Operators That Use This Format Examples Operate On one operand operator operand ABS tag a two operands operand aoperatoroperand b e tag b45 e ag c AND tag d e tag e 2 MOD tag f tag 9 Determine The Order of Operation The operations you write into the expression are performed by the instruction in a prescribed order not necessarily the order you write them You can override the order of operation by grouping terms within parentheses forcing the instruction to perform an operation within the parentheses ahead of other operations Operations of equal order are performed from left to right Order Operation 1 2 ABS ACS ASN ATN COS DEG FRD LN LOG RAD SIN SOR TAN TOD TRN negate NOT MOD lt lt gt gt subtract AND XOR OR S co cof xi S a s Publication 1756 RMOO3K EN P July 2008 209 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Use Strings In an Expression Use a relay ladder or structured text expression to compare string data types To use strings in an expression follow these guidelines An expressio
134. another tag for use in the application Relay Ladder CPS Synchronous Copy File Source project data 0 Dest produced array 0 Length 100 Structured Text CPS project data 0 produced array 0 100 Local 0 I Data stores the input data for the DeviceNet network that is connected to the 1756 DNB module in slot 0 To synchronize the inputs with the application the CPS instruction copies the input data to input_buffer e While the CPS instruction copies the data no I O updates can change the data e As the application executes it uses for its inputs the input data in input buffer Relay Ladder CPS Synchronous Copy File Source Local 0 l Data 0 Dest input buffer 0 Length 20 Structured Text CPS Local 0 I Data 0 input buffer 0 20 359 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 5 This example initializes an array of timer structures When enabled the MOV instructions initialize the PRE and ACC values of the first array_timer element When enabled the COP instruction copies a contiguous block of bytes starting at array Zimer 0 The length is nine timer structures array timer 0 First the instruction copies timer 0 values to timer 1 array timer 1 Then the instruction copies timer 1 values to timer M2 array timer
135. ar z msg LEN to the Serial Port Control Length of the AWA instruction a arzz rite LEN In alarm_msg the 14 counts as one character It is the hex code for the Ctrl T character Relay Ladder MOV AWA Move ASCII Write Append EN Source alarm msg LEN Channel 0 5 Source alarm msg DND Dest alarm_write LEN 1425 1 5 SerialPort Control alarm_write ER gt SerialPort Control Length 5 Characters Sent 6 Structured Text osri l InputBit alarm OSRI osri 1 IF osri_1 OutputBit THEN alarm write LEN alarm msg LEN AWA 0 alarm msg alarm write END IF 593 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Write AWT ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT The AWT instruction sends a specified number of characters of the Source tag to a setial device Operands Relay Ladder ASCII Write Channel Source SerialPort Control SerialPort Control Length Characters Sent Operand Type Format Enter Notes Channel DINT immediate 0 tag Source string tag tag that contains the e f you want to compare convert or characters to send manipulate the characters use a string data SINT type e For a string data type e String data types are INT enter the name of the tag e default STRING data type DINT e Fora SINT INT or DINT e any new string data type that yo
136. artisantg com Preface Logix5000 Controllers General Instructions Notes 28 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Introduction These Logix based alarm instructions ate available in relay ladder structured text and function block diagram When used with FactoryTalk View SE software version 5 0 and later these instructions create an alarming system with your visualization package The controller detects alarm conditions and publishes events to FactoryTalk View Alarms and Events servers that propagate alarms to Factory Talk View SE clients that subscribe to receive notifications If You Want To Use This Instruction Available In These Languages See Page detect alarms based on Boolean true false ALMD relay ladder 30 conditions structured text function block detect alarms based on the level or rate of ALMA relay ladder 42 change of a value Publication 1756 RMO03K EN P July 2008 structured text function block Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 29 Chapter 1 Digital Alarm ALMD Al MD Operands FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA The ALMD instruction detects alarms based on Boolean true fal
137. associated tags Analog Alarm Example Approximate Size Analog alarm with no associated tags and this configuration 2228 bytes e HH Alarm message Level Alarm e H Alarm Message Level Alarm L Alarm Message Level Alarm e LL Alarm Message Level Alarm e Rate of Change Positive Message Fill Too Fast Rate of Change Negative Message Empty Too Fast e Alarm Class Tank Farm A Analog alarm with two associated tags and this configuration 2604 bytes e HH Alarm message Level Alarm e H Alarm Message Level Alarm e Alarm Message Level Alarm e LL Alarm Message Level Alarm e Rate of Change Positive Message Fill Too Fast e Rate of Change Negative Message Empty Too Fast Alarm Class Tank Farm A e Associated Tag 1 DINT data type e Associated Tag 2 DINT data type Analog alarm with two associated tags and this configuration 4536 bytes e HH Alarm message Level Alarm e H Alarm Message Level Alarm L Alarm Message Level Alarm e LL Alarm Message Level Alarm e Rate of Change Positive Message Fill Too Fast Rate of Change Negative Message Empty Too Fast e Alarm Class Tank Farm A e Associated Tag 1 DINT data type e Associated Tag 2 STRING data type Longer message strings as well as message strings for multiple languages consume additional memory from your controller Actual memory usage will depend on how the alarm is configured message length and any associated tags passed with the alarm 74 Publicati
138. com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Arithmetic Status Flags not affected Fault Conditions none Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true rung condition out is set to true masked source masked compare rung condition out is set to false gt Y postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated Enableln is set The instruction executes EnableOut is set postscan No action taken Publication 1756 RMOO3K EN P July 2008 239 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example 1 1f the masked value_1 is equal to the masked va ue_2 set light_1 If the masked value_1 is not equal to the masked va ue_2 clear iight_1 This example shows that the masked values are equal A 0 in the mask restrains the instruction from comparing that bit shown by x in the example value 110 1 0 1 0 1 0
139. conditions generate prescan Toggle from Program to Run mode e Automatically enter Run mode from a power up condition Prescan does not occur for a program when The program becomes scheduled while the controller is running e The program is unscheduled when the controller enters Run mode Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Logix5000 Controllers General Instructions Preface Function block states IMPORTANT When programming in function block restrict the range of engineering units to 10 1 because internal floating point calculations are done using single precision floating point Engineering units outside of this range may result in a loss of accuracy if results approach the limitations of single precision floating point 4 10 38 The controller evaluates function block instructions based on the state of different conditions Possible Condition Description prescan Prescan for function block routines is the same as for relay ladder routines The only difference is that the Enableln parameter for each function block instruction is cleared during prescan instruction first scan Instruction first scan refers to the first time an instruction is executed after prescan The controller uses instruction first scan to read current inputs and determine the appropriate state to be in instruction fi
140. configured as latched the reset command also acknowledges the alarm Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Option Alarm class Description Use the alarm class to group related alarms Specify the alarm class exactly the same for each alarm you want in the same class The alarm class is case sensitive For example specify class Tank Farm A to group all the tank alarms for a specific area Or specify class Control Loop to group all alarms for PID loops You can then display and filter alarms at the HMI based on the class For example an operator can display all tank alarms or all PID loop alarms The alarm class does not limit the alarms that an Alarm Summary object subscribes to Use the alarm class to filter the alarms that display to an operator once they have been received by the Alarm Summary object FactoryTalk View software can filter the alarm class substituting wild cards for characters View command Enter Alarm Message Text Publication 1756 RMOOS3K EN P July 2008 Year Execute a command on the operator station when requested by an operator for a specific alarm This lets an operator execute any standard FactoryTalk View command such as call specific faceplates and displays execute macros access help files and launch externa
141. control until it receives a request to change For example the operator could set the OperOperReq input from a faceplate to take over control of that instruction The following example shows how to lock an instruction into Program control FuelFlowController PIDE El Enhanced PID Local 1 l ChOData D q Pv CVEU m Local 3 0 ChOData C SPProg SP SPCascade PVHHAlarm StartupCV P1 7 RatioProg PVHAlarm CVProg PVLAI arm qrr PVLLAIarm Cj HandFB PVROCPosAlarm StartupSequenceActive a ProgProgReq PVROCNegAlarm E ProgOperReq DewHHAlarm ProgCasRatReq DewHAlarm ProgAutoReq DevLAlarm L ProgManualReq DewLLAlarm E ProgOverrideReq ProgOper When StartupSequenceActive is set the PIDE instruction is placed in Program control and Auto Manual mode The StartupCV Manual value is used as the loop output j ProgHandReq CasRat Override Hand Operator request inputs to an instruction are always cleared by the instruction when it executes This allows operator interfaces to work with these instructions by merely setting the desired mode request bit You don t have to program the operator interface to reset the request bits For example if an operator interface sets the OperAutoReq input to a PIDE instruction when the PIDE instruction executes it determines what the appropriate response should be and clears the OperAutoReq Program request inputs are not normally cleared by t
142. data bit is not modified The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example When enabled the OTU instruction clears Aght_2 Relay Ladder light_2 Structured Text IF BOOL expression THEN Light 2 0 END IF Publication 1756 RMOO3K EN P July 2008 87 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI One Shot ONS Operands TONS J Description Arithmetic Status Flags Fault Conditions 88 The ONS instruction enables or disables the remainder of the rung depending on the status of the storage bit Relay Ladder Operand Type Format Description storage bit BOOL tag internal storage bit stores the rung condition in from the last time the instruction was executed Structured Text Structured text does not have an ONS instruction but you can achieve the same results using an IE THEN construct IF BOOL expression AND NOT storage bit THEN statement END IF storage bit BOOL expression See Appendix 641B Function Block Attributes for information on the syntax of constructs expressions and expressions within structur
143. data type depends on the attribute you select Destination GSV SINT tag destination for attribute data INT DINT REAL structure Source SSV SINT tag tag that contains data you want to copy to the attribute INT DINT REAL structure Structured Text GSV ClassName InstanceName AttributeName Dest SSV ClassName InstanceName AttributeName Source The operands for are the same as those for the relay ladder GSV and SSV instructions 176 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Description The GSV SSV instructions get and set controller system data that is stored in objects The controller stores system data in objects There is no status file as in the PLC 5 processot When enabled the GSV instruction retrieves the specified information and places it in the destination When enabled the SSV instruction sets the specified attribute with data from the source When you enter a GSV SSV instruction the programming software displays the valid object classes object names and attribute names for each instruction For the GSV instruction you can get values for all the available attributes For the SSV instruction the software displays only those attributes are allowed to set SSV Use the GSV and SSV instructions carefully Making changes to objects may cause unexpected con
144. data_1_ascii Subsequent rungs insert or concatenate da a 1 asc with other strings to produce a complete message for a display terminal You may see a slight difference between the fractional parts of the Source and Destination Relay Ladder RTOS Real to String Source data 1 15 3001 Dest data 1 ascii 15 3001003 Structured Text IF send data THEN RTOS data 1 data 1 ascii send data 0 END IF Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 Upper Case UPPER The UPPER instruction converts the alphabetical characters in a string to upper case characters Operands Relay Ladder PPER Upper Case Source Operand Type Format Description Dest Source string tag tag that contains the characters that you want to convert to upper case Destination string tag tag to store the characters in upper case Structured Text E UPPER Source Dest The operands are the same as those for the relay ladder UPPER instruction Description The UPPER instruction converts to upper case all the letters in the Source and places the result in the Destination e ASCII characters are case sensitive Upper case A 41 is not equal to lower case a 61 e If operators directly enter ASCII characters con
145. ded aida d 663 Use arithmetic operators and functions 0005 665 Use relational operators a careo eC e E e Ie 666 Use too cal operators oq bere bua OC EUR eee heed es ba RAE ARE 668 Use bitwise operators Luder ed eb pack eor ebe qnd td 669 Determine the order of execution uui dob x ned OR 669 Instf cHODS ieleqaack EEK RR RR REOR PISS TR ROCER OR RARE RR Rs 670 oro P 671 Some key words are reserved for future use 00 671 D LHEN MUERE 672 CASE UI a i eae er een UE II HET QS eens ege NV 675 POR DO iieri 4 pa hp PRIE3X A E EA D Rape is Ei alt 678 WEILE DIO viae EX pee CR CE re a CR d e 681 REPEAL 4 UNTID uu Ip wanted ahs tees rado Ar RR 684 LODIPIBHOS 5 ea1 ota eh E EE HIE I PHI EC we E abe died 687 ASCII Character Gouesusa ss ck Res utr RR re RARE E ERR 699 11 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Table of Contents 12 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Summary of Changes Introduction This release of this document contains new and updated information To find new and updated information look for change bars as shown next to this paragraph Updated Information This document contains the following changes Change Page Chapter 1 Combined Digital Alarm ALMD and Analog Alarm 29 ALMA instructions into
146. derivative calculation is enhanced by a derivative smoothing filter This first order low pass digital filter helps to minimize large derivative term spikes caused by noise in the PV This smoothing becomes more aggressive with larger values of detivative gain You can disable derivative smoothing if your process requires very large values of derivative gain K4 gt 10 for example To disable derivative smoothing select the No derivative smoothing option on the Configuration tab or set the NDF bit in the PID structure Publication 1756 RMOO3K EN P July 2008 513 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 514 Special Instructions FBC DDT DTR PID Set the Deadband The adjustable deadband lets you select an error range above and below the setpoint where output does not change as long as the error remains within this range This deadband lets you control how closely the process variable matches the setpoint without changing the output The deadband also helps to minimize wear and tear on your final control device error within deadband range time 41026 Zeto crossing is deadband control that lets the instruction use the error for computational purposes as the process variable crosses into the deadband until the process vatiable crosses the setpoint Once the process vatiable crosses the setpoint error crosses zero and changes sign and as long as th
147. description 0004 IOI syntax error see extended error codes same as description 0005 Destination unknown class unsupported instance undefined same as description or structure element undefined see extended error codes 0006 Insufficient packet space same as description 0007 Connection lost same as description 0008 Service unsupported same as description 0009 Error in data segment or invalid attribute value same as description 000A Attribute list error same as description 000B State already exists same as description 000C Object model conflict same as description 000D Object already exists same as description 000E Attribute not settable same as description 000F Permission denied same as description 0010 Device state conflict same as description 0011 Reply will not fit same as description 0012 Fragment primitive same as description 0013 Insufficient command data same as description 0014 Attribute not supported same as description 0015 Too much data same as description 001A Bridge request too large same as description 001B Bridge response too large same as description 001C Attribute list shortage same as description 152 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG G
148. e You can have as many as 10 parameters DINT REAL structure Return BOOL tag tag in this routine to which you want to copy a result of the external routine parameter SINT e The return parameter is optional INT e You can have only one return parameter DINT REAL 447 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT EXT_ROUTINE_CONTROL Structure Mnemonic Data Type Description Implementation ErrorCode SINT If an error occurs this value identifies the error There are no predefined error codes The Valid values are from 0 255 developer of the external routine must provide the error codes NumParams SINT This value indicates the number of parameters Display only this information is derived from associated with this instruction the instruction entry ParameterDefs EXT ROUTINE This array contains definitions of the Display only this information is derived from PARAMETERS 10 parameters to pass to the external routine The the instruction entry instruction can pass as many as 10 parameters ReturnParamDef EXT ROUTIN This value contains definitions of the return Display only this information is derived from PARAMETERS parameter from the external routine There is the instruction entry only one return parameter
149. en RR es 494 Enter an immediate mask value 1 2 osa source x E 495 Proportional Integral Derivative PID cee eceseee erm 497 Configure a PID Insteactiols sese ction st eed eo ne 502 Specify TUning as ea an need Sek ate a ae ene ech dene Roca 503 Specify Configuration iseiubxag da i RR RR RARO RE NO ER Wa 504 Specifying Alarms a duae aed orani ed uo acd dedic e 504 Specifying SCAN sueta esed be RA HE ARCU dd or edid 505 Using PID Instructions 5 ase ur olet mc ee dra Rah wan doe etn 505 Anti teset Windup And Bumpless Transfer From Manual To Auto 507 PID inskechob UI MBIp a oco ovo pad nok e CR EC CRT GR EROR 508 Butpless Restatt sri ssie ssis eR X E REY RA RORRGCEROR ws 512 Derivative Smoothing ua sci cto acte or redo oe odore 513 SettheDeadband Disc eek wd desk mE am DE ORE eee 514 Use Output Limiting sou S ees tne e ee e a 514 Feedforward or Output Biasing 2 ose wes er RR RE RA 515 Cascading LOOPS 24i saa reb Ee b urit RR S Rack es 515 Controla RANG is cen e o a CROCI TT 516 PID Theory enire gonsist area 517 PILPPIGEOSS bro X TERR SE ER NAI E E E A eN 517 PID Process With Master slave Loops 000 517 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Advanced Math Instructions LN LOG XPY Math Conversion Instructions DEG RAD TOD
150. equals MySearchKey The 11111111111111111111111111111111 5 instruction sets the FD and IN bits The POS 4 value indicates the position of the 11111111111111111111111111111111 6 equal element To continue comparing the 11111111111111111111111111111111 7 rest of the array clear the IN bit 11111111111111111111111111111111 8 11111111111111111111111111111111 9 350 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 3 Search for a string in an array of strings When enabled the FSC instruction compares the characters in code to 10 elements in code_table FSC File Search Compare Control code_table_search Length 10 Position De Mode ALL Expression code code_table code_table_search POS code code_table code_table_search POS AFG 0 BEH 1 HUO 2 SA The FSC instruction finds that this array SAM SAM 4 w element equals code The instruction sets FOG 5 the FD and IN bits The POS 4 value indicates the position of the equal element CLE 6 To continue comparing the rest of the array CAK 7 clear the IN bit DET 8 BWG 9 FSC expressions You program expressions in FSC instructions the same as expressions in CMP instructions Use the following
151. first run No action taken No action taken Enableln is cleared EnableOut is cleared the instruction does nothing na and the outputs are not updated Enableln is set The instruction executes EnableOut is set Enableln is always set The instruction executes postscan No action taken No action taken Publication 1756 RMOO3K EN P July 2008 289 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Example 1 Copy Target into Dest E x x x x ix x x x x x x x Target Dest 2 Mask Source and compare it to Dest Any required changes are made in Dest Source and Target remain unchanged A 0 in the mask restrains the instruction from comparing that bit shown by x in the example 0uce 011 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 e e e e e e e e e e e e e e e e Mask1 Dest 0 1 0 1 1 1 1 1 0
152. flags none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true expression is true evaluate expression rung condition out is set to true expression is false rung condition out is set to false Y postscan The rung condition out is set to false Examples If the CMP instruction finds the expression true the rung condition out is set to true Compare Expression value 1 value 2 MP CM Compare Expression value 1 value 2 value 3 value 4 Compare Expression CM value 1 If you enter an expression without a comparison operator such as va ue 1 value_2 ot value 1 the instruction evaluates the expression as If The Expression non zero The Rung condition out Is Set To true Zero Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation false 207 Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP
153. greater than another string For the hex code of a character see the back cover of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater ASCII Characters Hex Codes 1ab 31 61 62 L a 0 31862 e r A 41 S e S a AB 41 42 AB B e t MERC i B B 42 d i a 61 a gt B Y ab 61 62 Arithmetic Status Flags not affected 228 Fault Conditions none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Chapter 5 Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Source A lt Source B rung condition out is set to true rung condition out is set to false postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is false EnableOut is cleared Enableln is true The instruction executes EnableOut is set pos
154. if the attribute is specified as a SINT and the destination is a DINT only the lower 8 bits of the DINT destination are updated leaving the remaining 24 bits unchanged You can access these objects For Information About This Object See This Page Or Publication AXIS ControlL ogix Motion Module Setup and Configuration Manual publication 1756 UM006 CONTROLLER 180 CONTROLLERDEVICE 181 CST 183 DFI 184 FAULTLOG 187 MESSAGE 188 MODULE 190 MOTIONGROUP 191 PROGRAM 192 ROUTINE 193 SERIALPORT 193 TASK 195 WALLCLOCKTIME 197 179 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Access the CONTROLLER object The CONTROLLER object provides status information about a controller s ask Execution Count to increment 0 default everything but forces forces included everything and forces execution Attribute Data Type Instruction Description TimeSlice INT GSV Percentage of available CPU that is assigned to communications SSV Valid values are 10 90 This value cannot be changed when the controller keyswitch is in the run position ControllerLogTotalEntryCou DINT SSV Number of controller log entries since the last firmware nt upgrade GSV The number will be reset if RAM enters a bad state The number is capped at the largest DINT Controlle
155. input signal has an error When set the instruction sets InFaulted Status 1 When cleared the instruction clears InFaulted Status 1 In either case the instruction continues to evaluate In for alarm conditions Default is cleared good health Condition BOOL Specifies how alarm is activated When Condition is set the alarm condition is activated when In is set When Condition is cleared the alarm condition is activated when In is cleared Default is set Publication 1756 RMOOS3K EN P July 2008 Year Artisan Technology Group 31 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Input Parameter Data Type AckRequired BOOL Description Specifies whether alarm acknowledgement is required When set acknowledgement is required When cleared acknowledgement is not required and Acked is always set Default is set Latched BOOL Specifies whether the alarm is latched Latched alarms remain InAlarm when the alarm condition becomes false until a Reset command is received When set the alarm is latched When cleared the alarm is unlatched A latched alarm can only be reset when the alarm condition is false Default is cleared ProgAck BOOL Set by the user program to acknowledge the alarm Requires a cleared to set transition while the alarm is unacknowledged Default
156. instruction To configure a block transfer message follow these guidelines The source for BTW and destination for BTR tags must be large enough to accept the requested data except for MESSAGE AXIS and MODULE structutes Specify how many 16 bit integers INT to send or receive You can specify from 0 to 64 integers If You Want The Then Specify Block transfer module to determine how many 0 for the number of elements 16 bit integers to send BTR Controller to send 64 integers BTW Publication 1756 RMOO3K EN P July 2008 165 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 166 Input Output Instructions MSG GSV SSV IOT Select this command Specify PLC 3 messages The PLC 3 message types are designed for PLC 3 processors If you want to PLC3 Typed Read read integer or REAL type data For integers this command reads 16 bit integers from the PLC 3 processor and stores them in SINT INT or DINT data arrays in the Logix5000 controller and maintains data integrity This command also reads floating point data from the PLC 3 and stores it in a REAL data type tag in the Logix5000 controller PLC3 Typed Write write integer or REAL type data This command writes SINT or INT data to the PLC 3 integer file and maintains data integrity You can write DINT data as long as it fits within an INT data type 32 768 2 data lt
157. instruction does not execute and outputs are not updated default is set Source DINT Value to NOT Output Parameter Data Type valid any integer Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of the instruction Arithmetic status flags are set for this output Description When enabled the instruction evaluates the NOT operation Arithmetic Status Flags Fault Conditions Execution Condition prescan If the Bit Inthe The Bit In the Source Is Destination Is 0 1 1 0 If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction performs a bitwise NOT operation The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 315 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Function Block Condition prescan Action No action taken instruction first scan No ac
158. is equal to or between the low and high limit ne is true if the test value is equal to or outside the low and 0 4 1 ipd high limit high limit low limit n 1 n Xn d n n maximum value n maximum value Arithmetic Status Flags no affected Fault Conditions none Publication 1756 RMOO3K EN P July 2008 233 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true comparison is true rung condition out is set to true evaluate limit comparison is false rung condition out is set to false postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated Enableln is set The instruction executes EnableOut is set postscan No action taken 234 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
159. may be detected For example if you desire 10 ms accuracy on timestamps you could place the alarm instructions that need that resolution in a 10 ms periodic task Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Controller Memory Use As a guideline use the following alarm sizes for a rough calculation of controller memory usage Typically 1 KB per digital alarm with no associated tags Digital Alarm Example Approximate Size Digital alarm with no associated tags and this configuration 1012 bytes e Alarm message Contactor Fault e Alarm Class Tank Farm A Digital alarm with two associated tags and this configuration 1100 bytes e Alarm message Contactor Fault e Alarm Class Tank Farm A e Associated Tag 1 DINT data type e Associated Tag 2 DINT data type Digital alarm with two associated tags and this configuration 1522 bytes e Alarm message Contactor Fault e Alarm Class Tank Farm A e Associated Tag 1 DINT data type e Associated Tag 2 STRING data type Publication 1756 RMOOS3K EN P July 2008 Year 73 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Typically 2 2 KB per analog alarm with no
160. of a loop with the Assume Data Available indicatot This is OK Assume Data Available indicator The Assume Data Available indicator defines the data flow within the loop 646 This is NOT OK The controller cannot resolve the loop because all the wires use the Assume Data Available indicator Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B Resolve Data Flow Between Two Blocks If you use two or more wires to connect two blocks use the same data flow indicators for all of the wires between the two blocks This is OK This is NOT OK Neither wire uses the Assume Data Available indicator One wire uses the Assume Data Available indicator while the other wire does not Assume Data Available indicator Both wires use the Assume Data Available indicator Create a One Scan Delay To produce a one scan delay between blocks use the Assume Data Available indicator In the following example block 1 executes first It uses the output from block 2 that was produced in the previous scan of the routine Publication 1756 RMOO3K EN P July 2008 647 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Summary In summary a function block routine executes in this order 1 The control
161. of elements in the array on which the instruction POS DINT The position contains the position of the current element that the instruction is accessing 370 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Description IMPORTANT Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The SRT instruction sorts a set of values in one dimension Dim to vary of the Array into ascending order You must test and confirm that the instruction doesn t change data that you don t want it to change The SRT instruction operates on contiguous memory In some cases the instruction changes data in other members of the tag This happens if the length is too big and the tag is a user defined data type IMPORTANT Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 Make sure the Length does not cause the instruction to exceed the specified Dimension to vary If this happens unexpected results will occur This is a transitional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition See Appendix C Structured Text Programming Arithmetic status flags ate affected A Major Fault Will Occur If Fault Type Fa
162. one chapter Added configuration message string and status information Chapter 4 Added new GSV SSV Controller Object attributes 180 Chapter 20 Added Debug Instructions PPT TPT 627 Publication 1756 RMOOSK EN P July 2008 13 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Summary of Changes Notes 14 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com If the locator lists a page number Instruction Locator Where to Find an Instruction Use this locator to find the reference details about Logix instructions the grayed out instructions are available in other manuals This locator also lists which programming languages are available for the instructions The instruction is documented in this manual motion Logix5000 Controllers Motion Instruction Set Reference Manual publication 1756 RM007 PhaseManager process control Publication 1756 RMOO3K EN P July 2008 PhaseManager User Manual publication LOGIX UM001 Logix5000 Controllers Process Control and Drives Instruction Set Reference Manual publication 1756 RMO006 15 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Instruction Locator
163. only A timeout triggered the task 1 event task only An overlap occurred for this 2 task Watchdog DINT GSV Time limit for execution of all programs associated with this task Time is in microseconds SSV l If you enter 0 these values are assigned Time Task Type 0 5 sec periodic or event 5 0 sec continuous 196 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Access The WALLCLOCKTIME Object The WALLCLOCKTIME object provides a timestamp the controller can use for scheduling Attribute Data Type Instruction Description CSTOffset DINT 2 GSV Positive offset from the CurrentValue of the CST object coordinated system time see page 183 DINT 0 contains the lower 32 bits of SSV the value DINT 1 contains the upper 32 bits of the value Value in usecs The default is 0 CurrentValue DINT 2 GSV Current value of the wall clock time DINT 0 contains the lower 32 bits of the value DINT 1 contains the upper 32 bits of the value SSV The value is the number of microseconds that have elapsed since 0000 hrs 1 January 1972 The CST and WALLCLOCKTIME objects are mathematically related in the controller For example if you add the CST CurrentValue and the WALLCLOCKTIME CTSOffset the result is the WALLCLOCKTIME CurrentValue DateTime DINT 7 GSV The date and time in a readable f
164. out is set to false No action taken postscan weight read EM Example After reading the weight from a scale weight_read EM is set the STOR instruction converts the numeric characters in weight asc to a REAL value You may see a slight difference between the fractional parts of the Source and Destination Relay Ladder STOR String to Real Source weight ascii 428 259 Dest weight 428 259 Publication 1756 RMOO3K EN P July 2008 617 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Structured Text IF weight read EM THEN STOR weight ascii weight weight read EM 0 END IF 618 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 DINT to String DTOS The DTOS instruction produces the ASCII representation of a value Operands Relay Ladder DTOS DINT to Strin Source rat Dest Operand Type Format Enter Notes Source SINT tag tag that contains the value If the Source is a REAL the instruction converts it to a DINT value Refer to REAL to an Integer INT on page 640 DINT REAL Destination string tag tag to store the ASCII value String data ty
165. prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction passes the Source through the Mask and copies the result into the Destination Unmasked bits in the Destination remain unchanged The rung condition out is set to true postscan The rung condition out is set to false 286 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Example Copy data from va ze a to value b while allowing data to be masked a 0 masks the data in va ze The shaded boxes show the bits that changed in value D Relay Ladder VM Masked Move Source value a 2 0101_0101_0101_0101_0101_0101_0101_0101 Mask mask_2 281111 0000 1111 O000 1111 0000 1111 0000 Dest value b 281111 1111 1111 1111 1111 1111 1111 1111 Structured Text value b value b AND NOT mask 2 OR value a AND mask 2 Publication 1756 RMOO3K EN P July 2008 281 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AN
166. receives the control variable from the PID channel of the module instruction This tells the analog output module that when the controller returns to Run mode or re establishes communications with the module the module should hold the analog output at its current value until the value sent from the controller matches within 0 196 of span the current value used by the output channel The controller s output will ramp to the currently held output value by making use of the BIAS term This ramping is similar to auto bumpless transfer Enter the Inhold bit tag and Inhold Value tag in the The 1756 analog output module returns two values for each channel in its input data PID instruction structure The InHold status bit Ch2InHold for example when true indicates that the analog output channel is holding its value The Data readback value Ch2Data for example shows the current output value in engineering units Enter the tag of the InHold status bit as the InHold bit parameter of the PID instruction Enter the tag of the Data readback value as the Inhold Value parameter When he Inhold bit goes true the PID instruction moves the Inhold Value into the Control variable output and re initializes to support a bumpless restart at that value When the analog output module receives this value back from the controller it turns off the InHold status bit which allows the PID instruction to start controlling normally Derivative Smoothing The
167. scans 4 T operation complete operation complete EE 40013 332 clears status bits and clears status bits and clears POS value clears POS value Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 If the rung condition in is true at completion the EN and DN bit are set until the rung condition in goes false When the rung condition in goes false these bits are cleared and the POS value is cleared If the rung condition in is false at completion the EN bit is cleared immediately One scan after the EN bit is cleared the DN bit and the POS value are cleared Incremental mode Incremental mode manipulates one element of the array each time the instruction s rung condition in goes from false to true ec cci 1st instruction enable 2nd instruction enable 4 P H 3rd instruction enable C LER M last instruction enable q 16643 Publication 1756 RM003K EN P July 2008 333 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE
168. sections for information on valid operators format and order of operation which are common to both instructions Publication 1756 RM003K EN P July 2008 351 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Valid Operators Operator Description Optimal Operator Description Optimal add DINT REAL DEG radians to degrees DINT REAL subtract negate DINT REAL FRD BCD to integer DINT B multiply DINT REAL LN natural log REAL divide DINT REAL LOG log base 10 REAL equal DINT REAL MOD modulo divide DINT REAL lt less than DINT REAL NOT bitwise complement DINT lt less than or equal DINT REAL OR bitwise OR DINT gt greater than DINT REAL RAD degrees to radians DINT REAL gt greater than or equal DINT REAL SIN sine REAL o not equal DINT REAL SOR square root DINT REAL af exponent x to y DINT REAL TAN tangent REAL ABS absolute value DINT REAL TOD integer to BCD DINT ACS arc cosine REAL TRN truncate DINT REAL AND bitwise AND DINT XOR bitwise exclusive OR DINT ASN arc sine REAL ATN arc tangent REAL COS cosine REAL Format Expressions For each operator that you use in an expression you have to provide one or two operands tags or immediate values Use the following table to format operators and operands within an expression For Ope
169. sets the path of the msg 1 message to the value of zsg 7 patb This send the message to a different controller Where Is msg 1 message whose attribute you want to change msg 1 fype tag that stores the value of the MessageType attribute tag a tag that stores a 0 msg 1 path array tag that stores the new connection path for the message Relay Ladder msg path GSV SSV Get System Value Set System Value Class name MESSAGE Class name MESSAGE Instance name msg 1 Instance name msg 1 Attribute NarMessageType Attribute NarMessageType Dest msg 1 type Source tag a 2 0 SSV SSV Set System Value Set System Value Class name MESSAGE Class name MESSAGE Instance name msg 1 Instance name msg 1 Attribute NanfonnectionPat Attribute N MessageType Source msg 1 path 0 Source msg 1 type 6 2 msg 1 EN MSG Type CIP Data Table Write Message Control msg 1 E Structured Text IF msg_path THEN GSV MESSAGE msg 1 MessageType msg 1 type SSV MESSAGE msg 1 MessageType tag a SSV MESSAGE msg 1 ConnectionPath msg 1 path 0 SSV MESSAGE msg_1 MessageType msg 1 type END IF IF NOT msg 1 EN THEN MSG msg 1 END IF Publication 1756 RMOO3K EN P July 2008 189 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Access The MODULE Object The MODULE objec
170. status Set when the High condition is active HInAlarm is set and unacknowledged Cleared when the High condition is normal inactive acknowledged or both 50 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Output Parameter Data Type Description LInAlarmUnack BOOL Combined Low condition active and unacknowledged status Set when the Low condition is active LInAlarm is set and unacknowledged Cleared when the Low condition is normal inactive acknowledged or both LLInAlarmUnack BOOL Combined Low Low condition active and unacknowledged status Set when the Low Low condition is active LLInAlarm is set and unacknowledged Cleared when the Low Low condition is normal inactive acknowledged or both ROCPosInAlarmUnack BOOL Combined positive rate of change condition active and unacknowledged status Set when the positive rate of change condition is active ROCPosInAlarm is set and unacknowledged Cleared when the positive rate of change condition is normal inactive acknowledged or both ROCNeglnAlarmUnack BOOL Combined negative rate of change condition active and unacknowledged status Set when the negative rate of change condition is active ROCNeglnAlarm is set and unacknowledged Cleared whe
171. string data type see Logixd000 Controllers Common Procedures publication 1756 PM001 C3 1 0 Configuration Each string data type contains the following members Name Data Type Description Notes LEN DINT number of characters The LEN automatically updates to the new count of characters whenever you in the string e use the String Browser dialog box to enter characters e use instructions that read convert or manipulate a string The LEN shows the length of the current string The DATA member may contain additional old characters which are not included in the LEN count DATA SINT array ASCII characters of e To access the characters of the string address the name of the tag the string For example to access the characters of the string 1 tag enter string f e Each element of the DATA array contains one character e You can create new string data types that store less or more characters 600 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII String Instructions CONCAT DELETE FIND INSERT MID Chapter 18 String Concatenate The CONCAT instruction adds ASCII characters to the end of a string CONCAT Operands f Relay Ladder CONCAT String Concatena Source A Source B 2 Dest 2 Operand Type Format Enter Notes Source A string tag tag that contains the initial String data types are characters Source B
172. string tag tag that contains the end e aprou STRING ueraya characters e any new string data type that you create Destination string tag tag to store the result Structured Text CONCAT SourceA SourceB Desti The operands are the same as those for the relay ladder CONCAT instruction Description The CONCAT instruction combines the characters in Source A with the characters in Source B and places the result in the Destination The characters from Source A are first followed by the characters from Source B Unless Source A and the Destination are the same tag Source A remains unchanged Arithmetic Status Flags no affected Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is 1 Check that no instruction is writing to the LEN member of the string tag greater than the DATA size of the string tag 2 In the LEN value enter the number of characters that the string contains Publication 1756 RMOOS3K EN P July 2008 601 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na Enableln is set The rung conditi
173. structure and the result control structure Using the same tag for both could result in unpredictable operation possibly causing equipment damage and or injury to personnel Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 COMPARE Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the DDT instruction is enabled DN BOOL The done bit is set when the DDT instruction compares the last bit in the Source and Reference arrays FD BOOL The found bit is set each time the DDT instruction records a mismatch one at a time operation or after recording all mismatches all per scan operation JN BOOL The inhibit bit indicates the DDT search mode 0 all mode 1 one mismatch at a time mode ER BOOL The error bit is set if the compare POS 0 the compare LEN 0 the result POS 0 or the result LEN 0 The instruction stops executing until the program clears the ER bit LEN DINT The length value identifies the number of bits to compare POS DINT The position value identifies the current bit RESULT Structure Mnemonic Data Type Description DN BOOL The done bit is set when the Result array is full LEN DINT The length value identifies the number of storage locations in the Result array POS DINT The position value identifies the cur
174. subscribers CommkError BOOL Communication error when delivering an alarm message Set when there are communication errors and all retries are used This means that a subscriber was subscribed and it had a connection but the controller did not receive confirmation of message delivery Cleared when all connected subscribers confirm receipt of the alarm message AlarmBuffered BOOL Alarm message buffered due to a communication error CommError is set or a lost connection NoConnection is set Set when the alarm message is buffered for at least one subscriber Cleared when the alarm message is not buffered Subscribers DINT Number of subscribers for this alarm SubscNotified DINT Number of subscribers successfully notified about the most recent alarm state change Status DINT Combined status indicators Status 0 InstructFault Status 1 InFaulted Status 2 Severitylnv Status 3 AlarmLimitsInv Status 4 Deadbandlnv Status 5 ROCPosLimitlnv Status 6 ROCNegLimitlnv Status 7 ROCPeriodlnv InstructFault Status 0 BOOL Instruction error conditions exist This is not a minor or major controller error Check the remaining status bits to determine what occurred 52 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Output Param
175. taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Publication 1756 RMOOSK EN P July 2008 213 Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example If value 1 is equal to value_2 set light_a If value_1 is not equal to value_2 clear light_a Relay Ladder Qu light_a Equal lt gt Source value_1 ge SourceB value 2 ge Structured Text light a value 1 value 2 Function Block value 1 value 2 214 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Greater than or Equal to The GEQ instruction tests whether Source A is greater than or equal to GEQ Source B Operands l Relay Ladder GEQ ig are Rob Operand Type Format Description A Source A SINT immediate value to test against Source B ource B INT tag DINT REAL string Source B SINT immediate value to test against Source A INT tag DINT REAL string e If you enter a SINT or INT tag the value converts to a DINT value by sign extension e String data types are default STRING data type any new string data type that you create To test the characters of a string enter a string tag for both Source A and Source B
176. telephone directory the order of the strings determines which one is greater ASCII Characters Hex Codes 1ab 31 61 62 LA a b 31 62 B r 4 S e A 4 S a AB 41 42 AB lt B e t oo B B 42 d r a 61 a gt B Y ab 61 62 e Strings are equal if their characters match Characters are case sensitive Upper case A 41 is zo equal to lower case a 61 For the decimal value and hex code of a character see the back cover of this manual 667 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Use This Format Use logical operators Logical operators let you check if multiple conditions are true or false The result of a logical operation is a BOOL value If The Comparison Is The Result Is true 1 false 0 Use the following logical operators For Use This Operator Data Type logical AND amp AND BOOL logical OR OR BOOL logical exclusive OR XOR BOOL logical complement NOT BOOL For example Example For This Situation You d Write BOOLtag If photoeye is a BOOL tag and your specification IF photoeye THEN says If photoeye is on then NOT BOOLtag If photoeye is a BOOL tag and your specification IF NOT photoeye THEN says If photoeye is off then expressionl amp expression2 If photoeye is a B
177. the FOR instruction no longer executes routine_2 FOR For Routine name routine 2 Index value 2 776 Initial value 0 Terminal value 10 Step size 1 412 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com For Break Instructions FOR FOR DO BRK EXIT RET Chapter 12 Break BRK Operands CBRK EXIT Description Arithmetic Status Flags Fault Conditions The BRK instruction interrupts the execution of a routine that was called by a FOR instruction Relay Ladder none Structured Text Use the EXIT statement in a loop construct See Appendix B for information on structuted text constructs When enabled the BRK instruction exits the routine and returns the controller to the instruction that follows the FOR If there are nested FOR instructions a BRK instruction returns control to the innermost FOR instruction not affected none Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The rung condition out is set to true Execution returns to the instruction that follows the calling FOR instruction postscan The rung condition out is set to false Example When enabled the BRK instruction stops executing the current routine and Publication
178. the controller gain unitless Integral gain K Enter the integral gain KI For independent gains it s the integral gain 1 sec For dependent gains it s the reset time minutes per repeat Derivative time Kj Enter the derivative gain KD For independent gains it s the derivative gain seconds For dependent gains it s the rate time minutes Manual mode Publication 1756 RMOO3K EN P July 2008 Select either manual MO or software manual SWM Manual mode overrides software manual mode if both are selected 503 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 504 Special Instructions FBC DDT DTR PID In this field PID equation Specify Configuration Select the Configuration tab You must click OK or Apply for any changes to take effect Specify Select independent gains or dependent gains PE Use independent when you want the three gains P I and D to operate independently Use dependent when you want an overall controller gain that affects all three terms P I and D Control action Select either E PV SP or E SP PV for the control action CA Derivative of Select PV or error DOE Use the derivative of PV to eliminate output spikes resulting from setpoint changes Use the derivative of error for fast responses to setpoint changes when the algorithm can tolerate overshoots
179. to false Publication 1756 RMOO3K EN P July 2008 403 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition Relay Ladder Action rung condition in is true EM EU bit is set p E no yes examine EU bit LEN lt 0 in POS lt 0 V EM bit is cleared EM bit is set POS lt 0 Y EM bit is set EM bit is cleared LEN size of array yes m yes EM bit is set EM bit is set no q no yes yes Destination 0 POS LEN W DN bit is set no no 8 POS POS 1 Destination FIFO 0 Y FIFO 1 FIFO yes no rung condition out is set to true 4 postscan The rung condition out is set to false 404 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Example When enabled the FFU instruction unloads array_dint 0 into value 2 and shifts the remaining elements in array_dint before FIFO unload FFU FIFO Unload Lenath
180. to a communication error CommkError is set or a lost connection NoConnection is set Set when the alarm message is buffered for at least one subscriber Cleared when the alarm message is not buffered Subscribers DINT Number of subscribers for this alarm SubscNotified DINT Number of subscribers successfully notified about the most recent alarm state change Status DINT Combined status indicators Status 0 InstructFault Status 1 InFaulted Status 2 Severitylnv InstructFault Status 0 BOOL Instruction error conditions exist This is not a minor or major controller error Check the remaining status bits to determine what occurred InFaulted Status 1 BOOL User program has set InFault to indicate bad quality input data Alarm continues to evaluate In for alarm condition SeverityInv Status 2 BOOL Alarm severity configuration is invalid If severity lt 1 the instruction uses Severity 1 If severity gt 1000 the instruction uses Severity 1000 Publication 1756 RMOOS3K EN P July 2008 Year Description The ALMD instruction detects alarms based on Boolean true false conditions The ALMD instruction provides additional functionality when used with RSLinx Enterprise and FactoryTalk View SE software You can display alarms in the Alarm Summary Alarm Banner Alarm Status Explorer and Alarm Log Viewer displays in FactoryTalk View SE software 35 Artisan Technology Group Quality Instrumentation Gu
181. to write 2102 Password invalid 2111 Unable to read 2103 No password issued 2112 Shared routine not editable 2104 Address out of range 2113 Controller in faulted mode 2105 Address and how many out of range 2114 Run mode inhibited 2106 Data in use 2107 Type is invalid or not supported Publication 1756 RMOO3K EN P July 2008 155 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT PLC and SLC Error Codes hex PLC and SLC Error Codes ERR Logix firmware revision 10 x and later provides new error codes for errors that are associated with PLC and SLC message types PCCC messages This change lets RSLogix 5000 software display a more meaningful desctiption for many of the errors Previously the software did not give a description for any of the errors associated with the 00FO error code The change also makes the etror codes more consistent with errors returned by other controllers such as PLC 5 controllers The following table shows the change in the error codes from R9 x and earlier to R10 x and later As a result of the change the ERR member returns a unique value fot each PCCC error The EXERR is no longer required for these errors R9 x And Earlier R10 x And Later Description ERR EXERR ERR EXERR 0010 1000 Illegal command or format from l
182. traces or breakpoint windows The format of the string is as shown here heading text type where Peading is a text string identifying the tracepoint or breakpoint exzis a string describing the tag or any other text you choose and ype indicates the format of the tag You need one type indicator for each tag you ate tracing with the tracepoint or breakpoint instruction For example you could format a tracepoint string as shown here My tracepoint Tag 1 e and Tag 2 d The e formats the first traced tag as double precision float with an exponent and od formats the second traced tag as a signed decimal integer In this case you would have a tracepoint instruction that has two Trace This operands one for a REAL and one for an INT although the value of any tag can be formatted with any flag 628 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Debug Instructions BPT TPT Chapter 20 The resulting tracepoint window that would appear when the tracepoint is triggered would look like this The heading the text preceding the The slot number indicates the slot colon in the format string appears here containing the emulator module that ha the tracepoint or breakpoint being traced in the trace window SES Ss Tag 1 6 488484e 002 and Tag 2 443 Tag 1 6 617994e 002 and Tag 2 447 The text for
183. true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction executes the PID loop The instruction executes the PID loop postscan The rung condition out is set to false No action taken Configure a PID Instruction After you enter the PID instruction and specify the PID structure you use the configuration tabs to specify how the PID instruction should function PID Proportional Integral Derivati Aig al Integ ag Click here to configure the Process Variable PID instruction Tieback Control Variable PID Master Loop Inhold Bit Inhold Value Setpoint Process Variable Output 502 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Specify Tuning Select the Tuning tab Changes take affect as soon as you click on another field click OK click Apply or press Enter In This Field Specify Setpoint SP Enter a setpoint value SP Set output 96 Enter a set output percentage SO In software manual mode this value is used for the output In auto mode this value displays the output 96 Output bias Enter an output bias percentage BIAS Proportional gain Kp Enter the proportional gain KP For independent gains it s the proportional gain unitless For dependent gains it s
184. update times that are at least several times longer than the worst case execution time for your continuous task The most accutate way to execute a PID instruction is to use the real time sampling RTS feature of the 1756 analog input modules The analog input module samples its inputs at the real time sampling rate you configure when you set up the module When the module s real time sample period expires it updates its inputs and updates a rolling timestamp represented by the RollingTimestamp member of the analog input data structure produced by the module Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Not Equal Special Instructions FBC DDT DTR PID Chapter 13 The timestamp ranges from 0 32767 milliseconds Monitor the timestamp When it changes a new process variable sample has been received Every time a timestamp changes execute the PID instruction once Because the process vatiable sample is driven by the analog input module the input sample time is very accurate and the loop update time used by the PID instruction should be set equal to the RTS time of the analog input module To make sure that you do not miss samples of the process variable execute your logic at a rate faster than the RTS time For example if the RTS time is 250 msecs you could put the PID logic in a periodic task that runs every 100 msecs to make sur
185. value converts to the destination data type if necessary You cannot specify a BOOL tag in an instruction that operates on integer or REAL data types Because the conversion of data takes additional time and memory you can increase the efficiency of your programs by using the same data type throughout the instruction minimizing the use of the SINT or INT data types In other words use all DINT tags or all REAL tags along with immediate values in your instructions The following sections explain how the data is converted when you use SINT ot INT tags or when you mix data types 636 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Publication 1756 RMO003K EN P July Year Common Attributes Appendix A SINT or INT to DINT For those instructions that convert SINT or INT values to DINT values the Operands sections in this manual identify the conversion method This Conversion Method Converts Data By Placing Sign extension the value of the left most bit the sign of the value into each bit position to the left of the existing bits until there are 32 bits Zero fill zeroes to the left of the existing bits until there are 32 bits The following example shows the results of converting a value using sign extension and zero fill This value 2 1111 1111 1111 1111 1 Converts to this 2 1111 1111 1111 1111 1111
186. www artisantg com Input Parameter Data Type Output Parameter Data Type Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Description Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The Source must be greater than or equal to 1 and less than or equal to 1 The Arithmetic Status Flags Fault Conditions Execution Condition prescan resulting value in the Destination is always greater than or equal to 0 or less than or equal to T where T 3 141592 Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller calculates the arc cosine of the Source and places the result in the Destination The rung condition out is set to true postscan Condition prescan instruction first scan The rung condition out is set to false Function Block Action No action taken No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set postscan Publication 1756 RMOO3K EN P July 2008 The instruction executes EnableOut is set No action taken 533 Artisan Technology Group Quality Instrumen
187. 0 timer on delay 104 timer on delay with reset 116 TIMER structure 104 108 112 timing modes 649 TND instruction 450 TOD instruction 556 TOF instruction 108 TOFR instruction 120 TON instruction 104 TONR instruction 116 trigger event task 464 trigger event task instruction 464 trigonometric instructions ACS 532 ASN 529 ATN 535 COS 523 introduction 519 SIN 520 Publication 1756 RMO03K EN P July 2008 Index TAN 526 TRN instruction 561 truncate 561 tuning 503 U UID instruction 454 UIE instruction 454 unresolved loop function block diagram 645 update output 201 upper case 623 UPPER instruction 623 user interrupt disable 454 user interrupt enable 454 W WALLCLOCKTIME object 197 WHILE DO 681 X Xto the power of Y 546 XIO instruction 80 XOR instruction 310 XPY instruction 546 697 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Index 698 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com How Are We Doing Your comments on our technical publications will help us serve you better in the future Thank you for taking the time to provide us feedback You can complete this form and mail or fax it back to us or email us at RADocumentComments ra rockwell com Pub Title Type Logix5000 Controllers General Instructions Reference Manual Cat No 1756 L6
188. 008 681 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming The following diagrams show how a WHILE DO loop executes and how an EXIT statement leaves the loop eatly d BOOL expression ias true statement 1 statement 2 statement 3 v rest of the routine While the boo2 expression is true the controller executes only the statements within the WHILE DO loop Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If false BOOL expression true statement 1 statement 2 statement 3 yes J w rest of the routine To stop the loop before the conditions are true use an EXIT statement Fault Type Fault Code the construct loops too long 6 1 Example 1 If You Want This The WHILE DO loop evaluates its conditions first If the conditions are true the controller then executes the statements within the loop This differs from the REPEAT UNTIL loop because the REPEAT UNTIL loop executes the statements in the construct and then determines if the conditions are true before executing the statements again The statements in a REPEAT UNTIL loop are always executed at least once The statements in a WHILE DO loop might never be executed 682 Enter This Structured Text pos 0 While lt gt targetvalue pos lt 100 do amp struct
189. 08 201 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT The type of network between the controllers determines when the consuming controller receives the new data and event trigger via the IOT instruction With This Controller Over This Network The Consuming Device Receives The Data And Event Trigger ControlLogix backplane immediately EtherNet IP network immediately ControlNet network within the actual packet interval API of the consumed tag connection SoftLogix5800 You can produce and consume tags only over within the actual packet interval API of the a ControlNet network consumed tag connection The following diagrams compate the receipt of data via an IOT instruction ovet EtherNet IP and ControlNet networks EtherNet IP network ControlNet network values loaded into E values loaded into EM umi produced tag l produced tag l IOT instruction in the IOT instruction in the producing controller producing controller H Zn n A event task in the RPI of the produced tag consuming controller I I event task in the ee consuming controller pog Arithmetic Status Flags not affected Fault Conditions none 202 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output
190. 1 0 Browse LocalENB 2 10 10 10 10 1 0 to the module in slot 0 The 1 0 configuration of the controller doesn t have any of the modules that you need for the message Go across the backplane r to the local communication module on slot 1 r Go out the ControlNet port to node 4 Go across the backplane to the module in slot 0 Browse Path 1 1 2 4 1 0 neh To type a path use this format port next_address port next_address 170 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Where Is For this network Type port backplane 1 DF1 serial serial 2 channel 0 ControlNet EtherNet IP DH channel A DH channel B 3 DF1 channel 1 serial channel 1 next address backplane slot number of the module DF1 serial Station address 0 254 ControlNet node number 1 99 decimal DH 8 followed by the node number 1 77 octal For example to specify the octal node address of 37 type 8 37 EtherNet IP You can specify a module on an EtherNet IP network using any of these formats IP address for example 10 10 10 10 IP address Port for example 10 10 10 10 24 DNS name for example tanks DNS name Port for example tanks 24 Publication 1756 RMOO3K EN P July 2008
191. 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 01 1 1 1 1 The shaded boxes show the bits that changed Structured Text MVMT 01 Source value 1 MVMT_01 Mask maskl MVMT 01 Target target MVMT MVMT 01 value masked MVMT 01 Dest Function Block MT 04 MVMT Masked Move with Target vau p d4d Source Dest B x value masked rk max 1 Target n 0 target Dp 290 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Bit Field Distribute BTD The BTD instruction copies the specified bits from the Source shifts the bits to the appropriate position and writes the bits into the Destination This instruction is available in structured text and function block as BTDT see page 294 Operands Relay Ladder BTD Bit Field Distribute Source Operand Type Format Description era Bit f Source SINT immediate tag that contains the bits to move est f Dest Bit ui tag Length DINT A SINT or INT tag converts to a DINT value by zero fill Source bit DINT immediate number of the bit lowest bit number from where to start the move 0 31 DINT 0 15 INT must
192. 1 0 channels while there were unknown error outstanding block transfers O0F3 Queues for remote block transfers are full unknown error OOF5 No communication channels are configured for the requested rack or slot unknown error OOF6 No communication channels are configured for remote 1 0 unknown error 00F7 The block transfer timeout set in the instruction timed out before completion unknown error OOF8 Error in block transfer protocol unsolicited block transfer unknown error OOF9 Block transfer data was lost due to a bad communication channel unknown error OOFA The block transfer module requested a different length than the associated unknown error block transfer instruction OOFB The checksum of the block transfer read data was wrong unknown error OOFC There was an invalid transfer of block transfer write data between the adapter and the unknown error block transfer module OOFD The size of the block transfer plus the size of the index in the block transfer data table was unknown error greater than the size of the block transfer data table file 158 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Specify the Configuration After you enter the MSG instruction and specify the MESSAGE structure use the Message Co
193. 1 1 1 1 1 1 1 1 1 value 2 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 ce mask_1 mask 111 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 Masked value 1 0 110 1 0 1 0 1 1 1 1 T1 x x x x Masked value 2 0 110 1 0 1 0 1 1 1 1 1 x x x x Relay Ladder MEQ light_1 Mask Equal Source value 1 280101 0101 1111 1111 ask mask 1 281111 1111 1111 0000 Compare value 2 2 0101_0101_1111_0000 M Structured Text light 1 value 1 AND mask_1 value 2 AND mask 2 Function Block Compare 240 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Example 2 If the masked va ve_1 is equal to the masked value_2 set ighz 1 If the masked value_1 is not equal to the masked va ue_2 clear Zght 1 This example shows that the masked values are not equal A 0 in the mask restrains the instruction from compating that bit shown by x in the example value 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 value 2 0 1110 1 0 1 0 1 1 1 1 1 0 0 0 0 mask 1 0 0 010 0 0 0 0 0 0 0 0 1 1 1 1 mask 110 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
194. 1 according to a different order mode The display style is ASCII and each character represents one byte Each instruction places the bytes in the new order in a different Destination Relay Ladder SWPB SWPB Swap Byte Swap Byte Swap Byte Source DINT_1 Source DINT_1 Source L ABCD ABCD ABCD Order Mode REVERSE Order Mode WORD Order Mode HIGH LOW Dest DINT_1_reverse Dest DINT_1_swap_word Dest DINT_1_swap_high_low DCBA CDAB BADC Structured Text SWPB DINT_1 REVERSE DINT 1 reverse SWPB DINT 1 WORD DINT 1 swap word SWPB DINT 1 HIGHLOW DINT 1 swap high low Example 2 The following example reverses the bytes in each element of an array For an RSLogix 5000 project that contains this example open the RSLogix 5000 Projects NSamples folder Swap Bytes in Array ACD file 1 Initialize the tags The SIZE instruction finds the number of elements in array and stores that value in array ength A subsequent instruction uses this value to determine when the routine has acted on all the elements in the array 2 Reverse the bytes in one element of array The SWPB instruction reverses the bytes of the element number that is indicated by the value of index For example when index equals 0 the SWPB instruction acts on array 0 The ADD instruction increments z dex The next time the instruction executes the SWPB instruction acts on the next element in array 3
195. 1111 1111 1111 1 value by sign extension Converts to this 240000 0000 0000 0000 1111 1111 1111 1111 65535 value by zero fill Because immediate values are always zero filled the conversion of a SINT or INT value may produce unexpected results In the following example the comparison is false because Source A an INT converts by sign extension while Source B an immediate value is zero filled EQU Equal SourceA remote rack 1 l Data 0 241111 1111 1111 1111 Source B 231111 1111 1111 1111 42093 637 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix A Common Attributes If you use a SINT or INT tag and an immediate value in an instruction that converts data by sign extension use one of these methods to handle immediate values e Specify any immediate value in the decimal radix e If you ate entering the value in a radix other than decimal specify all 32 bits of the immediate value To do so enter the value of the left most bit into each bit position to its left until there are 32 bits Create a tag for each operand and use the same data type throughout the instruction To assign a constant value either Enter it into one of the tags Add a MOV instruction that moves the value into one of the tags Use a MEQ instruction to check only the required bits The following examples show two ways to mix an immediate val
196. 111111111 11111111111111111111111111111111 11111111111111111111111111111111 1111111111111111111111111111111 11111111111111111111111111111111 Publication 1756 RMOO3K EN P July 2008 array control 3 pos lt gt array 2 control 3 pos N control 3 N5 10 R5 p ALL control 3 pos 0 cO aoa NH C Ci A CO N The FSC instruction finds that these elements are not equal The instruction sets ihe FD and JN bits The POS value 4 indicates the position of the elements that are not equal To continue comparing the rest of the array clear the IN bit 349 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 2 Search for a match in an array When enabled the FSC instruction compares the MySearchKey to 10 elements in array T FSC File Search Compare N Control control 1 N 5 Length 10 R Position of Mode all Expression MySearchKey reference control 1 pos MySearchKey reference control 3 pos 00000000000000000000000000000000 0 00000000000000000000000000000000 1 00000000000000000000000000000000 2 ea aae aa a a aaa 3 The FSC instruction finds that this array 11111111111111110000000000000000 11111111111111110000000000000000 4 gt element
197. 1F a ult BOR AL MD 0 ai Motor10 10vertemp a Boolean Or Digital Alarm 0 Motor10 1FailtoStart D Publication 1756 RMOO3K EN P July 2008 Year Suppressed D Disabled 41 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Analog Alarm ALMA The ALMA instruction detects alarms based on the level or rate of change of an analog value Program Prog and operator Oper control parameters provide an interface for alarm commands Operands Relay Ladder Analog m ms ALMA KHHin larm In 7 HFEHinAlarm FXLIn amp lerm Prog amp ckAll FXLLIn amp larm 3 EEXROCPosin larm ProgDisable FXROCNeginAlarm FXHHAcked ProgEnable HHLImi 2 HXLLAcked HLienit ROCPosAcked gt LLimit P ed LLLimit 7 HDisabled FEnstructFault Operand Type Format Description ALMA tag ALARM ANALOG Structure ALMA structure In REAL Tag Value is copied to In when instruction executes The alarm DINT Immediate input value which is compared with alarm limits to detect the INT alarm conditions SINT ProgAckAll BOOL Tag Value is copied to ProgAckAll when instruction executes On Immediate transition from cleared to set acknowledges all alarm conditions that require acknowle
198. 2 Start Dest 2 Operand Type Format Enter Notes Source A string tag string to add the characters String data types are to Source B string tag string containing the Au SING pe characters to add e any new string data type that you create Start SINT immediate position in Source A to add Enter a number between 1 and the DATA size of the characters the Source INT tag DINT Result string tag string to store the result INSERT SourceA SourceB Start Dest Description Arithmetic Status Flags Fault Conditions Structured Text The operands are the same as those for the relay ladder INSERT instruction The INSERT instruction adds the characters in Source B to a designated position within Source A and places the result in the Destination e Start defines where in Source A that Source B is added Unless SourceA and the Destination are the same tag Source A remains unchanged not affected Type Code Cause Recovery Method 4 51 The LEN value of the string tag is 1 Check that no instruction is writing to the LEN member of the string tag greater than the DATA size of the string tag 2 In the LEN value enter the number of characters that the string contains 4 56 The Start value is invalid Check that the Start value is between 1 and the DATA size of the Source Publication 1756 RMOO3K EN P July 2008 607 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com C
199. 2008 Artisan Technology Group Quality Instrumentation ends the assignment 661 Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming The ag retains the assigned value until another assignment changes the value The expression can be simple such as an immediate value or another tag name or the expression can be complex and include several operators and or functions See the next section Expressions on page 663 for details Specify a non retentive assignment The non retentive assignment is different from the regular assignment described above in that the tag in a non retentive assignment is reset to zero each time the controller entets the RUN mode leaves the step of an SFC if you configure the SFC for Automatic reset This applies only if you embed the assignment in the action of the step or use the action to call a structured text routine via a JSR instruction A non retentive assignment has this syntax tag expression where Component Description tag represents the tag that is getting the new value the tag must be a BOOL SINT INT DINT or REAL is the non retentive assignment symbol expression represents the new value to assign to the tag lf tag is this data type Use this type of expression BOOL BOOL expression SINT numeric expression INT DINT REAL ends the assignment 662 Publication 1756 RM003K EN P July 2008 Artisan Te
200. 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Mnemonic Data Description Type FLAGS INT The FLAGS member provides access to the status members bits in one 16 bit word This bit Is this member 2 EW 4 ER 5 DN 6 ST 7 EN 8 TO 9 EN CC Important Do not change the EW ER DN or ST bits of the FLAGS member For example do not clear the entire FLAGS word The controller ignores the change and uses the internally stored values of the bits ERR INT If the ER bit is set the error code word identifies error codes for the MSG instruction EXERR INT The extended error code word specifies additional error code information for some error codes REQ LEN INT The requested length specifies how many words the message instruction will attempt to transfer DN LEN INT The done length identifies how many words actually transferred EW BOOL The enable waiting bit is set when the controller detects that a message request has entered the queue The controller resets the EW bit when the ST bit is set Important Do not change the EW bit The controller ignores the change and uses the internally stored value of the bit ER BOOL The error bit is set when the controller detects that a transfer failed The ER bit is reset the next time the rung condition in goes from fa
201. 22222 22222 33333 control 1 pos 5 33333 44444 value 1 55555 44444 array dint 5 00000 p 55555 00000 00000 control 1 pos 6 00000 00000 00000 00000 00000 00000 Publication 1756 RMOO3K EN P July 2008 399 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 FIFO Unload FFU Operands FFU FIFO Unload FIFO Dest Control Lenath Position 400 Array File Shift Instructions BSL BSR FFL FFU LFL LFU The FFU instruction unloads the value from position 0 first position of the FIFO and stores that value in the Destination The remaining data in the FIFO shifts down one position Relay Ladder Operand FIFO Type Format SINT array tag INT DINT REAL string structure Description FIFO to modify specify the first element of the FIFO do not use CONTROL POS in the subscript Destination SINT tag INT DINT REAL string structure value that exits the FIFO The Destination value converts to the data type of the Destination tag A smaller integer converts to a larger integer by sign extension Control CONTROL tag control structure for the operation typically use the same CONTROL as the associated FFL Length DINT immediate maximum number of elements the FIFO can hold at one time Position DINT immediate next location in the FIFO where the instruction unloads data initial value is typically 0 If yo
202. 4 undelivered packets undelivered packets undelivered packets 5 unused messages retried messages retried 6 NAKs received NAKs received unused 7 ENQs received poll packets received unused 8 bad packets NAKed bad packets not ACKed bad packets not ACKed 9 no memory sent NAK no memory not ACKed unused 10 duplicate packets received duplicate packets received duplicate packets received 11 bad characters received unused unused 12 DCD recoveries count DCD recoveries count DCD recoveries count 13 lost modem count lost modem count lost modem count 14 unused unused priority scan time maximum 15 unused unused priority scan time last 16 unused unused normal scan time maximum 17 unused unused normal scant time last 18 ENQs sent unused unused DuplicateDetection SINT GSV Enables duplicate message detection Value Meaning 0 duplicate message detection disabled non zero duplicate message detection disabled EmbeddedResponseEnable SINT GSV Enables embedded response functionality point to point only Value Meaning 0 initiated only after one is received default 1 enabled unconditionally ENOTransmitLimit SINT GSV The number of inquiries ENQs to send after an ACK timeout point to point only Valid value 0 127 Default setting is 3 EOTSuppression SINT GSV Enable suppressing EOT transmissions in response to poll packets slave only Value Meaning 0 EOT suppression disabled disabled non zero EOT suppression enabled 184 Publication 1756 RMOOS3K EN P Jul
203. 43 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Order of Execution The RSLogix 5000 programming software automatically determines the order of execution for the function blocks in a routine when you e verify a function block routine verify a project that contains a function block routine download a project that contains a function block routine You define execution order by wiring function blocks together and indicating the data flow of any feedback wires if necessary If function blocks ate not wired together it does not matter which block executes first There is no data flow between the blocks If you wire the blocks sequentally the execution order moves from input to output The inputs of a block require data to be available before the controller can execute that block For example block 2 has to execute before block 3 because the outputs of block 2 feed the inputs of block 3 a p d p d p w Execution order is only relative to the blocks that are wired together The following example is fine because the two groups of blocks are not wired together The blocks within a specific group execute in the appropriate order in relation to the blocks in that group 644 Publication 1756 RMO03K EN
204. 443 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Example 1 The JSR instruction passes va ue_ and value 2 to routine T The SBR instruction receives va ue_ and va ue 2 from the JSR instruction and copies those values to va ue_a and value_b respectively Logic execution continues in this routine The RET instruction sends float_a to the JSR instruction The JSR instruction receives float_a and copies the value to float_value_1 Logic execution continues with the next instruction following the JSR instruction Relay Ladder Routine Program Main routine JSR Jump to Subroutine Routine name routine 1 Input par value 1 Input par value 2 Return par float value 1 Subroutine SBR Subroutine Input par value a Input par value b other rungs of code RET Retum Return par float a Structured Text Routine Program Main routine JSR routine 1 2 value 1 value 2 float value 1 Subroutine SBR value a value b statements RET float a 444 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11
205. 47483647 manipulate one element of the array each time the Incremental rung condition in goes from false to true All mode In All mode all the specified elements in the array are operated on before continuing on to the next instruction The operation begins when the instruction s rung condition in goes from false to true The position POS value in the control structure points to the element in the array that the instruction is currently using Operation stops when the POS value equals the LEN value zU dert hene one scan 4 16639 330 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The following timing diagram shows the relationship between status bits and instruction operation When the instruction execution is complete the DN bit is set The DN bit the EN bit and the POS value are cleared when the rung condition in is false Only then can another execution of the instruction be triggered by a false to true transition of rung condition in one scan rung condition in EN bit DN bit clears status bits and clears POS value scan of the instruction operation complete LI no execution occurs Numeric
206. 559 elay ladder Diagnostic Detect Convert to Integer unction block DEDT process control structured text FSC 346 elay ladder Deadtime function block File Search and Compare DEG 553 relay ladder GEQ 215 elay ladder Degrees structured text Greater than or Equal to structured tex function block unction block DELETE 603 relay ladder GRT 219 elay ladder String Delete structured text Greater Than structured tex unction block DERV process control structured text Derivative function block GSV 176 elay ladder Get System Value structured tex DFF process control structured text D Flip Flop function block HLL process control structured text High Low Limit function block DIV 261 relay ladder Divide structured text HPF process control structured text function block High Pass Filter function block DTOS 619 relay ladder ICON 641 function block DINT to String structured text Input Wire Connector DTR 494 relay ladder IMC process control structured text Data Transitional Internal Model Control function block EOT 458 relay ladder INSERT 607 relay ladder End of Transition structured text Insert String structured text EQU 206 relay ladder INTG process control _ structured text Equal to structured text Integrator function block function block IOT 201 relay ladder ESEL process control structured text Immediate Output structured text Enhanced Select function block IREF 641 function block EVENT 464 relay ladder Input Reference Trigger Event Task structured
207. 6 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 5 When enabled the FAL instruction divides the value in the current position of array 2 with the value in the current position of array 2 and stores the result in the current position of array f FAL File Arith Logical Control control 2 Lenath 10 Position pe Mode all Dest array control 2 pos 00 Expression atray_2 control_2 pos amy 3 control 2 pos arithmetic operation array array to array E E m E Expression Destination Example 6 When enabled the FAL instruction adds the value at the current position in array_1 to value 1 and stores the result in the current position in array_3 The instruction must execute 10 times for the entire array 1 and array 3 to be arithmetic operation array element to array manipulated FAL File Arith Logical N gt Control control_1 Lenath N5 Position af Mode 6 LER Dest array_3 control_1 pos g Expression array 1 control 1 pos evalue 1 Expression Destination Example 7 Each time the FAL instruction is enable
208. 888 88 SOURCE www artisantg com Chapter 11 JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI Program Control Instructions NOP EOT SFP SFR EVENT Introduction Use the program control instructions to change the flow of logic If You Want To Use This Instruction Available In These Languages See Page Jump over a section of logic that does not JMP relay ladder 434 always need to be executed LBL Jump to a separate routine pass data to the JSR relay ladder 436 routine execute the routine and return results ae simae EISE structured text Jump to an external routine SoftLogix5800 JXR relay ladder 447 controller only Mark a temporary end that halts TND relay ladder 450 routine execution smicturedtert Disable all the rungs in a section of logic MCR relay ladder 452 Disable user tasks UID relay ladder 454 structured text Enable user tasks UIE relay ladder 454 structured text Disable a rung AFI relay ladder 456 Insert a placeholder in the logic NOP relay ladder 457 End a transition for a sequential function chart EOT relay ladder 458 structured text Pause a sequential function chart SFP relay ladder 460 structured text Reset a sequential function chart SFR relay ladder 462 structured text Trigger the execution of an event task EVENT relay ladder 464 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation structured text Guaranteed
209. 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Bitwise AND AND The AND instruction performs a bitwise AND operation using the bits in Source A and Source B and places the result in the Destination To perform a logical AND see page 317 Operands Relay Ladder AND Bitwise AND Source Operand Type Format Description Source B k Source A SINT immediate value to AND with Source B Dest 1 INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Source B SINT immediate value to AND with Source A INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT E Structured Text d A AN DERE Use AND or the ampersand sign amp as an operator within an expression This expression evaluates sourceA AND sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Fay AND 01 Function Block Bitwise AND Operand Type Format Description SaurceA Dest h AND tag FBD_LOGICAL structure AND structure SourceB Publication 1756 RMOO3K EN P July 2008 303 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT FBD LOGICAL
210. ACB ACL AHL ARD ARL AWA AWT Chapter 17 Description The ABL instruction searches the buffer for the first set of termination characters If the instruction finds the termination characters it sets the FD bit counts the characters in the buffer up to and including the first set of termination characters The Controller Properties dialog box User Protocol tab defines the ASCII characters that the instruction considers as the termination charactets To program the ABL instruction follow these guidelines 1 Configure the serial port of the controller for user mode and define the characters that serve as the termination charactets 2 This is a transitional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction counts the characte
211. ACL AHL ARD ARL AWA AWT Instruction Execution ASCII serial port instructions execute asynchronous to the scan of the logic Logic ASCII Queue ASCII Task Rung condition in of instruction transitions from false to true Instruction 2 Instruction 1 wp Instruction at the top of the queue executes Instruction 3 Instruction 4 Data flows Instruction enters the between task and ASCII queue buffer Data flows between buffer and serial port Serial Port rai erial Fo Buffer Each ASCII serial port instruction except ACL uses a SERIAL PORT CONTROL structure to perform the following functions e control the execution of the instruction provide status information about the instruction 566 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 The following timing diagram depicts the changes in the status bits as an ABL instruction tests the buffer for termination characters scan scan scan scan Y Y Y Y rung condition in false true false true false EN of on off on off EU of on RN of on off on off DN or ER of on off on FD of on off on EM of on off on A A enters que
212. AE timer did not reach aq PRE value timer accumulated value ACC g IJ 16649 A timer runs by subtracting the time of its last scan from the time now ACC ACC current time last time scanned After it updates the ACC the timer sets last_ time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 minutes while it runs Otherwise the ACC value won t be correct The last_time_scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minutes if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur lf Fault Type Fault Code PRE 0 4 34 ACC lt 0 4 34 Publication 1756 RMOOS3K EN P July 2008 105 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Execution Condition prescan Relay Ladder Action The EN TT and DN bits are cleared The ACC value is cleared The rung condition out is set to false rung condition in i
213. ASN instruction takes the arc sine of the Source value and stores the result in the Destination in radians Operands E Relay Ladder E ASN Are Sine inti Cocoa Operand Type Format Description i Source SINT immediate find the arc sine of this value est INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest ASIN source Use ASIN as a function This function computes the arc sine of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text ASN_04 Function Block Operand Type Format Description ASN tag FBD_MATH_ADVANCED structure ASN structure FBD_MATH_ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction Valid any float Publication 1756 RMOO3K EN P July 2008 529 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Input Parameter Data Type Output Parameter Data Type Description Description The instruction produced a valid result EnableOut BOOL Dest REAL Description Arithmetic Status Flags Fault Conditions Execution Condition prescan
214. Access Alarm Information 0 0 70 Suppress or Disable Alarms a sida sara RRG RR RE dO RR RR 71 Controller based Alarm Execution 0 0 0 000 ccc eee 72 Controller Memory Use ic xq 3 ood tanta xcd CC Recta ee ee 73 Scan Tine toe a eee RU V ME P A Ne 75 3 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Table of Contents Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Input Output Instructions MSG GSV SSV IOT Chapter 2 Tatrod c oms uarie eiCe ra k EA ean dC Ae d a E T e 77 Examine If Closed SIC way rin wp ao Ree ie RA a ea crane dg 78 Examine If Open AIO jie zu se qeadurqe iid ex d eode odor bu an 80 Ou tp t Energize OTE uar cont c acp Rue Roe SR ne on d tod 82 Output Lateh OT sc crsirri resnie ba px R3 au ka ea ee eae 8 84 Output Unlatch OUELD dadas dades dog c acetic Reo oe eo ob kas 86 One Shot ONS erratia iiA taiata subicere eg ur ea 88 One Shot Rising OSR Caes uses Sas eger HERO de OR e e SR 91 Une Shot Falling OSF Lee T ue UE A ROANOKE KR PER es 94 One Shot Rising with Input OSRD 1 sce ctrtr t RRRERR e EER 96 One Shot Falling with Input OSPD a iis shoe e ee 99 Chapter 3 TatrodUCHON es iii as e TERR C E a E ieee EAE ES 103 Tim r On Delay TON crrrrtirarberirrisrrecevsriisscniti 104 Timer Off Delay TOF PEE NC 108 Ret
215. B 252 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 FBD_MATH Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to add to SourceB Valid any float SourceB REAL Value to add to SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The ADD instruction adds Source A to Source B and places the result in the Arithmetic Status Flags Fault Conditions Condition prescan rung condition in is false Execution Destination Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false The rung condition out is set to false rung condition in is true Destination Source A Source B The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 253 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions
216. BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction copies the Source into the Destination The rung condition out is set to true postscan The rung condition out is set to false Example Move the data in vz ue 1 to value 2 Relay Ladder MOY Move Source Dest Structured Text value 2 value 1 284 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Masked Move MVM The MVM instruction copies the Source to a Destination and allows portions of the data to be masked This instruction is available in structured text and function block as MVMT see page 288 Operands Relay Ladder MVM Masked Move Source Operand Type Format Description Mask Source SINT immediate value to move Dest INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Mask SINT immediate which bits to block or pass INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag tag to store the result INT DINT E Structured Text dest Dest AND NOT Mask
217. C instruction mode of operation 330 operands 346 function block diagram choose elements 641 create a scan delay 647 resolve a loop 645 resolve data flow between blocks 647 functions structured text 665 G GEQ instruction 215 get system value 176 greater than 219 greater than or equal to 215 GRT instruction 219 GSV instruction objects 179 operands 176 ICON 641 IF THEN 672 immediate output instruction 201 immediate values 635 incremental mode 333 inhibit task 195 input reference 641 input wire connector 641 input output instructions GSV 176 introduction 143 IOT 201 MSG 144 SSV 176 INSERT instruction 607 Insert String 607 instructions advanced math 539 alarms and events 29 array ASCII conversion 611 ASCII serial port 565 ASCII string manipulation 599 bit 77 compare 205 compute 247 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com conversion 549 counter 103 debug 627 for break 469 input output 143 logical 281 math conversion 549 move 281 program control 433 sequencer 419 serial port 565 shift 385 special 477 string conversion 611 string manipulation 599 timer 103 trigonometric 519 IOT instruction 201 IREF 641 J JMP instruction 434 627 631 JSR instruction 436 jump 434 627 631 jump to subroutine 436 JXR instruction control structure 448 L label 434 627 631 latching da
218. CE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Condition Relay Ladder Action rung condition in is false compare EN bit is cleared examine compare DN 0 compare DN bit poo compare DN bit is cleared compare POS value is cleared result DN bit is cleared rung condition out is set to false 482 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Condition Relay Ladder Action rung condition in is true examine compare EN 1 oto compare EN bit gt at 0r 0 compare DN 1 compare EN bit is set compare DN bit an compare DN 0 compare ER bit is cleared compare LEN Q compare POS 0 7073 no compare ER bit is set rung condition out is set to true goto om Cm page 484 Publication 1756 RMOO3K EN P July 2008 483 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Condition Relay Ladder Action compare p compare POS gt compare POS compare LEN compare LEN goto exit page 483 result DN 1 Source com
219. Clear CLR The CLR instruction clears all the bits of the Destination Operands Relay Ladder Operand Type Format Description Destination SINT tag tag to clear INT DINT REAL B dest o Structured Text Structured text does not have a CLR instruction Instead assign 0 to the tag you want to clear This assignment statement clears dest See Appendix C Structured Text Programming for information on the syntax of expressions and assignment statements within structured text Description The CLR instruction clears all the bits of the Destination Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions none Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction clears the Destination The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOOS3K EN P July 2008 297 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Example Clear all the bits of value to 0 Relay Ladder Structured Text value 0 298 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 S
220. Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Example 1 Low Limit High Limit When 0 Salue 2 100 set Aght_1 If value lt 0 ot value gt 100 clear Zghz f Relay Ladder LIM Limit Test CIRC Low Limit 0 light 1 Test value p High Limit 100 Structured Text IF value lt 100 AND value gt 0 AND value lt 100 OR value gt 100 AND value lt 0 OR value gt 100 THEN light 1 1s ELSE light 1 0 END IF Function Block LIM 01 LIM Limit Test CIRC 0 Dest light 1 LowLimit O HighLimit Publication 1756 RMOO3K EN P July 2008 235 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example 2 Low Limit gt High Limit When value 0 ot value SA00 set Joh 1 If value lt 0 ot value 7400 clear Zgh T Relay Ladder LIM Limit Test CIRC Low Limit light_1 Test High Limit Structured Text IF 0 lt 100 AND value gt 0 AND value lt 100 OR 0 gt 100 AND value lt 0 OR value gt 100 THEN light 1 1 ELSE light 1 0 END IF Function Block LIM 01 LIM wl Limit Test CIRC 0 Det p light 1 LowLimit value HighLimit 236 Publication 1756 RMO03K EN P Ju
221. D OR XOR NOT BAND BOR BXOR BNOT Masked Move with Target MVMT Operands MVMT MVMT tag Psi MVMT 01 MVMT Ez Move With Mask with Target Source Input Parameter Data Type The MVMT instruction first copies the Target to the Destination Then the instruction compares the masked Source to the Destination and makes any required changes to the Destination The Target and the Source remain unchanged This instruction is available in relay ladder as MVM see page 285 Structured Text Variable Type Format Description MVMT tag FBD_MASKED_MOVE structure MVMT structure Function Block Operand Type Format Description MVMT tag FBD_MASKED_MOVE structure MVMT structure FBD MASKED MOVE Structure Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes Source DINT Input value to move to Destination based on value of Mask Valid any integer Mask DINT Mask of bits to move from Source to Dest All bits set to one cause the corresponding bits to move from Source to Dest All bits that are set to zero cause the corresponding bits not to move from Source to Dest Valid any integer Target DINT 288 Input value to move to Dest prior to moving Source bits through the Mask Valid any integer Publication 1756 RMO
222. D 553 TOD 556 TRN 561 convert to BCD 556 convert to integer 559 converting data types 635 COP instruction 355 copy 355 COS instruction 523 cosine 523 count down 132 count up 128 count up down 136 counter instructions CTD 132 CTU 128 CTUD 136 introduction 103 RES 141 COUNTER structure 128 132 CPS instruction 355 CPT instruction 248 CST object 183 CTD instruction 132 CTU instruction 128 CTUD instruction 136 D data transitional 494 DDT instruction operands 486 search mode 488 deadband 514 debug instructions 627 DEG instruction 550 degree 550 DELETE instruction 603 description structured text 687 Publication 1756 RMO03K EN P July 2008 Index DF1 object 184 diagnostic detect 486 digital alarm 30 DINT to String 619 DIV instruction 261 division 261 document structured text 687 DTOS instruction 619 DTR instruction 494 E elements SIZE instruction 381 end of transition instruction 458 EOT instruction 458 EQU instruction 211 equal to 211 error codes ASCII 568 MSG instruction 152 EVENT instruction 464 event task configure 195 trigger via consumed tag 201 trigger via EVENT instruction 464 examine if open 80 execution order 644 exponential 546 expression BOOL expression structured text 663 numeric expression structured text 663 order of execution structured text 669 structured text arithmetic operators 665 bitwise operators 669 functions 665 logical operators 668 overview 663 relational o
223. DINT number of characters The LEN automatically updates to the new count of characters whenever you in the string e use the String Browser dialog box to enter characters e use instructions that read convert or manipulate a string The LEN shows the length of the current string The DATA member may contain additional old characters which are not included in the LEN count DATA SINT array ASCII characters of e To access the characters of the string address the name of the tag the string For example to access the characters of the string 1 tag enter string f e Each element of the DATA array contains one character e You can create new string data types that store less or more characters Publication 1756 RMOO3K EN P July 2008 569 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT ASCII Test For Buffer Line ABL Channel ABL Channel ABL ASCII Test For Buffer Lin SerialPort Control Character Count Operands SerialPortControl The ABL instruction counts the characters in the buffer up to and including the first termination character Relay Ladder Operand Type Format Description Channel DINT immediate 0 tag Serial Port SERIAL PORT tag tag that controls the operation Control CONTROL Character DINT immediate 0 Count During execution displays t
224. Destination Arithmetic Status Flags not affected Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is greater than the DATA 1 Check that no instruction is writing to the LEN size of the string tag member of the string tag 2 In the LEN value enter the number of characters that the string contains 4 52 The output string is larger than the destination Create a new string data type that is large enough for the output string Use the new string data type as the data type for the destination Publication 1756 RMOO3K EN P July 2008 621 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction converts the Source postscan send data 622 The rung condition out is set to false No action taken Example When sezd data is set the RTOS instruction converts the value in dafa_1 to a string of ASCII characters and places the result in
225. Determine when the SWPB instruction has acted on all the elements in the array e If zidex is less then the number of elements in the array array_ ength then continue with the next element in the array e If index equals array_length then the SWPB has acted on all the elements in the array Publication 1756 RMOO3K EN P July 2008 301 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Relay Ladder Initialize the tags SIZE Clear Size in Elements Dest i Source array 0 1234 Dim To Vary 0 Size array length je Reverse the bytes swap bytes SwPB DD LBL Swap Byte Add Source array index Source 1 1234 Order Mode REVERSE Source B index Dest array_bytes_reverse index 4321 Dest Determine whether the SWPB instruction has acted on all the elements in the array LES swap bytes Less Than A B M Source i Source B array length 4 Structured Text index 0 SIZE array 0 0 array length REPEAT SWPB array index REVERSE array bytes reverse index index index 1 UNTIL index gt array length END REPEAT 302 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed
226. E with Reset The TONR instruction is a non retentive timer that accumulates time when TimerEnable is set This instruction is available in relay ladder as two separate instructions TON see page 104 and RES see page 141 Structured Text Variable Type Format Description TONR tag FBD_TIMER structure TONR structure Function Block Operand Type Format Description TONR tag FBD_TIMER structure TONR structure FBD_TIMER Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes TimerEnable BOOL If set this enables the timer to run and accumulate time Default is cleared PRE DINT Timer preset value This is the value in 1msec units that ACC must reach before timing is finished If invalid the instruction sets the appropriate bit in Status and the timer does not execute Valid 0 to maximum positive integer Reset BOOL Request to reset the timer When set the timer resets Default is cleared Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result ACC BOOL Accumulated time in milliseconds EN BOOL Timer enabled output Indicates the timer instruction is enabled TT BOOL Timer timing output When set a timing operation is in progress 116 Publication 1756 RMO003K EN P Ju
227. EQU GEQ GRT LEQ LES LIM MEQ NEQ CMP expressions You program expressions in CMP instructions the same as expressions in FSC instructions Use the following sections for information on valid operators format and order of operation which are common to both instructions Valid operators Operator Description Optimal Operator Description Optimal add DINT REAL DEG radians to degrees DINT REAL subtract negate DINT REAL FRD BCD to integer DINT i multiply DINT REAL LN natural log REAL divide DINT REAL LOG log base 10 REAL equal DINT REAL MOD modulo divide DINT REAL lt less than DINT REAL NOT bitwise complement DINT lt less than or equal DINT REAL OR bitwise OR DINT gt greater than DINT REAL RAD degrees to radians DINT REAL gt greater than or equal DINT REAL SIN sine REAL o not equal DINT REAL SOR square root DINT REAL ui exponent x to y DINT REAL TAN tangent REAL ABS absolute value DINT REAL TOD integer to BCD DINT ACS arc cosine REAL TRN munate DINLREAL AND bitwise AND DINT XOR bitwise exclusive OR DINT ASN arc sine REAL ATN arc tangent REAL COS cosine REAL 208 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Format Expressions For each operator that you use in
228. ER is cleared Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation 149 Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Condition Relay Ladder Action Structured Text Action rung condition in is false EN bit 1 i examine EN bit EN bit 0 EW bit 1 examine EW bit EW bit 0 examine ST bit examine DN bit ER bit 1 it ER bit 0 block transfer examine ER bit command module path valid DN bit 1 module connection running examine DN bit Y DN bit 0 EN bit is cleared execute message request Y Y EW bit is set ER bit is set ER bit 1 examine ER bit aiba Y rung condition out is set to false rung condition in is true The instruction executes na The rung condition out is set to true 150 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Inst
229. ES LIM MEQ NEQ Chapter 5 Example If value 1 is not equal to value_2 set light_4 If value_1 is equal to value_2 clear light_4 Relay Ladder EQ light_4 Not Equal Source value 1 De SourceB value 2 De Structured Text light 4 value 1 lt gt value 2 Function Block value 1 Publication 1756 RMOO3K EN P July 2008 245 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Notes 246 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Introduction The compute math instructions evaluate arithmetic operations using an expression or a specific arithmetic instruction If You Want To Use This Instruction Available In These Languages See Page evaluate an expression CPT relay ladder 248 structured text add two values ADD relay ladder 252 structured text function block subtract two values SUB relay ladder 255 structured text function block multiply two values MUL relay ladder 258 structured text function block divide two values DIV relay ladder 261 structured text function block determine the remainder after one value is MOD relay ladder 266
230. Enter Notes Source string tag string to search in String data types are Search string tag string to find e default STRING data type e any new string data type that you create Start SINT immediate position in Source to start Enter a number between 1 and the DATA size of the search the Source INT tag DINT Result SINT tag tag that stores the starting position of the string to find INT DINT Structured Text FIND sae ANE qd The operands are the same as those for the relay ladder FIND instruction Result described above Description The FIND instruction searches the Source string for the Search string If the Arithmetic Status Flags instruction finds the Search string the Result shows the starting position of the Search string within the Source string Fault Conditions Type Code Cause 4 51 The LEN value of the string tag is greater than the DATA size of the not affected Recovery Method 1 Check that no instruction is writing to the LEN member of the string tag string tag 2 In the LEN value enter the number of characters that the string contains 4 56 The Start value is invalid Check that the Start value is between 1 and the DATA size of the Source Publication 1756 RMOO3K EN P July 2008 605 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Execution Condition Relay La
231. F RTO TONR TOFR RTOR CTU CTD CTUD RES Timer Off Delay with Reset TOFR TOFR TOFR Operands tag TOFR d Timer Off Delay with Reset EF TimerEnable ACC The TOFR instruction is a non retentive timer that accumulates time when TimerEnable is cleared This instruction is available in relay ladder as two separate instructions TOF see page 108 and RES see page 141 Structured Text Variable Type Format Description TOFR tag FBD TIMER structure TOFR structure Function Block Operands Operand Type Format Description TOFR tag FBD TIMER structure TOFR structure FBD TIMER Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes TimerEnable BOOL If cleared this enables the timer to run and accumulate time Default is cleared PRE DINT Timer preset value This is the value in 1msec units that ACC must reach before timing is finished If invalid the instructions sets the appropriate bit in Status and the timer does not execute Valid 0 to maximum positive integer Reset BOOL Request to reset the timer When set the timer resets Default is cleared Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result ACC BOOL Accumulated time in milliseco
232. Function Block ASN 01 ASN uu Arc Sine Publication 1756 RMO03K EN P July 2008 531 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Arc Cosine ACS The ACS instruction takes the arc cosine of the Source value and stores the result in the Destination in radians Operands Relay Ladder ACS Arc Cosine Operand Type Format Description Source C IU EE OU UM EC KU EK NCC Source SINT immediate find the arc cosine of this value Dest INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest ACOS source Use ACOS as a function This function computes the arc cosine of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Pal ACS 01 Function Block acs gg c Arc Cosine Operand Type Format Description ACStag FBD MATH ADVANCED structure ACS structure FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction Valid any float 532 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE
233. Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Output Parameter Data Type Description DeliveryDN BOOL Delivery completion of the alarm notification message Set when delivery is successful at least one subscriber was subscribed and all subscribers received the latest alarm change state message successfully Cleared when delivery does not complete successfully or is in progress DeliveryEN BOOL Delivery status of the alarm notification message Set when delivery is in progress Cleared when delivery is not in progress NoSubscriber BOOL Alarm had no subscribers when attempting to deliver the most recent message Set when there are no subscribers Cleared when there is at least one subscriber NoConnection BOOL Alarm s subscribers were not connected when attempting to deliver the most recent message Set when all subscribers are disconnected Cleared when at least one subscriber is connected or there are no subscribers CommkError BOOL Communication error when delivering an alarm message Set when there are communication errors and all retries are used This means that a subscriber was subscribed and it had a connection but the controller did not receive confirmation of message delivery Cleared when all connected subscribers confirm receipt of the alarm message AlarmBuffered BOOL Alarm message buffered due
234. HELD DISTRIBUTE structure BTDT structure Function Block Operand Type Format Description BTDT tag FBD BIT HELD DISTRIBUTE structure BTDT structure FBD BIT FIELD DISTRIBUTE Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes Source DINT Input value containing the bits to move to Destination Valid any integer SourceBit DINT The bit position in Source lowest bit number from where to start the move Valid 0 31 Length DINT Number of bits to move Valid 1 32 294 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Input Parameter Data Type Description DestBit DINT The bit position in Dest lowest bit number to start copying bits into Valid 0 31 Target DINT Input value to move to Dest prior to moving bits from the Source Output Parameter EnableOut Dest Valid any integer Data Type Description BOOL The instruction produced a valid result DINT Result of the bit move operation Arithmetic status flags are set for this output Description When enabled the BTD instruction copies a g
235. ID gt Auto Mode Ts mins O Error X 100 Calculation po Auto Convert to CV Units maxs mins NA K Output Y Manual Limiting gt CV maxev mincv icy gt e Manuai 30 fige Ule mw PV mini maxs mins maxi mini mns Converts Tieback Units to 96 tieback mintie _ _ x 100 ZN maxtie mintie PV Publication 1756 RMOO3K EN P July 2008 517 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Notes 518 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Introduction The trigonometric instructions evaluate arithmetic operations using trigonometric operations If You Want To Use This Instruction Available In These Languages See Page Take the sine of a value SIN relay ladder 520 structured text function block Take the cosine of a value COS relay ladder 523 structured text function block Take the tangent of a value TAN relay ladder 526 structured text function block Take the arc sine of a value ASN relay ladder 529 structured text ASIN function block Take the arc cosine of a value ACS relay ladder 532 structured text Acos function block Take the arc tangent of a value
236. INT array tag the JSR instruction INT DINT REAL structure SBR InputPar Structured Text EC a Subroutine 438 BR Ez The operands are the same as those for the relay ladder SBR instruction Function Block Parameters X SBR Subroutine The operands are the same as those for the relay ladder SBR instruction Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 RET Operands RET Retum Return par RET ReturnPar E ET Hj Return Description Publication 1756 RMOO3K EN P July 2008 Relay Ladder Operand Type Format Description Return BOOL immediate data from this routine that you want to copy parameter to the corresponding return parameter in the SINT tag JSR instruction INT array tag DINT REAL structure Structured Text The operands are the same as those for the relay ladder RET instruction Function Block Parameters UA E RET Return The operands are the same as those for the relay ladder RET instruction The JSR instruction initiates the execution of the specified routine which is referred to as a subroutine e The subroutine executes one time e After the subroutine executes logic execution returns t
237. If the string contains multiple groups of numbers that are separated by delimiters for example the instruction converts only the first group of numbers Arithmetic Status Flags Arithmetic status flags are affected 616 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is greater than the DATA 1 Check that no instruction is writing to the LEN size of the string tag member of the string tag 2 In the LEN value enter the number of characters that the string contains 4 53 The output number is beyond the limits of the Either destination data type e Reduce the size of the ASCII value e Use a larger data type for the destination Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na Enableln is ste The rung condition out is set to true na Enableln is always set The instruction executes instruction execution S C is set Destination is cleared The instruction converts the Source If the result is zero then S Z is set The rung condition
238. InAlarm Acked In zz Condition 3 5 2 ProgAck OperAck ALMD Alarm Acknowledge Not Required and Latched InAlarm f m n n cies U B Acked Publication 1756 RM003K EN P July 2008 Year 39 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA ALMD Alarm Acknowledge Not Required and Not Latched In Condition ProgAck OperAck ProgReset OperReset InAlarm Acked Example Two motor failure signals are combined such that if either one occurs a motor fault alarm is activated Programmatically acknowledge the alarm with a cleared to set transition of the Motor101Ack tag value The application logic must clear Motor101Ack Relay Ladder Motor101 Overtemp ALMD Digital Alarm ALMD Motor101Fautt Motor1 01 FaittoStart ProgA amp ck Motor101 Ack 0e ProgReset ProgDisable ProgEnable MinDurationPRE MinDuration amp CC 40 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Structured Text MotorlO0lFaultConditions MotorlO0lOvertemp OR Motor101FailToStart ALMD Motorl0lFault MotorlOlFaultConditions Motorl01Ack 0 0 0 Function Block BOR 01 Motor10
239. Instructions FBC DDT DTR PID Chapter 13 Because the PID instruction uses a time base in its calculation you need to synchronize execution of this instruction with sampling of the process variable PV The easiest way to execute the PID instruction is to put the PID instruction in a periodic task Set the loop update time UPD equal to the periodic task rate and make sure that the PID instruction is executed every scan of the periodic task Relay Ladder PID 0 Proportional Integral Derivative PID TiC101 E Process variable Local 0 1 Ch0Data Tieback Local 0 1 Ch1Data Control variable Local 1 0 Ch4Data PID Master Loop 0 Inhold bit Local 1 1 Ch4InHold Inhold Value Local 1 l Ch4Data Setpoint 0 0 Process Variable 0 0 Output 0 0 Structured Text PID TIC101 Local 0 I ChOData Local 0 I ChlData Local 1 0 Ch4Data 0 Local 1 1I Ch4InHold Local 1 I Ch4Data When using a periodic task make sure that the analog input used for the process variable is updated to the processor at a rate that is significantly faster than the rate of the periodic task Ideally the process variable should be sent to the processor at least five to ten times faster than the periodic task rate This minimizes the time difference between actual samples of the process variable and execution of the PID loop For example if the PID loop is in a 250 millisecond periodic task use a loop update time of 250 milliseconds UPD 25 and configure
240. MOD divisor Function Block MOD 01 MOD Modulo 0 0 j remainder dividend divisor J C SourceA SourceB Publication 1756 RMOO3K EN P July 2008 269 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Square Root SOR The SQR instruction computes the square root of the Source and places the result in the Destination Operands Relay Ladder P m 1 oot ke s Operand Type Format Description Dest Source SINT immediate find the square root of this value INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL Structured Text dest SQRT source Use SQRT as a function This expression computes the square root of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text 210 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Fal SOR 01 SOR d Square Root Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Function Block Operand Type Format Description SOR tag FBD_MATH_ADVANCED structure SOR structure FBD_MATH_ADVANCED Structu
241. N P July 2008 393 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU FIFO Load FFL The FFL instruction copies the Source value to the FIFO Operands Relay Ladder FFL FIFO Load Source FIFO Control N Operand Type Format Description bMS Source SINT immediate data to be stored in the FIFO Length INT tag Position DINT REAL string Structure The Source converts to the data type of the array tag A smaller integer converts to a larger integer by sign extension FIFO SINT array tag FIFO to modify INT specify the first element of the FIFO DINT do not use CONTROL POS in the subscript REAL string structure Control CONTROL tag control structure for the operation typically use the same CONTROL as the associated FFU Length DINT immediate maximum number of elements the FIFO can hold at one time Position DINT immediate next location in the FIFO where the instruction loads data initial value is typically 0 If you use a user defined structure as the data type for the Source or FIFO operand use the same structure for both operands 394 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9
242. NTER Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes CUEnable BOOL Enable up count When input toggles from clear to set accumulator counts up by one Default is cleared 136 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Input Parameter Data Type Description CDEnable BOOL Enable down count When input toggles from clear to set accumulator counts down by one Default is cleared PRE DINT Counter preset value This is the value the accumulated value must reach before DN is set Valid any integer Default is 0 Reset BOOL Request to reset the timer When set the counter resets Default is cleared Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result ACC DINT Accumulated value CU BOOL Count up enabled CD BOOL Count down enabled DN BOOL Counting done Set when accumulated value is greater than or equal to preset OV BOOL Counter overflow Indicates the counter exceeded the upper limit of 2 147 483 647 The counter then rolls over to 2 147 483 648 and begins count
243. O3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of masked move instruction Arithmetic status flags are set for this output Description When enabled the MVMT instruction uses a Mask to either pass or block Source data bits A 1 in the mask means the data bit is passed A 0 in the mask means the data bit is blocked If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Enter an Immediate Mask Value Using an Input Reference When you enter a mask the programming softwate defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix 162 Description hexadecimal for example 16 0FOF 3 octal for example 8 16 2 binary for example 2 00110011 Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions none Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan No action taken No action taken instruction
244. OD FRD TRN TRUNC Condition Action Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example The TOD instruction converts value_1 to a BCD value and places the result in result a Relay Ladder TOD To BCD Source value 1 22 Dest result a 1810022 Function Block TOD 04 TOD To BCD o a 558 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Convert to Integer FRD Operands FRD From BCD Source FRD 041 FRD Ed From BCD Source Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 The FRD instruction converts a BCD value Source to a decimal value and stotes the result in the Destination Relay Ladder Operand Type Format Description Source SINT immediate value to convert to decimal INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT Function Block Operand Format Description FRD tag Type FBD CONVERT structure FRD structure FBD CONVERT Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source DINT Input to the conversion instruction Valid any integ
245. OL Combined alarm active and acknowledged status Set when the alarm is active InAlarm is set and unacknowledged Acked is cleared Cleared when the alarm is normal inactive acknowledged or both Suppressed BOOL Suppressed status of the alarm Set when the alarm is suppressed Cleared when the alarm is not suppressed Disabled BOOL Disabled status of the alarm Set when the alarm is disabled Cleared when the alarm is enabled MinDurationACC DINT Elapsed time since the alarm was detected When this value reaches MinDurationPRE the alarm becomes active InAlarm is set and a notification is sent to clients AlarmCount DINT Number of times the alarm has been activated InAlarm is set If the maximum value is reached the counter leaves the value at the maximum count value InAlarmTime LINT Timestamp of alarm detection AckTime LINT Timestamp of alarm acknowledgement If the alarm does not require acknowledgement this timestamp is equal to alarm time RetToNormalTime LINT Timestamp of alarm returning to a normal state AlarmCountResetTime LINT Timestamp indicating when the alarm count was reset DeliveryER BOOL Delivery error of the alarm notification message Set when there is a delivery error either no alarm subscriber was subscribed or at least one subscriber did not receive the latest alarm change state message Cleared when delivery is successful or is in progress 34 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology
246. OL instruction increments to the next position in the sequencer array and loads the Source value into that position If the DN bit is set or if POS 2 LEN the instruction sets POS 1 Typically use the same CONTROL structure as the SOI and SQO instructions You must test and confirm that the instruction doesn t change data that you don t want it to change The SQL instruction operates on contiguous memory In some cases the instruction loads data past the array into other members of the tag This happens if the length is too big and the tag is a user defined data type Arithmetic Status Flags Fault Conditions Execution Condition prescan not affected A Major Fault Will Occur lf Fault Type Fault Code Length size of Array 4 20 Relay Ladder Action The EN bit is set to prevent a false load when the program scan begins The rung condition out is set to false rung condition in is false Publication 1756 RMOO3K EN P July 2008 The EN bit is cleared The rung condition out is set to false 429 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Condition Relay Ladder Action rung condition in is true EN bit is set EN 0 examine EN bit 9 ER bit is cleared EN 1 POS LEN SE POS 1 yes no DN bit is set P
247. OOL tag tempis a DINT tag IF photoeye amp temp lt 100 and your specification says If photoeye ison THEN and temp is less than 100 then expressionl ORexpression2 If photoeye is a BOOL tag temp is a DINT tag IF photoeye OR temp lt 100 and your specification says If photoeye is on or temp is less than 100 then THEN expressionl XOR expression2 If photoeye and photoeye2 are BOOL tags and your specification says If e photoeye is on while photoeyeZ is off or e photoeye is off while photoeye2 is on then IF photoeyel XOR photoeye2 THEN BOOLtag expression2 expressionl amp 668 If photoeye1 and photoeye2 are BOOL tags openis a BOOL tag and your specification says f photoeyel and photoeyeZ are both on set open to true open photoeyel amp photoeye2 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Use bitwise operators Bitwise operators manipulate the bits within a value based on two values Fo _UseThis Operator Optimal Data Type bitwise AND amp AND DINT bitwise OR OR DINT bitwise exclusive OR XOR DINT bitwise complement NOT DINT For example Use This Format Example For This Situation You d Write valuel operator value2 If input input2 and result are DINT tags and your r
248. OS POS 1 POS value rolls over goto error DN bit is set POS gt LEN error Y _ ER bit is set d Array control POS Source rung condition out is set to true postscan The rung condition out is set to false 430 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Sequencer Instructions SQI SQO SQL Chapter 10 Example When enabled the SQL instruction loads va we_3 into the next position in the sequencer array which is array_dint 5 in this example before load array dint 0 00000 11111 22222 33333 control 1 pos 5 33333 44444 array dint 5 00000 00000 00000 00000 00000 Publication 1756 RMOO3K EN P July 2008 SOL Sequencer Load CEN Array array dint D Source value 3 N5 Control control 1 Lenath Position after load 00000 11111 22222 value 3 55555 44444 p 55555 00000 control 1 pos 6 00000 00000 00000 431 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Notes 432 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed
249. OURCE www artisantg com The SWPB instruction tearranges the bytes of a value wap byte g y Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Operands Suh Relay Ladder Swap Byte Source Order Mode Dest Operand Type Format Enter Source INT tag tag that contains the bytes that you want to rearrange DINT REAL Order Mode If the Source And You Want To Change the Bytes To Then Select Is an This Pattern Each Letter Represents a Different Byte INT n a any of the options DINT ABCD DCBA REVERSE or enter 0 REAL ABCD CDAB WORD or enter 1 ABCD BADC HIGH LOW or enter 2 Destination INT tag tag to store the bytes in the new order DINT Ifthe Source Then the Destination Must Be an Is an REAL INT INT DINT DINT DINT REAL REAL Structured Text SWPB Source OrderMode Dest The operands are the same as those for the relay ladder SWPB instruction If you select the HIGH LOW order mode enter it as HIGHLOW or HIGH LOW without the slash Publication 1756 RMOO3K EN P July 2008 299 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Description The SWPB instruction rearranges the order of the bytes of the Source It places the result i
250. OUT members of the PID structure rather than by E including values in the operand list PID Structure Mnemonic Data Type Description CTL DINT The CTL member provides access to the status members bits in one 32 bit word The PID instruction sets bits 07 15 This Bit Is This Member 31 EN 30 CT 29 CL 28 PVT 27 DOE 26 SWM 25 CA 24 MO 23 PE 22 NDF 21 NOBC 20 NOZC This Bit Is This Member Which the PID Instruction Sets 15 INI 4 SPOR 13 OLL 2 OLH 11 EWD 10 DVNA 09 DVPA 08 PVLA 07 PVHA 498 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Mnemonic Data Type Description SP REAL setpoint KP REAL independent proportional gain unitless dependent controller gain unitless Kl REAL independent integral gain 1 sec dependent reset time minutes per repeat KD REAL independent derivative gain seconds dependent rate time minutes BIAS REAL feedforward or bias 96 MAXS REAL maximum engineering unit scaling value MINS REAL minimum engineering unit scaling value DB REAL deadband engineering units SO REAL set output MAXO REAL maximum output limit of output MINO REAL minimum output limit of output UPD
251. Port SERIAL PORT tag tag that controls the operation Control CONTROL Serial Port DINT immediate number of characters to e The Serial Port Control Length must be less Control Length send than or equal to the size of the Source e f you want to set the Serial Port Control Length equal to the number of characters in the Source enter 0 Characters Sent DINT immediate 0 During execution displays the number of AWA Channel Source SerialPortControl Publication 1756 RMOO3K EN P July 2008 Structured Text characters that were sent The operands are the same as those for the relay ladder AWA instruction However you specify the Serial Port Control Length and the Characters Sent values by accessing the LEN and POS members of the SERIAL PORT CONTROL structure rather than by including the values in the operand list 589 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT SERIAL PORT CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL The run bit indicates that the instruction is executing EM BOOL The empty bit indi
252. RCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 ASCII Clear Buffer ACL The ACL instruction immediately clears the buffer and ASCII queue Operands Relay Ladder ACL Operand Type Format Enter ASCII Clear Buffer Channel Channel DINT immediate 0 Clear Serial Port Read Clear Serial Port Write tag Clear Serial BOOL immediate To empty the buffer and remove ARD and Port Read ARL instructions from the queue enter Yes tag Clear Serial BOOL immediate To remove AWA and AWT instructions from Port Write the queue enter Yes tag Structured Text ACL Channel ClearSerialPortRead ClearSerialPortWrite The operands are the same as those for the relay ladder ACL instruction Description The ACL instruction immediately performs one or both of the following actions clears the buffer of characters and clears the ASCII queue of read instructions clears the ASCII queue of write instructions To program the ACL instruction follow these guidelines 1 Configure the serial port of the controller If Your Application Then uses ARD or ARL instructions Select User mode does not use ARD or ARL Select either System or User mode instructions 2 To determine if an instruction was removed from the queue or aborted examine the following of the appropriate instruction e ER bit is set e ERROR member is 16 E Arithmetic Status Flags not affected Fault Condi
253. RD From BCD Source value a 1610043 Dest result 1 43 Function Block FRD 01 FRD From BCD 0 value a J Source T result 1 t bag Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Truncate TRN Operands TRN Truncate Source Dest dest TRUNC source TRN 04 TRN Ex Truncate Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 The TRN instruction removes truncates the fractional part of the Source and stores the result in the Destination Relay Ladder Operand Type Format Description Source REAL immediate value to truncate tag Destination SINT tag tag to store the result INT DINT REAL Structured Text Use TRUNC as a function This function truncates source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block Operand TRN tag FBD TRUNCATE structure Type Format Description TRN structure FBD TRUNCATE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the conversion instruction Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid res
254. RMOOS3K EN P July 2008 Index FFL 394 FFU 400 file misc 329 FLL 361 FSC 346 LFL 406 LFU 412 mode of operation 330 RES 141 sequencer 419 shift 385 SIZE 381 SQI 420 SQL 428 SQ0 424 SRT 370 STD 375 ASCII structured text assignment 663 ASCII chars in buffer 573 ASCII clear buffer 575 ASCII handshake lines 577 ASCII instructions ABL 570 ACB 573 ACL 575 AHL 577 ARD 581 ARL 585 AWA 589 AWT 594 CONCAT 601 DELETE 603 DTOS 619 FIND 605 INSERT 607 LOWER 625 MID 609 RTOS 621 STOD 614 STOR 616 SWPB 299 UPPER 623 ASCII read 581 ASCII read line 585 ASCII test for buffer line 570 ASCII write 594 ASCII write append 589 ASN instruction 529 assignment ASCII character 663 non retentive 662 retentive 661 689 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Index 690 assume data available 645 647 ATN instruction 535 attributes converting data types 635 immediate values 635 AVE instruction 365 average 365 AWA instruction 589 AWT instruction 594 BAND 317 hit field distribute 291 bit field distribute with target 294 bit instructions introduction 77 ONS 88 OSF 94 OSFI 99 OSR 91 OSRI 96 OTE 82 OTL 84 OTU 86 XIO 80 bit shift left 386 bit shift right 390 bitwise AND 303 bitwise exclusive OR 310 bitwise NOT 314 bitwise operators structured text 669 bitwise OR 306 BNOT 326 BOOL expression
255. Reset is cleared A timer runs by subtracting the time of its last scan from the time now ACC ACC current_time last_time_scanned Publication 1756 RMOO3K EN P July 2008 121 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES After it updates the ACC the timer sets ast time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 minutes while it runs Otherwise the ACC value won t be correct The last_time_scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minutes if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan EN TT and DN are cleared EN TT and DN are cleared ACC value is set to PRE ACC value is set to PRE instruction first run EN TT and DN are cleared ACC value is set to PRE EN TT and DN
256. SCII convert an entry made by an operator LOWER relay ladder 625 characters to lower case to all lower case so you can search for it in an array structured text Publication 1756 RMOOS3K EN P July 2008 611 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER You can also use the following instructions to compare or manipulate ASCII characters If You Want To Use This Instruction See Page add characters to the end of a string CONCAT 601 delete characters from a string DELETE 603 determine the starting character of a sub string FIND 605 insert characters into a string INSERT 607 extract characters from a string MID 609 rearrange the bytes of a INT DINT or REAL tag SWPB 299 compare a string to another string CMP 206 see if the characters are equal to specific characters EQU 211 see if the characters are not equal to specific characters NEQ 242 see if the characters are equal to or greater than specific characters GEO 215 see if the characters are greater than specific characters GRT 219 see if the characters are equal to or less than specific characters LEQ 223 see if the characters are less than specific characters LES 22 find a string in an array of strings FSC 346 612 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed
257. SV SSV IOT Chapter 4 Error Code Description Display In Software Hex 001D Invalid attribute list same as description 001E Embedded service error same as description 001F Connection related failure see extended error codes same as description 0022 Invalid reply received same as description 0025 Key segment error same as description 0026 Invalid IO error same as description 0027 Unexpected attribute in list same as description 0028 DeviceNet error invalid member ID same as description 0029 DeviceNet error member not settable same as description 00D1 Module not in run state unknown error OOFB Message port not supported unknown error OOFC Message unsupported data type unknown error OOFD Message uninitialized unknown error OOFE Message timeout unknown error OOFF General error see extended error codes unknown error Publication 1756 RMOOS3K EN P July 2008 153 Chapter 4 Input Output Instructions MSG GSV SSV IOT Extended Error Codes RSLogix 5000 software does not display any text for the extended error codes These are the extended error codes for error code 0001 Extended Description Extended Description Error Code Error Code Hex Hex 0100 Connection in use 0203 Connection timeout 0103 Transport not supported 0204 Unconnected message timeout 0106 Ownership conflict 0205 Unconnected send parameter error 0107 Connection not found 0206 Message too large 0108 Invalid connection type
258. Slot Slot number that the module is in block transfer module over a ControlNet Slot Slot number that the module is in ControlNet network Choose a cache option Depending on how you configure a MSG instruction it may use a connection to send or receive data This Type Of Message And This Communication Method Uses A Connection CIPdatatablereadorwrite re Y PLC2 PLC3 PLC5 or SLC all types CIP CIP with Source ID DH V CIP generic P your option block transfer read or write gt J You can connect CIP generic messages But for most applications we recommend you leave CIP generic messages unconnected If a MSG instruction uses a connection you have the option to leave the connection open cache or close the connection when the message is done transmitting If You Cache the connection Then The connection stays open after the MSG instruction is done This optimizes execution time Opening a connection each time the message executes increases execution time Do not cache the connection Publication 1756 RMOO3K EN P July 2008 The connection closes after the MSG instruction is done This frees up that connection for other uses 173 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT The controller has the following limits on the number of connections that you can cache If Yo
259. Tag Level High High High Message Associated Tags Alam Class PactoryTak View Command Low Low Low Rate Of Chang l osiive Negative Asyucisted Tags Status OK Alamc Normal Acknowkedged Option Message string Q Disabled D Suppressed Delivery Cancel Status OK D Alam Nomal D Disaliesl AbAcknowledged le Suppressed pala 2 Delivery coe To define an alarm message specify this information Description The message string contains the information to display to the operator regarding the alarm In addition to entering text you can also embed variable information In the alarm message editor select the variable you want and add it anywhere in the message string The message string can have a maximum of 255 characters including the characters that specify any embedded variables not the number of characters in the actual values of the embedded variables For example S 0 96 Tag1 specifies a string tag and adds 13 characters towards the total string length but the actual value of the string tag could contain 82 characters You cannot programmatically access the alarm message string from the alarm tag To change the alarm message based on specific events configure one of the associated tags as a String data type and embed that associated tag in the message You can have multiple language versions of messages Yo
260. Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Publication 1756 RMOO3K EN P July 2008 Structured Text Programming Use arithmetic operators and functions Appendix C You can combine multiple operators and functions in arithmetic expressions Arithmetic operators calculate new values To Use This Operator Optimal Data Type add DINT REAL subtract negate DINT REAL multiply DINT REAL exponent x to the power of y di DINT REAL divide DINT REAL modulo divide MOD DINT REAL Arithmetic functions perform math operations Specify a constant a non boolean tag or an expression for the function For Use This Function Optimal Data Type absolute value ABS numeric expression DINT REAL arc cosine ACOS numeric expression REAL arc sine ASIN numeric expression REAL arc tangent ATAN numeric expression REAL cosine COS numeric expression REAL radians to degrees DEG numeric expression DINT REAL natural log LN numeric expression REAL log base 10 LOG numeric expression REAL degrees to radians RAD numeric expression DINT REAL sine SIN numeric expression REAL square root SQRT numeric expression DINT REAL tangent TAN numeric expression REAL truncate TRUNC numeric expression DINT REAL Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 665 Appendix C Stru
261. Text Use AND or the ampersand sign amp as an operator within an expression The operands must be BOOL values or expressions that evaluate to BOOL values This expression evaluates whether operandA and operandB are both set true See Appendix B for information on the syntax of expressions within structured text Function Block Operand Type Format Description BAND tag FBD BOOLEAN AND structure BAND structure FBD BOOLEAN AND Structure Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set In1 BOOL First boolean input Default is set In2 BOOL Second boolean input Default is set In3 BOOL Third boolean input Default is set In4 BOOL Fourth boolean input Default is set Ind BOOL Fifth boolean input default is set In6 BOOL Sixth boolean input Default is set Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group 317 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Input Parameter Data Type Description In7 BOOL Seventh boolean input Default is set In8 BOOL Eighth boolean input Default is set Output Parameter Data Type Description EnableOut BOOL Enable output Out BOOL The output of the instruction Description T
262. The FAULTLOG object provides fault information about the controller Attribute Data Type Instruction Description MajorEvents INT GSV How many major faults have occurred since the last time this counter was reset SSV MinorEvents INT GSV How many minor faults have occurred since the last time this counter was reset SSV MajorFaultBits DINT GSV Individual bits indicate the reason for the current major fault SSV Bit Meaning 1 power loss 3 1 0 4 instruction execution program 5 fault handler 6 watchdog 7 stack 8 mode change 11 motion MinorFaultBits DINT GSV Individual bits indicate the reason for the current minor fault SSV Bit Meaning Publication 1756 RMOO3K EN P July 2008 4 instruction execution program 6 watchdog 9 serial port 10 battery 187 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Access The MESSAGE Object You can access the MESSAGE object through the GSV SSV instructions Specify the message tag name to determine which MESSAGE object you want The MESSAGE object provides an interface to setup and trigger peer to peer communications This object replaces the MG data type of the PLC 5 processor Attribute Data Type Instruction Description ConnectionPath SINT 130 GSV Data to setup the connection path The first two bytes low byte and high byte are the length in bytes o
263. The Start plus the Quantity must be less than or delete equal to the DATA size of the Source INT tag DINT Start SINT immediate position of the first Enter a number between 1 and the DATA size of character to delete the Source INT tag DINT Destination string tag tag to store the result Structured Text PEE e BOVEM REI The operands are the same as those for the relay ladder DELETE instruction Description The DELETE instruction deletes removes a group of characters from the Publication 1756 RMOO3K EN P July 2008 Source and places the remaining characters in the Destination e The Start position and Quantity define the characters to remove Unless the Source and Destination are the same tag the Source remains unchanged 603 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Arithmetic Status Flags not affected Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is 1 Check that no instruction is writing to the LEN member of the string tag greater than the DATA size of the string tag 2 In the LEN value enter the number of characters that the string contains 4 56 The Start or Quantity value is invalid 1 Check that the Start value is between 1 and the DATA size of the Source 2 Check that the Start value plus the Quantity value is less than or
264. To determine if Examine this bit An EVENT instruction triggered the task event task 0 only A timeout triggered the task event task only 1 An overlap occurred for this task 2 464 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 The controller does not cleat the bits of the Status attribute once they are set To use a bit for new status information you must manually clear the bit Use a Set System Value SSV instruction to set the attribute to a different value Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction triggers one execution of the specified event task postscan The rung condition out is set to false No action taken Publication 1756 RMOO3K EN P July 2008 465 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg c
265. UD instruction Structured Text CTUD Ol Preset 500 CTUD Ol Reset Restart CTUD Ol CUEnable limit switchl CTUD CTUD 01 counter state CTUD_01 DN Function Block Publication 1756 RMOO3K EN P July 2008 139 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES CTUD 02 CTUD pul Count Up Down aie aa 140 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Reset RES The RES instruction resets a TIMER COUNTER or CONTROL structute Operands _ Relay Ladder FE CRES Operand Type Format Description structure TIMER tag structure to reset CONTROL COUNTER Description When enabled the RES instruction clears these elements When Using a Res The Instruction Clears Instruction For a TIMER ACC value control status bits COUNTER ACC value control status bits CONTROL POS value control status bits Because the RES instruction clears the ACC value DN bit and TT bit do not use the RES instruction to reset a TOF timer Arithmetic Status Flags not affected Fault Conditions none Execution Conditio
266. WHILE DO loop might never be executed end repeat Publication 1756 RMOO3K EN P July 2008 685 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Example 2 If You Want This Enter This Structured Text Move ASCII characters from a SINT array into a string tag In element number 0 a SINT array each element holds one character Stop when you reach the carriage return SIZE SINT array 0 SINT array size Repeat 1 Initialize Element number to 0 String tag DATA element number 2 Count the number of elements in SINT array array that SINT array element number contains the ASCII characters and store the result in element number element number 1 SINT array size DINT tag 7 7 String_tag LEN element_number 3 Set String taglelement number the character at If element number SINT array size then SINT arraylelement number E m exit 4 Add 1 to element number This lets the controller check end if the next character in S NT array Until SINT array element number 13 5 Set the Length member of String tag element number This records the number of characters in String tag so far end repeat 6 If element number SINT array size then stop You are at the end of the array and it does not contain a carriage return 7 If the character at S NT arraylelement number 13 decim
267. WM 1 ELSE TIC101 SWM 0 END IF IF Local 0 1 RollingTimestamp lt gt PreviousTimestamp OR Local 0 1 ChOFault THEN PreviousTimestamp Local 0 I RollingTimestamp PID TIC101 Local 0 I ChO0Data Local 0 I ChlData Local 1 0 ChO0Data 0 Local 1 I ChOInHold Local 1 I Ch0Data END IF Bumpless Restart The PID instruction can interact with the 1756 analog output modules to support a bumpless restart when the controller changes from Program to Run mode or when the controller powers up When a 1756 analog output module loses communications with the controller or senses that the controller is in Program mode the analog output module sets its outputs to the fault condition values you specified when you configured the module When the controller then returns to Run mode or re establishes communications with the analog output module you can have the PID instruction automatically reset its control variable output equal to the analog output by using the Inhold bit and Inhold Value parameters on the PID instruction Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 To set a bumpless restart Do This Details Configure the 1756 analog output module s channel Select the hold for initialization check box on the properties page for the specific which
268. _count loop count 1 loop count 0 D POS POS 1 yes y evaluate expression no 88 Y yes POS POS 1 ER bit is set DN bit is set I P0S POS 1 338 Y rung condition out is set true Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Condition Relay Ladder Action EN bit 1 examine EN bit EN bit 0 examine internal bit POS POR internal bit is set yes yes no no EN bit is set POS POS 1 loop_count 1 Y DN bit is set Y rung condition out is set to true page 338 Publication 1756 RM003K EN P July 2008 339 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Condition Relay Ladder Action ALL mode l EN bit 0 amie bit 1 examine EN bit internal bit bit 0 POS POS 1 _EN bit is set yes yes no no loop count LEN POS POS POS 1 8 DN bit is set m true page 338 340
269. a e e e e C Ea 447 Temporary End TND isses Eph tae rade aca ce CER CR 450 Master Control Reset MCR 0 os cere ete Rene 452 User Interrupt Disable UID User Interrupt Enable UIE 454 Always False Instruction AED 14er ehem 456 No Operation ONG aa qioack accen dackegotack ado dolo e or oe ac 457 7 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Table of Contents For Break Instructions FOR FOR DO BRK EXIT RET Special Instructions FBC DDT DTR PID End of Transition ECT s pesca wg war mac ok RR UR OR CR te 458 SFG Pause SEP red br REY re RETENIR PERS 460 SFG Reset SER Seni hewn wh eae dia usb dank au dac 462 Trigger Event Task EVEN Desa ssad sack e n a on 464 Programmatically Determine if an EVENT Instruction Triggered WT P 464 Chapter 12 TatfOd WCBlott coe ies d SO E eee NOE REA A RO Uc on de 469 POIL icc EE E e eons E EFE I x EO IE 470 Break BRI auca cn eee dh deoa RI d der o adcbeg acida a dedi wa 473 Retr RET aae dic iu dod Ree RC UR a ire cR ca d ER 474 Chapter 13 IttfoducBOD exceder REGN enn Tee eee eee Gas 477 File Bit Comparison FBC saa dicks och ke eee db be re Ra 478 Selecting the Search Mode secs Cia scan ex Desc ign ER Ea A adn 480 Diagnostic Detect DDT exar oan dri paw CHOR be aree ae 486 Selecting the search mode us eda daa d ed oto o cac aea 488 Data Transitional DTR duuwasu esae dba bag ned
270. a value to the power of another value XPY relay ladder 546 structured text function block f There is no equivalent structured text instruction Use the operator in an expression You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the S V bit to see whether the result was truncated For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Publication 1756 RMO03K EN P July 2008 539 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 15 Advanced Math Instructions LN LOG XPY Natural Log LN The LN instruction takes the natural log of the Source and stores the result in the Destination Operands Relay Ladder LN Natural Log Operand Type Format Description Source Source SINT immediate find the natural log of this value Dest INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest LN source Use LN as a function This function computes the natural log of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text LN 01 Function Block n sg Natuiaiii g Oper
271. abled it retains its ACC value You must clear the ACC value using the Reset input The time base is always 1 msec For example for a 2 second timer enter 2000 for the PRE value TimerEnable Reset preset ae timer accumulated value ACC 77 4 p le e Publication 1756 RMOO3K EN P July 2008 0 timer did not reach PRE value Set the Reset input parameter to reset the instruction If TimerEnable is set when Reset is set the RTOR instruction begins timing again when Reset is cleared A timer runs by subtracting the time of its last scan from the time now ACC ACC current time last time scanned 125 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES After it updates the ACC the timer sets ast time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 minutes while it runs Otherwise the ACC value won t be correct The last_time_scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minut
272. ableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA DINT Value to XOR with SourceB Valid any integer SourceB DINT Value to XOR with SourceA Output Parameter Data Type Valid any integer Description The instruction produced a valid result Result of the instruction Arithmetic status flags are set for this output EnableOut BOOL Dest DINT Description Arithmetic Status Flags Fault Conditions Execution Condition prescan rung condition in is false When enabled the instruction evaluates the XOR operation If the Bit In And the Bit In The Bit In the Source A Is Source B Is Destination Is 0 0 0 0 1 1 1 0 1 1 1 0 If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false The rung condition out is set to false rung condition in is true The instruction performs a bitwise OR operation The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group 311 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT
273. age set this member to the required group number octal Slot SINT To change the slot number for a block transfer message set this member to the required slot number If the message Then specify the slot number in goes over this network universal remote I O octal ControlNet decimal 0 15 Path STRING To send the message to a different controller set this member to the new path e Enter the path as hexadecimal values e Omit commas For example for a path of 1 0 2 42 1 3 enter 01 00 02 2A 01 03 To browse to a device and automatically create a portion or all of the new string right click a string tag and choose Go to Message Path Editor Remotelndex DINT If you use an asterisk to designate the element number of the remote array the Remotelndex provides the element number To change the element number set this member to the required value If the message Then the remote array is the reads data Source element writes data Destination element RemoteElement STRING To specify a different tag or address in the controller to which the message is sent set this member 146 to the required value Enter the tag or address as ASCII characters If the message Then the remote array is the reads data Source element writes data Destination element Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instruction
274. al mode 40010 Numerical mode distributes the array operation over a number of scans This mode is useful when working with non time critical data or large amounts of data You enter the number of elements to operate on for each scan which keeps scan time shorter Publication 1756 RMOO3K EN P July 2008 331 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE rung condition in EN bit DN bit scan of the instruction Execution is triggered when the rung condition in goes from false to true Once triggered the instruction is executed each time it is scanned for the number of scans necessary to complete operating on the entire array Once triggered rung condition in can change repeatedly without interrupting execution of the instruction peo CELL one scan T j second scan lt I lt next scan lt q 1 A 4 T 16641 IMPORTANT Avoid using the results ofa file instruction operating in numerical mode until the DN bit is set The following timing diagram shows the relationship between status bits and instruction operation When the instruction execution is complete the DN bit is set rung is true at completion rung is false at completion multiple scans lt q multiple
275. al value of the carriage return then stop Otherwise go to 3 686 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Comments Publication 1756 RMOO3K EN P July 2008 To make your structured text easier to interpret add comments to it Comments let you use plain language to describe how your structured text wotks e Comments do not affect the execution of the structured text To add comments to your structured text To Add A Comment on a single line at the end of a line of structured text Use One Of These Formats comment comment comment within a line of structured text comment comment that spans more than one line start of comment end of comment start of comment end of comment 687 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Format comment For example Example At the beginning of a line comment comment Check conveyor belt direction IF conveyor direction THEN At the end of a line ELSE If conveyor isn t moving set alarm light light 1 END IF Sugar Inlet 1 open the inlet IF Sugar Low low level LS amp Sugar High hi
276. all subroutines regardless of rung condition To ensure that all rungs in the subroutine are prescanned the controller ignores RET instructions that is RET instructions do not exit the subroutine e Release 6 x and earlier input and return parameters are passed e Release 7 x and later input and return parameters are not passed If recursive calls exist to the same subroutine the subroutine is prescanned only the first time If multiple calls exist non recursive to the same subroutine the subroutine is prescanned each time The rung condition out is set to false relay ladder only rung condition in isfalseto The subroutine does not execute na the JSR instruction Outputs in the subroutine remain in their last state The rung condition out is set to false rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes Publication 1756 RMOO3K EN P July 2008 441 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Condition Relay Ladder Action instruction execution input parameters Structured Text Action appropriate SBR tags JSR copies input parameters to logic execution begins in routine i
277. alse rung condition in is false The rung condition out is set to false rung condition in is true Destination 0 Source The rung condition out is set to true postscan The rung condition out is set to false Function Block Action Condition prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Publication 1756 RMOO3K EN P July 2008 215 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 216 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Relay Ladder NEG Negate Source value 1 g Dest negate result p Structured Text negate result value 1 Function Block NEG 01 value 1 Example Change the sign of value_1 and place the result in negate_result negate result Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Absolute Value ABS The ABS instruction takes the absolute value of the Source and places the result in the Destination Operands
278. alue DATA 11 dependent gain KP DATA 12 dependent gain KI DATA 13 dependent gain KD DATA 14 previous CV value DATA 15 CV descaling constant DATA 16 tieback descaling constant EN BOOL enabled CT BOOL cascade type O slave 1 master CL BOOL cascade loop O no 1 yes PVT BOOL process variable tracking 0 no 1 yes DOE BOOL derivative of O PV 1 error SWM BOOL software manual mode 0 no auto 1 yes sw manual CA BOOL control action 0 means E SP PV 1 means E PV SP MO BOOL station mode 0 automatic 1 manual PE BOOL PID equation 0 independent 1 dependent NDF BOOL no derivative smoothing O derivative smoothing filter enabled 1 derivative smoothing filter disabled NOBC BOOL no bias back calculation 0 bias back calculation enabled 1 bias back calculation disabled NOZC BOOL no zero crossing deadband 0 deadband is zero crossing 1 deadband is not zero crossing INI BOOL PID initialized O no 1 yes SPOR BOOL setpoint out of range 0 no 1 yes OLL BOOL CV is below minimum output limit 02no 1 yes OLH BOOL CV is above maximum output limit 02no 1 yes 500 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Mnemonic DataType Description SSS CEWD BOOL emoriswihindeadband nol yes ait tt tS DVNA BOOL deviation is alarmed low 0 no 1 yes
279. ana 000 ccc eee eee 25 Setand Cleat secte wer dele och kee nary x e d ap t pd 25 Relay ladder rung condos 2 200334 aes e RICE wes 26 Function block states lesse 27 Chapter 1 Introduction o iresore se vr xen Pa bsc ee x pur SR ARR ns 29 Digital Alarm ALMD iik race Rhe ee Rabe ed Ee un 30 State Diagrams when Acknowledgement Required 36 State Diagrams when Acknowledgment Not Required 37 ALMD Alarm Acknowledge Required and Latched 38 ALMD Alarm Acknowledge Required and Not Latched 39 ALMD Alarm Acknowledge Not Required and Latched 39 ALMD Alarm Acknowledge Not Required and Not Latched 40 Analog Alarm ALMA vesc erac iore acte e Snel bep CR rd 42 State Diagrams when Acknowledgement Required 54 State Diagrams when Acknowledgement Not Required 55 ALMA Level Condition Acknowledge Required 58 ALMA Level Condition Acknowledge Not Required 59 ALMA Rate of Change Acknowledge Required 60 ALMA Rate of Change Acknowledge Not Required 61 Configure an Alarm Instruction ss ssa ar rad be bae a 63 Enter Alarm Message Text iua t dacackaon eani a oi dole do adeo dd 65 Message String Variables nus t8o bt ncedet sed dewwncteieends 67 Multiple Language Versions of Alarm Messages 68 Monitor Alarm Status 0 0 00 ccc teen enn es 69 Buffefing AlarMS 2er ub hae carci kiana avons q i debida 69 Programmatically
280. and 4 Since element numbers start at 0 the last element is 1 less than the number of elements in the array Otherwise stop 680 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C WHILE DO Use the WHILE DO loop to keep doing something as long as certain conditions are true Operands Structured Text WHILE bool expression DO Operand Type Format Enter statement a END WHILE bool_ l BOOL tag BOOL tag or expression that evaluates to expression a BOOL value expression IMPORTANT Make sure that you do got iterate within the loop too many times in a single scan The controller does not execute any other statements in the routine until it completes the loop e If the time that it takes to complete the loop is greater than the watchdog timer for the task a major fault occurs Consider using a different construct such as IE THEN Description The syntax is WHILE bool expressioni DO statement a Statements to execute while bool expression is true IIS Joxexod exoressioimZ TEN KLIVA a If there are conditions when you want to optional m exit the loop early use other statements END IF such as an IF THEN construct to condition an EXIT statement END WHILE Publication 1756 RMOO3K EN P July 2
281. and RTS signals Operands Relay Ladder ASCII Handshake see END Channel AND Mask DN OR Mask ERD SerialPort Control Channel Status Decimal Operand Type Format Enter Channel DINT immediate 0 tag ANDMask DINT immediate Refer to the description tag ORMask DINT immediate tag Serial Port Control SERIAL PORT CONTROL tag tag that controls the operation Channel Status Decimal DINT immediate 0 AHL Channel ANDMask ORMask SerialPortControl Publication 1756 RMOO3K EN P July 2008 During execution displays the status of the control lines For the Status Of This Control Examine This Bit Line CTS 0 RTS 1 DSR 2 DCD 3 DTR 4 Received the XOFF character 5 Structured Text The operands are the same as those for the relay ladder AHL instruction Howevet you specify the Channel Status value by accessing the POS member of the SERIAL PORT CONTROL structure rather than by including the value in the operand list 571 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT SERIAL PORT CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the i
282. and Type Format Description LN tag FBD_MATH_ADVANCED structure LN structure Source Dest 3 FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to math instruction Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result 540 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Advanced Math Instructions LN LOG XPY Chapter 15 Description Arithmetic Status Flags Fault Conditions Execution Condition prescan The Source must be greater than zero otherwise the overflow status bit S V is set The resulting Destination is greater than or equal to 87 33655 and less than or equal to 88 72284 Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller calculates the natural log of the Source and places the result in the Destination The rung condition out is set to true postscan Condition prescan The rung condition out is set to false Function Block Action No action taken instruction first scan
283. ansitions from cleared to set you have to condition the structured text instruction Use a one shot to trigger execution osri l InputBit tag xic OSRI osri 1 IF osri l OutputBit THEN ABL O0 serial control END IF Constructs Constructs can be programmed singly or nested within other constructs If You Want To Use This Construct Available In These Languages See Page do something if or when specific IF THEN structured text 672 conditions occur select what to do based on a numerical value CASE OF structured text 675 do something a specific number of times before FOR DO structured text 678 doing anything else keep doing something as long as certain WHILE DO structured text 681 conditions are true keep doing something until a condition is true REPEAT UNTIL structured text 684 Some key words are reserved for future use These constructs are not available e GOTO e REPEAT RSLogix 5000 software will not let you use them as tag names or constructs Publication 1756 RMOOS3K EN P July 2008 671 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming IF THEN Use IF THEN to do something if or when specific conditions occur Operands Structured Text IF bool expression THEN pc Operand Type Format Enter END IF bool BOOL tag BOOL tag or expression that evaluates to expression a BOOL value BOOL expression expre
284. aranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA RSLinx Enterprise software subscribes to alarms in the controller Use the output parameters to monitor the instruction to see the alarm subscription status and to display alarm status changes If a connection to RSLinx Enterprise software is lost the controller can briefly buffer alarm data until the connection is restored State Diagrams when Acknowledgement Required Latched False a Nn Condition MinDurationACC gt MinDurationPRE E N Ne InAlarm False InAlarm True Acked True j gon d Acked False RO N oc S P a E yw oa e pe X A pe SS my Ack nage Ack we 0 xe ge se aX na s p po In Je Ps MN Cong EN Vow T x NO li e di b InAlarm False wv InAlarm True Acked False J k Acked True J K P NS Latched True yo own Condition MinDurationACC gt MinDurationPRE IN InAlarm 7 False i InAlarm True Acked True J Acked False NL 4 RN In Condition Reset NU A ho Ack Ong Loy Sm S Ese n Maa E Dem Ny x InAlarm True V Acked True J N 4 1 Alarm can be acked by several different ways ProgAck OperAck clients RSLogix 5000 software RSView software Alarm can be reset by several different ways ProgReset OperReset clients RSLogix 5000 software RSView software
285. are cleared ACC value is set to PRE Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated na Enableln is set When Enableln transitions from cleared to set the instruction initializes as described for instruction first scan The instruction executes EnableOut is set Enableln is always set The instruction executes reset When the Reset input parameter is set the instruction clears EN TT and DN and sets ACC PRE Note that this is different than using a RES instruction on a TOF instruction When the Reset input parameter is set the instruction clears EN TT and DN and sets ACC PRE Note that this is different than using a RES instruction on a TOF instruction postscan No action taken No action taken Example Each scan after imit_switch7 is cleared the TOFR instruction increments the ACC value by elapsed time until the ACC value reaches the PRE value When ACC 2 PRE the DN parameter is cleared and mer_state2 is set 122 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Structured Text TOFR Ol Preset 500 TOFR Ol Reset reset TOFR Ol TimerEnable limit switchl TOFR TOFR 01 timer state2 TOFR_01 DN Function B
286. arm after the alarm condition returns to inactive normal Latched alarms require a reset command to transition to normal The reset command must be received after the condition returns to normal Acknowledge commands will not reset a latched alarm Deadband ALMA instruction Specify a Deadband value to reduce alarm condition chattering caused by small fluctuations in the In value The deadband value does not affect the alarm limit for the transition into the active state and is also not used during the Minimum Duration interval Once a level condition becomes active InAlarm it will remain active until the In value crosses back over the limit by the specified deadband For example if the High limit is 80 the Low limit is 20 and the Deadband is 5 the High condition will be active at 2 80 and return to normal at lt 5 the Low condition will be active at 20 and return to normal at 2 lt 25 The Deadband has no effect on Rate of Change alarm conditions Acknowledgement Required 64 Alarms are configured to require acknowledgement by default Acknowledgement indicates that an operator is aware of the alarm condition whether or not conditions have returned to normal Clear the Acknowledgement Required setting when you want the alarm to appear and disappear from the Alarm Summary on the HMI with no operator interaction Alarms that do not require acknowledgement always have the Acked status set If a digital alarm is
287. arm mix could boost the output value faster than waiting for the process variable to change as a result of the mixing A bias value is typically used when no integral control is used In this case the bias value can be adjusted to maintain the output in the range required to keep the PV near the setpoint Cascading Loops The PID cascades two loops by assigning the output in percent of the master loop to the setpoint of the slave loop The slave loop automatically converts the output of the master loop into the correct engineering units for the setpoint of the slave loop based on the slave loop s values for MAXS and MINS Relay Ladder PID PID Proportional Integral Derivative Proportional Integral Derivative PID master JE PID slave E Process variable pv master Process variable pv slave Tieback n Tieback Control variable cv master Control variable cv slave PID Master Loop D PID Master Loop master 0 Inhold bit 0 Inhold bit Inhold Value 0 Inhold Value D Setpoint 50 0 Setpoint Process Variable 0 0 Process Variable Output 0 0 Output Structured Text PID master pv_master 0 cv_master 0 0 0 PID slave pv_slave 0 cv_slave master 0 0 Publication 1756 RMOO3K EN P July 2008 515 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Control a Ratio You can maintain two values in a ratio by using the
288. array pos value pos pos 2 String tag DATA pos SINT array pos end while Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Example 2 If You Want This Enter This Structured Text Move ASCII characters from a SINT array into a string tag In element number 0 a SINT array each element holds one character Stop when you reach the carriage return SIZE SINT array 0 SINT array size While SINT array element number 13 do 1 Initialize Element number to 0 String tag DATA element number 2 Count the number of elements in S NT array array that SINT array element number contains the ASCII characters and store the result in element number element number 1 SINT array size DINT tag R V String tag LEN element number 3 If the character at S NT arraylelement number 13 If element number SINT array size then decimal value of the carriage return then stop g exit 4 Set String_taglelement_number the character at end if SINT arraylelement number end while 5 Add 1 to element number This lets the controller check the next character in S NT array 6 Set the Length member of String tag element number This records the number of characters in String tag so far 7 If element number SINT array size then stop You ar
289. artisantg com Chapter 6 Multiply MUL Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS The MUL instruction multiplies Source A with Source B and places the result in the Destination Operands i Relay L r MUL elay Ladde Multiply Source Operand Type Format Description Source B Source A SINT immediate value of the multiplicand Dest INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Source B SINT immediate value of the multiplier INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination dest sourceA sourceB SINT tag tag to store the result INT DINT REAL Structured Text Use the multiply sign as an operator in an expression This expression multiplies sourceA by sourceB and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text MUL 04 MUL Operand MUL tag Multiply Source SourceB 258 Function Block Format Description MUL structure Type FBD_MATH structure Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 FBD_MATH Structure Input Parameter Data Type Description E
290. at Description Dest Source SINT tag initial element to copy Length INT Important the Source and Destination operands should be the same data type or CPS DINT unexpected results may occur Synchronous Copy File Source Dest HEAE Length f i lid string structure Destination SINT tag initial element to be overwritten by the Source INT Important the Source and Destination DINT operands should be the same data type or unexpected results may occur REAL string structure Length DINT immediate number of Destination elements to copy tag Structured Text COP Source Dest Length The operands are the same as those for the relay ladder COP and CPS Source Dest Length CPS instr ctions Publication 1756 RMOO3K EN P July 2008 355 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Description During execution of the COP and CPS instructions other controller actions may try to interrupt the copy operation and change the source or destination data If the Source Or Destination Is And You Want To Then Select Notes e produced tag prevent the data from changing CPS e asks that attempt to interrupt a CPS e consumed tag during the copy operation instruction are delayed until the a 1 0 data instruction is done e To estimate the execution time of the e data that anoth
291. ater than or equal GEO relay ladder 215 to a second value structured text function block test whether one value is greater than a GRT relay ladder 219 second value structured text function block test whether one value is less than or equal to LEQ relay ladder 223 a second value structured text function block test whether one value is less than a LES relay ladder 22 second value structured text function block test whether one value is between two LIM relay ladder 231 other values structured text function block pass two values through a mask and test MEQ relay ladder 237 whether they are equal structured text function block test whether one value is not equal to a NEQ relay ladder 242 second value structured text function block f There is no equivalent structured text instruction Use other structured text programming to achieve the same result See the description for the instruction 2 There is no equivalent structured text instruction Use the operator in an expression You can compare values of different data types such as floating point and integer For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Publication 1756 RMO03K EN P July 2008 205 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE w
292. ath Conversion Instructions DEG RAD TOD FRD TRN TRUNC Description Description The instruction produced a valid result Input Parameter Data Type Output Parameter Data Type EnableOut BOOL Dest REAL Description Arithmetic Status Flags Fault Conditions Execution Condition prescan Result of the conversion instruction Arithmetic status flags are set for this output The RAD instruction uses this algorithm Source n 180 where x 3 141593 Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller converts the Source to radians and places the result in the Destination The rung condition out is set to true postscan Condition prescan instruction first scan The rung condition out is set to false Function Block Action No action taken No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set postscan 554 The instruction executes EnableOut is set No action taken Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 Example Convert value
293. ation Node fo metal M Connected v Cache Connections Specify a path Specify a Communication Method Or Module Address Choose a cache option Specify a path The path shows the route that the message takes to get to the destination It uses either names from the I O configuration of the controller numbers that you type or both lf Then The 1 0 configuration of the controller has Use the Browse button to select the module the module that gets the message The 1 0 configuration of the controller has 1 Use the Browse button to select the local communication module only the local communication module 2 Type the rest of the path The I O configuration of the controller Type the path doesn t have any of the modules that you need for the message Publication 1756 RMOO3K EN P July 2008 169 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Example The 1 0 configuration of the controller has the module that gets the message Click the Browse button and select the module Path Peer Controller Peer Controller The 1 0 configuration of the controller has only the local communication module r Go to the local communication module Go out the EtherNet IP port to the address of 10 10 10 10 Go across the backplane Path LocalENB 2 10 10 10 10
294. atus information about a task Specify the task name to determine which TASK object you want Attribute Data Type Instruction Description DisableUpdateOutputs DINT GSV Enables or disables the processing of outputs at the end of a task SSV To Set the attribute to enable the processing of outputs 0 at the end of the task disable the processing of 1 or any non zero value outputs at the end of the task EnableTimeOut DINT GSV Enables or disables the timeout function of an event task SSV To Set the attribute to disable the timeout function 0 enable the timeout function 1 or any non zero value InhibitTask DINT GSV Prevents the task from executing If a task is inhibited the controller still prescans the task when the controller transitions from program SSV to run or test mode To Set the attribute to enable the task 0 default inhibit disable the task 1 or any non zero value Instance DINT GSV Provides the instance number of this TASK object Valid values are 0 31 LastScanTime DINT GSV Time it took to execute this task the last time it was executed Time is in microseconds SSV Maxlnterval DINT 2 GSV The maximum time interval between successive executions of the task DINT 0 contains the lower 32 bits of the value DINT 1 SSV contains the upper 32 bits of the value A value of 0 indicates 1 or less executions of the task MaxScanTime DINT GSV Maximum recorded execution time for this program Time is in microse
295. ay Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Execution Condition prescan Relay Ladder Action The EN bit is cleared The DN bit is cleared The ER bit is cleared The rung condition out is set to false rung condition in is false examine DN bit DN bit 1 DN bit 0 EN bit is cleared ER bit is cleared DN bit is cleared a Y rung condition out is set to false rung condition in is true The AVE instruction calculates the average by adding all the specified elements in the array and dividing by the number of elements Internally the instruction uses a FAL instruction to calculate the average Expression average calculation Mode ALL For details on how the FAL instruction executes see page 337 postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 367 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 1 Average array dint which is DINT 4 5 dimension 1 T 2 d a 0 1 2 3 4 S 0 20
296. ay Ladder Action prescan The EN bit is set to prevent a false load when the program scan begins The rung condition out is set to false rung condition in is false The EN bit is cleared The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 425 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Condition Relay Ladder Action rung condition in is true EN 0 EN bit is set examine EN bit 9 ER bit is cleared EN 1 POS LEN v dun POS 1 yes no DN bit is set POS POS 1 Y POS value goto rolls over error yes T DN bit is set no POS gt LEN S yes T Destination Destination AND NOT Mask y FR bitis set a OR Array control POS AND Mask gt y rung condition out is set to true postscan The rung condition out is set to false 426 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Sequencer Instructions SQI SQO SQL Chapter 10 Example When enabled the SQO instruction increments the position passes the data at that position in array_dint through the mask and stores the result in va ze f go Seque
297. be within the valid range for the Source 0 7 SINT data type Destination SINT tag tag where to move the bits INT DINT Destination DINT immediate the number of the bit lowest bit number bit where to start copying bits from the Source 0 31 DINT 0 15 INT must be within the valid range for the 0 7 SINT Destination data type Length DINT immediate number of bits to move 1 32 Description When enabled the BTD instruction copies a group of bits from the Source to the Destination The group of bits is identified by the Source bit lowest bit numbet of the group and the Length number of bits to copy The Destination bit identifies the lowest bit number bit to start with in the Destination The Source remains unchanged If the length of the bit field extends beyond the Destination the instruction does not save the extra bits Any extra bits do not wrap to the next word If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Arithmetic Status Flags no affected Publication 1756 RMOO3K EN P July 2008 291 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Fault Conditions none Execution Condition Relay Ladder Action prescan The rung co
298. ble PV E SP PV t CV KE Kj Edi K T BAS 0 E PV SP t CV KyE Kj Bat K 2 Bras 0 506 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Where Variable Kp Special Instructions FBC DDT DTR PID Chapter 13 Description proportional gain unitless Kp Ke unitless integral gain seconds To convert between K integral gain and T reset time use Kc K i 60T derivative gain seconds To convert between K derivative gain and Ty rate time use Ka Ke Tq 60 controller gain unitless reset time minutes repeat rate time minutes setpoint process variable error SP PV or PV SP BIAS CV feedforward or bias control variable dt loop update time If you do not want to use a particular term of the PID equation just set its gain to zero For example if you want no derivative action set Kg or T4 equal to zero Anti reset Windup And Bumpless Transfer From Manual To Auto The PID instruction automatically avoids reset windup by preventing the integral term from accumulating whenever the CV output reaches its maximum or minimum values as set by MAXO and MINO The accumulated integral term remains frozen until the CV output drops below its maximum limit or rises above its minimum limit Then normal integral accumulatio
299. ble detection of the High alarm condition Default is set LEnabled BOOL Low alarm condition detection Set to enable detection of the Low alarm condition Clear to disable detection of the Low alarm condition Default is set LLEnabled 44 BOOL Low Low alarm condition detection Set to enable detection of the Low Low alarm condition Clear to disable detection of the Low Low alarm condition Default is set Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Input Parameter Data Type Description AckRequired BOOL Specifies whether alarm acknowledgement is required When set acknowledgement is required When cleared acknowledgement is not required and HHAcked HAcked LAcked LLAcked ROCPosAcked and ROCNegAcked are always set Default is set ProgAckAll BOOL Set by the user program to acknowledge all conditions of this alarm Requires a cleared to set transition while the alarm conditions are unacknowledged Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperAckAll BOOL Set by the operator interface to acknowledge all conditions of this alarm Requires a cleared to set transition while the alarm conditions are unacknowledged Th
300. bleIn to trigger execution Structured text instructions execute as if EnableIn is always set This also differs from relay ladder instructions that use rung condition in to trigger execution Some relay ladder instructions only execute when rung condition in toggles from false to true These are transitional relay ladder instructions In structured text instructions will execute each time they are scanned unless you pre condition the execution of the structured text For example the ABL instruction is a transitional instruction in relay ladder In this example the ABL instruction only executes on a scan when ag xc transitions from cleared to set The ABL instruction does not execute when ABL ASCII Test For Buffer Line Channel 0 SerialPort Control Character Count serial_control IF tag xic THEN ABL 0 serial_ control the ABL instruction will execute every scan that ag_xic is set not just when Instructions rung condition or state transition that triggers execution instruction tag_xic stays set or when zag xic is cleared lag xic JE In structured text if you write this example as END IF qg xic transitions from cleared to set 670 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C If you want the ABL instruction to execute only when ag xic tr
301. blication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction pauses or resumes execution of the specified SFC routine postscan The rung condition out is set to false No action taken Example 1f e 5 is set pause the SFC routine named normal Restart the SFC when Sfc en eis set Relay Ladder Pause the SFC routine sfp en p SF SFC Pause SFC Routine Name normal Target State Paused Resume executing the SFC routine SF sfp en e SFC Pause SFC Routine Name normal Target State Executing Structured Text Pause the SFC routine IF sfp en p THEN SFP normal paused sfp en p 0 END IF Publication 1756 RMOO3K EN P July 2008 461 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program
302. cates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit does not apply to this instruction LEN DINT The length indicates the number of characters to send POS DINT The position displays the number of characters that were sent ERROR DINT The error contains a hexadecimal value that identifies the cause of an error Description The AWA instruction sends the specified number of characters Serial Port Control Length of the Source tag to the device that is connected to the serial port of the controller adds to the end of the characters appends either one or two characters that are defined in the Controller Properties dialog box User Protocol tab To program the AWA instruction follow these guidelines 1 Configure the serial port of the controller a Does your application also include ARD or ARL instructions If Then Yes Select User mode No Select either System or User mode b Define the characters to append to the data 2 This is a transitional instruction In relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition 590 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisa
303. cation 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false is internal bit is cleared DN bit 1 yes no EN bit is cleared EN bit is cleared ALL mode ER bit is cleared yes m es Y LEN 2 0 no yes no no POS POS 1 vey 8 no DN bit is set 4 Y yes DN bit is set g mode LEN numeric mode page 341 Y rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 337 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Condition rung condition in is true ER bit 0 examine ER bit ER bit 1 examine DN bit DN bit 1 Relay Ladder Action DN bit 0 no no no ALL mode yes yes page 341 numeric mode yes DN bit is set INC ALL mode mode page 339 page 340 q loop
304. cation 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Input Parameter Data Type Description In8 BOOL Eighth boolean input Default is cleared Output Parameter Data Type Description EnableOut BOOL Enable output Out BOOL The output of the instruction Description The BOR instruction ORs as many as eight boolean inputs If an input is not used it defaults to cleared 0 Out 7 In1 OR In2 OR In3 OR In4 OR In5 OR In6 OR In7 OR In8 Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example 1 This example ORs bool_in1 and bool in2 and places the result in sz ze result or If BOOL IN1 Is If BOOL_IN2 Is Then VALUE RESULT OR Is 0 0 0 0 1 1 1 0 1 1 1 1 Structured Text value result or Publication 1756 RMOO3K EN P July 2008 bool inl OR bool in2 321 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instruc
305. cce as dsiaws erue rae 4223 Boolean NOT BNOT i4icieerctvonwerduceadsdadate eg dd 326 Chapter 8 Lttodge UO asa exadoa id p bdey a Da qa dde OR EO a baeo cR dera a 329 Selecting Mode of Operation seco bere Yd o dA He ace did 330 JUI dE Giugno Ca nck qa RO OR OE ee hes ee Ae C 330 Numerical mode oq dude cadena Sc trees ere debi d 331 Incremental mode sses ose vu ac bc ERE E E A 333 File Arithmetic and Logic FAL ruuaas 44 uo ERA Adr tas s 335 o IMs su Tnm 344 VAN operators yrs Siw degen ne SAA ae eae ee aD 344 Format Expressions es os accord rt wu qoe alegre 345 Determine the order of operation v au vea e yx RR Re P ed 345 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Sequencer Instructions SQI SQ0 SQL Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Publication 1756 RMO03K EN P July 2008 Table of Contents File Search and Compare FSC esie s e weeds ee 346 POC expressions hci arte cs Gate UR REX ROI S 351 Valid Operators EET 352 Format EsptessiOfls us rar x ha REY ek e aes 352 Determine the order of operation ua seda itd ones 353 Use Strings In an Expression 2h sepan b Rp dcr hee CR 354 Copy File COP Synchronous Copy File CPS 355 Pile FIFE DTE 361 Pile Average
306. ccumulated value must reach before the instruction sets the DN bit ACC DINT The accumulated value specifies the number of milliseconds that have elapsed since the RTO instruction was enabled Description The RTO instruction accumulates time until it is disabled When the RTO instruction is disabled it retains its ACC value You must clear the ACC value typically with a RES instruction referencing the same TIMER structure 112 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 The time base is always 1 msec For example for a 2 second timer enter 2000 fot the PRE value rung condition in timer enable bit EN rung condition that controls RES instruction timer timing bit TT timer done bit DN timer accumulated value ACC 7 4 H 0 m 7 preset a 16651 timer did not reach PRE value A timer runs by subtracting the time of its last scan from the time now ACC ACC current time last time scanned After it updates the ACC the timer sets last_ time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 m
307. ces the Arithmetic Status Flags Fault Conditions Execution E Condition prescan result in the Destination Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Destination Source The rung condition out is set to true postscan The rung condition out is set to false Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken 218 Artisan Technology Group Publication 1756 RMOO3K EN P July 2008 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Example Place the absolute value of value_1 into value 1 absolute In this example the absolute value of negative four is positive fout Relay Ladder ABS Absolute Value Source value 1 EP Dest value 1 absolute 4e Structured Text value 1 absolute ABS value 1 Function Block Absolute Value value 1 J Publication 1756 RMOO3K EN P July 2008 value 1 absolute Artisan Technology Group Quali
308. chnology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 Input Parameter Data Type Enableln BOOL FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA ALARM_ANALOG Structure Description Relay Ladder Corresponds to the rung state If cleared the instruction does not execute and outputs are not updated Structured Text No effect The instruction always executes Function Block If cleared the instruction does not execute and outputs are not updated Default is set REAL The alarm input value which is compared with alarm limits to detect alarm conditions Default 0 0 Relay Ladder Copied from the instruction operand Structured Text Copied from instruction operand InFault BOOL Bad health indicator for the input The user application may set InFault to indicate the input signal has an error When set the instruction sets InFaulted Status 1 When cleared the instruction clears InFaulted Status 1 In either case the instruction continues to evaluate In for alarm conditions Default is cleared good health HHEnabled BOOL High High alarm condition detection Set to enable detection of the High High alarm condition Clear to disable detection of the High High alarm condition Default is set HEnabled BOOL High alarm condition detection Set to enable detection of the High alarm condition Clear to disa
309. chnology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Assign an ASCII character to a string Use the assignment operator to assign an ASCII character to an element of the DATA member of a string tag To assign a character specify the value of the character or specify the tag name DATA member and element of the character For example This is OK This is not OK stringl DATA 0 65 stringl DATA 0 A stringl DATA 0 string2 DATA 0 stringl string2 To add or insert a string of characters to a string tag use either of these ASCII string instructions To Use This Instruction add characters to the end of a string CONCAT insert characters into a string INSERT Expressions An expression is a tag name equation or comparison To write an expression use any of the following tag name that stores the value variable number that you enter directly into the expression immediate value e functions such as ABS TRUNC operators such as gt And Or As you write expressions follow these general rules e Use any combination of upper case and lower case letter For example these three variations of AND are acceptable AND And and e For more complex requirements use parentheses to group expressions within expressions This makes the whole expression easier to read and ensures that the expression executes in the desire
310. ck Operand Type Format Description BNOT tag FBD_BOOLEAN_NOT structure BNOT structure FBD_BOOLEAN_NOT Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set In BOOL Input to the instruction Default is set Output Parameter Data Type Description EnableOut BOOL Enable output Out BOOL The output of the instruction Description The BNOT instruction complements a boolean input Arithmetic Status Flags Fault Conditions 326 Out NOT In not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Execution Condition Function Block Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example 1 This example complements boo _in and places the result in valwe_result_not Example 2 Publication 1756 RMOO3K EN P July 2008 If BOOL IN1 Is Then VALUE RESULT NOT Is 0 1 1 0 Structured Text value result not NOT bool inl Function Block BNOT 01 BNOT Fal
311. ck BOOL Combined alarm active and acknowledged status Set when any alarm condition is detected and unacknowledged Cleared when all alarm conditions are normal inactive acknowledged or both HHInAlarm BOOL High High alarm condition status Set when a High High condition exists Cleared when no High High condition exists HInAlarm BOOL High alarm condition status Set when a High condition exists Cleared when no High condition exists LInAlarm BOOL Low alarm condition status Set when a Low condition exists Cleared when no Low condition exists LLInAlarm BOOL Low Low alarm condition status Set when a Low Low condition exists Cleared when no Low Low condition exists ROCPosInAlarm BOOL Positive rate of change alarm condition status Set when a positive rate of change condition exists Cleared when no positive rate of change condition exists ROCNeglnAlarm BOOL Negative rate of change alarm condition status Set when a negative rate of change condition exists Cleared when no negative rate of change condition exists ROC REAL Calculated rate of change of the In value This value is updated when the instruction is scanned following each elapsed ROCPeriod The ROC value is used to evaluate the ROCPosInAlarm and ROCNeglnAlarm conditions ROC current sample of In previous sample of In ROCPeriod HHAcked BOOL High High condition acknowledged status Set when a High High condition is acknowledged Always set
312. cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition 4 To trigger a subsequent action when the instruction is done examine the EM bit Arithmetic Status Flags not affected Fault Conditions none 582 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction removes characters from the buffer and stores them in the destination The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan The rung condition out is set to false No action taken Example A bar code reader sends bar codes to the serial port channel 0 of the controller Each bar code contains 24 characters To determine when the controller receives a bar code the
313. compare LEN 0 the result POS 0 or the result LEN 0 The instruction stops executing until the program clears the ER bit LEN DINT The length value identifies the number of bits to compare POS DINT The position value identifies the current bit RESULT Structure Mnemonic Data Type Description DN BOOL The done bit is set when the Result array is full LEN DINT The length value identifies the number of storage locations in the Result array POS DINT The position value identifies the current position in the Result array Description When enabled the FBC instruction compares the bits in the Source array with IMPORTANT the bits in the Reference atray and records the bit number of each mismatch in the Result array You must test and confirm that the instruction doesn t change data that you don t want it to change The FBC instruction operates on contiguous memory In some cases the instruction searches or writes past the array into other members of the tag This happens if a length is too big and the tag is a user defined data type Publication 1756 RMOO3K EN P July 2008 The difference between the DDT and FBC instructions is that each time the DDT instruction finds a mismatch the instruction changes the reference bit to match the source bit The FBC instruction does not change the reference bit 479 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13
314. conds SSV MinInterval DINT 2 GSV The minimum time interval between successive executions of the task DINT 0 contains the lower 32 bits of the value DINT 1 SSV contains the upper 32 bits of the value A value of 0 indicates 1 or less executions of the task OverlapCount DINT GSV Number of times that the task was triggered while it was still executing Valid for an event or a periodic task SSV Publication 1756 RMOO3K EN P July 2008 To clear the count set the attribute to 0 195 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Attribute Data Type Instruction Description Priority INT GSV Relative priority of this task as compared to the other tasks SSV Valid values 1 15 Rate DINT GSV If the task type is Then the Rate attribute specifies the SSV ar r T periodic Period for the task Time is in microseconds event The timeout value for the task Time is in microseconds StartTime DINT 2 GSV Value of WALLCLOCKTIME when the last execution of the task was started DINT 0 contains the lower 32 bits of the value SSV DINT 1 contains the upper 32 bits of the value Status DINT GSV Provides status information about the task Once the controller sets one of these bits you must manually clear the bit d To determine if Examine this bit An EVNT instruction triggered 0 the task event task
315. converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL Structured Text ec Use the minus sign as an operator in an expression This expression changes the sign of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block Operand Type Format Description NEG tag FBD MATH ADVANCED structure NEG structure Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 FBD_MATH Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated default is set Source REAL Value to negate valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description If you negate a negative value the result is positive If you negate a positive Arithmetic Status Flags Fault Conditions Execution Condition prescan value the result is negative Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to f
316. count 0 gt gt _ POS POS 1 yes evaluate comparison no 88 3 yes EN bit is set DN bit is set a POS POS 1 FD bit is set ET rung condition out is set to true postscan The rung condition out is set to false 348 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 1 Search for a match between two arrays When enabled the FSC instruction compares each of the first 10 elements in array f to the corresponding Mode array 1 Expression elements in array_2 FSC File Search Compare Control Lenath Position amay 2 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000001111111111111111 00000000000000000000000000000000 11111111111111110000000000000000 11111111111111111111111111111111 11111111111111111111111111111111 1111111111111111111111111111111 11111111111111111111111111111111 11111111111111111111111111111111 11111111111111111111111
317. cted A Major Fault Will Occur If Fault Type Fault Code the routine type is not an SFC routine 4 85 specified target step does not exist in 4 89 the SFC routine Publication 1756 RMO03K EN P July 2008 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction resets the specified SFC routine The instruction resets the specified SFC routine postscan The rung condition out is set to false No action taken Example Ifa specific condition occurs shutdown is set restart the SFC at step initialize Relay Ladder shutdown SFR 4 SFC Reset SFC Routine Name mySFC Step Name initialize Structured Text IF shutdown THEN SFR mySFC initialize END IF Publication 1756 RMOO3K EN P July 2008 463 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP
318. ction but you can achieve the same results using structured text IF LowLimit lt HighLimit AND Test gt LowLimit AND Test lt HighLimit OR LowLimit gt HighLimit AND Test lt LowLimit OR Test gt HighLimit THEN lt statement gt END IF Publication 1756 RMOO3K EN P July 2008 231 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ E LIM 01 LIM Ea Limit Test CIRC LowLimit C HighLimit Dest Function Block Operand Type Format Description LIM tag FBD LIMIT structure LIM structure FBD LIMIT Structure Input Parameter Data Type Description Enableln BOOL If cleared the instruction does not execute and outputs are not updated If set the instruction executes as described under Execution Default is set LowLimit REAL Value of lower limit Valid any float Test REAL Value to test against limits Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder LIM instruction HighLimit REAL Value of upper limit Valid any float Description The LIM instruction tests whether the Test value is within the range of the Low Limit to the High Limit If Low Limit And Test Value Is T
319. ction execution The instruction converts the Source postscan The rung condition out is set to false No action taken Example When semp_high is set the DTOS instruction converts the value in msg_num to a string of ASCII characters and places the result in msg_num_ascii Subsequent rungs insert or concatenate msg_num_ascii with other strings to produce a complete message for a display terminal Relay Ladder temp_high DTOS DINT to String Source msg_num 23 Dest msg num ascii 23 Structured Text IF temp high THEN DTOS msg num msg num ascii temp high 0 END IF 620 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 REAL to String RTOS The RTOS instruction produces the ASCII representation of a REAL value Operands Relay Ladder RTOS Real to String Source Dest Operand Type Format Enter Notes Source REAL tag tag that contains the REAL value Destination string tag tag to store the ASCII value String data types are e default STRING data type e any new string data type that you create nus donus dai Structured Text The operands are the same as those for the relay ladder RTOS instruction Description The RTOS converts the Source to a string of ASCII characters and places the result in the
320. ctured Text Programming Use This Format valuel operator value2 For example Example For This Situation If gain_4 and gain 4 adj are DINT tags and your specification says Add 15 to gain 4and store the result in gain 4 adj You d Write gain 4 adj gain 4 15 If alarm and high alarm are DINT tags and your operator valuel specification says Negate high alarm and store the result in alarm alarm high alarm function numeric expression If overtravel and overtravel POS are DINT tags and your specification says Calculate the absolute value of overtravel and store the result in overtravel POS overtravel POS ABS overtravel valuel operator function value2 value3 2 666 If adjustment and position are DINT tags and sensor and sensor are REAL tags and your specification says Find the absolute value of the average of sensor and sensorZ add the position adjustment ABS sensorl sensor2 2 adjustment and store the result in position Use relational operators Relational operators compare two values or strings to provide a true or false result The result of a relational operation is a BOOL value If The Comparison Is The Result Is true 1 false 0 Use the following relational operators For This Comparison Use This Operator Optimal Data Type equal DINT REAL string less than lt DINT REAL string less than or equal
321. ctured text 297 relay ladder rearrange the bytes of a INT DINT or REAL tag SWPB relay ladder 299 structured text f There is no equivalent structured text instruction Use other structured text programming to achieve the same result See the description for the instruction Publication 1756 RMO03K EN P July 2008 281 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT The logical instructions perform operations on bits If you want to Use this instruction Available in these languages See page bitwise AND operation Bitwise AND relay ladder 303 gn structured text function block bitwise OR operation Bitwise OR relay ladder 306 structured text function block bitwise exclusive OR operation Bitwise XOR relay ladder 310 structured text function block bitwise NOT operation Bitwise NOT relay ladder 314 structured text function block logically AND as many as eight boolean inputs Boolean AND BAND structured text 317 function block logically OR as many as eight boolean inputs Boolean OR BOR structured text 320 function block perform an exclusive OR on two boolean inputs Boolean Exclusive OR structured text 323 BXOR function block complement a boolean input Boolean NOT BNOT structured text 326 1 Structured text only
322. d none Relay Ladder Action The rung condition out is set to false prescan rung condition in is false The rung condition out is set to false rung condition in is true postscan The controller calculates the tangent of the Source and places the result in the Destination The rung condition out is set to true The rung condition out is set to false Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group No action taken 527 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 528 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Relay Ladder TAN Tangent Source value 2 0943952 Dest result 1 7320507 Structured Text result TAN value Function Block value Example Calculate the tangent of value and place the result in result Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Arc Sine ASN The
323. d it adds value_1 to the current value of array 1 and stores the result in va se 2 The FAL instruction uses incremental mode so only one array value is added to va ue_1 each time the instruction is enabled The next time the instruction is enabled the instruction overwrites value 2 arithmetic operation element array to element FAL File Arith Logical N gt Control control_1 Lenath 10 N Position pe Mode inc R gt Dest value 2 g Expression value 1 array 1 control 1 pos Publication 1756 RMOO3K EN P July 2008 Expression Destination 343 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 8 When enabled the FAL instruction multiplies the current value of array_1 by the current value of array 2 and stores the result in va ue_1 The FAL instruction uses incremental mode so only one pair of array values is multiplied each time the instruction is enabled The next time the instruction is enabled the instruction overwrites va ze f arithmetic operation array array to element N5 x N E R3 1 Expression Destination FAL File Arith Logical Control control 1 Length 10 Position 0 Mode inc Dest value 1 g
324. d the DTR instruction masks ra ze 1 If there is a difference in the two values the rung condition out is set to true TR Data Transition Source Mask Reference example 1 example 2 ENSXEEXEE source mask OFFF PTET current scan current scan previous scan previous scan The rung remains false as long as the input The rung remains true for one scan when a value does not change change is detected 13385 A 0 in the mask leaves the bit unchanged 496 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Proportional Integral Derivative PID Special Instructions FBC DDT DTR PID Chapter 13 The PID instruction controls a process variable such as flow pressure temperature or level Operands Relay Ladder PID Proportional Integral Derivative PID enl Process Variable Tieback Control Variable PID Master Loop Inhold Bit Inhold Value Setpoint Process Variable Output Operand Type Format Description PID PID structure PID structure Process SINT tag value you want to control variable INT DINT REAL Tieback SINT immediate optional output of a hardware hand auto station which is bypassing the output of the controller INT tag Enter 0 if you don t want to use this parameter DINT REAL Control SINT tag value which goes to the fi
325. d 30 110001 Analog inputs 30 224001 30 214001 and 30 226000 Analog inputs 30 320000 30 233000 and 30 422001 Analog inputs 29 993000 30 345001 and 30 445399 Freeze Display Freeze Log Clear Display When this trace is logged to disk the characters before the colon appear in the traces Publication 1756 RM003K EN P July 2008 633 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 20 Debug Instructions BPT TPT This indicates which tracepoint caused which trace entry This is an example of a trace entry Analog inputs trace is the heading text from the tracepoint s format string Analog inputs trace Analog inputs 31 00201 30 282000 and 30 110001 634 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix A Common Attributes Introduction This appendix describes attributes that are common to the Logix instructions For Information About See Page Immediate Values 635 Data Conversions 635 Immediate Values Whenever you enter an immediate value constant in decimal format for example 2 3 the controller stores the value using 32 bits If you enter a value in a radix other than decimal such as binaty or hexadecimal and do not specify all 32 bits the controller places a zero in the bits that you do not specify zero fill
326. d sequence See Determine the order of execution on page 669 Publication 1756 RMOO3K EN P July 2008 663 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming In structured text you use two types of expressions BOOL expression An expression that produces either the BOOL value of 1 true or O false e A bool expression uses bool tags relational operators and logical operators to compare values or check if conditions are true or false For example tag1 gt 65 e A simple bool expression can be a single BOOL tag Typically you use bool expressions to condition the execution of other logic Numeric expression An expression that calculates an integer or floating point value A numeric exptession uses arithmetic operators arithmetic functions and bitwise operators For example tag1 5 Often you nest a numeric expression within a bool expression For example tag1 5 gt 65 Use the following table to choose operators for your expressions If You Want To Then Calculate an arithmetic value Use arithmetic operators and functions on page 665 Compare two values or strings Use relational operators on page 666 Check if conditions are true or false Use logical operators on page 668 Compare the bits within values Use bitwise operators on page 669 664 Publication 1756 RMOOS3K EN P July 2008 Artisan
327. dder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction searches for the specified characters postscan MV read EM 606 The rung condition out is set to false No action taken Example A message from a MessageView terminal contains several pieces of information The backslash character separates each piece of information To locate a piece of information the FIND instruction searches for the backslash character and records its position in f zd pos Relay Ladder FIN Find String Source MV msg 06324M12N1V r Search i Start Result Structured Text IF MV read EM THEN FIND MV msg find l find pos MV read EM 0 END IF Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Insert String INSERT ASCII String Instructions CONCAT DELETE FIND INSERT MID Chapter 18 The INSERT instruction adds ASCII characters to a specified location within a string Operands Relay Ladder INSERT Insert String Source A e Source B
328. delines 1 Configure the serial port of the controller for user mode 2 This is a transitional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction counts the characters in the buffer The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan The rung condition out is set to false No action taken Example Continuously count the characters in the buffer Relay Ladder bar code count EN ACB ASCII Chars in Buffer EN Channel 0 DN gt SerialPort Control bar code 2 Character Count Structured Text ACB 0 bar code count 574 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOU
329. dentified by JSR yes p return parameters no no u yes p RET copies return parameters to appropriate JSR tags yes end of subroutine p Y rung condition out is set to true rung condition out is set to false postscan Same action as prescan described above Same action as prescan described above 442 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run No action taken normal execution 1 If the routine contains an SBR instruction the controller first executes the SBR instruction 2 The controller latches all data values in IREFs 3 The controller executes the other function blocks in the order that is determined by their wiring This includes other JSR instructions 4 The controller writes outputs in OREFs 5 f the routine contains an RET instruction the controller executes the RET instruction last postscan The subroutine is called If the routine is an SFC routine the routine in initialized the same as it is during prescan Publication 1756 RMOOS3K EN P July 2008
330. der terminal read EM UPPER Upper Case Source catalog number abcd Dest catalog number upper case ABCD Structured Text IF terminal read EM THEN UPPER catalog number catalog number upper case terminal read EM 0 END IF 624 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 Lower Case LOWER The LOWER instruction converts the alphabetical characters in a string to lower case characters Operands LOWER Relay Ladder Lower Case Source Operand Type Format Description Source string tag tag that contains the characters that you want to convert to lower case Destination string tag tag to store the characters in lower case Structured Text cj LOWER Source Dest The operands are the same as those for the relay ladder LOWER instruction The LOWER instruction converts to lower case all the letters in the Source and places the result in the Destination Description e ASCII characters are case sensitive Upper case A 41 is not equal to lower case a 61 e If operators directly enter ASCII characters convert the characters to all upper case or all lower case before you compare them Any characters in the Source string that are not letters remain unchanged n
331. dgement ProgDisable BOOL Tag Value is copied to ProgDisable when instruction executes Immediate When set disables alarm does not override Enable Commands ProgEnable BOOL Tag Value is copied to ProgEnable when instruction executes Immediate When set enables alarm takes precedence over Disable commands HHlimit REAL Immediate Relay ladder only High High alarm limit HLimit REAL Immediate Relay ladder only High alarm limit LLimit REAL Immediate Relay ladder only Low alarm limit LLLimit REAL Immediate Relay ladder only Low Low alarm limit 42 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 ALMA ALMA ProgDisable Fd Publication 1756 RMOOS3K EN P July 2008 Year In ProgAckAll Progl ALMA 01 ALMA Analog Alarm gin HH InAl a m Hin Alam LIn Alam LLInAla m RO CPosInAl a m RO CNeglInAl am HHAcked HA cked LA cked LL Acked ROCP osAcked ROCNeg Acked Suppressed Enable HruUUJUUSJIWrTuTT TIT Uu O O 2 2 a ae me 2008057 000 0 0 Disabled p Structured Text The operands are the same as those for the relay ladder ALMD instruction with a few exceptions as indicated above Function Block Operand Format ALMA tag Description ALMA structure Type ALARM ANALOG Structure 43 Artisan Te
332. dition in is false The rung condition out is set to false rung condition in is true The controller calculates the cosine of the Source and places the result in the Destination The rung condition out is set to true The rung condition out is set to false postscan 524 Artisan Technology Group Publication 1756 RMO03K EN P July 2008 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example Calculate the cosine of value and place the result in result Relay Ladder Cos Cosine Source value 1 0471976 Dest result 05 Structured Text result COS value Function Block value X s via b result Publication 1756 RMOOSK EN P July 2008 525 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Tangent TAN The TAN instruction takes the tangent of the Source value in radians and stores the result in the Destination Operands Relay Ladder TAN Larae Op
333. divided by another structured text function block calculate the square root of a value SOR relay ladder 270 structured text SORT function block take the opposite sign of a value NEG relay ladder 274 structured text function block take the absolute value of a value ABS relay ladder 277 structured text function block f There is no equivalent structured text instruction Use other structured text programming to achieve the same result See the description for the instruction 2 B Structured text only Publication 1756 RMO03K EN P July 2008 There is no equivalent structured text instruction Use the operator in an expression You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the S V bit to see whether the result was truncated 247 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Compute CPT The CPT instruction performs the arithmetic operations you define in the expression Operands Relay Ladder CPT Compute Dest Operand Type Format Description Expression 1
334. ds Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Introduction Use the ASCII conversion instructions to alter the format of data If You Want To For Example Use This Available In These See Page Instruction Languages convert the ASCII representation of convert a value from a weight scale STOD relay ladder 614 an integer value to a SINT INT DINT or other ASCII device to an integer so or REAL value you can use it in your logic structured text convert the ASCII representation of a convert a value from a weight scale STOR relay ladder 616 floating point value to a REAL value or other ASCII device to a REAL value so you can use it in your logic structured text convert a SINT INT DINT or REAL convert a variable to an ASCII string DTOS relay ladder 619 value to a string of ASCII characters so you can send it to a MessageView terminal structured text convert a REAL value to a string of convert a variable to an ASCII string RTOS relay ladder 621 ASCII characters so you can send it to a MessageView terminal structured text convert the letters in a string of ASCII convert an entry made by an operator UPPER relay ladder 623 characters to upper case to all upper case so you can search for it in an array structured text convert the letters in a string of A
335. dule 1626000 Inhibited the MODULE object is inhibited the inhibit bit in the Mode attribute is set 1627000 Waiting the parent MODULE object upon which this MODULE object depends is not running FaultCode INT GSV A number which identifies a module fault if one occurs Faultlnfo DINT GSV Provides specific information about the MODULE object fault code ForceStatus INT GSV Specifies the status of forces Bit Meaning 0 forces installed 1 yes 0 no 1 forces enabled 1 yes 0 no 2 15 not used Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Attribute Data Type Instruction Description Instance DINT GSV Provides the instance number of this MODULE object LEDStatus INT GSV Specifies the current state of the 1 0 LED on the front of the controller Value Meaning 0 LED off No MODULE objects are configured for the controller there are no modules in the 1 0 Configuration section of the controller organizer 1 Flashing red None of the MODULE objects are Running 2 Flashing green At least one MODULE object is not Running 3 Solid green All the Module objects are Running Note You do not enter an object name with this attribute because this attribute applies to the entire collection of modules Mode INT GSV Specifies the current mode of the MODULE object SSV Bit
336. e Itwise P P g A and Source B and places the result in the Destination To perform a logical OR see page 320 Operands Relay Ladder OR Bitwise Inclusive OR Source 4 Operand Type Format Description Source B 9 Source A SINT immediate value to OR with Source B Dest INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Source B SINT immediate value to OR with Source A INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT E Structured Text dest A OR B 9 ides Prem Use OR as an operator within an expression This expression evaluates sourceA OR sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text OR 01 Function Block Bitwise Inclusive OR Operand Type Format Description eaa OR tag FBD LOGICAL structure OR structure SourceB 306 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 FBD LOGICAL Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA DINT Value to OR with SourceB Valid any integer SourceB DINT Value to OR w
337. e at the end of the array and it does not contain a carriage return 8 Go to 3 Publication 1756 RMOO3K EN P July 2008 683 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming REPEAT UNTIL Use the REPEAT UNTIL loop to keep doing something until conditions ate true Operands Structured Text REPEAT statement Sperand tpe Format Enter UNTIL bool expression bool BOOL tag BOOL tag or expression that evaluates to a expression a BOOL value BOOL expression E expression IMPORTANT Make sure that you do not iterate within the loop too many times in a single scan The controller does not execute any other statements in the routine until it completes the loop e If the time that it takes to complete the loop is greater than the watchdog timer for the task a major fault occurs Consider using a different construct such as IE THEN Description The syntax is REPEAT statement a statements to execute while bool expression is false As DOOL ExoeesSaoia2 WAIN EXIT a f there are conditions when you want to optional exit the loop early use other statements END IF such as an IF THEN construct to condition an EXIT statement UNTIL bool expressionl END REPEAT 684 Publicat
338. e 0 65 535 Delay in counts of 20 msec periods The default is 5 periods 100 msec StationAddress INT GSV Current station address of the serial port Valid value 0 254 Default is 0 SlavePollTimeout DINT GSV The amount of time in msecs that the slave waits for the master to poll before the slave declares that it is unable to transmit because the master is inactive slave only Valid value 0 32 767 Delay in counts of 20 msec periods The default is 3000 periods 1 minute TransmitRetries SINT GSV Number of times to resend a message without getting an acknowledgment master and slave only Valid value 0 127 Default is 3 PendingACKTimeout DINT Publication 1756 RMOO3K EN P July 2008 SSV Pending value for the ACKTimeout attribute 185 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT PendingEmbeddedResponse SINT SSV Pending value for the EmbeddedResponse attribute Enable PendingENOTransmitLimit SINT SSV Pending value for the ENOTransmitLimit attribute PendingEOT Suppression SINT SSV Pending value for the EOTSuppression attribute PendingErrorDetection SINT SSV Pending value for the ErrorDetection attribute PendingNormalPollGroupSize INT SSV Pending value for the NormalPollGroupSize attribute PendingMasterMes
339. e 1 value 2 O SourceB Publication 1756 RMOO3K EN P July 2008 313 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Bitwise NOT NOT The NOT instruction performs a bitwise NOT operation using the bits in the Source and places the result in the Destination To perform a logical NOT see page 326 Operands Relay Ladder NOT Bitwise NOT Operand Type Format Description Source Source SINT immediate value to NOT INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT E Structured Text dest NOT ens Use NOT as an operator within an expression This expression evaluates NOT SOUrCE See Appendix C Structured Text Programming for information on the syntax of expressions within structured text NOT_o1 Function Block Bikass HOT Operand Type Format Description NOT tag FBD_LOGICAL structure NOT structure 314 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 FBD LOGICAL Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the
340. e Format Description Format String tag A string that sets the formatting for the trace reports both on screen and logged to disk Trace This BOOL SINT tag The tag you want to trace INT DINT OOO OPA Tracepoints are programmed with the tracepoint output instruction TPT When the inputs on a rung containing a TPT instruction are true the TPT instruction writes a trace entry to a trace display or log file You can trace many tags with the TPT instruction However the formatting string can contain only 82 characters Because the formatting string requires two characters for each tag you want to trace you cannot trace more than 41 tags with a single TPT instruction However to separate tag data in your traces you will need to include spaces and other formatting thus reducing the number of tags that one TPT instruction can effectively trace to far fewer than 41 String Format With the Format string in the tracepoint and breakpoint instructions you can control how the traced tags appear in the traces or breakpoint windows The format of the string is as shown here heading text type where beading is a text string identifying the tracepoint or breakpoint exzis a string describing the tag or any other text you choose and V o ype indicates the format of the tag You need one type indicator fort each tag you are tracing with the tracepoint or breakpoint instruction For example you could format a tracepoint string as show
341. e Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example When enabled the AND instruction performs a bitwise AND operation on SourceA SourceB Dest Publication 1756 RMOO3K EN P July 2008 SourceA and SourceB and places the result in the Dest Relay Ladder AND Bitwize AMD Source A value 1 H0000 ann aaa aro 1O1 OTCT 1111 1111 Source B value 2 H0000_0000_0000_1177_1111_0000_0000_0000 Dest value result and HO000_0000_0000_0701_0701_0000_0000_0000 Structured Text value result and value 1 AND value 2 Function Block AND 01 AND Bitwise AND C SourceA 0 value result and value 2 m 305 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT itwi The OR instruction performs a bitwise OR operation using the bits in Sourc
342. e alarm instruction clears this parameter Default is cleared HHProgAck BOOL High High program acknowledge Set by the user program to acknowledge a High High condition Requires a cleared to set transition while the alarm condition is unacknowledged Default is cleared HHOperAck BOOL High High operator acknowledge Set by the operator interface to acknowledge a High High condition Requires a cleared to set transition while the alarm condition is unacknowledged The alarm instruction clears this parameter Default is cleared HProgAck BOOL High program acknowledge Set by the user program to acknowledge a High condition Requires a cleared to set transition while the alarm condition is unacknowledged Default is cleared HOperAck BOOL High operator acknowledge Set by the operator interface to acknowledge a High condition Requires a cleared to set transition while the alarm condition is Unacknowledged The alarm instruction clears this parameter Default is cleared LProgAck BOOL Low program acknowledge Set by the user program to acknowledge a Low condition Requires a cleared to set transition while the alarm condition is unacknowledged Default is cleared LOperAck BOOL Low operator acknowledge Set by the operator interface to acknowledge a Low condition Requires a cleared to set transition while the alarm condition is unacknowledged The alarm instruction clears this parameter Default is cleared Publication 1756 RMOOS3K EN P J
343. e changes occut the alarm instructions in the controller cache the necessary information such as timestamps and associated tag values and request the transmission of the alarm message to all of the subscribers The publisher mechanism delivers the alarm messages to each subscriber as quickly as possible If any subscriber fails to confirm receipt of the alarm message or if the connection to a known subscriber is not good the publisher mechanism stores the undelivered alarm messages in a 100 KB buffer Each subscriber has its own buffer so communication problems with one subscriber do not interfere with alarm delivery to other subscribers When the buffer is full newer alarm messages are discarded The buffer is created when the subscriber establishes its initial connection and is maintained for a configurable length of time 0 120 minutes default is 20 minutes after a subscriber loses its connection When the subscriber re establishes a connection within the buffer timeout interval it obtains the current state of all alarms begins to receive current alarm messages and also uploads any buffered messages that may have accumulated Even if the buffer was full and messages were discarded the 69 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Programmatically Access Alarm Information subscriber
344. e characters Publication 1756 RMOO3K EN P July 2008 613 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER String To DINT STOD The STOD instruction converts the ASCII representation of an integer to an integer or REAL value Operands Relay Ladder STOD String To DINT Source Dest E Operand Type Format Enter Notes Source string tag tag that contains the value String data types are in ASCII e default STRING data type e any new string data type that you create Destination SINT tag tag to store the integer If the Source value is a floating point number value the instruction converts only the non fractional INT part of the number regardless of the destination data type DINT REAL MONT Structured Text The operands are the same as those for the relay ladder STOD instruction Description The STOD converts the Source to an integer and places the result in the Destination e The instruction converts positive and negative numbers e If the Source string contains non numeric characters the STOD converts the first set of contiguous numbers The instruction skips any initial control or non numeric characters except the minus sign in front of a number If the string contains multiple groups of numbers that are separated by delimiters for example the instruction co
345. e process vatiable remains in the deadband the output will not change The deadband extends above and below the setpoint by the value you specify Enter zero to inhibit the deadband The deadband has the same scaled units as the setpoint You can use the deadband without the zero crossing feature by selecting the no zero crossing for deadband option on the Configuration tab ot set the NOZC bit in the PID structure If you are using the deadband the Control variable must be REAL or it will be forced to 0 when the error is within the deadband Use Output Limiting You can set an output limit percentage of output on the control output When the instruction detects that the output has reached a limit it sets an alarm bit and prevents the output from exceeding either the lower or upper limit Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Feedforward or Output Biasing You can feedforward a disturbance from the system by feeding the BIAS value into the PID instruction s feedforward bias value The feedforward value represents a disturbance fed into the PID instruction before the disturbance has a chance to change the process variable Feedforward is often used to control processes with a transportation lag For example a feedforward value representing cold water poured into a w
346. e scanned 117 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES After it updates the ACC the timer sets ast time scanned current time This gets the timer ready for the next scan IMPORTANT Make sure to scan the timer at least every 69 minutes while it runs Otherwise the ACC value won t be correct The last_time_scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minutes if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan EN TT and DN are cleared EN TT and DN are cleared ACC value is set to 0 instruction first run EN TT and DN are cleared ACC value is set to 0 ACC value is set to 0 EN TT and DN are cleared ACC value is set to 0 na Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated Enableln is
347. e specified parameters to the calling routine The rung condition out is set to true postscan The rung condition out is set to false 474 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com For Break Instructions FOR FOR DO BRK EXIT RET Chapter 12 Example The FOR instruction repeatedly executes routine_2 and increments value_2 by 1 each time When value_2 is gt 10 or a BRK instruction is enabled the FOR instruction no longer executes routine_2 The RET instruction returns to the calling FOR instruction The FOR instruction either executes the subroutine again and increments the Index value by the Step size or if the Index value exceeds the Terminal value the FOR instruction is complete and execution moves on to the instruction that follows the FOR instruction calling routine subroutine FOR RET For lt _ lt Return Routine name routine 2 Index value 2 Initial value D Terminal value 10 Step size 1 Publication 1756 RMO03K EN P July 2008 415 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 12 For Break Instructions FOR FOR DO BRK EXIT RET Notes 476 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Cha
348. e that you never miss a sample You could even place the PID logic in a continuous task as long as you make sure that the logic would be updated more frequently than once every 250 milliseconds An example of the RTS method of execution is shown below The execution of the PID instruction depends on receiving new analog input data If the analog input module fails or is removed the controller stops receiving rolling timestamps and the PID loop stops executing You should monitor the status bit of the PV analog input and if it shows bad status force the loop into software manual mode and execute the loop every scan This lets operator still manually change the output of the PID loop Relay Ladder PID Proportional Integral Derivative Source Locat I RolingTimestamp PID TIC101 t n Source B Local 0 l ChOF ault Publication 1756 RMOO3K EN P July 2008 Process variable Local 0 l Ch D ata PreviousT imestamp Tieback Local 0 1 Ch1Data 0 Control variable Local 1 0 Ch0Data PID Master Loop 0 TIC101 5wM Inhold bit Local 1 I ChOlnHold Inhold Value Local1 ChOD ata Setpoint 0 0 Process Variable 0 0 Output 0 0 Move Source Local 0 RollingTimestamp p Dest PreviousTimestamp p 511 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 512 Special Instructions FBC DDT DTR PID Structured Text IF Local 0 I ChO0Fault THEN TIC101 S
349. ed Fault Conditions none Publication 1756 RMOO3K EN P July 2008 129 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Execution Condition Relay Ladder Action prescan The CU bit is set to prevent invalid increments during the first program scan The rung condition out is set to false rung condition in is false The CU bit is cleared The rung condition out is set to false rung condition in is true it CU bit is set examine CU bit ease T ACC value rolls over ACC ACC 1 CU bit 1 Y examine UN bit s LUN bit 1 examine OV bit UN bit is cleared DN bit is cleared OV bit 0 OV bit 1 examine ACC ACC lt PRE LUN bit 1 ACC gt PRE examine UN bit OV bit is set DN bit is cleared DN bit is set Y Er true rung condition out is set to postscan 130 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example After it_switch_1 goes from disabled to enabled 10
350. ed in the DINT destination Relay Ladder DIN MOY Divide Move Source dint_a Source real temp 5e 1 6666666 Dest divide result rounded Source B dint b e 2 Dest real temp 1 6666666 43008 Publication 1756 RMOO3K EN P July 2008 265 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 Modulo MOD Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS The MOD instruction divides Source A by Source B and places the remainder in the Destination Operands oD Relay Ladder Modulo Source A Operand Type Format Description Source B Source A SINT immediate value of the dividend Dest INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Source B SINT immediate value of the divisor INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination dest sourceA MOD sourceB SINT tag tag to store the result INT DINT REAL Structured Text Use MOD as an operator in an expression This expression divides sourceA by sourceB and stores the remainder in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text MOD 01 MOD m Operand MOD tag Modulo O SourceA Dest D SourceB 266 Function Block Format Description
351. ed text When enabled and the storage bit is cleared the ONS instruction enables the remainder of the rung When disabled or when the storage bit is set the ONS instruction disables the remainder of the rung not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Execution Condition prescan Relay Ladder Action The storage bit is set to prevent an invalid trigger during the first scan The rung condition out is set to false rung condition in is false The storage bit is cleared The rung condition out is set to false rung condition in is true examine storage bit storage bit storage bit remains set storage bit 0 storage bit is set rung condition out is rung condition out is set gt Y postscan Example Publication 1756 RMOO3K EN P July 2008 The storage bit is cleared The rung condition out is set to false You typically precede the ONS instruction with an input instruction because you scan the ONS instruction when it is enabled and when it is disabled for it to operate correctly Once the ONS instruction is enabled the rung condition in must go clear or the storage bit must be cleared for the ONS instruction to be enabled again 89
352. eed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Attribute Data Type Instruction Description PendingDataBits SINT SSV Pending value for the DataBits attribute PendingParity SINT SSV Pending value for the Parity attribute PendingRTSOffDelay INT SSV Pending value for the RTSOffDelay attribute PendingRTSSendDelay INT SSV Pending value for the RTSSendDelay attribute PendingStopBits SINT SSV Pending value for the StopBits attribute To apply values for any of the SERIALPORT pending attributes 1 Use an SSV instruction to set the value for the pending attribute You can set as many pending attributes as you want using an SSV instruction for each pending attribute 2 Use a MSG instruction to apply the value The MSG instruction applies every pending attribute you set Configure the MSG instructions as MSG Configuration Tab Field Value Configuration Message Type CIP Generic Service Code Od hex Object Type 6f hex Object ID 1 Object Attribute leave blank Source leave blank Number of Elements 0 Destination leave blank Communication Path communication path to self 1 5 where s slot number of controller 194 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Access The TASK Object The TASK object provides st
353. ember has 24 elements The string structure has a user specified length of 24 Relay Ladder SIZE Size in Elements Source strings a 0 DATA O 00 Dim To Vary 0 Size data size a 24 Structured Text SIZE strings a 0 DATA 0 0 data size a Publication 1756 RMOO3K EN P July 2008 383 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Notes 384 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Introduction Use the array file shift instructions to modify the location of data within arrays If You Want To Use This Instruction Available In These Languages See Page Load bits into shift bits through and unload BSL relay ladder 386 bits from a bit array one bit at a time BSR relay ladder 390 Load and unload values in the same order FFL relay ladder 394 FFU relay ladder 400 Load and unload values in reverse order LFL relay ladder 406 LFU relay ladder 412 Publication 1756 RMO03K EN P July 2008 You can mix data types but loss of accuracy and rounding errors might occur For relay ladder instructions bold data types indicate optimal data types An instruction executes faster a
354. en enabled the LFL instruction loads zz se 1 into the next position in the LIFO which is array dnt 5 in this example LFL LIFO Load N Source value 1 No LIFO array_dint 0 EM5 Control control 1 Length 10 5 Position before LIFO load after LIFO load array dint O 00000 00000 mmo 1111 22222 22222 33333 control 1 pos 5 33333 44444 value 1 55555 44444 array dint 5 00000 p 55555 00000 00000 control 1 pos 6 00000 00000 00000 00000 00000 00000 Publication 1756 RMOO3K EN P July 2008 411 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU LIFO Unload LFU Operands LFU LIFO Unload LIFO Dest Control Lenath Position Us NS MS 412 Relay Ladder Type Format SINT array tag INT DINT REAL string structure The LFU instruction unloads the value at POS of the LIFO and stores 0 in Description LIFO to modify specify the first element of the LIFO do not use CONTROL POS in the subscript SINT tag INT DINT REAL string structure value that exits the LIFO The Destination value converts to the data type of the Destination tag A smaller integer converts to a larger integer by sign extension CONTROL tag control structure for the operation typ
355. en the instruction generates an overflow The instruction stops executing until the program clears the ER bit The position of the element that caused the overflow is stored in the POS value LEN DINT The length specifies the number of elements in the array on which the instruction operates POS DINT 1 The position contains the position of the current element that the instruction is accessing Publication 1756 RMOO3K EN P July 2008 315 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Structured Text Es Structured text does not have an STD instruction but you can achieve the same results using a SIZE instruction and a FOR DO or other loop construct SIZE array 0 length sum 0 FOR position 0 TO length 1 DO sum sum array position END FOR average sum length sum 0 FOR position 0 TO length 1 DO sum sum array position average 2 END FOR destination SQRT sum length 1 See Appendix C Structured Text Programming for information on the syntax of constructs within structured text Description The standard deviation is calculated according to this formula N 2 ZK X start i AVE j Standard Deviation N 1 Where start dimension to vary subscript of the array operand x variab
356. enabled the NOP instruction performs no operation When disabled the NOP instruction performs no operation Arithmetic Status Flags no affected Fault Conditions none Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The rung condition out is set to true postscan The rung condition out is set to false Example This instruction is useful for locating unconditional branches when you place the NOP instruction on the branch The NOP instruction bypasses the XIC instruction to enable the output limit switch 1 light 1 Publication 1756 RMOO3K EN P July 2008 457 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT End of Transition EOT Operands EOT data bit Description Arithmetic Status Flags Fault Conditions The EOT instruction returns a boolean state to an SFC transition Relay Ladder Operand Type Format Description data bit BOOL tag state of the transition O executing 1 completed Structured Text The operands are the same as those for the relay ladder EOT instruction Because the EOT instruction returns a boolean state multiple SFC routines can share the same routine that co
357. entive Timer On B DO uasa oos dace s eae yo a 112 Timer On Delay with Reset TONR ens evacces ER RERO ewes 116 Timer Off Delay with Reset TOPR cijseecdadivwtsas er RR 120 Retentive Timer On with Reset RIOR iius ka 124 Count Up CIL usas esuada eres DR RA RR ARR awe EORR RU 128 Count Down GIL ue serene ea dei pete oe d eoe erar pees 132 Count Up Down CTUD equat ea ce o GR C 136 Reset RES ovas pps Uim da tube ices eu pda debeas 141 Chapter 4 icono O 143 Message MSG cosas pecans Cr a an kani waned ERE WA kd 144 MSG Error Codes aseo ur acte enset at a wae eee ea 152 Biror CodeS arag net T ER 152 Extended Mier Codes ieee eit ERE PRESE Ee 154 PLC and SLC Error Codes ERR 23 dua e bebe 156 Block Transfer Error Codes cecgaecica acoso ase nn 158 Specify the Configuration Details 22a ce reb cech 159 Specify CIP Data Table Read and Write messages 160 Reconfigure an I O module iet tea d eee aer 161 Specify CIP Generic messages seres re dry ERN ERR Y 162 Specify PLUS messages a osos bb eee brake vdd nda 163 Specify SLC meseapes 42x o ad eee aed nb SCC EU 165 Specify block transfer messages ce een 165 Specify PLC 3 m ssages o hc d teehee a Ro dede acd 166 Specify PLU messages 5 i424 tind pan ae Sore eoe dca eia 167 MSG Configuration Examples 14er eere 168 Specify the Communication Details 12442 de sor rr in ns 169 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Inst
358. equal to the DATA size of the Source Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction deletes the specified characters postscan The rung condition out is set to false No action taken Example ASCII information from a terminal contains a header character After the controller reads the data Zerz read EM is set the DELETE instruction removes the header character Relay Ladder term_read EM DELETE String Delete Source term input 0655 Qty 1 Start Dest term text 55 Structured Text IF term read EM THEN DELETE term input l l term text term read EM 0 END IF 604 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Find String FIND ASCII String Instructions CONCAT DELETE FIND INSERT MID Chapter 18 The FIND instruction locates the starting position of a specified string within another string Operands Relay Ladder E FIND Find String Source Search Start Result Operand Type Format
359. er Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of the conversion instruction Arithmetic status flags are set for this output Description The FRD instruction converts a BCD value Source to a decimal value and Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group stores the result in the Destination Arithmetic status flags ate affected none 559 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller converts the Source to a decimal value and places the result in the Destination The rung condition out is set to true postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken 560 Example The FRD instruction converts za ze a to a decimal value and places the result in result f Relay Ladder F
360. er is a carriage return r which marks the end of the message Relay Ladder AWT ASCII Write EN Channel 0 Source string 2 ND 142224 01 r SerialPort Control temp_low_write SerialPort Control Length 9 Characters Sent 9 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 Structured Text osri l InputBit temp low OSRI osri 1 IF osri_1 OutputBit THEN temp low write LEN 9 AWT O string 2 temp low write END IF Example 2 When MV zpdateis set the AWT instruction sends the characters in MV_msg Because the number of characters in MV_masg varies the rung first moves the length of the string MI ze LEN to the Serial Port Control Length of the AWT instruction MV_write LEN In MV sg the 16 counts as one character It is the hex code for the Ctrl V character Relay Ladder MV update MOV AWT Move ASCII Write EN Source MV msg LEN Channel 0 10 Source MV msg DND Dest MV_write LEN 161365 8 1 r 10 SerialPort Control MV_write ER gt SerialPort Control Length 10 Characters Sent 10 Structured Text osri l InputBit MV update OSRI osri 1 IF osri l OutputBit THEN MV write LEN Mv msg LEN AWT 0 MV msg MV write END IF Publicat
361. er task can CPS instruction see ControlLogix overwrite System User Manual publication 1756 UM001 allow the data to change during the COP copy operation none of the above pe COP ATTENTION A IMPORTANT Arithmetic Status Flags Fault Conditions 356 The number of bytes copied is Byte Count Length number of bytes in the Destination data type If the byte count is greater than the length of the Source unpredictable data is copied for the remaining elements You musttest and confirm that the instruction doesn t change data that you don t want it to change The COP and CPS instructions operate on contiguous memory They do a straight byte to byte memory copy In some cases they write past the array into other members of the tag This happens if the length is too big and the tag is a user defined data type If The Tag Is Then user defined data type If the Length is too big the instruction writes past the end of the array into other members of the tag It stops at the end of the tag No major fault is generated NOT user defined data type If the Length is too big the instruction stops at the end of the array No major fault is generated The Length is too big if it is more than the total number of elements in the Destination array not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
362. er then rolls over to 2 147 483 648 and begins counting up again UN BOOL The underflow bit indicates that the counter exceeded the lower limit of 2 147 483 648 The counter then rolls over to 2 147 483 647 and begins counting down again PRE DINT The preset value specifies the value which the accumulated value must reach before the instruction sets the DN bit ACC DINT The accumulated value specifies the number of transitions the instruction has counted 132 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Description The CTD instruction is typically used with a CTU instruction that references the same counter structure When enabled and the CD bit is cleared the CTD instruction decrements the counter by one When enabled and the CD bit is set or when disabled the CTD instruction retains its ACC value rung condition in count down enable bit CD count down done bit DN counter accumulated value ACC preset 5555 16637 The accumulated value continues decrementing even after the DN bit is set To clear the accumulated value use a RES instruction that references the counter structure or write 0 to the accumulated value
363. era GS I e p Edere 250 Format Expressions psa weds a p DER RU adole es 250 Determine the order of operatioB sisters Seba debe Rs 251 Add ADD ETE 252 Subtract SUB s erus qr doe REESE Y dicke dob Lite A 255 Mu l ply MUL use e d CRY SE aod obe eR E e ath a ee Eee 258 Divide DTV Saepe e dr iced OR RE RA RE eb Rae AER EORR 261 Modelo MOD 2 ics aed decidere sede e quede d Cd ard detecte 266 oguars Roof 50 IU ua sordo oa ti MR OE ADI AE B C OC eR A ER 270 Negate NEG 61454 sk RE TERRACE REG GCON FOROR RACER ee s 274 Absolute Value ABS aaa uaa doa a aoo e Y dodo ye 277 Chapter 7 Totroduc ti i eeir iad On e C a E n E a a e 281 Mose MOY acia eoe erker ee aeea a e d etr 283 Masked Move MVM ss e udekcedalu 3ORR oe aqoa e d eq X OA Eee 285 Enter an immediate mask value 42252 usau 4E EE A 286 Masked Move with Target MVMT cesses 288 Bit Field Distribute BTD siad i kde RES Rd REOR dr 29 Bit Field Distribute with Target BTDT cese 294 Clear CLR TET 297 Swap Byte SWP B Jereerisssrec einioes banned oE ke enia 299 Bitwise AND AND aus d iecore a o dde ode do a aera de 303 Bitwise OR COR iode suckiucb as seeding elas bead dada dcithausd 306 Bitwise Exclusive OR XOR i aic doa Oe CR Ra e d 310 Bitwise NOT NOT eda apap ah dua er Ker ERR eed Rb RES 314 Boolean AND BAND ois gpu ua So dad iet eee cde dede bag d 317 Boolean OR BOR Voss cate dra ERO Y AGE Gea tens baw ek ee Rd 320 Boolean Exclusive OR BXOBR cc
364. erand Type Format Description iad Source SINT immediate find the tangent of this value INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest TAN source Use TAN as a function This function computes the tangent of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text st TAN 04 Function Block TAN En Tangani Operand Type Format Description TAN tag FBD_MATH_ADVANCED structure TAN structure 526 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The Source must be greater than or equal to 102943 7 2nx2 and less than Arithmetic Status Flags Fault Conditions Execution E Condition or equal to 102943 7 2nx2 Arithmetic status flags are affecte
365. eration Length ER Position Length DINT immediate number of elements in the array to Mode be manipulated Expression Position DINT immediate offset into array initial value is typically 0 CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the FSC instruction is enabled DN BOOL The done bit is set when the instruction has operated on the last element POS LEN ER BOOL The error bit is not modified IN BOOL The inhibit bit indicates that the FSC instruction detected a true comparison You must clear this bit to continue the search operation FD BOOL The found bit indicates that the FSC instruction detected a true comparison LEN DINT The length specifies the number of elements in the array on which the instruction operates POS DINT The position contains the position of the current element that the instruction is accessing Description When the FSC instruction is enabled and the comparison is true the instruction sets the FD bit and the POS bit reflects the array position where the instruction found the true comparison The instruction sets the IN bit to prevent further searching Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code POS lt 0 or LEN lt 0 4 21 346 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg co
366. ers termination characters structured text count the characters in the buffer check for the required number of ACB relay ladder 573 characters before reading the buffer structured text clear the buffer e remove old data from the buffer at ACL relay ladder 575 l start up clear out ASCII Serial Port instructions that are currently e synchronize the buffer with a SEIU executing or are in the queue device obtain the status of the serial port cause a modem to hang up AHL relay ladder 577 control lines turn on or off the DTR signal Strciureai text turn on or off the RTS signal read a fixed number of characters read data from a device that sends ARD relay ladder 581 the same number of characters each transmission structured text read a varying number of characters read data from a device that sends a ARL relay ladder 585 up to and including the first set of varying number of characters each termination characters transmission structured text send characters and automatically send messages that always use the AWA relay ladder 589 append one or two additional same termination character s characters to mark the end of the structured text data send characters send messages that use a variety of AWT relay ladder 594 termination characters structured text Publication 1756 RM003K EN P July 2008 565 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB
367. erty Message Type Input Output Instructions MSG GSV SSV IOT Chapter 4 Type Or Select CIP Generic Service Type Select which alarm that you want to unlatch e Unlatch All Alarms I e Unlatch Analog High Alarm I e Unlatch Analog High High Alarm I e Unlatch Analog Low Alarm I e Unlatch Analog Low Low Alarm I e Unlatch Rate Alarm I Instance Channel of the alarm that you want to unlatch Unlatch the alarm of an analog output module Select This Command Message Type CIP Generic Service Type Select which alarm that you want to unlatch e Unlatch All Alarms 0 e Unlatch High Alarm 0 e Unlatch Low Alarm 0 e Unlatch Ramp Alarm 0 Instance Channel of the alarm that you want to unlatch Specify PLC 5 messages Use the PLC 5 message types to communicate with PLC 5 controllers If You Want To PLC5 Typed Read PLC5 Typed Write Read 16 bit integer floating point or string type data and maintain data integrity See Data types for PLC5 Typed Read and Typed Write messages on page 164 Write 16 bit integer floating point or string type data and maintain data integrity See Data types for PLC5 Typed Read and Typed Write messages on page 164 PLC5 Word Range Read Read a contiguous range of 16 bit words in PLC 5 memory regardless of data type This command starts at the address specified as the Source Element and reads sequentially the number of 16 b
368. es if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action prescan No action taken instruction first scan EN TT and DN are cleared ACC value is not modified Structured Text Action No action taken EN TT and DN are cleared ACC value is not modified instruction first run EN TT and DN are cleared ACC value is not modified Enableln is cleared EnableOut is cleared the instruction does nothing and the outputs are not updated EN TT and DN are cleared ACC value is not modified na Enableln is set Function Block When Enableln transitions from cleared to set the instruction initializes as described for instruction first scan The instruction executes EnableOut is set Enableln is always set The instruction executes reset When the Reset input parameter is set the When the Reset input parameter is set the instruction clears EN TT and DN and sets instruction clears EN TT and DN and sets ACC zero ACC zero postscan No action taken No action taken 126 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR
369. es not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 ROCNegLimit REAL Limit for a decreasing rate of change in units per second Detection is enabled for any value gt 0 0 if ROCPeriod is also gt 0 0 Valid 0 0 maximum possible float Default 0 0 ROCNegseverity DINT Severity of the decreasing rate of change condition This does not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 ROCPeriod REAL Time period in seconds for calculation sampling interval of the rate of change value Each time the sampling interval expires a new sample of In is stored and ROC is recalculated Rate of change detection is enabled for any value gt 0 0 Valid 0 0 maximum possible float Default 0 0 Publication 1756 RMOOS3K EN P July 2008 Year 49 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Output Parameter Data Type Description EnableOut BOOL Enable output InAlarm BOOL Alarm active status Set when any alarm condition is active Cleared when all alarm conditions are not active normal status AnylnAlarmUna
370. es the next instruction the rung condition out is true Relay Ladder 2l Fo Structured Text IF S V THEN statement END IF Publication 1756 RMOO3K EN P July 2008 79 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Examine If Open XIO Operands Description Arithmetic Status Flags Fault Conditions Execution Condition prescan rung condition in is false The XIO instruction examines the data bit to see if it is cleared Relay Ladder Operand Type Format Description data bit BOOL tag bit to be tested Structured Text Structured text does not have an XIO instruction but you can achieve the same results using an IE THEN construct IF NOT data bit THEN statement END IF See Appendix 641B Function Block Attributes for information on the syntax of constructs within structured text The XIO instruction examines the data bit to see if it is cleared not affected none Relay Ladder Action The rung condition out is set to false The rung condition out is set to false rung condition in is true i examine data bit data bit 1 rung condition out is set data bit 0 rung condition out is set to true tofalse postscan 80 gt Y The rung condition out is se
371. essor cannot put requested information in packets OOFO 000B FO0B Privilege error access denied OOFO 000C FOOC Requested function is not available OOFO 000D FOOD Request is redundant OOFO 000E FOOE Command cannot be executed OOFO 000F FOOF Overflow histogram overflow OOFO 0010 F010 No access OOFO 0011 F011 Data type requested does not match data available OOFO 0012 F012 Incorrect command parameters OOFO 0013 F013 Address reference exists to deleted area OOFO 0014 F014 Command execution failure for unknown reason PLC 3 histogram overflow OOFO 0015 F015 Data conversion error OOFO 0016 F016 The scanner is not available to communicate with a 1771 rack adapter OOFO 0017 F017 The adapter is no available to communicate with the module OOFO 0018 F018 The 1771 module response was not valid OOFO 0019 F019 Duplicate label OOFO 001A F01A File owner active the file is being used OOFO 001B F01B Program owner active someone is downloading or editing online OOFO 001C F01C Disk file is write protected or otherwise not accessible offline only OOFO 001D F01D Disk file is being used by another application Publication 1756 RMOO3K EN P July 2008 Update not performed offline only 157 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Block Transfer Error Codes These are the Logix5000 block transfer specific error codes
372. esult of the conversion instruction Arithmetic status flags are set for this output Description The DEG instruction uses this algorithm Arithmetic Status Flags Fault Conditions Execution Condition prescan Source 180 T where m 3 141593 Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller converts the Source to degrees and places the result in the Destination The rung condition out is set to true postscan Condition prescan instruction first scan The rung condition out is set to false Function Block Action No action taken No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set postscan The instruction executes EnableOut is set No action taken Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group 551 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC 552 Example Convert value to degrees and place the result in result Relay Ladder EG Radians To Degrees Source value 150 Dest result 859 43671 Structured Text result DEG value Function Block DEG 01 DEG
373. esultl inputl AND specification says Calculate the bitwise result of input2 input and input2 Store the result in result Determine the order of execution The operations you write into an expression are performed in a prescribed order not necessarily from left to right Operations of equal order ate performed from left to right e If an expression contains multiple operators or functions group the conditions in parenthesis This ensures the correct order of execution and makes it easier to read the expression Order Operation 1 2 function 3 xx 4 negate 5 NOT 6 MOD 7 subtract 8 lt lt gt gt 9 lt gt 10 amp AND 11 XOR 12 OR Publication 1756 RMOOS3K EN P July 2008 669 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming Structured text statements can also be instructions See the Locator Table at the beginning of this manual for a list of the instructions available in structured text A structured text instruction executes each time it is scanned A structured text instruction within a construct executes every time the conditions of the construct ate true If the conditions of the construct are false the statements within the construct are not scanned There is no This differs from function block instructions that use Ena
374. et to the value of the OversampleDT parameter When TimingMode 2 real time sampling timing is enabled and DeltaT is the difference between the current and previous time stamp values read from the module associated with the input If TimingMode invalid the instruction sets the appropriate bit in Status Execution time for oversample timing The value used for DeltaT is in seconds If TimingMode 1 then OversampleDT 0 0 disables the execution of the control algorithm If invalid the instruction sets DeltaT 0 0 and sets the appropriate bit in Status valid 0 to 4194 303 seconds default 0 0 651 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Input Parameter Data Type RTSTime DINT RTSTimeStamp DINT Output Parameter Data Type Description Module update period for real time sampling timing The expected DeltaT update period is in milliseconds The update period is normally the value that was used to configure the module s update time If invalid the instruction sets the appropriate bit in Status and disables RTSMissed checking valid 1 to 32 767ms default 1 Module time stamp value for real time sampling timing The time stamp value that corresponds to the last update of the input signal This value is used to calculate Delta If invalid the instruction sets the appropriate bit in Status disables execution of
375. eter Data Type Description InFaulted Status 1 BOOL User program has set InFault to indicate bad quality input data Alarm continues to evaluate In for alarm conditions Severitylnv Status 2 BOOL Alarm severity configuration is invalid If severity 1 the instruction uses Severity 1 If severity gt 1000 the instruction uses Severity 1000 AlarmLimitsInv BOOL Alarm Limit configuration is invalid for example LLimit LLLimit If invalid the instruction Status 3 clears all level conditions active bits Until the fault is cleared no new level conditions can be detected Deadbandlnv Status 4 BOOL Deadband configuration is invalid If invalid the instruction uses Deadband 0 0 Valid 0 Deadband Span from first enabled low alarm to the first enabled high alarm ROCPosLimitlnv BOOL Positive rate of change limit invalid If invalid the instruction uses ROCPosLimit 0 0 Status 5 which disables positive rate of change detection ROCNegLimitlnv BOOL Negative rate of change limit invalid If invalid the instruction uses ROCNegLimit 0 0 Status 6 which disables negative rate of change detection ROCPeriodlnv Status 7 BOOL Rate of change period invalid If invalid the instruction uses ROCPeriod 0 0 which Publication 1756 RMOOS3K EN P July 2008 Year disables rate of change detection Description The ALMA instruction detects alarms based on the level or rate of change of a value The ALMA instruction prov
376. ex Det aer es c e dae cane we KO see 69 205 Compete UMP aede qe ipt HP EHE HH Pd pi es 206 CMP expressions xx coe d e RR Ce ORC EE p 208 Valid perabote a ccu doce gd eee en kee Fdo Ai I Rs 208 Porat EXPrESSIONS qa irade asa eia saaa adaa bd doro s 209 Determine The Order of ODSFtOB ced ey bone Ore eh 209 Use Strings In an Exptesslof cuis ex or be inh tin 210 Eg al to EQU eoe eaae x Duca ROC SHEEP RACER cena eee eS 211 Greater than or Equal to GEQ sses energie ne t e ees 215 Greater Than GRT einernie gat Tara i Ca de doe EAEE E EE 219 Less Than or Equal to LEQ oc cjscci as oer Rye kn os 223 Less Than LES deh a cs det Raps at ac patiens Rat deb ba de edere 227 PIEUE D Se eee Ense Rs Radeon a d AL oie ees 231 Mask Equal to MEQ iua eset wei ine er ccr oe hdc eg 237 Entering an Immediate Mask Value eese 238 Not Egq al to NEQ ss ibjyetenteaen RAS GG Pete EN M SGH 242 5 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Table of Contents Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 6 Latro HOBu weit ewe tb d do dur ety e SCR eee 247 Compute CET og pop ace atr visser bae a e RO CEQUE S ER tee eee 248 Valid operatofSe eeii p
377. f INT to DINT 4 Lee Re eee 637 Integer to READ a ad acp ue sae Pees Gene SD I o E ER RR i 639 DINT to SINT ot INT nee 639 REAL foan Inteper nea ee UV RERO ea UR Mrd 640 Appendix B ntfod cton cxi RE EU udi eon ee X EP Eid Ead s 641 Choose the Function Block Elements 0 0000 641 Latchitip Data seas cr RR Rx e CREER ERROR RR ges 642 Order of EXxECUbOfi 2 e e AC Ae CR GC e 4 644 Resolve a LOO oi chica aa RR x o OR RR eR Ra RACER s 645 Resolve Data Flow Between Two Blocks 0005 647 Create a One Scan Delay vs ooa kann Poe te Sea RIO A 647 sibi ADM CE 648 Function Block Responses to Overflow Conditions 648 Timing Mod s P IC Lr ETE 649 Common Instruction Parameters for Timing Modes 651 Overview of Timing Modes carus teckel conn te ER a eres 653 Program Opetitot Control iua scc acetate debet 654 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Index Publication 1756 RMOO3K EN P July 2008 Table of Contents Appendix C Jib FOE M CIE qu d s dicar do e Cro CUANDO 659 Str t f d T ORE SVM aie te wens amp X IER SE ee CR a a ee 659 ASSERTS e ac decided eee ee pe dex Mrs Added edo 661 Specify a mon retentive ASSIOMMENE see er donet 662 Assign an ASCII character to a sting celles 663 Expressions sianie stani cated in a cd ORO RR ORG E
378. f a string enter a string tag for both Source A and Source B E Structured Text IF sourceA sourceB THEN Use the greater than sign gt as an operator within an expression This statements expression evaluates whether sourceA is greater than sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text GRT 04 Function Block eRT E Greater Than A gt B Operand Type Format Description GRT tag FBD_COMPARE structure GRT structure Sources Dest D C SourceB Publication 1756 RMOOSK EN P July 2008 219 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ FBD_COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder GRT instruction Description The GRT instruction tests whether Source A is greater than Source B When you compare strings The hexadecimal values of the charac
379. f array data into SRT relay ladder 370 ascending order structured text calculate the standard deviation of an array STD relay ladder 375 of values structured text find the size of a dimension of an array SIZE relay ladder 381 structured text f There is no equivalent structured text instruction Use other structured text programming to achieve the same result See the description for the instruction Publication 1756 RMO03K EN P July 2008 You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the S V bit to see whether the result was truncated For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 329 Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Selecting Mode of For FAL and FSC instructions the mode tells the controller how to distribute the array tation Operation M CEN If You Want To Select This Mode operate on all of the specified elements in an array before All continuing on to the next instruction distribute array operation over a number of scans Numerical enter the number of elements to operate on per scan 1 21
380. f the connection path SSV ConnectionRate DINT GSV Requested packet rate of the connection SSV Message Type SINT GSV Specifies the type of message SSV Value Meaning 0 not initialized Port SINT GSV Indicates which port the message should be sent on SSV Value Meaning 1 backplane 2 serial port TimeoutMultiplier SINT GSV Determines when a connection should be considered timed out and closed SSV Value Meaning 0 connection will timeout in 4 times the update rate default 1 connection will timeout in 8 times the update rate 2 connection will timeout in 16 times the update rate UnconnectedTimeout DINT GSV Timeout period in microseconds for all unconnected messages The default is 30 000 000 microseconds 30 seconds SSV To change a MESSAGE attribute follow these steps 1 Use a GSV instruction to get the Message Type attribute and save it in a tag 2 Use a SSV instruction to set the MessageType to 0 3 Usea SSV instruction to set the MESSAGE attribute that you want to change 4 Use a SSV instruction to set the MessageType attribute back to the original value you obtained in step 1 188 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Example The following example changes the ConnectionPath attribute so that the message goes to a different controller When msg_path is on
381. f their characters do not match e ASCII characters are case sensitive Upper case A 41 is not equal to lower case a 61 ASCII Characters Hex Codes Jab 31 61 62 i Ag Tb 31 62 H r 4 S e A 4 S a AB 41 42 AB B e t B 42 r a 61 a B Y ab 61 62 not affected none 243 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Execution Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Relay Ladder Action Condition The rung condition out is set to false prescan rung condition in is false The rung condition out is set to false rung condition in is true Source A Source B rung condition out is set rung condition out is set to true to false postscan Y The rung condition out is set to false Function Block Action Condition No action taken prescan instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken 244 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ L
382. function This function computes the cosine of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Fal COS 04 Function Block Operand Type Cosine Publication 1756 RMOO3K EN P July 2008 Format Description COS tag FBD MATH ADVANCED structure COS structure 523 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction Output Parameter Data Type Valid any float Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The Source must be greater than or equal to 205887 4 2nx2 and less than Arithmetic Status Flags Fault Conditions Execution Condition prescan ot equal to 205887 4 21x25 The resulting value in the Destination is always greater than or equal to 1 and less than or equal to 1 Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung con
383. g Source B SINT immediate value to test against Source A INT tag DINT REAL string e If you enter a SINT or INT tag the value converts to a DINT value by sign extension REAL values are rarely absolutely equal If you need to determine the equality of two REAL values use the LIM instruction e String data types are default STRING data type any new sttine data type that you cteate y g p y To test the characters of a string enter a string tag for both Source A and Source B E Structured Text IF sourceA sourceB THEN Use the equal sign 6 lt statements gt evaluates whether sourceA is equal to sourceB as an operator within an expression This expression See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Publication 1756 RMOO3K EN P July 2008 211 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Fal EQU 04 O SourceA C SourceB Dest D Function Block Operand Type Format Description EQU tag FBD_COMPARE structure EQU structure FBD_COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB
384. g com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 1 Sort 7 array which is DINT 4 5 Before After dimension 1 A dimension 1 lo 1 2 3 4 0 20 19 3 17 16 1 115 14 8 12 11 dimension 0 dimension 0 2 10 9 13 7 6 315 1 SRT Sort File N Array int array 0 2 Dim to vary 0 N Control control 1 Length 4 Position of Structured Text control 1 LEN 4 control 1 POS 0 SRT int array 0 2 0 control 1 Publication 1756 RMO03K EN P July 2008 373 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Example 2 Sort int _array which is DINT 4 5 Before After dimension 1 Di dimension 1 lO 1 2 83 4 0 1 2 83 4 0 20 19 18 17 16 0 20 19 18 17 16 1 115 14 13 12 11 1 115 14 13 12 11 dimension 0 dimension 0 2 110 9 8 J 6 2 6 7 8 9 10 3 3 Relay Ladder SRT Sort File Array int_array 2 0 Dim to vary 1 Control control Lenath Position 1 e e on Structured Text control 1 LEN 5 control 1 POS 0 SRT int array 2 0 1 control 1 374 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg c
385. g condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction evaluates the Expression and places the result in the Destination The rung condition out is set to true postscan The rung condition out is set to false Example 1 When enabled the CPT instruction evaluates value_1 multiplied by 5 and divides that result by the result of va ue_2 divided by 7 and places the final result in resu A f Compute Dest result 1 0 0 Expression value 1 5 value 2 7 Example 2 When enabled the CPT instruction truncates float value 1 and float value 2 raises the truncated float_value_2 to the power of two and divides the truncated float value 1 by that result and stores the remainder after the division in float value result cpt Compute Dest float value result cpt 14 000061 Expression trn float value 1 HOD tnflaat value 2 2 Publication 1756 RMOO3K EN P July 2008 249 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Valid operators Operator Description Optimal Operator Description Optimal add DINT REAL LOG log base 10 REAL subtract negate DINT REAL MOD modulo divide DINT REAL multiply DINT REAL NOT bitwise complement DINT divide DINT REAL
386. g for both Source A and Source B E Structured Text IF sourceA lt sourceB THEN Use adjacent less than and equal signs lt as an operator within an lt statements gt expression This expression evaluates whether sowrceA is less than or equal to sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Publication 1756 RMOO3K EN P July 2008 223 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Ay LEQ 01 Function Block LEQ Less Than or Eql A lt B Operand Type Format Description LEQ tag FBD_COMPARE structure LEQ structure SourceA Dest Cj SourceB FBD COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder LEQ instruction Description The LEQ instruction tests whether Source A is less than or equal to Source B When you compare strings The hexadecimal
387. ger value to a REAL value before the instruction executes A SINT or INT value always converts to the same REAL value A DINT value may not convert to the same REAL value A REAL value uses up to 24 bits for the base value 23 stored bits plus a hidden bit A DINT value uses up to 32 bits for the value one for the sign and 31 for the value If the DINT value requires more than 24 significant bits it may not convert to the same REAL value If it will not the controller rounds to the nearest REAL value using 24 significant bits DINT to SINT or INT To convert a DINT value to a SINT or INT value the controller truncates the upper portion of the DINT and sets the overflow status flag if necessary The following example shows the result of a DINT to SINT or INT conversion EXAMPLE Conversion of a DINT to an INT and a SINT This DINT Value Converts To This Smaller Value 1620001 0081 65 665 INT 16 0081 129 SINT 16 81 127 Publication 1756 RMO003K EN P July Year 639 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix A Common Attributes REAL to an Integer To convert a REAL value to an integer value the controller rounds the fractional part and truncates the upper portion of the non fractional part If data is lost the controller sets the overflow status flag Numbers round as follows e Numbers other than x 5 round t
388. ges MUL 258 relay ladder Multiply structured text function block MVM 285 relay ladder Masked Move MEQ Mask Equal to MVMT 288 structured text Masked Move with Target function block NEG 274 relay ladder Negate structured text function block NEQ 242 relay ladder Not Equal to structured text function block NOP 457 relay ladder No Operation NOT 314 relay ladder Bitwise NOT structured text function block MID relay ladder Middle String structured text OCON 641 function block Output Wire Connector ONS 88 relay ladder One Shot OR 306 relay ladder MOD Bitwise OR structured text Modulo function block PANTON OREF 641 function block relay ladder Output Reference OSH 99 structured text One Shot Falling with Input function block OSF 94 relay ladder One Shot Falling OSRI 91 structured text One Shot Rising with Input function block OSR 91 relay ladder One Shot Rising OTE 82 relay ladder Output Energize MSG relay ladder Message structured text OTL 84 relay ladder Output Latch OTU 86 relay ladder Output Unlatch Publication 1756 RMOO3K EN P July 2008 19 rtisan Technolog iroup Quality Instrumentation uaranteed 8 88 S RCE www artisant Instruction Locator Instruction Location Languages PID relay ladder Proportional Integral structured text Derivative RAD 553 relay ladder Radians structured text function block RES 141 relay ladder
389. gh level LS THEN Controls the speed of the recirculation pump The Speed depends on the temperature in the tank IF tank temp 200 THEN Sugar Inlet 0 close the inlet Tz Z IF bar code 65 A TH Gets the number of elements in the Inventory array and stores the value in the Inventory Items tag SIZE Inventory O Inventory Items 688 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com A ABL instruction 570 ABS instruction 277 absolute value 277 ACB instruction 573 ACL instruction 575 ACS instruction 532 ADD instruction 252 addition 252 advanced math instructions introduction 539 LN 540 LOG 543 XPY 546 AFI instruction 456 AHL instruction 577 alarms 504 alarms and events instructions alarm status 69 ALMA analog alarm 42 buffer alarms 69 configuration 63 controller based alarm execution 72 message text 65 programmatically access 70 suppress or disable alarms 71 all mode 330 ALMA instruction 42 ALMD instruction alarms and events instructions ALMD 30 always false instruction 456 AND instruction 303 arc cosine 532 arc sine 529 arc tangent 535 ARD instruction 581 arithmetic operators structured text 665 arithmetic status flags overflow 648 ARL instruction 585 array instructions AVE 365 BSL 386 BSR 390 COP 355 CPS 355 DDT 486 FAL 335 FBC 478 Publication 1756
390. h 10 source bit i 11111 1 1 1 1 1 1 1 1 1 mE mE mE zx value 1 destination bit value 2 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 before BTD instruction value 2 0 0 0 0 0 0 010 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 after BTD instruction The shaded boxes show the bits that changed in value 2 Publication 1756 RMOO3K EN P July 2008 293 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Bit Field Distribute with Target BTDT Operands BTDT BTDT tag BTDT 041 BTDT d Bit Field Distribute with Target Dest SourceBit DestBit The BTDT instruction first copies the Target to the Destination Then the instruction copies the specified bits from the Source shifts the bits to the appropriate position and writes the bits into the Destination The Target and Source remain unchanged This instruction is available in relay ladder as BTD see page 291 Structured Text Variable Type Format Description BTDT tag FBD BIT
391. hapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction inserts the specified characters postscan The rung condition out is set to false No action taken Example When ezp ighis set the INSERT instruction adds the characters in string 2 to position 2 within string_ and places the result in string_ Relay Ladder INSERT Insert String Source A temp high Source B Start Dest Structured Text IF temp high THEN INSERT string 1 string 2 2 string 3 temp high 0 END IF 608 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Middle String MID ASCII String Instructions CONCAT DELETE FIND INSERT MID Chapter 18 The MID instruction copies a specified number of ASCII characters from a string and stores them in another string Operands Relay Ladder E MID Middle String Source Qty 2 Start 2 Dest 2 Operand Type Format Enter Notes Source stri
392. he END_CASE statement Arithmetic Status Flags not affected Fault Conditions none 676 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C Example If You Want This Enter This Structured Text If recipe number 1 then CASE recipe number OF Ingredient A outlet 1 open 1 1 Ingredient A Outlet 1 1 Ingredient B outlet 4 open 1 Ingredient B Outlet 4 1 If recipe number 2 or 3 then 243 Ingredient A Outlet 4 1 Ingredient A outlet 4 open 1 Ingredient B Outlet 2 1 Ingredient B outlet 2 open 1 If recipe number 4 5 6 or 7 then a eds Ingredient A Outlet 4 1 Ingredient A outlet 4 open 1 Ingredient B Outlet 2 1 Ingredient B outlet 2 open 1 If recipe number 8 11 12 or 13 then 8 11 13 Ingredient A Outlet 1 1 Ingredient A outlet 1 open 1 Ingredient B Outlet 4 1 Ingredient B outlet 4 open 1 Otherwise all outlets closed 0 ELSE Ingredient A Outlet 1 0 Ingredient A Outlet 4 0 Ingredient B Outlet 2 0 Ingredient B Outlet 4 0 END CASE The tells the controller to also clear the outlet tags whenever the controller e enters the RUN mode leaves the step of an SFC if you configure the SFC for Automatic reset This applies only if you embed the assignment in the action
393. he BAND instruction ANDs as many as eight boolean inputs If an input is not used it defaults to set 1 Out Inf AND In2 AND In3 AND In4 AND In5 AND In6 AND In7 AND In8 Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example 1 This example ANDs boo _in and bool_in2 and places the result in value_result_and If BOOL_IN1Is If BOOL IN2is Then VALUE RESULT AND Is 0 0 0 0 1 0 1 0 0 1 1 1 Structured Text value result and bool inl AND bool in2 318 Publication 1756 RMOOSK EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Function Block BAND 01 BAND E Boolean And 0 bool in1 D Int Out 0 value result and E In2 o bool in2 D Example 2 If both bool in1 and bool_in2 are set true ight7 is set on Otherwise ight is cleared off Structured Text IF bool inl AND bool in2 THEN l ghel lt 1 ELSE light1 0 END_IF Publication 1756 RMO03K EN P July 2008 319 Arti
394. he Rung condition out Is High Limit equal to or between limits true not equal to or outside limits false 2 High Limit equal to or outside limits true not equal to or inside limits false Signed integers roll over from the maximum positive number to the maximum negative number when the most significant bit is set For example in 16 bit integers INT type the maximum positive integer is 32 767 which is represented in hexadecimal as 16 7FFF bits 0 through 14 are all set If you increment that number by one the result is 16228000 bit 15 is set For signed integers hexadecimal 16 8000 is equal to 32 768 decimal Incrementing from this point on until all 16 bits are set ends up at 164 FFFE which is equal to 1 decimal 232 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 This can be shown as a circular number line see the following diagrams The LIM instruction starts at the Low Limit and increments clockwise until it reaches the High Limit Any Test value in the clockwise range from the Low Limit to the High Limit sets the rung condition out to true Any Test value in the clockwise range from the High Limit to the Low Limit sets the rung condition out to false Low Limit High Limit Low Limit 2 High Limit The instruction is true if the test value
395. he SFC for Automatic reset This applies only if you embed the assignment in the action of the step or use the action to call a structured text routine via a JSR instruction Example 4 IF THEN ELSIF ELSE If You Want This Enter This Structured Text ftanktemperatue 100 TF tank temp gt 200 THEN then pump slow pump fast 1 pump slow 0 pump off 0 If tank temperature 200 ELSIF tank temp 100 THEN then pump fast pump fast 0 pump slow 1 pump off 0 otherwise pump off ELSE pump fast 0 pump slow 0 pump off 1 END IF 674 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C CAS E OF Use CASE to select what to do based on a numerical value Operands Structured Text CASE numeric expression OF Operand Type Format Enter selectori statement selector statement numeric SINT tag tag or expression that evaluates to a number numeric expression s expression NT expression statement END CASE DINT REAL selector SINT immediate same type as numeric expression INT DINT REAL IMPORTANT If you use REAL values use a range of values for a selector because a REAL value is more likely to be within a range of values than an exact match of one specific value Description The syntax i
396. he instruction because these are normally wired as inputs into the instruction If the instruction clears these inputs the input would just get set again by the wired input There might be situations where you want to use other logic to set the Program requests in such a manner that you want the Program requests to be cleared by the instruction In this case you can set the ProgValueReset input and the instruction will always clear the Program mode request inputs when it executes Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B In this example a rung of ladder logic in another routine is used to one shot latch a ProgAutoReq to a PIDE instruction when a pushbutton is pushed Because the PIDE instruction automatically clears the Program mode requests you don t have to write any ladder logic to clear the ProgAutoReq after the routine executes and the PIDE instruction will receive only one request to go to Auto evety time the pushbutton is pressed When the TIC101AutoReq Pushbutton is pressed one shot latch ProgAutoReq for the PIDE instruction TIC101 TIC101 has been configured with the ProgValueReset input set so when the PIDE instruction executes it automatically clears ProgAutoReq TiCi lAutoReqPB TIC101AutoRegPB neShot TIC101 Prog amp utoReq JE LONS d Publication 1756 RMOO3K EN P J
397. he instruction was executed output bit BOOL tag bit to be set Description When enabled and the storage bit is cleared the OSR instruction sets the output bit When enabled and the storage bit is set or when disabled the OSR instruction clears the output bit rung condition in storage bit output bit eee instruction is instruction resets during executed next scan execution Arithmetic Status Flags no affected Fault Conditions none Execution Publication 1756 RMOOS3K EN P July 2008 91 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Condition Relay Ladder Action prescan The storage bit is set to prevent an invalid trigger during the first scan The output bit is cleared The rung condition out is set to false rung condition in is false The storage bit is cleared The output bit is not modified The rung condition out is set to false rung condition in is true storage bit is set storage bit 0 gt ui output bit is set examine storage bit storage bit storage bit remains set output bit is cleared Y postscan The storage bit is cleared The output bit is not modified The rung condition out is set to false 92 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology
398. he number of characters in the buffer including the first set of termination characters Structured Text The operands are the same as those for the relay ladder ABL instruction You access the Character Count value via the POS member of the SERIAL PORT CONTROL structure SERIAL PORT CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL The run bit indicates that the instruction is executing EM BOOL The empty bit indicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit indicates that the instruction found the termination character or characters POS DINT The position determines the number of characters in the buffer up to and including the first set of termination characters The instruction only returns this number after it finds the termination character or characters ERROR DINT The error contains a hexadecimal value that identifies the cause of an error 570 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL
399. he value of stat to the calling routine Relay Ladder limit switchl interlock_1 state JE JE CM timer 1 DN state ARR yr Structured Text state limit switchl AND interlock 1 IF timer 1 DN THEN EOT state END IF Publication 1756 RMOO3K EN P July 2008 459 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT SFC Pause SFP The SFP instruction pauses an SFC routine Operands Relay Ladder SEC Pause B Operand Type Format Description SFC Routine Name SFCRoutine ROUTINE name SFC routine to pause Target State Name TargetState DINT immediate select one tag executing or enter 0 paused or enter 1 Structured Text SFP SFCRoutineName TargetState The operands are the same as those for the relay ladder SFP instruction Description The SFP instruction lets you pause an executing SFC routine If an SFC routine is in the paused state use the SFP instruction again to change the state and resume execution of the routine Also use the SFP instruction to resume SFC execution after using an SFR instruction see page 462 to reset an SFC routine Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code the routine type is not an SFC routine 4 85 460 Pu
400. ibers Communication Fri Buttered Count Status OK Alam Normal amp acknowledged Buffering Alarms ic zone of BM U5 UUJ Q Disabled D Suppressed Delivery Cancel On the Status tab of the alarm dialog monitor the alarm condition acknowledge an alarm disable an alarm suppress an alarm or reset an alarm Use the dialog selections to see how an alarm behaves without needing an operational HMI ALMA Properties Tank32Level Rung 2 Conhguraon Messages Status Parameters Tag i Al alarm times are displayed in the workstation time zone of GMT 05 00 Level Rate Of Change High High 0 e Acknowledged Positive 0 In Alam Time In Alam Time High 0 e Acknowledged Negative 0 In Alam Time In Alam Time Low U Acknowledged In Alam Time D Low Low f e Acknowesdgeid In Alam Time Acknowledge Subscribers T Rain To Subscriber Lonnechion Normal T ime Notified Subscribers Alarm Count D omemunicalion Fror Reset Time Buffered Status OK Alam Normal Disabled AlAcknowledged Suppressed Publication 1756 RMOO3K EN P July 2008 Year Delivery In order to receive controller based alarm messages alarm clients such as an RSLinx Enterprise server must establish a subscription to the alarms in the Logix controller The controller maintains a connection to each subscriber and monitors the status of that connection As alarm stat
401. ically use the same CONTROL as the associated LFL DINT immediate maximum number of elements the LIFO can hold at one time DINT immediate next location in the LIFO where the instruction unloads data initial value is typically 0 If you use a uset defined structure as the data type for the LIFO or Destination operand use the same structure for both operands Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 CONTROL Structure Mnemonic Data Type Description EU BOOL The enable unload bit indicates that the LFU instruction is enabled The EU bit is set to preset a false unload when the program scan begins DN BOOL The done bit is set to indicate that the LIFO is full POS LEN EM BOOL The empty bit indicates that the LIFO is empty If LEN 0 or POS 0 both the EM bit and DN bit are set LEN DINT The length specifies the maximum number of elements the LIFO can hold at one time POS DINT The position identifies the end of the data that has been loaded into the LIFO Description Use the LFU instruction with the LFL instruction to store and retrieve data in a last in first out order When enabled the LFU instruction unloads the value at POS of the LIFO and places that value in the Destination The instruction unloads one value and re
402. icates that the instruction is executing EM BOOL The empty bit indicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit does not apply to this instruction LEN DINT The length indicates the number of characters to send POS DINT The position displays the number of characters that were sent ERROR DINT The error contains a hexadecimal value that identifies the cause of an error Publication 1756 RMOO3K EN P July 2008 Description The AWT instruction sends the specified number of characters Serial Port Control Length of the Source tag to the device that is connected to the serial port of the controller To program the AWT instruction follow these guidelines 1 Configure the serial port of the controller If Your Application Then uses ARD or ARL instructions Select User mode does not use ARD or ARL Select either System or User mode instructions 2 This is a transitional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition 3 Each time the instruction executes do you always send the same number of characters If Then Yes In the Serial Port Control Length enter the number of characters to send No Before the instruction executes mo
403. ides additional functionality when used with RSLinx Enterprise and FactoryTalk View SE software You can display alarms in the Alarm Summary Alarm Banner Alarm Status Explorer and Alarm Log Viewer displays in FactoryTalk View SE software RSLinx Enterprise software subscribes to alarms in the controller Use the output parameters to monitor the instruction to see the alarm subscription status and to display alarm status changes If a connection to RSLinx Enterprise software is lost the controller can briefly buffer alarm data until the connection is restored 53 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA State Diagrams when Acknowledgement Required In gt HHLimit MinDurationACC gt MinDurationPRE HHlnAlarm True HHAcked False 5 In gt HLimit MinDurationACC gt MinDurationPRE T B M ff HinAlarm True HHInAlarm False HinAlarm False HAcked True HAcked False i HHAcked True NS Ack Ack Ack Ack ra N E 7 Se f HinAlarm False HinAlarm True fi HHInAlarm False HHInAlarm True HAcked True HHAcked False HHAcked True HAcked False N zt 1 HH alarm condition can be acked by several different ways HHProgAck HHOperAck ProgAckAll OperAckAll 1H alarm condition can be acked by several different wa
404. imit_switch_1 is enabled and counter 1 increments by 1 Each time a part leaves ligit switch 21s enabled and counter 1 decrements by 1 If there are 100 parts in the buffer zone counter_1 dn is set conveyor a turns on and stops the conveyor from bringing in any more parts until the buffer has room for more parts restart counter 1 PRES lirnit_switch_1 CTU Count Up Counter counter 1 Preset 100 Accum of CTD Count Down Counter counter 1 Preset 100 p limit_switch_2 Accum counter 1 dn conveyor A e r Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 135 Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Count Up Down CTUD The CTUD instruction counts up by one when CUEnable transitions from clear to set The instruction counts down by one when CDEnable transitions from clear to set This instruction is available in relay ladder as three separate instructions CTU see page 128 CTD see page 132 and RES see page 141 Operands CTUD CTUD tag Structured Text Variable Type Format Description CTUD tag FBD_COUNTER structure CTUD structure 7 CTUD 01 Function Block cTuD zd Count UPD ow Operand Type Format Description CTUD tag FBD_COUNTER structure CTUD structure CUEnable ACC CDEnable DN f FBD COU
405. immediate values Use the following table to format operators and operands within an expression For Operators That Use This Format Examples Operate On one operand operator operand ABS tag a two operands operand aoperatoroperand b e tag b45 e ag c AND tag d e tag e 2 MOD tag f tag 9 Determine the order of operation The operations you write into the expression are performed by the instruction in a prescribed order not necessarily the order you write them You can override the order of operation by grouping terms within parentheses forcing the instruction to perform an operation within the parentheses ahead of other operations Operations of equal order are performed from left to right Order Operation 1 2 ABS ACS ASN ATN COS DEG FRD LN LOG RAD SIN SOR TAN TOD TRN negate NOT MOD subtract AND XOR OR co Cop N S 9 S amp Publication 1756 RM003K EN P July 2008 345 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 File Search and Compare FSC Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE The FSC instruction compares values in an array element by element Operands Relay Ladder FSC cae Pia Boni Copdre CEN Operand Type Format Description Control DN Control CONTROL tag control structure for the op
406. in is true The rung condition out is set to true Execution jumps to the rung that contains the LBL instruction with the referenced label name postscan 632 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Debug Instructions BPT TPT Chapter 20 Example This rung triggers a trace of three analog values when any one of them exceeds Jf a given value 30 01 GRT Greater Than A5B Source amp analogvaluel TPT Tracepoint Format myformat Analog inputs trace Trace This analogvalue1 Trace This analogvalue2 Trace This analogvalue3 Source B Greater Than AB Source A analogvalue2 Source B Greater Than A5 B Source 4 analogvalue3 Source B You want to display the tracepoint information in the Format string myformat In this case the format string contains this text Analog inputs trace Analog inputs f f and f When the tracepoint triggers the characters before the colon Analog inputs trace appear in the title bar of the trace window The other characters make up the traces In this example of represents the tags to be traced analogvalue1 analogvalue2 and analogvalue3 The resulting traces appear as shown here Slot 1 Analog inputs trace PES FA Analog inputs 31 002001 30 282000 an
407. ine s execution The stored value is used when Block 01 executes The same stored value is also used when Blcock 02 executes If the value of tagA changes during execution of the routine the stored value of tagA in the IREF does not change until the next execution of the routine b Block 01 El q Block_02 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B This example is the same as the one above The value of tagA is stored only once at the beginning of the routine s execution The routine uses this stored value throughout the routine Block 01 Starting with RSLogix 5000 software version 11 you can use the same tag in multiple IREFs and an OREF in the same routine Because the values of tags in IREFs are latched every scan through the routine all IREFs will use the same value even if an OREF obtains a different tag value during execution of the routine In this example if tagA has a value of 25 4 when the routine starts executing this scan and Block 01 changes the value of tagA to 50 9 the second IREF wired into Block 02 will still use a value of 25 4 when Block 02 executes this scan The new tagA value of 50 9 will not be used by any IREFs in this routine until the start of the next scan Block 04 Block 02 Publication 1756 RMOO3K EN P July 2008 6
408. ing down again UN BOOL Counter underflow Indicates the counter exceeded the lower limit of 2 147 483 648 Publication 1756 RMOO3K EN P July 2008 The counter then rolls over to 2 147 483 647 and begins counting down again Description When enabled and CUEnable is set the CTUD instructions increments the counter by one When enabled and CD Enable is set the CTUD instruction decrements the counter by one Both the CUEnable and CDEnable input parameters can both be toggled during the same scan The instruction executes the count up prior to the count down 137 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Counting Up CUEnable count up enable bit CU count up done bit DN DIESEL eb bees due cote esce counter accumulated value ACC 16636 Counting Down CDEnable __ count down enable bit CD 1 count down done bit DN counter accumulated value ACC UCET MELLE LET IEEE 16637 When disabled the CTUD instruction retains its accumulated value Set the Reset input parameter of the PBD COUNTER structure to reset the instruction Arithmetic Status Flags not affected Fault Conditions none 138 Publication 1756 RMO03K EN P
409. instruction 460 SFR instruction 462 shift instructions BSL 386 BSR 390 FFL 394 FFU 400 introduction 385 LFL 406 LFU 412 SIN instruction 520 sine 520 size in elements 381 SIZE instruction 381 sort 3 0 special instructions DDT 486 DTR 494 FBC 478 introduction 477 PID 497 SFP 460 SFR 462 SQI instruction 420 SQL instruction 428 SQ0 instruction 424 SQR instruction 270 square root 270 SRT instruction 370 SSV instruction objects 179 operands 176 standard deviation 3 5 status task 195 STD instructions 375 695 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Index 696 STOD instruction 614 STOR instruction 616 string evaluation in structured text 667 String Concatenate 601 string conversion instructions DTOS 619 introduction 611 LOWER 625 RTOS 621 STOD 614 STOR 616 SWPB 299 UPPER 623 string data type 567 600 613 String Delete 603 string manipulation instructions CONCAT 601 DELETE 603 FIND 605 INSERT 607 introduction 599 MID 609 STRING structure 567 600 613 String To DINT 614 String To REAL 616 structured text arithmetic operators 665 assign ASCII character 663 assignment 661 bitwise operators 669 CASE 675 comments 687 components 659 contructs 671 evaluation of strings 667 expression 663 FOR DO 678 functions 665 IF THEN 672 logical operators 668 non retentive assignment 662 numeric expression 663 relational operators
410. instruction can access only tags that are in the Controller Tags folder controller the controller scope scope 3 If your MSG is to a device that uses 16 bit If your message is to a device that uses 16 bit integers such as a PLC 5 or SLC 500 integers use a buffer of INTs in the MSG controller and it transfers integers not REALs use a buffer of INTs in the message and and DINTs throughout the project DINTs throughout the project This increases the efficiency of your project because Logix controllers execute more efficiently and use less memory when working with 32 bit integers DINTs To convert between INTs and DINTs see Logix5000 Controllers Common Procedures publication 1756 PM001 4 Cache the connected MSGs that execute Cache the connection for those MSG instructions that execute most frequently up to most frequently the maximum number permissible for your controller revision This optimizes execution time because the controller does not have to open a connection each time the message executes 5 If you want to enable more than 16 MSGs at If you enable more than 16 MSGs at one time some MSG instructions may experience one time use some type of management delays in entering the queue To guarantee the execution of each message use one of strategy these options Enable each message in sequence Enable the messages in groups e Program a message to communicate with multiple devices For more information
411. instruction examines the data bit to see if it is set Relay Ladder Operand Type Format Description data bit BOOL tag bit to be tested Structured Text Structured text does not have an XIC instruction but you can achieve the same results using an IE THEN construct IF data bit THEN statement END IF See Appendix 641B Function Block Attributes for information on the syntax of constructs within structured text The XIC instruction examines the data bit to see if it is set not affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Y examine data bit data bit 1 rung condition out is set data bit 0 rung condition out is set to false to true gt Y postscan 78 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example 1 16 switch 1 is set this enables the next instruction the rung condition out is true Relay Ladder irit switch 1 Structured Text IF limit switch THEN statement END IF Example 2 If 5 17 is set indicates that an overflow has occurred this enabl
412. instruction executes EnableOut is set postscan No action taken Publication 1756 RMOOSK EN P July 2008 221 Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example If value 1 is greater than value_2 set ghz 1 If value 1 is less than or equal to value_2 cleat light_1 Relay Ladder AT light_1 Greater Than 4 gt B x Source value 1 o SourceB value 2 o Structured Text light 1 value 1 gt value 2 Function Block GRT 01 GRT gal Greater Than A gt B SourceB Rg light 1 222 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Less Than or Equal to LEQ The LEQ instruction tests whether Source A is less than or equal to Source B Operands Relay Ladder LEQ cir Mod Operand Type Format Description Source A SINT immediate value to test against Source B Source B INT tag DINT REAL string Source B SINT immediate value to test against Source A INT tag DINT REAL string e If you enter a SINT or INT tag the value converts to a DINT value by sign extension e String data types are default STRING data type any new string data type that you create To test the characters of a string enter a string ta
413. instruction sets the output bit When disabled and the storage bit is cleared or when enabled the OSF instruction cleats the output bit rung condition in storage bit ouputbit eeso tot instruction is instruction resets during executed next scan execution Arithmetic Status Flags not affected Fault Conditions none 94 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Execution Condition prescan rung condition in is false examine storage bit storage bit 1 storage bit is cleared output bit is set Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Relay Ladder Action The storage bit is cleared to prevent an invalid trigger during the first scan The output bit is cleared The rung condition out is set to false storage bit remains cleared storage bit 0 output bit is cleared p Y rung condition in is true The storage bit is set The output bit is cleared The rung condition out is set to true postscan Example limit switch 1 output bit 2 Publication 1756 RMOO3K EN P July 2008 See rung condition in is false above Each time mit_switch_1 goes from set to cleared the OSF instruction sets output bit 2 and the ADD instruction increments sum by 5 As long as limit_sw
414. inutes while it runs Otherwise the ACC value won t be correct The last_ time scanned value has a range of up to 69 minutes The timer s calculation rolls over if you don t scan the timer within 69 minutes The ACC value won t be correct if this happens While a timer runs scan it within 69 minutes if you put it in a e subroutine e section of code that is between JMP and LBL instructions e sequential function chart SFC e event or periodic task e state routine of a phase Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur lf Fault Type Fault Code PRE 0 4 34 ACC lt 0 4 34 Publication 1756 RMOO3K EN P July 2008 113 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Execution Condition Relay Ladder Action prescan The EN TT and DN bits are cleared The ACC value is not modified The rung condition out is set to false rung condition in is false The EN and TT bits are cleared The DN bit is not modified The ACC value is not modified The rung condition out is set to false rung condition in is true Y examine DN bit oe DN bit 0 EN bit is set examine EN bit TT bit is set TT bit is set ACC ACC current time last time ACC value rolls over
415. ion H Condition In Time t7 HinAlarm LinAlarm LLinAlarm HHAcked HAcked LLAcked 58 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 ALMA Level Condition Acknowledge Not Required In Bg uin to aianei HHInAlarm T HinAlarm a i LinAlarm 1 E LLinAlarm HHAcked HAcked LAcked LLAcked Publication 1756 RMOOS3K EN P July 2008 Year 59 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA ALMA Rate of Change Acknowledge Required Alarm Condition ProgAckAll OperAckAll Ack Request Alarm Condition ROCPos Condition In Time t7 Alarm Services AckR Alarm Condition ROCNeg Condition In Time t6 ROCPoslnAlarm ROCNeglnAlarm ROCPosAcked Fal ROCNegAcked i H i 1 2 4 15 7 t8 1 2 60 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 ALMA Rate of Change Acknowledge Not Re
416. ion 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C The following diagrams show how a REPEAT UNTIL loop executes and how an EXIT statement leaves the loop early statement 1 d statement 1 statement 2 statement 2 statement 3 statement3 yes true BOOL expression no false M true BOOL expression V V false rest of the routine rest of the routine While the boo2 expression is false the To stop the loop before the conditions are false use controller executes only the statements within the an EXIT statement REPEAT UNTIL loop Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code the construct loops too long 6 1 Example 1 If You Want This Enter This Structured Text The REPEAT UNTIL loop executes the statements in the pos 1 construct and then determines if the conditions are true before REPENT executing the statements again nn pos pos 2 This differs from the WHILE DO loop because the WHILE DO The WHILE DO loop evaluates its conditions first If the UNTIL pos 101 OR conditions are true the controller then executes the structarray pos value targetvalue statements within the loop The statements in a REPEAT UNTIL loop are always executed at least once The statements in a
417. ion 1756 RMOO3K EN P July 2008 597 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Notes 598 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Introduction Use the ASCII string instructions to modify and create strings of ASCII characters If you want to For example Use this Available in these See page instruction languages add characters to the end of a string add termination characters or CONCAT relay ladder 601 delimiters to a string structured text delete characters from a string remove header or control characters DELETE relay ladder 603 from a string structured text determine the starting character of a locate a group of characters within a FIND relay ladder 605 sub string string structured text insert characters into a string create a string that uses variables INSERT relay ladder 607 structured text extract characters from a string extract information from a bar code MID relay ladder 609 structured text You can also use the following instructions to compare or convert ASCII characters If you want to Use this instruction See page compare a string to another stri
418. ion SGI 1 1 available from your local Rockwell Automation sales office or online at http literature rockwellautomation com describes some important differences between solid state equipment and hard wired electromechanical devices Because of this difference and also because of the wide variety of uses for solid state equipment all persons responsible for applying this equipment must satisfy themselves that each intended application of this equipment is acceptable In no event will Rockwell Automation Inc be responsible or liable for indirect or consequential damages resulting from the use or application of this equipment The examples and diagrams in this manual are included solely for illustrative purposes Because of the many variables and requirements associated with any particular installation Rockwell Automation Inc cannot assume responsibility or liability for actual use based on the examples and diagrams No patent liability is assumed by Rockwell Automation Inc with respect to use of information circuits equipment or software described in this manual Reproduction of the contents of this manual in whole or in part without written permission of Rockwell Automation Inc is prohibited Throughout this manual when necessary we use notes to make you aware of safety considerations Identifies information about practices or circumstances that can cause an explosion in a hazardous environment which may lead to personal i
419. ion are true the BPT instruction stops program execution The software displays a window indicating that the breakpoint triggered and the values that triggered it Description Slot 1 X E Stopped t Breakpoint OK to Continue Publication 1756 RM003K EN P July 2008 627 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 20 Debug Instructions BPT TPT When a breakpoint triggers the emulator displays a window informing you that a breakpoint occurred The title bar of the window shows the slot containing the emulator that encountered the breakpoint When you click OK the emulator resumes program execution If the conditions that triggered the breakpoint persist the breakpoint will recur In addition the emulator opens a trace window for the breakpoint The trace window displays information about the breakpoint and the values When a breakpoint triggers you will not be able to edit your project ATTENTION R until you permit the execution to continue You can go online with the emulator to observe the state of your project but you will not be able to edit it If you try to accept a rung edit while a breakpoint is triggered you will see a dialog box saying the controller is not in the correct mode String Format With the Format string in the tracepoint and breakpoint instructions you can control how the traced tags appear in the
420. ion in status and rung condition out status For more information on using the JXR instruction and creating external routines see the SoftLogix5800 System User Manual publication 1789 UM002 449 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Temporary End TND The TND instruction acts as a boundary Operands Relay Ladder Operands CIND none TND Structured Text none You must enter the parentheses after the instruction mnemonic even though there are no operands Description When enabled the TND instruction lets the controller execute logic only up to this instruction When enabled the TND instruction acts as the end of the routine When the controller scans a TND instruction the controller moves to the end of the current routine If the TND instruction is in a subroutine control returns to the calling routine If the TND instruction 1s in a main routine control returns to the next program within the current task Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes
421. iption If cleared the instruction does not execute and outputs are not updated If set the instruction executes as described under Execution Default is set Source DINT Value to test against Compare Valid any integer Mask DINT Defines which bits to block mask Valid any integer Compare Output Parameter EnableOut DINT Data Type BOOL Compare value Valid any integer Description The instruction produced a valid result Dest 238 BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder MEO instruction Description A 1 in the mask means the data bit is passed A 0 in the mask means the data bit is blocked Typically the Source Mask and Compare values are all the same data type If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Entering an Immediate Mask Value When you enter a mask the programming software defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix Description 16 hexadecimal for example 16 0FOF 0f octal for example 8216 2 binary for example 2 00110011 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg
422. is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperAck BOOL Set by the operator interface to acknowledge the alarm Requires a cleared to set transition while the alarm is unacknowledged The instruction clears this parameter Default is cleared ProgReset BOOL Set by the user program to reset the alarm Requires a cleared to set transition while the alarm is InAlarm and the In condition is not in alarm Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperReset BOOL Set by the operator interface to reset the alarm Requires a cleared to set transition while the alarm is InAlarm and the In condition is not in alarm The alarm instruction clears this parameter Default is cleared ProgSuppress BOOL Set by the user program to suppress the alarm Default is cleared OperSuppress BOOL Set by the operator interface to suppress the alarm The alarm instruction clears this parameter Default is cleared 32 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Input Parameter Data Type Description ProgUnsuppress BOOL Set by the user program
423. it words in 32 bit words in 16 bit words in 32 bit words in PLC 5 processor Logix5000 controller PLC 5 processor Logix5000 controller T 1 1 1 1 2 1 2 p 2 2 p 4 3 3 3 3 4 4 4 The typed commands maintain data structure and value The word range commands fill the destination tag contiguously Data structure and value change depending on the destination data type 164 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Specify SLC messages Use the SLC message types to communicate with SLC and MicroLogix controllers The following table shows which data types that the instruction lets you access The table also shows the corresponding Logix5000 data type For this SLC or MicroLogix Data Type Use This Logix5000 Data Type F REAL L MicroLogix 1200 and 1500 controllers DINT N INT Specify block transfer messages The block transfer message types are used to communicate with block transfer modules over a Universal Remote I O network If You Want To Select This Command read data from a block transfer module Block Transfer Read This message type replaces the BTR instruction write data to a block transfer module Block Transfer Write This message type replaces the BTW
424. it words requested The data from the Source Element is stored starting at the address specified as the Destination Tag PLC5 Word Range Write Publication 1756 RMOO3K EN P July 2008 Write a contiguous range of 16 bit words from Logix5000 memory regardless of data type to PLC 5 memory This command starts at the address specified as the Source Tag and reads sequentially the number of 16 bit words requested The data from the Source Tag is stored starting at the address specified as the Destination Element in the PLC 5 processor 163 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT The following table shows the data types to use with PLC5 Typed Read and PLC5 Typed Write messages Data types for PLC5 Typed Read and Typed Write messages For this PLC 5 data type Use this Logix5000 data type B INT F REAL N INT DINT Only write DINT values to a PLC 5 controller if the value is gt 32 768 and lt 32 767 S INT ST STRING The Typed Read and Typed Write commands also work with SLC 5 03 processors OS303 and above SLC 5 04 processors OS402 and above and SLC 5 05 processors The following diagrams show how the typed and word range commands differ The example uses read commands from a PLC 5 processor to a Logix5000 controller Typed read command Word range read command 16 b
425. itch_1 stays cleared sum stays the same value The mit_switch_1 must go from set to cleared again for sw to be incremented again You can use output_bit_2 on multiple rungs to trigger other operations DSF One Shot Falling Storage Bit storage_bit2 Output Bit output_bit_2 DD Add Source Source B Dest 95 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 2 One Shot Rising with Input OSRI Operands OSRI OSRI tag OSRI tag OSRI Ee One Shot Rising with Input InputBit OutputBit f Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI The OSRI instruction sets the output bit for one execution cycle when the input bit togeles from cleared to set This instruction is available in relay ladder as OSR see page 91 Structured Text Operand Type Format Description OSRI tag FBD ONESHOT structure OSRI structure Function Block Operand Type Format Description OSRI tag FBD ONESHOT structure OSRI structure FBD ONESHOT Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes InputBit BOOL Input bit This is equivalent to rung condition for the relay ladder OSR instruction Default is cleared Out
426. ith SourceA Valid any integer Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of the instruction Arithmetic status flags are set for this output Description When enabled the instruction evaluates the OR operation If the Bit In And the Bitin The Bit In the Source A Is Source B Is Destination Is 0 0 0 0 1 1 1 0 1 Arithmetic Status Flags Fault Conditions Condition prescan Execution 1 1 1 If you mix integer data types the instruction fills the upper bits of the smaller integer data types with Os so that they are the same size as the largest data type Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true postscan The instruction performs a bitwise OR operation The rung condition out is set to true The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 307 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared
427. ithin structured text Fal LOG 01 Function Block Log Base 40 Operand Type Format Description LOG tag FBD MATH ADVANCED structure LOG structure Publication 1756 RMOOSK EN P July 2008 543 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 15 Advanced Math Instructions LN LOG XPY FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to math instruction Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The Source must be greater than zero otherwise the overflow status bit S V Arithmetic Status Flags Fault Conditions Execution Condition prescan is set The resulting Destination is greater than or equal to 37 92978 and less than or equal to 38 53184 Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true postscan Condition prescan The controller calculates the log of the Source and places the result in the Destination The rung condition out is set to tr
428. ition of the mismatch and stops executing All mismatches Clear the IN bit in the compare CONTROL structure Each time the rung condition in goes from false to true the DDT instruction searches for all mismatches between the Source and Reference arrays Arithmetic Status Flags not affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code Result POS gt size of Result array 4 20 488 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Execution Condition Relay Ladder Action prescan compare EN bit is cleared examine compare DN 0 compare DN bit pues 1 compare DN bit is cleared compare POS value is cleared result DN bit is cleared ui rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 489 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Condition Relay Ladder Action rung condition in is false j compare EN bit is cleared examine compare DN 0 compare DN bit yon 1 compare DN bit is cleared compare POS value is cleared result DN bit is cleared lt a rung condition out is set to 3 490
429. itional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition Arithmetic Status Flags not affected Fault Conditions Type Code Cause 4 57 The AHL instruction failed to execute because the serial port is set to no handshaking Condition prescan Execution Relay Ladder Action The rung condition out is set to false Recovery Method Either e Change the Control Line setting of the serial port e Delete the AHL instruction Structured Text Action No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in toggles from cleared to set The rung condition out is set to true na Enableln is set na Enableln is always set The instruction executes instruction execution postscan The instruction obtains the control line status and turns on or off DTR and RTS signals The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 No action taken 579 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17
430. ize an event task Another type of event normally triggers the event task Continuous task If Initialize Task 1 1 then The ONS instruction limits the execution of the EVENT instruction to one scan The EVENT instruction triggers an execution of Task 1 event task EVENT Trigger Event T ask Task Task 1 Initialize Task 1 Sterage ONS Task_1 event task The GSV instruction sets Task Status DINT tag Status attribute for the event task In the Instance Name attribute THIS means the TASK object for the task that the instruction is in that is Task 1 GSV Get System Value Class Name TASK Instance Name THIS Attribute Name Status Dest Task Status oe If Task Status 0 1 then an EVENT instruction triggered the event task that is when the continuous task executes its EVENT instruction to initialize the event task The RES instruction resets a counter that the event task uses Task Status Counter 1 E The controller does not clear the bits of the Status attribute once they are set To use a bit for new status information you must manually clear the bit If Task_Status 0 1 then clear that bit The OTU instruction sets Task Status 0 0 The SSV instruction sets the Status attribute of THIS task Task 1 Task Status This includes the cleared bit Task Status SV Set System Value Class Name TASK Instance Name THIS Attribute Name Status Source Task_Status 0 Task_Status 0
431. l applications When the alarm condition occurs and is displayed to the operator a button on the summary and banner displays lets the operator run an associated view command Be careful to enter the correct command syntax and test the command at runtime as there is no error checking performed when the command is entered You can edit all aspects of the alarm configuration offline and online Online edits of new and existing alarms are immediately sent to Factory Talk subscribers legacy HMI terminals that are just polling the tags do not automatically update Factory Talk subscribers do not have to re subscribe to receive updated information Online changes automatically propagate from the controller alarm structure to the rest of the architecture Enter appropriate message text to display when an alarm condition is active InAlarm For an ALMD instruction you enter the message information on 65 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA ALMD Properties Motor101Fault Rung 1 Configuation tatus Pacemeters Tag cow EE Fach Severity nnn Minimum Duration U IV Askruieikyemeri Perper the Configuration tab For an ALMA instruction you enter the message information on the Message tab ALMA Properties Tank32Level Rung 2 Conhgurahon Messages Status Pacemeters
432. l variable level detector 14271 In the above example the level in the tank is compared against the setpoint If the level is higher than the setpoint the PID equation increases the control variable and causes the outlet valve from the tank to open thereby decreasing the level in the tank 505 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID The PID equation used in the PID instruction is a positional form equation with the option of using either independent gains or dependent gains When using independent gains the proportional integral and derivative gains only affect their specific proportional integral or derivative terms respectively When using dependent gains the proportional gain is replaced with a controller gain which affects all three terms You can use either form of equation to perform the same type of control The two equation types are merely provided to let you use the equation type with which you are most familiar Gains Option Derivative Of Equation Dependent gains error E ISA standard t 1 dE CV Kd E rj Edt Ty BIAS 0 process variable PV E SP PV t 1 dPV T CV de E al Edt T BIAS 0 E PV SP t 1 dPV 7 CV K E z Edi Tj BIAS 0 Independent gains error E t CV KE Kj Edi K BIAS 0 process varia
433. larm False RocPosAcked True RocNegAcked False RocPosinAlarm False RocPosAcked False Se Fi w zw N 1 ROCPos alarm condition can be acked by several different ways RocPosProgAck RocPosOperAck ProgAckAll 1 1 ROCNeg alarm condition can be acked by several different ways RocNegProgAck RocNegOperAck ProgAckAlll E OperAckAll clients RSLogix 5000 software RSView software f OperAckAlll clients RSLogix 5000 software RSView software 54 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 State Diagrams when Acknowledgement Not Required ON In gt HLimit MinDurationACC gt MinDurationPRE gt HinAlarm False HinAlarm True xt N A In lt HLimit Deadband N i TN In lt LLimit MinDurationACC gt MinDurationPRE i x gt LinAlarm False LinAlarm True JA X a In gt LLimit Deadband SS Pd Nn gt HHLimit MinDurationACC gt MinDurationPRE gt HHInAlarm False HHInAlarm True N is d In HHLimit Deadband s Fa j N In lt LLLimit MinDurationACC gt MinDurationPRE lt y X LLInAlarm False LLInAlarm 7 True In CurrentSample In PreviousSample In gt LLLimit Deadband ROC HAcked
434. lay ladder CONCAT 601 relay ladder ASCII Read Line structured tex String Concatenate structured text ASN 529 relay ladder COP 355 relay ladder Arc Sine structured tex Copy File structured text rietan kiak COS 523 relay ladder ATN 535 relay ladder Cosine structured text Arc Tangent structured tex function block DILDO CPS 355 relay ladder AVE 365 relay ladder Synchronous Copy File structured text File A ATE CPT 248 relay ladder AWA 589 relay ladder Compute ASCII Write Append structured text iudici CTD 132 relay ladder AWT 594 relay ladder Count Down ASCII Writ structured text b CTU 128 relay ladder BAND 317 structured text Count Up Boolean AND function block 16 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Instruction Locator Instruction Location Languages Instruction Location Languages CTUD 136 structured text FIND 605 elay ladder Count Up Down function block Find String structured text D2SD process control structured text FLL 361 elay ladder Discrete 2 State Device function block File Fill D3SD process control structured text FOR 470 elay ladder Discrete 3 State Device function block For DDT A86 relay ladder FRD
435. le element in the array N number of specified elements in the array e AVE N by ti i 1 N IMPORTANT Make sure the Length does not cause the instruction to exceed the specified Dimension to vary If this happens the Destination will be incorrect 376 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code POS lt 0 or LEN lt 0 4 21 Dimension to vary does not exist for the 4 20 specified array Publication 1756 RMOO3K EN P July 2008 377 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Execution Condition Relay Ladder Action prescan The EN bit is cleared The DN bit is cleared The ER bit is cleared The rung condition out is set to false rung condition in is false examine DN bit DN bit 1 EN bit is cleared ER bit is cleared DN bit is cleared 48g rung condition out is set to false rung condition in is true The STD instruction calculates the s
436. ler evaluates x 1 and 0 0 Arithmetic status flags ate affected A Minor Fault Will Occur If Fault Type Fault Code Source X is negative and Source Y is not an 4 4 integer value Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller takes Source X to the power of Source Y and places the result in the Destination The rung condition out is set to true postscan Publication 1756 RMOO3K EN P July 2008 The rung condition out is set to false 547 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 15 Advanced Math Instructions LN LOG XPY Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example The XPY instruction takes va ne_1 to the power of value_2 and places the result in result Relay Ladder KPY X To Power Of Y Source X value 1 33e Source Y value 2 Structured Text result value 1 value 2 Function Block XPY 01 XPY mm X To Power Of Y 0 0 result SourceA value 1 value 2 SourceB 548 Publication 1756 RMO03K EN
437. ler latches all data values in IREFs 2 The controller executes the other function blocks in the order determined by how they are wired 3 The controller writes outputs in OREFs Function Block Responses In general the function block instructions that maintain history do not update to Overflow Conditions history with ENAN or INF values when an overflow occurs Each instruction has one of these responses to an overflow condition Response 1 Response 2 Response 3 Blocks execute their algorithm and check Blocks with output limiting execute their The overflow condition does not apply These the result for NAN or INF If NAN or algorithm and check the result for NAN or instructions typically have a boolean output XINF the block outputs NAN or INF INF The output limits are defined by the HighLimit and LowLimit input parameters If INF the block outputs a limited result If NAN the output limits are not used and the block outputs NAN ALMNTCH HLL BANDOSRI DEDTPMUL INTG BNOTRESD DERVPOSP PI BORRTOR ESELRLIM PIDE BXORSETD FGENRMPS SCL CUTDTOFR HPFSCRV SOC D2SDTONR LDL2SEL D3SD LDLGSNEG DFF LPFSRTP JKFF MAVESSUM OSFI MAXCTOT MINCUPDN MSTD MUX 648 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B Timing Modes These process control and drives instructions support differe
438. lied This stops the execution of an ASCII serial port instruction and clears the queue 16 E ACL instruction executed 16 F Serial port configuration changed from User mode to System mode This stops the execution of an ASCII serial port instruction and clears the ASCII serial port instruction queue 16 51 The LEN value of the string tag is either negative or greater than the DATA size of the string tag 16 54 The Serial Port Control Length is greater than the size of the buffer 16 55 The Serial Port Control Length is either negative or greater than the size of the Source or Destination 568 Controller name of controller 1 s String Data Types You store ASCII characters in tags that use a string data type You can use the default STRING data type It stores up to 82 characters J Tasks A Trends You can create a new string data type that stores less or more characters Data Types Cj amp User Defined To create a new string data type see Logixd000 Controllers Common Procedures 4 6 Strings publication 1756 PM001 STRING C Predefined Li Module Defined 140 Configuration Each string data type contains the following members Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 Name Data Type Description Notes LEN
439. lock TOFR 01 TOFR mi Timer Off Delay with Reset TimerEnable limit switch1 I timer_state2 Publication 1756 RMOO3K EN P July 2008 123 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Retentive Timer On with Reset RTOR Operands RTOR RTOR tag RTOR Ez Retentive Timer On with Reset E TimerEnable The RTOR instruction is a tetentive timet that accumulates time when TimerEnable is set This instruction is available in relay ladder as two separate instructions RTO see page 112 and RES see page 141 Structured Text Variable Type Format Description RTOR tag FBD TIMER structure RTOR structure Function Block Operands Operand Type Format Description RTOR tag FBD TIMER structure RTOR structure FBD TIMER Structure Input Parameter Data Type Description Enableln BOOL Function Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes TimerEnable BOOL If set this enables the timer to run and accumulate time Default is cleared PRE DINT Timer preset value This is the value in 1msec units that ACC must reach before timing is finished If invalid the instruction sets the appr
440. lot number of the controller PLC 3 processor Destination Link Link ID of the remote DH link where the target device resides PLC 2 processor Destination Node Station address of the target device in octal If there is only one DH link and you did not use the RSLinx software to configure the DH RIO module for remote links specify 0 for both the Source Link and the Destination Link 172 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com If The Destination Device Is a Application on a workstation that is receiving an unsolicited message routed over an EtherNet IP or ControINet network through RSLinx Then Select CIP with Source ID This lets the application receive data from a controller Input Output Instructions MSG GSV SSV IOT Chapter 4 And Specify Source Link Remote ID of the topic in RSLinx software Destination Link Virtual Link ID set up in RSLinx 0 65535 Destination Node Destination ID 0 77 octal provided by the application to RSLinx For a DDE topic in RSLinx use 77 The slot number of the ControlLogix controller is used as the Source Node block transfer module over a RIO Channel Channel A or B of the 1756 DHRIO module that universal remote I O network is connected to the RIO network Rack Rack number octal of the module Group Group number of the module
441. lse to true Important Do not change the FR bit DN BOOL The done bit is set when the last packet of the message is successfully transferred The DN bit is reset the next time the rung condition in goes from false to true Important Do not change the DN bit ST BOOL The start bit is set when the controller begins executing the MSG instruction The ST bit is reset when the DN bit or the ER bit is set Important Do not change the ST bit The controller ignores the change and uses the internally stored value of the bit EN BOOL The enable bit is set when the rung condition in goes true and remains set until either the DN bit or the ER bit is set and the rung condition in is false If the rung condition in goes false but the DN bit and the FR bit are cleared the EN bit remains set Important Do not change the EN bit TO BOOL If you manually set the TO bit the controller stops processing the message and sets the ER bit EN CC BOOL The enable cache bit determines how to manage the MSG connection Refer to Choose a cache option on page 4 173 Connections for MSG instructions going out the serial port are not cached even if the EN_CC bit is set ERR SRC SINT Used by RSLogix 5000 software to show the error path on the Message Configuration dialog box DestinationLink INT To change the Destination Link of a DH or CIP with Source ID message set this member to the required value Publication 1756 RMO03K EN P July 2008 145 Arti
442. ly 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Mask Equal to MEQ The MEQ instruction passes the Source and Compare values through a Mask and compates the results Operands Relay Ladder MEQ Mask Equal Source i Operand Type Format Description Mask k Source SINT immediate value to test against Compare Compare E INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Mask SINT immediate defines which bits to block or pass INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Compare SINT immediate value to test against Source INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Structured Text B Structured text does not have an MEQ instruction but you can achieve the same results using structured text IF Source AND Mask Compare AND Mask THEN lt statement gt END IF MEQ 04 Function Block MEO 5j Mask Equal Operand Type Format Description MEQ tag FBD_MASK_EQUAL structure MEO structure Cj Compare Publication 1756 RMOOSK EN P July 2008 237 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Input Parameter Enableln Data Type BOOL FBD_MASK_EQUAL Structure Descr
443. ly 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Parameter Data Type Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Description DN BOOL Timing done output Indicates when the accumulated time is greater than or equal to the preset value Status DINT Status of the function block InstructFault Status 0 BOOL The instruction detected one of the following execution errors This is not a minor or major controller error Check the remaining status bits to determine what occurred Presetinv Status 1 BOOL The preset value is invalid Description The TONR instruction accumulates time until the enable bit EN timer timing bit TT timer done bit DN e TONR instruction is disabled e ACC 2 PRE The time base is always 1 msec For example for a 2 second timer enter 2000 for the PRE value TimerEnable ON delay preset 2 ooo LLL LLL Lll IN timer did not 16649 timer accumulated value ACC g JL 4 reach PRE value Publication 1756 RMOO3K EN P July 2008 Set the Reset input parameter to reset the instruction If TimerEnable is set when Reset is set the TONR instruction begins timing again when Reset is cleared A timer runs by subtracting the time of its last scan from the time now ACC ACC current time last tim
444. m Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false DN bit 0 no INC mode gt internal bit is cleared examine DN bit yes EN bit is cleared EN bit is cleared ALL mode ER bit is cleared yes m es Y J LEN 0 no yes no no POS POS 1 yes 8 no DN bit is set 9 Y yes DN bit is set g mode LEN numeric Y mode page 341 rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 347 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Condition rung condition in is true ER bit 1 examine ER bit ER bit 0 examine IN bit v bit 0 ag examine DN bit DN bit 1 i DN bit 1 DN bit 0 Relay Ladder Action page 341 numeric mode no no no ALL mode yes yes yes DN bit is set INC Ai mode mode page 339 page 340 lt q loop_count loop count 1 no loop
445. m value is reached the counter leaves the value at the maximum count value LLInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the Low Low condition limit for the most recent transition to the active state LLAlarmCount DINT The number of times the Low Low condition has been activated If the maximum value is reached the counter leaves the value at the maximum count value ROCPosInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the positive rate of change condition limit for the most recent transition to the active state ROCPosInAlarmCount DINT The number of times the positive rate of change condition has been activated If the maximum value is reached the counter leaves the value at the maximum count value ROCNegInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the negative rate of change condition limit for the most recent transition to the active state ROCNegAlarmCount DINT The number of times the negative rate of change condition has been activated If the Publication 1756 RMO003K EN P July 2008 Year maximum value is reached the counter leaves the value at the maximum count value 51 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Outpu
446. ment the sequencer array The SQI instruction compares the source value The ADD instruction increments the sequencer array The GRT determined whether another value is available to check in the sequencer array The MOV instruction resets the position value after completely stepping through the sequencer array one time ADD Add Source control 1 pos p Source B 1 Dest control 1 pos p MOV Move Source 1 Dest control 1 pos 0 423 Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Sequencer Output SQ0 The SQO instruction sets output conditions for the next step of a sequence pair of SQO SQI instructions Operands 1 Relay Ladder sao Fle Output CEN gt Operand Type Format Description Mask Array DINT array tag sequencer array Dest pei specify the first element of the sequencer Position array do not use CONTROL POS in the subscript Mask SINT tag which bits to block or pass INT immediate DINT A SINT or INT tag converts to a DINT value by sign extension Destination DINT tag output data from the sequencer array Control CONTROL tag control structure for the operation typically use the same CONTROL as the SQI and SQL instructions Length DINT immediate number of elements in the Array sequencer table to output Position DINT immediate current position in the array initial value is typically 0 CONTROL Structure Mnemonic Data Ty
447. mode Type INT GSV Identifies the device as a controller Controller 14 Vendor INT GSV Identifies the vendor of the device Allen Bradley 0001 182 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Access the CST object The CST coordinated system time object provides coordinated system time for the devices in one chassis Attribute Data Type Instruction Description CurrentStatus INT GSV Current status of the coordinated system time Bits identify Bit Meaning 0 timer hardware faulted the device s internal timer hardware is in a faulted state 1 ramping enabled the current value of the timer s lower 16 bits ramp up to the requested value rather than snap to the lower value These bits are manipulated by the network specific tick synchronization method 2 system time master the CST object is a master time source in the ControlLogix system 3 synchronized the CST object s 64 bit CurrentValue is synchronized by a master CST object via a system time update 4 local network master the CST object is the local network master time source 5 in relay mode the CST object is acting in a time relay mode 6 duplicate master detected a duplicate local network time master has been detected This bit is always 0 for time dependent nodes 7 unused
448. n Relay Ladder light 2 Structured Text IF BOOL expression THEN light 2 1 END IF Publication 1756 RMOO3K EN P July 2008 85 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Output Unlatch OTU Operands f EY Description Arithmetic Status Flags Fault Conditions Execution Condition prescan rung condition in is false The OTU instruction clears unlatches the data bit Relay Ladder Operand Type Format Description data bit BOOL tag bit to be cleared Structured Text Structured text does not have an OTU instruction but you can achieve the same results using an IE THEN construct and an assignment IF BOOL expression THEN data bit 0 END IF See Appendix 641B Function Block Attributes for information on the syntax of constructs expressions and assignments within structured text When enabled the OTU instruction clears the data bit When disabled the OTU instruction does not change the status of the data bit not affected none Relay Ladder Action The data bit is not modified The rung condition out is set to false The data bit is not modified The rung condition out is set to false rung condition in is true postscan 86 The data bit is cleared The rung condition out is set to true The
449. n have as many as 40 characters contain letters numbers and underscores 434 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Arithmetic Status Flags Fault Conditions Execution Condition prescan A Major Fault Will Occur If label does not exist 4 not affected Fault Type Relay Ladder Action The rung condition out is set to false Chapter 11 Fault Code 42 rung condition in is false The rung condition out is set to false rung condition in is true The rung condition out is set to true Execution jumps to the rung that contains the LBL instruction with the referenced label name postscan The rung condition out is set to false Example When the JMP instruction is enabled execution jumps over successive rungs of logic until it reaches the rung that contains the LBL instruction with label 20 label 20 HP other rungs of code label 20 LBL J Publication 1756 RMOO3K EN P July 2008 435 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Jump to Subroutine JSR Subroutine SBR Return RET JSR Operands JSR Jump to Subroutine Routine name Input par Return par 436
450. n rung condition in is false EU bit is cleared LEN lt 0 yes V POS lt 0 yes r EM is cleared EM is set yes EM is set no u E DN is set no q rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 415 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Condition Relay Ladder Action rung condition in is true EU bit is set mn no es POS lt 0 4 Y EM bit is cleared EM bit is set POS lt 0 Y EM bit is set iti es EM bit is cleared y EM bitis set i no yes es EM bit is set d Destination 0 no no Wo es y POS LEN yes TR POS gt LEN Mp DN bit is set no no POS POS 1 LEN size of array Destination LIFO control POS U rung condition out is set to true postscan The rung condition out is set to false 416 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Example
451. n Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the math instruction Valid any float Publication 1756 RMOO3K EN P July 2008 535 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Input Parameter Data Type Output Parameter Data Type Description Description The instruction produced a valid result Result of the math instruction Arithmetic status flags are set for this output EnableOut BOOL Dest REAL Description Arithmetic Status Flags Fault Conditions Execution Condition prescan The resulting value in the Destination is always greater than or equal to 7 2 and less than or equal to 1 2 where x 3 141593 Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller calculates the arc tangent of the Source and places the result in the Destination The rung condition out is set to true postscan The rung condition out is set to false Condition prescan Function Block Action No action taken instruction first scan No action taken instruction first run
452. n 1756 RM003K EN P July 2008 143 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Message MSG Operands MSG Message N ee Message Contre JN 2 Message Control mi ERS MSG MessageControl 144 The MSG instruction asynchronously reads or writes a block of data to another module on a network Relay Ladder Operand Type Format Description Message MESSAGE tag message structure control Structured Text The operands are the same as those for the relay ladder MSG instruction MESSAGE Structure ATTENTION A IMPORTANT If you check the status bits more than once The controller changes the DN ER EW and ST bits asynchronous to the scan of your logic Use a copy of the bits if you check them in more than one place in your logic Otherwise the bits may change during the scan and your logic won t work as you expect it One way to make a copy is to use the FLAGS word Copy the FLAGS word to another tag and check the bits in the copy Do not change the following status bits of a MSG instruction e DN e EN e ER e EW e ST Do not change those bits either by themselves or as part of the FLAGS word If you do the controller may have a non recoverable fault The controller clears the project from its memory when it has a non recoverable fault Publication 1756 RMO03K EN P July
453. n Relay Ladder Action prescan The rung condition out is set to false Publication 1756 RMOOS3K EN P July 2008 141 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Condition Relay Ladder Action rung condition in is false The rung condition out is set to false rung condition in is true The RES instruction resets the specified structure The rung condition out is set to true postscan The rung condition out is set to false 142 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter Input Output Instructions MSG GSV SSV IOT Introduction The input output instructions read or write data to or from the controller or a block of data to or from another module on another network If You Want To Use This Instruction Available In These Languages See Page send data to or from another module MSG relay ladder 144 structured text get controller status information GSV relay ladder 176 structured text set controller status information SSV relay ladder 176 structured text e send output values to an I O module or IOT relay ladder 201 consuming controller at a specific point in your logic structured text e trigger an event task in another controller Publicatio
454. n automatically resumes Publication 1756 RMOO3K EN P July 2008 507 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID The PID instruction supports two manual modes of control Manual Mode of Control Description software manual SWM also known as set output mode lets the user set the output 96 from the software The set output S0 value is used as the output of the loop The set output value typically comes from an operator input from an operator interface device manual MO takes the tieback value as an input and adjusts its internal variables to generate the same value at the output The tieback input to the PID instruction is scaled to 0 100 according to the values of MINTIE and MAXTIE and is used as the output of the loop The tieback input typically comes from the output of a hardware hand auto station which is bypassing the output from the controller Note Manual mode overrides software manual mode if both mode bits are set on The PID instruction also automatically provides bumpless transfers from software manual mode to auto mode or from manual to auto mode The PID instruction back calculates the value of the integral accumulation term required to make the CV output track either the set output SO value in software manual mode or the tieback input in manual mode In this manner when the loop switche
455. n for 180 msec imer 2 is timing When Zer 2 ac teaches 180 Jigbt 2 goes off and igh 3 goes on Light_3 remains on until the TOF instruction is enabled If zX3 ssitch 2 is set while timer_2 is timing Zghz 2 goes off lirit switch 2 TOF Timer Off Delay Timer timer_2 N gt Preset 180 Accum of timer 2 tt timer 2 dn Publication 1756 RMOO3K EN P July 2008 111 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Retentive Timer On RTO The RTO instruction is a tetentive timer that accumulates time when the instruction is enabled This instruction is available in structured text and function block as RTOR see page 124 Operands Relay Ladder RTO FEE Retentive Timer On EN Operand Type Format Description Tre IN Timer TIMER tag timer structure reset f Accum Preset DINT immediate how long to delay accumulate time Accum DINT immediate number of msec the timer has counted initial value is typically 0 TIMER Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the RTO instruction is enabled TT BOOL The timing bit indicates that a timing operation is in process DN BOOL The dore bit indicates that ACC gt PRE PRE DINT The preset value specifies the value 1 msec units which the a
456. n here My tracepoint Tag 1 e and Tag 2 d 631 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 20 Debug Instructions BPT TPT The slot number indicates the slot containing the emulator module that has The e formats the first traced tag as double precision float with an exponent and od formats the second traced tag as a signed decimal integer In this case you would have a tracepoint instruction that has two Trace This operands one for a REAL and one for an INT although the value of any tag can be formatted with any flag The resulting tracepoint window that would appear when the tracepoint is triggered would look like this The heading the text preceding the colon in the format string appears here the tracepoint or breakpoint being traced in the trace window Arithmetic Status Flags Fault Conditions Execution Condition prescan Slot 1 My Tracepoint Tag 1 6 488484e 002 and Tag 2 443 Tag 1 6 617994e 002 and Tag 2 447 The text for the REAL represented in P the format string as e appears here The text for the INT represented in the format string as d appears here zi Freeze Display Freeze Log Clear Display il not affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition
457. n lets you compate two string tags You cannot enter ASCII characters directly into the expression Only the following operators are permitted Operator Description equal lt less than lt less than or equal gt greater than gt greater than or equal lt gt not equal e Strings are equal if their characters match e ASCII characters ate case sensitive Upper case A 41 is not equal to lower case a 61 The hexadecimal values of the characters determine if one string is less than or greater than another string For the hex code of a character see the back cover of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater 210 DAH DO z D c C Os c ASCII Characters Hex Codes 1ab 31 61 62 1b 31 62 A 41 AB 41 42 B 42 a 61 ab 61 62 AB lt B a gt B Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Chapter 5 Equal to EQU The EQU instruction tests whether Source A is equal to Source B Operands Relay Ladder EQU Equal Operand Type Format Description Source Source A SINT immediate value to test against Source B Source B INT tag DINT REAL strin
458. n of InputBit instruction clears InputBit The instruction executes EnableOut is set EnableOut is cleared the instruction does nothing na the On a cleared to set transition of InputBit the instruction clears InputBit Enableln is always set The instruction executes postscan 100 No action taken Artisan Technology Group Quality Instrumentation No action taken Publication 1756 RMO03K EN P July 2008 Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example When zz switch goes from set to cleared the OSFI instruction sets Publication 1756 RMOO3K EN P July 2008 OutputBit for one scan Structured Text OSFI Ol InputBit limit switchl OSFI OSFI 01 Output state OSFI 01 OutputBit Function Block OSFI 02 One Shot Falling with Input 0 OutputBit p t Ouput_state 0 limit switch1 a 0 InputBit Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 101 Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Notes 102 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter J Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES In
459. n the Destination When you read or write ASCH characters you typically do not need to swap characters The ASCII read and write instructions ARD ARL AWA AWT automatically swap characters as shown below bar code reader ARD p_a ASCII Read BA Channel 5 o o a i gt Destination bat_code 0 SerialPort Control bar_code_read 42969 SerialPort Control Lenath 2 Characters Read 2 42968 AB Arithmetic Status Flags not affected Fault Conditions none B e JM9 bar code 0 Tag Name Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The rung condition out is set to true na Enableln is set na Enableln is always set The instruction executes instruction execution The instruction rearranges the specified bytes The instruction rearranges the specified bytes postscan The rung condition out is set to false No action taken 300 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Example 1 The three SWPB instructions each reorder the bytes of DINT_
460. n the Destination Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false The rung condition out is set to false rung condition in is true Destination Source B Source A The rung condition out is set to true postscan The rung condition out is set to false 256 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example Subtract f oat value 2 from float value 1 and place the result in subtract_result Relay Ladder SUB Subtract Source float value 1 00 Source B float value 2 00 Dest subtract result 0 0 Structured Text subtract result float value 1 float value 2 Function Block SUB 01 SUB Subtract 0 0 float_value_1 C SourceA subtract_result C SourceB float value 2 Publication 1756 RMOO3K EN P July 2008 257 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www
461. n the negative rate of change condition is normal inactive acknowledged or both Suppressed BOOL Suppressed status of the alarm Set when the alarm is suppressed Cleared when the alarm is not suppressed Disabled BOOL Disabled status of the alarm Set when the alarm is disabled Cleared when the alarm is enabled MinDurationACC DINT Elapsed time since an alarm condition was detected When this value reaches MinDurationPRE all detected alarm level conditions become active xInAlarm is set and a notification is sent to clients HHInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the High High condition limit for the most recent transition to the active state HHAlarmCount DINT The number of times the High High condition has been activated If the maximum value is reached the counter leaves the value at the maximum count value HinAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the High condition limit for the most recent transition to the active state HAlarmCount DINT The number of times the High condition has been activated If the maximum value is reached the counter leaves the value at the maximum count value LInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value exceeded the Low condition limit for the most recent transition to the active state LAlarmCount DINT The number of times the Low condition has been activated If the maximu
462. nableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source A REAL Value of the multiplicand Valid any float Source B REAL Value of the multiplier Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The MUL instruction multiplies Source A with Source B and places the result Arithmetic Status Flags Fault Conditions Condition prescan rung condition in is false Execution in the Destination Arithmetic status flags ate affected none Relay Ladder Action The rung condition out is set to false The rung condition out is set to false rung condition in is true Destination Source B x Source A The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 259 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Function Block 3 Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instructi
463. nal control device valve damper etc variable INT If you are using the deadband the Control variable must be REAL or it will be forced to 0 when the error is within the deadband DINT REAL PID master PID structure optional PID tag for the master PID loop If you are performing cascade control and this PID is a slave loop enter the name of the master PID Enter 0 if you don t want to use this parameter Inhold bit BOOL tag optional current status of the inhold bit from a 1756 analog output channel to support bumpless restart Enter 0 if you don t want to use this parameter Inhold value SINT tag optional data readback value from a 1756 analog output channel to support bumpless INT DINT REAL Publication 1756 RMOO3K EN P July 2008 restart Enter 0 if you don t want to use this parameter 497 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Operand Type Format Description Setpoint displays current value of the setpoint Process displays current value of the scaled Process Variable variable Output 96 displays current output percentage value Structured Text PID PID ProcessVariable Tieback ControlVariable PIDMasterLoop InholdBit The operands are the same as those for the relay ladder PID instruction However you specify the Setpoint Process Variable and Output by accessing the SP PV and
464. ncer Dutput N Amay array_dint 0 Mask 158OF F N Dest value 1 Control control 1 Length 10 Position of SQ0 Operand Example Values Using INTS Displayed In Binary Array XXXXXXXX XXXXXXXX XXXX0101 xxxx1010 Mask 00000000 00000000 00001111 00001111 Destination XXXXXXXX XXXXXXXX XXXx0101 xxxx1010 A 0 in the mask means the bit is not compared designated by xxxx in this example Using SOI with SQO If you pair an SQI instruction with an SQO instruction make sure that both instructions use the same Control Length and Position values Array Mask Source Control Length S FS Sequencer Input Position Sal go Sequencer Output Array array dint O Mask 18H0FO0F Dest value 1 Control control 1 Lenath 10 Position of array_dint 0 16 0F0F value 2 control 1 10 0 Resetting the position of SQ0 Each time the controller goes from Program to Run mode the SQO instruction clears initializes the POS value To reset POS to the initialization value POS 0 use a RES instruction to clear the position value This example uses the status of the first scan bit to clear the POS value control 1 RES Publication 1756 RMOO3K EN P July 2008 221 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Load SQL Array Source Control Lenath Position SQL Sequencer Load Operands
465. nd requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 385 Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Bit Shift Left BSL Operands BSL _ Bit Shift Left CEN 25 Array mE Control CDN Source Bit Lenath The BSL instruction shifts the specified bits within the Array one position left Relay Ladder Operand Type Format Description Array DINT array tag array to modify specify the first element of the group of elements do not use CONTROL POS in the subscript Control CONTROL tag control structure for the operation Source bit BOOL tag bit to shift Length DINT immediate number of bits in the array to shift CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the BSL instruction is enabled DN BOOL The done bit is set to indicate that bits shifted one position to the left UL BOOL The unload bit is the instruction s output The UL bit stores the status of the bit that was shifted out of the range of bits ER BOOL The error bit is set when LEN 0 LEN DINT The length specifies the number of array bits to shift Description When enabled the instruction unloads the uppermost bit of the specified bits IMPORTANT Arithmetic Status Flags Fault Conditions
466. ndition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The instruction copies and shifts the Source bits to the Destination The rung condition out is set to true postscan The rung condition out is set to false Example 1 When enabled the BTD instruction moves bits within va ue_1 BTD Bit Field Distribute Source value 1 2111 1111 1111 1111 1111 1000 0000 0000 Source Bit 3 Dest value 1 281111 1111 1111 1111 1111 1000 0000 0000 Dest Bit 10 Length B destination bit source bit vaue 111 1 1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 before BTD instruction i vadue 1111 111 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 after BTD instruction The shaded boxes show the bits that changed in value 1 292 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Example 2 When enabled the BTD instruction moves 10 bits from value_1 to value 2 BTD Bit Field Distribute Source value 1 2111 1111 1111 1111 1111 1000 0000 0000 Source Bit 3 Dest value 2 2 0000_0000_0000_0000_0000_0000_0000_0000 Dest Bit 5 Lengt
467. nds EN BOOL Timer enabled output Indicates the timer instruction is enabled 120 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Input Parameter Data Type Description TT BOOL Timer timing output When set a timing operation is in progress DN BOOL Timing done output Indicates when accumulated time is greater than or equal to preset Status DINT Status of the function block InstructFault Status 0 BOOL The instruction detected one of the following execution errors This is not a minor or major controller error Check the remaining status bits to determine what occurred Presetinv Status 1 BOOL The preset value is invalid Description The TOFR instruction accumulates time until the e TOEFR instruction is disabled e ACC 2 PRE The time base is always 1 msec For example for a 2 second timer enter 2000 for the PRE value TimerEnable enable bit EN timer timing bit TT timer done bit DN OFF delay a gt preset oce etai NRI em ap Fi timer accumulated value ACC m A 16650 timer did not reach PRE value Set the Reset input parameter to reset the instruction If TimerEnable is cleared when Reset is set the TOFR instruction does not begin timing again when
468. ne if one string is less than or greater than another string For the hex code of a character see the back cover of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater ASCII Characters Hex Codes 1ab 31 61 62 LA a b 31862 e r A 41 S e n S a AB 41 42 AB B e t l i B 42 r a 61 a B Y ab 61 62 216 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Arithmetic Status Flags not affected Fault Conditions none Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Source A gt Source B rung condition out is set to true rung condition out is set to false nt a postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Publication 1756 RMOOS3K EN P July 2008
469. nfiguration dialog box to specify the details of the message Details dp 5 PSP MSG Message EN MSG message hDN CER DH Click here to configure the MSG instruction The details you configure depend on the message type you select Message Configuration Message_1 EI Configuration Communication Tag Message Type cip Data Table Read Source Element Number Of Elements z Destination Element New Tag 42976 If The Target Device Is a Select One Of These Message Types See Page Logix5000 controller CIP Data Table Read 160 CIP Data Table Write 1 0 module that you configure using Module Reconfigure 161 RSLogix 5000 software CIP Generic 162 PLC 5 controller PLC5 Typed Read 163 PLC5 Typed Write PLC5 Word Range Read PLC5 Word Range Write SLC controller SLC Typed Read 165 MicroLogix controller SLC Typed Write Block transfer module Block Transfer Read 165 Block Transfer Write PLC 3 processor PLC3 typed read 166 PLC3 typed write PLC3 word range read PLC3 word range write PLC 2 processor PLC2 unprotected read 167 PLC2 unprotected write Publication 1756 RMOOS3K EN P July 2008 159 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT You must specify this configuration information For This Property Specify Source Element e f you select a read message type the Source Element is the address of the data y
470. nfigure message to send new configuration information to an I O module During the reconfiguration Input modules continue to send input data to the controller Output modules continue to control their output devices A Module Reconfigure message requites this configuration propetties In This Property Select Message Type Module Reconfigure Example To reconfigure an I O module 1 Set the required member of the configuration tag of the module to the new value 2 Send a Module Reconfigure message to the module When reconfigure 5 is set set the high alarm to 60 for the local module in slot 4 The Module Reconfigure message then sends the new alarm value to the module The one shot instruction prevents the rung from sending multiple messages to the module while the reconfigure 5 is on Relay Ladder reconfigure 5 reconfigure 6 MOY E T 0NS Move Source 60 Dest Local 4 C Ch Config HAlarmLimit 750 change Halarm EN MSG Type Module Reconfigure Message Control change_Halarm E ND Structured Text IF reconfigure 5 AND NOT reconfigure 6 THEN Local 4 C Ch0Config HAlarmLimit 60 IF NOT change Halarm EN THEN MSG change Halarm END IF END IF reconfigure 6 reconfigure 5 Publication 1756 RMOO3K EN P July 2008 161 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg c
471. nformation about a routine Specify the routine name to determine which ROUTINE object you want Instruction Description GSV Provides the instance number of this ROUTINE object Valid values are 0 65 535 Access The SERIALPORT Object The SERIALPORT object provides an interface to the serial communication pott Instruction Description GSV Specifies the baud rate Valid values are 110 300 600 1200 2400 4800 9600 and 19200 default GSV Specifies the number of bits of data per character Value Meaning 7 7 data bits ASCII only 8 8 data bits default Parity RTSOffDelay SINT INT GSV Specifies the parity Value Meaning 0 no parity no default 1 odd parity ASCII only 2 even parity GSV Amount of time to delay turning off the RTS line after the last character has been transmitted Valid value 0 32 767 Delay in counts of 20 msec periods The default is 0 msec RTSSendDelay INT GSV Amount of time to delay transmitting the first character of a message after turning on the RTS line Valid value 0 32 767 Delay in counts of 20 msec periods The default is 0 msec StopBits SINT GSV Specifies the number of stop bits Value Meaning 1 1 stop bit default 2 2 stop bits ASCII only PendingBaudRate Publication 1756 RM DINT 003K EN P July 2008 SSV Pending value for the BaudRate attribute 193 Artisan Technology Group Quality Instrumentation Guarant
472. ng CMP 206 see if the characters are equal to specific characters EQU 211 see if the characters are not equal to specific characters NEQ 242 see if the characters are equal to or greater than specific characters GEQ 211 see if the characters are greater than specific characters GRT 219 see if the characters are equal to or less than specific characters LEQ 223 see if the characters are less than specific characters LES 227 rearrange the bytes of a INT DINT or REAL tag SWPB 299 find a string in an array of strings FSC 346 convert characters to a SINT INT DINT or REAL value STOD 614 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 599 Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID If you want to Use this instruction See page convert characters to a REAL value STOR 616 convert a SINT INT DINT or REAL value to a string of ASCII characters DTOS 619 convert REAL value to a string of ASCII characters RTOS 621 String Data Types You store ASCII characters in tags that use a string data type i s name of controller You can use the default STRING data type It stores up to 82 characters asks Sa Trends e You can create a new string data type that stores less or more characters E Data Types i User Defined d 5 8 Strings Mj STRING H O Predefined Ca Module Defined To create a new
473. ng tag string to copy characters String data types are from e default STRING data type e any new string data type that you create Quantity SINT immediate number of characters to The Start plus the Quantity must be less than or copy equal to the DATA size of the Source INT tag DINT Start SINT immediate position of the first Enter a number between 1 and the DATA size of character to copy the Source INT tag DINT Destination string tag string to copy the MID Source Qty Start Dest Description Arithmetic Status Flags Publication 1756 RMOO3K EN P July 2008 characters to Structured Text The operands are the same as those for the relay ladder MID instruction The MID instruction copies a group of characters from the Source and places the result in the Destination e The Start position and Quantity define the characters to copy Unless the Source and Destination are the same tag the Source remains unchanged not affected 609 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 18 ASCII String Instructions CONCAT DELETE FIND INSERT MID Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is 1 Check that no instruction is writing to the LEN member of the string tag greater than the DATA size of the string tag 2 In the LEN value enter the number of characters that the string contains
474. nges to take effect Specify PV unscaled maximum Enter a maximum PV value MAXI that equals the maximum unscaled value received from the analog input channel for the PV value PV unscaled minimum Enter a minimum PV value MINI that equals the minimum unscaled value received from the analog input channel for the PV value PV engineering units maximum Enter the maximum engineering units corresponding to MAXI MAXS PV engineering units minimum CV maximum Enter the minimum engineering units corresponding to MINI MINS Enter a maximum CV value corresponding to 100 MAXCV CV minimum Enter a minimum CV value corresponding to 0 MINCV Tieback maximum Enter a maximum tieback value MAXTIE that equals the maximum unscaled value received from the analog input channel for the tieback value Tieback minimum PID Initialized Using PID Instructions Publication 1756 RMOO3K EN P July 2008 Enter a minimum tieback value MINTIE that equals the minimum unscaled value received from the analog input channel for the tieback value If you change scaling constants during Run mode turn this off to reinitialize internal descaling values INI PID closed loop control holds a process variable at a desired set point The following figure shows a flow rate fluid level example setpoint error PID equation flow rate process variable contro
475. njury or death property damage or economic loss IMPORTANT Identifies information that is critical for successful application and understanding of the product Identifies information about practices or circumstances that can lead to personal injury or death property damage or economic loss Attentions help you identify a hazard avoid a hazard and recognize the consequence ATTENTION INA awa Labels may be on or inside the equipment for example a drive or motor to alert people that dangerous voltage may be present TENET Labels may be on or inside the equipment for example a drive or motor to alert people that surfaces may reach dangerous temperatures gt gt eiie Allen Bradley Rockwell Automation and TechConnect are trademarks of Rockwell Automation Inc Trademarks not belonging to Rockwell Automation are property of their respective companies Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Preface Logix5000 Controllers General Instructions FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Publication 1756 RMOO3K EN P July 2008 Table of Contents Introductio iau soe rrine badia a nae ad dora er 3 d babaa dts 23 Who Should Use This Manual eene 23 putposeor This Manuals iu ue au dur en og o a ERO 24 Common Information for All Instructions 0000005 25 Conventions and Related Terms o nn
476. ns lt gt together as an operator within statements an expression This expression evaluates whether sourceA is not equal to sourceD See Appendix C Structured Text Programming for information on the syntax of expressions within structured text 242 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Fal NEQ_O4 NEQ Ez Not Equal SourceA Dest SourceB Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Function Block Operand Type Format Description NEQ tag FBD COMPARE structure NEO structure FBD COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder NEO instruction Description The NEQ instruction tests whether Source A is not equal to Source B Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group When you compate strings e Strings are not equal if any o
477. ns ABL ACB ACL AHL ARD ARL AWA AWT When the temperature exceeds the high limit zezzp bigh is set the AWA instruction sends a message to a MessageView terminal that is connected to the serial port of the controller The message contains five characters from the DATA member of the s rizg 1 tag which is a string The 14 counts as one character It is the hex code for the Ctrl T character The instruction also sends appends the characters defined in the controller properties In this example the AWA instruction sends a carriage return 0D which marks the end of the message Relay Ladder AWA ASCII Write Append E Channel 0 Source string 1 DND 1425 1 SerialPort Control temp_high_write SerialPort Control Length 5 Characters Sent 6 Structured Text IF temp high THEN temp high write LEN AWA 0 string 1 temp high write temp high 0 END IF Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 Example 2 alarm Publication 1756 RMOO3K EN P July 2008 When a arm is set the AWA instruction sends the specified number of characters in a arm_msg and appends a termination character s Because the number of characters in a arzz sg varies the rung first moves the length of the string a
478. ns CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 If Source B the divisor is zero a minor fault occurs Type 4 program fault Code 4 arithmetic overflow e the destination is set as follows If Source B Is Zero And And The Destination Is a And The Result Is Then The Destination Is Set To all operands are integers SINT INT gt gt Source A or DINT at least one operand is a REAL SINT INT or DINT positive 1 negative 0 REAL positive 1 positive infinity negative 1 negative infinity To detect a possible divide by zero examine the minor fault bit S MINOR See Logix5000 Controllers Common Procedures publication 1756 PMO001 Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions A Minor Fault Occurs If Fault Type Fault Code the divisor is zero 4 4 Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Destination Source A Source B The rung condition out is set to true postscan The rung condition out is set to false Publication 1756 RMOOS3K EN P July 2008 263 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 Condition prescan Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Function Block Action
479. nstruction is done but it is asynchronous to the logic scan RN BOOL The run bit indicates that the instruction is executing EM BOOL The empty bit indicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit does not apply to this instruction POS DINT The position stores the status of the control lines ERROR DINT The error contains a hexadecimal value that identifies the cause of an error Description The AHL instruction can obtain the status of the control lines of the serial port e turn on or off the data terminal ready DTR signal e turn on or off the request to send signal RTS To program the AHL instruction follow these guidelines 1 Configure the serial port of the controller If Your Application Then uses ARD or ARL instructions Select User mode does not use ARD or ARL Select either System or User mode instructions 2 Use the following table to select the correct values for the ANDMask and ORMask operands ANDMask Value ORMask Value off off 3 0 on 1 2 unchanged 1 0 on off 2 1 on 0 3 unchanged 0 1 unchanged off 2 0 on 0 2 unchanged 0 0 578 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 3 This is a trans
480. nstruction is scanned In relay ladder and structured text if you want to programmatically access the alarm structure assign the structure tag to the parameter on the instruction For example to use MyAnalogAlarm ProgAck in logic assign the tag MyAnalogAlarm ProgAck to the ProgAck parameter ALMA Analog Alarm ALMA MyAnalogAlarm HHin amp larm 3 In Amplitude Hin amp larm oo LinAlarm Prog AckAII My amp nalogAlarm ProgA amp ckAll LLInAlarm De ROCPoslnAlarm ProgDisable MyAnalogA amp larm ProgDisable ROCNeglnAlarm De HHAcked eem ProgEnable My amp nalog amp larm ProgEnable HAcked em De LAcked em HHLimit 1000 0 LLAcked eem HLimit 100 0 ROCPosAcked em LLimit 200 ROCNegAcked em LLLimit 100 Suppressed Disabled InstructFault Suppress or Disable Alarms Suppress alarms to remove alarms you know exist from the HMI but still keep the alarms alive This lets you clear the alarm summary while you are resolving a known alarm without continuing to view alarm information A suppressed alarm does not appear on the operator summary or banner screens but a suppressed alarm is still sent to subscribers logged in the historical database able to transition alarm status time stamped and responsive to other programmatic or operator interactions e When an alarm is Suppressed it continues to function normally monitor the In parameter for alarm conditions and respond to Acknowledge req
481. nstrumentation Guaranteed 888 88 SOURCE www artisantg com Preface Logix5000 Controllers General Instructions 26 Relay ladder rung condition The controller evaluates ladder instructions based on the rung condition preceding the instruction rung condition in Based on the rung condition in and the instruction the controller sets the rung condition following the instruction rung condition out which in turn affects any subsequent instruction input instruction output instruction Z rung in rung out condition condition If the rung in condition to an input instruction is true the controller evaluates the instruction and sets the rung out condition based on the results of the instruction If the instruction evaluates to true the rung out condition is true if the instruction evaluates to false the rung out condition is false The controller also prescans instructions Prescan is a special scan of all routines in the controller The controller scans all main routines and subroutines during prescan but ignores jumps that could skip the execution of instructions The controller executes all FOR loops and subroutine calls If a subroutine is called more than once it is executed each time it is called The controller uses prescan of relay ladder instructions to reset non retentive I O and internal values During prescan input values are not current and outputs are not written The following
482. nt timing modes DEDT LDLG RLIM DERV LPF SCRV HPF NTCH SOC INTG PI TOT LDL2 PIDE There are three different timing modes Timing Mode Description periodic Periodic mode is the default mode and is suitable for most control applications We recommend that you place the instructions that use this mode in a routine that executes in a periodic task The delta time DeltaT for the instruction is determined as follows If The Instruction Then DeltaT Equals Executes In a periodic task period of the task event or continuous elapsed time since the previous execution task The controller truncates the elapsed time to whole milliseconds ms For example if the elapsed time 10 5 ms the controller sets DeltaT 10 ms The update of the process input needs to be synchronized with the execution of the task or sampled 5 10 times faster than the task executes in order to minimize the sampling error between the input and the instruction oversample In oversample mode the delta time DeltaT used by the instruction is the value written into the OversampleDT parameter of the instruction If the process input has a time stamp value use the real time sampling mode instead Add logic to your program to control when the instruction executes For example you can use a timer set to the OversampleDeltaT value to control the execution by using the Enableln input of the instruction The process input needs to be sampled 5 10 times faster than the instruc
483. ntact your local distributor or Rockwell Automation representative or visit http suppott rockwellautomation com Installation Assistance If you expetience a problem with a hardware module within the first 24 hours of installation please review the information that s contained in this manual You can also contact a special Customer Support number for initial help in getting your module up and running United States 1 440 646 3223 Monday Friday 8am 5pm EST Outside United Please contact your local Rockwell Automation representative for any States technical support issues New Product Satisfaction Return Rockwell tests all of its products to ensure that they are fully operational when shipped from the manufacturing facility However if your product is not functioning and needs to be returned United States Contact your distributor You must provide a Customer Support case number see phone number above to obtain one to your distributor in order to complete the return process Outside United Please contact your local Rockwell Automation representative for States return procedure Power Control and Information Solutions Headquarters Americas Rockwell Automation 1201 South Second Street Milwaukee WI 53204 2496 USA Tel 1 414 382 2000 Fax 1 414 382 4444 Europe Middle East Africa Rockwell Automation Vorstlaan Boulevard du Souverain 36 1170 Brussels Belgium Tel 32 2 663 0600 Fax 32 2 663 0640
484. ntains the EOT instruction If the calling routine is not a transition the EOT instruction acts as a TND instruction see page 450 The Logix implementation of the EOT instruction differs from that in a PLC 5 controller In a PLC 5 controller the EOT instruction has no parameters Instead the PLC 5 EOT instruction returns rung condition as its state In a Logix controller the return parameter returns the transition state since rung condition is not available in all Logix programming languages not affected none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction returns the data bit value to the calling routine postscan 458 The rung condition out is set to false No action taken Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Example When both Zzz switch and interlock_1 are set set state After Hmer_1 completes FOT returns t
485. ntg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 3 Each time the instruction executes do you always send the same number of characters Yes Then In the Serial Port Control Length enter the number of characters to send No Arithmetic Status Flags not affected Fault Conditions none Before the instruction executes set the LEN member of the Source tag to the LEN member of the Serial Port Control tag Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction sends a specified number of characters and appends either one or two predefined characters The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 No action taken 591 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 Example 1 temp high 592 ASCII Serial Port Instructio
486. ntrol Length and the Characters Read values by accessing the LEN and POS members of the Publication 1756 RMOO3K EN P July 2008 585 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT SERIAL PORT CONTROL structure rather than by including the values in the operand list SERIAL PORT CONTROL Structure Mnemonic DataType Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL The run bit indicates that the instruction is executing CEM BOO X Theemptybitindicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit does not apply to this instruction LEN DINT The length indicates the maximum number of characters to move to the destination that is when to stop reading if no termination characters are found POS DINT The position displays the number of characters that were read ERROR DNT Theerror contains a hexadecimal value that identifies the cause of an error Description The ARL instruction removes characters from the buffer and store
487. ntrol the status of bits If You Want To Use This Instruction Available In These Languages See Page enable outputs when a bit is set XIC relay ladder 78 structured text enable outputs when a bit is cleared XIO relay ladder 80 structured text set a bit OTE relay ladder 82 structured text set a hit retentive OTL relay ladder 84 structured text clear bit retentive OTU relay ladder 86 structured text enable outputs for one scan each time a ONS relay ladder 88 rung goes true structured text set a bit for one scan each time a rung OSR relay ladder 91 goes true set a bit for one scan each time the rung OSF relay ladder 94 goes false set a bit for one scan each time the input bit is OSRI structured text 96 set in function block function block set a bit for one scan each time the input bit is OSFI structured text 99 cleared in function block function block There is no equivalent structured text instruction Use other structured text programming to achieve the same result See the description for the instruction Publication 1756 RMO03K EN P July 2008 TI Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Examine If Closed XIC Operands Description Arithmetic Status Flags Fault Conditions Execution Condition prescan The XIC
488. ntroller Logix Controller Product Code CompactLogix5320 43 CompactLogix5330 44 CompactLogix5335E 65 ControlLogix5550 3 ControlLogix5553 50 ControlLogix5555 51 ControlLogix5561 54 ControlLogix5562 55 ControlLogix5563 56 DriveLogix5720 48 FlexLogix5433 41 FlexLogix5434 42 SoftLogix5860 15 ProductRev INT GSV Identifies the current product revision Display should be hexadecimal The low byte contains the major revision the high byte contains the minor revision SerialNumber DINT GSV Serial number of the device The serial number is assigned when the device is built Publication 1756 RMOOS3K EN P July 2008 181 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Attribute Data Type Instruction Description Status INT GSV Bits identify status Bits 3 0 are reserved Device Status Bits Bits 7 4 Meaning 0000 reserved 0001 flash update in progress 0010 reserved 0011 reserved 0100 flash is bad 0101 faulted 0110 run 0111 program Fault Status Bits Bits 11 8 Meaning 0001 recoverable minor fault 0010 unrecoverable minor fault 0100 recoverable major fault 1000 unrecoverable major fault Logix5000 Specific Status Bits Bits 13 12 Meaning 01 keyswitch in run 10 keyswitch in program 11 keyswitch in remote Bits 15 14 Meaning 01 controller is changing modes 10 debug mode if controller is in run
489. nverts only the first group of numbers Arithmetic Status Flags Arithmetic status flags are affected 614 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Chapter 19 Fault Conditions Type Code Cause Recovery Method size of the string tag member of the string tag 2 In the LEN value enter the number of characters that the string contains 4 53 The output number is beyond the limits of the Either destination data type e Reduce the size of the ASCII value e Use a larger data type for the destination Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set instruction execution na Enableln is always set The instruction executes SC is set Destination is cleared The instruction converts the Source If the result is zero then S Z is set postscan The rung condition out is set to false No action taken Example When MV read EM is set the STOD instruction converts the first set of numeric characters in MT 773g to an integer value The instruction skips the initial cont
490. o the nearest whole numbet e X 5 rounds to the nearest even number The following example show the result of converting REAL values to DINT values EXAMPLE Conversion of REAL values to DINT values This REAL Value Converts To This DINT Value 2 5 2 1 6 2 1 5 2 1 4 1 1 4 1 1 5 2 1 6 2 2 5 2 IMPORTANT The arithmetic status flags are set based on the value being stored Instructions that normally do not affect arithmetic status keywords might appear to do so if type conversion occurs because of mixed data types for the instruction parameters The type conversion process sets the arithmetic status keywords 640 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Introduction This appendix describes issues that are unique with function block instructions Review the information in this appendix to make sure you understand how your function block routines will operate IMPORTANT When programming in function block restrict the range of engineering units to 10 1 because internal floating point calculations are done using single precision floating point Engineering units outside of this range may result in a loss of accuracy if results approach the limitations of single precision floating point 4 10 38 Choose the Function Block To control a device
491. o the position in the LIFO identified by the POS value The instruction loads one value each time the instruction is enabled until the LIFO is full You must test and confirm that the instruction doesn t change data that you don t want it to change The LFL instruction operates on contiguous memory In some cases the instruction loads data past the array into other members of the tag This happens if the length is too big and the tag is a user defined data type not affected A Major Fault Will Occur If Fault Type Fault Code starting element POS gt LIFO array size 4 20 407 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Execution Condition Relay Ladder Action EN bit is set to prevent a false load when scan begins prescan LEN 0 uil V POS lt 0 V EM is cleared EM is set es EM is set no udi Jes DN is set no q rung condition out is set to 4 408 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Condition Relay Ladder Action rung condition in is false EN bit is cleared
492. o the routine that contains the JSR instruction To program a jump to a subroutine follow these guidelines IMPORTANT Do not use a JSR instruction to call execute the main routine e You can put a JSR instruction in the main routine or any other routine e If you use a JSR instruction to call the main routine and then put a RET instruction in the main routine a major fault occurs type 4 code 31 439 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT The following diagram illustrates how the instructions operate Calling Routine Subroutine SBF 1 If the JSR instruction has an input SBR parameter enter an SBR instruction JSR JSR 2 Place the SBR instruction as the first instruction in the routine 1 If you want to copy data to a tag in the subroutine enter an input parameter 3 For each input parameter in the JSR instruction enter the tag into which 2 If you want to copy a result of the subroutine to a tag in this routine enter a return parameter 42974 RET 3 Enter as many input and return parameters as you need 1 If the JSR instruction has a return parameter enter an RET instruction 2 Place the RET instruction as the last instruction in the r
493. ocal processor 0020 2000 Communication module not working 0030 3000 Remote node is missing disconnected or shut down 0040 4000 Processor connected but faulted hardware 0050 5000 Wrong station number 0060 6000 Requested function is not available 0070 7000 Processor is in Program mode 0080 8000 Processor s compatibility file does not exist 0090 9000 Remote node cannot buffer command 00B0 B000 Processor is downloading so it is not accessible OOFO 0001 F001 Processor incorrectly converted the address OOFO 0002 F002 Incomplete address OOFO 0003 F003 Incorrect address OOFO 0004 F004 Illegal address format symbol not found OOFO 0005 F005 Illegal address format symbol has 0 or greater than the maximum number of characters supported by the device OOFO 0006 F006 Address file does not exist in target processor OOFO 0007 F007 Destination file is too small for the number of words requested OOFO 0008 F008 Cannot complete request Situation changed during multipacket operation OOFO 0009 F009 Data or file is too large Memory unavailable 156 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com PLC and SLC Error Codes hex Continued Input Output Instructions MSG GSV SSV IOT Chapter 4 R9 x And Earlier R10 x And Later Description ERR EXERR ERR EXERR OOFO 000A FOOA Target proc
494. ocation in the LIFO where the instruction loads data initial value is typically 0 If you use a user defined structure as the data type for the Source or LIFO operand use the same structure for both operands 406 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the LFL instruction is enabled DN BOOL The done bit is set to indicate that the LIFO is full POS LEN The DN bit inhibits loading the LIFO until POS lt LEN EM BOOL The empty bit indicates that the LIFO is empty If LEN 0 or POS 0 both the EM bit and DN bit are set LEN DINT The length specifies the maximum number of elements the LIFO can hold at one time POS DINT The position identifies the location in the LIFO where the instruction will load the next value Description Use the LFL instruction with the LFU instruction to store and retrieve data in IMPORTANT Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 a last in first out order When used in pairs the LFL and LFU instructions establish an asynchronous shift register Typically the Source and the LIFO are the same data type When enabled the LFL instruction loads the Source value int
495. of the step of use the action to call a structured text routine via a JSR instruction Publication 1756 RMOO3K EN P July 2008 677 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming FOR DO Use the FOR DO loop to do something a specific number of times before doing anything else Operands Structured Text FOR count initial value TO final value BY increment DO Operand Type Format Description statement count SINT tag tag to store count position as the END FOR FOR DO executes INT DINT initial SINT tag must evaluate to a number value INT expression specifies initial value for count DINT immediate final SINT tag specifies final value for count which value determines when to exit the loop INT expression DINT immediate increment SINT tag optional amount to increment count each time through the loop INT expression DINT immediate If you don t specify an increment the count increments by 1 IMPORTANT Make sure that you do not iterate within the loop too many times in a single scan The controller does not execute any other statements in the routine until it completes the loop e If the time that it takes to complete the loop is greater than the watchdog timer for the task a major fault occurs Consider using a different construct such as IF THEN 678 Publication 1756 RMO03K EN P July
496. ology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions Condition prescan A Minor Fault Occurs If Fault Type Fault Code the divisor is zero 4 4 Execution Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Destination Source A TRN Source A Source B Source B The rung condition out is set to true postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared postscan No action taken 268 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Example Divide dividend by divisor and place the remainder in remainder In this example three goes into 10 three times with a remainder of one Relay Ladder Bap Madulo Source A dividend 1 Source B divisor 3 Dest remainder 1 Structured Text remainder dividend
497. om Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Example 1 A controller uses multiple programs but a common shut down procedure Each program uses a program scoped tag named Shut_Down_Line that turns on if the program detects a condition that requires a shut down The logic in each program executes as follows If Shut Down Line on conditions require a shut down then Execute the Shut_Down task one time Relay Ladder Program A EVENT Trigger Event Task Task Shut Down Shut Down Line Shut Down Line Dine Shot E Tins Program B EVENT Trigger Event T ask Task Shut Down Shut Down Line Shut Down Line Dine Shot E ins Structured Text Program A IF Shut Down Line AND NOT Shut Down Line One Shot THEN EVENT Shut Down END IF Shut Down Line One Shot Shut Down Line Program B IF Shut Down Line AND NOT Shut Down Line One Shot THEN EVENT Shut Down END IF Shut Down Line One Shot Shut Down Line 466 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Example 2 The following example uses an EVENT instruction to initial
498. om Chapter 4 Input Output Instructions MSG GSV SSV IOT Specify CIP Generic messages A CIP Generic message performs a specific action on an I O module If You Want To In This Property Type Or Select Perform a pulse test on a digital output Message Type CIP Generic module Service Type Pulse Test Source tag_name of type INT 5 This array contains tag_name 0 bit mask of points to test test only one point at a time tag name 1 reserved leave 0 tag name 2 pulse width hundreds of usecs usually 20 tag name 3 zero cross delay for ControlLogix 1 0 hundreds of secs usually 40 tag name 4 verify delay Destination leave blank output eol Service Type Reset Electronic Fuse Source tag name of type DINT This tag represents a bit mask of the points to reset fuses on Destination leave blank inpurmodule Service Type Reset Latched Diagnostics I Source tag_name of type DINT This tag represents a bit mask of the points to reset diagnostics on Reset latched diagnostics on a digital Message Type CIP Generic outputmadulg Service Type Reset Latched Diagnostics 0 Source tag_name of type DINT 162 This tag represents a bit mask of the points to reset diagnostics on Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com If You Want To Unlatch the alarm of an analog input module In This Prop
499. om File Standard Deviation STD Array Dest Control Lenath Standard Deviation Dim to vary Position Operands STD I DD AI OD Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The STD instruction calculates the standard deviation of a set of values in one dimension of the Array and stores the result in the Destination Relay Ladder Operand Type Array SINT INT DINT REAL Format array tag Description find the standard deviation of the values in this array specify the first element of the group of elements to use in calculating the standard deviation do not use CONTROL POS in the subscript A SINT or INT tag converts to a DINT value by sign extension Dimension DINT immediate which dimension to use to vary 0 1 2 depending on the number of dimensions the order is array dim O dim 1 dim 2 array dim_0 dim_1 array dim 0 Destination REAL tag result of the operation Control CONTROL tag control structure for the operation Length DINT immediate number of elements of the array to use in calculating the standard deviation Position DINT immediate current element in the array initial value is typically 0 CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the STD instruction is enabled DN BOOL The done bit is set when the calculation is complete ER BOOL The error bit is set wh
500. on Destination SINT tag tag to store the result INT DINT REAL Structured Text dest sourceA sourceB Use the minus sign as an operator in an expression This expression subtracts sourceB from sourceA and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block a SUB 01 Q Operand Type Format Description SUB tag FBD MATH structure SUB structure SourceA SourceB Publication 1756 RMOOSK EN P July 2008 255 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS FBD_MATH Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value from which to subtract SourceB Valid any float SourceB REAL Value to subtract from SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description The SUB instruction subtracts Source B from Source A and places the result Arithmetic Status Flags Fault Conditions Condition prescan rung condition in is false Execution i
501. on 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Scan Time These execution times show how ALMD instructions and ALMA instructions affect total scan time Rung State Execution Times Digital Alarm ALMD Analog Alarm ALMA No Alarm State Rung False 8 us 17 us oronge Rung True 8 us 60 us Alarm State Change Rung False 35 us 17 us Rung True 35 us 126 us An alarm state change is any event that changes the condition of the alarm such as acknowledging or suppressing the alarm Minimize the potential for a large number of alarms changing state simultaneously alarm bursts by creating dependencies on related alarms Large alarm bursts can have a significant impact on application code scan time Publication 1756 RMOOS3K EN P July 2008 Year 15 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Notes 76 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Introduction Use the bit relay type instructions to monitor and co
502. on 1756 RMOOS3K EN P July 2008 225 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEO NEQ Example If va ve_7 is less than or equal to value_2 set light_2 If value_1 is greater than value_2 clear light_2 Relay Ladder LEQ light_2 Less Than or Eql amp B Source value 1 0 Source B value 2 D l Structured Text light 2 value 1 lt value 2 Function Block LEO 01 LEQ Ea Less Than or Eql A lt B SourceA value 1 value 2 SourceB 226 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Less Than LES The LES instruction tests whether Source A is less than Source B Operands Relay Ladder LES p Ks AB Operand Type Format Description Source A SINT immediate value to test against Source B Source B INT tag DINT REAL string Source B SINT immediate value to test against Source A INT tag DINT REAL string e If you enter a SINT or INT tag the value converts to a DINT value by sign extension e String data types are default STRING data type any new stting data type that you create To test the characters of a string enter a string
503. on and range over which DeltaT varies A discontinuity occurs if the e instruction is not executed during a scan e instruction is executed multiple times during a task task is running and the task scan rate or the sample time of the process input changes user changes the time base mode while the task is running Order parameter is changed on a filter block while the task is running Changing the Order parameter selects a different control algorithm within the instruction 650 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Parameter Data Type TimingMode DINT OversampleDT REAL Publication 1756 RMOO3K EN P July 2008 Function Block Attributes Appendix B Common Instruction Parameters for Timing Modes The instructions that support time base modes have these input and output parameters Input parameters Description Selects timing execution mode Value Description 0 periodic mode 1 oversample mode 2 real time sampling mode valid 0 to 2 default 0 When TimingMode 0 and task is periodic periodic timing is enabled and DeltaT is set to the task scan rate When TimingMode 0 and task is event or continuous periodic timing is enabled and DeltaT is set equal to the elapsed time span since the last time the instruction was executed When TimingMode 1 oversample timing is enabled and DeltaT is s
504. on executes EnableOut is set postscan No action taken Example Multiply oaz value 1 by float value 2 and place the result in multiphy_result Relay Ladder MUL Multiply Source float value 1 0 0 Source B float value 2 o 0 Dest multiply result 0 0 Structured Text multiply result float value 1 float value 2 Function Block MUL 01 MUL EI Multiply float_value_1 SourceA multiply_result 260 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Chapter 7 Divide DIV The DIV instruction divides Source A by Source B and places the result in the Destination Operands Bh Relay Ladder Divide Source A Operand Type Format Description Source B Source A SINT immediate value of the dividend dia INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Source B SINT immediate value of the divisor INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL Structured Text dest sourceA sourceB Use the divide sign as an operator in an expression This expression divides sourceA by sourceB and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within struct
505. on identifies the element that the instruction is currently comparing 420 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Sequencer Instructions SQI SQO SQL Chapter 10 Description When enabled the SQI instruction compares a Source element through a Mask to an Array element for equality Typically use the same CONTROL structure as the SQO and SQL instructions The SQI instruction operates on contiguous memory Enter an Immediate Mask Value When you enter a mask the programming software defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix Description 167 hexadecimal for example 16 0FOF 0f octal for example 8216 2 binary for example 2 00110011 Arithmetic Status Flags not affected Fault Conditions none Publication 1756 RM003K EN P July 2008 421 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Execution Condition Relay Ladder Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true LEN O Tn mg fitis cleared POS gt LEN yes Y ER bit is set no masked Source Y r
506. on out is set to true na Enableln is always set The instruction executes instruction execution The instruction concatenates the strings postscan add node 602 The rung condition out is set to false No action taken Example To trigger a message in a MessageView terminal the controller must send an ASCH string that contains a message number and node number Sting_1 contains the message number When add_node is set the CONCAT instruction adds the characters in node_num_ascii node number to the end of the characters in s ring_1 and then stores the result in msg Relay Ladder CONCAT String Concatenate Source A Structured Text IF add node THEN CONCAT string 1 node num ascii msg add node 0 END IF Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com String Delete DELETE ASCII String Instructions CONCAT DELETE FIND INSERT MID Chapter 18 The DELETE instruction removes ASCII characters from a string Operands Relay Ladder DELETE String Delete Source Qty 2 Start E Dest 2 Operand Type Format Enter Notes Source string tag tag that contains the string String data types are from which you want to delete characters e default STRING data type e any new string data type that you create Quantity SINT immediate number of characters to
507. on to verify details Publication 1756 RMO03K EN P July 2008 23 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Preface Logix5000 Controllers General Instructions Purpose of This Manual This section Instruction name Operands This manual provides a description of each instruction in this format Provides this type of information identifies the instruction defines whether the instruction is an input or an output instruction lists all the operands of the instruction if available in relay ladder describes the operands if available in structured text describes the operands if available in function block describes the operands The pins shown on a default function block are only the default pins The operands table lists all the possible pins for a function block Instruction structure lists control status bits and values if any of the instruction Description Arithmetic status flags describes the instruction s use defines any differences when the instruction is enabled and disabled if appropriate defines whether or not the instruction affects arithmetic status flags see appendix Common Attributes Fault conditions Execution Example 24 defines whether or not the instruction generates minor or major faults if so defines the fault type and code defines the specifics of how the instruction operates provides at least one
508. one1Controller Program Main MyAlarmTagName SAlarmName Condition name The condition that triggers the alarm 8 e digital alarm displays the trip e analog alarm displays HiHi Hi Lo LoLo ROC POS or ROC NEG ConditionName Input value The input value to the alarm N 5 InputValue NOFILL DP 0 e digital alarm displays 0 or 1 e analog alarm displays the value of the input variable being monitored by the alarm Limit value The threshold of the alarm N 5 LimitValue NOFILL DP 0 e digital alarm displays 0 or 1 e analog alarm displays the actual configured range check for the analog alarm condition Severity The configured severity of the alarm condition N 5 Severity NOFILL DP 0 Values of associated tags The value of a tag configured to be included with the N 5 Tagl NOFILL DP 0 alarm event The code vaties depending on the type of tag you select how many digits or characters are in a tag value and whether you want to left fill the empty bits with spaces or zeroes For example Tag Code BOOL value N 1 Tagl NOFILL DP 0 DINT value 9 digits space left fill N 9 Tag2 SPACEFILL DP 0 REAL input value 9 digits includes decimal 3 digits after N 9 InputValue NOFILL DP 3 decimal zero left fill REAL value 8 digits includes decimal 4 digits after N 8 Tag3 ZEROFILL DP 4 decimal zero left fill String value no fixed width S 0 Tag4 String val
509. ons BSL BSR FFL FFU LFL LFU Chapter 9 Example 1 When enabled the BSR instruction starts at bit 9 in array_dint 0 The instruction unloads array dint 0 0 into the UL bit shifts the remaining bits right and loads zupaz 1 into array_dint 0 9 The values in the remaining bits 10 31 are invalid BSR Bit Shift Right N Array array dint D Control control 1 N gt Source Bit input_1 Lenath array_dint 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 before shift 1 m these bits shift right UL bit input 1 9878543210 array dint 0 1 010 1 1 1 1 0 0 0 after shift Example 2 When enabled the BSR instruction starts at bit 25 in array_dint 1 The instruction unloads array_dint 0 0 into the UL bit shifts the remaining bits right and loads zupa 1 into array_dint 1 25 The values in the remaining bits 31 26 in dint array 1 are invalid Note how array dint 1 0 shifts across words into array dint 0 31 BSR Bit Shift Right N Array array dint 0 Control control 1 N5 Source Bit input 1 58 3 0 amay din o 1 11 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 31 0 array dint 1 ofolsia pii ToloTolo i o 3 To Tolo o o 3 2 1 oTo o o E these bits shift right input 1 Publication 1756 RMO03K E
510. opriate bit in Status and the timer does not execute Valid 0 to maximum positive integer Reset BOOL Request to reset the timer When set the timer resets Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result ACC DINT Accumulated time in milliseconds This value is retained even while the TimerEnable input is cleared This makes the behavior of this block different than the TONR block EN BOOL Timer enabled output Indicates the timer instruction is enabled TT BOOL Timer timing output When set a timing operation is in progress 124 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Parameter Data Type DN BOOL Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Description Timing done output Indicates when accumulated time is greater than or equal to preset Status DINT Status of the function block InstructFault Status 0 BOOL The instruction detected one of the following execution errors This is not a minor or major controller error Check the remaining status bits to determine what occurred Presetinv Status 1 BOOL The preset value is invalid Description The RTOR instruction accumulates time until it is disabled When the RTOR enable bit EN timer timing bit TT timer done bit DN instruction is dis
511. ora string data type M d aig enter the name of the e default STRING data type M i tring data type that t e e Fora SINT INT or DINT any new string data type that you create array enter the first element of the array Serial Port SERIAL PORT tag tag that controls the operation Control CONTROL Serial Port DINT immediate number of characters to e he Serial Port Control Length must be less move to the destination than or equal to the size of the Destination Control Length read e f you want to set the Serial Port Control Length equal to the size of the Destination enter 0 Characters Read DINT immediate 0 During execution displays the number of ARD Channel Destination SerialPortControl Publication 1756 RMOO3K EN P July 2008 Structured Text characters that were read The operands are the same as those for the relay ladder ARD instruction However you specify the Serial Port Control Length and the Characters Read values by accessing the LEN and POS members of the SERIAL PORT CONTROL structure rather than by including the values in the operand list 581 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT SERIAL PORT CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bi
512. order are performed from left to right Order Operation 1 2 ABS ACS ASN ATN COS DEG FRD LN LOG RAD SIN SOR TAN TOD TRN negate NOT MOD subtract AND XOR OR co x S oa a w Publication 1756 RMOO3K EN P July 2008 251 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Add ADD The ADD instruction adds Source A to Source B and places the result in the Destination Operands Relay Ladder m ADD Source Operand Type Format Description Source B E Source A SINT immediate value to add to Source B Des INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Source B SINT immediate value to add to Source A INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Destination SINT tag tag to store the result INT DINT REAL E Structured Text dest sourceA sourceB Use the plus sign as an operator within an expression This expression adds sourceA to sourceB and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text F ADD 01 Function Block Operand Type Format Description Source pes ADD tag FBD MATH structure ADD structure Source
513. ormat SSV DINT O year Publication 1756 RMOO3K EN P July 2008 DINT 1 integer representation of month 1 12 DINT 2 X integer representation of day 1 31 DINT 3 hour 0 23 DINT 4 minute 0 59 DINT 5 seconds 0 59 DINT 6 microseconds 0 999 999 197 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 GSV SSV Programming Example Example 1 Example 2 198 Input Output Instructions MSG GSV SSV IOT Get Fault Information The following examples use GSV instructions to get fault information This example gets fault information from the I O module disc iz 2 and places the data in a user defined structure disc s 2 info Relay Ladder Structured Text GSV MODU GSV MODU GSV MODU This example gets status information about program discrete and places the data in a uset defined structure discrete_info Relay Ladder Dest 2 0000_0000_0000_0000_0000_ a 1 Get system value Object class MODULE Object name disc_in_2 Attribute name FaultCode Dest disc in 2 info FaultCode e GSV Get system value Object class MODULE Object name disc_in_2 Attribute name Faultlnfo Dest disc in 2 info Faultlnfo 0 e GSV Get system value Object class MODULE Object name disc_in_2 Attribute name Mode disc_in_2_info Mode 0000_0000_0000 E disc in 2 FaultCode disc in 2 info
514. ormation on the syntax of assignments and expressions within structured text When the OTE instruction is enabled the controller sets the data bit When the OTE instruction is disabled the controller clears the data bit not affected none Relay Ladder Action The data bit is cleared The rung condition out is set to false rung condition in is false The data bit is cleared The rung condition out is set to false rung condition in is true The data bit is set The rung condition out is set to true postscan 82 The data bit is cleared The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example When switch is set the OTE instruction sets turns on Zighz T When switch is cleared the OTE instruction clears turns off Ze f Relay Ladder switch light 1 Structured Text light 1 switch Publication 1756 RMOO3K EN P July 2008 83 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Output Latch OTL Operands ENT je A EY Description Arithmetic Status Flags Fault Conditions Execution Condition prescan The
515. ot affected Arithmetic Status Flags Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction converts the Source to lower case postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 No action taken 625 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Example To find information about a specific item an operator enters the item number into an ASCII terminal After the controller reads the input from a terminal terminal_read EM is set the LOWER instruction converts the characters in Mem number to all lower case characters and stores the result in deg number lower case A subsequent rung then searches an array for characters that match those in Zez number lower case Relay Ladder terminal read EM LOWER Lower Case Source item_number ABCD Dest item number lower case abcd Structured Text IF terminal read EM THEN
516. ou want to read in the target device Use the addressing syntax of the target device e f you select a write message type the Source Tag is the first element of the tag that you want to send to the target device Number of Elements The number of elements you read write depends on the type of data you are using An element refers to one chunk of related data For example tag timer is one element that consists of one timer control structure Destination Element e f you select a read message type the Destination Element is the first element of the tag in the Logix5000 controller where you want to store the data you read from the target device e f you select a write message type the Destination Element is the address of the location in the target device where you want to write the data Specify CIP Data Table Read and Write messages The CIP Data Table Read and Write message types transfer data between Logix5000 controllers Select This Command If You Want To CIP Data Table Read read data from another controller The Source and Destination types must match CIP Data Table Write write data to another controller The Source and Destination types must match 160 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Reconfigure an 1 0 module Use the Module Reco
517. outine 3 For each return parameter in the JSR instruction enter a return parameter to send to the JSR instruction 4 In a ladder routine place additional RET instructions to exit the subroutine based on different input conditions if required There are no restrictions other than controller memory on the number of nested routines you can have or the number of parameters you pass or return level 1 level 2 level 3 main routine d SBR SBR SBR action 1 JSR HH action_2 action_3 JSR JSR RET RET RET 440 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions A Major Fault Will Occur If Fault Type Fault Code JSR instruction has fewer input parameters than SBR instruction 4 31 JSR instruction jumps to a fault routine 4 or user supplied 0 or user supplied RET instruction has fewer return parameters than JSR instruction 4 31 main routine contains a RET instruction 4 31 Execution Relay Ladder and Structured Text Condition Relay Ladder Action Structured Text Action prescan The controller executes
518. output data output tag or produced tag Operands Relay Ladder IOT Immediate Output Update T ag Operand Type Format Description Update Tag tag tag that you want to update either e output tag of an 1 0 module e produced tag Do not choose a member or element of a tag For example Local 5 0 is OK but Local 5 0 Data is not OK IOT output tag Structured Text The operands are the same as those for the relay ladder IOT instruction Description The IOT instruction overrides the requested packet interval RPI of an output connection and sends fresh data over the connection e An output connection is a connection that is associated with the output tag of an I O module or with a produced tag e If the connection is for a produced tag the IOT instruction also sends the event trigger to the consuming controller This lets the IOT instruction trigger an event task in the consuming controller To use an IOT instruction and a produced tag to trigger an event task in a consumer controller configure the produced tag as follows 55 Tag Properties Produced Tag General Connection Maximum Consumers E Check this box M v Programmatically IOT Instruction Send E vent Trigger to Consume This configures the tag to update its event trigger only via an IOT instruction Publication 1756 RMOO3K EN P July 20
519. pare POS 2 O eference compare POS result DN bit is cleared result POS value is cleared compare FD bit is set examine result DN bit result DN 0 a compare POS compare POS 1 result POS lt 0 yes T compare ER bit is set _ Tesult POS gt goto size of result array exit page 483 result result POS compare POS result POS result POS 1 Y ng result POS gt result LEN yes Y result DN bit is set postscan The rung condition out is set to false 484 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Example When enabled the FBC instruction compares the source array_dint to the reference array dint2 and stores the locations of any mismatches in the result array dint3 Source Reference Result Length Position Lenath Position FBC File Bit Comparison Cmp Control Result Control array_dint1 0 array dint2 array dint3 control 1 10 p control_3 10 0 suuce 0 0 0 0 0 0 000 0 0 0 0000 0 00 0 0 0 000 0 0 0 0 0 0 0 0 array_dint1 ry reference 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
520. pe Description EN BOOL The enable bit indicates that the SOO instruction is enabled DN BOOL The done bit is set when all the specified elements have been moved to the Destination ER BOOL The error bit is set when LEN lt POS 0 or POS gt LEN LEN DINT The length specifies the number of steps in the sequencer array POS DINT The position identifies the element that the controller is currently manipulating 424 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Sequencer Instructions SQI SQO SQL Chapter 10 Description When enabled the SQO instruction increments the position moves the data at the position through the Mask and stores the result in the Destination If POS gt LEN the instruction wraps around to the beginning of the sequencer array and continues with POS 1 Typically use the same CONTROL structure as the SOI and SQL instructions The SQO instruction operates on contiguous memory Enter an Immediate Mask Value When you enter a mask the programming software defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix Description 167 hexadecimal for example 16 0FOF 0f octal for example 8216 24 binary for example 2200110011 Arithmetic Status Flags not affected Fault Conditions none Execution Condition Rel
521. perators 666 expressions format 209 250 345 352 order of operation 209 251 345 353 valid operators 208 250 344 352 F FAL instruction 691 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Index 692 mode of operation 330 operands 335 FAULTLOG object 187 FBC instruction operands 478 search mode 480 FBD BIT FIELD DISTRIBUTE structure 294 FBD BOOLEAN AND structure 317 FBD BOOLEAN NOT structure 326 FBD BOOLEAN OR structure 320 FBD BOOLEAN XOR structure 323 FBD COMPARE structure 212 216 220 224 228 243 FBD CONVERT structure 556 559 FBD COUNTER structure 136 FBD LIMIT structure 232 FBD LOGICAL structure 304 307 311 315 FBD MASK EQUAL structure 238 FBD MASKED MOVE structure 288 FBD MATH structure 253 256 259 262 267 215 547 FBD MATH ADVANCED structure 271 278 520 524 527 529 532 535 540 544 550 553 FBD ONESHOT structure 96 99 FBD TIMER structure 116 120 124 FBD TRUNCATE structure 561 feedback loop function block diagram 645 feedforward 515 FFL instruction 394 FFU instruction 400 FIFO load 394 FIFO unload 400 file arithmetic and logic 335 file bit comparison 478 file fill 361 file instructions See array instructions file search and compare 346 FIND instruction 605 Find String 605 FLL instruction 361 FOR instruction 470 FOR DO 678 for break instructions BRK 473 FOR 470 introduction 469 RET 474 FRD instruction 559 FS
522. pes are e default STRING data type e any new string data type that you create En cepe pos Structured Text The operands are the same as those for the relay ladder DTOS instruction Description The DTOS converts the Source to a string of ASCII characters and places the result in the Destination Arithmetic Status Flags no affected Fault Conditions Type Code Cause Recovery Method 4 51 The LEN value of the string tag is greater than the DATA 1 Check that no instruction is writing to the LEN size of the string tag member of the string tag 2 In the LEN value enter the number of characters that the string contains 4 52 The output string is larger than the destination Create a new string data type that is large enough for the output string Use the new string data type as the data type for the destination Publication 1756 RMOO3K EN P July 2008 619 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instru
523. places it with 0 each time the instruction is enabled until the LIFO is empty If the LIFO is empty the LFU returns 0 to the Destination IMPORTANT You must test and confirm that the instruction doesn t change data that you don t want it to change The LFU instruction operates on contiguous memory In some cases the instruction unloads data from other members of the tag This happens if the length is too big and the tag is a user defined data type Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 not affected A Major Fault Will Occur If Fault Type Fault Code Length LIFO array size 4 20 413 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Execution Condition Relay Ladder Action EU bit is set to prevent a false unload when scan begins prescan LEN 0 uil V POS lt 0 V EM is cleared EM is set es EM is set no udi Jes DN is set no q rung condition out is set to 4 414 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Condition Relay Ladder Actio
524. program request to go to Operator control OperProgReq An operator request to go to Program control OperOperReq An operator request to go to Operator control To determine whether an instruction is in Program or Control control examine the ProgOper output If ProgOper is set the instruction is in Program control if ProgOper is cleared the instruction is in Operator control Operator control takes precedence over Program control if both input request bits are set For example if ProgProgReq and ProgOperReq are both set the instruction goes to Operator control 654 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B The Program request inputs take precedence over the Operator request inputs This provides the capability to use the ProgProgReq and ProgOperReq inputs to lock an instruction in a desired control For example let s assume that a Totalizer instruction will always be used in Operator control and your user program will never control the running or stopping of the Totalizer In this case you could wire a literal value of 1 into the ProgOperReq This would prevent the operator from ever putting the Totalizer into Program control by setting the OperProgReq from an operator interface device Because the ProgOperReq input is always set pressing the Program In Locak1 1 ChODa
525. programming example in each available programming language includes a description explaining each example The following icons help identity language specific information relay ladder structured text function block Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Logix5000 Controllers General Instructions Preface Common Information for The Logix5000 instruction set has some common atttibutes All Instruction seen For this information See this appendix common attributes appendix Common Attributes defines e arithmetic status flags e data types e keywords function block attributes appendix Function Block Attributes defines e program and operator control e timing modes Conventions and Set and clear Related Terms This manual uses set and clear to define the status of bits booleans and values non booleans This term Means set the bit is set to 1 ON a value is set to any non zero number clear the bit is cleared to 0 OFF all the bits in a value are cleared to 0 If an operand or parameter support more than one data type the bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL Publication 1756 RMOO3K EN P July 2008 25 Artisan Technology Group Quality I
526. pter 13 Special Instructions FBC DDT DTR PID Introduction The special instructions perform application specific operations If You Want To Use This Instruction Available In These Languages See Page Compare data against a known good reference FBC relay ladder 478 and record any mismatches Compare data against a known good reference DDT relay ladder 486 record any mismatches and update the reference to match the source Pass the source data through a mask and DTR relay ladder 494 compare the result to reference data Then write the source into the reference for the next comparison Control a PID loop PID relay ladder 497 structured text Publication 1756 RMOOS3K EN P July 2008 471 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID File Bit Comparison FBC FBC File Bit Comparison Source Reference Result Cmp Control Length Position Result Control Length Position 478 The FBC instruction compares bits in a Source array with bits in a Reference ATTENTION A array Relay Ladder Operand Type Format Description Source DINT array tag array to compare to the reference do not use CONTROL POS in the subscript Reference DINT array tag array to compare to the source do not use CONTROL POS in the subscript Result DINT array tag array to store the result
527. put Parameter Data Type Description EnableOut BOOL The instruction produced a valid result OutputBit BOOL Output bit 96 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Description When InputBit is set and InputBit is cleared the OSRI instruction sets OutputBit When InputBit is set or when InputBit is cleared the OSRI instruction clears OutputBit eee InputBit i eee InputBit OutputBit eee instruction is t instruction resets during executed next scan execution 40048 Arithmetic Status Flags not affected Fault Conditions none Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan InputBit 1 is set InputBit p1 is set instruction first run InputBit 4 is set InputBit is set Enableln is cleared EnableOut is cleared the instruction does nothing na and the outputs are not updated Enableln is set On a cleared to set transition of InputBit the On a cleared to set transition of InputBit the instruction sets InputBit 1 The instruction executes EnableOut is set instruction sets InputBit Enableln is always set The instruction executes postscan No action taken Publica
528. quired Alarm Condition ROCPosinAlarm ROCNeginAlarm i ROCPosAcked ROCNegAcked Example A tank alarm is activated if the tank level surpasses a High or High High limit Programmatically acknowledge all the alarm conditions with a cleared to set Publication 1756 RMOOS3K EN P July 2008 Year 61 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 62 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA transition of the Tank32LevelAck tag value The application logic must clear Tank32LevelAck Relay Ladder ALMA In Prog A amp ckAII ProgDisable ProgEnable HHLimit HLimit LLimit LLLimit Structured Text ALMA Analog Alarm Tank32Level Tank32LT 0e Tank32LevelAck De ROCPoslnAlarm 0 ROCNeglnAlarm 0 ALMA Tank32Level Tank32LT Tank32LevelAck 0 0 Function Block 0 0 Tanks2LT Cj in o Ta nks2 Le velAck E Pro gAd amp kAll Tank32Le vel ALMA Analog Alam HH In a rm Hin Alarm Lin Alarm LL Inl a rm RO CPosinAlarm RO CNeginAlarm HH Acke d HAcked LAcked LLAcked ROCPosAcke d ROCNegAcked Suppressed 9 Disabled 5 0 OQ a a x wee alb OOOOo OO Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions
529. r but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 LLimit REAL Low alarm limit Valid LLLimit lt LLimit lt HLimit Default 0 0 LSeverity DINT Severity of the Low alarm condition This does not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 LLLimit REAL Low Low alarm limit Valid maximum negative float lt LLLimit lt LLimit Default 0 0 LLSeverity DINT Severity of the Low Low alarm condition This does not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 MinDurationPRE DINT Minimum duration preset milliseconds for an alarm level condition to remain true before the condition is marked as InAlarm and alarm notification is sent to clients The controller collects alarm data as soon as the alarm condition is detected so no data is lost while waiting to meet the minimum duration Does not apply to rate of change conditions MinDurationPRE only applies to the first excursion from normal in either direction For example once the High condition times out the High High condition will become active immediately while a low condition will wait fo
530. r Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set In1 BOOL First boolean input Default is cleared In2 BOOL Second boolean input Default is cleared Output Parameter Data Type Description EnableOut BOOL Enable output Out BOOL The output of the instruction Description The BXOR instruction performs an exclusive OR on two boolean inputs Out In1 XOR In2 Arithmetic Status Flags not affected Fault Conditions none Publication 1756 RMOO3K EN P July 2008 323 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Condition prescan Execution Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example 1 This example performs an exclusive OR on bool_in and Poo in2 and places the result in value_result_xor If BOOL IN1Is If BOOL IN2is Then VALUE RESULT XOR Is 0 0 0 0 1 1 1 0 1 1 1 0 Structured Text value result xor bool inl XOR bool in2 Function Block BXOR 01 BXOR f Boolean Excl
531. r the timeout period Valid 0 2 147 483 647 Default 0 48 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Input Parameter Data Type Description Deadband REAL Deadband for detecting that High High High Low and Low Low alarm levels have returned to normal A non zero Deadband can reduce alarm condition chattering if the In value is continually changing but remaining near the level condition threshold The Deadband value does not affect the transition to the InAlarm active state Once a level condition is active but before the condition will return to the inactive normal state the In value must either e drop below the threshold minus the deadband for High and High High conditions or e rise above the threshold plus the deadband for Low and Low Low conditions The Deadband is not used to condition the Minimum Duration time measurement Valid 0 Deadband Span from first enabled low alarm to the first enabled high alarm Default 0 0 ROCPosLimit REAL Limit for an increasing rate of change in units per second Detection is enabled for any value gt 0 0 if ROCPeriod is also gt 0 0 Valid 0 0 maximum possible float Default 0 0 ROCPosSeverity DINT Severity of the increasing rate of change condition This do
532. rLogExecutionMod DINT SSV Number of controller log entries that originated from a ificationCount program task properties change an online edit or a controller GSV timeslice change It can also be configured to include log entries originating from forces The number will be reset if RAM enters a bad state The number is not capped at the largest DINT and a rollover can occur ControllerLogUnsavedEntry DINT GSV Number of entries in the controller log that have yet to be Count stored to removable media Range from 0 to maximum number of entries ControllerLogAutoWrite BOOL MSG Flag used to determine if the automatic write of the controller log to removable media is enabled 0 auto write is disabled fault 1 controller log will attempt to write to removable media when the log is 80 full ExecutionCountConfigureM DINT MSG Bit array used to determine what will cause the Modify 180 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Access the CONTROLLERDEVICE object The CONTROLLERDEVICE object identifies the physical hardware of the controller Attribute Data Type Instruction Description and memory board The first byte contains a count of the number of ASCII characters returned in the array string ProductCode INT GSV Identifies the type of co
533. rameter Default is cleared ProgEnable BOOL Set by the user program to enable the alarm Takes precedence over a Disable command Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperEnable BOOL Set by the operator interface to enable the alarm Takes precedence over Disable command The alarm instruction clears this parameter Default is cleared AlarmCountReset BOOL Set by the user program to reset the alarm counts for all conditions A cleared to set transition resets the alarm counts to zero Default is cleared HHLimit REAL High High alarm limit Valid HLimit lt HHLimit lt maximum positive float Default 0 0 HHSeverity DINT Severity of the High High alarm condition This does not affect processing of alarms by the controller but can be used for sorting and filtering functions at the alarm subscriber Valid 1 1000 1000 most severe 1 least severe Default 500 HLimit REAL High alarm limit Valid LLimit lt HLimit lt HHLimit Default 0 0 Publication 1756 RMOOS3K EN P July 2008 Year 47 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Input Parameter Data Type Description HSeverity DINT Severity of the High alarm condition This does not affect processing of alarms by the controlle
534. rates on contiguous memory In some cases the instruction unloads data from other members of the tag This happens if the length is too big and the tag is a user defined data type Arithmetic Status Flags Fault Conditions Publication 1756 RMOO3K EN P July 2008 not affected A Major Fault Will Occur If Fault Type Fault Code Length gt FIFO array size 4 20 401 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Execution Condition Relay Ladder Action EU bit is set to prevent a false unload when scan begins prescan LEN 0 I n POS lt 0 E r EM is cleared EM is set XS EM is set no cud yes DN is set no Rh rung condition out is set to false 402 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Condition Relay Ladder Action rung condition in is false EU bit is cleared Y LEN lt 0 us V POS 0 yes V EM is cleared EM is set Yes EM is set no q S DN is set no q rung condition out is set
535. rators That Use This Format Examples Operate On one operand operator operand ABS tag a two operands operand aoperatoroperand b e fag b45 e fag c AND tag d e tag e 2 MOD tag f tag gl 352 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Determine the order of operation The operations you write into the expression are performed by the instruction in a prescribed order not necessarily the order you write them You can override the order of operation by grouping terms within parentheses forcing the instruction to perform an operation within the parentheses ahead of other operations Operations of equal order are performed from left to right Order Operation 1 2 ABS ACS ASN ATN COS DEG FRD LN LOG RAD SIN SOR TAN TOD TRN negate NOT MOD lt lt gt gt subtract AND XOR OR So co 2 NS om s Publication 1756 RMOO3K EN P July 2008 353 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Use Strings In an Expression To use strings of ASCII characters in an expression follow these guidelines
536. re Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Find the square root of this value Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Arithmetic Status Flags Publication 1756 RMOO3K EN P July 2008 Description If the Destination is no a REAL the instruction handles the fractional portion Fault Conditions of the result as follows If The Source Is Then The Fractional Example Portion Of The Result nota REAL truncates Source DINT 3 Destination DINT 1 a REAL rounds Source REAL 3 0 Destination DINT 2 If the Source is negative the instruction takes the absolute value of the Source before calculating the square root Arithmetic status flags are affected none 271 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Condition prescan Execution Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Destination JSource The rung condition out is set to true
537. re the same as those for the relay ladder ACB instruction Howevet you specity the Character Count value by accessing the POS member of the SERIAL PORT CONTROL structure rather than by including the value in the operand list SERIAL PORT CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL Therunbitindicates that the instruction is executing EM BOOL The empty bit indicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOOL The found bit indicates that the instruction found a character POS DINT The position determines the number of characters in the buffer up to and including the first set of termination characters ERROR DINT The error contains a hexadecimal value that identifies the cause of an error Publication 1756 RMOO3K EN P July 2008 573 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Description The ACB instruction counts the characters in the buffer To program the ACB instruction follow these gui
538. rees Source Dest dest DEG source Pal DEG 01 pEe ia Radians To Degrees Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC The DEG instruction converts the Source in radians to degrees and stores the result in the Destination Relay Ladder Operand Type Format Source SINT Description immediate value to convert to degrees INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text Use DEG as a function This function converts source to degrees and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Block Operand Type Format DEG tag FBD MATH ADVANCED structure Description DEG structure FBD MATH ADVANCED Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source REAL Input to the conversion instruction 550 Valid any float Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Parameter Data Type Output Parameter Data Type Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 Description Description EnableOut BOOL The instruction produced a valid result Dest REAL R
539. rence value is different than the Source value the rung condition out goes true Use caution if you insert this instruction when the processor is in Run or Remote Run mode Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 Enter an immediate mask value When you enter a mask the programming software defaults to decimal values If you want to enter a mask using another format precede the value with the correct prefix Prefix Description 16 hexadecimal for example 16 0FOF 8 octal for example 8 16 2 binary for example 2 00110011 Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action prescan The Reference Source AND Mask The rung condition out is set to false rung condition in is false The Reference Source AND Mask The rung condition out is set to false rung condition in is true masked source reference is set equal to masked source reference rung condition out is set to false postscan The rung condition out is set to false Publication 1756 RM003K EN P July 2008 495 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Example When enable
540. rent position in the Result array Description When enabled the DDT instruction compares the bits in the Source array with the bits in the Reference array records the bit number of each mismatch in the Result array and changes the value of the Reference bit to match the value of the corresponding Source bit IMPORTANT Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group You must test and confirm that the instruction doesn t change data that you don t want it to change The DDT instruction operates on contiguous memory In some cases the instruction searches or writes past the array into other members of the tag This happens if a length is too big and the tag is a user defined data type The difference between the DDT and FBC instructions is that each time the DDT instruction finds a mismatch the DDT instruction changes the reference bit to match the source bit The FBC instruction does not change the reference bit 487 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID Selecting the search mode If You Want To Detect Select This Mode One mismatch at a time Set the IN bit in the compare CONTROL structure Each time the rung condition in goes from false to true the DDT instruction searches for the next mismatch between the Source and Reference arrays Upon finding a mismatch the instruction sets the FD bit records the pos
541. rol character 06 and stops at the delimiter Relay Ladder MV read EM STOD String To DINT Source MV msg 06324 12 1 r Dest MV_msg_nmbr 324 Structured Text IF MV_read EM THEN Publication 1756 RMOOS3K EN P July 2008 615 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER STOD MV msg MV msg nmbr MV read EM 0 END IF String To REAL STOR The STOR instruction converts the ASCII representation of a floating point value to a REAL value Operands Relay Ladder Operands STOR String to Real Source Dest E Operand Type Format Enter Notes Source string tag tag that contains the value String data types are in ASCII e default STRING data type e any new string data type that you create Destination REAL tag tag to store the REAL value Structured Text STOR Source Dest The operands are the same as those for the relay ladder STOR instruction Description The STOR converts the Source to a REAL value and places the result in the Destination The instruction converts positive and negative numbers e If the Source string contains non numeric characters the STOR converts the first set of contiguous numbers including the decimal point The instruction skips any initial control or non numeric characters except the minus sign in front of a number
542. roup of bits from the Source to the Destination The group of bits is identified by the Source bit lowest bit number of the group and the Length number of bits to copy The Destination bit identifies the lowest bit number bit to start with in the Destination The Source remains unchanged If the length of the bit field extends beyond the Destination the instruction does not save the extra bits Any extra bits do not wrap to the next word Arithmetic Status Flags Arithmetic status flags are affected Fault Conditions none Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan No action taken No action taken instruction first run No action taken No action taken Enableln is cleared EnableOut is cleared the instruction does nothing na and the outputs are not updated Enableln is set The instruction executes Enableln is always set EnableOut is set The instruction executes postscan No action taken No action taken Publication 1756 RMOOS3K EN P July 2008 295 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Example 1 The controller copies Target into Dest i
543. rray_4 into the first 10 elements of array 5 Relay Ladder co Copy File Source array 4 0 Dest array 5 0 Length 10 Structured Text COP array 4 0 array 5 0 10 Example 2 When enabled the COP instruction copies the structure zer 1 into element 5 of array timer The instruction copies only one structure to one array element Relay Ladder co Copy File Source timer_1 Dest array timer 5 Length 1 Structured Text COP timer_1 array timer 5 1 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Example 3 Example 4 Publication 1756 RMOO3K EN P July 2008 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The project data array 100 elements stores a variety of values that change at different times in the application To send a complete image of project data at one instance in time to another controller the CPS instruction copies project data to produced arra e While the CPS instruction copies the data no I O updates or other tasks can change the data e The Produced array tag produces the data on a ControlNet network for consumption by other controllers To use the same image of data that is a synchronized copy of the data the consuming controller s uses a CPS instruction to copy the data from the consumed tag to
544. rs in the buffer The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan The rung condition out is set to false No action taken Publication 1756 RMOO3K EN P July 2008 571 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Example Continuously test the buffer for the termination characters Relay Ladder MV_line EN ABL ASCII Test For Buffer Line END Channel 0 ND SerialPort Control MV line ERD Character Count 0 Structured Text ABL 0 MV line 572 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Chars in Buffer ACB ASCII Chars Channel ACB Channel ACB SerialPort Control Character Count Operands in Buffer SerialPortControl ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 The ACB instruction counts the characters in the buffer Relay Ladder Operand Type Format Enter Channel DINT immediate 0 tag Serial Port SERIAL PORT tag tag that controls the operation Control CONTROL Character DINT immediate 0 Count During execution displays the number of characters in the buffer Structured Text The operands a
545. rst run Instruction first run refers to the first time the instruction executes with a new instance of a data structure The controller uses instruction first run to generate coefficients and other data stores that do not change for a function block after initial download Every function block instruction also includes EnableIn and EnableOut parameters e function block instructions execute normally when EnableIn is set e when EnableIn is cleared the function block instruction either executes prescan logic postscan logic or just skips normal algorithm execution e EnableOut mirrors EnableIn however if function block execution detects an overflow condition EnableOut is also cleared e function block execution resumes where it left off when EnableIn toggles from cleared to set However there are some function block instructions that specify special functionality such as re initialization when EnableIn toggles from cleared to set For function block instructions with time base parameters whenever the timing mode is Oversample the instruction always resumes were it left off when EnableIn toggles from cleared to set If the EnableIn parameter is not wired the instruction always executes as normal and EnableIn remains set If you clear EnablelIn it changes to set the next time the instruction executes Publication 1756 RMOO3K EN P July 2008 2 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www
546. ruction finds the size of a dimension The instruction finds the size of a dimension postscan 382 The rung condition out is set to false Example 1 Example 2 No action taken Find the number of elements in dimension 0 first dimension of array_a Store the size in array a size In this example dimension 0 of array_a has 10 elements Relay Ladder SIZE Size in Elements Source array a 0 255 Dim To Vary 0 Size array a size 10 Structured Text SIZE array a 0 array a size Find the number of elements in the DATA member of string_1 which is a string Store the size in rizg 1 ise In this example the DATA member of string_1 has 82 elements The string uses the default STRING data type Since each element holds one character 5 rzg 1 can contain up to 82 characters Relay Ladder SIZE Size in Elements Source string 1 DATA O 00 Dim To Vary 0 Size string 1 size 82 Structured Text SIZE string 1 DATA 0 0 string 1 size Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Example 3 Svrings_a is an array of string structures The SIZE instruction finds the numbet of elements in the DATA member of the string structure and stores the size in dafa_size_a In this example the DATA m
547. ructions MSG GSV SSV IOT Chapter 4 Condition Relay Ladder Action Structured Text Action Enableln is set na Enableln is always set The instruction executes instruction execution EN bit 1 EN bit 2 0 examine EN bit EW bit 1 EW bit 2 1 examine EW bit examine EW bit EW bit 2 0 ST bitz 1 ST bitz 1 examine ST bit examine ST bit ST bit 2 0 ST bitz 0 EW ST TO DN and ER bits are cleared examine DN bit DN bit 2 0 EN bit is set ER bit 1 ER bit 0 yes no 44 examine ER bit block transfer module path valid command no yes module connection Y running EW ST TO DN and ER bits are cleared EN bit is set Y ER bit is set rung condition out is set to false postscan The rung condition out is set to false No action taken Publication 1756 RMOO3K EN P July 2008 151 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 MSG Error Codes Input Output Instructions MSG GSV SSV IOT Arithmetic Status Flags not affected Fault Conditions none Error Codes The error codes depend on the type of MSG instruction RSLogix 5000 software does not always display the full description Error Code Description Display In Software Hex 0001 Connection failure see extended error codes same as description 0002 Insufficient resource same as description 0003 Invalid value same as
548. rumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEO LES LIM MEQ NEQ Publication 1756 RMO03K EN P July 2008 Table of Contents Specify a q i Rm 169 For Block Transfers 16 tows Gabba ehhine tev esoks dapi epa 172 Specify a Communication Method Or Module Address 172 Choose a cache Option s is iseus car ckias ree Y ha Rs 173 onu TV 175 Get System Value GSV and Set System Value SSV 176 G5V SSV ODIBGS i s cioe e idee eed d re o bc eed ah 179 Access the CONTROLLER object ccrte rrh RR 180 Access the CONTROLLERDEVICE object 181 Access The CST objectis ssa pessier Race oe ade d d C od dig 183 Access the DF1 object cias zu itu ds si RE Ra Race Ec ws 184 Access the FAULTLOG object t rae 187 Access The MESSAGE Object 04 sere Rh Re 188 Access The MODULE Object serrer ehe 190 Access The MOTIONGROUP Object 0 00048 191 Access The PROGRAM OBIEGE aia das saca dO ERE RA 192 Access The Routine object s oz ved CR Re PY RP EY 193 Access The SERIALPORT Object 3 uere eh mn 193 Access The TASK Objectes dcibdcba deor c eh dede eps 195 Access The WALLCLOCKTIMB Object 197 GSV SSV Programming Example 2542 sasuke dore Rana 198 Get Fault Information uud uei kao e d OE Ete OI d 198 Set Enable And Disable Tlaes i csve cenit tbe E ERR 200 Immediate Output UOT cassis teak wedi ete Se oie e tette e 201 Chapter 5 TSWOCUCUOE ce bed
549. rumentation Guaranteed 888 88 SOURCE www artisantg com File Average AVE Operands AVE Average File N5 Array Dim to vary N 5 Dest R Control Lenath Position E Publication 1756 RM003K EN P July 2008 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The AVE instruction calculates the average of a set of values Relay Ladder Operand Type Format Description Array SINT array tag find the average of the values in this array INT specify the first element of the group of elements to average DINT do not use CONTROL POS in the subscript REAL Dimension DINT immediate which dimension to use to vary 0 1 2 depending on the number of dimensions the order is array dim O dim 1 dim 2 array dim_0 dim_1 array dim 0 Destination SINT tag result of the operation INT DINT REAL Control CONTROL tag control structure for the operation Length DINT immediate number of elements of the array to average Position DINT immediate current element in the array initial value is typically 0 Structured Text Structured text does not have an AVE instruction but you can achieve the same results using a SIZE instruction and a FOR DO or other loop construct SIZE array 0 length sum 0 FOR position sum END FOR 0 TO length 1 DO sum array position 365 Artisan Technology Group Quali
550. s CASE numeric_expression OF selectorl lt statement gt lt q Statements to execute when numeric expression selector selector2 lt statement gt lt Statements to execute when specify as many numeric_expression selector2 alternative selector i values paths as you i need selector3 statement e statements to execute when numeric expression selector3 Publication 1756 RMOOS3K EN P July 2008 675 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Structured Text Programming ELSE lt statement gt q statements to execute when optional numeric expression any selector END CASE See the table on the next page for valid selector values The syntax for entering the selector values is When Selector Is Enter one value value statement multiple distinct values value value2 valueN statement Use a comma to separate each value a range of values value1 valueN statement Use two periods to identify the range distinct values plus a range valuea valueb value valueN statement of values The CASE construct is similar to a switch statement in the C or C programming languages However with the CASE construct the controller executes on the statements that are associated with the frst matching selector value Execution always breaks after the statements of that selector and goes to t
551. s For subscript 0 to 31 by 1 do 1 Initialize the subscript tag to 0 arrayls bseript s U End for 2 Clear array subscript For example when subscript 5 clear array 5 3 Add 1 to subscript 4 f subscript is to 31 repeat 2 and 3 Otherwise stop Example 2 If You Want This Enter This Structured Text A user defined data type structure stores the following SIZE Inventory 0 Inventory Items information about an item in your inventory T For position 0 to Inventory Items 1 do e Barcode ID of the item string data type If Barcode Inventory position ID then e Quantity in stock of the item DINT data type Quantity Inventory position Qty An array of the above structure contains an element for each Exit different item in your inventory You want to search the array for a specific product use its bar code and determine the End if quantity that is in stock End for 1 Get the size number of items of the nventory array and store the result in nventory Items DINT tag 2 Initialize the position tag to 0 3 If Barcode matches the ID of an item in the array then a Set the Quantity tag Inventory position Oty This produces the quantity in stock of the item b Stop Barcode is a string tag that stores the bar code of the item for which you are searching For example when position 5 compare Barcode to Inventory 5 ID 4 Add 1 to position 5 If positionis to Inventory Items 1 repeat 3
552. s MSG GSV SSV IOT Chapter 4 Mnemonic Data Type UnconnnectedTimeout DINT Description Time out for an unconnected message or for making a connection The default value is 30 seconds Ifthe message is Then unconnected The ER bit turns on if the controller doesn t get a response within the UnconnectedTimeout time connected The ER bit turns on if the controller doesn t get a response for making the connection within the UnconnectedTimeout time ConnectionRate DINT TimeoutMultiplier SINT Time out for a connected message once it has a connection This time out is for the response from the other device about the sending of the data e his time out applies only after the connection is made e he time out ConnectionRate x TimeoutMultiplier e The default ConnectionRate is 7 5 seconds e The default TimeoutMultiplier is 0 which is a multiplication factor of 4 e The default time out for connected messages is 30 seconds 7 5 seconds x 4 30 seconds e To change the time out change the ConnectionRate and leave the TimeoutMultiplier at the default value Description The MSG instruction transfers elements of data This is a transitional instruction e In relay ladder toggle the rung condition in from cleared to set each time the instruction should execute e In structured text condition the instruction so that it only executes on a transition See Appendix B Publication 1756 RMOO3K EN P July
553. s 152 operands 144 programming guidelines 175 structure 144 MUL instruction 258 multiplication 258 MVM instruction 285 MVMT instruction 288 natural log 540 NEG instruction 274 negate 274 NEO instruction 242 no operation 457 NOP instruction 457 not equal to 242 NOT instruction 314 numeric expression 663 numerical mode 331 0 objects CONTROLLER 180 CONTROLLERDEVICE 181 CST 183 DF1 184 FAULTLOG 187 GSV SSV instruction 179 MESSAGE 188 MODULE 190 MOTIONGROUP 191 PROGRAM 192 ROUTINE 193 SERIALPORT 193 TASK 195 WALLCLOCKTIME 197 OCON 641 one shot 88 one shot falling 94 one shot falling with input 99 one shot rising 91 one shot rising with input 96 ONS instruction 88 operators 208 250 344 352 order of execution structured text 669 OR instruction 306 order of execution 644 structured text expression 669 order of operation 209 251 345 353 OREF 641 OSF instruction 94 OSFI instruction 99 OSR instruction 91 OSRI instruction 96 OTE instruction 82 OTL instruction 84 OTU instruction 86 output enable or disable end of task processing 195 update immediately 201 output biasing 515 output energize 82 output latch 84 output reference 641 output unlatch 86 output wire connector 641 overflow conditions 648 overlap check for task overlap 195 P pause SFC instruction 460 PID instruction alarms 504 configuring 502 deadband 514 feedforward 515 operands 497 output biasing 515 scaling 505 tuning 503
554. s accurately synchronize to the current state of the alarms including the most recent InAlarmTime RetToNormalTime and AckTime timestamps The buffer continues until is filled Once filled the buffer stops adding alarm transitions until space is made available in the buffer by the subscriber Each alarm instruction has an alarm structure that stores alarm configuration and execution information The alarm structure includes both Program and Operator control elements and operator elements The alarm instructions do not use mode settings to determine whether program access or operator access is active so these elements are always active There are three ways to perform actions on an alarm instruction Access Alarm Structure Elements Considerations User program e ProgAck Use controller logic to programmatically access elements of the alarming system For example the control program can determine e ProgReset whether to disable a series of alarms that are related to a single e ProgSuppress root cause For example the control program could disable an alarm e ProgDisable instruction MyDigitalAlarm of data type ALARM_DIGITAL by e ProgEnable accessing the tag member MyDigitalAlarm ProgDisable Custom HMI e OperAck Create a custom HMI faceplate to access elements of the alarming e OperReset system For example if the operator needs to remove a tool rather than manually disable or suppress alarms individually from the e OperSuppre
555. s enabled the rungs in the MCR zone are scanned for normal true or false conditions When disabled the controller still scans rungs within an MCR zone but scan time is reduced because non retentive outputs in the zone are disabled The rung condition in is false for all the instructions inside of the disabled MCR zone When you program an MCR zone note that e You must end the zone with an unconditional MCR instruction You cannot nest one MCR zone within another Do not jump into an MCR zone If the zone is false jumping into the zone activates the zone from the point to which you jumped to the end of the zone e If an MCR zone continues to the end of the routine you do not have to program an MCR instruction to end the zone The MCR instruction is not a substitute for a hard wired master control relay that provides emergency stop capability You should still install a hard wired master control relay to provide emergency I O power shutdown Do not overlap or nest MCR zones Each MCR zone must be separate and complete If they overlap or nest unpredictable machine operation could occur with possible damage to equipment or injury to personnel Place critical operations outside the MCR zone If you start instructions such as timers ina MCR zone instruction execution stops when the zone is disabled and the timer is cleared not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality
556. s false The EN TT and DN bits are cleared The ACC value is cleared The rung condition out is set to false rung condition in is true Y examine DN bit examine EN bit DN bit 1 DN bit 0 TT bit is set ACC ACC current time last time ACC value rolls over yes Y no EN bit is set TT bit is set u examine ACC ACC gt PRE ACC lt PRE y DN is se TT bit is cleared ACC 2 147 483 647 Y true rung condition out is set to postscan 106 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example When imit_switch_1 is set light 2 is on for 180 msec zzer 1 is timing When Timer 1 acc reaches 180 Zeb 2 goes off and Zght 3 goes on Ligh 3 remains on until the TON instruction is disabled If Awit_switch_1 is cleared while timer_1 is timing ght_2 goes off TON Timer On Delay Timer timer 1 Preset 180 Accum of lirnit_switch_1 tirer 1 tt light 2 timer 1 dn light 3 Publication 1756 RMOO3K EN P July 2008 107 Artisan Technology Group Quality Instrumentation Guaran
557. s them in the Destination as follows e The ARL instruction continues to execute until it removes either the fitst set of termination characters specified numbet of characters Serial Port Control Length While the ARL instruction is executing no other ASCII serial port instruction executes To program the ARL instruction follow these guidelines 1 Configure the serial port of the controller a Select Uset mode b Define the characters that serve as the termination characters 2 Use the results of an ABL instruction to trigger the ARL instruction This prevents the ARL instruction from holding up the ASCII queue while it waits for the termination characters 3 This is a transitional instruction n relay ladder toggle the rung condition in from cleared to set each time the instruction should execute n structured text condition the instruction so that it only executes on a transition 586 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 4 To trigger a subsequent action when the instruction is done examine the EM bit Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken
558. s to auto mode the CV output starts off from the set output or tieback value and no bump in output value occurs The PID instruction can also automatically provide a bumpless transfer from manual to auto even if integral control is not used that is K 0 In this case the instruction modifies the BIAS term to make the CV output track either the set output or tieback values When automatic control is resumed the BIAS term will maintain its last value You can disable back calculation of the BIAS term by setting the NOBC bit in the PID data structure Be aware that if you set NOBC true the PID instruction no longer provides a bumpless transfer from manual to auto when integral control is not used PID instruction timing The PID instruction and the sampling of the process variable need to be updated at a periodic rate This update time is related to the physical process you ate controlling For very slow loops such as temperature loops an update time of once per second or even longer is usually sufficient to obtain good control Somewhat faster loops such as pressure or flow loops may require an update time such as once every 250 milliseconds Only rare cases such as tension control on an unwinder spool require loop updates as fast as every 10 milliseconds or faster 508 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special
559. sage SINT SSV Pending value for the MasterMessage Transmit attribute Transmit PendingNAkReceiveLimit SINT SSV Pending value for the NAKReceiveLimit attribute PendingPollingMode SINT SSV Pending value for the PollingMode attribute PendingReplyMessageWait DINT SSV Pending value for the ReplyMessageWait attribute PendingStationAddress INT SSV Pending value for the StationAddress attribute PendingSlavePollTimeout DINT SSV Pending value for the SlavePollTimeout attribute PendingTransmitRetries SINT SSV Pending value for the TransmitRetries attribute To apply values for any of the DF1 pending attributes 1 Use an SSV instruction to set the value for the pending attribute You can set as many pending attributes as you want using an SSV instruction for each pending attribute 2 Use a MSG instruction to apply the value The MSG instruction applies every pending attribute you set Configure the MSG instruction as MSG Configuration Tab Field Value Configuration Message Type CIP Generic Service Code Od hex Object Type a2 Object ID 1 Object Attribute leave blank Source leave blank Number of Elements 0 Destination leave blank Communication Path communication path to self 1 s where s slot number of controller 186 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Access the FAULTLOG object
560. san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Mnemonic Data Description Type DestinationNode INT To change the Destination Node of a DH or CIP with Source ID message set this member to the required value Sourcel ink INT To change the Source Link of a DH or CIP with Source ID message set this member to the required value Class INT To change the Class parameter of a CIP Generic message set this member to the required value Attribute INT To change the Attribute parameter of a CIP Generic message set this member to the required value Instance DINT To change the Instance parameter of a CIP Generic message set this member to the required value Locallndex DINT If you use an asterisk to designate the element number of the local array the Locallndex provides the element number To change the element number set this member to the required value If the message Then the local array is the reads data Destination element writes data Source element Channel SINT To send the message out a different channel of the 1756 DHRIO module set this member to the required value Use either the ASCII character A or B Rack SINT To change the rack number for a block transfer message set this member to the required rack number octal Group SINT To change the group number for a block transfer mess
561. san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Boolean OR BOR The BOR instruction logically ORs as many as eight boolean inputs To perform a bitwise OR see page 306 Operands E Structured Text IF operandA OR operandB THEN der Use OR as an operator within an expression The operands must be BOOL stat t sc values or expressions that evaluate to BOOL values This expression evaluates END EN whether operandA or operandB or both ate set true See Appendix B for information on the syntax of expressions within structured text BOR 01 Function Block BOR FE Boolean Or Operand Type Format Description BOR tag FBD BOOLEAN OR structure BOR structure FBD BOOLEAN OR Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set In BOOL First boolean input Default is cleared In2 BOOL Second boolean input Default is cleared In3 BOOL Third boolean input Default is cleared In4 BOOL Fourth boolean input Default is cleared In5 BOOL Fifth boolean input Default is cleared In6 BOOL Sixth boolean input Default is cleared In7 BOOL Seventh boolean input Default is cleared 320 Publi
562. santg com Chapter 11 Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT User Interrupt Disable UID User Interrupt Enable UIE Operands D gt culE UID UIE Description Arithmetic Status Flags Fault Conditions 454 The UID instruction and the UIE instruction work together to prevent a small numbet of ctitical rungs from being interrupted by other tasks Relay Ladder none Structured Text none You must enter the parentheses after the instruction mnemohic even though there are no operands When the rung condition in is true the UID instruction prevents higher priority tasks from interrupting the current task but does not disable execution of a fault routine or the Controller Fault Handler e UIE instruction enables other tasks to interrupt the current task To prevent a series of rungs from being interrupted 1 Limit the number of rungs that you do not want interrupted to as few as possible Disabling interrupts for a prolonged period of time can produce communication loss 2 Above the first rung that you do not want interrupted enter a rung and a UID instruction 3 After the last rung in the series that you do not want interrupted enter a rung and a UIE instruction 4 If required you can nest pairs of UID UIE instructions not affected none Publication 1756 RMO03K EN P July 2008 Artisan Technology
563. se conditions Program Prog and operator Oper control parameters provide an interface for alarm commands Relay Ladder umm 2 Enam In relay ladder the alarm condition input In is obtained from the rung iia 5 HAcked condition ProgReset HCGuppressed3 ProqDisable n Disabled ProgEnable n HilnstrurdF anit MinDurationPRE 7 MinDurationA CC 7 Operand Type Format Description ALMD tag ALARM DIGITAL Structure ALMD structure In BOOL Tag Structured text only Immediate Value is copied to In when instruction executes The alarm input value is compared to determine whether there is an alarm ProgAck BOOL Tag Value is copied to ProgAck when instruction executes On Immediate transition from cleared to set acknowledges alarm if acknowledgement is required ProgReset BOOL Tag Value is copied to ProgReset when instruction executes On Immediate transition from cleared to set resets alarm if required ProgDisable BOOL Tag Value is copied to ProgDisable when instruction executes Immediate When set disables alarm does not override Enable Commands ProgEnable BOOL Tag Value is copied to ProgEnable when instruction executes Immediate When set enables alarm takes precedence over Disable Commands MinDurationPRE DINT Immediate Relay ladder only Specifies how long the alarm condition must be met before it is reported milliseconds MinDurationACC DINT Immediate Relay ladder only
564. se parameters uncontrolled value controlled value the resultant setpoint to be used by the PID instruction ratio between these two values Relay Ladder UL Multiply Source uncontrolled flow 0 0 Source B ratio 0 0 Dest pid 2 sp 00 PID Proportional Integral Derivative Process variable Tieback Control variable PID Master Loop Inhold bit Inhold Value Setpoint Process Variable Output Structured Text pid 2 sp uncontrolled flow ratio PID pid 2 pv 2 tieback 2 cv_2 0 0 0 For This Multiplication Parameter Enter This Value destination controlled value source A uncontrolled value source B ratio 516 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Special Instructions FBC DDT DTR PID Chapter 13 PID Theory The following figures show the process flow for a PID instructions PID Process SP Error Displayed Displayed as EUs as EUs gt A M d Software A M A or Output A M Station Mode Control Bias J Ps T Mode Output 96 Auto
565. set When Enableln transitions from cleared to set the instruction initializes as described for instruction first scan The instruction executes EnableOut is set Enableln is always set The instruction executes reset When the Reset input parameter is set the When the Reset input parameter is set the instruction clears EN TT and DN and sets instruction clears EN TT and DN and sets ACC zero ACC zero postscan No action taken No action taken 118 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example Each scan that imit_switch7 is set the TONR instruction increments the ACC value by elapsed time until the ACC value reaches the PRE value When ACC 2 PRE the DN parameter is set and mer_state is set Structured Text TONR_01 Preset 500 TONR Ol Reset reset TONR Ol TimerEnable limit switchl TONR TONR 01 timer state TONR_01 DN Function Block Example TONR 01 TONR f Timer On Delay with Reset TimerEnable limit switch1 C ine a e Publication 1756 RMOO3K EN P July 2008 119 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TO
566. sition within array f array to array copy FAL gt File Arith Logical N Control contro 2 E Lenath 10 N Position of Mode ALL R Dest array l control 2 pos 00 m Expression array 2 control 2 pos Expression Destination Example 2 When enabled the FAL instruction copies va ue_ into the first 10 positions of the second dimension of array 2 element to array copy FAL File Arith Logical N Control control 2 Lenath 10 N Position of Mode ALL R Dest array_2 D contro_2 pos Expression Destination Expression value 1 Example 3 Each time the FAL instruction is enabled it copies the current value of array to value 1 The FAL instruction uses incremental mode so only one array value is copied each time the instruction is enabled The next time the instruction is enabled the instruction overwrites va ue_1 with the next value in array 1 array to element copy FAL File Arith Logical N gt Control control 1 Length 10 N Position o Mode inc R5 Dest value 1 0 e Expression array_1 control_1 pos Expression Destination Example 4 When enabled the FAL instruction adds value_1 and value_2 and stores the result in the current position of array f arithmetic operation element element to array AL File Arith Logical N Control control 1 Length 10 N5 _ Position of Mode all R Dest array control 1 pos 0 3 eee Expression value_1 value 2 Expression Destination 342 Publication 175
567. sources Description Alarm tag members are for the most part processed when the user application scans the alarm instruction This includes processing changes to configuration parameters evaluating the alarm condition e measuring elapsed time for MinDuration capturing InAlarmTime and RetToNormalTime timestamps e capturing associated tag values processing Prog and Oper commands In addition these alarm tag status members are updated as alarm messages are delivered to each subscriber asynchronously to the program scan e DeliveryEN DeliveryER DeliveryDN e NoSubscriber NoConnection CommError AlarmBuffered SubscNotified Client messages 72 Client messages are processed as they are received asynchronously to the program scan e Reset Acknowledge Disable Enable and Suppress Unsuppress commands from an RSLogix 5000 terminal e Reset Acknowledge Disable Enable and Suppress Unsuppress commands from a FactoryTalk View SE alarm subscriber Use care when determining where to place alarm instructions in the application The accuracy of the timestamps are affected by how quickly the instruction is scanned after the alarm condition changes state MinDuration time accumulation and Rate of Change calculations require repeated scanning within time intervals determined by the user application Alarm instructions must continue to be scanned after the alarm condition becomes false so that the ReturnToNormal transition
568. ss alarming screens the operator can press a disable key that e OperDisable accesses a tag MyDigitalAlarm OperDisable e OperEnable Operator parameters work with any Rockwell Automation or third party operator interface to allow control of alarm states When an operator parameter is set the instruction evaluates whether it can respond to the request then always resets the parameter Standard HMI object 70 Not accessible Normal operator interaction is through the alarm summary alarm banner and alarm status explorer objects in the FactoryTalk View application This interaction is similar to the custom HMI option described above but there is no programmatic visibility or interaction When you create an alarm instruction you must create and assign a tag of the correct alarm data type for that alarm For example create MyDigitalAlarm of data type ALARM DIGITAL In relay ladder these instruction parameters must be entered on the instruction ProgAck ProgReset ProgDisable ProgEnable Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 In relay ladder and structured text the value or tag you assign to an instruction parameter such as ProgAck is automatically written to the alarm tag member such as MyAnalogAlarm ProgAck each time the i
569. ss to the MajorFaultRecord attribute Name Data Type Style Description TimeLow DINT Decimal lower 32 bits of fault timestamp value TimeHigh DINT Decimal upper 32 bits of fault timestamp value Type INT Decimal fault type program 1 0 etc Code INT Decimal unique code for the fault depends on fault type Info DINT 8 Hexadecimal fault specific information depends on fault type and code MaxScanTime DINT GSV Maximum recorded execution time for this program Time is in microseconds SSV MinorFaultRecord DINT 11 GSV Records minor faults for this program SSV We recommend that you create a user defined structure to simplify access to the MinorFaultRecord attribute Name Data Type Style Description TimeLow DINT Decimal lower 32 bits of fault timestamp value TimeHigh DINT Decimal upper 32 bits of fault timestamp value Type INT Decimal fault type program 1 0 etc Code INT Decimal unique code for the fault depends on fault type Info DINT 8 Hexadecimal fault specific information depends on fault type and code SFCRestart INT GSV unused reserved for future use SSV 192 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Attribute Instance Attribute BaudRate DataBits Data Type DINT Data Type DINT SINT Input Output Instructions MSG GSV SSV IOT Chapter 4 Access The Routine object The ROUTINE object provides status i
570. ssion Description The syntax is IF bool expressioni THEN statement a statements to execute when bool expression is true optional 4 statements to execute when bool expressionZ is true optional 4 statements to execute when both expressions are false END IF To use ELSIF or ELSE follow these guidelines 1 To select from several possible groups of statements add one or more ELSIF statements Each ELSIF represents an alternative path e Specify as many ELSIF paths as you need The controller executes the first true IF or ELSIF and skips the rest of the ELSIFs and the ELSE 2 To do something when all of the IF or ELSIF conditions are false add an ELSE statement 672 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Structured Text Programming Appendix C The following table summarizes different combinations of IE THEN ELSIF and ELSE If You Want To And Use This Construct do something if or when conditions do nothing if conditions are false IF THEN MILLE do something else if conditions are false IF THEN ELSE choose from alternative statements do nothing if conditions are false IF THEN ELSIF or groups of statements based on input conditions assign default statements if all IF THEN ELSIF ELSE conditions are false Arithmetic Status Flags not affected
571. structs within structured text 335 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the FAL instruction is enabled DN BOOL The done bit is set when the instruction has operated on the last element POS LEN ER BOOL The error bit is set if the expression generates an overflow S V is set The instruction stops executing until the program clears the ER bit The POS value contains the position of the element that caused the overflow LEN DINT The length specifies the number of elements in the array on which the FAL instruction operates POS DINT The position contains the position of the current element that the instruction is accessing Description The FAL instruction performs the same operations on arrays as the CPT 336 Arithmetic Status Flags Fault Conditions instruction performs on elements The examples that start on page 342 show how to use the POS value to step through an array If a subscript in the expression of the Destination is out of range the FAL instruction generates a major fault type 4 code 20 Arithmetic status flags are affected A Major Fault Will Occur If Fault Type Fault Code subscript is out of range 4 20 POS lt 0 or LEN lt 0 4 21 Publi
572. sty Converts Units i A M Station x Error to Pip Gut _ Auto Mode gt Calculation 9 i SP SH Manual gt Error X 100 X Auto Convert to CV Units BUT PV SP maxs mins Output H 2 cv Manuai Limiting gt CV maxcv mincv 3iminer No n Manual 07 PV 2 NvV KC gt Displayed F Output CV Yes asEUs Displayed as a of EU Scale Converts Binary to Converts Tieback Units LX Engineering Units to PV minimaxs mins mins tieback mintie maxi mini a sr OLI maxtie mintie JN ZN PV Master Loo P Software A M Output or Control Bias AM Station Mode Action Software A M a i utpu Auto SP PV Rarer Unis Mode A M Station pie ror to Uut Auto K gt KE gt PD LG Moda p Calculati j i SP Manual Error X 100_ een v Auto a 26 PV SP maxs mins Master Gut Ps Output PVT Set um Manual Limiting No Output Manual KC Software Yes A M Mode Auto Converts Binary to Converts Units Engineering Units sP 2 x to 96 Manuai lt J PV minifmaxs mins mins PV gt Error X 100 Manualj amp m maxi mini maxs mins 2 Items referenced in this box are parameters units and modes as they pertain to the designated Slave loop vas PV Slave Loop Control Output Action Bias Cat e Software A M Converts to sp SP PV Mode AEG 7 Output 96 iMaster Outj Engineering Units PE Converts Units E T xi g h g L gt to 9b P
573. t Parameter Data Type Description AckTime LINT Timestamp of most recent condition acknowledgement If the alarm does not require acknowledgement this timestamp is equal to most recent condition alarm time RetToNormalTime LINT Timestamp of alarm returning to a normal state AlarmCountResetTime LINT Timestamp indicating when the alarm count was reset DeliveryER BOOL Delivery error of the alarm notification message Set when there is a delivery error either no alarm subscriber was subscribed or at least one subscriber did not receive the latest alarm change state message Cleared when delivery is successful or is in progress DeliveryDN BOOL Delivery completion of the alarm notification message Set when delivery is successful at least one subscriber was subscribed and all subscribers received the latest alarm change state message successfully Cleared when delivery does not complete successfully or is in progress DeliveryEN BOOL Delivery status of the alarm notification message Set when delivery is in progress Cleared when delivery is not in progress NoSubscriber BOOL Alarm had no subscribers when attempting to deliver the most recent message Set when there are no subscribers Cleared when there is at least one subscriber NoConnection BOOL Alarm s subscribers were not connected when attempting to deliver the most recent message Set when all subscribers are disconnected Cleared when at least one subscriber is connected or there are no
574. t indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL The run bit indicates that the instruction is executing EM BOOL The empty bit indicates that the instruction is done but it is synchronous to the logic scan ER BOOL The error bit indicates when the instruction fails errors FD BOO The found bit does not apply to this instruction LEN DINT The length indicates the number of characters to move to the destination read POS DINT The position displays the number of characters that were read ERROR DINT The error contains a hexadecimal value that identifies the cause of an error Description The ARD instruction removes the specified number of characters from the buffer and stotes them in the Destination The ARD instruction continues to execute until it removes the specified numbet of characters Serial Port Control Length e While the ARD instruction is executing no other ASCII Serial Port instruction executes To program the ARD instruction follow these guidelines 1 Configure the serial port of the controller for user mode 2 Use the results of an ACB instruction to trigger the ARD instruction This prevents the ARD instruction from holding up the ASCII queue while it waits for the required number of characters 3 This is a transitional instruction n relay ladder toggle the rung condition in from
575. t provides status information about a module To select a particular MODULE object set the Object Name operand of the GSV SSV instruction to the module name The specified module must be present in the I O Configuration section of the controller organizer and must have a device 190 name Attribute Data Type Instruction Description EntryStatus INT GSV Specifies the current state of the specified map entry The lower 12 bits should be masked when performing a comparison operation Only bits 12 15 are valid Value Meaning 1620000 Standby the controller is powering up 1621000 Faulted any of the MODULE object s connections to the associated module fail This value should not be used to determine if the module failed because the MODULE object leaves this state periodically when trying to reconnect to the module Instead test for Running state 1624000 Check for FaultCode not equal to 0 to determine if a module is faulted When Faulted the FaultCode and FaultInfo attributes are valid until the fault condition is corrected 1622000 Validating the MODULE object is verifying MODULE object integrity prior to establishing connections to the module 1623000 Connecting the MODULE object is initiating connections to the module 1624000 Running all connections to the module are established and data is successfully transferring 1625000 Shutting down the MODULE object is in the process of shutting down all connections to the mo
576. t to false Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 Example 1 Lf oit switch 2 is cleared this enables the next instruction the rung condition out is true Relay Ladder irit switch 2 Structured Text IF NOT limit switch 2 THEN statement END IF Example 2 If 5 17 is cleared indicates that no overflow has occurred this enables the next instruction the rung condition out is true Relay Ladder SM _ uu Structured Text IF NOT 8 V THEN lt statement gt END IF Publication 1756 RMOO3K EN P July 2008 81 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Output Energize OTE Operands EY Description Arithmetic Status Flags Fault Conditions Execution Condition prescan The OTE instruction sets or clears the data bit Relay Ladder Operand Type Format Description data bit BOOL tag bit to be set or cleared Structured Text Structured text does not have an OTE instruction but you can achieve the same results using a non retentive assignment data bit BOOL expression See Appendix 641B Function Block Attributes for inf
577. ta 642 LBL instruction 434 627 631 LEO instruction 223 LES instruction 227 less than 227 less than or equal to 223 LFL instruction 406 LFU instruction 412 LIFO load 406 LIFO unload 412 LIM instruction 231 limit 231 LN instruction 540 log base 10 543 natural 540 log base 10 543 LOG instruction 543 logical instructions AND 303 Publication 1756 RMOOS3K EN P July 2008 Index introduction 281 NOT 314 OR 306 XOR 310 logical operators structured text 668 lower case 625 LOWER instruction 625 masked equal to 237 masked move 285 masked move with target 288 masks 495 master control reset 452 math conversion instructions DEG 550 FRD 559 introduction 549 RAD 553 TOD 556 TRN 561 math operators structured text 665 MCR instruction 452 MEO instruction 237 message 144 cach connections 173 programming guidelines 175 MESSAGE object 188 MESSAGE structure 144 MID instruction 609 Middle String 609 mixing data types 635 MOD instruction 266 mode of operation 330 MODULE object 190 modulo division 266 MOTIONGROUP object 191 MOV instruction 283 move 283 move instructions BID 291 BIDT 294 CLR 297 introduction 281 MOV 283 MVM 285 MVMT 288 move logical instructions 693 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Index 694 BAND 317 BNOT 326 BOR 320 BXOR 323 MSG instruction 159 cache connection 173 communication method 172 error code
578. ta E E ProgProgReq ProgOperReq uer gd ProgStartReq E ProgStopReq Wiring a 1 into ProgOperReq means the user program always wants the E ProgResetReq TOT to be in Operator control Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Totalizer Totalizer program MainProgram TOT 01 Total 403 282 gallons button on the faceplate which sets the OperProgReg input has no effect Mode Total D cae 59 d Lind see Normally setting OperProgReq puts OldTotal b Ce ig un the TOT in Program control ProgOper Ius Dev2 Program RunStop D T Operator n Dev 1 Operator rogResetDone D TargetFlag 3 Start TargetDev1Flag D Stop TargetDev2Flag 3 Reset Pe Reset Pus Detail Status Ok 655 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes 656 Likewise constantly setting the ProgProgReq can lock the instruction into Program control This is useful for automatic startup sequences when you want the program to control the action of the instruction without worrying about an operator inadvertently taking control of the instruction In this example you have the program set the ProgProgReq input during the startup and then clear the ProgProgReq input once the startup was complete Once the ProgProgReq input is cleared the instruction remains in Program
579. tag The destination must be a base tag Logix5000 PLC 5 Logix5000 SLC Logix5000 PLC 2 Message Path Logix5000 Logix5000 Logix5000 PLC 5 Logix5000 SLC source tag array_1 0 destination element N7 10 You can use an alias tag for the source tag in originating Logix5000 controller source tag array_1 0 destination element 070 Por MSG instructions originating from a Logix5000 controller and reading from another controller Example Source and Destination source tag array_1 0 destination tag array_2 0 You cannot use an alias tag for the source tag The source must be a base tag You can use an alias tag for the destination tag in originating Logix5000 controller Logix5000 PLC 2 168 source element N7 10 destination tag array_1 0 You can use an alias tag for the destination tag in originating Logix5000 controller source element 010 destination tag array_1 0 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Specify the To configure a MSG instruction you specify these details on the i i i Communication tab Communication Details D Message Configuration My Message Configuration Communication Tag Path Browse Communication Method GP DAF Channel z DEI fo vhit Source Link fo Destin
580. tag for both Source A and Source B E Structured Text IF sourceA sourceB THEN Use the less than sign lt as an operator within an expression This expression statements evaluates whether sourceA is less than sourceB See Appendix C Structured Text Programming for information on the syntax of expressions within structured text LES 04 Function Block LES E Less Than A B Operand Type Format Description LES tag FBD COMPARE structure LES structure O SourceA D est SourceB Publication 1756 RMOOSK EN P July 2008 221 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ FBD_COMPARE Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set SourceA REAL Value to test against SourceB Valid any float SourceB REAL Value to test against SourceA Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest BOOL Result of the instruction This is equivalent to rung condition out for the relay ladder LES instruction Description The LES instruction tests whether Source A is less than Source B When you compare strings The hexadecimal values of the characters determine if one string is less than or
581. tag is a user defined data type not affected A Major Fault Will Occur If Fault Type Fault Code starting element POS gt FIFO array size 4 20 395 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 9 Array File Shift Instructions BSL BSR FFL FFU LFL LFU Execution Condition Relay Ladder Action prescan EN bit is set to prevent a false load when scan begins LEN 0 V yes yes no Y EM is cleared EM is set yes EM is set no sn DN is set no rung condition out is set to 4 396 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 Condition Relay Ladder Action rung condition in is false EN bit is cleared LEN lt 0 yes V POS lt 0 yes r EM is cleared EM is set yes EM is set no u E DN is set no q rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 397 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
582. tandard deviation of the specified elements Internally the instruction uses a FAL instruction to calculate the average Expression standard deviation calculation Mode ALL For details on how the FAL instruction executes see page 337 postscan The rung condition out is set to false 378 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Example 1 AVE 164 11 6 1 34 _ Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 Calculate the standard deviation of dint_array which is DINT 4 5 D dimension 1 oo 1 2 3 4 dimension 0 une 16 85 11 real sid 6 454972 Publication 1756 RM003K EN P July 2008 85y 6 8 5 1 8 5 6 454972 4 1 Relay Ladder STD Standard Deviation N Array dint array 0 4 Dim to vary 0 N Dest real std o RA Control control_1 Length 4 Position of Structured Text SIZE dint array 0 length sum 0 FOR position 0 TO length 1 DO sum sum dint array position END FOR average sum length sum 0 FOR position 0 TO length 1 DO sum sum dint array position average 2 END FOR real std SQRT sum length 1 379 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
583. tation Guaranteed 888 88 SOURCE www artisantg com Chapter 14 Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN 534 Relay Ladder C5 Are Cosine Source value 0 60000002 Dest result 2 2142975 Structured Text result ACOS value Function Block value Example Calculate the arc cosine of value and place the result in result Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Trigonometric Instructions SIN COS TAN ASN ASIN ACS ACOS ATN ATAN Chapter 14 Arc Tangent ATN The ATN instruction takes the arc tangent of the Source value and stores the result in the Destination in radians Operands Relay Ladder ATN Are Tangent Operand Type Format Description pane Source SINT immediate find the arc tangent of this value Dest INT tag DINT REAL Destination SINT tag tag to store the result INT DINT REAL Structured Text dest ATAN source Use ATAN as a function This function computes the arc tangent of source and stores the result in dest See Appendix C Structured Text Programming for information on the syntax of expressions within structured text F3 ATN 01 Function Block Operand Type Format Description ATN tag FBD MATH ADVANCED structure ATN structure FBD MATH ADVANCED Structure Input Parameter Data Type Descriptio
584. ted results may occur REAL The preferred way to initialize a structure is structure to use the COP instruction Length DINT immediate number of elements to fill E Structured Text Structured text does not have an FLL instruction but you can achieve the same results using a SIZE instruction and a FOR DO or other loop construct SIZE destination O0O length FOR position 0 TO length 1 DO destination position source END FOR See Appendix C Structured Text Programming for information on the syntax of constructs within structured text Publication 1756 RMOO3K EN P July 2008 361 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Description The number of bytes filled is IMPORTANT Arithmetic Status Flags Byte count Length number of bytes in the Destination data type You must test and confirm that the instruction doesn t change data that you don t want it to change The FLL instruction operates on contiguous data memory In some cases the instruction writes past the array into other members of the tag This happens if the length is too big and the tag is a user defined data type If the tag is Then user defined data type If the Length is too big the instruction writes past the end of the array into other members of the tag It stops at the end of
585. teed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Timer Off Del ay TO F The TOF instruction is a non retentive timer that accumulates time when the instruction 1s enabled rung condition in is false This instruction is available in structured text and function block as T OFR see page 120 Operands Relay Ladder TOF ipti Timer Off Delay EN Operand Type Format Description Timer DN5 Timer TIMER tag timer structure Preset Accum Preset DINT immediate how long to delay accumulate time Accum DINT immediate total msec the timer has counted initial value is typically 0 TIMER Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the TOF instruction is enabled TT BOOL The timing bit indicates that a timing operation is in process DN BOOL The done bit is cleared when ACC gt PRE PRE DINT The preset value specifies the value 1 msec units which the accumulated value must reach before the instruction clears the DN bit ACC DINT The accumulated value specifies the number of milliseconds that have elapsed since the TOF instruction was enabled Description The TOF instruction accumulates time until e the TOF instruction is disabled e the ACC 2 PRE The time base is always 1 msec For example for a 2 second timer enter 2000 for the PRE value 108 Publication 1756 RMO03K
586. ters determine if one string is less than or greater than another string For the hex code of a character see the back covet of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater ASCII Characters Hex Codes 1ab 31 61 62 L a 0 31862 e r A 41 S e S a AB 41 42 AB B e t MERC i B B 42 d i a 61 a gt B Y ab 61 62 Arithmetic Status Flags not affected 220 Fault Conditions none Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Chapter 5 Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Source A gt Source B rung condition out is set to true rung condition out is set to false postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The
587. text JKFF process control structured text FAL 335 relay ladder JK Flip Flop function block File Arithmetic and Logic JMP 434 elay ladder FBC l l 478 relay ladder Jump to Label File Bit Comparison JSR 436 elay ladder FFL 394 relay ladder Jump to Subroutine structured text FIFO Load unction block FFU 400 relay ladder JXR 447 elay ladder FIFO Unload Jump to External Routine FGEN process control structured text LBL 434 elay ladder Function Generator function block Label Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation 17 Guaranteed 888 88 SOURCE www artisantg com Instruction Locator Instruction Location Languages Instruction Location Languages LEQ 223 relay ladder Less Than or Equal to structured text function block LES 227 relay ladder Less Than structured text function block LFL 406 relay ladder LIFO Load LFU 412 relay ladder LIFO Unload LIM 231 relay ladder Limit function block LN 540 relay ladder Natural Li structured text TOM function block LOG 1 relay ladder Log Base 10 structured text mo function block LOWER 625 relay ladder Lower Case structured text MCR Master Control Reset 18 Publication 1756 RMOO3K EN P July 2008 rtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant Instruction Locator Instruction ion Instruction Location Langua
588. that expresses individual decimal digits 0 9 in a 4 bit binary notation If you enter a negative Source the instruction generates a minor fault and clears the Destination Arithmetic Status Flags Arithmetic status flags are affected 556 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Chapter 16 Fault Conditions A Minor Fault Will Occur If Fault Type Fault Code Source 0 4 4 Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true no source 99 999 999 convert source to BCD yes S V is set to rung condition out is set to true rung condition in is true The controller converts the Source to BCD and places the result in the Destination The rung condition out is set to true postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Publication 1756 RMOOS3K EN P July 2008 557 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Math Conversion Instructions DEG RAD T
589. the REAL represented in Pd the format string as 96e appears here The text for the INT represented in the format string as 96d appears here Freeze Display Freeze Log Clear Display i Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action I prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The rung condition out is set to true Execution jumps to the rung that contains the LBL instruction with the referenced label name postscan The rung condition out is set to false Example You can display many tag values with the BPT instruction However the formatting string can contain only 82 characters Because the formatting string requires two characters for each tag you want in the breakpoint you cannot trace more than 41 tags with a single BPT instruction However to separate tag data in your traces you will need to include spaces and other formatting thus reducing the number of tag values that one BPT instruction can effectively display to far fewer than 41 Publication 1756 RMOO3K EN P July 2008 629 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 20 Debug Instructions BPT TPT This rung shows a breakpoint that stops program execution when an analog value is greater than 3 02 or less than 2 01
590. the analog input module to produce data at least about evety 25 to 50 msecs Another somewhat less accurate method of executing a PID instruction is to place the instruction in a continuous task and use a timer done bit to trigger execution of the PID instruction Publication 1756 RMOO3K EN P July 2008 509 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 13 Special Instructions FBC DDT DTR PID PID_timer dn PID timer DN 510 Relay Ladder TON Timer On Delay Timer PID_timer Preset 1000 Accum of PID Proportional Integral Derivative ES PID TiC101 EE Process variable Local 0 ChOData Tieback Local 0 ChiData Control variable Local 1 0 ChOData PID Master Loop 0 Inhold bit Local 1 1 Ch0 lnH old Inhold alue Local 1 1 Ch0D ata Setpoint 0 0 Process Variable 0 0 Output 0 0 Structured Text PID timer pre 1000 TONR PID timer IF PID timer DN THEN PID TIC101 Local 0 I ChO0Data Local 0 I ChlData Local 1 0 ChO0Data 0 Local 1 1I ChOInHold Local 1 I Ch0Data END IF In this method the loop update time of the PID instruction should be set equal to the timer preset As in the case of using a periodic task you should set the analog input module to produce the process variable at a significantly faster rate than the loop update time You should only use the timer method of PID execution for loops with loop
591. the control algorithm and disables RTSMissed checking valid 1 to 32 767ms wraps from 32767 to 0 1 count 1 millisecond default 0 Output parameters Description DeltaT REAL Elapsed time between updates This is the elapsed time in seconds used by the control algorithm to calculate the process output Periodic DeltaT task scan rate if task is Periodic task DeltaT elapsed time since previous instruction execution if task is Event or Continuous task Oversample DeltaT OversampleDT Real Time Sampling DeltaT RTSTimeStamp RTSTimeStampy 1 Status DINT Status of the function block TimingModelnv BOOL Invalid TimingMode value Status 27 RTSMissed Status 28 BOOL Only used in real time sampling mode Set when ABS DeltaT RTSTime gt 1 001 second RTSTimelnv BOOL Invalid RTSTime value Status 29 RTSTimeStamplnv BOOL Invalid RTSTimeStamp value Status 30 DeltaTInv Status 31 BOO Invalid DeltaT value 652 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Function Block Attributes Appendix B TimingMode 0 C Periodic timing v Determine task type v C Periodic task v Overview of Timing Modes The following diagram shows how an instruction determines the appropriate timing mode 4 Determine time base mode
592. times the DN bit is set and Zight 1 turns on If Zuzt smitch 1 continues to go from disabled to enabled counter 1 continues to increment its count and the DN bit remains set When limit switch 2is enabled the RES instruction resets counter 1 clears the status bits and the ACC value and Zghz f turns off limit switch 1 CTU Count Up CU Counter counter 1 N5 Preset 10 Accum of counter_1 dn light_1 lirit_switch_2 counter_1 RES Publication 1756 RMOO3K EN P July 2008 131 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Count Down CTD Counter Preset Accum Count Down Operands CTD The CTD instruction counts downward This instruction is available in structured text and function block as CTUD see page 136 Relay Ladder Operand Type Format Description Counter COUNTER tag counter structure Preset DINT immediate how low to count Accum DINT immediate number of times the counter has counted initial value is typically 0 COUNTER Structure Mnemonic Data Type Description CD BOOL The count down enable bit indicates that the CTD instruction is enabled DN BOOL The done bit indicates that ACC 2 PRE OV BOOL The overflow bit indicates that the counter exceeded the upper limit of 2 147 483 647 The count
593. tination e CDND SerialPort Control GERD SerialPort Control Length Characters Read Operand Type Format Enter Notes Channel DINT immediate 0 tag Destination string tag tag into which the e f you want to compare convert or characters are moved manipulate the characters use a string data SINT read type e String data types are INT e For a string data type J ud enter the name of the e default STRING data type did s tring data type that t e any new string data type that you create e For a SINT INT or DINT d AEE array enter the first element of the array Serial Port SERIAL_PORT_ tag tag that controls the operation Control CONTROL Serial Port DINT immediate maximum number of e Enter the maximum number of characters Control Length characters to read if no that any message will contain that is when termination characters are to stop reading if no termination characters found are found For example if messages range from 3 to 6 characters in length enter 6 e The Serial Port Control Length must be less than or equal to the size of the Destination e f you want to set the Serial Port Control Length equal to the size of the Destination enter 0 Characters Read DINT immediate 0 During execution displays the number of characters that were read Structured Text ARL Channel Destination SerialPortControl The operands are the same as those for the relay ladder ARL instruction However you specify the Serial Port Co
594. tion 1756 RMOO3K EN P July 2008 No action taken 97 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 2 98 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI OutputBit for one scan Structured Text OSRI Ol InputBit limit switchl OSRI OSRI 01 State OSRI Ol OutputBit Function Block OSRI 01 OSRI El One Shot Rising with Input 0 limit switch1 a InputBit DOutputBit Publication 1756 RMOO3K EN P July 2008 Example When izzt switch goes from cleared to set the OSRI instruction sets su Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com One Shot Falling with Input OSFI OSFI OSFI Operands tag OSFI tag OSFI E One Shot Falling with Input InputBit OutputBit f Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Chapter 2 The OSFI instruction sets the OutputBit for one execution cycle when the InputBit toggles from set to cleared This instruction is available in relay ladder as OSF see page 94 Structured Text Operand Type Format Description OSFI tag FBD_ONESHOT structure OSFI structure Function Block Operand Type Format Description OSFI tag FBD_ONESHOT structure OSFI structure FBD_ONESHOT Structure Input Parameter Data Type Description Enableln BOOL Func
595. tion 1756 RMOOS3K EN P July 2008 Year 37 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Condition prescan Function Block Action All operator requests timestamps and delivery flags are cleared InAlarm is cleared and Acked is set Structured Text Action All operator requests timestamps and delivery flags are cleared InAlarm is cleared and Acked is set instruction first scan No action taken No action taken instruction first run No action taken No action taken Enableln is cleared The instruction does not execute EnableOut is cleared The instruction executes EnableOut is always set Enableln is set The instruction executes EnableOut is set The instruction executes EnableOut is always set postscan In Condition ProgAck OperAck Inputs InAlarm Acked 38 No action taken No action taken ALMD Alarm Acknowledge Required and Latched ProgReset OperReset Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 ALMD Alarm Acknowledge Required and Not Latched In Condition LJ 1 T dd Ln
596. tion Block If cleared the instruction does not execute and outputs are not updated If set the instruction executes Default is set Structured Text No effect The instruction executes InputBit BOOL Input bit This is equivalent to rung condition for the relay ladder OSF instruction Default is cleared Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result OutputBit BOOL Output bit Publication 1756 RMOO3K EN P July 2008 99 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter2 Bit Instructions XIC XIO OTE OTL OTU ONS OSR OSF OSRI OSFI Description When the InputBit is cleared and the InputBit 1 is set the OSFI instruction sets the OutputBit When InputBit 1 is cleared or when InputBit is set the OSFI instruction clears the OutputBit InputBit InputBit 4 OutputBit Arithmetic Status Flags not affected Fault Conditions none instruction is instruction resets during executed next scan execution 40047 Execution Condition Function Block Action Structured Text Action prescan No action taken No action taken instruction first scan InputBit 4 is cleared InputBit 1 is cleared instruction first run InputBit 4 is cleared InputBit 4 is cleared Enableln is cleared Enableln is set and the outputs are not updated On a cleared to set transitio
597. tion is executed in order to minimize the sampling error between the input and the instruction Publication 1756 RMOOS3K EN P July 2008 649 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Timing Mode Description real time sampling In the real time sampling mode the delta time DeltaT used by the instruction is the difference between two time stamp values that correspond to the updates of the process input Use this mode when the process input has a time stamp associated with its updates and you need precise coordination The time stamp value is read from the tag name entered for the RTSTimeStamp parameter of the instruction Normally this tag name is a parameter on the input module associated with the process input The instruction compares the configured RTSTime value expected update period against the calculated DeltaT to determine if every update of the process input is being read by the instruction If DeltaT is not within 1 millisecond of the configuration time the instruction sets the RTSMissed status bit to indicate that a problem exists reading updates for the input on the module Time based instructions require a constant value for DeltaT in order for the control algorithm to properly calculate the process output If DeltaT varies a discontinuity occurs in the process output The severity of the discontinuity depends on the instructi
598. tion taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Example When enabled the NOT instruction performs a bitwise NOT operation on Source and places the result in Dest value 10 0 00 0 0 00 0 0 0 1 0 1 0 1 0 1 0 1 0 1 11 1 1 1 1 1 1 value result not 1 1 1 1 1 1 111 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 Relay Ladder NOT Bitwise MOT Source value 1 2HOO00_O0000_0000_0701_0101_0101_1111_1111 Dest walue result nat 2 1111 1111 1111 1010 1010 1010 BDnn DODO Structured Text value result not NOT value 1 Function Block NOT 01 NOT Bitwise NOT 0 Pd value 1 D Source d value result not 316 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Boolean AND BAND amp Operands IF operandA AND operandB THEN statement END IF Fal BAND 01 BAND Ez Boolean And Out Input Parameter Data Type The BAND instruction logically ANDs as many as 8 boolean inputs To perform a bitwise AND see page 303 Structured
599. tions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Function Block resti Sp an In2 o eE value_result_or Example 2 In this example igh 7 is set on if only bool inf is set true only boo in2 is set true both Poo inf and bool_in2 ate set true Otherwise gh 7 is cleared off Structured Text IF bool inl OR bool in2 THEN lightl 1 ELSE lightil 0 END IF 322 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Boolean Exclusive OR The BXOR performs an exclusive OR on two boolean inputs BXOR To perform a bitwise XOR see page 310 Operands E Structured Text IF operandA XOR operandB THEN n g Use XOR as an operator within an expression The operands must be BOOL lt D SEEN values or expressions that evaluate to BOOL values This expression evaluates END LL whether only operandA ox only operanaB is set true See Appendix B for information on the syntax of expressions within structured text BXOR 01 Function Block BXOR El Boolean Exclusive Or Operand Type Format Description BXOR tag FBD_BOOLEAN_XOR structure BXOR structure ini Out FBD_BOOLEAN_XOR Structure Input Paramete
600. tions none Publication 1756 RMOO3K EN P July 2008 575 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction clears the specified instructions and buffer s postscan The rung condition out is set to false No action taken Example When the controller enters Run mode clear the buffer and the ASCII queue Relay Ladder S FS ACL J F ASCII Clear Buffer Channel 0 Clear Serial Port Read 1 Clear Serial Port Write 1 Structured Text osri l InputBit S FS OSRI osri 1 IF osri_1 OutputBit THEN ACL 0 0 1 END IF 576 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Handshake Lines AHL ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 The AHL instruction obtains the status of control lines and turns on or off the DTR
601. to radians and place the result in result Relay Ladder AD Degrees To Radians Source value 450 est result 0 78539819 Structured Text result RAD value Function Block RAD 04 RAD Degrees To Radians Source result Publication 1756 RMO03K EN P July 2008 555 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Convert to BCD TOD Operands TOD 04 The TOD instruction converts a decimal value 0 Source 99 999 999 to a BCD value and stores the result in the Destination Relay Ladder Operand Type Format Description Source SINT immediate value to convert to decimal INT tag DINT A SINT or INT tag converts to a DINT value by zero fill Destination SINT tag stores the result INT DINT Function Block Operand Type Format Description TOD tag FBD CONVERT structure TOD structure FBD CONVERT Structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source DINT Input to the conversion instruction Valid any integer Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest DINT Result of the conversion instruction Arithmetic status flags are set for this output Description BCD is the Binary Coded Decimal number system
602. to unsuppress the alarm Takes precedence over Suppress commands Default is cleared OperUnsuppress BOOL Set by the operator interface to unsuppress the alarm Takes precedence over Suppress commands The alarm instruction clears this parameter Default is cleared ProgDisable BOOL Set by the user program to disable the alarm Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperDisable BOOL Set by the operator interface to disable the alarm The alarm instruction clears this parameter Default is cleared ProgEnable BOOL Set by the user program to enable the alarm Takes precedence over a Disable command Default is cleared Relay Ladder Copied from the instruction operand Structured Text Copied from the instruction operand OperEnable BOOL Set by the operator interface to enable the alarm Takes precedence over Disable command The alarm instruction clears this parameter Default is cleared AlarmCountReset BOOL Set by the user program to reset the alarm count A cleared to set transition resets the alarm count to zero Default is cleared UseProgTime BOOL Specifies whether to use the controller s clock or the ProgTime value to timestamp alarm state change events When set the ProgTime value provides timestamp When cleared the controller s clock provides timestamp Default is cleared Publication 1756 RMOOS3K EN P July 2008 Year 33 Artisan
603. tor in English H L alarm for operator in English L LL alarm for operator in English LL ROC positive alarm for operator in English POS ROC positive alarm for operator in English NEG HH Mitteilung f r den Operator auf Deutsch HH H Mitteilung f r den Operator auf Deutsch H ALARM DIGITAL digital alarm for operator in English AM Use the import export utility to create and translate message strings into multiple languages The TXT import export format supports double byte characters so you can use this format for all languages including Chinese Japanese and Korean The CSV import export format does not support double byte characters Importing and exporting messages always performs a merge Deleting a message in a CSV or TXT file does not delete the message from the ACD file To delete a message import the CSV or TXT file with the type name and specifier fields filled in but the description blank Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Monitor Alarm Status ALMD Properties Motor101Fault Rung 1 Conhguralion Status Paremetes Tag i All alarm times are displayed in the workstobon bm In Aleem Ime Acknowledge Time Retun To Normal Time Alam Court Fired Time Subscribers Subscriber Connection Notified Subscr
604. troduction Timers and counters control operations based on time or the number of events If You Want To Use This Instruction Available In These Languages See Page time how long a timer is enabled TON relay ladder 104 time how long a timer is disabled TOF relay ladder 108 accumulate time RTO relay ladder 112 time how long a timer is enabled with built in TONR structured text 116 reset in function block function bloc time how long a timer is disabled with built in TOFR structure text 120 reset in function block function bloc accumulate time with built in reset in function RTOR structured text 124 block function bloc count up CTU relay ladder 128 count down CTD relay ladder 132 count up and count down in function block CTUD structured text 136 function block reset a timer or counter RES relay ladder 141 The time base for all timers is 1 msec Publication 1756 RMO03K EN P July 2008 103 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Timer On Del ay TON The TON instruction is a non retentive timer that accumulates time when the instruction 1s enabled rung condition in is true This instruction is available in structured text and function block as TONR see page 116 Operands Relay Ladder TON nti Timer On Delay EN
605. troller operation or injury to personnel N You must test and confirm that the instructions don t change data that you don t want them to change The GSV and SSV instructions write or read past a member into other members of a tag If the tag is too small the instructions don t write or read the data They log a minor fault instead Example 1 My Tag si My_Tag Member_A Attribute HE My Tag Member A 0 E My Tag Member Alt My_Tag Member_B Member_A is too small for the attribute So the GSV instruction writes the last value to Member_B Example 2 GSV Tg H My_Tag Member_A Attribute F My_Tag Member_A 0 My Tag Member A 1 F My Tag Member B Tag is too small Minor fault My Tag is too small for the attribute So the GSV instruction stops and logs a minor fault The GSV SSV Objects section shows each object s attributes and their associated data types For example the MajorFaultRecord attribute of the Program object needs a DINT 11 data type Publication 1756 RMOO3K EN P July 2008 177 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 4 Input Output Instructions MSG GSV SSV IOT Arithmetic Status Flags not affected Fault Conditions Condition prescan A Minor Fault Will Occur If Fault Type Fault Code invalid object address 4 5 specified an object that does not support 4 6 GSV SSV invalid a
606. truction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL 419 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 10 Sequencer Instructions SQI SQO SQL Sequencer Input SQI Operands Sequencer Input Array Mask Source Control Lenath Position The SQI instruction detects when a step is complete in a sequence pair of SQO SQI instructions Relay Ladder Operand Type Format Description Array DINT array tag sequencer array specify the first element of the sequencer array do not use CONTROL POS in the subscript Mask SINT tag which bits to block or pass INT immediate DINT A SINT or INT tag converts to a DINT value by sign extension Source SINT tag input data for the sequencer array INT DINT A SINT or INT tag converts to a DINT value by sign extension Control CONTROL tag control structure for the operation typically use the same CONTROL as the SOO and SOL instructions Length DINT immediate number of elements in the Array sequencer table to compare Position DINT immediate current position in the array initial value is typically 0 CONTROL Structure Mnemonic Data Type Description ER BOOL The error bit is set when LEN 0 POS 0 or POS gt LEN LEN DINT The length specifies the number of steps in the sequencer array POS DINT The positi
607. tscan No action taken Publication 1756 RMOOSK EN P July 2008 229 Chapter5 Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Example If value_ is less than value_2 set Light 3 If value 1 is greater than or equal to value_2 clear light_3 Relay Ladder LES Less Than amp B Source value 1 Oe light_3 SourceB value 2 Oe Structured Text light 3 value 1 lt value 2 Function Block LES 01 LES Em Less Than A B 0 SourceB light 3 230 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Limit LIM The LIM instruction tests whether the Test value is within the range of the Low Limit to the High Limit Operands Relay Ladder LIM Limit Test CIRC Low Limit BL Operand Type Format Description Test Low limit SINT immediate value of lower limit High Limit INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension Test SINT immediate value to test INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension High limit SINT immediate value of upper limit INT tag DINT REAL A SINT or INT tag converts to a DINT value by sign extension E Structured Text Structured text does not have a LIM instru
608. ttribute 4 6 did not supply enough information for an SSV 4 6 instruction the GSV destination was not large enough to hold 4 7 the requested data Execution Relay Ladder Action The rung condition out is set to false Structured Text Action No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes The rung condition out is set to true na Enableln is set na Enableln is always set The instruction executes instruction executes Get or set the specified value Get or set the specified value postscan 178 The rung condition out is set to false No action taken Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com GSV SSV Objects Publication 1756 RMOO3K EN P July 2008 Input Output Instructions MSG GSV SSV IOT Chapter 4 When you enter a GSV SSV instruction you specify the object and its attribute that you want to access In some cases there will be more than one instance of the same type of object so you might also have to specify the object name For example there can be several tasks in your application Each task has its own TASK object that you access by the task name ATTENTION For the GSV instruction only the specified size of data is copied to the destination For example
609. ty Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 7 219 Chapter6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS Notes 280 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter Introduction If you want to copy a value Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT You can mix data types but loss of accuracy and rounding error might occur and the instruction takes more time to execute Check the S V bit to see whether the result was truncated For relay ladder instructions bold data types indicate optimal data types An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type typically DINT or REAL The move instructions modify and move bits Use this instruction Available in these languages See page MOV relay ladder 283 structured text copy a specific part of an integer MVM relay ladder 285 copy a specific part of an integer in function block MVMT structured text 288 function block move bits within an integer or between integers move bits within an integer or between integers in function block BTD relay ladder 291 BTDT structured text 294 function block clear a value CLR stru
610. ty Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE destination sum length See Appendix C Structured Text Programming for information on the syntax of constructs within structured text CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the AVE instruction is enabled DN BOOL The done bit is set when the instruction has operated on the last element in the Array POS LEN ER BOOL The error bit is set if the instruction generates an overflow The instruction stops executing until the program clears the ER bit The position of the element that caused the overflow is stored in the POS value LEN DINT The length specifies the number of elements in the array on which the instruction operates POS DINT The position contains the position of the current element that the instruction is accessing Description The AVE instruction calculates the average of a set of values Arithmetic Status Flags 366 Fault Conditions IMPORTANT Make sure the Length does not cause the instruction to exceed the specified Dimension to vary If this happens the Destination will be incorrect Arithmetic status flags are affected A Major Fault Will Occur If Fault Type Fault Code POS lt 0 or LEN lt 0 4 21 Dimension to vary does not exist for the 4 20 specified arr
611. u Have This Software Then You Can Cache And Firmware Revision 11 x or earlier e block transfer messages for up to 16 connections e other types of messages for up to 16 connections 12 x or later up to 32 connections If several messages go to the same device the messages may be able to share a connection IF THE MSG Instructions Are To And They Are Then different devices pw Each MSG instruction uses 1 connection same device enabled at the same time Each MSG instruction uses 1 connection NOT enabled at the same time The MSG instructions share the connection that is Together they count as 1 connection Share a Connection If the controller alternates between sending a block transfer read message and a block transfer write message to the same module then together both messages count as 1 connection Caching both messages counts as 1 on the cache list 174 Publication 1756 RMOOS3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Input Output Instructions MSG GSV SSV IOT Chapter 4 Guidelines As you plan and program your MSG instructions follow these guidelines Guideline Details 1 For each MSG instruction create a control Each MSG instruction requires its own control tag nd e Data type MESSAGE e Scope controller e The tag cannot be part of an array or a user defined data type 2 Keep the source and or destination data at A MSG
612. u create array enter the first element of the array Serial Port SERIAL PORT tag tag that controls the operation Control CONTROL Serial Port DINT immediate number of characters to e he Serial Port Control Length must be less Control Length send than or equal to the size of the Source e f you want to set the Serial Port Control Length equal to the number of characters in the Source enter 0 Characters Sent DINT immediate 0 During execution displays the number of AWT Channel Source 594 SerialPortControl characters that were sent Structured Text The operands are the same as those for the relay ladder AWT instruction However you specify the Serial Port Control Length and the Characters Sent values by accessing the LEN and POS members of the SERIAL PORT CONTROL structure rather than by including the values in the operand list Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Chapter 17 SERIAL PORT CONTROL Structure Mnemonic DataType Description 00 EN BOOL The enable bit indicates that the instruction is enabled EU BOOL The queue bit indicates that the instruction entered the ASCII queue DN BOOL The done bit indicates when the instruction is done but it is asynchronous to the logic scan RN BOOL The run bit ind
613. u enter the different language via the import export utility For more information see page 68 Associated tags 66 You can select as many as four additional tags from the controller project to associate with the alarm The values of these tags are sent with an alarm message to the alarm server For example a digital alarm for a pressure relief valve might also include information such as pump speed and tank temperature Associated tags may be any atomic data type BOOL DINT INT SINT or REAL or a STRING They may be elements in a UDT or an Array Variable array references are not allowed If the alarm is controller scoped the associated tags must also be controller scoped Optionally embed the associated tags into the message text string Associated tag values are always sent with the alarm viewable by the operator and entered in the history log regardless of whether you embed them in the message string Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Variable FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Message String Variables You can embed this variable information in a message string Embeds in the Message String Default Code Added to Message String Alarm name The name of the alarm which consists of the S 0 controller name program name and tag name For example Z
614. u use a user defined structure as the data type for the FIFO or Destination operand use the same structure for both operands Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Array File Shift Instructions BSL BSR FFL FFU LFL LFU Chapter 9 CONTROL Structure Mnemonic Data Type Description EU BOOL The enable unload bit indicates that the FFU instruction is enabled The EU bit is set to preset a false unload when the program scan begins DN BOOL The done bit is set to indicate that the FIFO is full POS LEN EM BOOL The empty bit indicates that the FIFO is empty If LEN 0 or POS 0 the EM bit and DN bits are set LEN DINT The length specifies the maximum number of elements in the FIFO POS DINT The position identifies the end of the data that has been loaded into the FIFO Description Use the FFU instruction with the FFL instruction to store and retrieve data in a first in first out order When enabled the FFU instruction unloads data from the first element of the FIFO and places that value in the Destination The instruction unloads one value each time the instruction is enabled until the FIFO is empty If the FIFO is empty the FFU returns 0 to the Destination IMPORTANT You must test and confirm that the instruction doesn t change data that you don t want it to change The FFU instruction ope
615. uaranteed 888 88 SOURCE www artisantg com FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Chapter 1 Condition prescan Function Block Action All operator requests timestamps and delivery flags are cleared All the xinAlarm parameters are cleared and all alarm conditions are acknowledged Structured Text Action All operator requests timestamps and delivery flags are cleared All the xinAlarm parameters are cleared and all alarm conditions are acknowledged instruction first scan No action taken No action taken instruction first run Enableln is cleared No action taken No action taken The instruction executes The instruction does not execute EnableOut is cleared EnableOut is always set Enableln is set The instruction executes EnableOut is set The instruction executes EnableOut is always set postscan No action taken Publication 1756 RMOOS3K EN P July 2008 Year No action taken 57 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Alarm Services HHInAlarm ProgAckAll OperAckAll ALMA Level Condition Acknowledge Required Ack Request Ack Request Alatm Condition HH Alarm Condition I II Condition In Time 17 Condition In Time t11 Ack Request InAlarm SubcCondit
616. ue The rung condition out is set to false Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan 544 Artisan Technology Group No action taken Publication 1756 RMO03K EN P July 2008 Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Advanced Math Instructions LN LOG XPY Chapter 15 Example Calculate the log of value and place the result in result Relay Ladder LOG Log Base 10 Source value 3 4000001 Dest result 0 53147888 Structured Text result LOG value Function Block LOG 01 LOG m Log Base 10 Publication 1756 RMO03K EN P July 2008 545 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 15 Xto the Power of Y XPY Operands KPY x To Power Of Y Source X Source Y Dest i dest sourceX sourceY Pal XPY 04 XPY mmf X To Power Of Y 0 0 O SourceA Dest SourceB 546 Advanced Math Instructions LN LOG XPY The XPY instruction takes Source A X to the power of Source B Y and stotes the result in the Destination Relay Ladder Operand Type Format Description Source X SINT immediate base value INT tag
617. ue resets status bits executes when scanned and DN or ER are set sets the in this example EM bit finds termination characters The ASCII queue holds up to 16 instructions When the queue is full an instruction tries to enter the queue on each subsequent scan of the instruction as depicted below scan scan scan scan rung condition in false true false EN off on EU off on Publication 1756 RMOO3K EN P July 2008 attempts to enter queue but queue is full enters queue 567 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT ASCII Error Codes If an ASCII serial port instruction fails to execute the ERROR member of its SERIAL PORT CONTROL structure will contain one of the following hexadecimal error codes This Hex Code Indicates That the 1622 Modem went offline 1623 CTS signal was lost during communication 1674 Serial port was in system mode 167A Before the instruction executed the UL bit was set This prevents the execution of the instruction 16 C The controller changed from Run mode to Program mode This stops the execution of an ASCII serial port instruction and clears the queue 16 D In the Controller Properties dialog box User Protocol tab the buffer size or echo mode parameters were changed and app
618. ue 26 characters fixed width 8 26 Tag4 All of this variable information is included with the alarm data viewable by the operator and entered in the history log regardless of whether you embed the information in the message text Publication 1756 RMOOS3K EN P July 2008 Year 67 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 TYPE TAG ALMMSG en us ALMMSG en us ALMMSG en us ALMMSG en us ALMMSG en us ALMMSG en us ALMMSG de ch ALMMSG de ch TAG ALMMSG en us 68 SCOPE NAME alma1 alma1 alma1 alma1 alma1 alma1 alma1 alma1 alma1 almd1 almd1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Multiple Language Versions of Alarm Messages You can maintain alarm messages in multiple languages Either enter the different languages in the associated language versions of RSLogix 5000 programming software or in an import export CSV or TXT file You can access alarm message text from an import export CSV or TXT file and add additional lines for translated versions of the original message string Messages in different languages use ISO language codes in the TYPE column Alarm message text including embedded variable codes for the operator is in the DESCRIPTION column The SPECIFIER identifies the alarm condition DESCRIPTION DATATYPE SPECIFIER ALARM ANALOG HH alarm for operator in English HH H alarm for opera
619. ue with an INT tag Both examples check the bits of a 1771 I O module to determine if all the bits ate on Since the input data word of a 1771 I O module is an INT tag it is easiest to use a 16 bit constant value EXAMPLE Mixing an INT tag with an immediate value Since remote_rack_1 1 Data O is an INT tag the value to check it against is also entered as an INT tag EQU Equal Source A remote rack 1 Data 0 2 1111 1111 1111 1111 Source B int 0 2 1111 1111 1111 1111 42093 EXAMPLE Mixing an INT tag with an immediate value Since remote_rack_1 1 Data 0 is an INT tag the value to check it against first moves into 77 0 also an INT tag The EQU instruction then compares both tags MOV EQU Move Equal Source 271111 1111 1111 1111 Source A remote rack 1 l Data 0 25111 1111 1111 1111 Dest int 0 Source B int 0 28111 1111 1111 1111 2 111 1111 1111 1111 19083 638 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Common Attributes Appendix A Integer to REAL The controller stores REAL values in IEEE single precision floating point number format It uses one bit for the sign of the value 23 bits for the base value and eight bits for the exponent 32 bits total If you mix an integer tag SINT INT or DINT and a REAL tag as inputs in the same instruction the controller converts the inte
620. uests All subscribers are notified of this event and any alarm messages generated while the alarm is in the Suppressed state include the Suppressed status Alarm clients can respond differently to Suppressed alarms For example suppressed alarms can be logged to the historical database but not annunciated to the operator e When an alarm is Unsuppressed all subscribers are notified and alarm messages to subscribers no longer include the Suppressed status Disable an alarm to treat the alarm as if it does not exist in the control program A disabled alarm does not transition alarm status or get logged in the historical database A disabled alarm is still tracked and can be re enabled in the Alarm Status Explorer in FactoryTalk View SE software e When an alarm is Disabled all of its conditions are set to the initial state InAlarm is cleared and Acked is set The In parameter is not monitored for alarm conditions All subscribers are notified of this event e When an alarm is Enabled it begins to monitor the In parameter for alarm conditions All subscribers are notified of this event Publication 1756 RMOOS3K EN P July 2008 Year 71 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Controller based Alarm Execution Source Alarm tag members Controller based alarms process inputs from two
621. ult Dest DINT Result of the conversion instruction Arithmetic status flags are set for this output Publication 1756 RMOO3K EN P July 2008 561 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 16 Description Arithmetic Status Flags Fault Conditions Execution Condition prescan Math Conversion Instructions DEG RAD TOD FRD TRN TRUNC Truncating does not round the value rather the non fractional part remains the same regardless of the value of the fractional part Arithmetic status flags are affected none Relay Ladder Action The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true The controller removes the fractional part of the Source and places the result in the Destination The rung condition out is set to true postscan Condition prescan The rung condition out is set to false Function Block Action No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan 562 No action taken Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
622. ult Code POS lt 0 or LEN lt 0 4 21 Dimension to vary does not exist for the 4 20 specified array Instruction tries to access data outside of 4 20 the array boundaries 3 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Execution Condition Relay Ladder Action Structured Text Action prescan The EN bit is cleared The EN bit is cleared rung condition in is false The DN bit is cleared The ER bit is cleared The rung condition out is set to false examine DN bit DNbit 0 DN bit 1 EN bit is cleared ER bit is cleared DN bit is cleared ud rung condition out is set to false The DN bit is cleared The ER bit is cleared na rung condition in is true The instruction executes The rung condition out is set to true na Enableln is set na Enableln is always set The instruction executes instruction execution The instruction sorts the specified elements of the array into ascending order The instruction sorts the specified elements of the array into ascending order postscan 372 The rung condition out is set to false No action taken Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant
623. ult Code PRE 0 4 34 ACC lt 0 4 34 Execution Publication 1756 RMOOS3K EN P July 2008 109 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 3 Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Condition Relay Ladder Action prescan The EN TT and DN bits are cleared The ACC value is set to equal the PRE value The rung condition out is set to false rung condition in is false Y examine DN bit A DN bit 1 EN bit is cleared examine EN bit TT bit is set ACC gt PRE TT bit is set examine ACC LL ACC ACC current time last time Y ACC lt PRE DN is cleared TT bit is cleared no ACC value a rolls over A yes rung condition out is set to false Y ACC 2 147 483 647 rung condition in is true The EN TT and DN bits are set The ACC value is cleared The rung condition out is set to true postscan The rung condition out is set to false 110 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Timer and Counter Instructions TON TOF RTO TONR TOFR RTOR CTU CTD CTUD RES Chapter 3 Example When Zzz f switch 2 is cleared ight_2 is o
624. uly 2008 Each time the FOR instruction executes the routine it adds the Step size to the Index Be careful not to loop too many times in a single scan An excessive number of repetitions can cause the controller s watchdog to timeout which causes a major fault not affected A Major Fault Will Occur If Fault Type Fault Code main routine contains a RET instruction 4 31 Relay Ladder Action The rung condition out is set to false The controller executes the subroutine once If recursive FOR instructions exist to the same subroutine the subroutine is prescanned only the first time If multiple FOR instructions exist non recursive to the same subroutine the subroutine is prescanned each time The rung condition out is set to false 471 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 12 For Break Instructions FOR FOR DO BRK EXIT RET Condition Relay Ladder Action rung condition in is true Y index initial value P Y step size lt 0 index terminal value goto end index 2 terminal value execute routine is goto end rung condition out is set to true postscan The rung condition out is set to false Example When enabled the FOR instruction repeatedly executes routine_2 and increments va ue_2 by 1 each time When va ue 2is gt 10 or a BRK instruction is enabled
625. uly 2008 657 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix B Function Block Attributes Notes 658 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Appendix C Introduction Structured Text Syntax Term Definition Structured Text Programming This appendix describes issues that are unique with structured text programming Review the information in this appendix to make sure you understand how your structured text programming will execute For Information About See Page Structured Text Syntax 659 Assignments 661 Expressions 663 Instructions 670 Constructs 671 Comments 687 Structured text is a textual programming language that uses statements to define what to execute e Structured text is not case sensitive Use tabs and carriage returns separate lines to make your structured text easier to read They have no effect on the execution of the structured text Structured text is not case sensitive Structured text can contain these components Examples assignment Use an assignment statement to assign values to tags tag expression see page 661 The operator is the assignment operator n n Terminate the assignment with a semi colon Publication 1756 RMOO3K EN P July 2008 659 Artisan Technology Group Quality
626. uly 2008 Year 45 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 1 FactoryTalk Alarms and Events Logix based Instructions ALMD ALMA Input Parameter Data Type Description LLProgAck BOOL Low Low program acknowledge Set by the user program to acknowledge a Low Low condition Requires a cleared to set transition while the alarm condition is unacknowledged Default is cleared LLOperAck BOOL Low Low operator acknowledge Set by the operator interface to acknowledge a Low Low condition Requires a cleared to set transition while the alarm condition is unacknowledged The alarm instruction clears this parameter Default is cleared ROCPosProgAck BOOL Positive rate of change program acknowledge Set by the user program to acknowledge a positive rate of change condition Requires a cleared to set transition while the alarm condition is unacknowledged Default is cleared ROCPosOperAck BOOL Positive rate of change operator acknowledge Set by the operator interface to acknowledge a positive rate of change condition Requires a cleared to set transition while the alarm condition is unacknowledged The alarm instruction clears this parameter Default is cleared ROCNegProgAck BOOL Negative rate of change program acknowledge Set by the user program to acknowledge a negative rate of change condition Requires a cleared to set transition while the alarm
627. umentation Guaranteed 888 88 SOURCE www artisantg com File Arithmetic and Logic FAL Operands FAL File Arith Logical Control Length N5 Position Mode RI Dest o 4 4 Expression 5j Publication 1756 RM003K EN P July 2008 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Chapter 8 The FAL instruction performs copy arithmetic logic and function operations on data stored in an array Relay Ladder Operand Type Format Description Control CONTROL tag control structure for the operation Length DINT immediate number of elements in the array to be manipulated Position DINT immediate current element in array initial value is typically 0 Mode DINT immediate how to distribute the operation select INC ALL or enter a number Destination SINT tag tag to store the result INT DINT REAL Expression SINT immediate an expression consisting of tags and or immediate values separated INT tag by operators DINT REAL A SINT or INT tag converts to a DINT value by sign extension Structured Text Structured text does not have an FAL instruction but you can achieve the same results using a SIZE instruction and a FOR DO or other loop construct SIZE destination 0 length 1 FOR position 0 TO length DO destination position numeric expression END FOR See Appendix C Structured Text Programming for information on the syntax of con
628. ung condition out is set to false masked Array POS p rung condition out is set to true postscan 422 The rung condition out is set to false Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Sequencer Instructions SQI SQO SQL Chapter 10 Example When enabled the SQI instruction passes va ue_2 through the mask to determine whether the result is equal to the current element in array dint The masked comparison is true so the rung condition out goes true Sl Sequencer Input Array array_1 0 Mask 15H0000f0ff Source value 1 Control control 1 Lenath 10 Position 0 GRT Greater Than 4 gt B Source control 1 pos p Source B control 1 len 10 Publication 1756 RM003K EN P July 2008 Artisan Technology Group Quality Instrumentation Sal Sequencer Input Armay array dint 0 Mask Source Control Lenath Position 16 0F0F value 2 control 1 10 g SQI Operand Example Values DINTs Displayed In Binary Source XXXXXXXX XXXXXXXX XXXX0101 xxxx1010 Mask 00000000 00000000 00001111 00001111 Array XXXXXXXX XXXXXXXX XXXX0101 xxxx1010 A 0 in the mask means the bit is not compared designated by xxxx in this example Use SOI without S00 If you use the SQI instruction without a paired SQO instruction you have to externally incre
629. urce Bit specify the element where to begin the shift do not use CONTROL POS in the subscript Control CONTROL tag control structure for the operation Source bit BOOL tag bit to shift Length DINT immediate number of bits in the array to shift CONTROL Structure Mnemonic Data Type Description EN BOOL The enable bit indicates that the BSR instruction is enabled DN BOOL The done bit is set to indicate that bits shifted one position to the right UL BOOL The unload bit is the instruction s output The UL bit stores the status of the bit that was shifted out of the range of bits ER BOOL The error bit is set when LEN 0 LEN DINT The length specifies the number of array bits to shift Description When enabled the instruction unloads the value at bit 0 of Array to the UL bit shifts the remaining bits one position right and loads Source bit into the uppermost bit of the specified bits IMPORTANT You must test and confirm that the instruction doesn t change data that you don t want it to change The BSR instruction operates on contiguous memory In some cases the instruction changes bits in other members of the tag This happens if the length is too big and the tag is a user defined data type Arithmetic Status Flags not affected Fault Conditions none 390 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com
630. ure string Dimension DINT immediate dimension to use to Vary 0 1 2 For The Size Of Enter first dimension 0 second dimension 1 third dimension 2 Size SINT tag tag to store the number of elements in the specified dimension of the array INT DINT REAL Structured Text SIZE Source Dimtovary Size The operands are the same as those for the relay ladder SIZE instruction Description The SIZE instruction finds the number of elements size in the designated dimension of the Source array and places the result in the Size operand The instruction finds the size of one dimension of an array e The instruction operates on an array array in a structure array that is part of a larger array Arithmetic Status Flags no affected Fault Conditions none Publication 1756 RMOO3K EN P July 2008 381 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 8 Array File Misc Instructions FAL FSC COP CPS FLL AVE SRT STD SIZE Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na Enableln is set The rung condition out is set to true na Enableln is always set The instruction executes instruction execution The inst
631. ured text Publication 1756 RMOO3K EN P July 2008 261 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 6 Compute Math Instructions CPT ADD SUB MUL DIV MOD SOR SORT NEG ABS DIV 01 DIV Ei Divide Dest Sources Cj SourceB Function Block Operand DIV tag Type FBD MATH FBD MATH Structure Format structure Description DIV structure Input Parameter Data Type Description Enableln BOOL Enable input If cleared the instruction does not execute and outputs are not updated Default is set Source A REAL Value of the dividend Valid any float Source B REAL Value of the divisor Valid any float Output Parameter Data Type Description EnableOut BOOL The instruction produced a valid result Dest REAL Result of the math instruction Arithmetic status flags are set for this output Description If the Destination is no a REAL the instruction handles the fractional portion of the result as follows If Source A Then The Fractional Example Portion Of The Result and Source Bare not truncates Source A DINT 5 REALS Source B DINT 3 Destination DINT 1 or Source Bisa REAL rounds Source A REAL 5 0 Source B DINT 3 Destination DINT 2 262 Publication 1756 RMO003K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compute Math Instructio
632. us ScanType0 BOOL Bit Values Scan Type 00 Normal 01 Pre Scan 10 Post Scan not applicable to relay ladder programs 448 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Chapter 11 Description Arithmetic Status Flags Fault Conditions Execution Publication 1756 RMOO3K EN P July 2008 Use the Jump to External Routine J XR instruction to call the external routine from a laddet routine in your project The JXR instruction supports multiple parameters so you can pass values between the ladder routine and the external routine The JXR instruction is similar to the Jump to Subroutine JSR instruction The JXR instruction initiates the execution of the specified external routine e The external routine executes one time e After the external routine executes logic execution returns to the routine that contains the J XR instruction Arithmetic status flags are not affected A Major Fault Will Occur If Fault Type Fault code ean exception occurs in the external routine DLL 4 88 ethe DLL could not be loaded ethe entry point was not found in the DLL The JXR can be synchronous or asynchronous depending on the implementation of the DLL The code in the DLL also determines how to respond to scan status rung condit
633. usive Or 0 0 bool in1 pe E In1 Out o A value result xor E In2 bool in2 E 324 Publication 1756 RMOO3K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Chapter 7 Example 2 In this example ig is set on if only boo inf is set true only boo i12 is set true Otherwise Zgh f is cleared off Structured Text IF bool inl XOR bool in2 THEN light1 1 ELSE light1 0 END IF Publication 1756 RMO03K EN P July 2008 325 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter7 Move Logical Instructions MOV MVM BTD MVMT BTDT CLR SWPB AND OR XOR NOT BAND BOR BXOR BNOT Boolean NOT B amp NOT Operands IF NOT operand THEN statement END IF ug BNOT 04 BNOT El Boolean NOT The BNOT instruction complements a boolean input To perform a bitwise NOT see page 314 Structured Text Use NOT as an operator within an expression The operand must be a BOOL values or expressions that evaluate to BOOL values This expression evaluates whether operand is cleared false See Appendix C Structured Text Programming for information on the syntax of expressions within structured text Function Blo
634. values in Add Input 1 Add Input 2 and Add Input 3 are copied to nput A Input B and Input C respectively 3 The value of Sum A B Cis copied to Add Three Result Function blocks of the Add Three Inputs routine ADD 02 ADD 03 E RET p Subroutine Return SourceA SourceA C SourceB C SourceB 2 The ADD instructions add nput A Input B and Input C and place the result in Sum A B C 446 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Program Control Instructions JMP LBL JSR RET SBR JXR TND MCR UID UIE AFI NOP EOT SFP SFR EVENT Jump to External Routine JXR Chapter 11 The JXR instruction executes an external routine This instruction is only supported by the SoftLogix5800 controllers Publication 1756 RMOO3K EN P July 2008 Operands Relay Ladder JXR Jump To External Routine N gt External routine name N gt External routine control Ro Parameter Return Par Operand Type Format Description External routine ROUTINE name external routine to execute name External routine EXT ROUTINE tag control structure see the next page control CONTROL Parameter BOOL immediate data from this routine that you want to copy to a variable in the external routine SINT tag e Parameters are optional e Enter multiple parameters if needed INT array tag
635. values of the characters determine if one string is less than or greater than another string For the hex code of a character see the back cover of this manual e When the two strings are sorted as in a telephone directory the order of the strings determines which one is greater ASCII Characters Hex Codes 1ab 31 61 62 i Ag 0 31962 e r A 41 S e S a AB 41 42 AB B e t i B 42 r a 61 a gt B Y ab 61 62 224 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Compare Instructions CMP EQU GEO GRT LEQ LES LIM MEQ NEQ Chapter 5 Arithmetic Status Flags not affected Fault Conditions none Execution Relay Ladder Condition Action prescan The rung condition out is set to false rung condition in is false The rung condition out is set to false rung condition in is true Source A Source B rung condition out is set to true rung condition out is set to false E MM M M postscan The rung condition out is set to false Function Block Condition Action prescan No action taken instruction first scan No action taken instruction first run No action taken Enableln is cleared EnableOut is cleared Enableln is set The instruction executes EnableOut is set postscan No action taken Publicati
636. ve the LEN member of the Source tag to the LEN member of the Serial Port Control tag 595 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 17 ASCII Serial Port Instructions ABL ACB ACL AHL ARD ARL AWA AWT Arithmetic Status Flags not affected Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes when rung condition in na toggles from cleared to set The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction sends a specified number of characters The EN bit is set The remaining status bits except UL are cleared The instruction attempts to enter the ASCII queue postscan temp low 596 The rung condition out is set to false No action taken Example 1 When the temperature reaches the low limit emp_ ow is set the AWT instruction sends a message to the MessageView terminal that is connected to the serial port of the controller The message contains nine characters from the DATA member of the s r zg 2 tag which is a string The 14 counts as one character It is the hex code for the Ctrl T character The last charact
637. vent trigger via an IOT instruction JM e v Programmatically IOT Instruction Send Event Trigger to Consume Relay Ladder If New Data on then the following occurs for one scan The CPS instruction sets Produced Tag Source Tag The IOT instruction updates Produced Tag and sends this update to the consuming controller station 25 When the consuming controller receives this update it triggers the associated event task in that controller PS Synchronous Copy File Source Source Tag Dest Produced Tag Length 1 IOT Immediate Output Update Tag Produced_Tag Mew Data Trigger_Consumer E LUNS Structured Text IF New Data AND NOT Trigger Consumer THEN CPS Source Tag Produced Tag 1 IOT Produced Tag END IF Trigger Consumer New Data 204 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 5 Compare Instructions CMP EQU GEO GRT LEO LES LIM MEQ NEO Introduction The compare instructions let you compare values by using an expression or a specific compare instruction If You Want To Use This Instruction Available In These Languages See Page compare values based on an expression CMP relay ladder 206 structured text test whether two values are equal EQU relay ladder 211 structured text function block test whether one value is gre
638. vert the characters to all upper case or all lower case before you compare them Any characters in the Source string that are not letters remain unchanged not affected Arithmetic Status Flags Fault Conditions none Execution Condition Relay Ladder Action Structured Text Action prescan The rung condition out is set to false No action taken rung condition in is false The rung condition out is set to false na rung condition in is true The instruction executes na The rung condition out is set to true Enableln is set na Enableln is always set The instruction executes instruction execution The instruction converts the Source to upper case postscan The rung condition out is set to false Publication 1756 RMOO3K EN P July 2008 No action taken 623 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Chapter 19 ASCII Conversion Instructions STOD STOR DTOS RTOS UPPER LOWER Example To find information about a specific item an operator enters the catalog numbet of the item into an ASCII terminal After the controller reads the input from a terminal erminal_read EM is set the UPPER instruction converts the characters in catalog_number to all upper case characters and stores the result in catalog number upper case A subsequent rung then searches an array for characters that match those in catalog_number_upper_case Relay Lad
639. when AckRequired is cleared Cleared when a High High condition is not acknowledged HAcked BOOL High condition acknowledged status Set when a High condition is acknowledged Always set when AckRequired is cleared Cleared when a High condition is not acknowledged LAcked BOOL Low condition acknowledged status Set when a Low condition is acknowledged Always set when AckRequired is cleared Cleared when a Low condition is not acknowledged LLAcked BOOL Low Low condition acknowledged status Set when a Low Low condition is acknowledged Always set when AckRequired is cleared Cleared when a Low Low condition is not acknowledged ROCPosAcked BOOL Positive rate of change condition acknowledged status Set when a positive rate of change condition is acknowledged Always set when AckRequired is cleared Cleared when a positive rate of change condition is not acknowledged ROCNegAcked BOOL Negative rate of change condition acknowledged status Set when a negative rate of change condition is acknowledged Always set when AckRequired is cleared Cleared when a negative rate of change condition is not acknowledged HHInAlarmUnack BOOL Combined High High condition active and unacknowledged status Set when the High High condition is active HHInAlarm is set and unacknowledged Cleared when the High High condition is normal inactive acknowledged or both HInAlarmUnack BOOL Combined High condition active and unacknowledged
640. ww artisantg com Chapter 5 Compare Instructions CMP EQU GEQ GRT LEQ LES LIM MEQ NEQ Compare CMP Operands CM Compare Expression amp Description Arithmetic Status Flags Fault Conditions 206 The CMP instruction performs a comparison on the arithmetic operations you specify in the expression Relay Ladder Operand Type Format Description Expression SINT immediate an expression consisting of tags and or immediate values separated by operators INT tag DINT REAL string A SINT or INT tag converts to a DINT value by sign extension Structured Text Structured text does not have a CMP instruction but you can achieve the same results using an IE THEN construct and expression IF BOOL expression THEN statement END IF See Appendix C Structured Text Programming for information on the syntax of constructs and expressions within structured text Define the CMP expression using operators tags and immediate values Use parentheses to define sections of more complex expressions The execution of a CMP instruction is slightly slower and uses more memory than the execution of the other comparison instructions The advantage of the CMP instruction is that it allows you to entet complex exptessions in one instruction The CMP instruction only affects the arithmetic status flags if the expression contains an operator for example 5 that affects the arithmetic status
641. x 1768 L4x Pub No 1756 RMOO3K EN P Pub Date July 2008 Part No 1769 L3x 1789 L6x 1794 L3x 20D Please complete the sections below Where applicable rank the feature 1 needs improvement 2 satisfactory and 3 outstanding Overall Usefulness 2 3 How can we make this publication more useful for you 2 3 Can we add more information to help you Completeness all necessary information procedure step illustration feature is provided DM example guideline other explanation definition Technical Accuracy 1 2 3 Can we be more accurate all provided information is correct text illustration Clarity 1 2 3 How can we make things clearer all provided information is easy to understand Other Comments You can add additional comments on the back of this form Your Name Your Title Function Would you like us to contact you regarding your comments Location Phone ___No there is no need to contact me Yes please call me Yes please email me at Yes please contact me via Return this form to Rockwell Automation Technical Communications 1 Allen Bradley Dr Mayfield Hts OH 44124 9705 Fax 440 646 3525 Email RADocumentComments ra rockwell com Publication ClG C0521D EN P July 2007 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com PLEASE FASTEN HERE DO NOT STAPLE Other Comments
642. x DINT tag counts how many times the routine has Step size been executed Initial value SINT immediate value at which to start the index INT tag DINT Terminal SINT immediate value at which to stop executing the routine value INT tag DINT Step size SINT immediate amount to add to the index each time the FOR instruction executes the routine INT tag DINT Structured Text FOR count initial value TO final value BY increment po Use the FOR DO construct See Appendix C Structured Text Programming for information on structured text constructs lt statement gt END_FOR Description IMPORTANT Do not use a FOR instruction to call execute the main routine e You can put a FOR instruction in the main routine or any other routine e If you use a FOR instruction to call the main routine and then put a RET instruction in the main routine a major fault occurs type 4 code 31 When enabled the FOR instruction repeatedly executes the Routine until the Index value exceeds the Terminal value This instruction does not pass parameters to the routine 470 Publication 1756 RMO03K EN P July 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com For Break Instructions FOR FOR DO BRK EXIT RET Chapter 12 Arithmetic Status Flags Fault Conditions Execution Condition prescan rung condition in is false Publication 1756 RMOO3K EN P J
643. y 2008 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Attribute ErrorDetection Data Type SINT Instruction GSV Input Output Instructions MSG GSV SSV IOT Chapter 4 Description Specifies the error detection scheme Value Meaning 0 BCC default 1 CRC MasterMessageTransmit SINT GSV Current value of the master message transmission master only Value Meaning 0 between station polls 1 in poll sequence in place of master s station number Default is 0 NAKReceivelimit SINT GSV The number of NAKs received in response to a message before stopping transmission point to point communication only Valid value 0 127 Default is 3 NormalPollGroupSize INT GSV Number of stations to poll in the normal poll node array after polling all the stations in the priority poll node array master only Valid value 0 255 Default is 0 PollingMode ReplyMessageWait SINT DINT GSV GSV Current polling mode master only Value Meaning 0 message based but don t allow slaves to initiate messages 1 message based but allow slaves to initiate messages default 2 standard single message transfer per node scan 3 standard multiple message transfer per node scan Default setting is 1 The time acting as a master to wait after receiving an ACK before polling the slave for a response master only Valid valu
644. ys HProgAck HOperAck ProgAckAll OperAckAIl clients RSLogix 5000 software RSView software clients RSLogix 5000 software RSView software Io 7 In lt LLLimit MinDurationACC gt MinDurationPRE E EY LLInAlarm True CN In lt LLimit MinDurationACC gt MinDurationPRE LinAlarm False LinAlarm True f LLInAlarm False LAcked True LAcked False LLAcked True LLAcked False ES a r Ack Ack Ack Ack g N LinAlarm False LinAlarm True LLInAlarm False LLInAlarm True LAcked False LAcked True LLAcked False LLAcked True N N A Sy 1 L alarm condition can be acked by several different ways LProgAck LOperAck ProgAckAll OperAckAll 1 LL alarm condition can be acked by several different ways LLProgAck LLOperAck ProgAckAll OperAckAIl clients RSLogix 5000 software RSView software clients RSLogix 5000 software RSView software Where a new sample is collected on the In CurrentSample In PreviousSample next scan after the ROCPeriod has elapsed ROC ROCPeriod Pi ROC RocPosLimit pt E DS ROC RocNegLimit i E CN RocPoslnAlarm False RocPoslnAlarm True RocNeglnAlarm False RocNeglnAlarm True i RocPosAcked True RocPosAcked False RocNegAcked True RocNegAcked False V Ack Ack Ack Ack X RocNeglnAlarm True RocNegAcked True RocPosinAlarm True RocNeglnA

Download Pdf Manuals

image

Related Search

Related Contents

  NETC01-M2 User Manual  Français DÉCLARATION FCC  Nokia 12W Headphones User Manual  Rapid Software Testing  マグネチックスターラー/ホットプレートスターラー  

Copyright © All rights reserved.
Failed to retrieve file