Jump to content
OMRON Forums

Finding the current step/line in a program


PaulOfCinci

Recommended Posts

I need to be able to tell what step/line in the program the PowerPMac is currently on, how do I do this? One of our requirements is that we can edit a program on the fly, so we need to be able to stop it, clear the buffer, load the new edited program, and then continue where we left off.
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

There are 2 sections to your question:

1. How to find out which section of the code is being calculated/executed?

2. How to jump to a section of the program.

 

The answer for the first question is use of "Synchronizing line labels". Each line of the motion program can have a user defined number associated with them (like N135 X10 Y20 or N1903 DWELL 10). At any given moment of execution Coord[x].Ncalc contains the value of the line label of the most recently calculated motion program line with a synchronizing line label (e.g. 560 if the most recent label were N560) and Coord[x].Nsync contains the value of the line label most closely preceding the presently executing or most recently executed move in a motion program (e.g. 740 if the most recent label were N740).

 

The answer to the second question is use of "Program line jump label". This is a numeric “jump” line label that permits the flow of execution of a motion program to jump to that line with a goto, gosub, callsub, call, G, M, T, or D program command or a B on-line command. Note that a colon must immediately follow the constant (no spaces) for this to be treated as a jump label. Without the colon, this is treated as “synchronizing status” label. It is valid to have both types of labels on a single line if both functionalities are desired.

 

Now if you want to combine these functionalities, you have to prepend each line of the code with Nxx: Nxx where xx is both line jump label and synchronizing line number. If the user decides to interrupt the execution, use a Pause or Quit in order to stop the program execution while remaining on the defined trajectory. Once the motion has stopped, check the Coord[x].Nsync to figure out which line of code was recently executed. Then allow the user to edit the file after that executed point, renumber and download the file. Remember that before downloading the program, you have to Abort the other Paused or Quit program in order to clear and release the buffer. There are more details involved depending on the type of application such as making sure all the outputs, motion modes and everything is matching the previous state of the machine when the execution was interrupted.

Link to comment
Share on other sites

  • 1 year later...

Dear Mr. Sina,

Is there any similar option available in Turbo PMAC? If not can you suggest me a way to display the executing line in the GUI. I don't need the "Jump to a section" option. In my GUI, I use both Rotary and Motion program buffer.

Link to comment
Share on other sites

Dear Mr. Sina,

Is there any similar option available in Turbo PMAC? If not can you suggest me a way to display the executing line in the GUI. I don't need the "Jump to a section" option. In my GUI, I use both Rotary and Motion program buffer.

 

Hi, Raghav

 

I suggest to use synchronous M-variables.

 

You can add synchronous M-variables at the front of the every single line.

 

This is example.

 

M100->*

 

OPEN PROG 1 CLEAR

 

...

M100==1 X 10

M100==2 X 5 Y 20

...

CLOSE

 

Then you can monitor "M100" variable in you GUI.

 

I hope this may be help to you.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...