Jump to content
OMRON Forums

commands in PLCs


steveneads
 Share

Recommended Posts

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

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...