Live CAN message from Simulink to App Designer
조회 수: 6 (최근 30일)
이전 댓글 표시
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!
채택된 답변
Umar
2024년 7월 1일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!