Using the Logic Editor
156 372 SPU 780 01EMAN May 2002
Mathematical Equations in Equation Networks
Equation Format ProWORX 32 expects equation elements to appear in a specific format. Op erations
and functions each have their own format. Also, for each value, you must specify
what kind of value it is (register address, constant or symbol) and its data type
(signed integer, unsigned integer, etc.).
Equation Values
and Data Types Each value can refer to a constant, register address or symbol. The Equation
Network Editor determines which data type the value is, based on the following
format.
The actual data type of a value is determined by its suffix, as shown in the following
table:
Typically, youd first indicate the register address where the calc ulated result is to be
stored, followed by an equal sign (the "assignment operator"), followed by the
calculation itself. For example:
40001 = 40002U + COS(40003UL) * #+1.35E-4F / HEIGHTL
40002U is an address of a 16-bit unsigned integer.
COS(40003UL) calculates the cosine of a long (32-bit) unsigned integer value
stored at address 40003.
#+1.35E-4F is the floating point value of 0.000145, given in exponential not ati on.
HEIGHTL is a symbol of the name HEIGHT, representing the address of a long
(32-bit) signed integer.
40001 = indicates that the result of the calculation is to be stored in register
address 40001 as a 16-bit signed integer.
Format Meaning Example
Default (no # sign or single quotes Register address 40001
Prefixed by # Constant #123
Enclosed in single quotes Symbol HEIGHT
Suffix Meaning Example
None 16-bit Integer #38
U 16-bit unsigned Integer 40001U
L Long (32-bit) signed Integer #-123L
UL Long (32-bit) unsigned Integer HEIGHTUL
F 32-bit floating point (real) #+1.45E-4F