05.05.2014 Views

csmstr - Omega Engineering

csmstr - Omega Engineering

csmstr - Omega Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FUNCTION REFERENCE SCALE(DATA, R1, R2, E1, E2)<br />

SCALE(DATA, R1, R2, E1, E2)<br />

ARGUMENT TYPE DESCRIPTION<br />

data int The value to be scaled.<br />

r1 int The minimum raw value stored in data..<br />

r2 int The maximum raw value stored in data..<br />

e1 int The engineering value corresponding to r1.<br />

e2 int The engineering value corresponding to r2.<br />

DESCRIPTION<br />

This function linearly scales the data argument, assuming it to contain values between r1<br />

and r2, and producing a return value between e1 and e2. The internal math is implemented<br />

using 64-bit integers, thereby avoiding the overflows that might result if you attempted to<br />

scale very large values using Crimson’s own math operators.<br />

FUNCTION TYPE<br />

This function is passive.<br />

RETURN TYPE<br />

int.<br />

EXAMPLE<br />

Data := Scale([D100], 0, 4095, 0, 99999)<br />

REVISION 6 PAGE 401

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!