I have a regular Matlab class named Server that is a convenience class built around webread() and webwrite() that allows communicating with a RESTful webservice. Inside Matlab everything works great. Now I am in the process of creating a Matlab.System class so I can create a Simulink block out of it. I have everything in Simulink as well. My question is the following: I'd like to split the functionallity of that Server Simulink block up into multiple blocks. Ideally I'd like to have one Control block that gives information about the connection status, the number of available measurements and so on, one Input block to GET data from the webservice via the Server class and one Output block to POST data to the webservice via the Server class. Is that possible?
The problem I am facing is that all of these blocks would have to use the same instance of the Server class. In my current Matlab.System class that I use in Simulink I have an instance of that Server class as a private property. Is there any mechanism that allows me to share a property across multiple Matlab.System classes or is there a different mechanism provided by Simulink itself to split functionality of a Matlab.System class up into multiple blocks?
Thank you very much for your help.