OPC to Excel: Writing OPC data to Excel
Excel has built-in tools for getting OPC data. All you have to do is specify the formula like this for a cell:
=myserver|mytopic!myOPCitem
where:
myserver - OPC server name;
mytopic - topic name;
myOPCitem - OPC tags name.
Once the item is updated on the server, it will be automatically updated in Excel.
This method has a few drawbacks:
- It is rather difficult to create a history of changes for the value of an OPC item. You will have to write a VBA code for that.
- Excel will work very slowly in case of a large number of items.
Our program offers an alternative way to generate files that can be opened in Excel, and that will contain the history of value changes.
1. You should add the necessary OPC tags the way it is described in the "Writing OPC to MSSQL" section (fig. 1-3)
2. Enable writing the received data to a log file of the CSV format (fig. 1). By default, the program generates files in the Excel format. You can customize the format of the CSV file if you click the "Advanced" button.

Fig. 1 Configuring the log file
Note 1. You should take into account that the "C:\logs" folder must be available for writing. Do not try to write log files to the root folder of the C:\ drive, the "Program Files" folder of the "Windows" folder. Starting from Windows Vista, only the Administrator can write to them.
Note 2. If you use the program as a Windows service, by default, the service will be run by the system account that has restricted permissions to create and write files.
Related articles: OPC to Excel: Writing OPC data to Excel
- Inserting OPC data to MS Access database through ODBC (features: adding groups and items, inserting to an ODBC database)
- Adding a timestamp in the CSV file (features: OPC groups)
- How to log OPC data to a SQL database.
- OPC to MSSQL: Writing a lot of OPC tags to MS SQL 2008 database
- OPC to MSSQL: Writing several OPC tags to separate columns
- OPC to MySQL: Writing OPC tags to MySQL 5 database
- OPC to a database: Writing OPC tags to a database
- OPC to Excel: Writing OPC data to Excel
- Filtering data by a tag value and write data to a database only when the value will change
- Filtering data out if an OPC tag value is not equal to a specified value
- Processing or storing OPC data by an event from the OPC server
- Aggregating data from multiple servers to one OPC server
Related topics: Advanced OPC Data Logger
hereOPC Logger RS232 pinout and signals Cables and signals Data monitor cables