Is there a way to associate events such as DataChangeFcn, RecordsAcquired, etc. along with the OPC Toolbox blocks in Simulink?

1 view (last 30 days)
I am looking into using the Simulink blocks that ship with the OPC Toolbox. However, I cannot see a way to access all of the OPC Toolbox callbacks in Simulink.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Not all functionality of the OPC Toolbox is exposed in Simulink. Specifically, there is no support for logging data using the OPC Toolbox functions. Rather, since Simulink provides a mechanism for doing this, the blocks rely on Simulink logging (via To Workspace blocks, output ports or scope blocks, for instance).
It is worth noting that the OPC Read block makes use of DataChange events when the Read Mode is set to asynchronous. In this mode, data changes happen "in the background" and Simulink picks up the latest value of the items during each execution of the OPC Read block. We also use the ErrorFcn callback to trap and deal with errors in read, write or connection operations.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!