steveneads Posted June 30, 2016 Share Posted June 30, 2016 Hi, Can someone clarify the subtleties of the timing of command execution when commands are issued from a PLC? For instance, in my old UMAC code, if I wanted to issue a command to jog or home an axis I would use something like: COMMAND"#1HOME" etc. Since this is executed as if it were an ASCII command from the terminal, I would then often use a timer to hold the PLC for a while to give time for the command to start execution etc. before moving on in the code. When I first translated my code to PPMAC, I just swapped the syntax to: cmd "#1HOME"; This seems to work fine, but can you explain how (if at all) execution is affected by using the new method of changing the line to: home 1; Why do you now have 2 ways of doing this? Does it make any change to the timing or priorities? Thanks Steve Link to comment Share on other sites More sharing options...
Omron Forums Support Posted June 30, 2016 Share Posted June 30, 2016 Hi Steve, The timing/priority does change. The online home command will not execute until after the end of the current PLC scan, same as with Turbo. The buffered program command will execute immediately. Note that when issued in a PLC (unlike in a motion program), subsequent lines will execute without waiting for the command to finish; therefore, your timer is still needed, or something like this: home3; // Start homing move for Motor 3 while (Motor[3].HomeInProgress == 0) { } // Wait for start while (Motor[3].DesVelZero == 0) { } // Wait for end Link to comment Share on other sites More sharing options...
steveneads Posted July 1, 2016 Author Share Posted July 1, 2016 Hi Greg Thanks for clarifying that. Incidentally, is there now a buffered program command for use in PLCs to replace phase finding search commands? Such as: cmd "#7$"; I didn't spot one in the manual. Steve Link to comment Share on other sites More sharing options...
kmonroe023 Posted July 1, 2016 Share Posted July 1, 2016 Set Motor[x].PhaseFindingStep = 1. This is the same as issuing the on-line $ command. The PMAC will set PhaseFindingStep to 0 at the end of the referencing process, this can be monitored in your program to determine when the phase referencing is done. Also note that Motor[x].PhaseFound will be set to 1 if the phase reference is successful. If it PhaseFound is set to 0, the phase reference was not successful. Link to comment Share on other sites More sharing options...
steveneads Posted July 1, 2016 Author Share Posted July 1, 2016 Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts