1 calculator basics – Innovate Motorsports LogWorks 3 User Manual
Page 112

LogWorks3_Manual_1.01.doc
- 112 -
10.1 Calculator basics
You can write formulas how ever you want to create new channels from existing data or calculate
stuff.
There are certain rules you need to follow.
The following examples show how to use the Calculator: Formulas and calculations can be
entered as described in the examples. By right-clicking in the formula window you can also cut
and paste formulas in as text from any program.
Comments can be added in the calculation by putting a ‘#’ as the first character in a line.
Example 1: Calculate Force (in lb force) from car mass (lb) and acceleration (in g)
(Thanks, Isaac N.)
#m is vehicle weight in lb
m = 3000
#a is acceleration in g
a = 0.4
F = m * a
In this example acceleration a is 0.4 g and vehicle mass is 3000 lb. The result window shows the
acceleration force. Enter the text (or copy it from this manual) and press the Calculate button
In the LogWorks Calculator, multiple variables used for a built-in function are separated by
semicolons, not commas as is usual for most programming languages. Example:
avrg(a;b;c)
calculates the average of the variable a, b and c.
The reason is that in some languages, German for example, a comma is used instead of the
decimal point as is usual in English speaking countries. Using a semicolon allows stored
calculations to be used in either case without re-writing. For every formula used, the math
calculator converts numbers with decimals into the respectively used format before doing a
calculation. So in English speaking countries, commas in the text will be converted into colons, or
in countries that use decimal commas, colons are replaced by commas. Calculation formulas can
so be interchanged internationally.
You can also change the formula so the user is asked for the car weight. To ask the user a
question you put a question mark at the beginning of the line, followed by a space. Then type in
the question, followed by an equal sign ‘=’ and then the name of the calculation variable you want
to assign the answer to.