Get Real-time data from sensor program in C and catch it in Real-time Windows Target using UDP protocol

조회 수: 1 (최근 30일)
hi all,
i have a sensor that is run with C program to collect the data, but i need to do processing in simulink (RTWT) to get real time data, as we know No Windows API functions are supported with RTWT,, so can i sent through UDP protocol in C then catch the data in RTWT also through UDP protocol and achieve real-time??
or any suggestion??
thanks

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 6월 16일
You might be able to use the Packet I/O or Stream I/O blocks from the Real-Time Windows Target library to achieve this. However, you can only communicate with supported hardware.
  댓글 수: 2
Luhur
Luhur 2011년 6월 16일
yes i have done it, but the only thing i get from my sensor is RAW data (before decoded), thats why i chose the C code, because in the C programming, they (distributor) have already maintain the encode and decode of this sensor,, so i think, the easy part is just sending the result data from C through UDP and catch it in UDP block in simulink. HOW bout that??
so, in the RTWT maybe only the block packet input or stream input.
Kaustubha Govind
Kaustubha Govind 2011년 6월 17일
Essentially, what you'd like to do is use your own custom driver for the output blocks. Although this is possible (see http://www.mathworks.com/help/toolbox/rtwin/ug/bqxlll1.html for information), I have reason to believe that creating your own RTWT drivers is not easy.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by