- Update MATLAB: If you are not using the latest patch/update of MATLAB R2020a, consider updating it. Sometimes these types of errors are fixed in subsequent patches.
- Check for External Customizations: Ensure you haven't made any custom modifications or added any custom TLC scripts that might be interfering with the ASAP2 generation process.
- User-defined Function: From the error, it appears there is a call to `ASAP2UserFcnWriteStructMeasurement` which may not be functioning as expected. Ensure that if this is a custom-defined function, it's correctly defined and accessible.
- Model Settings: Ensure that your model's settings related to ASAP2 generation are correctly configured. Sometimes, misconfigurations or inconsistencies in settings can lead to such errors.
- Use a Simplified Model: Try generating the ASAP2 file for a simpler Simulink model to see if the issue is related to your specific model or a general MATLAB issue. If a simple model works fine, incrementally add complexity to isolate the problem.
- MATLAB Support: Given that the error arises from MATLAB's internal files (`asap2lib.tlc`), it might be worthwhile to contact MathWorks support. They might be aware of this issue and could offer a direct solution or workaround.
- Fresh MATLAB Installation: As a last resort, if nothing else works, consider reinstalling MATLAB. Sometimes, corrupted installations or certain files can lead to unexpected errors.
Errors in ASAP2 Generation: Attempt to call a non-function value
조회 수: 10 (최근 30일)
이전 댓글 표시
I'm trying to get simulink to generate an ASAP2 data exchange interface. When I try to build the model, I keep getting this error
--------------------------------------------------------------------------------------------------------------------------
### Creating ASAP2 file: "filename".a2l
Error: File: C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc Line: 1325 Column: 56
Attempt to call a non-function value: ASAP2UserFcnWriteStructMeasurement Main program:
==> [00] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc:FcnLoopThruDWorks(1325)
[01] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc:SLibASAP2WriteDynamicContents(31)
[02] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2main.tlc:<NONE>(88)
Error: File: C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc Line: 1325 Column: 43
Values of NULL type cannot be expanded Main program:
==> [00] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc:FcnLoopThruDWorks(1325)
[01] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2lib.tlc:SLibASAP2WriteDynamicContents(31)
[02] C:\Program Files\MATLAB\R2020a\rtw\c\tlc\mw\asap2main.tlc:<NONE>(88)
---------------------------------------------------------------------------------------
Does anyone know how to fix this?
댓글 수: 0
답변 (1개)
Mrutyunjaya Hiremath
2023년 10월 24일
The error seeing appears to be a TLC (Target Language Compiler) error when MATLAB/Simulink tries to generate an ASAP2 file. TLC errors can sometimes be a bit cryptic, but from the error messages you provided, it seems that there is an issue with a function call or the value being used within the `asap2lib.tlc` file, which is part of MATLAB's code generation process.
Here are some steps that can take to troubleshoot and potentially resolve this issue:
Finally, when dealing with such errors, always ensure backups of work and important files. This way, can experiment with different solutions without the fear of losing any data.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!