advertisement
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
Operand
Source
FIFO
Control
Length
Position
Type
SINT
INT
DINT
Format
immediate tag
Description
data to be stored in the FIFO
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.
SINT array tag FIFO to modify specify the first element of the FIFO
do not use CONTROL.POS in the subscript
INT
DINT
REAL string structure
CONTROL
DINT
DINT tag control structure for the operation typically use the same CONTROL as the associated FFU immediate maximum number of elements the FIFO can hold at one time 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-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
Mnemonic
.EN
.DN
.EM
.LEN
.POS
CONTROL Structure
Data Type
BOOL
BOOL
BOOL
DINT
DINT
Description
The enable bit indicates that the FFL instruction is enabled.
The done bit is set to indicate that the FIFO is full (.POS = .LEN). The .DN bit inhibits loading the FIFO until .POS < .LEN.
The empty bit indicates that the FIFO is empty. If .LEN
≤
.DN bit are set.
The length specifies the maximum number of elements the FIFO can hold at one time.
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
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 tag is a user-defined data type.
Arithmetic Status Flags:
not affected
Fault Conditions:
A Major Fault Will Occur If
(starting element + .POS) > FIFO array size
Fault Type
4
Fault Code
20
Publication 1756-RM003K-EN-P - July 2008
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
395
Chapter 9 Array (File)/Shift Instructions (BSL, BSR, FFL, FFU, LFL, LFU)
Condition
prescan
.EN bit is set to prevent a false load when scan begins
Execution:
Relay Ladder Action
.LEN < 0 no yes
.POS < 0
.EM is cleared no yes
.EM is set
.POS = 0 no yes
.EM is set
.POS
≥
.LEN
yes no
.DN is set rung-condition-out is set to
false
end
396
Publication 1756-RM003K-EN-P - July 2008
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Condition
rung-condition-in is false
.EN bit is cleared
.LEN < 0 no yes
.POS < 0
.EM is cleared no yes
Relay Ladder Action
Array (File)/Shift Instructions (BSL, BSR, FFL, FFU, LFL, LFU) Chapter 9
.EM is set
.POS = 0 no yes
.EM is set
.POS
≥
.LEN
yes no
.DN is set rung-condition-out is set to
false
end
Publication 1756-RM003K-EN-P - July 2008
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
397
Chapter 9 Array (File)/Shift Instructions (BSL, BSR, FFL, FFU, LFL, LFU)
Relay Ladder Action Condition
rung-condition-in is true examine .EN bit
.EN = 0
.EN = 1
.LEN < 0 no yes
.POS < 0 yes no
.EM bit is cleared
.EN bit is set
.EM bit is set
.LEN < 0 yes no
.POS < 0 yes no
.EM bit is cleared
.DN is cleared
.POS = 0 no yes
.EM bit is set
.POS
≥
.LEN
yes no
.DN bit is set
.POS
≥
.LEN
yes no
.DN bit is set
.POS or
.LEN > size of array yes no major fault
.POS > .LEN
yes no
.POS = .POS - 1
FIFO[.POS - 1] = source
.EM bit is set rung-condition-out is set to
true
end
The rung-condition-out is set to false.
postscan
398
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 FFL instruction loads value_1 into the next position in the
FIFO, which is array_dint[5] in this example.
array_dint[0] array_dint[5]
before FIFO load
00000
11111
22222
33333
44444
00000
00000
00000
00000
00000
control_1.pos = 5
value_1 = 55555 after FIFO load
00000
11111
22222
33333
44444
55555
00000
00000
00000
00000
control_1.pos = 6
Publication 1756-RM003K-EN-P - July 2008
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
399
advertisement
Related manuals
advertisement
Table of contents
- 24 Introduction
- 24 Who Should Use This Manual
- 25 Purpose of This Manual
- 26 Common Information for All Instructions
- 26 Conventions and Related Terms
- 26 Set and clear
- 27 Relay ladder rung condition
- 28 Function block states
- 30 Introduction
- 31 Digital Alarm (ALMD)
- 37 State Diagrams when Acknowledgement Required
- 38 State Diagrams when Acknowledgment Not Required
- 39 ALMD Alarm Acknowledge Required and Latched
- 40 ALMD Alarm Acknowledge Required and Not Latched
- 40 ALMD Alarm Acknowledge Not Required and Latched
- 41 ALMD Alarm Acknowledge Not Required and Not Latched
- 43 Analog Alarm (ALMA)
- 55 State Diagrams when Acknowledgement Required
- 56 State Diagrams when Acknowledgement Not Required
- 59 ALMA Level Condition Acknowledge Required
- 60 ALMA Level Condition Acknowledge Not Required
- 61 ALMA Rate of Change Acknowledge Required
- 62 ALMA Rate of Change Acknowledge Not Required
- 64 Configure an Alarm Instruction
- 66 Enter Alarm Message Text
- 68 Message String Variables
- 69 Multiple Language Versions of Alarm Messages
- 70 Monitor Alarm Status
- 70 Buffering Alarms
- 71 Programmatically Access Alarm Information
- 72 Suppress or Disable Alarms
- 73 Controller-based Alarm Execution
- 74 Controller Memory Use
- 76 Scan Time
- 78 Introduction
- 79 Examine If Closed (XIC)
- 81 Examine If Open (XIO)
- 83 Output Energize (OTE)
- 85 Output Latch (OTL)
- 87 Output Unlatch (OTU)
- 89 One Shot (ONS)
- 92 One Shot Rising (OSR)
- 95 One Shot Falling (OSF)
- 97 One Shot Rising with Input (OSRI)
- 100 One Shot Falling with Input (OSFI)
- 104 Introduction
- 105 Timer On Delay (TON)
- 109 Timer Off Delay (TOF)
- 113 Retentive Timer On (RTO)
- 117 Timer On Delay with Reset (TONR)
- 121 Timer Off Delay with Reset (TOFR)
- 125 Retentive Timer On with Reset (RTOR)
- 129 Count Up (CTU)
- 133 Count Down (CTD)
- 137 Count Up/Down (CTUD)
- 142 Reset (RES)
- 144 Introduction
- 145 Message (MSG)
- 153 MSG Error Codes
- 153 Error Codes
- 155 Extended Error Codes
- 157 PLC and SLC Error Codes (.ERR)
- 159 Block-Transfer Error Codes
- 160 Specify the Configuration Details
- 161 Specify CIP Data Table Read and Write messages
- 162 Reconfigure an I/O module
- 163 Specify CIP Generic messages
- 164 Specify PLC-5 messages
- 166 Specify SLC messages
- 166 Specify block-transfer messages
- 167 Specify PLC-3 messages
- 168 Specify PLC-2 messages
- 169 MSG Configuration Examples
- 170 Specify the Communication Details
- 170 Specify a path
- 173 For Block Transfers
- 173 Specify a Communication Method Or Module Address
- 174 Choose a cache option
- 176 Guidelines
- 177 Get System Value (GSV) and Set System Value (SSV)
- 180 GSV/SSV Objects
- 181 Access the CONTROLLER object
- 182 Access the CONTROLLERDEVICE object
- 184 Access the CST object
- 185 Access the DF1 object
- 188 Access the FAULTLOG object
- 189 Access The MESSAGE Object
- 191 Access The MODULE Object
- 192 Access The MOTIONGROUP Object
- 193 Access The PROGRAM Object
- 194 Access The Routine object
- 194 Access The SERIALPORT Object
- 196 Access The TASK Object
- 198 Access The WALLCLOCKTIME Object
- 199 GSV/SSV Programming Example
- 199 Get Fault Information
- 201 Set Enable And Disable Flags
- 202 Immediate Output (IOT)
- 206 Introduction
- 207 Compare (CMP)
- 209 CMP expressions
- 209 Valid operators
- 210 Format Expressions
- 210 Determine The Order of Operation
- 211 Use Strings In an Expression
- 212 Equal to (EQU)
- 216 Greater than or Equal to (GEQ)
- 220 Greater Than (GRT)
- 224 Less Than or Equal to (LEQ)
- 228 Less Than (LES)
- 232 Limit (LIM)
- 238 Mask Equal to (MEQ)
- 239 Entering an Immediate Mask Value
- 243 Not Equal to (NEQ)
- 248 Introduction
- 249 Compute (CPT)
- 251 Valid operators
- 251 Format Expressions
- 252 Determine the order of operation
- 253 Add (ADD)
- 256 Subtract (SUB)
- 259 Multiply (MUL)
- 262 Divide (DIV)
- 267 Modulo (MOD)
- 271 Square Root (SQR)
- 275 Negate (NEG)
- 278 Absolute Value (ABS)
- 282 Introduction
- 284 Move (MOV)
- 286 Masked Move (MVM)
- 287 Enter an immediate mask value
- 289 Masked Move with Target (MVMT)
- 292 Bit Field Distribute (BTD)
- 295 Bit Field Distribute with Target (BTDT)
- 298 Clear (CLR)
- 300 Swap Byte (SWPB)
- 304 Bitwise AND (AND)
- 307 Bitwise OR (OR)
- 311 Bitwise Exclusive OR (XOR)
- 315 Bitwise NOT (NOT)
- 318 Boolean AND (BAND)
- 321 Boolean OR (BOR)
- 324 Boolean Exclusive OR (BXOR)
- 327 Boolean NOT (BNOT)
- 330 Introduction
- 331 Selecting Mode of Operation
- 331 All mode
- 332 Numerical mode
- 334 Incremental mode
- 336 File Arithmetic and Logic (FAL)
- 345 FAL Expressions
- 345 Valid operators
- 346 Format Expressions
- 346 Determine the order of operation
- 347 File Search and Compare (FSC)
- 352 FSC expressions
- 353 Valid Operators
- 353 Format Expressions
- 354 Determine the order of operation
- 355 Use Strings In an Expression
- 356 Copy File (COP) Synchronous Copy File (CPS)
- 362 File Fill (FLL)
- 366 File Average (AVE)
- 371 File Sort (SRT)
- 376 File Standard Deviation (STD)
- 382 Size In Elements (SIZE)
- 386 Introduction
- 387 Bit Shift Left (BSL)
- 391 Bit Shift Right (BSR)
- 395 FIFO Load (FFL)
- 401 FIFO Unload (FFU)
- 407 LIFO Load (LFL)
- 413 LIFO Unload (LFU)
- 420 Introduction
- 421 Sequencer Input (SQI)
- 422 Enter an Immediate Mask Value
- 424 Use SQI without SQO
- 425 Sequencer Output (SQO)
- 426 Enter an Immediate Mask Value
- 428 Using SQI with SQO
- 428 Resetting the position of SQO
- 429 Sequencer Load (SQL)
- 434 Introduction
- 435 Label (LBL)
- 437 Subroutine (SBR) Return (RET)
- 448 Jump to External Routine (JXR)
- 451 Temporary End (TND)
- 453 Master Control Reset (MCR)
- 455 User Interrupt Disable (UID) User Interrupt Enable (UIE)
- 457 Always False Instruction (AFI)
- 458 No Operation (NOP)
- 459 End of Transition (EOT)
- 461 SFC Pause (SFP)
- 463 SFC Reset (SFR)
- 465 Trigger Event Task (EVENT)
- 465 a Task
- 470 Introduction
- 471 For (FOR)
- 474 Break (BRK)
- 475 Return (RET)
- 478 Introduction
- 479 File Bit Comparison (FBC)
- 481 Selecting the Search Mode
- 487 Diagnostic Detect (DDT)
- 489 Selecting the search mode
- 495 Data Transitional (DTR)
- 496 Enter an immediate mask value
- 498 Proportional Integral Derivative (PID)
- 503 Configure a PID Instruction
- 504 Specify Tuning
- 505 Specify Configuration
- 505 Specifying Alarms
- 506 Specifying Scaling
- 506 Using PID Instructions
- 509 PID instruction timing
- 513 Bumpless Restart
- 514 Derivative Smoothing
- 515 Set the Deadband
- 515 Use Output Limiting
- 516 Feedforward or Output Biasing
- 516 Cascading Loops
- 517 Control a Ratio
- 518 PID Theory
- 518 PID Process
- 518 PID Process With Master/slave Loops
- 520 Introduction
- 521 Sine (SIN)
- 524 Cosine (COS)
- 527 Tangent (TAN)
- 530 Arc Sine (ASN)
- 533 Arc Cosine (ACS)
- 536 Arc Tangent (ATN)
- 540 Introduction
- 541 Natural Log (LN)
- 544 Log Base 10 (LOG)
- 547 X to the Power of Y (XPY)
- 550 Introduction
- 551 Degrees (DEG)
- 554 Radians (RAD)
- 557 Convert to BCD (TOD)
- 560 Convert to Integer (FRD)
- 562 Truncate (TRN)
- 566 Introduction
- 567 Instruction Execution
- 569 ASCII Error Codes
- 569 String Data Types
- 571 ASCII Test For Buffer Line (ABL)
- 574 ASCII Chars in Buffer (ACB)
- 576 ASCII Clear Buffer (ACL)
- 578 ASCII Handshake Lines (AHL)
- 582 ASCII Read (ARD)
- 586 ASCII Read Line (ARL)
- 590 ASCII Write Append (AWA)
- 595 ASCII Write (AWT)
- 600 Introduction
- 601 String Data Types
- 602 String Concatenate (CONCAT)
- 604 String Delete (DELETE)
- 606 Find String (FIND)
- 608 Insert String (INSERT)
- 610 Middle String (MID)
- 612 Introduction
- 614 String Data Types
- 615 String To DINT (STOD)
- 617 String To REAL (STOR)
- 620 DINT to String (DTOS)
- 622 REAL to String (RTOS)
- 624 Upper Case (UPPER)
- 626 Lower Case (LOWER)
- 628 Introduction
- 628 Breakpoints (BPT)
- 629 String Format
- 632 Tracepoints (TPT)
- 632 String Format
- 636 Introduction
- 636 Immediate Values
- 636 Data Conversions
- 638 SINT or INT to DINT
- 640 Integer to REAL
- 640 DINT to SINT or INT
- 641 REAL to an Integer
- 642 Introduction
- 642 Choose the Function Block Elements
- 643 Latching Data
- 645 Order of Execution
- 646 Resolve a Loop
- 648 Resolve Data Flow Between Two Blocks
- 648 Create a One Scan Delay
- 649 Summary
- 649 Function Block Responses to Overflow Conditions
- 650 Timing Modes
- 652 Common Instruction Parameters for Timing Modes
- 654 Overview of Timing Modes
- 655 Program/Operator Control
- 660 Introduction
- 660 Structured Text Syntax
- 662 Assignments
- 663 Specify a non-retentive assignment
- 664 Assign an ASCII character to a string
- 664 Expressions
- 666 Use arithmetic operators and functions
- 667 Use relational operators
- 669 Use logical operators
- 670 Use bitwise operators
- 670 Determine the order of execution
- 671 Instructions
- 672 Constructs
- 672 Some key words are reserved for future use
- 673 IF...THEN
- 676 CASE...OF
- 679 FOR…DO
- 682 WHILE…DO
- 685 REPEAT…UNTIL
- 688 Comments
- 700 ASCII Character Codes