Main Content

OPC Configuration

Configure OPC clients for model, pseudo real-time control, and behavior for OPC errors and events

  • Library:
  • OPC Toolbox

  • OPC Configuration block

Description

The OPC Configuration block defines the OPC clients to be used in a model, configures pseudo real-time behavior for the model, and defines behavior for OPC errors and events.

The block has no input ports. One optional output port displays model latency.

You cannot place more than one OPC Configuration block in a model. If you attempt to do so, an error message appears, and the second OPC Configuration block is disabled.

Ports

Output

expand all

Outputs the model latency as the time spent waiting at each simulation step to achieve pseudo real-time behavior.

Data Types: double

Parameters

expand all

OPC Configuration

Click to open the OPC Client Manager dialog for the model. Each model has a list of clients associated with it. These clients are used during the simulation to read or write data to an OPC server. For more information, see Use the OPC Client Manager.

Error Control

These parameters defines actions when OPC-specific errors and events are encountered. The available actions are to produce an error and stop the simulation, produce a warning and continue the simulation, or ignore the error or event.

Defines the behavior for items that are specified in a Read or Write block but do not exist on the server when the simulation starts.

Defines the behavior when a read or write operation fails.

Defines the behavior when the client cannot connect to the OPC server, or when the server sends a shutdown event to the client.

Defines the behavior when the simulation runs slower than real time. See the Pseudo real-time simulation options for more information.

Pseudo real-time simulation

This parameter allows you to configure options for running the simulation in pseudo real time. When checked (on), the model execution time matches the system clock as closely as possible by slowing down the simulation appropriately. Note that the real-time control settings do not guarantee real-time behavior.

If the model runs slower than real time, a pseudo real-time latency violation error occurs. You can control how Simulink® responds to a pseudo real-time latency violation using the settings in the Error control pane.

The Speedup setting determines how many times faster than the system clock the simulation runs. For example, a setting of 2 means that a 10-second simulation will take 5 seconds to complete. The Speedup parameter must be a literal integer; you cannot use a MATLAB or Simulink model workspace variable to define the speedup factor.

Output Ports

Check this parameter (on) to add an output port to the block for the model pseudo real-time latency.

See Also

Blocks

Introduced before R2006a