How to stop output in Simulink?

1 visualización (últimos 30 días)
Emily V
Emily V el 15 de Jun. de 2023
Respondida: Harsh Saxena el 19 de Jun. de 2023
Hello,
I'm building a Transmitter and Receiver with two Ettus N210 USRPs using Matlab & Simlink. I can send data from the Transmitter to the Receiver, and the Receiver is receiving the correct data.
My problem is: There is a continuous output.
I would like to only send one single message, but I can't seem to figure out how to only send a single message.
Is this even possible?
Thanks for any help!
Best regards,
Emily

Respuestas (1)

Harsh Saxena
Harsh Saxena el 19 de Jun. de 2023
Hi Emily,
I think you need to modify the simulation time in Simulink so that the simulation runs for only one transmission. Here are the steps you can follow to modify the simulation time:
1. Double-click on the Transmitter block to open its block parameters dialog. In the "Source properties" tab, set the "Samples per frame" parameter to the number of samples you want to send in a single transmission.
2. In the Simulation tab of the Simulink model, set the "Stop time" parameter to a value that corresponds to the length of the transmission you want to send. For example, if you want to transmit for 1 second at a sample rate of 1 MHz, set the Stop Time to 1e-6 (i.e., 1/1e6).
3. Run the simulation.
By following these steps, the simulation will transmit and receive only one message, and then stop. If you want to send another message, you will need to restart the simulation.
Note that the actual duration of the transmission depends on the number of samples per frame and the sample rate of the USRPs. You should adjust the "Samples per frame" parameter and the "Stop time" parameter accordingly to ensure that the transmission duration matches your requirements.
Hope this helps!

Categorías

Más información sobre Communications Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by