MATLAB Answers

Asynchronous data acquisition & filtering

2 views (last 30 days)
Jan Kappen
Jan Kappen on 15 Jul 2013
Hey guys,
I need your help again :(
Currently I'm using a real time windows target model which receives data via the stream input block from the rs232. The samplerate of the input port is much higher than the real send rate, so I don't miss any packets. But there are some time delays, of course. For example usually every 10th. sample contains new data. But sometime it's the 12th or the 9th sample. So I can't decimate the samples (I want to have a lower sample rate in the dsp block), and a rate transition would sometimes produce the same output twice, which is unwanted.
So i tried to make the whole thing asynchronous.
I receive a few packets and check if they are correct and if the packet is complete a flag is set.
This flag is going to be used (via the triggering action block) in a filtering block where some calculations are made, when a new packet has been received. So this is a asynchronous system.
Now my questions: - Is this approach ok and usual? I feel like this is the 'natural' way, but is simulink made for this application?
- A triggered system will execute only once, if there is no new trigger. How long can the calculations last? Can they be longer than a global sampletime? What does this look like in a scope?
- Can I - if the second question is true - measure the time the block needs for execution?
Thank you very much!


Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by