Read block in Simulink OPC Toolbox causes exception

I'm using Simulink OPC Toolbox to read and write data to and from an OPC server. The OPC server is running on an Arduino Mega. (I created the server with the program OPC Server for Arduino by st4makers, link: https://www.st4makers.com.) Two Pt100 temperature sensors are connected to the Arduino (the OPC server) and this system works almost fine with Simulink, but I have two problems.

  1. Occasionally one of the temperature values drops down to zero or the two temperature readings get mixed up.
  2. Simulink freezes. When I open the diagnostic viewer, I get two kind of messages. There are pseudo real-time latency violation errors. I've read that these errors almost natural by real-time settings and you can live with them without a problem. The other message is a read error (There is also a message about an unspecified exception caused by the read block.) When I get the last error the simulation still goes on, but the temperature values won’t change anymore. The same value is read. If I stop the simulation and try to run it again a crash report pops up. The hang up of the reading blocks happens randomly. Sometime the simulation can go on two and a half hours long, but other times I can run it only 15 minutes long. The read mode is synchronous (cache), sample time is 2. I would appreciate any ideas.