This special function is not supported by M90 controllers, but is supported by Jazz and M91 controllers (from OS 91). Note that constant values are not supported; only MI value may be used.
Long integer functions are activated via SB82. A long integer function uses adjacent MIs in performing calculations and storing results. When SB82 is used as the activating condition for a Math, Compare, or Store function, selecting a single MI as an input value causes the following MI to be included with the input. The selected MI value fills the 2 'lower bytes' of the long register, and the following MI fills the 2 'higher bytes'. The same logic holds for the output value.
In the example below, the values in MI 0 and MI 1 provide the 'A' input, MI 2 and MI 3 provide the 'B' input. Note that MI 0 provides the value that fills the 2 'lower bytes', and MI 1 provides the value that fills the 2 'higher bytes' of the long integer.
The result is stored in MI 10 (low) and 11 (high).
In the Compare function below, MI 10 contains 100, MI 11 contains 3, MI 12 contains 100, and MI13 contains 0, making the comparison true. Note that to activate Compare functions, SB 82 must be on the left ladder rail. This is not so for Math and Store functions.
You can use the Store function in two ways; these can enable you to display long values on the LCD. Note that in order to display long values, the variable used to represent the 'low' byte should be configured to show leading zeros. Display is restricted to positive values within the range of 0-99,999,999.
Setting SB82 before a Store function causes the 'A' value to be treated as a 32-bit 'long' value; the long value is then broken up into the 2 16-bit MIs constituting the 'B' value.
Resetting SB82 before a Store function causes the 'A' value to be treated as a 2 16-bit values; the values are then stored as a long 32-bit 'B' value.