How to stop output in Simulink?

4 次查看(过去 30 天)
Emily V
Emily V 2023-6-15
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

回答(1 个)

Harsh Saxena
Harsh Saxena 2023-6-19
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!

类别

Help CenterFile Exchange 中查找有关 Communications Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by