Online data display and aquisition

2 views (last 30 days)
Stefan
Stefan on 1 Jul 2014
Answered: Rajiv Ghosh-Roy on 2 Jul 2014
Dear Mathworks-Team,
we want to monitor xPC on-line data with our own GUI and plot() function. We gather chunks of data (a vector of 50 doubles) with the SigIn-Block and try to read them out (at the moment we access the "Out" block.
The Matlab-Code does the following:
ids='Piezosteuerung/SigIxi/Out'
id = getsignalid(tg, ids)
variable = tg.getsignal(id)
What happens now is that we do not get the entire vector, but only the first element. So we made some construction like
for (i = 1:bufsize)
variable(i) = tg.getsignal(i+id)
end
It works, however, but I cannot imagine that this is the way to solve the problem. How can we get a vector with the last bufsize elements into Matlab to display them?
Thanks for your help,
Stefan

Answers (1)

Rajiv Ghosh-Roy
Rajiv Ghosh-Roy on 2 Jul 2014
If you are looking to get time histories of data, you will need to use a host scope block. This can store a buffer of data. When the buffer is full, you can upload the buffer and then restart the scope.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!