Live CAN message from Simulink to App Designer
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
I am having issue with both Simulink and App designer due to Arduino Hardware limitation.
So my new approach is to read live CAN message via Simulink and bring that data to App designer.
I was able to run the simulation but it is running as just 'start' not 'monitor and tune' by using this code
set_param(app.ModelName,'SimulationCommand','Start')
Is there a way to programatically run 'monitor and tune' so I can run simulink via App Designer on Arduino?
Thanks!
3 comentarios
Respuesta aceptada
Umar
el 1 de Jul. de 2024
Hi Min, Let me tackle your comments one at a time. So, for the first one that you mentioned,
I am having an interesting error.
Warning:Non-scalar data in first argument to set_param is detected. Only first handle in the matrix is processed. simulink_root does not have a parameter named 'SimulationCommand'
Any reason why it isn't grabing the simulationcommand?
In my opinion, when you receive the warning "Non-scalar data in the first argument to set_param is detected," it indicates that the function is expecting scalar data but is receiving non-scalar data, such as a matrix or cell array. To address this issue, ensure that the input to set_param is a scalar value.
Now, regarding the 'SimulationCommand' parameter not being recognized, double-check the spelling and case sensitivity of the parameter name. Make sure that 'SimulationCommand' is the correct parameter name for the block you are trying to modify. Additionally, verify that the block you are targeting supports the 'SimulationCommand' parameter.
Problem number 2, Another thing I found is that when I run it as "monitor and tune" the Simulink Model runs perfectly fine. When I try to run the model as "Connect" it does not run but says "Error:External Mode Open Protocol Connect command failed Caused by: Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command" Not sure what is causing this.
In order to troubleshoot this problem, you may want to check the network configuration and ensure that there are no issues with connectivity. Additionally, it's important to verify that the target application is properly configured to accept connections from XCP. This may involve checking the settings within the target application and ensuring that it is set up to communicate with XCP without any restrictions or limitations.
Furthermore, it could be beneficial to review the system requirements for running the Simulink model in "Connect" mode. There may be specific hardware or software requirements that need to be met in order for the connection to be established successfully. In some cases, updating or reinstalling relevant drivers or software components may also help resolve communication issues between the target application and XCP.
Let me know if you further assistance.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Arduino Hardware 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!