"From Workspace" time delay
Mostrar comentarios más antiguos
Hello community, I have a tricky problem with the "From workspace" block.
I want the output of my Block A to be written to workspace (which works fine) and then be red by a "from workspace" block for beeing processed by block B.
My problem is now to make sure, that the "from workspace" block reads the variable AFTER block A has written down the information to the workspace.
In my case I have a 2-block demo for getting along with this issue. My aim is to build up a simulation with about a hundered of timedepending blocks, connected through to-and-from-workspace blocks.
The reason for using the workspace is that I can't say which output belongs to which input. This will be assigned by a m-File at the beginning of the simulation.
Edit: here is an screenshot, which shows the use of priority: http://img825.imageshack.us/i/screenshotbs.jpg/ As you see, the display on the right should show "0" instead of "1" (which was my former test value). This shows, that the "From workspace" block is beeing handled before the "to workspace" block. In this case there's another problem: When I start my simulation the first time, I get an exception, that the variable "simin" does not yet exist. If the order of priority would have been handled correctly, this problem may have not been occure...
It would be nice, if someone can give me a hint onto this topic.
Greets, Tobias
Respuesta aceptada
Más respuestas (1)
Kaustubha Govind
el 2 de Feb. de 2011
0 votos
I am not sure if the From/To Workspace blocks lock down the workspace variable at any point during the simulation, but passing data through the model using these blocks may not be the best idea since they are meant solely for reading static data and data-logging, respectively. Is there a reason you wouldn't consider using the From / Goto blocks instead?
Note that assigning block priorities will be non-trivial if you plan to connect hundreds of blocks in this fashion. Also, Simulink will honor your setting only if there are no data-dependency violations.
4 comentarios
Tobias
el 2 de Feb. de 2011
Kaustubha Govind
el 2 de Feb. de 2011
I'm not sure what you mean by "incompatible to priority". From/Goto blocks are merely connection points and are therefore virtual. Think of them as two ends of a signal - they do not need to be executed like other (non-virtual) blocks. Consequently, they do not have a priority that you can set. However, priority is inconsequential for these blocks - it is the priority of their source/destination blocks that is useful.
Tobias
el 8 de Feb. de 2011
Kaustubha Govind
el 8 de Feb. de 2011
Try something like:
set_param('mymodel/From', 'GotoTag', 'A')
set_param('mymodel/Goto', 'GotoTag', 'A')
Categorías
Más información sobre Simulink Functions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!