Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ADSLOGSTR(msgCtrlMask := ADSLOG_MSGTYPE_LOG, msgFmtStr := 'OSIO: %s', strArg := 'Autostrsys');
我在 TwinCAT 3 中使用这个函数,但是当我运行我的代码时,它因为 ADSLOGSTR 函数而被挂起。如果我对此发表评论,那么它工作正常,但在这种情况下,我无法看到消息。
为什么系统会因为这个消息显示功能(ADSLOGSTR)而挂起?
没有看到完整的例子,我们都必须猜测哪里出了问题。
我的猜测是您在每个周期都调用该函数。您需要确保只调用一次,如下所示:
IF NOT bAdsLogStrBeenCalled THEN ADSLOGSTR(...); bAdsLogStrBeenCalled := TRUE; END_IF
供将来参考: https ://stackoverflow.com/help/how-to-ask