TRi-ExcelLink   Version 1.0 - Helps


Introduction

The TRi-ExcelLink software works by acting on a number of "Actions" that you can define to configure which data you want to read or write,  from which PLC, and  the  IP address of the TLServer  to which the PLC is connected. The "Action" also define the spreadsheet cell or a range of cells that the data should be stored or retrieved for read/write actions to the PLC.

Since the M-series PLCs rely on the TLServer to provide them the network connectivity as well as managing the username/password authentications, the TRi-ExcelLink software groups all the "Actions" that pass through a particular TLServer as a "Site". A Site is simply a PC running the TLServer software that has an IP address and with a specific username/password (if it is connected to the LAN or the Internet it will have an IP address shown on the TLServer screen.  TRi-ExcelLink software can also work in the local mode on the same PC where the TLServer is located, in this case the IP address is simply a localhost address 127.0.0.1:9080)

The program allows up to 8 Sites" to be defined and accessed simultaneously. Each Site can be defined with up to 100 independent Actions to interact with the PLCs that are connected to this Site (i.e. the TLServer). Hence, the TRi-ExcelLink software allows you to, on a single Excel spreadsheet, display or write data to hundreds of PLCs in real time!

Two Methods of Executing TRi-ExcelLink Actions

  1. Button: Normally you begin by defining the active Sites and the active Actions using the TRi-ExcelLink extremely simple user-interface. When you are ready for the show, just click on the "RUN" button to launch the actions. The software will first process all active Actions once, follow by periodically processing those READ Actions that have a non-zero "Period"  parameter. This is the simplest and most natural way of using this software and requires no programming at all. There is no need to write any macro or equations in the Excel spreadsheet because TRi-ExcelLink software automatically fills the spreadsheet cells with data according to the manner defined in their "Action Configuration" window.
  1. DDERequest from other DDE clients: TRi-ExcelLink software is itself also a DDEserver,  and all the pre-defined "Actions" can also be remotely triggered by other DDE-capable client programs such as MSExcel, MSWord via the DDERequest. This enables great flexibility to programmers who wish to have finer control of the data capturing process in their Macros, yet saving them lots of work in defining where to store the captured data .

Home Screen

Once the TRi-ExcelLink software is running, you will see the following screen:

An active Site appears as a light blue color button. Inactive Sites are shown as gray color buttons. If a Sitename has been defined  it will be displayed on the button (e.g. "Localhost Demo" in the diagram).

Controlling ExcelLink from other DDE Client

When the TRi-ExcelLink program is loaded an internal DDEServer will be running regardless of whether the "Run" or the "Stop" button has been pressed. This allows other DDE clients such as a macro in the Excel spreadsheet or Wordbasic macro to remotely control the executions of the predefined "Actions" defined in the TRi-ExcelLinkprogram. The remote DDE client can even trigger the "Run", "Pause" and "Stop" button to control the operation of the TRi-ExelLink software. An Excel file "testmacro.xls" which contains some macros for sending DDERequest to the TRi-ExcelLink software can be found at the program's installation folder.

Only the DDERequest command is supported by the TRi-ExcelLink DDE server with the following parameters:

DDE  System Name:
"XLLINKSVR"  
DDE  Topic Name= "Action" Purpose -  For requesting the execution of an "Action" defined in the program. 

Item -   "SnAm" where n is the Site No. (1-8) and m is the Action No. (1-100).

Returned String:   OK - action has been scheduled successfully. Otherwise error string will be returned.

Note: Both active and inactive "Actions" can be executed by this DDERequest. However a Site must be active and running before its defined action can be executed due to the need to log-in to the TLServer of the defined Site.

DDE  Topic Name= "Command" Purpose -  For controlling the "Run", "Pause" and "Stop" button of the TRi-ExcelLink program.

Item   - Only three Item names are currently supported: "Run", "Pause" and "Stop".

Returned String:   OK - command has been performed.

 

Examples  1:  - Trigger the action defined at: Site #1, Action #1

Sub Macro1( ) 

channelNumber = Application.DDEInitiate("xlLinkSvr", "Action")
DataArray = Application.DDERequest(channelNumber, "S1A1")
Application.DDETerminate channelNumber
Sheets("Sheet1").Range(Cells(1, 1), Cells(1, 1)).FormulaArray = DataArray ' display the returned string at cell A1.

Example  2:  - Trigger the action defined at: Site #5, Action #67

Sub Macro1( ) 

channelNumber = Application.DDEInitiate("xlLinkSvr", "Action")
DataArray = Application.DDERequest(channelNumber, "S5A67")
Application.DDETerminate channelNumber
Sheets("Sheet1").Range(Cells(1, 1), Cells(1, 1)).FormulaArray = DataArray ' display the returned string at cell A1.

Example 3:  - Trigger the "Run" button of the TRi-ExcelLink software.

Sub RunXLLink( )

channelNumber = Application.DDEInitiate("XLLinkSvr", "Command")
DataArray = Application.DDERequest(channelNumber, "Run")
Application.DDETerminate channelNumber
Sheets("Sheet1").Range(Cells(1, 1), Cells(1,1)).FormulaArray = DataArray
End Sub


Site Configuration

When you click on any of the S1 to S8 buttons in the Home Screen, the Site Configuration window is opened as shown below. Note that the Site Number (1-8) is displayed in the Titlebar of this window:

 

You define the parameters required for logging in to the TLServer:

Action Definition

The Action Definition window will be opened after you double-click any of the A1-A100 button in the Site Configuration Window.

Record the currently defined parameters for this Action.


Cancel the current Action definition. The original Action parameters will be restored.


Delete this Action definition so that the parameters defined here will not show up in the "Site Configuration" windows at the area of the A1-A100 buttons.

  • Action: The are four choices available:  Read Single variable; Read a range of DM; Write Single variable, Write a range of DM.

    Read Single Variable  will extract the value of the target system variable (as defined by the Variable and the Var. Index fields) from the PLC and insert it into the Excel Spreadsheet cell (or range of cells) periodically.

    Write Single Variable  will take the data out of the spreadsheet cell (as defined in the "Excel Linkage Cell Locations" section) and write it into the PLC. 

    If  "Read A range of DMs" or "Write A Range of DMs" is  selected then the Var.Count field will become visible for you to define the number of DMs that you want read into the spreadsheet or write from the spreadsheet.  

     

  • Variable:  Select  from a list of all the system variables such as DM[n], INPUT[n]. OUTPUT[n].....etc. All the PLC's system variables, including all timer and counter Present Values (PV) as well as Set Values (SV) can be read from or written to the PLC.

    This selection, combined with the index to the system variable defined in Var. Index,  is used to select  the exact variable that you wish to read from or write to the PLC.

Note:  if the "Action" choice is either "Read A Range of DMs" or "Write A Range of DMs" then this selection is automatically fixed at "DM[n]" and cannot be changed.

In this example, 10 DMs  starting from DM[3],   will be taken from the PLC and fill into the spreadsheet cells. i.e. DM[3] to DM[12] are the data to be captured into the spreadsheet.

Excel Linkage Cell Locations

The TRi-ExcelLink software lets you define where and how you want the captured data to be stored into the Excel spreadsheet. When capturing data from a single variable or a range of DMs, you can define it such that the captured data will either occupy a single cell (for "Read Single Variable") or populate a range of cells defined here. You even have a choice of whether the cells are being filled from left to right or top to bottom and whether the data should be rolled over once the data have populated the entire defined range of cells.

When "Write Single Variable" is selected, both the No. of Row and No. of Col. fields will be set to1. When  "Read A Range of DMs" or "Write A Range of DMs"  are selected, the No. of Row x No. of Col. has to be greater than or equal to the number defined in the "Var. Count" field to be accepted. Roll Over are not allowed in reading or writing DMs.

Note that the time-stamp recorded will be based on the clock in the PC where the TRi-ExcelLink runs on, and not from the real time clock in the PLC.