Borrar filtros
Borrar filtros

Running 2 commands at same time

34 visualizaciones (últimos 30 días)
Paul Elliott
Paul Elliott el 25 de Jun. de 2024 a las 18:16
Respondida: Paul Elliott el 2 de Jul. de 2024 a las 12:48
I am working on a data acquisition program. Within that program, i need the following functionality:
1- start recording data on a raspberry pi
2- send a command that triggers an output voltage from the pi, some time after starting recording (say 0.25 sec).
I spoke with a matlab engineer who was totally unfamiliar with what I wanted to do. I don't really care about the order. If issuing a command first that tells the pi to generate a trigger signal is easier that is easy to adjust the delay time, but the actual trigger has to start after the data collection starts. I'm not really running 2 scripts just 2 commands and I'd like them to be able to run non-sequentially, or parallel.
I don't really even know enough to ask Mathworks the right question. Any guideance would be helpful.

Respuestas (3)

SACHIN KHANDELWAL
SACHIN KHANDELWAL el 26 de Jun. de 2024 a las 4:21
You might want to use the 'parpool' and 'parfeval' functions in MATLAB. These functions allow you to create a parallel pool for your computations, so you can run tasks simultaneously.
For more details, you can check out the MathWorks documentation on these functions.
If you need to wait for a while, you can use the 'pause' function.
Hope this is helpful!
  1 comentario
Paul Elliott
Paul Elliott el 26 de Jun. de 2024 a las 19:14
Thank you. I will research this. I appreciate the suggestion.

Iniciar sesión para comentar.


MathWorks MATLAB Hardware Team
MathWorks MATLAB Hardware Team el 2 de Jul. de 2024 a las 7:19
Hi,
Your wokflow is possible by using targetHardware function,
Please feel free to contact our technical support if you need further assistance.
Thanks,
MATLAB Hardware Team
MathWorks

Paul Elliott
Paul Elliott el 2 de Jul. de 2024 a las 12:48
Upon review, we will have to use a Python library call to start the data recording on the raspberry pi, and then use a python scripy to initiate a trigger from the pi to release the weight. We found what appears to be an easy way do this within Python. Will try to post once our solution is proven.

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by