Learn FACTORYIO-MACROS with Real Code Examples
Updated Nov 27, 2025
Performance Notes
Keep logic simple-executed every frame
Avoid long chains of nested conditions
Use timers instead of frame counters
Group related logic into fewer macros
Disable unused macros for performance
Security Notes
Macros run only inside simulation-no external risk
Cannot access OS or external files
Safe sandboxed environment
Good for student and training labs
No network exposure unless using external PLC drivers
Monitoring Analytics
Use tag viewer to track values
Enable simulation step-by-step mode
Monitor timers and macro output
Check collision and sensor events
Debug via visual feedback
Code Quality
Use consistent naming for tags
Group related logic together
Avoid long nested conditions
Document logic inside macro notes
Test edge cases in simulation