23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Introduction to <strong>Visual</strong> <strong>Components</strong> 2.3<br />

Since VC 2.2 Runtime supports m68k targets in addition to i386 targets, the imprecise floating decimal data type<br />

"double" should be avoided when calculating scaling internally. Calculation takes place with int32 data types<br />

instead.<br />

To prevent problems with value overflows, actual calculations are processed with the aid of Assembler routines<br />

which allow 64−bit operations.<br />

When scaling in VC 2.2, the slope 'k' from the linear function is made up of the PLC−Min, PLC−Max,<br />

Display−Min, and Display−Max parameters. These configurable values (fixed or dynamic using PVs) result in<br />

the slope 'k' whereby either x or y is represented depending on the scaling direction.<br />

k = (ymax ymin) / (xmax xmin)<br />

d=ymin−(xmin *k)<br />

This results in the following scaling formula, whose scope is general:<br />

y = (ymax ymin) / (xmax xmin) * x + (ymin −(xmin*(ymax ymin) / (xmax xmin)))<br />

Example:<br />

Following configuration:<br />

PLCmin=2<br />

PLCmax=4<br />

SCALmin=−10<br />

SCALmax=100<br />

Needed: Displayed value when PLCValue=3<br />

k=(100−(−10)/4−2))<br />

k=55<br />

d=−10−(2*55)<br />

d=−120<br />

Y=55*3 −120<br />

Y=45<br />

The parameters defined above in detail:<br />

Parameter Description<br />

PLC Min Permitted lower limit of the values of a PV on the target<br />

PLC Max Permitted upper limit of the values of a PV on the target<br />

Display Min Permitted lower limit of the displayed values of a PV on the display<br />

Display Max Permitted upper limit of the displayed values of a PV on the display<br />

4.13.2.3 Restrictions<br />

Using scaling, even unsigned PVs (on the target) can accept a signed value range on the display. PVs of data<br />

type float are normally excluded from scaling because their special properties and non−linear cardinality would<br />

cause unforeseen side effects for the user. The following table shows all data types which can be scaled:<br />

PV Data Type Display Value Range<br />

BOOL DINT<br />

USINT DINT<br />

SINT DINT<br />

UINT DINT<br />

INT DINT<br />

UDINT UDINT<br />

DINT DINT<br />

4.13.2.3 Restrictions 439

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

Saved successfully!

Ooh no, something went wrong!