Model based Software Development-How to?

조회 수: 4 (최근 30일)
Gary
Gary 2022년 7월 25일
답변: Ronald 2023년 8월 2일
I have to design an embedded system that takes in 75 digital inputs and generates 40 outputs. The system interacts with the outside world through LAN. In my current design, I am using Wiznet hardware TCP/IP module, which uses all 4 sockets. I understand that no simulink model is currently available for the LAN module. My software team has already developed the requisite driver for this module and we are ready to test. Before prototyping, I was interested to simulate all of these in matlab. Could anybody help of how to get started.
btw: I need the procedure for complete workflow for design and automated verification using test cases (script based) and generate C code after testing

답변 (1개)

Ronald
Ronald 2023년 8월 2일
To get started with model-based software development for your embedded system using MATLAB, you can follow the workflow outlined below. This approach allows you to design, simulate, and automatically verify your system using test cases before generating C code.
System Requirements and Architecture:
Clearly define the requirements for your embedded system, including the desired behavior, input-output mappings, and performance constraints. Design the system architecture, considering the number of digital inputs and outputs, as well as the integration of the LAN module.
Simulink Modeling:
Create a Simulink model to represent your embedded system. Use Simulink blocks to represent the various components, including the digital inputs, outputs, and the LAN module. Implement the driver for the LAN module using MATLAB Function blocks or S-Functions.
Interface Design:
Define the interfaces between the digital inputs/outputs and the LAN module in your Simulink model. Map the inputs/outputs to the appropriate signals in the LAN module.
Test Case Generation:
Define a set of test cases that cover various scenarios and edge cases for your system. Write test case scripts using MATLAB to simulate different input conditions and verify the expected output behavior. Use MATLAB's scripting capabilities to automate the execution of these test cases.
Simulation and Verification:
Run the simulation using the defined test cases to verify the behavior of your system. Monitor the digital inputs, outputs, and LAN module behavior during the simulation to ensure correctness. Analyze the simulation results and compare them with expected outcomes from the test cases.
Code Generation:
Once your Simulink model and test cases are validated, you can proceed with code generation. Use the Simulink Coder to generate C code from your validated Simulink model. Configure the code generation settings according to your target hardware and requirements. Verify the generated C code using additional test cases if necessary.
Hardware Implementation:
Take the generated C code and integrate it with your hardware platform. Compile and build the code for your target hardware. Flash the firmware onto the embedded system.
Testing on Hardware:
Test the functionality of your embedded system on the hardware platform. Use the same test cases developed during simulation to verify the behavior of the system in a real-world scenario.
By following this workflow, you can leverage MATLAB's Simulink modeling capabilities, simulation environment, and code generation tools to design, simulate, and validate your embedded system before prototyping and deployment. If your experience does not allow you to implement this, you can seek help from software development specialists https://tech-stack.com/services/custom-software-development

카테고리

Help CenterFile Exchange에서 Test Model Components에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by