MATLAB and Visual Components (VC) can exchange data through OPC UA, but the endpoints must use compatible roles. MATLAB's Industrial Communication Toolbox provides an OPC UA client; connecting it directly to another OPC UA client will not work. Place an OPC UA server between the clients, or install a third-party VC plug-in that turns VC into the server.
Identify the OPC UA Roles
Determine whether each endpoint operates as a client or server before configuring addresses or security. The standard arrangement described in the available evidence uses an external OPC UA server that both MATLAB and the VC client access.
MATLAB OPC UA client ──> External OPC UA server <── VC OPC UA client
A client-to-client arrangement has no server to host the address space and therefore cannot establish the required data exchange.
Select the Connection Architecture
| Architecture | VC role | MATLAB role | Decision |
|---|---|---|---|
| External OPC UA server | Client | Client | Use when a separate server is available to expose the exchanged data. |
| VC2OPCUA plug-in | Server | Client | Use when MATLAB has only the client role and an external server is undesirable. The plug-in exposes VC model information bidirectionally but has unspecified limitations. |
| Socket connection | Socket endpoint | Socket endpoint | Consider when OPC UA roles or security cannot be resolved. The evidence does not define the socket protocol or message format. |
For the plug-in route, install VC2OPCUA, start its OPC UA server, and configure MATLAB to connect as a client. For the external-server route, connect both clients to that server and map the required VC model data and MATLAB variables through its address space.
Troubleshoot OPC UA Security Verification
The reported plug-in failure was an error occurred verifying security, accompanied by an inability to locate the security certificate. This indicates a security-validation problem, but the evidence does not identify the missing certificate, endpoint policy, or trust-store location.
- Confirm that MATLAB targets the server endpoint created by VC2OPCUA rather than another client.
- Inspect the server and MATLAB client security configuration for certificate or trust requirements.
- Locate or generate certificates only through the documented controls supplied by those products; no certificate path is established by the evidence.
- Retry the connection and record the selected endpoint and security settings if verification still fails.
Verify Bidirectional Data Exchange
A connected session alone does not prove that the integration works. Read one exposed VC model value from MATLAB, then write one permitted value from MATLAB and confirm that VC changes accordingly. If using an external server, also verify that both clients reference the same server data items.
The reported outcome confirms that a MATLAB-to-VC OPC UA connection is feasible, but it does not establish which architecture or security settings produced the successful connection. Preserve the working endpoint, role assignment, and certificate configuration for repeatable deployment.
FAQ
Why can’t MATLAB connect directly to the Visual Components OPC UA client?
Both endpoints are clients, so neither hosts the OPC UA address space. Connect both to an external OPC UA server or use VC2OPCUA to make VC operate as the server.
Can Visual Components act as an OPC UA server for MATLAB?
Yes, the third-party VC2OPCUA plug-in creates an OPC UA server and exposes VC model information bidirectionally. Its limitations are acknowledged but not defined in the available evidence.
How do I fix “an error occurred verifying security” in MATLAB OPC UA?
Verify that MATLAB targets the correct server endpoint, then inspect the client and server certificate and trust configuration. The evidence does not provide a certificate location or supported security-policy setting, so confirm those details in the installed products' documentation.