Real-Time USB Enumeration
Mostrar comentarios más antiguos
I am developing a HIL test platform utilizing Simulink Real-Time. The hardware communicates via USB-to-serial ports, and I am currently communicating via the Legacy Serial block and selecting "USB Serial Port 1" for the first device. There are multiple hardware devices in the architecture that communicate by the USB serial ports, so they are being further enumerate 2, 3, ...
In certain test scenarios hardware device 1 might be simulated in mathworks, and the hardware completely removed. I am using a switch case to select the factory/simulation code type and maintain the Serial block within the model. I then get a this error at deployment "USB serial port 1 error: No such file or directory".
If the platform and controller are completely power cycled I see the device that was USB Port 2 is now enumerated as USB Serial Port 1. This causes the code that was assigned as Port 2 to not function correctly (and wont deploy). I was able to utilize a switch case for selecting between multiple Legacy Serial blocks, but this fails to deploy if those other ports are not connected.
How do to I configure the code and hardware to overcome these limitations?
- Can I make the USB Serial enumerations static, linked to attribute such as model or serial number?
- How do I deploy code (if using a variable and switch case for multiple serial blocks) that ignores the absence of devices at the USB serial port.
Respuestas (0)
Categorías
Más información sobre Simulink Real-Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!