How to stop output in Simulink?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Harsh Saxena
le 19 Juin 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!
0 commentaires
Voir également
Catégories
En savoir plus sur Communications Toolbox 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!