omron — P-Variables

PMAC Product Guide I185 -- I199: Coordinate System 1 setup I200 -- I284: Motor #2 setup I285 -- I299: Coordinate System 2 setup ... I800 -- I884: Motor #8 setup I885 -- I899: Coordinate System 8 setup I900 -- I979: Encoder 1 - 16 setup I980 -- I1023: Reserved for future use Values assigned to an I-Variable may be either a constant or an expression. The commands to do this are on-line (immediate) if no buffer is open when sent, or buffered program commands is a buffer is open. Examples: I120 = 45 I120 = (I120+P25*3) For I-Variables with limited range, an attempt to assign an out-of-range value does not cause an error.

The value is automatically rolled over to within the range by modulo arithmetic (truncation). For example, I3 has a range of 0 to 3 (4 possible values). The command I3=5 actually would assign a value of 5 modulo 4 = 1 to the variable. On PMACs with battery-backed RAM, most of the I-Variable values can be stored in a 2K x 8 EEPROM IC with the SAVE command. These values are safe here even in the event of a battery-backed RAM failure, so the basic setup of the board is not lost. After a new value is given to one of these I-Variables, the SAVE command must be issued in order for this value to survive a power-down or reset.

The I- Variables that are not saved to EEPROM are held in battery-backed RAM. These variables do not require a SAVE command to be held through a power-down or reset and the previous value is not retained anywhere. These variables are: I19-I44, Ix13, Ix14. On PMACs with flash memory backup (those with Option 4A, 5A, or 5B), all of the I-Variable values can be stored in the flash memory with the SAVE command. If there is an EEPROM IC on the board, it is not used. After a new value is given to any I-variable, the SAVE command must be issued in order for this value to survive a power-down or reset. Default values for all I-Variables are contained in the manufacturer-supplied firmware.

They can be used individually with the I{constant}=* command, or in a range with the I{constant}.. {constant}=* command. Upon board re-initialization by the $$$*** command or by a reset with E51 in the non-default setting, all default settings are copied from the firmware into active memory. The last saved values are not lost; they are just not used. P-Variables P-Variables are general-purpose user variables. They are 48-bit floating-point variables at fixed locations in PMAC’s memory, but with no pre-defined use. There are 1024 P-Variables, from P0 to P1023.

A given P-Variable means the same thing from any context within the card; all coordinate systems have access to all P-Variables (contrast Q-Variables which are coupled to a given coordinate system, below). This allows for useful information passing between different coordinate systems. P-Variables can be used in programs for any purpose desired: positions, distances, velocities, times, modes, angles, intermediate calculations, etc. If a command consisting simply of a constant value is sent to PMAC, PMAC assigns that value to variable P0. For example, if the command 342 is sent to PMAC, it will interpret it as P0=342 .

This capability is intended to facilitate simple operator terminal interfaces. It does mean, however, that it is not a good idea to use P0 for other purposes, because it is easy to change this accidentally. 46 Programming PMAC