MATLAB Answers

How to use IDL sequences in Simulink DDS Blockset

6 views (last 30 days)
Patrick S
Patrick S on 1 Oct 2021
Commented: Mark McBroom on 14 Oct 2021
Dear Community,
In my project, I am sending messages via DDS that include sequences. I was wondering how I can handle sequences in Simulink with the DDS Blockset addon.
Consider for example the following IDL file that defines a message type which consists of an array of points.
#ifndef POINTS_IDL
#define POINTS_IDL
struct Point
{
double x;
double y;
};
struct Points
{
sequence<Point> points;
};
#endif
I would now want to access a specific Point in the Points array by index. How can I do that with Simulink blocks?
If it matters: I would prefer to have a variable length sequence in the message.
Kind regards,
Patrick

Answers (1)

Mark McBroom
Mark McBroom on 13 Oct 2021
Edited: Mark McBroom on 13 Oct 2021
Unfortunately, the DDS Blockset does not fully support sequences. Simulink will treat a sequence as a fixed length vector. The default size is 100 which you can change in the DDS Data Dictionary. The DDS Take block will only accept sequences up to the fixed length. The DDS Write block will always write the fixed length vector to the sequence.
Thanks.
Mark.
  1 Comment
Mark McBroom
Mark McBroom on 14 Oct 2021
Feel free to reach out to me directly if you have additional questions on the DDS Blockset. mmcbroom@mathworks.com

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!