EMEC245
Industrial Control Systems II
Advanced PLC’s and PAC’s
Data Handling Instructions and Shift Registers
Section 10-3-6 Copy and Fill Instructions
ControlLogix (The textbook is for reference only
and covers the instructions in SLC500 format)
Chapter 10
3
 The Copy File (COP) instruction is an
output instruction that copies data from
one memory location to another.
 Executes when the rung containing the
instruction is true and can be conditional
or unconditional.
 The COP instruction has 3-instruction
parameters:
 Source
 Destination
 Length
Copy File (COP)
4
 Source
 A word level tag that contains the data to be
copied.
 Must be an array with at least one word; ex.
ArrayName[0]. (ArrayName[x], where ‘x’ is the
starting element of the array).
 The word level tag with array element
reference is the starting word of the array to
be copied.
 Data type of SINT, INT, DINT, REAL or
Structure.
COP Instruction
Parameters (1 of 3)
5
 Destination
 A word level tag with array element reference
that is the starting word of the array to which
the Source data is to be copied.
 Must be an array with at least the same number
of elements as the array referenced in the
Source; ex. ArrayDest[0].
 The instruction will overwrite any data that is
already stored in the Destination without
notification.
 Data type of SINT, INT, DINT, REAL or
Structure.
COP Instruction
Parameters (2 of 3)
6
 Length
 Can be a tag of type DINT or a program
constant that specifies the number of elements
or words to be copied.
 Test to insure that the length will not exceed
the number of array elements referenced in
the destination to avoid runtime errors and
processor faults.
COP Instruction
Parameters (3 of 3)
7
 The COP instruction has no instruction
tags or status bits. If status is required,
status must be supplied by the user.
 The value referenced in the Length
parameter determines the number of
words to be copied. This instruction will
fault the processor if the number of
elements copied exceeds the length of the
Source or Destination array.
COP Status Bits
COP Single Word per
Array Element Dest
Because the
Destination address
is a data file that
consists of one
word array
elements, for each
array element in the
Source, one word
will be copied to the
array elements
referenced in the
Destination.
COP Structure
Destination
Because the
Destination address is
a data structure
consisting of three
words, for each array
element referenced in
the Source, three
words will be copied
to the array structure
referenced in the
Destination.
Length * 3 words.
Unpredictable operation can occur because the
status bits will be affected and the lower byte
of word 0 (being used by AB for some
purpose) will be affected.
10
 The File Fill (FLL) instruction is an output
instruction that fills data from a word level tag or
program constant referenced in the Source
parameter to the array referenced in the
Destination.
 Executes when the rung containing the instruction
is true and can be conditional or unconditional.
 The FLL instruction has 3-instruction parameters:
 Source
 Destination
 Length
File Fill (FLL)
11
 Source
 Can be a word level tag or program constant.
 When a tag, the tag is not an array because
only the value stored in the word is filled to
the destination.
FLL Instruction
Parameters (1 of 3)
12
 Destination
 A word level array that references the starting
word of the array to which the Source data is
to be filled.
 Must be an array with a length of at least one
element.
 The instruction will overwrite any data that is
already stored in the Destination without
notification.
FLL Instruction
Parameters (2 of 3)
13
 Length
 Must be a program constant that specifies the
number of array elements to be filled.
 If the Destination data type is 1-word
elements the length range can be 1 to the
upper array bounds.
 If the Destination file type is a structure such
as Timers or Counters, the number of array
elements filled is Length * the number of
words in the structure.
 The length value should be tested to insure
that it will not exceed the upper array bound.
FLL Instruction
Parameters (3 of 3)
14
 The FLL instruction has no instruction tag
or status bits. If status is required, status
must be supplied by the user.
 The value referenced in the Length
parameter determines the number of
words to be filled. This instruction will
fault the processor if the number of
elements filled exceeds the length of the
Destination array.
FLL Status Bits
FLL Single Word per
Array Element Dest
The array,
whose starting
element is
referenced in
the Destination
will be filled for
the number of
elements
referenced in
the Length,
with the data
stored in the
Source.
16
 Filling a structure such as timers and
counters should be done with extreme
care. Unpredictable operation can occur
because the status bits will be affected
and the lower byte of word 0 (being used
by AB for some purpose) will be affected.
FLL Array of Structure
Dest (1 of 2)
17
 The example shown on the next slide will fill
five timer structures starting at TimerArray[0]
with the value stored in the Source tag
FLL_Source_Tag:
 TimerArray[0].0 (the status bit word) =
FLL_Source_Tag
 TimerArray[0].PRE = FLL_Source_Tag
 TimerArray[0].ACC = FLL_Source_Tag
Through
 TimerArray[4].0 (the status bit word) =
FLL_Source_Tag
 TimerArray[4].PRE = FLL_Source_Tag
 TimerArray[4].ACC = FLL_Source_Tag
FLL Array of Structure
Dest (2 of 2)
FLL Array of
Structure Dest
FLL Constant Source
Recipe Application
 This example copies 1-of-4 user
selected recipes to the batch
parameters of a batch process.
 The COP instruction shown will copy
the content of 4-words from a two-
dimensional array referenced in the
source, to a one-dimensional array in
the destination. (The COP will be
discussed in the next unit).
 The source tag is referencing a two-
dimensional array:
Recipe[RecipeNumber, 0]. Note that
the first dimension of the array is a
tag. This tag stores the value of the
recipe number selected by a user and
is used to point to 1-of-4 of the
recipes.
 If the user selects recipe number 2, the
data stored in Recipe[2,0],
Recipe[2,1], Recipe[2,2] and
Recipe[2,3] will be copied to:
BatchRecipe[0] through BatchRecipe[3]
respectively.
0
1
2
3
Optional class material – Not covered inclass
COP & FLL for SLC500
Data Handling Instructions and Shift Registers
Section 10-3-6 Copy and Fill Instructions
SLC500, (LogixPro does not support Copy and
Fill Instructions).
Chapter 10
23
 The Copy File (COP) instruction is an
output instruction that copies data from
one memory location to another.
 Executes when the rung containing the
instruction is true and can be conditional
or unconditional.
 The COP instruction has 3-instruction
parameters:
 Source
 Destination
 Length
Copy File (COP)
24
 Source
 A word level address that contains the data to
be copied.
 Must be an indexed word level address
because a file or block of data is being copied.
Therefore, the index indicator (#) must be
used when entering the address.
 The word level address is the starting word of
the file to be copied.
 Floating Point (F8) and String (ST) values are
supported for those processor types that are
capable of these data types.
COP Instruction
Parameters (1 of 3)
25
 Destination
 A word level address that is the starting word of
the file to which the Source data is to be copied.
 Must be an indexed word level address because
a file or block of data is being copied. Therefore,
the index indicator (#) must be used when
entering the address.
 The instruction will overwrite any data that is
already stored in the Destination without issuing
a warning.
 Floating Point (F8) and String (ST) values are
supported for those processor types that are
capable of these data types.
COP Instruction
Parameters (2 of 3)
26
 Length
 Must be a program constant that specifies the
number of elements or words to be copied.
 If the Destination file type is 1-word elements
the length range is 1 to 128 inclusive.
 If the Destination file type is a 3-word element
such as Timers or Counters, the length range
is 1 to 42 inclusive.
 The length value is written to S:24 when the
instruction executes.
COP Instruction
Parameters (3 of 3)
27
 The COP instruction has no instruction
address or status bits. If status is
required, status must be supplied by the
user.
COP Status Bits
28
 This instruction will not copy across file
boundaries. The value referenced in the
Length parameter determines the number
of words to be copied. Insure that the
starting address referenced in the Source
parameter will not exceed the file
boundary of the Destination based upon
the value entered in for the Length.
 If an attempt is made to cross file
boundaries is made, and error will occur
and the processor will fault.
COP Crossing File
Boundaries
COP Single Word
Destination
Because the
Destination address
is a data file that
consists of one
word elements, for
each word in the file
referenced in the
Source, one word
will be copied to the
file referenced in
the Destination.
COP Structure
Destination
Because the
Destination address is
a data file that
consists of three word
elements, for each
word in the file
referenced in the
Source, three words
will be copied to the
file referenced in the
Destination.
Length * 3 words.
Unpredictable operation can occur because the
status bits will be affected and the lower byte
of word 0 (being used by AB for some
purpose) will be affected.
31
 The File Fill (FLL) instruction is an output
instruction that fills data from a word level address
or program constant referenced in the Source
parameter to the indexed address referenced in the
Destination.
 Executes when the rung containing the instruction
is true and can be conditional or unconditional.
 The FLL instruction has 3-instruction parameters:
 Source
 Destination
 Length
File Fill – (FLL)
32
 Source
 Can be a word level address or program
constant.
 Is not an indexed word level address because
only the value stored in the word is filled to
the destination. Therefore, the index indicator
(#) is not required.
 Floating Point (F8) and String (ST) values are
supported for those processor types that are
capable of these data types.
FLL Instruction
Parameters (1 of 3)
33
 Destination
 A word level address that is the starting word of
the file to which the Source data is to be filled.
 Must be an indexed word level address because
a file or block of data is being filled. Therefore,
the index indicator (#) must be used when
entering the address.
 The instruction will overwrite any data that is
already stored in the Destination without issuing
a warning.
 Floating Point (F8) and String (ST) values are
supported for those processor types that are
capable of these data types.
FLL Instruction
Parameters (2 of 3)
34
 Length
 Must be a program constant that specifies the
number of elements or words to be filled.
 If the Destination file type is 1-word elements
the length range is 1 to 128 inclusive.
 If the Destination file type is a 3-word element
such as Timers or Counters, the length range
is 1 to 42 inclusive.
 The length value is written to S:24 when the
instruction executes.
FLL Instruction
Parameters
35
 The FLL instruction has no instruction
address or status bits. If status is
required, status must be supplied by the
user.
FLL Status Bits
36
 This instruction will not fill across file
boundaries. The value referenced in the
Length parameter determines the number
of words to be filled. Insure that the value
referenced in the Length parameter will
not make the filled data exceed the file
boundary.
 If an attempt is made to cross file
boundaries is made, and error will occur
and the processor will fault.
FLL Crossing File
Boundaries
FLL Single Word
Destination
The file, whose
starting word is
referenced in the
Destination will be
filled for the
number of words
referenced in the
Length, with the
data stored in the
Source.
38
 Filling a file whose destination address is a 3-word
structure such as timers and counters should be
done with extreme care. Unpredictable operation
can occur because the status bits will be affected
and the lower byte of word 0 (being used by AB
for some purpose) will be affected.
 The example shown on the next slide is being used
as an FYI only to show functionality of the FLL
instruction. It will fill six counter words starting at
C5:4 with the constant 5319 as follows:
 C5:4.0 (the status bit word) = 5319
 C5:4.PRE = 5319
 C5:4.ACC = 5319
FLL Structure
Destination
FLL Structure
Destination
5419
40
 Allen Bradley makes a module that accepts
4-thermocouples (T/C), (1746-NT4).
Assume this module is placed in slot-6.
 The NT4 module has 4-input channels and
4-output channels. The input channels is
the T/C data and the output channels are
the module configuration channels.
FLL Application
41
 The module must be configured before
use. The configuration word configures:
 The T/C type
 Data in engineering units
 Open circuit response
 Temperature units (C or F)
 Filter frequency
 Channels enabled
FLL Application
(SLC500)
FLL Application
FLL Application

More Related Content

PPTX
04 sequencer instructions_sp15
PPTX
06 chapter03 04_control_logix_tags_memory_structure_fa16
PPTX
05 chapter03 03_memory_structure_slc500_fa16
PPTX
09 chapter04 timers_fa14
PPTX
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
PPTX
Move mask moves_rev01_fa16
PPT
Data Manipulation and Math Instruction on RSLogix 500
PPTX
03 chapter03 01_introduction_fa16
04 sequencer instructions_sp15
06 chapter03 04_control_logix_tags_memory_structure_fa16
05 chapter03 03_memory_structure_slc500_fa16
09 chapter04 timers_fa14
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
Move mask moves_rev01_fa16
Data Manipulation and Math Instruction on RSLogix 500
03 chapter03 01_introduction_fa16

What's hot (20)

PPTX
11 chapter06 slc_int_float_mov_mvm_fa14
PPTX
System programming and implementation
PPT
Assemblers: Ch03
PDF
system software 16 marks
PPTX
Assembler
PDF
PDF
Assembler directives and basic steps ALP of 8086
PPT
Assembler
PPTX
Instruction format
PDF
Examinable Question and answer system programming
PPTX
Chapter 5 programming concepts iv
PDF
Embedded C - Lecture 4
PPTX
Addressing mode
PPTX
PPTX
Two pass Assembler
PDF
Mp lab manual
DOCX
MASM -UNIT-III
PPTX
Chapter 2 programming concepts - I
PDF
Compiler unit 4
11 chapter06 slc_int_float_mov_mvm_fa14
System programming and implementation
Assemblers: Ch03
system software 16 marks
Assembler
Assembler directives and basic steps ALP of 8086
Assembler
Instruction format
Examinable Question and answer system programming
Chapter 5 programming concepts iv
Embedded C - Lecture 4
Addressing mode
Two pass Assembler
Mp lab manual
MASM -UNIT-III
Chapter 2 programming concepts - I
Compiler unit 4
Ad

Viewers also liked (20)

PPTX
01 control logix_arrays_sp17
PPTX
01 indirect indexed_addressing_and_arrays_sp15
PPTX
04 scaling analog_datal_sp17
PPTX
03 analog control_sp17
PPTX
02 chapter02 fa16
PPTX
Stepper motor
PDF
PLC Counters
PDF
PLC arithmatic functions
PDF
PLC application
PDF
Module Consolidation: Combining Safety-Critical Automotive Applications with ...
PPTX
01 introduction to_plc-pac_rev01_fa16
PDF
Plc analog input output programming
PDF
PLC data types and addressing
PDF
ELECTRICAL DISTRIBUTION TECHNOLOGY
PDF
Load Characteristics
PDF
PLC input and output devices
PDF
Application of Capacitors to Distribution System and Voltage Regulation
PDF
PLC Traffic Light Control
PPT
Input and Output Devices.
PDF
Distribution System Voltage Drop and Power Loss Calculation
01 control logix_arrays_sp17
01 indirect indexed_addressing_and_arrays_sp15
04 scaling analog_datal_sp17
03 analog control_sp17
02 chapter02 fa16
Stepper motor
PLC Counters
PLC arithmatic functions
PLC application
Module Consolidation: Combining Safety-Critical Automotive Applications with ...
01 introduction to_plc-pac_rev01_fa16
Plc analog input output programming
PLC data types and addressing
ELECTRICAL DISTRIBUTION TECHNOLOGY
Load Characteristics
PLC input and output devices
Application of Capacitors to Distribution System and Voltage Regulation
PLC Traffic Light Control
Input and Output Devices.
Distribution System Voltage Drop and Power Loss Calculation
Ad

Similar to 02 copy file_fill_sp16 (20)

PPTX
B sc e 5.2 mp unit 2 soft ware(alp)
PDF
Instruction types
PDF
Stack and subroutine
PPTX
Chapter 4 programming concepts III
DOCX
Instructionformatreport 110419102141-phpapp02
PDF
8086 instruction set with types
PPT
7. Stacks and subroutine.pptfor engineering student
PPTX
FLAG & PROCESSOR & STRING INSTRUCTIONS.pptx
PDF
PDF
Lecture5(1)
PDF
8085_MicroelectronicAndMicroprocess.pdf
PPTX
ppt-U2 - (Instruction Set of 8086, Simple programs).pptx
PDF
Chapter 6 - Introduction to 8085 Instructions
PPT
Data manipulation for Mechatronics System
PPT
10 instruction sets characteristics
PDF
Chapter 4 instruction set of 8086 microprocessor.pdf
PDF
Chapter 5 and 6 instructions and program control instructions.pdf
PPT
C for Microcontrollers
PPTX
Unit iii
B sc e 5.2 mp unit 2 soft ware(alp)
Instruction types
Stack and subroutine
Chapter 4 programming concepts III
Instructionformatreport 110419102141-phpapp02
8086 instruction set with types
7. Stacks and subroutine.pptfor engineering student
FLAG & PROCESSOR & STRING INSTRUCTIONS.pptx
Lecture5(1)
8085_MicroelectronicAndMicroprocess.pdf
ppt-U2 - (Instruction Set of 8086, Simple programs).pptx
Chapter 6 - Introduction to 8085 Instructions
Data manipulation for Mechatronics System
10 instruction sets characteristics
Chapter 4 instruction set of 8086 microprocessor.pdf
Chapter 5 and 6 instructions and program control instructions.pdf
C for Microcontrollers
Unit iii

More from John Todora (20)

PPTX
Comparison instructions, AB, Siemens and AB CCW
PPTX
Lab02 review
PPTX
Subroutines rev01 fa16
PPTX
Math cl ccw_siemens_rev01_fa16
PPTX
ControlLogix Counters FA16
PPTX
Lab02 lead in
PPTX
ControlLogix Timers FA16
PPTX
07 chapter07 loop_diagrams
PPTX
06 chapter06 binary_logic_systems_Rev02
PPTX
04 chapter04 specification_forms
PPTX
03 chapter03 lists_indexes_databases
PPTX
02 chapter02 p&ids_and_symbols_split_animations
PPTX
01 chapter01 process_flow_diagram
PPTX
00 introduction
PPTX
EMEC130 P&ID Symbol Primer
PPTX
Control Systems Basics
PPTX
01 overview of_industrial_automation_sp15
PPTX
05 analog control_sp15
PPTX
03 shift registers_and_more_data_manipulation_sp15
PPTX
13 chap07 and_08_comparison_subs_force_fa14
Comparison instructions, AB, Siemens and AB CCW
Lab02 review
Subroutines rev01 fa16
Math cl ccw_siemens_rev01_fa16
ControlLogix Counters FA16
Lab02 lead in
ControlLogix Timers FA16
07 chapter07 loop_diagrams
06 chapter06 binary_logic_systems_Rev02
04 chapter04 specification_forms
03 chapter03 lists_indexes_databases
02 chapter02 p&ids_and_symbols_split_animations
01 chapter01 process_flow_diagram
00 introduction
EMEC130 P&ID Symbol Primer
Control Systems Basics
01 overview of_industrial_automation_sp15
05 analog control_sp15
03 shift registers_and_more_data_manipulation_sp15
13 chap07 and_08_comparison_subs_force_fa14

Recently uploaded (20)

DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
IGGE1 Understanding the Self1234567891011
PDF
HVAC Specification 2024 according to central public works department
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Virtual and Augmented Reality in Current Scenario
PDF
advance database management system book.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
Complications of Minimal Access-Surgery.pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Cambridge-Practice-Tests-for-IELTS-12.docx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
B.Sc. DS Unit 2 Software Engineering.pptx
IGGE1 Understanding the Self1234567891011
HVAC Specification 2024 according to central public works department
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
What if we spent less time fighting change, and more time building what’s rig...
Virtual and Augmented Reality in Current Scenario
advance database management system book.pdf
History, Philosophy and sociology of education (1).pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Environmental Education MCQ BD2EE - Share Source.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Complications of Minimal Access-Surgery.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...

02 copy file_fill_sp16

  • 1. EMEC245 Industrial Control Systems II Advanced PLC’s and PAC’s
  • 2. Data Handling Instructions and Shift Registers Section 10-3-6 Copy and Fill Instructions ControlLogix (The textbook is for reference only and covers the instructions in SLC500 format) Chapter 10
  • 3. 3  The Copy File (COP) instruction is an output instruction that copies data from one memory location to another.  Executes when the rung containing the instruction is true and can be conditional or unconditional.  The COP instruction has 3-instruction parameters:  Source  Destination  Length Copy File (COP)
  • 4. 4  Source  A word level tag that contains the data to be copied.  Must be an array with at least one word; ex. ArrayName[0]. (ArrayName[x], where ‘x’ is the starting element of the array).  The word level tag with array element reference is the starting word of the array to be copied.  Data type of SINT, INT, DINT, REAL or Structure. COP Instruction Parameters (1 of 3)
  • 5. 5  Destination  A word level tag with array element reference that is the starting word of the array to which the Source data is to be copied.  Must be an array with at least the same number of elements as the array referenced in the Source; ex. ArrayDest[0].  The instruction will overwrite any data that is already stored in the Destination without notification.  Data type of SINT, INT, DINT, REAL or Structure. COP Instruction Parameters (2 of 3)
  • 6. 6  Length  Can be a tag of type DINT or a program constant that specifies the number of elements or words to be copied.  Test to insure that the length will not exceed the number of array elements referenced in the destination to avoid runtime errors and processor faults. COP Instruction Parameters (3 of 3)
  • 7. 7  The COP instruction has no instruction tags or status bits. If status is required, status must be supplied by the user.  The value referenced in the Length parameter determines the number of words to be copied. This instruction will fault the processor if the number of elements copied exceeds the length of the Source or Destination array. COP Status Bits
  • 8. COP Single Word per Array Element Dest Because the Destination address is a data file that consists of one word array elements, for each array element in the Source, one word will be copied to the array elements referenced in the Destination.
  • 9. COP Structure Destination Because the Destination address is a data structure consisting of three words, for each array element referenced in the Source, three words will be copied to the array structure referenced in the Destination. Length * 3 words. Unpredictable operation can occur because the status bits will be affected and the lower byte of word 0 (being used by AB for some purpose) will be affected.
  • 10. 10  The File Fill (FLL) instruction is an output instruction that fills data from a word level tag or program constant referenced in the Source parameter to the array referenced in the Destination.  Executes when the rung containing the instruction is true and can be conditional or unconditional.  The FLL instruction has 3-instruction parameters:  Source  Destination  Length File Fill (FLL)
  • 11. 11  Source  Can be a word level tag or program constant.  When a tag, the tag is not an array because only the value stored in the word is filled to the destination. FLL Instruction Parameters (1 of 3)
  • 12. 12  Destination  A word level array that references the starting word of the array to which the Source data is to be filled.  Must be an array with a length of at least one element.  The instruction will overwrite any data that is already stored in the Destination without notification. FLL Instruction Parameters (2 of 3)
  • 13. 13  Length  Must be a program constant that specifies the number of array elements to be filled.  If the Destination data type is 1-word elements the length range can be 1 to the upper array bounds.  If the Destination file type is a structure such as Timers or Counters, the number of array elements filled is Length * the number of words in the structure.  The length value should be tested to insure that it will not exceed the upper array bound. FLL Instruction Parameters (3 of 3)
  • 14. 14  The FLL instruction has no instruction tag or status bits. If status is required, status must be supplied by the user.  The value referenced in the Length parameter determines the number of words to be filled. This instruction will fault the processor if the number of elements filled exceeds the length of the Destination array. FLL Status Bits
  • 15. FLL Single Word per Array Element Dest The array, whose starting element is referenced in the Destination will be filled for the number of elements referenced in the Length, with the data stored in the Source.
  • 16. 16  Filling a structure such as timers and counters should be done with extreme care. Unpredictable operation can occur because the status bits will be affected and the lower byte of word 0 (being used by AB for some purpose) will be affected. FLL Array of Structure Dest (1 of 2)
  • 17. 17  The example shown on the next slide will fill five timer structures starting at TimerArray[0] with the value stored in the Source tag FLL_Source_Tag:  TimerArray[0].0 (the status bit word) = FLL_Source_Tag  TimerArray[0].PRE = FLL_Source_Tag  TimerArray[0].ACC = FLL_Source_Tag Through  TimerArray[4].0 (the status bit word) = FLL_Source_Tag  TimerArray[4].PRE = FLL_Source_Tag  TimerArray[4].ACC = FLL_Source_Tag FLL Array of Structure Dest (2 of 2)
  • 20. Recipe Application  This example copies 1-of-4 user selected recipes to the batch parameters of a batch process.  The COP instruction shown will copy the content of 4-words from a two- dimensional array referenced in the source, to a one-dimensional array in the destination. (The COP will be discussed in the next unit).  The source tag is referencing a two- dimensional array: Recipe[RecipeNumber, 0]. Note that the first dimension of the array is a tag. This tag stores the value of the recipe number selected by a user and is used to point to 1-of-4 of the recipes.  If the user selects recipe number 2, the data stored in Recipe[2,0], Recipe[2,1], Recipe[2,2] and Recipe[2,3] will be copied to: BatchRecipe[0] through BatchRecipe[3] respectively. 0 1 2 3
  • 21. Optional class material – Not covered inclass COP & FLL for SLC500
  • 22. Data Handling Instructions and Shift Registers Section 10-3-6 Copy and Fill Instructions SLC500, (LogixPro does not support Copy and Fill Instructions). Chapter 10
  • 23. 23  The Copy File (COP) instruction is an output instruction that copies data from one memory location to another.  Executes when the rung containing the instruction is true and can be conditional or unconditional.  The COP instruction has 3-instruction parameters:  Source  Destination  Length Copy File (COP)
  • 24. 24  Source  A word level address that contains the data to be copied.  Must be an indexed word level address because a file or block of data is being copied. Therefore, the index indicator (#) must be used when entering the address.  The word level address is the starting word of the file to be copied.  Floating Point (F8) and String (ST) values are supported for those processor types that are capable of these data types. COP Instruction Parameters (1 of 3)
  • 25. 25  Destination  A word level address that is the starting word of the file to which the Source data is to be copied.  Must be an indexed word level address because a file or block of data is being copied. Therefore, the index indicator (#) must be used when entering the address.  The instruction will overwrite any data that is already stored in the Destination without issuing a warning.  Floating Point (F8) and String (ST) values are supported for those processor types that are capable of these data types. COP Instruction Parameters (2 of 3)
  • 26. 26  Length  Must be a program constant that specifies the number of elements or words to be copied.  If the Destination file type is 1-word elements the length range is 1 to 128 inclusive.  If the Destination file type is a 3-word element such as Timers or Counters, the length range is 1 to 42 inclusive.  The length value is written to S:24 when the instruction executes. COP Instruction Parameters (3 of 3)
  • 27. 27  The COP instruction has no instruction address or status bits. If status is required, status must be supplied by the user. COP Status Bits
  • 28. 28  This instruction will not copy across file boundaries. The value referenced in the Length parameter determines the number of words to be copied. Insure that the starting address referenced in the Source parameter will not exceed the file boundary of the Destination based upon the value entered in for the Length.  If an attempt is made to cross file boundaries is made, and error will occur and the processor will fault. COP Crossing File Boundaries
  • 29. COP Single Word Destination Because the Destination address is a data file that consists of one word elements, for each word in the file referenced in the Source, one word will be copied to the file referenced in the Destination.
  • 30. COP Structure Destination Because the Destination address is a data file that consists of three word elements, for each word in the file referenced in the Source, three words will be copied to the file referenced in the Destination. Length * 3 words. Unpredictable operation can occur because the status bits will be affected and the lower byte of word 0 (being used by AB for some purpose) will be affected.
  • 31. 31  The File Fill (FLL) instruction is an output instruction that fills data from a word level address or program constant referenced in the Source parameter to the indexed address referenced in the Destination.  Executes when the rung containing the instruction is true and can be conditional or unconditional.  The FLL instruction has 3-instruction parameters:  Source  Destination  Length File Fill – (FLL)
  • 32. 32  Source  Can be a word level address or program constant.  Is not an indexed word level address because only the value stored in the word is filled to the destination. Therefore, the index indicator (#) is not required.  Floating Point (F8) and String (ST) values are supported for those processor types that are capable of these data types. FLL Instruction Parameters (1 of 3)
  • 33. 33  Destination  A word level address that is the starting word of the file to which the Source data is to be filled.  Must be an indexed word level address because a file or block of data is being filled. Therefore, the index indicator (#) must be used when entering the address.  The instruction will overwrite any data that is already stored in the Destination without issuing a warning.  Floating Point (F8) and String (ST) values are supported for those processor types that are capable of these data types. FLL Instruction Parameters (2 of 3)
  • 34. 34  Length  Must be a program constant that specifies the number of elements or words to be filled.  If the Destination file type is 1-word elements the length range is 1 to 128 inclusive.  If the Destination file type is a 3-word element such as Timers or Counters, the length range is 1 to 42 inclusive.  The length value is written to S:24 when the instruction executes. FLL Instruction Parameters
  • 35. 35  The FLL instruction has no instruction address or status bits. If status is required, status must be supplied by the user. FLL Status Bits
  • 36. 36  This instruction will not fill across file boundaries. The value referenced in the Length parameter determines the number of words to be filled. Insure that the value referenced in the Length parameter will not make the filled data exceed the file boundary.  If an attempt is made to cross file boundaries is made, and error will occur and the processor will fault. FLL Crossing File Boundaries
  • 37. FLL Single Word Destination The file, whose starting word is referenced in the Destination will be filled for the number of words referenced in the Length, with the data stored in the Source.
  • 38. 38  Filling a file whose destination address is a 3-word structure such as timers and counters should be done with extreme care. Unpredictable operation can occur because the status bits will be affected and the lower byte of word 0 (being used by AB for some purpose) will be affected.  The example shown on the next slide is being used as an FYI only to show functionality of the FLL instruction. It will fill six counter words starting at C5:4 with the constant 5319 as follows:  C5:4.0 (the status bit word) = 5319  C5:4.PRE = 5319  C5:4.ACC = 5319 FLL Structure Destination
  • 40. 40  Allen Bradley makes a module that accepts 4-thermocouples (T/C), (1746-NT4). Assume this module is placed in slot-6.  The NT4 module has 4-input channels and 4-output channels. The input channels is the T/C data and the output channels are the module configuration channels. FLL Application
  • 41. 41  The module must be configured before use. The configuration word configures:  The T/C type  Data in engineering units  Open circuit response  Temperature units (C or F)  Filter frequency  Channels enabled FLL Application (SLC500)