Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding the current step/line in a program
#1
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.
Reply
#2
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.
Sina Sattari
Hardware Engineering Manager
Delta Tau Data Systems, Inc.
Reply
#3
Thanks!
Reply
#4
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.
Reply
#5
(07-28-2013, 06:06 AM)Raghav Wrote: 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)