Recently I am facing an issue when using BRSE_CSV library. I am generating 2 files simultaneously but in some instances the PLC goes into service mode when generating(saving) csv file.
I am saving around 80 variables in both files together.
I have kept 512Kb of max memory size and 1 row max scan per cycle.
I have created a new task class for this task so that I don’t encounter memory issue.
But still in some cases or instances the PLC goes to service mode. It would be great for some suggestions and help in this case. Hope for your replies.
At first you should check the logger of the PLC to identify the reason for the service boot.
Common reasons related to custom application code are cycle time violation and page faults, but also other critical system events like missing monitored hardware can lead to service mode.
Here in the community, the’re already some helpful posts about how to diagnose service mode, especially if it’s a page fault I suggest first to read this post: Troubleshooting Page Faults
Thanks for your insights, The logger shows Divide zero error for this case. The probable fault I observed was that the BRSE_CSV_Open function block was in error for zero file length because of which the PLC was getting to service mode. Any suggestions on this if possible
because BRSE_CSV library is not a official B&R library delivered together with Automation Studio, may I asked if you have the source code of this library also (sorry, I don’t know this library in detail)?
→ If yes, are there backtrace information inside the logger on the division by zero error? And do backtrace information have “green arrows” pointing to a code position?
About logger backtrace, please see this link for explanation.
If you have “green arrows” inside the backtrace, you can double-click them and then you’ll be forwarded to the code positions where the arrows point to (that’s the reason why I asked if you have the source code).
Maybe somewhere in the code the length information of the named function block is used in some calculation (when the function block was in error because of zero filelength, and filelength = 0 is used as denominator in a calculation, this could lead to a division by zero exception)?
Hello,
Thanks Alexander for your excelent Debugging guide!
I just want to mention, that it might be an posibility to switch to a B&R Standard Library.
I think the “MpRecipeCsv” or “MpRecipeXml” will do mostly the same like BRSE_CSV.
It looks like you got some good answers from Alexander and Michael, and it has been a couple of weeks since the last activity on this post. If the answers helped you with your question, can you help the next person with the same question by marking the solution on the information which helped you the most. If you still have open questions on this topic, can you provide an update?