Guide Vijeo Designer V5.1.0 Guide: HMISTO and HMISTU Real-Time Clock Synchronization Table of Contents 1.1 Description .......................................................................................................................................... 2 1.2 Goal ...................................................................................................................................................... 2 1.3 Setup in Vijeo Designer ..................................................................................................................... 2 1.4 Setup of Time and Date Addresses in PLC ...................................................................................... 7 1.4.1 Explanation of Set Terminal Clock Dialog Table Function ............................................................... 7 1.4.2 General Description of Mapping Addresses for Unity Pro and Twido Suite .................................... 8 1.4.3 Steps to Copy Real-Time Clock Values to Modbus Addresses in Unity Pro ................................... 9 1.4.4 Steps to Copy Real-Time Clock Values to Modbus Addresses in Twido Suite ............................. 12 Table of Figures Figure 1.3.1 - Target Property Inspector; Time Synchronization dropdown menu ........................................... 2 Figure 1.3.2 - Time Adjustment dropdown menu .............................................................................................. 3 Figure 1.3.3 - IO Manager example .................................................................................................................. 3 Figure 1.3.4 - Equipment Configuration - Double Word word order .................................................................. 4 Figure 1.3.5 - Dialog Table ellipsis button ......................................................................................................... 4 Figure 1.3.6 - Dialog Table Settings dialog ....................................................................................................... 5 Figure 1.3.7 - Dialog Table Functions dialog ..................................................................................................... 6 Figure 1.3.8 - Address field in Dialog Table Settings ........................................................................................ 7 Figure 1.4.1 - Set Terminal Clock Dialog Table Address Map .......................................................................... 8 Figure 1.4.2 - Unity Pro Real-time clock function for M340, Premium Atrium, and Quantum PLCs (from Unity Pro help documentation) ............................................................................................................................ 9 Figure 1.4.3 - TWIDO Real-Time Clock System Words (from TWIDO Suite help documentation) .................. 9 Figure 1.4.4 - Project Browser -> Elementary Variables node ........................................................................ 10 Figure 1.4.5 - Data Editor Array of INT ............................................................................................................ 10 Figure 1.4.6 - Program Sections - New Section .............................................................................................. 11 Figure 1.4.7 - New Section Dialog ................................................................................................................... 11 Figure 1.4.8 – Edit Program Screen ................................................................................................................ 13 Figure 1.4.9 - Add a New Section of Ladder Logic.......................................................................................... 13 Figure 1.4.10 - Add a Rung ............................................................................................................................. 14 Figure 1.4.11 - Create 5 total Rungs ............................................................................................................... 15 Figure 1.4.12 - Add SHORT and Operation Block .......................................................................................... 15 Figure 1.4.13 - Finish Adding SHORT and Operation Blocks to Each Rung .................................................. 16 Figure 1.4.14 - Complete Ladder Logic ........................................................................................................... 17 Page 1 / 17 Guide 1.1 Description STO and STU HMI target types do not have built-in real-time clocks. In order to use features that require time, STO and STU target types must be connected to and synchronized with equipment that have Real-Time clocks. An example of a feature that requires time to operate is Alarms & Events. Time synchronization uses the Dialog Table function called “Set terminal clock” to get the time and date data from the PLC. 1.2 Goal This guide will provide a description of how to set up Time Synchronization for HMISTO and HMISTU targets in the Vijeo Designer Editor software. It will also provide details on how to set up address mapping for the Real-Time clock system addresses in Unity Pro v4.1 and Twido Suite. 1.3 Setup in Vijeo Designer In the Vijeo Designer Editor, follow the steps below: Step 1: Create a project with an HMISTO or HMISTU type target. Step 2: Click on the Target node in the Navigator and in the Property Inspector, expand the property group called “Startup Options” Figure 1.3.1 - Target Property Inspector; Time Synchronization dropdown menu Step 3: In the dropdown box next to “Time Synchronization”, select “User PLC Dialog Table”. This will enable Time Synchronization via the Dialog Table feature. Step 4: Page 2 / 17 Guide Disable “Time Adjustment” for Daylight Savings Time (DST), as the PLC will control the time in our case. Figure 1.3.2 - Time Adjustment dropdown menu Step 5: Add a driver that supports the Dialog Table feature. For example, Modbus RTU: Figure 1.3.3 - IO Manager example Page 3 / 17 Guide Important: Ensure that the Double Word word order matches that as defined by the PLC. Figure 1.3.4 - Equipment Configuration - Double Word word order Step 6: When you have the Equipment Node of the driver selected, in the Property Inspector, press the ellipsis button […] next to Dialog Table. This will bring up the Dialog Table Settings dialog box. Figure 1.3.5 - Dialog Table ellipsis button Step 7: Check the “Enable Dialog Table” checkbox and enter an Address that you will be using as your starting address of the dialog table in the “Start Address” field. Notice that %MW9001 is used. This will be explained below in Section 1.4 “Setup of Time and Date Addresses in PLC” Page 4 / 17 Guide Figure 1.3.6 - Dialog Table Settings dialog Step 8: Click on the “Add…” button. This will bring up the “Dialog Table Functions” dialog. In this dialog, put a check next to “Function 33: Set terminal clock”. Page 5 / 17 Guide Figure 1.3.7 - Dialog Table Functions dialog Step 9: Press OK in the “Dialog Table Functions” dialog. IMPORTANT: Please note the Address used for the Set Terminal Clock function. If you use other Dialog Table Functions, the address offset for the Set Terminal Clock function will change and will be based on the number of Dialog Table Functions you enable. Check the Address field updated in the Dialog Table Settings dialog shown in the picture below. Page 6 / 17 Guide Figure 1.3.8 - Address field in Dialog Table Settings Set the Termianl (HMI) setting to “BCD”. Press OK again in the “Dialog Table Settings” dialog and you have now completed setting up Time Synchronization in Vijeo Designer. 1.4 Setup of Time and Date Addresses in PLC This section will cover setup of the time and date addresses in the PLC. How to map the addresses in Unity Pro (v4.1) is covered in the step-by-step guide in Section 1.4.2. 1.4.1 Explanation of Set Terminal Clock Dialog Table Function Page 7 / 17 Guide This function is a block of four 16-bit words that stores the target machine time and date. Note that the upper and lower 8-bits of the words store a different value. Figure 1.4.1 shows the structure: Figure 1.4.1 - Set Terminal Clock Dialog Table Address Map * the HMI ignores the values in the Day of the Week and derives this value from calculating of the date information. 1.4.2 General Description of Mapping Addresses for Unity Pro and Twido Suite In Step 7 in the above Section 1.3, the address %MW9001 is used as the start address for the Dialog Table Set Terminal Clock feature. In the PLC, it is required to write the information to the four Words shown in Figure 7 above. Following our example: Modbus Address %MW9001 %MW9002 %MW9003 %MW9004 Bits 0-7 8-15 0-7 8-15 0-7 8-15 0-7 8-15 Data Day of the Week Seconds Minutes Hour Day of the month Month Year (last two digits) Year (first two digits) This data should be updated every second so as to be shared with the HMI. Unity Pro In Unity Pro (v4.1 is used in the sample screenshots), the above information for the Real-time clock function for Modicon M340, Premium Atrium, and Quantum PLCs are stored in the system words %SW49 to %SW53 as BCD: Page 8 / 17 Guide Figure 1.4.2 - Unity Pro Real-time clock function for M340, Premium Atrium, and Quantum PLCs (from Unity Pro help documentation) TWIDO Twido Controllers (Twido Suite v1.20 is used in the sample screenshots) use the same system words for their Real-Time Clock feature as Unity Pro: Figure 1.4.3 - TWIDO Real-Time Clock System Words (from TWIDO Suite help documentation) However, there is one difference. In Unity Pro, the Seconds are stored in the upper part of the 16bit %SW50 word (16#SS00). In Twido, it is stored in the lower part of the 16-bit %SW50 word (16#00SS). We must take this into account when we configure our Twido PLC memory addresses. Please see Section 1.4.4 for the steps. 1.4.3 Steps to Copy Real-Time Clock Values to Modbus Addresses in Unity Pro Following on the example above for Vijeo Designer, this section will go through the steps to copy the values from the Real-time clock function system words to the required address by Vijeo Designer. Step 1: Page 9 / 17 Guide In your Unity Pro PLC project, double-click on the “Elementary Variables” node in the Project Browser to open the Data Editor. Figure 1.4.4 - Project Browser -> Elementary Variables node Step 2: In the Data Editor, Create an ARRAY variable of type INT with 3 elements and assign the address %MW9001 to the start of the array (this is to match the configuration of the Dialog Table function for “Set terminal clock”): Figure 1.4.5 - Data Editor Array of INT Step 3: In the Project Browser, go to Program->Tasks->MAST and Right-click on Sections, and create a New Section (in our example, it is called “RTC_Update”) with Language type Structured Text (ST): Page 10 / 17 Guide Figure 1.4.6 - Program Sections - New Section Figure 1.4.7 - New Section Dialog Step 4: Double-click the newly created Section in the Programs RTC_Update and input the following instructions: DialogTable_DATE_TIME_INTARRAY[0] := %SW49 + %SW50; DialogTable_DATE_TIME_INTARRAY[1] := %SW51; DialogTable_DATE_TIME_INTARRAY[2] := %SW52; DialogTable_DATE_TIME_INTARRAY[3] := %SW53; Step 5: Page 11 / 17 Guide Close all dialogs. Compile, Build and download the PLC project and transfer to the PLC. This concludes the setup required for Run-time clock synchronization for Unity Pro. 1.4.4 Steps to Copy Real-Time Clock Values to Modbus Addresses in Twido Suite Since TWIDO Suite uses the same %SW addresses for the Run-Time Clock feature, the same principles apply. Step 1: Go to Program -> Configure -> Configure the data. Create Symbols for the Dialog Table in the %MW Simple objects: Since the Seconds is in the lower part of the word in Twido, a fifth Symbol (16-bit word )is required to combine the Day of the Week and Seconds into one register. In the figure above, the Symbol is “DIALOGTABLE_CALC” at %MW2005. Page 12 / 17 Guide Note: %MW9001 is larger than memory addresses supported in the Twido PLC used in my example, so %MW2001 is used. In Vijeo-Designer’s Dialog Table function (Section 1.3 - Step 7), enter %MW2001 instead of %MW9001. Step 2: In your Twido Suite application, go to Program -> Program ->Edit Program. Figure 1.4.8 – Edit Program Screen Step 2: Add a new section by pressing the “add a section” button in the ladder logic editing toolbar: Figure 1.4.9 - Add a New Section of Ladder Logic Page 13 / 17 Guide Step 3: You should now see a rung of ladder logic appear as in the following Figure. Click on the vertical line at the right of the rung so that it is highlighted in green. In the menu, click the “insert a link” button and move your mouse over the long horizontal line so that it is highlighted and click the mouse. Perform this 4 times in total. Figure 1.4.10 - Add a Rung Page 14 / 17 Guide Figure 1.4.11 – Insert 4 links Step 4: At the start of the rung, add a SHORT. Also, on each link, add an Operation Block by selecting each link and clicking the buttons shown in the figure below: Figure 1.4.12 - Add SHORT and Operation Block Page 15 / 17 Guide Figure 1.4.13 - Finish Adding SHORT and Operation Blocks to Each Rung Step 5: In the operation blocks, type these instructions: Link 0: DIALOGTABLE_CALC := SHL(%SW50,8) Link 1: DIALOGTABLE_RTC1 := %SW49 OR DIALOGTABLE_CALC Link 2: DIALOGTABLE_RTC2 := %SW51 Link 3: DIALOGTABLE_RTC3 := %SW52 Link 4: DIALOGTABLE_RTC4 := %SW53 Explaination: Link 0: The operation shifts the “seconds” data from the lower part of the word to the upper part Link 1: The operation combines the “seconds” and “day of the week” and copies to one word. Link 2-4: The operation copies the whole system words When you finish, the ladder logic screen should appear as in the figure below: Page 16 / 17 Guide Figure 1.4.14 - Complete Ladder Logic Step 6: Download to your controller. Page 17 / 17