D-15, Conversion instructions – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

Page 315

Advertising
background image

Publication 1785-UM012D-EN-P - July 2005

Instruction Set Quick Reference D-15

Conversion Instructions

Instruction

Description

Convert from BCD
FRD

Convert to BCD
TOD

Convert to Degrees
DEG

FRD

FROM BCD

Source

D9:3

0037

Dest

N7:12

37

When the input conditions are true, convert the BCD value
in the Source (D9:3) to a integer value and store the result
in the Destination (N7:12). The source must be in the
range of

Status

C

V

Z

S

Description

always resets

Bit

sets if the destination value is zero;

always resets

always resets

otherwise resets

TOD

TO BCD

Source

N7:3

44

Dest

D9:5

0044

When the input conditions are true, convert the integer
value in Source (N7:3) to a BCD format and store the result
in the

Status

C

V

Z

S

Description

always resets

Bit

sets if the source value is negative

sets if the destinationvalue is zero;

always resets

otherwise resets

or greater than 9999 (i.e. outside of

the range of 0-9999)

DEG

RADIANS TO DEGREE

Source

Dest

F8:7

0.7853982

F8:8

45

When the input conditions are true, convert radians (the
value in Source A) to degrees and stores the result in the
Destination (Source times 180/p).

Status

C

V

Z

S

Description

always resets

Bit

sets if overflow generated;

sets if result is zero; otherwise resets

sets if result is negative;

otherwise resets

otherwise resets

Advertising