Main Content

OPC Write

Write data to OPC server

  • Library:
  • OPC Toolbox

  • OPC Write block

Description

The OPC Write block writes data to one or more items on an OPC server. You can choose the write operation to take place synchronously or asynchronously.

Each element of the input vector is written to the corresponding item in the item ID list defined for the OPC Write block.

Note

You must have an OPC Configuration block in your model to use the OPC Write block. You cannot open the OPC Write dialog without first including an OPC Configuration block in the model.

Ports

Input

expand all

Values to be written to OPC items. Each element of the input vector is written to a separate item on the OPC server.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean

Parameters

expand all

The import dialog allows you to import settings for the OPC Write block from a dagroup object in the MATLAB base workspace. The client, item IDs, and sample time are updated based on the properties of the imported group.

Defines the OPC client associated with this block. You can add clients to the list using Configure OPC Clients. For more information, see Use the OPC Client Manager.

Shows the items to be written to on the specified server. You can add items to the list using Add Items, or delete items using Delete. You can change the order of the items in the list using Move Up or Move Down. Each element of the vector at input port is written in order to the corresponding item in the list.

Defines the write mode for this block, as Synchronous or Asynchronous. Synchronous writes are generally more reliable than asynchronous. but have slightly more overhead.

Defines the sample time for the block. Data is written to the server at the specified sample time. You can specify 0 for continuous mode, or -1 to inherit the sample time of the block connected to the input of the OPC Write block.

See Also

Blocks

Functions

Introduced before R2006a