IF function equations and adding limit stops
One commonly used equation is the if function. An if function follows the following format:
if(VARIABLE>THIS,THEN THIS,OTHERWISE THIS)
Less than <, more than > and = equals can be used to define the conditions.
Below are two main uses for these equations:
1. Using a variable with an if function equation
2. Limit Stops
1. Using a variable with an if function equation
An if function can be used to turn on/off a control using the following example:
In the “Alpha” box 255 is fully visible, 0 is hidden. 127 is 50% transparency. An if function can be used to turn on/off an image with this example equation:
if(VAR_XXXX>1,255,0)
This example shows a digital display that displays the lap number (VAR_7004) for 10 seconds after crossing the lap marker:
Using alpha and the time into lap (VAR_0060) variable. When time into lap is under 10 seconds the lap counter will be visible for the first few seconds of the new lap.
The equation is if(VAR_0060<10,255,0)
The lap counter variable (to display) is VAR_7004
2. Limit Stops
An if function can be used to add an end limit to a control like a speedometer so if the speed exceeds for example 260 then the needle stops at 260. An example equation structure is shown here:
if(VARIABLE>MAX SCALE NUMBER,THEN MAX ANGLE, (OTHERWISE ORIGINAL EQUATION))
So for the example in Step by step guide to designing a simple overlay, the equation is:
VAR_0015/(260/210)-30
So to add a limit stop, so the needle stops rotating at a speed of 260 (210 degrees) that would be:
if(VAR_0015>260,210,(VAR_0015/(260/210)-30))
Note: It is critical to get the brackets correct. If the equation does not work, check there are no missing or extra brackets.