Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
338
 
Writing and Executing Motion Programs 
Staying Ahead of Executing Line 
The key to the handling of a rotary program buffer is knowing how many lines ahead it is; that is, how 
many program lines have been loaded ahead of the program line that PMAC is executing.  Typically it 
will load ahead until a certain number of lines ahead is reached, and then wait until the program catches 
up to within a smaller number of lines ahead.  A real-time application may just work one line ahead of the 
executing line; an application doing periodic downloading of a huge file may get 1000 lines ahead, and 
then start again when the program has caught up to within 500 lines. 
PR Command 
There are several ways of telling how far ahead it is.  First is the PR (program remaining) command, 
which returns the number of lines ahead.  This provides a very simple polling scheme, but one that is 
probably not good for tight real- time applications. 
BREQ Interrupt 
For tightly coupled applications, there are hardware lines to handle the handshaking for the rotary buffer, 
and variables to control the transition points of the lines.  The BREQ (Buffer Request) line goes high 
when the rotary buffer for the addressed coordinate system wants more program lines, and it goes low 
when it does not.  This line is wired into PMAC-PC’s programmable interrupt controller, so it can be used 
to generate an interrupt to the host PC.  (See Using the PMAC-PC to Interrupt the Host PCof this 
manual.)  The complement, BREQ/, is provided on the JPAN connector.  In addition, there is a Buffer 
Full (BREQ/) status bit for each coordinate system. 
I17 Stops Interrupts 
Variable I17 controls how many lines ahead the host can load and still get BREQ true.  If a program line 
is sent to a rotary buffer, BREQ is taken low, at least temporarily.  If still less than I17 lines ahead of the 
executing line, BREQ is taken high again, which can generate an interrupt.  If it is I17 or more lines 
ahead, BREQ is left low.  When a rotary program buffer is entered with OPEN ROT or the addressed 
coordinate system is changed, BREQ is taken low, and then set high if the buffer is less than I17 lines 
ahead of the executing point. 
I16 Restarts Interrupts 
Variable I16 controls where BREQ gets set again as the executing program in the rotary buffer catches up 
to the last loaded lines.  If after execution of a line, there are less than I16 lines ahead in the rotary buffer, 
BREQ is set high.  This can be used to signal the host that more program lines need to be sent. 
By using these two variables and the BREQ line for interrupts, an extremely fast and efficient system can 
be created for downloading programs in real time from the PC.  
If the Buffer Runs Out 
If the program calculation catches up with the load point of the rotary buffer, there is no error; program 
operation will suspend until more lines are entered into the rotary buffer.  Technically, the program is still 
running; a Q or A command must be given to truly stop the program. 
If PMAC is in segmentation mode (I13>0) and is executing the last line in the rotary buffer, as long as a 
new line is entered before the start of deceleration to stop, PMAC will blend into the new move without 
stopping. 
Closing and Deleting Buffers 
The CLOSE command closes the rotary buffers just as it does for other types of buffers.  Closing the 
rotary buffers does not affect the execution of the buffer programs; it just prevents new buffered 
commands from being entered into the buffers until they are reopened.   
DELETE ROT erases the rotary buffer for the addressed coordinate system and de-allocates the memory 
that had been reserved for it.