beautypg.com

Real_to_dint function, Reg_real, reg_dint, reg_dword functions, Real_to_dint( a ) – Delta RMC151 User Manual

Page 376: Reg_real( f, e ), Reg_dint( f, e ), Reg_dword( f, e )

background image

RMC70/150 and RMCTools User Manual

Examples

POLY(1, 1, 2, 4, 1) is the equivalent of 1 + 2t + 4t

2

+ t

3

, where t is 1.0 and returns 8.0.

POLY(0.5, -10, 5, -0.1) is the equivalent of -10 + 5t - 0.1t

2

, where t is 0.5 and returns -

7.525.

5.14.2.31. REAL_TO_DINT Function

REAL_TO_DINT(a)
Converts a to a DINT by rounding to the nearest integer.

Parameters

a (REAL)
The value to convert to a DINT.

Return Value

Returns a DINT.

Remarks

0.5 rounds up to 1.
Rounding -0.5 differs between the RMCs:

The RMC75E and RMC150E will round -0.5 to -1.

The RMC75S and RMC75P will round -0.5 to 0.

Examples

REAL_TO_DINT(0.5) returns 1
REAL_TO_DINT(-7.89) returns -8

5.14.2.32. REG_REAL, REG_DINT, REG_DWORD Functions

REG_REAL (file, element)
REG_DINT (file, element
)
REG_DWORD (file, element
)
Represents the register at the specified IEC address %MDfile.element.

Parameters

File (DINT)

The file portion of the address.
Element (DINT)

The element portion of the address.

Returns

Represents the register at the specified IEC address %MDfile.element. The function

determines the returned data type:
REG_REAL: REAL
REG_DINT:
DINT

356

Delta Computer Systems, Inc.

This manual is related to the following products: