xPC Target / Commtech-Fastcomm 422/4-PCI-335F block variable length binary data
1 view (last 30 days)
Show older comments
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,
0 Comments
Answers (1)
Gordon Weast
on 14 Dec 2012
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.
0 Comments
See Also
Categories
Find more on Target Computer Setup in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!