Parameter Mapping in the 3000
A "mapping" is defined by an "equation". The things that can be mapped are organized into tables, which are arrays of numeric entities.
We call a table an "output" table if the items in the table are permitted to be on the left hand side of an equation. If the items in the table are only permitted on the right hand side of an equation, we call it an "input" table.
For example, the digital inputs on the 3000 unit are found in an input table, as are the items in the DeviceNet input table.
Boolean mapping
A Boolean variable is a variable that can have the value 0 (FALSE) or 1 (TRUE). In the 3000 there are 3 boolean operations supported:
- 1: AND The symbol for "AND" in a Boolean equation is '*'.
- 2: OR The symbol for "OR" in a Boolean equation is '+'.
- 3: NOT The symbol for "NOT" in a Boolean equation is '~'.
The Boolean tables are considered to be arrays of short (2 byte) integers. An individual Boolean variable in the table is located by its word offset and its bit offset. Boolean tables are given 2 letter names as follows:
- DI is the DeviceNet input table.
- DO is the DeviceNet output table
- HI is a Hardy input table.
- HO is a Hardy output table.
The DeviceNet input and output tables are mapped to physical external devices using RSNETWORX for DeviceNet. The Hardy input and output tables have pre-defined meanings for certain bits within the tables.
A Boolean variable is addressed with the syntax below:
[tablename][word offset].[bit offset].
For example DI0.3 is bit #3 in the DeviceNet input table, word #0.
Analog mapping.
An analog variable is one that can have many different values. The 3000 supports float, 16 bit integer, and 32 bit integer analog variable types.
There are 3 analog operations supported. The symbols are the same as the Boolean operations, but with different meaning.
- 1: Multiply. The symbol for "multiply" is '*'
- 2: Add. The symbol for "Add" is '+'
- 3: Negate. The symbol for "Negate" is '~'
Analog tables are given 3 letter names as follows:
DFI,DFO,DSI,DSO,DII,DIO all refer to DeviceNet tables, where the item is a float, a short integer, or a 32 bit integer depending on the second letter in the table name.
- S,H - 16 bit signed integer
- F, D, R - float
- I - 32 bit signed integer
An analog variable is addressed with the syntax below:
[tablename][offset]
The offset is an offset in words in the case of the DeviceNet tables. The offsets in Hardy tables have various predefined meanings.
When an analog equation is evaluated, all terms get converted to float. The final result is then converted to the type of the LHS (left hand side).
Mixed mapping.
An equation is said to be an analog equation if the term on the left side of the equals sign is an analog variable. The equation
is said to be a boolean equation if the term on the left side is a boolean variable.
It is permissible to have analog variables to appear in Boolean equations, and to have Boolean variables in analog equations. (We call a mixed equation "Boolean" if its LHS is a Boolean term, and "Analog" if its LHS is an analog term). The interpretation is the following:
A Boolean variable in an analog equation is converted to 1.0 or 0.0.
An analog variable in a Boolean equation is TRUE if it is greater than zero, and FALSE if it is less than or equal to zero.
Special (command) mapping
We will have a command interface to do special things, like setting a parameter value.
The table CMD can appear only on the left hand side of an equation, and the right hand side of a "command" equation has 1 or 2 terms. The first term on the right had side defines the table and offset (in words) where the command data comes from, and the second term defines the table and offset where the response to a command is written.
The Command interface in the 3000 series
A "command" in the 3000 consists of a two-byte "command number", followed by a variable number of "command data" bytes.
The commands defined as of the date of this document are the following:
WRITEINTEGER, command number 0x1000
The WRITEINTEGER command is used to set the value of integer valued parameters.
Command data:
- 2 bytes: PARAMETER NUMBER: the number (PARAMID) of the parameter to write.
- 4 bytes: PARAMETER VALUE: what to set the parameter to.
Data returned by the 3000: 8 bytes, echoing the WRITEINTEGER command.
WRITEFLOAT, command number 0x1001
The WRITEFLOAT command is used to set the value of float valued parameters.
Command data:
- 2 bytes: PARAMETER NUMBER: the number (PARAMID) of the parameter to write.
- 4 bytes: PARAMETER VALUE: what to set the parameter to.
Data returned by the 3000: 8 bytes, echoing the WRITEFLOAT command.
WRITESTRING, command number0x1002
The WRITESTRING command can be used to set the value of any parameter (not just the string parameters).
Command data:
- 2 bytes: PARAMETER NUMBER: the number (PARAMID) of the parameter to write.
- Variable number of bytes: a zero terminated ASCII string, giving the value to set the parameter to.
Data returned by the 3000: 8 bytes, echoing the first 8 bytes of the WRITESTRING command.
READINTEGER 0x2000
READFLOAT 0x2001
These commands are used to read the value of integer or float parameters.
Command data:
- 2 bytes: PARAMETER NUMBER: the number (PARAMID) of the parameter to read.
Data returned by the 3000: 8 bytes. The first 4 bytes echo the command, and the next 4 contain the value of the parameter.
Setting up the command interface in mapping:
Use an equation of the form
CMD0 = (in_table)*(out_table)
In_table is an input table, defining where the command is written.
Out_table defines where the reply data is written.
Example:
CMD0= DI0.0*DO0.0
This equation says the command will be written to the DeviceNet input table, at word offset 0, and the reply data is written to the DeviceNet output table, at word offset zero.
It is legal to omit the Out_table.
Example:
CMD0=DI3.0
This equation says that the command will be written to the DeviceNet input table, at word offset 3, but no reply data will be written..