Hilscher Community Forum
Profinet Bus Failure - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: Profinet Bus Failure (/thread-248.html)



Answer - Schranz - January-19th-2018

During the last month testing a netPI running Node_RED I encountered twice a profinet failure (LED ERR Red Solid).
Is there somewhere a log file, which could give me some more information what could have caused the error?


Answer - Armin@netPI - January-19th-2018

The current source code example implementation in Node-RED does not allow to look closer to the error that happened. It is of course possible to extened the source code.

But I know this error very well and know when it happens. You have to know that once started the netX51 network controller runs a watchdog to monitor its user application - in our case Node-RED - if it is still running. If now during normal operation Node-RED crashed by any reason, or you slowed down Node-RED too much, or you simply call a "kill $PID" with $PID as process ID of Node-RED then Node-RED and the fieldbus node does not have any chance to trigger the watchdog in time and netX51 automatically goes into this fail state. This is the only error that can happen.

Node-RED is an application that is running in a single thread. So once you program an infinite loop in javascript for example with no return, this will lead to such an error.

What else can you tell us when you see this error happened? Was it happening during experimentation phase, during complex data aggregations in Node-RED? When did it happen in your case?


Answer - Schranz - January-22nd-2018

In one case it happened at startup. Within the fieldbus node I found following information:

Edit fieldbus in node
!Last Error -2146697183
!Description xChannelIORead return error 2148270113(0x800c0021) [COM-flag not set]

Edit fieldbus out node
!Last Error 2148270113
!Description xChannelInfo return error 2148270113(0x800c0021) [COM-flag not set]

From my own log within Node-RED I can tell, that Node-Red itself was running.

Any help is much appreciaped



Answer - Armin@netPI - January-22nd-2018

Well the Error "COM-Flag not set" is a common error that just tells that the netX chip is expected to start process IO data exchange with PROFINET by indicating this with a special bit named "COM" = communication running. But this bit is not coming by any reason.

That Node-RED is running or not after the error happened can still mean that starting Node-RED and its application still consumed more time than the watchdog time is set.(1000msec by default). So netX is very strict monitoring the time. If it expires netX stops communication in all cases. Only deploying the Node-RED flow again recovery from this error.


Answer - Schranz - January-22nd-2018

What do you mean with 'this bit is not coming by any reason'.
Also could I somehow measure the execution time of my flows within Node-Red.


Answer - Armin@netPI - January-22nd-2018

To keep the interface to Node-RED very very very simple, the only bit Node-RED is looking for is the "communication" bit of netX, which indicates that netX is exchanging cyclic process data with the PLC master or not. In your case the bit is not set because the netX is in watchdog error. And it will never come again until netX is reset by the fieldbus node due to a Node-RED deploy.

Node-RED does not embody any time measurement function. If you want a reliable result with an application and netX then you have to write indeed your own application as we did it with the Docker image https://hub.docker.com/r/hilschernetpi/netpi-netx-programming-examples/. This Docker image embeds a "c" source code on how to program netX as PROFINET IO device with an own application. In such an application you can of course make time measurements yourself and you get predictable results far better than with Node-RED.

Another solution can be to disable the netX watchdog. Then netX will never go into an error state and waits endlessly for new application data.



Answer - Schranz - January-23rd-2018

Where could I disable the netX watchdog. Would it be also possible to increase the time instead of disabling it.


Answer - Armin@netPI - January-23rd-2018

Yes you can change the value to any value you want.

I think you have recognized that the Fieldbus Nodes are configured via web-configurator-fieldbus HTML pages. On the github source code project the whole web confgurator project in a zip file that is extracted when the Docker image is build. When you unzip it you find a folder named WebConfigurator V1.0200.725\PROFINET_IO\Device\WebContent\Structures\ and a file "ConfigurationStruct.js". In this file you find the default settings of the profinet configuration data including the watchdog time. There you find the "this.WdgTime = 1000" as default value setting the watchdog time to 1000msec. Change it to any value you want.