0

Good day all, I am currently having trouble with my Simulink model. There are 2 subsystems A and B. I would like to make subsystem A run first then using the data produced, run subsystem B. Is there a function of Simulink block i could use to execute this?

I have tried using trigger and enable with a step input of 10sec before subsystem B but it didn't work. I have tried a store memory but it didn't work too. A Variant subsystem is considered but as the input to both subsystems A and B are different, i assume it would not work as well.

I would appreciate the help and support i can get from you guys! Thank you very much!

nauyishok
  • 1
  • 5
  • I think we need more information here, some simple examples of your subsystems. Because usually you just put them one by one and then B uses A's results. So I assume your problem is that you need some data arrays, which created for some time period and then route it to sub B. It's a bit harder but it can be done with enabled subsystems. We need more information to answer. – Mikhail_Sam Apr 07 '16 at 11:46
  • 1
    If subsystem A feeds into subsystem B then Simulink will automatically (and by definition) order the execution such that A executes before B. That will happen at every time step. Are you asking for A to run for a certain amount of time and then for B to execute? And when you say "it didn't work", be more explicit about what didn't work. What happened, and what was wrong with what happened. – Phil Goddard Apr 07 '16 at 13:55
  • Thanks for the reply. I have attached my Simulink model in the link below. Hopefully it will be clearer. Basically I need my PV configuration to run first. Then i will use my subsystem B to scan through the V-P graph of the PV. Thanks again! https://www.dropbox.com/sh/asononvm9hgnlig/AABrIsRZRfH2OCMBLMDx9Af1a?dl=0 – nauyishok Apr 08 '16 at 04:23
  • Hi Phil, basically i need subsystem A to run completely then run Subsystem B. When i tried it with a trigger operator with a step input to control the trigger, this error surfaced. "Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs." – nauyishok Apr 08 '16 at 04:34
  • Why aren't they 2 different models? It's still not clear whether a) P,V and I should be input to Subsystem B at each time step, b) they should be buffered and input to subsystem B at given/triggered time steps, or c)you should have 2 models, getting the results of P, V and I first, then running model B. – Phil Goddard Apr 08 '16 at 17:06
  • Hi Phil, what i am trying to achieve is running them together in 1 Simulink file (both models together). The P,V and I should only be input into subsystem B after completion. Is it impossible to achieve this? – nauyishok Apr 09 '16 at 02:12
  • You most likely can get it to work in one model, but you'd need to jump through multiple non-trivial hoops to do so. Alternatively you can use 2 models and have it working in a couple of minutes. – Phil Goddard Apr 09 '16 at 02:39
  • May I know what you mean by the non-trivial hoops? I hope to get a solution for you. I am keen to put them together! – nauyishok Apr 09 '16 at 02:51
  • At a minimum, you'll need to group the 2 parts separate parts; figure out how to best trigger or enable each part; buffer the signals appropriately (you won't be able to using the Workspace to store/transfer the data); depending on what you want to achieve, work out how to separate the data out (noting that depending on how you do the previous steps the output signals will have values at all time steps, not just when they are triggered/enabled); and probably other issues that arise as you are trying to overcome the above issue. In short - use 2 models. – Phil Goddard Apr 09 '16 at 03:45
  • If i want to use 2 models, how can i connect the V+ and V- between Subsystem A and B? I would be unable to use Goto or To workpace. Is there any method for me to accomplish this? Thanks for the knowledge! – nauyishok Apr 09 '16 at 03:56

1 Answers1

-1

What you might need is to understand how to assign priorities to certain blocks in Simulink, also known as changing the sorted order in your model. You can do this either programmatically or interactively. Check this page from the documentation for more detailed information.

Jorh
  • 1
  • 1
  • 1
    Sorted order only has an effect when it doesn't matter which order subsystem A and subsystem B execute in (and hence Simulink allows the user to specify which order they want the execution done in). If subsystem A feeds into subsystem B then there is an inherent ordering to the blocks so Simulink will ignore your specified sorder order. – Phil Goddard Apr 07 '16 at 13:51