TwinCAT 3 console message display

610 views Asked by At

ADSLOGSTR(msgCtrlMask := ADSLOG_MSGTYPE_LOG, msgFmtStr := 'OSIO: %s', strArg := 'Autostrsys');

I'm using this function in TwinCAT 3, but when I'm running my code it's getting hanged because of ADSLOGSTR function. If I'm commenting this then it's working fine but in that case I'm not able to see messages.

Why system is hanging because of this message display function(ADSLOGSTR)?

1

There are 1 answers

1
Jakob On BEST ANSWER

My guess is that you are calling the function at every cycle. You need to make sure to only call it once, like so:

IF NOT bAdsLogStrBeenCalled THEN
    ADSLOGSTR(...);
    bAdsLogStrBeenCalled := TRUE;
END_IF