Use the OPC Client Manager
Introduction to the OPC Client Manager
The OPC Client Manager displays and manages all clients for a Simulink® model. Using the OPC Client Manager, you associate one or more clients with a particular model. Each time you use an OPC Read or OPC Write block, you choose the client for that block from the list of configured clients. By defining a single list of clients in the OPC Client Manager, you enable a Simulink model to reuse clients among OPC Read and OPC Write blocks.
You access the OPC Client Manager from the parameters dialog of the OPC Configuration, OPC Read, or OPC Write block, by clicking Configure OPC Clients. A dialog similar to the following figure appears.
Add Clients to the OPC Client Manager
You add clients to the OPC Client Manager by clicking Add. The following dialog box appears.
Specify the host in the Host edit box. You can then type the Server ID of the required server, or use Select to query the host for a list of servers.
Specify the timeout (in seconds) to use when communicating with the server.
When you click OK, the client is added to the OPC Clients list in the OPC Client Manager. You can now use that client in one or more OPC Read or OPC Write blocks within that model.
Remove Clients from the OPC Client Manager
To remove a client from the OPC Client Manager, select the client in the OPC Clients list and click Delete. A confirmation dialog appears. Click Delete to remove the client from the OPC Client Manager.
If you attempt to remove a client that is referenced by one or more OPC library blocks, you see the following dialog.
Click Delete to remove all blocks that reference the client you want to delete.
Click Replace to replace the referenced client with another client in the OPC Client list (this choice is available only if another client is available), and select the replacement client from the resulting list. Click Cancel to cancel the delete operation.
Modify the Server Timeout Value for a Client
Click Edit to modify the timeout property of the selected client. The timeout value is specified in seconds, and applies to all server operations (connect, disconnect, read, write).
Control Client/Server Connections
Industrial Communication Toolbox™ software automatically attempts to connect a client configured in the OPC Client Manager to its server. This enables you to browse the server name space for items, and speeds up the initialization process of simulating a model.
You can control the client connection status by highlighting a client in the OPC Client list and clicking Connect or Disconnect.
The OPC block library automatically reconnects any disconnected client to its server when you run a simulation.