What is the correct way to read Simulink Real Time data from the Speedgoat IO504 read block?

11 views (last 30 days)
With the recent update on R2020b+ I am having difficulty with the IO504 read block. Documentation states the output from the IO504 read is “low-order byte of an unsigned 32-bit integer vector”. However the IO504 read block with a fifo bin read returns an error due to dimension mismatch. 1024 elements vs 1 element. Throwing a fifo write before the fifo bin read allows the model to run but does not give the desired result. I’m summary, what is the correct way to take the output of a IO504 read to break up into headers + data of varying size (binary)? Or must I write my own state machine to decode the data correctly?

Answers (1)

Dimitri MANKOV
Dimitri MANKOV on 9 Aug 2022
Hi Wiley,
Speedgoat recently introduced product examples in their latest Speedgoat I/O Blockset release (v9.4.1), including an example model for the IO504 module. Furthermore, several examples in the MathWorks documentation show how to deal with binary encoding/decoding (incl. headers) for serial communication protocols in Simulink Real-Time.
I hope this is helpful!
Dimitri

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!