Hi Caly,
The issue you're encountering with scattered data points and "square waves that have many holes in it" could be due to several factors ranging from the way the TCP/IP connection is set up, to the processing of the incoming data stream in Simulink. Here are few things that you can try at your end:
On TCP/IP side:
- The default buffer size might be too small, leading to data loss. Increase the buffer size to ensure that all incoming data can be accommodated.
- If the block is in non-blocking mode, it might not wait for enough data to arrive before proceeding, leading to "holes" in your data. Try setting it to blocking mode.
Simulink Model configuration:
- The execution rate of the Simulink model might be too slow to process the incoming data in real-time. Try increasing the fixed-step size.
- If the data is sent in chunks, make sure that your processing script or Simulink model is correctly reassembling these chunks into a continuous stream.