xPC stream values from memory during run
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I would like to stream values one by one each time step in an xPC model, just like a "from file" block would do, but from memory instead. The "constant" block can get a vector but puts out all at once....
Say, if there was something where I could upload datat to in the memory of the target and then replay them point by point each timestep during the run, that would be perfect.
The issue came up as I am already using a "to file" block to log massive amounts of data. Now if I also use a "from file" block, the values streamed from file are not fluent: sometimes a value is kept for several dt, as if the file ended (which is not the case) and than updating resumes. The holding time is the typical hard-disk rotation time... so I guess having both blocks is not wise. Increasing buffers does not help.
Thanks for suggestions!
0 个评论
回答(3 个)
Suneesh
2014-3-21
You may be looking for the 'From Workspace' block. Although you would have to enter the values themselves into the block instead of using a workspace variable as the MATLAB workspace is not relevant on a target.
Rajiv Ghosh-Roy
2014-3-21
You could use the "From Workspace" block from Simulink/Sources. On generating code, this will cache the values in memory and then output them one at a time.
2 个评论
Rajiv Ghosh-Roy
2014-3-26
You can use the From Workspace block with a variable (e.g. a time series object). However, you are probably right about the tunability. Your other option is the Lookup table block (e.g. 1-D lookup table) with time as an input. This should be tunable, but the new values must of course have the same dimension as the old ones.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!