0

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 Answers1

0

Without seeing the complete example, we all have to guess what is wrong.

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

For future reference: https://stackoverflow.com/help/how-to-ask

Jakob
  • 1,288
  • 7
  • 13
  • Thanks @Jakob I tried with if condition so that it can run one time only, and it's working fine (y). But in my scenario I want to see particular message after update of each cycle. For that can you help please. – Subhash Chandra Sep 08 '20 at 10:47