
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 15-30 minutes
Fanuc Alarm PS0111 - Macro Variable Calculation Error
PS0111 alarm occurs when a macro variable calculation exceeds allowable limits (overflow/underflow), attempts division by zero, or performs invalid mathematical operations (square root of negative number, invalid trigonometric function arguments). This is typically caused by programming errors in custom macro B programs (#variables) or incorrect macro variable values passed during execution.
Fanuc Alarm PS0111 - Macro Variable Calculation Error
Macro Variable Error
Fanuc alarm PS0111: Macro Variable Error. The part program or machine configuration has an error related to this alarm condition. Review the block indicated in the alarm screen and correct the command per the Fanuc programming manual.
Root Cause Summary
PS0111 alarm occurs when a macro variable calculation exceeds allowable limits (overflow/underflow), attempts division by zero, or performs invalid mathematical operations (square root of negative number, invalid trigonometric function arguments). This is typically caused by programming errors in custom macro B programs (#variables) or incorrect macro variable values passed during execution.
Safety
Causes and Fixes
Press ALARM button to display full alarm message and note the O-number and N-block where PS0111 was triggered. Record the exact sequence number for reference.
Navigate to EDIT mode and review the macro program at the reported block. Identify all macro variable calculations (#i=#j*#k or #i=#j+#k operations) in that block and surrounding lines.
Go to SYSTEM > MACRO > display current macro variable values. Check common variables #100-#199 and #500-#999 used in the calculation. Verify none exceed +/-99999999 or are generating exponential growth through loop iterations.
Modify the macro program to add range checking (IF[#i GT 9999999]THEN GOTO...) or insert intermediate calculations to break down operations into smaller magnitude steps. Re-test with controlled input values.
Seeing Multiple Alarms?
Seeing another alarm with this one? Enter the code.
AxisMD logs alarms against your actual machines, tracks patterns, and gives AI context your manual doesn't have.
Start freeWas this guide helpful?
Always verify with your machine manual or a certified technician before performing service procedures.