Once a DDE topic is configured, you are ready to establish a DDE Hot Link to Microsoft Excel. There are two ways to establish a DDE Hot Link to Excel, the hard way and the easy way. The hard way is to type it by hand with all the proper syntax marks in place, but we will try it the easy way using the Windows clipboard. The clipboard will copy only hot links.
This exercise will establish a Hot Link to Excel to read a block of five timer accumulators from a Control Logix and create an active graph of the data in Excel. We will use Timer1 through Timer4 - it is essential that these timers exist in the data table section of the ControlLogix. Excel 97 is used for this exercise, other versions of Excel would be similar with slightly different keystrokes or mouse clicks.
- If RSLinx is not already running, start it now.
- Select Edit/Copy DDE Link to Clipboard ( or use the icon in the toolbar that looks similar to the typical windows Paste icon.)
• A Copy Link to Clipboard box will appear.
- Click OK. All of the information required to establish a Hot Link to Excel is now residing in the Windows clipboard.
- Start-up Microsoft Excel by clicking the taskbar’s Start button/ Programs/Microsof tExcel, but DO NOT CLOSE RSLinx.
- Place the cell pointer in the cell that you would like the Hot Link to be put in. For example, place the cell pointer in cell A1 by RIGHT-clicking on that cell.
- Select Paste Special, source of Paste Link and click on OK. The Hot Link will be
pasted into the cell and data from the PLC will appear.
• The five timer accumulator values will begin to update in five successive cells.
This is now live data being read directly from the ControlLogix.
- Note that the formula bar in Excel contains the formula that is needed to establish
the DDE Hot Link. This link was pasted in from the clipboard.
It should look similar to the following:
- The parts of the formula are as follows:
Note the braces { } around the formula. These indicate that this formula is an array formula. All hot links pasted in via the clipboard from RSLinx are array formulas and are READ ONLY (in other words - you can not poke, also known as “download,” from a hot link).
Under normal circumstances, you cannot modify part of an array formula (an array is defined by Excel - please see your Excel manual for details).
• If you attempt to do this you can get caught in a loop of errors.
To bail out, just press the escape key on your keyboard.
Charting Data In Excel
- We are now going to create a live chart from the PLC data. Make sure that the five cells that contain the PLC data are highlighted (Left-click on cell A1, hold, and drag down to cell A5).
- Click on the Chart Wizard icon on the Excel toolbar. The Chart Wizard icon looks like the following:
- The following Chart Wizard Step 1 of 3 will immediately appear as the Chart Wizard icon is clicked. You will see a box to select the type of chart you prefer.
Note: At this point, you may simply accept the Wizard defaults for these options.
- After selecting the chart type, just click Finish or, if you prefer, click Next repeatedly until the Wizard is complete just to be aware of the charting options available.
- After clicking Finish, a live chart of the data will appear on your spreadsheet.
Hi,
ReplyDeleteHow do you form that link that is written to clipboard?
Can you give me some documentation about the object that needs to be created?