As the light curtain deactivates the drive, the green option does not help you because the safety signals deactivate the drive (and therefore unit does not stay in ExecState RUNNING).
You can try:
If light curtain accessed, set Axis.Execute:=FALSE.
Then set Axis.ParImm.Enable:=FALSE (currently Enable FALSE will internally be executed after the command cancel, but it is planned to change this behaviour).
If light curtain is free again, set AxisParImm.Enable:=TRUE
Then start axis command again.
... View more