Jump to content
OMRON Forums

Rotary Buffer free


ScottB

Recommended Posts

I am trying to set up and use a rotary buffer for a motion program and I'm having trouble determining when the buffer is empty. The "ROTFREE" command in the SRM says that it will "Report number of unexecuted lines in rotary buffer". If I type:

define rotary 10000

rotfree

I get 9988, so I guess this is really returning the number of bytes free, not the number of lines remaining as the manual states.

Now if I type the following:

open rotary

N100 x10y10f100

N110 x20y20f100

n120 x30y30f200

Close

rotfree

I get 9877, which makes sense, the amount of free memory decreased. The problem is that if I issue the Run command so the program starts, the rotfree command always returns 9877, it doesn't increase as the lines are executed. If I do a "list rotary" command, the lines are gone, but the rotfree command doesn't reflect this. The only way I've found to get Rotfree to increase again is to delete the rotary buffer and define a new one (not very useful).

 

If the ROTFREE command doesn't work, how can you determine when the rotary buffer is getting empty? I noticed through Intellisense that there are Coord [].RotLine, RotFill, RotEnd status variables but these aren't mentioned in the manual at all. Is there any documentation for these?

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

A better method than the usage of the “rotfree” command would be to use the “N” synchronous program line labels (without the colon) in the rotary programs and monitor Coord[x].Ncalc and/or Coord[x].Nsync to decide when more program lines need to be downloaded.

 

Using your program:

open rotary

N100 x10y10f100

N110 x20y20f100

N120 x30y30f200

N130 x40y40f200

Close

 

Coord[x].Nsync contains the value of the line label most closely preceding the presently executing or most recently executed move. A value of 110 would indicate two lines or less are left in the buffer to execute.

Link to comment
Share on other sites

A better method than the usage of the “rotfree” command would be to use the “N” synchronous program line labels (without the colon) in the rotary programs and monitor Coord[x].Ncalc and/or Coord[x].Nsync to decide when more program lines need to be downloaded.

 

Using your program:

open rotary

N100 x10y10f100

N110 x20y20f100

N120 x30y30f200

N130 x40y40f200

Close

 

Coord[x].Nsync contains the value of the line label most closely preceding the presently executing or most recently executed move. A value of 110 would indicate two lines or less are left in the buffer to execute.

 

Steve,

Thanks for responding. I ended up calculating the free memory by using the Coord[].RotStore and Coord[].RotExec values, but I am going to change my logic to use Nsync instead.

 

Scott

Link to comment
Share on other sites

A clarification on the response to the "rotfree" query:

 

Power PMAC responds with the size of the largest continuous block of open memory in the buffer, as there can be a block before the executing point and a block after.

 

The reason that this value is reported is that a single program line cannot wrap around from the end of the buffer to the beginning. So the response to "rotfree" is the size of the longest program line that can be accepted. (If the space at the end of the rotary buffer is less than the length of the program line, the entire program line will be placed at the beginning of the buffer, presuming there is room there.)

 

So in your test, the block of 9977 bytes open toward the end of the buffer is a far larger space than the ~40 bytes per line opened up by the executed program lines.

Link to comment
Share on other sites

That will work until the storage pointer wraps around to the beginning of the rotary buffer. Then your expression will report a negative number. To make it more robust, you could do the following:

 

BufferUsed = (Coord[x].RotStore - Coord[x].RotExec) modulo (Coord[x].RotEnd - Coord[x].RotStart)

 

Using the modulo operation with the size of the buffer would turn a -4000 value into a +6000 value for a 10000-byte buffer.

Link to comment
Share on other sites

That will work until the storage pointer wraps around to the beginning of the rotary buffer. Then your expression will report a negative number. To make it more robust, you could do the following:

 

BufferUsed = (Coord[x].RotStore - Coord[x].RotExec) modulo (Coord[x].RotEnd - Coord[x].RotStart)

 

Using the modulo operation with the size of the buffer would turn a -4000 value into a +6000 value for a 10000-byte buffer.

 

Good catch!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...