Calling changeFBExecutionState(cg_nMGM_CMD_Stop) on the E_RESTART instance does not actually stop the application.
I can make an application stop by calling sendOutputEvent(E_RESTART::csm_nSTOPID) on my E_RESTART instance (with my start function being a friend of E_RESTART). It does stop the application, but does not increment the monitored STOP output of the E_RESTART function block shown in the 4DIAC IDE.
Maybe what I want to do is not possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, it seams that you found an issues in E_RESTART. The problem is that the STOP command deactivates to early the event handling so the sending of the STOP event is not peferformed. I'll try to get you an updated version of the E_RESTART later this day.
Alois
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, but the result is the same. I can now use changeFBExecutionState(cg_nMGM_CMD_Stop) rather than call sendOutputEvent(E_RESTART::csm_nSTOPID) directly. The application stops, but the monitored E_RESTART STOP output does not change from zero.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've attached a 4DIAC view of the simple test app I'm using. Each of COLD, WARM, STOP E_RESTART outputs are connected to E_CYCLE blocks. The snapshot shows the view after deployment and stop.
That is strange because sendOutputEvent should definitly result in an increas in the count. How are you invoking the changeFBExecutionState(cg_nMGM_CMD_Stop)? Is there a way that I can recreate it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in this code you are sending a stop command to the E_RESTART of the RMT_RES. With that you will shutdown the communication between 4DIAC-IDE and the FORTE as this will result in an INIT- event for the SERVER FB that is located in the DM_KRNL FB. The result of this is that 4DIAC IDE will not got monitoring updates.
The RMT_RES will be correctly shutdown on the shutdown of the device. In other cases you should not do anything withit. Therefore RMT_RES is also not available through managment commands to be changed by the tool (e.g., you can not add FBs or monitor it).
I think what you should do is to get the fbList of the DEV and search there for the RES with your name. Or maybe all Resources there and stop the E_RESTARTS in them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note there is an error in the E_RESTART::executeEvent function that you supplied earlier. if csmSTOPID == mEventToSend then the changeFBExecutionState should be cg_nMGM_CMD_Stop.
Last edit: Nishchal Kush 2015-10-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Calling changeFBExecutionState(cg_nMGM_CMD_Stop) on the E_RESTART instance does not actually stop the application.
I can make an application stop by calling sendOutputEvent(E_RESTART::csm_nSTOPID) on my E_RESTART instance (with my start function being a friend of E_RESTART). It does stop the application, but does not increment the monitored STOP output of the E_RESTART function block shown in the 4DIAC IDE.
Maybe what I want to do is not possible?
Hi, it seams that you found an issues in E_RESTART. The problem is that the STOP command deactivates to early the event handling so the sending of the STOP event is not peferformed. I'll try to get you an updated version of the E_RESTART later this day.
Alois
Please find attached an updated version of E_RESTART which should handle your situation correctly. Could you be so kind and give it a try.
Thanks, but the result is the same. I can now use changeFBExecutionState(cg_nMGM_CMD_Stop) rather than call sendOutputEvent(E_RESTART::csm_nSTOPID) directly. The application stops, but the monitored E_RESTART STOP output does not change from zero.
I've attached a 4DIAC view of the simple test app I'm using. Each of COLD, WARM, STOP E_RESTART outputs are connected to E_CYCLE blocks. The snapshot shows the view after deployment and stop.
Last edit: Nishchal Kush 2015-10-26
That is strange because sendOutputEvent should definitly result in an increas in the count. How are you invoking the changeFBExecutionState(cg_nMGM_CMD_Stop)? Is there a way that I can recreate it?
Last edit: Nishchal Kush 2015-10-27
Hi,
in this code you are sending a stop command to the E_RESTART of the RMT_RES. With that you will shutdown the communication between 4DIAC-IDE and the FORTE as this will result in an INIT- event for the SERVER FB that is located in the DM_KRNL FB. The result of this is that 4DIAC IDE will not got monitoring updates.
The RMT_RES will be correctly shutdown on the shutdown of the device. In other cases you should not do anything withit. Therefore RMT_RES is also not available through managment commands to be changed by the tool (e.g., you can not add FBs or monitor it).
I think what you should do is to get the fbList of the DEV and search there for the RES with your name. Or maybe all Resources there and stop the E_RESTARTS in them.
Thanks. The functional stop operation is:
Note there is an error in the E_RESTART::executeEvent function that you supplied earlier. if csmSTOPID == mEventToSend then the changeFBExecutionState should be cg_nMGM_CMD_Stop.
Last edit: Nishchal Kush 2015-10-29
Thanks for noting the error. I will fix this and push it to the repository.
What I forgot to ask is if it works now correctly?
Yes, it is now working.
ah good.