How to configure byte unpack?

4 views (last 30 days)
ander
ander on 5 Nov 2014
Answered: Dimitri MANKOV on 7 Jul 2022
Hi, I have a client-server aplication and I am sending udp packets to the server. The server takes this packets and return it to matlab. When I send packets the total size is 16 bytes (2 doubles) so I am sure that the size of returning packet is 16 byte. Then I have to unpack and for that I have the next configuration:
I think I am doing well but simulink has another opinion. The error it gives is the next:
Thanks

Answers (1)

Dimitri MANKOV
Dimitri MANKOV on 7 Jul 2022
Hi Ander,
I'm not sure whether the Byte Unpack block is capable of outputting matrix signals... But most importantly, the dimensions don't seem to match what you're trying to achieve: if you know that you get a vector of 16 bytes as an input and want to have 2x double signals as the output, you should use the following parameters:
  • Output data type: {'double', 'double'}
  • Output dimension: {[1],[1]}
... if you want two output ports, or:
  • Output data type: {'double'}
  • Output dimension: {[2]}
... if you'd prefer one output port with a vector signal.
I hope this is helpful!
Dimitri

Tags

Products

Community Treasure Hunt

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

Start Hunting!

Translated by