Back to tutorials
PLC Instructions

PLC Input Output Mapping / Buffering | IO Addressing Basics in RSLogix Studio 5000 Allen Bradley

By
Vladimir Romanov
Table of Contents

Introduction

One of the first tasks of PLC Programming is to properly map Inputs & Outputs. Although this task is fairly straightforward, many programmers either avoid it or implement it incorrectly due to their misunderstanding of it. IO Mapping or Buffering can help you in multiple ways. It allows one to contain all the primary input & output tags within a single program & easily manipulate them as needed. The necessity to manipulate may come from hardware failure or need to upgrade or expand the system. Furthermore, having these assets within a single program greatly reduces the time to troubleshoot and commission new systems.

In this article, we will be giving you an in-depth overview of IO buffering, discussing why it’s important & what you can accomplish through this practice. Lastly, we will give you real-world scenarios in which this practice is important.

IO Buffering / Mapping Routine

The simplest way to map inputs & outputs is to create a routine which will contain the tags linked to the modules & set them through OTE Instructions. In other words, each input module which specifies input tags will need to be mapped to internal PLC tags. For example, in Studio 5000, you’ll need to map as follows:

  • Local:1:I.Data.0 -> LocalInput[0]
  • Local:1:I.Data.1 -> LocalInput[1]
  • Local:1:I.Data.2 -> LocalInput[2]
  • Local:1:I.Data.3 -> LocalInput[3]
  • … -> …

Each input will receive a corresponding tag on the PLC side. Similarly, each output tag which comes from the PLC will need to be mapped to the corresponding output. In Studio 5000, this is done as follows:

  • LocalOutput[0] -> Local:1:O.Data.0
  • LocalOutput[1] -> Local:1:O.Data.1
  • LocalOutput[2] -> Local:1:O.Data.2
  • LocalOutput[3] -> Local:1:O.Data.3
  • … -> …

The above practice is called IO mapping or buffering. Although this practice doesn’t seem like a big deal, we will explore the reasons for doing so below.

PLC Input Output Mapping / Buffering | IO Addressing Basics in RSLogix Studio 5000 Allen Bradley Rockwell

Inputs & Outputs Managed from a Single Program

By following the implementation outlined above, you will have access to all the inputs and outputs from within the same program. This allows you to scroll through, see their status and identify issues in the system. Furthermore, this allows you to easily commission your system as you will need to verify each input and output once it’s deployed and installed in the field.

The alternative method would be to access the same input and output bits from all over your PLC program. This may seem easier from a programming standpoint as you’ll have fewer rungs, but it quickly becomes very confusing. Even within your own programs, you’ll often go through the exercise of figuring out where each point of IO has been used, how it’s mapped and how it will be updated. Definitely an undesirable practice.

Manipulating Inputs & Outputs at The Source

One of the most common pieces of logic I like to apply to my inputs and outputs is called debouncing. This logic allows me to monitor the status of the input or output bit in order to set an internal bit after it has been on or off for a certain period of time. Allow me to elaborate.

Consider a photo eye which is looking to count boxes & is tied to an input. As the box travels into the area, the photo-eye may be triggered a few times due to the edge of the box and miscount. In other words, instead of counting one box, the photo-eye is set high, low and then high again by the surface. This occurs frequently in a real-world scenario. To counter this phenomenon, a debounce routine is introduced. Essentially, it’s just a TON Instruction which monitors the input and will set an internal bit to HIGH once the input has been set for a defined time.

Here’s an example of such logic which leverages a FOR Loop & applies debouncing to all the inputs.

PLC Input Output Mapping / Buffering | IO Addressing Basics in RSLogix Studio 5000 Allen Bradley Rockwell Programming

Based on the logic above, it’s extremely simple to apply to all the inputs as well as outputs from the same routine. The alternative would be to copy & paste this rung all over the PLC program & make it extremely confusing for other programmers to troubleshoot.

Troubleshooting & Addressing Hardware Failures

Input and Output points will fail for a number of reasons. I’ve seen internal fuses, resistors, capacitors & other components fail. Although it’s possible to swap out the entire card, a much more cost-effective solution is to temporarily re-assign the input or output to a spare one.

For example, a machine which utilizes a 16 input card & is tied to 10 sensors experiences a short circuit on one of the points due to an operator bumping into the sensor. The input which was mapped through the routine above was determined to be Local Input 7. You’ve determined that since the machine is only utilizing 10 inputs, a point on 10 to 16 are available as spares. Therefore, you can move the wire from input 7 into input 10. By changing a single rung of logic within the mapping routine, you can re-assign the new input.

The alternative to the above would be to figure out every single instance of where the input is used and change the tags one by one; extremely tedious practice.

Conclusion

IO Mapping & Buffering is a simple practice to implement. It allows a PLC programmer to set up a routine which contains all the inputs & outputs for a given system. This translates to the easier commission of the system, faster troubleshooting & easier fixes if the problem is determined to be one of the points of IO. Another advantage is the ability to apply generic logic to all the input and output points; an excellent example is debouncing.

Make sure that you take the time to map your Input and Output points as well as give your tags proper descriptions & names in your PLC programs.

Video Tutorial

Back to tutorials

Related Tutorials

Advanced

PowerFlex 525 Parameter, Input and Output Programming Tutorial in RSLogix Studio 5000

The PowerFlex 525 series of Variable Frequency Drives from Allen Bradley is highly utilized and respected within the automation field. The drives are compact, versatile and easy to use. We’ve written an extensive tutorial on how to get started with these drives in a previous tutorial; it covers how to initialize the drive, connect it to an EtherNet/IP based PLC and how to set the right parameters. In this tutorial, we’re looking to expand on the concepts and demonstrate a way to access and utilize the multiple Input and Output options available on the drive. The reason you may want to utilize the IO is to save money on purchasing external components, integrate instrumentation into your drive and save floor space, wiring and cost. We’ve seen the need to integrate closely related sensors into a PowerFlex 525 application; this would be the right way to do it.

By
Vladimir Romanov
Advanced

Publishing MQTT Data Using Opto 22 groov EPIC PAC

MQTT is a communication protocol that has taken off in the IIoT community. It’s a light-weight, efficient protocol that works through a publisher / broker / subscriber model. It creates an easy way for field devices to communicate and retrieve data from a single location. In this article, we’ll go over MQTT and dive into an example of how you can publish data using a groov EPIC PAC and retrieve the data using a MQTT client.

By
Vladimir Romanov
Intermediate

HMI Design - Best Practices for Effective HMI Screens

HMI Design is the practice of building HMI screens that are intuitive to the end user, pleasing to the eye and are efficient to operate. As control systems within manufacturing are migrated from traditional push button designs to primarily operated from HMI displays, HMI Design has become trivial to any new installation.Although there is a wide range of HMI based systems, the basic principles of good design remain the same. Different industries may dictate different patterns of layout for their systems, but the good practices remain.

By
Vladimir Romanov