How does QuickOPC allow integration of OPC data into Perl?
# 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", "nsu=http://test.org/UA/Data/;i=10853");