Question about a couple of log entries
-
I had a printer failure last week with several consequences and I finally got to looking in the eventlog. There are two several log entries that occurred with the printer failure and I'm hoping someone can help me understand them.
HW - Duet2 WIFI
RRF - 3.5Error: Max open file count exceeded. Warning: Macro file check_limit_violations.g not found Error: Push(): stack overflow on Aux
I suspect the first error is an indication that too many macro files are "in play"> I use that term because I think it might be a count of nested macros has been exceeded, but might the count include macro's that are queued?
The second error is a mystery to my but I expect it's a consequence of the first.
Also, the troubling behaviors I noticed in my system seemed to be caused because some tool change macros were not being run. The warning is an example of one of these.
I suspect I caused the initial problem with a macro that was queued too many times and I have a fix for this.
But it seems that when this set of errors started, the machine fw skipped execution of some macros (or maybe parts of macros) and I wonder if it would be better if operation is halted when one of these errors occurs. If there are good reasons to want to continue operation after one of these kinds of errors, maybe there is some flag I can set in config.g or a print file to force a halt on error? -
undefined Phaedrux marked this topic as a question
-
Do you have a M122 report from after the problem?
-
@Phaedrux - unfortunately I don't have the M122. If I get another case of it I'll grab an M122.
I also read in a couple of old posts reporting a similar issue that a likely cause is a recursive connection withing the macros. I have a lot of macros on the system - close to 40, so posting all my code for someone else to look is not reasonable. and trying to inspect the code seems easy to miss something.
So my plan is to log threads through all my macros. I'm thinking I'll make a global variable global.call_number I'll increment it every time I start a macro and long into a special file:
time stamp, global.call_number, macro name, "starting"Then if a macro is about to use an M98, I'll log again
time stamp, global.call_number, macro name, "About run M98 P"next macro"And when the M98 returns, I log
time stamp, global.call_number, macro name, "Returned from M98 P"next macro"And finally, when the macro exits
time stamp, global.call_number, macro name, "Exiting"This should let me watch the execution thread through all my macros and hopefully help me spot any recursions.
-
@Phaedrux - follow up question. I'm in the midst of implementing my trace-macros thing and I've added a couple of additional placed where my macros might branch (and so I need to leave a breadcrumb) - calling a gcode that calls a macro - things like G32, M701, M703, M0, etc. I think I've got those covered.
My questions regards M291 S3 messages. One of the possible responses "cancels the operation in progress". This means it stops running the macro where the M291 is located. This is an exit point for the macro and I can't think of a way to capture that so I can write an entry in my trace_log.
The only thing I can think of is rewriting all my M291 S3 uses to M291 S4 and making my own OK and Cancel buttons.
Any clever options I'm not thinking of?
-
@mikeabuilder That would be a good question for @dc42
-
Thanks. I'll see if @dc42 has some trick... but I've also been thinking about the relative effort of
- Adding my trace code to existing M291 S3 commands, plus adding whatever trick might exist.
- Swapping M291 S2 for M291 S4 and using my existing bread crumbs.
The M291 swap replaces 1 line of code with three lines (the M291, plus an if statement, and an M99 (to cancel).
Any trickiness to retain the M291S3 would almost certainly require more than that.
In both cases, there is the search for M291 in multiple files and add the breadcrumb code (two lines). And this is maybe the biggest effort.
So I'll amend my request for a tricky solution to include - "only if it's dead-simple"
-
@mikeabuilder said in Question about a couple of log entries:
My questions regards M291 S3 messages. One of the possible responses "cancels the operation in progress". This means it stops running the macro where the M291 is located. This is an exit point for the macro and I can't think of a way to capture that so I can write an entry in my trace_log.
If you upgrade to RRF 3.6 you can use the new J2 option in M291.
-
Nice! Upgrading RRF has been on our list and so now it's moved to the top.
-
@dc42 - My home machine has a duet3 6HC board and is running RRF 3.6.0-rc.2 I made a quick test macros to help me understand the J2 option. I think I found a documentation error on the M291 Page.
In my testing, not using S4 without the J2 option is blocking, and any T parameter is ignored. If I use this method, I need to name a button "Cancel", then evaluate the input variable to see if the cancel button was pressed.
M291 S4 K{"button 0","button 1"} T1 P"test message" echo "returned input", input echo "returned result", result
With the J2 parameter, I can set a timeout. I evaluate the Result variable to see if either the cancel button was pressed or a timeout occurred.
With no T parameter the message is blocking
M291 S4 K{"button 0","button 1"} P"test message" J2 echo "returned input", input echo "returned result", result
According to my reading of the M291 Doc page description of the T parameter "A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Cancel button)"
When I tested this, T0 behaves as expected (blocking) but with a negative value for T, I get an error message.
M291 S4 K{"button 0","button 1"} T-1 P"test message" J2 echo "returned input", input echo "returned result", result
Error: in file macro line 1 column 35: M291: value must be not less than zero
result 2
returned input null -
I'm mostly through instrumenting all my code to enable tracing the opening and closing of macros. I have a couple of follow up questions for @dc42
The first question is regarding the error message: Error: Max open file count exceeded. What does this refer to, and what is the open file limit? My guess is the total number of open nested macros. A google AI response tells me the limit is 20, and if so this may be the source of my printer hang. I do a lot of redirection of files (maybe too much) during tool changes and when my problem happened, a user was also trying to start other macros from the touch-screen.
My second question is about M292. I see that the S parameter is the message sequence, and I wonder if there is a limit on it's value. I also send a lot of messages (also maybe too many) during tool changes and I wonder if during the course of a lot of tool changes I might hit this limit.