Professional OPC Development Tools and Services

opc logo

Get OPC data into Perl

With QuickOPC, you can create new OPC Perl solutions, or integrate OPC functionality into your Perl scripts.

How does QuickOPC allow integration of OPC data into Perl?

  • QuickOPC provides COM (OLE Automation) objects with easy interfaces to perform all kinds of OPC tasks
  • You instantiate one of the main QuickOPC objects.
  • You call methods that perform operations such as OPC reading or writing.

Read More

OPC Perl Example

If you want see it for yourself, we have an example that shows how to read a value of an OPC item in Perl and print it out. It is just a few lines of code, and for OPC Data Access server, it looks like this:
use Win32::OLE;
# Create EasyOPC-DA component $client = Win32::OLE->new("OpcLabs.EasyOpc.DataAccess.EasyDAClient");
# Read item value and display it print $client->ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single");

The example connects to Simulation OPC Server, but you can quickly modify it to connect to your OPC server instead. Simply download the product and then open the project.

It is also possible to subscribe to OPC item changes in Perl. We have tested this example with ActivePerl v5.14.2.

With an OPC Unified Architecture (OPC UA), the code is just as simple:

use Win32::OLE;

# Create EasyOPC-UA component 
$client = Win32::OLE->new("OpcLabs.EasyOpc.UA.EasyUAClient");

# Read node value and display it
print $client->ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer",