Purpose
This document provides the instructions necessary to automatically synchronize
the NB HMIs real time clock (date and time) to the CP1L-E system clock
Problem Explanation/Objective
The PLC system clock is available for ladder logic to programmatically read. The challenge is to mine and re-format the PLC clock data, and make it available to the NB HMI. Once available to the NB, the NB application, with a timed macro trigger, will update the HMI real time clock
Supported devices
NB HMI with EtherNet
NB Designer 1.63
CP1L-E
CX-Programmer
Requirements
Prerequisites include basic knowledge of how to program an NB HMI, as well as basic understanding of how to program CP1L-E controller
Procedure
Step 1 Create the CP1L-E Variables
In CX-Programmer, create the following variables in the Global Symbols Table
Individually, double click the symbols “Seconds”, “Minutes”, “Hours”, “Day”, “Month”, and “Year”, and check the Link to CX-Server file
Step 2 Create the CP1L-E code
Step 3 Create a Macro in the NB to set the Real Time Clock
Create a Macro from the Options / Macro menus in NB Designer
Choose HMI0 as the PT, and macro_0.c will automatically be created. Click OK.
In the Project File Window, expand the tree and double click on 0:macro_0.c to open the macro
Create the following Macro Variables by right clicking in the Macro Variable Table, and selecting
Add Variable
Create the following code in the macro. This code assigns each of the parts of the Real Time
Clock from the NX / NJ CPU to the corresponding parts of the Real Time Clock in the NB
Step 4 Create a timer to call the macro
Open the Common Window (screen 1) and place a Timer object from the Function Parts list on
the screen. The Common Window is a screen that is always open in the background of the NB
project, regardless of which screen is being displayed.
Set the Timer properties as shown. This will trigger the macro every minute to update the HMI
Real Time Clock.
Step 5. Download the project to the NB and test the functionality
Date/Revision History
Jan 20, 2025 - Submitted for review
Author:
Ed Gallagher, Technical Support Specialist
References
V106 - NB Designer Operation Manual
V107 - NB Setup Manual
V109 - NB Startup Guide
V122 - NB User’s Manual
W516 - CP1L-EL/EM CPU Unit Operation Manual
W451 - CP1H/CP1L CPU Unit Programming Manual
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article