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

1 次查看(过去 30 天)
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.

采纳的回答

MathWorks Support Team
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.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by