Home
Systems Engineering Subsea Control Systems Software Development
Products and Applications
Tech Info Contacts & Key Personnel |
Software Development
Excel OPC Server It provides the following functionality:
Overview
Another possible configuration for the Excel OPC Server is shown below. Here the Excel OPC Server acquires data from another (third-party) OPC Server, not connected to the main DCS/SCADA system. As with the previous configuration, the advantages of this approach are that there is no need to write data to the Excel OPC Server, and in addition, any data changes from the third-party OPC Server to the Excel OPC Server are performed by exception.
Note that we do not recommend the use of Excel for process control purposes. It is for this reason that the OPC client component of the OPC server is designed to be read-only.
The number of macros is defined using a record in the INI file, for example The macro name and the execution period (in seconds) is then defined in a separate section of the INI file, such as [Macro 1]. Note that the OPC Server does not limit the number of macros that the user can define. There will, of course, be a practical limit dependent on the complexity of the macros, and this limit can really only be determined through testing. After running the Microsoft Installer package for the Excel OPC Server, run the batch file RegisterOPC.bat to register
the OPC server, or alternatively run the following command from the command prompt:
The OPC Server is configured using an initialisation file, a sample of which is shown below: [Excel OPC Server] LicenseKey=Demo User = Process IT Development NewExcelInstance = false Database=Excel.csv Visible=True Workbook=C:\Program Files\Process IT\Excel Server\Test.xls Macros = 2 [Macro 1] Name = IncrementCellM1 Period = 1 [Macro 2] Name = IncrementCellM2 Period = 5 [OPC Client] Node= Server = ProcessIT.SimulationSvr.1 Database = OpcSimClient.csv Sheet = Sheet3 [Excel] ; For non-English versions, set the True and False strings (e.g. German) ;True = WAHR ;False = FALSCH ; Disable AutoCalc when writing (200 milliseconds) DisableAutoCalcOnWriteTime = 200 [Excel OPC Server] LicenseKey User NewExcelInstance If the OPC client is on the same PC as the Excel OPC Server, then use of the NewExcelInstance directive is straightforward. If, however, the OPC client is on another PC (and therefore the Excel OPC Server is being instantiated using DCOM), then this directive needs to be considered in light of the DCOM settings. For example, you have your OPC client on machine B, and want to connect to an Excel spreadsheet on machine A, which is currently open by the user logged into machine A. The Excel OPC Server would therefore be installed on machine A, and in DCOM, under Identity, it would be set to run as the Interactive User. Workbook Name Period In the example here, subroutine IncrementCellM1() will get called every second (Period = 1). This subroutine increments the value of Sheet1, Cell M1. '-------------------- Sub IncrementCellM1() '-------------------- Dim nValue As Long Const strCell As String = "M1" If IsEmpty(Sheet1.Range(strCell)) Then Sheet1.Range(strCell) = 0 Else nValue = Sheet1.Range(strCell) + 1 If nValue > 99 Then nValue = 0 End If Sheet1.Range(strCell) = nValue End If End Sub
True and False for Non-English Versions of Excel [Excel] True = WAHR False = FALSCH DisableAutoCalcOnWriteTime Note that it is also possible to manipulate the Excel AutoCalc setting directly using the Excel.CalculationMode OPC tag.
OPC Server Database Database=Excel.csvThe file itself is a regular comma-delimited file. As an example, the first 4 lines and last 6 lines of the sample database definition file (Excel.csv) are shown here: OPC Tag,Type,Sheet,Item,Write Tag001.PV,R4,Sheet1,R1C11,x Tag002.PV,R4,Sheet1,R2C11,x Tag003.PV,R4,Sheet1,R3C11,x ... Tag201.PV,R8,Sheet1,R4C14,x Tag202.PV,I2,Sheet1,R5C14,x Tag203.PV,I4,Sheet1,R6C14,x Tag204.PV,BOOL,Sheet1,R7C14,x Tag205.PV,String,Sheet1,R8C14,x Tag206.PV,Date,Sheet1,R9C14,x OPC Tag Type The following data types are supported:
Sheet Item For non-English versions of Excel it is necessary to change the cell row and column references to the local language. For example, the cell R1C4 would be given by Z1S4 when using a German version of Excel. Write Inbuilt OPC Server Tags Excel.CalculationMode
Alternatively, send an email with these details to the tech support email address below.
|