Beckhoff-USA-Community / SPT-Libraries

MIT License
70 stars 16 forks source link

FB_BasicAxis - comprehension question #9

Closed vanoo1983 closed 1 year ago

vanoo1983 commented 1 year ago

Hi,

I have a question about the FB_BasicAxis. In the Interface I_BasicAxis there is a method Stop. This method calls the FB MC_Halt. The FB MC_Stop is not used in your library. Why don't you differentiate between halt and stop?

My idea is to use a MC_Stop for safety reasosns for example for a quickstop and MC_Halt for a normal stop in the process.

It is not clear from the interface that the method Stop executes an MC_Halt. Made me confused. Maybe it would be more clear if you would have a Stop and a Halt in the interface and call the PLCopen blocks accordingly.

Thanks for sharing your ideas behind

Silvano

nshiggins commented 1 year ago

Hi Silvano,

Not a bad suggestion, but in general I think your application logic should take care of not interrupting MC_Halt with another motion command. We will discuss and see about adding an additional method.

If the idea is to enforce the blocking of further motion commands for safety reasons, we will need to come up with a different calling convention for this method, as internally when an FB is executed it will automatically clean itself up (collect any error info, call FB with Execute:=FALSE) after the Busy bit goes low. In the case of MC_Stop, Busy stays high until Execute:=FALSE. So, we would need to have some way for the programmer to explicitly release the MC_Stop command (method argument? additional release method?)

The most robust way to initiate a quick stop (in response to TwinSAFE, for example) is to let the NC do it and take PLC logic out of the equation: InfoSys: Fast Axis Stop

nshiggins commented 1 year ago

Discussed with the other developers and it was decided to leave this as-is for now.

Thanks for the suggestion!