How can I sovle this error in building a simulink model using M-target for Bachmann PLC?
8 views (last 30 days)
Show older comments
Why do I receive an " Undefined function or variable 'auto'"error?
problem discription:
The call to m1target_make_rtw_hook, during the before_make hook generated the following error:
Undefined function or variable 'auto'.
The build process will terminate as a result.
this simulink model is builded for bachmann PLC,what is the solution?Thank you very much.
3 Comments
Alexander
on 7 Oct 2025
We might had the same issue in the past, but do not know the exact solution anymore, but maybe try these:
cs = getActiveConfigSet(bdroot);
try, get_param(cs,'SystemTargetFile'), end % should be 'm1target.tlc'
try, get_param(cs,'Toolchain'), end
try, get_param(cs,'TemplateMakefile'), end
if any of those prints "auto", try to set it explicitly in the model configuration:
- Check that only one configuration exists for your model (+ delete inactive configurations)
- Use explicit toolchain / TMF (no “auto”)
Open Configuration Parameters → Code Generation:
- System target file: set explicitly to m1target.tlc.
- If you have the Toolchain workflow: pick the Bachmann toolchain explicitly (do not leave “Auto”).
- If you have the older Template makefile workflow: pick the M-Target TMF explicitly (not “auto”/blank).
--> Else try to search for mask or model parameter (auto) without quotes in any block. Search with commenting out blocks. Once we had an issue with "parameter" inside a misconfigured simulink block.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!