xPC Target / Commtech-Fastcomm 422/4-PCI-335F block variable length binary data

조회 수: 6 (최근 30일)
sadi 2012년 5월 10일
Hi, I'm actually using xpctarget/commtech-fastcom 422/4-PCI-335F driver block to communicate with RS485 protocol, to send and receive fixed length binary data through a port. Is there a way to send and receive varying length binary messages to a device, through a port of the driver block within a unique model? Thanks for your support. Best regards,

답변 (1개)

Gordon Weast
Gordon Weast 2012년 12월 14일
In general the message needs to have some identifier that tells you the length of the message to expect. The most common is to have a message header or preamble that changes depending on the length of the message that follows.
To receive variable length messages on xPC Target, use the FIFO read binary block in the serial IO section of xpclib. You can specify several different headers and the associated message length to expect. The block looks for that header and copies out the specified length to it's output port.


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