104 Student Guide 16. Using Dynamic Data Exchange (DDE) Chapter 16 Using Dynamic Data Exchange (DDE) Copyright 1994-2003, GE Fanuc International, Inc. 16-1
FIX Fundamentals 16. Using Dynamic Data Exchange (DDE) Section Objectives This section focuses on using Dynamic Data Exchange (DDE). There are three primary topics that are covered in this chapter: DDE Client DDE Server Report Generation Copyright 1994-2003, GE Fanuc International, Inc. 16-2
104 Student Guide 16. Using Dynamic Data Exchange (DDE) A. Notes: A method of communication between Windows applications Uses shared memory to exchange data This method differs from clipboard method of transferring data - DDE provides an ongoing update - This is opposed to a one-time transfer such as a cut and paste B. DDE Addressing Applications that support DDE use a three part syntax to get data This syntax is referred to as Application Topic Item (ATI) ATI provides a standard means of identifying DDE information The syntax usually is described in the program s documentation Syntax: - =Application Topic! Item - Application - Topic - Item name of the DDE application where the data resides many applications use the name of the program name of group of data to be retrieved very often these are file names individual piece of data to transfer the item name depends on method by which data is stored Example: - =EXCEL [FILE1.XLS]SHEET1!R1C1 - Syntax used in a FIX application, such as a data link in Draw - Retrieves data from row one, column one from the first sheet of an Excel spreadsheet file called FILE1.XLS Copyright 1994-2003, GE Fanuc International, Inc. 16-3
FIX Fundamentals 16.1. DDE Client A. Notes: Client refers to the application that initiates the request for information Allows you to pass DDE information into FIX for use with: - pictures - process database B. DDE Client Support in Pictures Display DDE information using a DDE Address instead of a tagname Can be used in the following features: - data link - dynamic properties - X/Y plot, multi-pen, multi-bar charts - command language See Figure 16-2 for an example Copyright 1994-2003, GE Fanuc International, Inc. 16-4
104 Student Guide 16.1. DDE Client Figure 16-1: DDE Client Figure 16-2: DDE Client Support in a Data Link Copyright 1994-2003, GE Fanuc International, Inc. 16-5
FIX Fundamentals 16.1. DDE Client C. DDE Client Support in the Database DDE I/O driver is used to get DDE data into the database - purchased from GE Fanuc (in the same way as other drivers) Configured like other I/O drivers - through SCADA configuration selection of the SCU Driver name: DDE - DDE Driver rev 6.0 DDE data in the process database can be used for: - Passing data in a chain - Alarming - Trending Example of entries for using DDE Client support (see Figure 16-3) - Device: DDE - I/O Address: =EXCEL [FILE1.XLS]SHEET1!R2C3 Copyright 1994-2003, GE Fanuc International, Inc. 16-6
104 Student Guide 16.1. DDE Client Figure 16-3: DDE Client Support in the PDB Figure 16-4: Edit I/O Address Dialog Box Copyright 1994-2003, GE Fanuc International, Inc. 16-7
FIX Fundamentals 16.2. DDE Server A. Notes: Server refers to the application from which information is requested Request is made by a client application In Figure 16-5, FIX is the DDE server and Excel is the client - a cell in the Excel spreadsheet has the FIX ATI B. FIX DDE Addressing Table 16-1 represents the ATI syntax used to request FIX data This is for the DDE client application C. SCADA Node to SCADA Node Communication DDE provides SCADA node to SCADA node data transfer Example: - SCADA1 needs information that is collected at SCADA2 - The following is entered in the database tag fields of SCADA1 DEVICE: DDE I/O Address: =DMDDE DATA!SCADA2.AA1.F_CV - The tag on SCADA1 will receive the current value of AA1 on SCADA2 Copyright 1994-2003, GE Fanuc International, Inc. 16-8
104 Student Guide 16.2. DDE Server Figure 16-5: DDE Server Real-time Historical Application DMDDE DMDDE Topic DATA HTR Item Node Pen Group Tag Time Group Field Display Node (Y/N) Display Tag (Y/N) Display Date (Y/N) Display Time (Y/N) Number of Samples Example =DMDDE DATA!N.T.F =DMDDE HTR!Grp1.Time1.Y.Y.Y.Y.25 Table 16-1: ATI syntax to request FIX data Copyright 1994-2003, GE Fanuc International, Inc. 16-9
FIX Fundamentals 16.3. Report Generator A. Notes: The report generator is a collection of Microsoft Excel macros The macros are used with the FIX DDE Server option Used for creating and scheduling reports B. DDE Server Intellution software that must be running to use the report generator Refresh time modified with plus and minus key in DDE server window Update times range from 0.2 to 40 seconds. Default is 2 seconds For troubleshooting information type D C. Excel Reports FIX reports database information to Excel using DDE server Maximum of 500 Links per spreadsheet - Real-time and Historical data values Copyright 1994-2003, GE Fanuc International, Inc. 16-10
104 Student Guide 16.3. Report Generator Figure 16-6: Example of Report Using DDE Server Figure 16-7: Link Selection Menu Copyright 1994-2003, GE Fanuc International, Inc. 16-11
FIX Fundamentals 16.3.1. Report Title and Text Links A. Notes: Places text strings in the worksheet Text to be used as titles, column and row headings Up to 255 characters in the field Figure 16-8: Report Title and Text Links Copyright 1994-2003, GE Fanuc International, Inc. 16-12
104 Student Guide 16.3.2. Report and Real-time Value Links A. Notes: Provides database tag information No register tag support Report value links use A_ fields Used with scheduled reports Used with continuous update Figure 16-9: Report and Real-time Value Links Copyright 1994-2003, GE Fanuc International, Inc. 16-13
FIX Fundamentals 16.3.3. Historical Data Value Links A. Notes: Provides historical data file information Uses historical pen group and time group definitions Can not use the following in pen and time group names: - spaces - + - - (hyphen) - & (ampersand) - The default pen or time group To retrieve historical data select <Ctrl><H> #### indicates unavailable value B. Link Fields: Pen Group and Time Group: - previously defined in Historical Display Number of Samples - divides time period into samples - valid entries: 1 to 254 Alignment - determines alignment of display options Copyright 1994-2003, GE Fanuc International, Inc. 16-14
104 Student Guide 16.3.3. Historical Data Value Links Figure 16-10: Historical Value Link Copyright 1994-2003, GE Fanuc International, Inc. 16-15
FIX Fundamentals 16.3.4. Report Generator Scheduler A. Notes: The Start Scheduler command located on the Report menu Opens a worksheet called SCHEDULE.LST Sets up a report to run based on specific date, time or event Definition File must contain report value links to display data in a scheduled report Real-time value links can not be displayed in a scheduled report Excel must be running in the background for the scheduler to work B. Scheduler Fields: Definition File Name - name of file with Report Value Links - this is the template from which reports are made Day - day of week or day of the month - leave blank to generate daily reports Start Time - time to generate report (24 hour format) Repeat Interval - leave blank to generate once or on an event - valid entries: 00:00:00 to 23:59:59 Report Destination - F for file, P for Printer, FP for both Destination File Name - file name for saving the generated report (*.RPT) Event Tagname - digital tagname to trigger generation of report - generated on an open to close transition (0 to 1) Copyright 1994-2003, GE Fanuc International, Inc. 16-16
104 Student Guide 16.3.4. Report Generator Scheduler Figure 16-11: Scheduler Spreadsheet Copyright 1994-2003, GE Fanuc International, Inc. 16-17
FIX Fundamentals 16.4. Excel Write Macro A. Notes: Write 1 to 10 ASCII values from Excel to FIX Assumes R1C1 as the first entry WRITE.XLS must be opened. Fields must be A_* AR/DR tags are not supported Select <Ctrl><O> to write only the first entry. Select <Ctrl><W> to write up to ten entries. B. Accelerator keys provided with the report macros Accelerator Key <Ctrl L> <Ctrl M> <Ctrl G> <Ctrl Z> <Ctrl H> <Ctrl Enter> Does... Create a Link Modify a Link Create an embedded chart Close macros before closing Excel Retrieve Historical Data Start the Scheduler Copyright 1994-2003, GE Fanuc International, Inc. 16-18
104 Student Guide 16.4 Excel Write Macro Figure 16-12: Example using WRITE.XLS Copyright 1994-2003, GE Fanuc International, Inc. 16-19
FIX Fundamentals 16.5. Lab Exercise 16 Report Generator Lab Exercise 16 Copyright 1994-2003, GE Fanuc International, Inc. 16-20
104 Student Guide Lab Exercise 16 Learning Objectives: Upon successful completion of this lab exercise, the student will be able to: Start the DDE (Dynamic Data Exchange) Server. Create a report containing real-time and historical data, in Microsoft Excel using the macros supplied with FIX. Schedule the report to run every 2 minutes. Create a Chart using the Report Value information References: The FIX for Windows One-Line Help The FIX for Windows Electronic Documentation Introduction: This lab exercise demonstrates the steps used to create a report, in Microsoft Excel, containing FIX real-time and historical data. The lab exercise illustrates the use of the Intellution supplied macros for creating links and scheduling reports. Required Materials: Microsoft Excel Note: The lab exercise is based on the following assumptions: FIX is running on your node. Historical Collection is running and collecting data. A Pen Group, RECON2, and a Time Group, 8HOURS, were created during the Historical Trend lab exercise. Copyright 1994-2003, GE Fanuc International, Inc. 16-21
FIX Fundamentals Lab Exercise 16 Lab Information The FIX Report Generator and DDE Server options are used to configure and generate reports using both real-time and historical data. FIX provides pre-defined macros for use in Microsoft's Excel spreadsheet software. The Report Generator option also provides a method of automatically generating reports to a file, printer or both based on time or a database event. You should then create a report using the pre-defined macros to display both real-time and historical data from the tank. The result of your work should look similar to the spreadsheet shown below. Save the report as a spreadsheet called REPORT1.XLS. Once you have created the report, schedule the report to be saved to a new file, REPORT1.RPT, every 2 minutes beginning 2 minutes from now. When the report has run at least once, you may then access the report and use the Excel features to manipulate the data. Create a chart using the real-time database information and modify the configuration to meet your specifications. Copyright 1994-2003, GE Fanuc International, Inc. 16-22
104 Student Guide Lab Exercise 16 A. Starting Excel The DDE Server program must be started and running in the background in order for Excel to receive the data from the FIX. Make sure Excel starts the DDE server by using the following steps: 1. Make sure that the Working Directory for Excel is C:\FIX32. This is the default directory for the FIX. 2. The DDE Server will automatically start when Excel starts by a macro that comes as part of the Report Option. 3. Start Excel. Note: Excel automatically starts the DDE Server and loads the other macros that come with the Report Option B. Creating Title and Text Links Text can be added into the report in one of three ways. You can type the text you want directly into a cell in the spreadsheet or you can use Text and Title links. Add text to the report with links using the following steps: 1. Select cell D1 by clicking once on the cell. The cell appears with a dark border surrounding it. 2. Hit <Ctrl L> or use the Create Links selection from the Report menu. The following dialog box appears: Copyright 1994-2003, GE Fanuc International, Inc. 16-23
FIX Fundamentals Lab Exercise 16 B. Creating Title and Text Links (continued) 3. Select Report Title and click on the OK button. The following dialog box appears: 4. Click on the Text field and enter the following: FIX 7.0 Class Report 5. Click the OK button. The title appears in the spreadsheet starting at cell D1 6. Select cell A5 and hit <Ctrl L>. 7. From the Link Selection Menu, select Text and click on the OK button. The Text Link dialog box appears, as shown below: 8. Click on the Text field and enter the following: Real-time FIX Data 9. Click on the OK button. 10. Select cell E5 and hit <Ctrl L>. 11. Repeat steps 7 through 9, using the following text: Historical FIX Data Copyright 1994-2003, GE Fanuc International, Inc. 16-24
104 Student Guide Lab Exercise 16 C. Creating Value Links You have two choices when you would like to add information from the real-time database into your report: Real-time Value links and Report Value links. Real-time Links should only be used when you need the spreadsheet continually updated. If you are scheduling the report, you should use Report Value links. Report Value links are added to the report using the following steps: 1. Select cell A6 and hit <Ctrl L>. The Link Selection Menu appears. 2. Select Report Value and click on the OK button. The following dialog box appears: 3. Use the default settings and click on the OK button. The following dialog box appears: Copyright 1994-2003, GE Fanuc International, Inc. 16-25
FIX Fundamentals Lab Exercise 16 C. Creating Value Links (continued) 4. Enter SCADA?.RATE.A_CV and click on the OK button. The format for entering a FIX Tagname is: NODE.TAG.FIELD. Enter the SCADA node name, RATE, and A_CV in the appropriate format. The Report Value Links menu appears again once it has placed the link on cell A6. 5. Continue to add Report Value Links as above for the following blocks: CNVY1SPEED CNVY1STAT TNK1LVL1 TNK1V1STAT MXR1LVL 6. Once the final link has been added, click the Cancel button. Copyright 1994-2003, GE Fanuc International, Inc. 16-26
104 Student Guide Lab Exercise 16 D. Creating Historical Value Links A separate link type is available that allows you to access information stored in an Historical Collection file for comparison against the real-time data. The Historical Links use the Pen and Time groups created for use with the Historical Display program. Add an Historical Link to the report using the following steps: 1. Highlight cell E6 and press <Ctrl L> or use the Create Links selection from the Report pull-down menu. The Link Selection dialog box appears. 2. Select Historical Value and click on the OK button. The following dialog box appears: 3. Highlight the Enter the Pen Group field and enter Pen Group, RECON2 4. Highlight the Enter the Time Group field and enter Time Group, 8HOURS The RECON2 Pen group and the 8HOURS Time Group were created during the Historical Trend Display lab exercise. 5. Use the default settings and click on the OK button. The Historical Link appears in the spreadsheet one cell lower than the starting point. 6. Use the <Ctrl H> keystroke to update the Historical Link. The Historical Links will now contain historical data rather than ###.##. Copyright 1994-2003, GE Fanuc International, Inc. 16-27
FIX Fundamentals Lab Exercise 16 E. Creating Time and Date Links Date and Time stamps can be added to the report to indicate when the report was run. This uses the local node's date and time. Add the date and time stamps to the report using the following steps: 1. Select cell B2 and use <Ctrl L> to access the Link Selection menu. 2. Select Time and click on the OK button. The Time Link is added to the spreadsheet and indicates the current time. 3. Select cell H2 and press <Ctrl L>. 4. Select Date from the Links Selection menu and click on the OK button. The current Date appears on the spreadsheet. F. Saving the Spreadsheet Save the Report definition spreadsheet to a file for future use using the following steps: 1. Select File from the Excel command bar menu. 2. Click on Save As in the pull-down menu. The following dialog box appears: 3. Enter REPORT1.XLS as the filename, click on the Save button. The report is now saved to the default directory. Copyright 1994-2003, GE Fanuc International, Inc. 16-28
104 Student Guide Lab Exercise 16 G. Defining the Schedule A report can be scheduled to run at a particular time or event and periodically. The report can be sent to a file, a printer or both. This configuration is defined in the SCHEDULE.LST spreadsheet. Schedule the report, REPORT1, to be saved to a file every 2 minutes using the following steps: 1. To start the configuration, select Start Scheduler from the Report menu. The following message appears: 2. Click the OK button on the message box. The SCHEDULE.LST spreadsheet appears as shown below: Copyright 1994-2003, GE Fanuc International, Inc. 16-29
FIX Fundamentals Lab Exercise 16 G. Defining the Schedule (continued) 3. In the first entry row of the spreadsheet, Row 2, enter the following Definition File Name: "C:\FIX32\REPORT1.XLS" The double-quotes around the file name and path name are required in order for Excel to find the correct file. 4. Enter a Start Time 2 minutes from now. Check the PC time! Example: 13:30 The Start Time is entered in 24 hour format. In the example, 13:30, the equivalent time 1:30PM is shown on the dialog line. 5. Enter a Repeat Interval of 2 minutes by entering 00:02 6. Enter F as the Report Destination Entering P sends the report to the configured printer. An entry of FP sends the report to both the printer and the file. To check the configured printer, select Page Setup from the File menu in Excel. 7. Enter the Destination File Name as: "C:\FIX32\REPORT1.RPT" Make sure that the Definition filename and the Destination file name are different if they are in the same directory on your hard disk. Copyright 1994-2003, GE Fanuc International, Inc. 16-30
104 Student Guide Lab Exercise 16 H. Starting the Schedule Once the report schedule has been configured, start the automatic generation of the report using the following steps: 1. Use the <Ctrl-Enter> keystroke combination to start the Scheduler. The following dialog box appears: 2. Click the On radio button and click the OK button. The following message appears: 3. Click the Yes button to save your configuration. The Schedule is saved to the SCHEDULE.LST file located in the FIX32 directory. The SCHEDULE.LST spreadsheet appears. 4. Minimize the spreadsheet using the minimize button in the upper right corner of the window. You must leave Excel running in order for scheduled reports to generate. Either minimize the Excel window or leave the window open as background window. 5. Let the report run by waiting at least 2 minutes. By monitoring the hard disk light on your PC, you will be able to judge when the report has run. Copyright 1994-2003, GE Fanuc International, Inc. 16-31
FIX Fundamentals Lab Exercise 16 I. Creating a Chart The FIX Report Generator software option provides a macro to generate charts in your spreadsheet. Once the chart is built, you may then use the Excel chart options to modify the chart to your specifications. Create the chart using the following steps: 1. Maximize Excel by double-clicking on the minimized Excel icon. 2. Open REPORT1.RPT by selecting Open from the File menu. You may have to change the default file extension to get a listing containing the correct spreadsheet. 3. Select all the Historical Link information by placing the cursor on cell E7 and holding the left mouse button down while dragging the mouse over all the fields for the link. The selected cells appear inverse highlighted. 4. Lift up on the mouse button once all the links are selected. 5. Use the <Ctrl G> key combination or select Create Chart from the Report pulldown menu. The following message appears: 6. Click OK and, using the scroll bars, locate the chart in the spreadsheet. 7. Place the cursor over the chart and drag it to a location just below the Real time Value links. You may now edit the chart using the chart edit icons which appear at the bottom of the window when a chart is selected. End of Lab Exercise Copyright 1994-2003, GE Fanuc International, Inc. 16-32