How to properly handle objects within level-2 Simulink S-Functions
1 次查看(过去 30 天)
显示 更早的评论
I'm attempting to use a level-2 S function to handle serial read/write to and from a device.
I need some help with two things:
- How do I handle dialogue parameter inputs? I'd like to input the specified com port.
- How can I create a serialport object that persists throughout an entire simulation? I'd like to avoid opening and closing the commport each iteration.
Thanks!
0 个评论
采纳的回答
Jan Houska
2023-4-18
Hi Zach,
while this does not directly answer your question, have you tried to use the Packet Input/Output or Stream Input/Output blocks with the Serial Port driver? These blocks from the Simulink Desktop Real-Time product library should be able to handle reading/writing serial port devices out of the box, with no programming necessary.
Jan
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Target Computer Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!