OPC Toolbox lets you discover, access, and read raw and processed data from any data historian compliant with the OPC Historical Data Access standard. You can also access live data from an OPC Data Access server in three ways:
When used in MATLAB, the toolbox employs an intuitive, hierarchical object structure to help you manage connections to OPC servers and collections of server items, or tags. You create an OPC Data Access Client object to connect to an OPC server. This connection lets you browse the server namespace and retrieve properties of each item stored on the server. You create Data Access Group objects to control sets of Data Access Item objects, which represent server items. The toolbox lets you configure and control all client, group, and item objects by modifying their properties.
In Simulink, the toolbox uses a Configuration block to specify the OPC Data Access clients to use in the model, define the behavior for OPC errors and events, and set the real-time behavior. During simulation, the model executes in pseudo real time, matching the system clock as closely as possible by automatically slowing the simulation. You can use the Configuration block to define the toolbox’s behavior if the simulation runs more slowly than the system clock.
Once you create a group object containing item objects, you can read from or write to individual items or all the items in the group simultaneously. In MATLAB, read and write operations can occur either synchronously (MATLAB execution is blocked until the operation is complete) or asynchronously (MATLAB can continue processing while the operation is in progress). You can log data to memory or disk.
In Simulink, OPC Read and OPC Write blocks retrieve and transmit data synchronously or asynchronously to and from the OPC DA server. The blocks contain a client manager that lets you specify and manage the OPC DA server, select items, and define block sample times.
You create an OPC Historical Data Access Client object to connect to an OPC HDA server. This client lets you browse the server namespace and retrieve fully qualified IDs of each item stored on the server. You use these IDs to request historical data from the server. You can retrieve raw or processed data stored on the OPC HDA server, specifying the IDs you want to retrieve, a time period for which to retrieve data, and optional parameters. OPC Toolbox supports the following read operations:
Data is retrieved into OPC HDA Data objects, which allow you to visualize and preprocess the historical data for further analysis in the MATLAB environment. Preprocessing operations include resampling, data conversion, and data display functions.