Issues with Signal Interruption in high frequency Simulink OPC UA Real-Time Latency Test

12 visualizaciones (últimos 30 días)
Hello Community,
I'm working on a Simulink program to test the real-time latency of OPC UA communication in our network. Here’s a brief overview of my setup:
  1. I generate a continuously increasing (amplitude) signal at a frequency of 100 Hz.
  2. This signal is sent to an OPC UA server using an OPC UA Write block.
  3. I receive this signal back within the same program via an OPC UA Read block.
  4. Both the generated signal and the received signal are logged along with their respective real-time timestamps (time sent vs. time received), and then plotted.
However, I've noticed an issue: The Write graph sometimes experiences a small interruption of about 0.02 seconds, during which the frequency does not hold. This occurs sporadically over a 2-second simulated time, and isn't periodic. The Read graph also reflects these interruptions, mirroring the behavior seen in the Write graph.
One hypothesis is that these interruptions might be related to the ticks counted by the Real-Time Sync block. Within the 2-second simulated timeframe, I observe around 4000 to 6000 ticks counted by the block.
My questions:
  • Could these signal interruptions be due to the tick count or timing behavior of the Real-Time Sync block?
  • Has anyone else experienced similar issues with OPC UA in Simulink, or are there any adjustments you’d recommend to improve timing accuracy and minimize interruptions?
Any insights or suggestions would be greatly appreciated. Thank you!

Respuestas (1)

Ruchika Parag
Ruchika Parag el 25 de Nov. de 2024 a las 10:07
Hi @Philipp Morlang, signal interruptions in a Simulink model using OPC UA communication can be caused by several factors, including timing issues, network latency, and the configuration of the Real-Time Sync block. Here are some potential causes and solutions to consider:
1. Real-Time Sync Block: This block is supposed to keep your model running in sync with real-world time. If it is not set up right, it might be causing those timing hiccups. Double-check its settings to make sure they are aligned with what your system needs.
2. Network Latency: OPC UA communication can slow down if your network is busy or has limited bandwidth. It's worth checking if the network is overloaded or if there are any issues with the network hardware.
3. CPU Load: If your computer is doing too many things at once, it might struggle to keep up with the real-time demands of your Simulink model. Monitor the CPU usage to see if that's the case.
4. OPC UA Server Performance: The server itself might be a bottleneck. Ensure it's running efficiently and is capable of handling the data rate you're working with.
5. Data Handling: Make sure the OPC UA blocks are set up to manage the data flow correctly. If they're not, you might see interruptions in the signal.
In order to improve the issue, please consider the following options:
1. Optimize Your Network: If possible, use a dedicated network for your OPC UA communication to reduce interference from other network traffic.
2. Streamline Your Model: Simplify the model to reduce the load on your system. Refer to the following MathWorks documentation to read more about how to to identify bottlenecks and optimize your model : https://www.mathworks.com/help/simulink/slref/simulinkprofiler.html
4. Check Data Rates: Make sure both the OPC UA server and client can handle the data rate you need. Adjust buffer sizes if necessary to prevent data loss.
5. Log and Analyze: Keep detailed logs of the send and receive times to pinpoint where delays are happening. This can help you figure out what is causing the interruptions.
6. Test on Different Hardware: Please try running your setup on another machine to see if the problem persists. This can help determine if the issue is hardware-related.
By addressing these areas, you should be able to improve the timing accuracy and reduce the interruptions.

Community Treasure Hunt

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

Start Hunting!

Translated by