wehg Posted July 25, 2012 Share Posted July 25, 2012 Hello, I'd like to make use of the supplied status data structure element "Motor[x].HomeComplete". I need to clear the home complete status on an encoder fault. Is there a way I can clear this bit or do I need to establish my own flag? Thanks, Wehg Link to comment Share on other sites More sharing options...
Sina.Sattari Posted July 26, 2012 Share Posted July 26, 2012 Hi Wehg, We suggest using the following PLC code for your homing. In this way, you don't have to manually set the Motor[x].HomeComplete to zero. ... Motor[2].CaptureMode=0; Motor[2].HomeVel=2; home 2; while(Motor[2].HomeComplete==0 || Motor[2].DesVelZero==0 || Motor[2].HomeInProgress==1){} ... Link to comment Share on other sites More sharing options...
wehg Posted July 26, 2012 Author Share Posted July 26, 2012 Thanks, but my desire to use it was a bit different. I want to use the home complete status to conditionally allow or inhibit a cycle start (program run) in my code. If an encoder fault occurs, I want to force the user to perform a home cycle for the respective motor, before I allow a cycle start to be executed. The home process is a separate user operation, independent of the cycle start operation. Link to comment Share on other sites More sharing options...
curtwilson Posted July 27, 2012 Share Posted July 27, 2012 The HomeComplete bit is write-protected in the Script environment, as I'm sure you have noticed. There are a couple of possible tricks you could use to clear the bit, but they should be considered tricks, so it may be best you to create your own status bit to do this. (One trick is to command a homing search move with zero or very low velocity, and abort it before it can find the trigger. This will clear the bit.) In the V1.5 firmware we are in the release process now for, a new saved setup element Coord[x].HomeRequired, if set to 1, means a program cannot start unless all motors assigned to axes in the coordinate system have their HomeComplete bits set to 1. Link to comment Share on other sites More sharing options...
wehg Posted July 27, 2012 Author Share Posted July 27, 2012 OK, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts