Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

watchdog Decoder

fahansen
2017-07-04
2017-07-17
  • fahansen - 2017-07-04

    Hi,

    I have an application using SoMachineV4.1 SP2 (PLC LMC058 + servodrivers LXM32). The application calculate the points and save in table (PVL.tabValores) and then this values are using in the decoder. There are two while loops in the aplication, one for calculate the points and other do fill the GEO table/execute (loop_decoder.png). Both loops are used to reduce the time between execution of the differents "steps" of the movement.The loops are in different tasks. Im put debug boolean variables that set on when enter in the loop and reset when leave. None of those variable where set when the exception happen.

    The program works fine, but once a while the PLC got exception and stops. (Running fews days and stop).

    Tasks monitor normal cycle:

    Task monitor with exception:

    Loop decoder:

    Loop calcs:

    Thanks.

    IMG: description_exception.jpg

    IMG: task_monitor_without_EXCEPTION.jpg

    IMG: task_monitor_WITH_EXCEPTION.jpg

    IMG: loop_decoder.png

    IMG: loop_calc.png

     
  • B.Roth - 2017-07-06

    Hello,

    could you please attach the whole project or at least the task configuration to see the properties(cycle time etc) ,do you have activated a watchdog for the decoding task?
    With LMC058 you have to be careful with while loops.

    Bruno

     
  • fahansen - 2017-07-11

    when took those pics the task configuration were:
    Motion
    priority: 1
    type: External Can1_Sync
    watchdog enabled: true
    watchdog time: 250ms
    sensitivity: 2

    Can0_Sync:
    priority: 2
    type: External Can0_Sync
    watchdog enabled: true
    watchdog time: 300ms
    sensitivity: 1

    Decoder
    priority: 3
    type: Cyclic
    interval: 10ms
    watchdog enabled: true
    wathcdog time: 300ms
    sensitivity: 2

    Mast
    priority: 15
    type: Freewheling
    watchdog enabled: true
    wathcdog time: 1000ms
    sensitivity: 2

    Task_26
    priority: 26
    type: Cyclic
    interval: 1000ms
    watchdog enabled: true
    wathcdog time: 1000ms
    sensitivity: 5

    Because of the max time of the decoder task, I create a new task moving some POU of the decoder task. Also changeg the decoder interval but keeps doing watchdog in a while.
    The new task must use in short interval have a pulse counter inside.

    Decoder
    priority: 3
    type: Cyclic
    interval: 30ms

    Task_04
    priority: 4
    type: Cyclic
    interval: 10ms
    watchdog enabled: true
    wathcdog time: 1000ms
    sensitivity: 5

     
  • josepmariarams - 2017-07-11

    Hi.

    The thing that I will do is move all for loop code to the assync task, and start this code via an execute-done method.

    I make all my trajectory calcs, read-write files,... in the assync task.

    Enviat des del meu Aquaris M5.5 usant Tapatalk

     
  • B.Roth - 2017-07-12

    Hello,

    you should use on LMC58 a lower prio for the Decoder-Task > 15 then also increment the cycle-time e.x. to 40ms and disable the watchdog.
    Also a freewheling task (Mast) on this controller is not a good idea this could also block other tasks which leads to a wachtdog.

    Bruno

     
  • fahansen - 2017-07-17

    I split the loop of the decoder task in other task calling by event.
    Also changed the MAST task to cyclic and the priorities.

    The wacthdog exception is not happing since those changes.

    Thanks a lot for helping.

    BR.

     

Log in to post a comment.