Using Simulink to send data over internet (TCP/IP)

3 vues (au cours des 30 derniers jours)
Harshil Patel
Harshil Patel le 8 Oct 2015
Hello, I'm trying to send data over internet via Simulink. I have gone through 'Sending and Receiving Data Over a TCP/IP Network' example in MATLAB Documentation and tried to replicate it. I modified the Simulink model a bit. I faced the following problem.
I inserted one more 'Scope' block near the 'Sine Wave' block to compare the 'sent' and 'receive' results. EVERYTHING else is similar to what is described in the example.
These were the results after running the simulation
:
The results obtained are clearly very different. Can anyone please tell me if this is a bug or am I making some mistake?
Harshil
  1 commentaire
João Thiago Campos
João Thiago Campos le 11 Juil 2017
You have to zoom out scope 2 to see it in same scale.
regards,

Connectez-vous pour commenter.

Réponses (1)

Andy Scarisbrick
Andy Scarisbrick le 3 Jan 2018
Hi. I am not sure if you solved the problem already. But it is not related to the zoom.
When you generate the sine wave, the signal data type is a double. By default of TCP/IP receive, the data type is uint8. If you double-click on the receive block and set Data type to double, the received info will be consistent with the sent one. If on your Simulink model you click Display->Signals & Ports->Ports Data Type, that will help you to better understand what I mean.
Regards, Samuele

Catégories

En savoir plus sur Direct Interface Communication in Simulink dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by