xPC Target / Commtech-Fastcomm 422/4-PCI-335F block variable length binary data
조회 수: 6 (최근 30일)
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,
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.