0
Under review

S7 Interface 100% CPU when no connection to PLC is available

Virgar Poulsen 3 weeks ago in realvirtual.io Starter and Professional updated by Support 2 weeks ago 7

How can we prevent a 100% CPU usage, when no plc is connected ?

My setup requires PLC to come in and out of the network, and every time the PLC goes out of the network, the CPU reaches 100% within 2 minutes. 

Answer

Answer

Ok will check this afternoon and send you here with a private message a new beta script.

+1
Under review

Hi, this setup is not considered in the current implementation. We need to implement a non blocking reconnection method to the S7. We will implement it for the next release.

Would you be able to test if I am sending you a beta implementation of the new interface code? This would be very kind because at the moment I don't have a S7 here available on my table.

Answer

Ok will check this afternoon and send you here with a private message a new beta script.

I replaced the old script, but I have the same error.   On first run of UnityScene, the S7 Interface component is being disabled.  If I enabled it in run mode, that's when the cpu quickly winds up to 100%       - I'm be no means an expert on this, but could it be that you need to implement IDisposable into S7Client, and wrap the "Client = new S7Client" like so:   using(var Client = new S7Client), so that the garbage collector can take care of it ?

ok thanks, will need to check the enabling in run mode. 

I think we need to check on your computer. Do you have a time slot tomorrow morning?