How to export OPC client so that it can be used in the workspace as defined in the toolbox?

1 view (last 30 days)
Hi
I have a CoDeSys based OPC Server on a WAGO. The more advanced data processing and the follwing control actions should be done/triggered by Matlab. Therefore I want to read and write OPC items in script or function. I tested to read/write on the server with Matlab both Editor and OPC Toolbox worked fine in the test case.
To configure the whole OPC Server I want to use the OPC Toolbox and not the editor. So these are the steps I did so far.
  1. I connect the client in the toolbox
  2. I added some groups and also gave them a tag
  3. I added multiple items per group and tagged them as well
  4. I export the configured client to the workspace in order to be able to read and write with a script/function on items and groups.
Now the problem starts: I used all three available client export possibilites in the toolbox under "File->Export Clients to"
  • Mat-File and Workspace option: I only get the opcda object lets call it OPCTEST into the workspace. The information about the OPCTEST I get in the editor with
OPCTEST.Group.Item
are correct. Unfortunatelly I'm not able to figure out how to read/write in the editor on to the single dagroups or daitem of this opcda object I configured in the toolbox. I imagine there is a way to extract the dagroups and daitem into the workspace as well?
  • Matlab Code File option: There I can recreate the client in the workspace but then all previously defined names for the groups and items get lost. And Matlab indexes them automatically in the function exportet. It's not an option to replace them manually as there might be some changes of the client from time to time and I would need to export it again.
Any suggestions?

Answers (0)

Community Treasure Hunt

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

Start Hunting!