Unrecoverable SoftMotion state after switch to PreOp

Kim
2015-07-10
6 days ago
  • Kim - 2015-07-10

    Running v3.5.3.30 in our iX TxB SoftMotion terminals.

    In order to execute a special function in our servo drives, we need to leave Operational mode and go to PreOperational mode. I do this the usual way (using a pointer to the slave):
    pSlave^.SetOpMode(ETC_SLAVE_STATE.ETC_SLAVE_PREOPERATIONAL);

    The slave wState goes to PreOp and the SoftMotion axis wCommunicationState becomes 1100 (ETC device is no longer in mode Operational). So far it seeems ok.

    I carry out my special function by doing a couple of SDO parameter read/writes, when I'm done I go back to Operational state using a sequence where I command the drive to Init, then PreOp, then SafeOp, then Op and the drive wState becomes ETC_SLAVE_OPERATIONAL, so far so good.

    But.... the SoftMotion axis is still stuck in wCommunicationState 1100 no matter what I do.
    Neither MC_Reset or SMC3_ReinitDrive helps.
    In pure desperation, I even tried doing a softreset of the EtherCAT_Master using:
    g_pFirstMaster^.xRestart:=TRUE;
    g_pFirstMaster^();
    g_pFirstMaster^.xRestart:=FALSE;
    Didn't help either, for sure the EtherCat restarts but the Softmotion axis is still stuck in 1100 and MC_Reset/SMC3_ReInitDrive still doesn't help.

    The only thing that fixes this is a warm/cold start, which ofc isn't acceptable.

    I hope I'm doing it wrong... Should I switch state in another way?
    What to do in order to obtain a correct behaviour?

    Regards,
    Kim Hansen
    Beijer Electronics Automation AB

     
  • eschwellinger

    eschwellinger - 2015-07-10

    Hi Kim,
    I've send you an email accoring this.

    BR
    Edwin

     
  • Kim - 2015-09-08

    Update:
    This seems to be working in v3.5.6.10 so most probably no longer an issue.

     
  • masterofplc - 2024-11-15

    Hi.
    i have the same problem.
    Thank you

     
  • alimans - 2025-10-22

    Hi Kim, Hi eschwellinger, how you could solve the problem? I am using Codesys V3.5.19.60 and I still have the same problem. It will work only after a warm/cold restart.
    Thank you in advance for your kind help.

     
  • eschwellinger

    eschwellinger - 7 days ago

    i would recommend to check the plc log..

     
  • alimans - 6 days ago

    For anyone still experiencing this issue, here’s how I managed to solve it:

    Symptoms:
    1. Sometimes, on the first start of CODESYS Runtime, the modules fail to run.
    2. After disconnecting and reconnecting the communication cable, the drive does not start again.
    3. MC_Reset cannot clear the fault.

    Solution (what worked for me):
    1. Check the axis communication using the SMC_CheckAxisCommunication function block (FB).
    2. If CheckAxisCommunication.eComState of the axis is equal to or higher than SMC_CommunicationState.SMC_COMSTATE_BASE_COM_INITIALIZATION, then
    3. Use the SMC3_ReinitDrive function block to reset the drive β€” and it works.

    For more information, refer to the official CODESYS documentation:
    πŸ‘‰ https://content.helpme-codesys.com/en/libs/SM3_Basic/Current/SM3_Basic/DriveInterface/AXIS_REF/SMC3_ReinitDrive.html

     
  • imdatatas - 6 days ago

    Dear @alimans,

    Additionally, As far as I know since starting from Softmotion V4.18.0.0 automatic restart behaviour for an axis has been changed for this issue. See below explanation from release notes.

    "With CODESYS SoftMotion 4.18.0.0, the behavior of SoftMotion axes after a loss of communication to the servo drive has changed. Now, an automatic reinitialization is performed as soon as the communication is established again. Before, an explicit call to SMC3_ReinitDrive had to be performed. An example for a loss of communication is that the cable to one of the drives is unplugged."

    Regards,
    imdatatas

     

Log in to post a comment.