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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
Hi Kim,
I've send you an email accoring this.
BR
Edwin
Update:
This seems to be working in v3.5.6.10 so most probably no longer an issue.
Hi.
i have the same problem.
Thank you
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.
i would recommend to check the plc log..
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_CheckAxisCommunicationfunction block (FB).2. If
CheckAxisCommunication.eComStateof the axis is equal to or higher thanSMC_CommunicationState.SMC_COMSTATE_BASE_COM_INITIALIZATION, then3. Use the
SMC3_ReinitDrivefunction 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
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