When formatting scale equations for use with the scale type of Based on value of other tags (SQL compliant) selected, you’ll need to format the text properly or else the integrity of the data points will be impacted, which will affect machine data collection capabilities.
The scale equations must be written in ANSI-SQL format. You can read more about how to do this on the helpful guru99 website.
There are some important things to note when entering scale equations:
- Following SQL CASE statement rules, the equation must start with CASE and finish with END. Parentheses are not required.
- You can find useful operators here.
- You can reference other data points by inputting the datapoint name inside of $ symbols. The data point name typed inside the $ symbols must exactly match, or else the scale equation won’t work.
- For instance, if you were to reference a point called LineSpeed, you would enter it in the format $LineSpeed$
- Some examples are shown below.
$GoodMaterial$ + $BadMaterial$
With three data points tracking material (TotalMaterial, GoodMaterial and BadMaterial), the tag name TotalMaterial is referencing the other two points and adding them together to get its value.
case ‘$MachineState$’ when ‘Stopped’ then 0 when ‘Running’ then 1 ‘SwitchedOff’ then 2 else 3 end
The machine state can be tracked either from values (0 through 3) in the machine device and written into a string such as ‘stopped’ or ‘running’ – this can also work in the opposite way (from a string to a number).
$Linespeed$ * ABS($LineRunning$)
The Linespeed data point is being multiplied by itself times the absolute value of the LineRunning data point.
($Injection1TransferPosition$ – $ScopeOffset0$) * $ScopeSlope0$
The datapoint for InjectionTransferPosition is getting its value from itself minus the scope offset, times the slope.
© 2020 ei3 Corporation. Content of this web page is proprietary to ei3 Corporation.