0

In my Simulink model, I have many Block S-Functions sharing a global variable. As we know, the value of the global variable will be transferred and possibly changed from block to block. I wonder if there is an alternative to transfer the data from block to block.

user3518207
  • 21
  • 1
  • 3
  • Can you please describe the problem a little more? Do you want to *unshare* the global variable, i.e have a copy of that variable per S-Function block? Or is it something else you're asking? – Praetorian Apr 22 '14 at 22:05

1 Answers1

0

I prefer using pwork vectors to share c and c++ classes (or any other stuff) between functions. A pwork vector is actually just a pointer to an object.

Check this out: http://www.mathworks.de/de/help/simulink/sfg/elementary-work-vectors.html?searchHighlight=Pwork

spieb
  • 73
  • 1
  • 1
  • 5