FM-AA-CIA-15 Rev.
01 07-April-2021
Study Guide in (Course Code and Course Title) Module No.__
STUDY GUIDE FOR MODULE NO. ___
DATA TRANSFER/CHAPTER
MODULE OVERVIEW
Data transfer in PLC programming involves moving information between different components within a
control system, including the PLC itself, input/output devices, and other PLCs or systems. This transfer is
crucial for the PLC to gather data from sensors, process it according to the programmed logic, and then send
control commands to actuators or other devices. Different methods are used for data transfer, including serial
communication (RS-232, RS-485), Ethernet, and proprietary protocols specific to the PLC manufacturer. The
choice of method depends on factors like distance, speed, and the specific requirements of the application.
PLC programming languages often provide instructions for handling these data transfer operations, allowing
programmers to define the data type, source, destination, and communication parameters for each transfer.
Efficient and reliable data transfer is essential for the smooth operation of any PLC-based control system.
The basic ideas behind simplifying PLC data transfer—a vital component of dependable and effective
automation systems—will be covered in this subject. We will explore the significance of using data structures
like arrays and tables effectively, designing modular code, and adhering to unambiguous naming rules. You’ll
discover how to decompose difficult jobs into more digestible, smaller modules, which will increase code
readability and lower error rates. Additionally, we’ll go over the many data transfer techniques accessible in
PLC programming and how to select the best technique for each task by taking efficiency and speed into
account. You will have the information and abilities necessary to write PLC programs that are not only
functional but also simple to comprehend, maintain, and debug at the end of this session. You’re going to
capable of putting these ideas to use in your own projects to make sure that your PLC programs are scalable,
dependable, and effective—all of which will help your automation efforts succeed.
MODULE LEARNING OUTCOMES
1. Explain the simplifier PLC data transfer
2. Observe and apply occupational health and safety standards.
LEARNING CONTENT (title of the subsection)
Simplifying PLC Data Transfer: A Guide to Efficient and Maintainable Code
In the world of PLC programming, data transfer is a fundamental process that involves moving
information between different parts of your program, as well as between the PLC and external devices. While
this process is essential, it can become complex and challenging if not approached strategically. This module
will guide you through the principles of simplifying PLC data transfer, leading to code that is easier to
understand, maintain, and debug.
One of the most crucial aspects of simplifying data transfer is using clear and consistent naming
conventions for data addresses. Imagine trying to decipher a program with variables named “X100,” “Y25,”
and “M500.” It’s a recipe for confusion! Instead, use descriptive names that clearly indicate the purpose of
each data address, such as “ConveyorSpeed,” “MotorStatus,” or “SensorValue.” This simple practice will
make your code significantly more readable and maintainable.
Another key principle is modular code design. Instead of writing one monolithic program, break down
complex tasks into smaller, reusable modules. For example, you could create a separate module for
controlling a conveyor belt, another for reading sensor data, and yet another for managing alarms. This
approach makes your code more organized, reduces the risk of errors, and allows you to easily reuse
modules in other projects.
PANGASINAN STATE UNIVERSITY 1
FM-AA-CIA-15 Rev. 01 07-April-2021
Study Guide in (Course Code and Course Title) Module No.__
Data structures like arrays and tables can be incredibly helpful in managing large amounts of data. Instead of
assigning individual addresses to each piece of data, use arrays to store a collection of related values, or
tables to represent a structured set of data. This not only simplifies data management but also improves code
readability and efficiency.
Finally, remember to document your code thoroughly. This includes not only explaining the purpose of each
module and data structure but also providing clear descriptions of data transfer routines and the logic behind
them. Well-documented code is easier to understand, maintain, and debug, making it a valuable asset for any
PLC programmer. By applying these principles, you can create PLC applications that are not only functional
but also easy to work with, contributing to more reliable and efficient automation systems.
Key aspects of data transfer in PLC programming:
Internal Data Transfer: This involves moving data between different memory locations within the
PLC, such as registers, arrays, and internal data tables. This is often done using instructions like
"MOV" (Move), "ADD" (Add), "SUB" (Subtract), and others.
Communication with I/O Modules: PLCs use input/output (I/O) modules to connect to external
devices like sensors, actuators, and other PLCs. Data is transferred between the PLC and I/O
modules using specific instructions.
Communication with Other Devices: PLCs can communicate with other devices, including
computers, HMIs, and other PLCs, using various communication protocols like serial communication
(RS-232, RS-485, Modbus), Ethernet communication (TCP/IP), and fieldbus communication
(Profibus, CANopen, DeviceNet).
Data Transfer Instructions: PLCs use specialized instructions to manage data transfer, including
instructions for moving, copying, reading, and writing data. One example is the "MVM" (Masked
Move) instruction, which allows for selective data transfer based on a mask.
Understanding data transfer is crucial for effective PLC programming. It allows you to:
Control industrial processes: By reading sensor data, processing it, and sending commands to
actuators, PLCs can automate complex industrial processes.
Monitor system performance: Data transfer allows you to collect data from sensors and other
devices to monitor the performance of the system.
Communicate with other systems: PLCs can communicate with other systems, such as SCADA
systems, to provide real-time data and control information.
Types of Data Transfer:
1. Internal Data Transfer:
Direct Memory Transfer: This involves moving data directly between memory locations within the PLC. This is
typically done using instructions like "MOV" (Move), "COPY," or "XCHG" (Exchange).
Indirect Memory Transfer: This involves transferring data using pointers or addresses. This allows for more
flexible data manipulation, as you can access and modify data in different memory locations without directly
specifying the location.
Data Table Transfer: PLCs often have dedicated data tables for storing and managing specific types of data.
Transferring data within these tables typically involves using specialized instructions designed for the specific
table type.
2. Communication with I/O Modules:
Input Data Transfer: This involves reading data from input modules connected to sensors and other input
devices. The PLC reads data from these modules to gather information about the state of the process or
system.
PANGASINAN STATE UNIVERSITY 2
FM-AA-CIA-15 Rev. 01 07-April-2021
Study Guide in (Course Code and Course Title) Module No.__
Output Data Transfer: This involves writing data to output modules connected to actuators and other output
devices. The PLC sends commands to these modules to control the process or system.
3. Communication with Other Devices:
Serial Communication: This involves transferring data using serial protocols like RS-232, RS-485, or Modbus.
Serial communication is often used for point-to-point communication between devices or for communication
over short distances.
Ethernet Communication: This involves transferring data using Ethernet protocols like TCP/IP. Ethernet
communication is used for communication over longer distances and for connecting multiple devices on a
network.
Fieldbus Communication: This involves transferring data using dedicated fieldbus protocols like Profibus,
CANopen, or DeviceNet. Fieldbus communication is designed for specific industrial applications and provides
high-speed, reliable communication within a network.
4. Data Transfer Based on Direction:
Unidirectional Data Transfer: This involves data moving in only one direction. For example, an input module
reads data from a sensor and sends it to the PLC, but the PLC does not send any data back to the sensor.
Bidirectional Data Transfer: This involves data moving in both directions. For example, the PLC sends a
command to an actuator through an output module, and the actuator sends feedback data back to the PLC.
5. Data Transfer Based on Timing:
Synchronous Data Transfer: This involves data transfer occurring at specific times or intervals. Synchronous
data transfer is often used in real-time applications where precise timing is critical.
Asynchronous Data Transfer: This involves data transfer occurring at irregular intervals or based on specific
events. Asynchronous data transfer is often used in applications where timing is not critical or where data
transfer is triggered by events.
LEARNING CONTENT (title of the subsection)
A Programmable Logic Controller (PLC) in a box with two slots reads and stores the number on a piece of
paper that Alice and Bob share. Serving as a middleman, the PLC reads, stores, and transmits the data to
Bob. Bob receives the data after which he can remove the paper from his slot. PLCs may communicate a
variety of data types directly between devices, over networks, or over the internet, including text, numbers,
and instructions.
Simplifying Data Transfer:
- Use clear and consistent naming conventions for addresses and data types. This makes your code easier to
understand and maintain.
- Break down complex tasks into smaller, manageable steps. This makes your code more modular and easier
to troubleshoot.
- Use data tables to organize and manage large amounts of data. This improves efficiency and readability.
- Choose the appropriate data transfer method for each task. Direct transfer is faster for simple tasks, while
indirect transfer is better for complex operations.
PANGASINAN STATE UNIVERSITY 3
FM-AA-CIA-15 Rev. 01 07-April-2021
Study Guide in (Course Code and Course Title) Module No.__
By understanding these basic principles, you can effectively manage data transfer in your PLC applications,
making your code more efficient, reliable, and easier to maintain.
LEARNING ACTIVITY 1
Instructions:
Read through the provided information on PLC data transfer methods (internal memory
transfer, I/O communication, serial/Ethernet communication, etc.). Based on this review,
write down the key differences between direct and indirect memory transfers in a PLC.
Consider the following:
What are the advantages of using direct memory transfer?
When would indirect memory transfer be a better choice in a PLC program?
Deliverable: Write a short explanation (3-5 sentences) for each of these transfer methods.
SUMMARY
Data transfer in PLC programming involves the movement of information between various components of a
control system, such as the PLC, I/O devices, and other PLCs or systems. This process is vital for the PLC to
collect data from sensors, process it, and then send commands to actuators. Data transfer methods vary,
including serial communication (RS-232, RS-485), Ethernet, and proprietary protocols. The method chosen
depends on factors like distance, speed, and application requirements. PLC programming languages provide
instructions to handle these transfers, specifying data types, source, destination, and communication
parameters.
To simplify and improve data transfer in PLC programming, it's crucial to use clear naming conventions,
modular code design, and efficient data structures. This makes code easier to read, maintain, and debug.
Dividing complex tasks into smaller modules, using arrays and tables for data management, and documenting
code thoroughly are key practices. This approach reduces errors, improves scalability, and ensures more
efficient and reliable systems.
Simplifying PLC data transfer is crucial for creating efficient, maintainable, and reliable automation systems.
By adopting clear naming conventions, you ensure that your code is easy to understand and debug. Breaking
down complex tasks into smaller, reusable modules improves code organization and reduces errors. Utilizing
data structures like arrays and tables allows you to manage large amounts of data efficiently and effectively.
Choosing the appropriate data transfer method for each task, considering factors like speed and efficiency,
further enhances your code's performance.
Remember that thorough documentation is key to making your code accessible to others and ensuring its
long-term maintainability. By consistently applying these principles, you’ll create PLC applications that are not
only functional but also easy to work with, contributing to the success of your automation projects. Simplifying
data transfer is not just about writing cleaner code; it’s about building a foundation for robust and scalable
automation systems that can meet the demands of modern industrial environments.
REFERENCES
https://www.automationworld.com/products/control/article/13299270/simplify-plc-data-transfers?
f_link_type=f_inlinenote&need_sec_link=1&sec_link_scene=im®ion=US&flow_sdk_version=5050040&use-
olympus-account=1
https://www.plctechnician.com/node/24
https://www.displayvisions.us/eng/pdf/funktion/PLC_Commands/ProtocolDatatransfer.html
PANGASINAN STATE UNIVERSITY 4
FM-AA-CIA-15 Rev. 01 07-April-2021
Study Guide in (Course Code and Course Title) Module No.__
PANGASINAN STATE UNIVERSITY 5