Back to tutorials
HMI Development

HMI / PLC Fundamentals - Syncing & Sending PLC Time to HMI Terminal

By
Vladimir Romanov
Table of Contents

Introduction

Time synchronization is an important step for displaying the right information to the machine operators, SCADA based data logging and for general accessibility. Creating this link between an HMI and PLC system is not as straightforward as one might think. That being said, time synchronization becomes quite simple after you’ve done it once.

We will be exploring this process between a CompactLogix L24ER processor programmed in v30 Studio 5000 and an HMI running v5.10 FactoryTalk View ME application. Through this process, we will also create a UDT for our structure and send it over as a regular tag in order to use it independently from the time logged by the HMI terminal.

UDT Time Structure in Studio RSLogix 5000

The UDT structure will support all of the registers which will store the current time on the Programmable Logic Controller (PLC). This structure can be used inside the Studio 5000 program as well as through the HMI application. It’s also labeled intuitively, so the registers are self-explanatory.

Note: it’s important to place the registers in this exact order as the copy instruction will populate the UDT in this same order. If this order isn’t followed, the data will not match the info placed inside.

Here’s a snapshot of the finalized UDT:

UDT Time Synchronization PLC HMI Studio 5000 FactoryTalk View ME

In the UDT above, we have 7 distinct members all of the type DINT:

  • Year
  • Month
  • Day
  • Hour
  • Minute
  • Second
  • Microsecond

GSV – Get System Value Instruction

The Get system Value, or the GSV, instruction is used to retrieve the data from our PLC registers. This instruction is similar to what a MOV instruction accomplishes but will be primarily applied to hardware-based registers which you can’t get otherwise.

To retrieve the current time settings from the PLC, we need to specify a class name of “WallClockTime” as well as a destination register which is based upon the UDT we created before. In this program, this register is labeled as “PLCTime”. Furthermore, a starting register must be specified to load our data. In this case, it’s the “.Year” designation. All of the registers will be loaded.

GSV Get System Value Instruction

Setting HMI Time through Global Connections

Now that we have our structure and the controller is in Run Mode, we can create the link from the HMI. This process requires us to add the PLC to the Communications tree of the HMI. This process is covered in one of the earlier tutorials: HMI to PLC Tag Based Link Tutorial.

Once the link is created, we need to open the “Global Connections” menu and add the appropriate tags from the PLC UDT structure to the HMI cells. Here’s what the outcome looks like:

FactoryTalk View ME Time Tags

Displaying PLC Based Time directly on HMI Screens

Although the method above will synchronize the time on the HMI terminal, it’s preferable to skip this procedure altogether and format the time based on what it’s set to on the PLC. This practice allows the engineer to keep the time in one place and display it exactly as it is on the main system. Furthermore, in most cases, you will be relying on the PLC time for your SCADA system thus making it the most important asset.

This is accomplished simply by creating a numeric display tag sequence which retrieves the same tags we’ve defined above. Although the sequence of numeric displays requires some tweaking, it allows one to use it all over the place once it’s properly implemented. Here’s a quick design of the said system. Each numeric display is properly formatted and links back to the PLC tags we’ve described above.

FactoryTalk View Time Display Design

Conclusion

Synchronizing the time between the PLC and the HMI can be tricky, but is very important for anyone working with control systems. The steps outlined above will synchronize the time between a PLC system running RSLogix or Studio 5000 and an HMI which is designed through FactoryTalk View Studio ME.

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