Sending Different Sized Integers together over TCP/IP
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to send a data packet in binary to a remote device via TCP/IP. The data packet format consists of a series of 8 bit unsigned integers and 16 signed integers that need to be sent together in twos complement representation. I am using fwrite to send binary data to the device. However, I can only write with one type of precision at a time. Are there other commands which I can use to send these different precision types together in one packet?
댓글 수: 0
답변 (1개)
Nathan Crosty
2013년 7월 23일
편집: Nathan Crosty
2013년 7월 23일
You might look into "packing" your values of different types using a structure and sending that, then of course unpacking them on the receiving end.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!