Introduction to RSLinx OPC Server
OPC (OLE (Object Linking and Embedding) for Process Control) and DDE (Dynamic Data Exchange) are a way for applications to interact with each other to share data. The RSLinx OPC Server can share data with other applications, such as an Excel Spreadsheet or OpenOffice Calc. Your Visual Basic application can also gather data from RSLinx. In order to use the RSLinx OPC server, you must have a paid version of RSLinx, such as RSLinx Professional.
There are many reasons you would want to do this. One reason is to create a troubleshooting tool. If your equipment fails to start, you can open a spreadsheet that has all of the conditions listed that must be met before the equipment will run. The next time the equipment fails, you can simply open the spreadsheet to see what condition is not met. You can also use this feature for reporting, trending, etc.
Example
First of all, let’s take a look at some code in the processor. Here we just have a self-running timer. Our goal in this example is to display the accumulated value in an OpenOffice (Or LibreOffice) spreadsheet. You can do the same with Excel.
When the accumulated value of the timer reaches, the preset, this timer will start all over. I’ve set up this timer simply to demonstrate how to display the data in a spreadsheet.
RSLinx
In RSLinx, we need to create a topic. The topic will act as a “shortcut” to our processor. In order to access the topics, we will open RSLinx.
Secondly, lets create a new topic.
Here, I’ve clicked “New”. Then I created a topic named “MyTopic”, and pointed this shortcut to the processor. Be sure the name of the topic, and the processor are both highlighted at the same time. The default update time is 1 second. If you need this to update faster, go to the “Data Collection” tab, to change the update time. Now hit “Apply” then “Done”.
Thirdly, we need to copy the link from RSLinx, so we can paste the topic into our spreadsheet. Click on Edit (from the menu bar), then Copy OPC/DDE topic.
Finally, browse for the tag “MyTimer.ACC” as shown, then press OK.
Paste link into spreadsheet
At last, I will open the spreadsheet program. In this instance, I’m using Openoffice Calc. Our goal is to paste the accumulated value into a cell, so it can update in real time (Or near real time).
Right-click a cell and choose “Paste Special”.
We are pasting a DDE Link.
At last, we see the value is updating in real time.
Now that you have the topic created, and the data is updating, you can just re-paste this link as many times as you like. Then, you can modify the tag in the formula for that cell.
— Ricky Bryce