6F3B0250

7. Instructions

FUN 190

BCD

BCD conversion

Expression

Input -[ A BCD B ]- Output

Function

When the input is ON, this instruction converts the binary data of A into BCD, and stores in B. If the data of A is not in the range of 0 to 9999, the conversion is not executed and the instruction error flag (ERF = S051) is set to ON.

Execution condition

Input

 

Operation

Output

ERF

OFF

No execution

 

OFF

-

ON

Normal execution

 

ON

-

 

Binary data error

 

OFF

Set

Operand

 

Name

 

 

Device

 

 

 

 

 

 

Register

 

 

 

 

Constant

Index

 

 

X

Y

R

S

T.

C.

XW

YW

RW

SW

T

C

D

I

J

K

 

 

A

Source

 

 

 

 

 

 

Ö

Ö

Ö

Ö

Ö

Ö

Ö

Ö

Ö

Ö

0 - 9999

 

 

(Binary)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

Destination

 

 

 

 

 

 

 

Ö

Ö

Ö

Ö

Ö

Ö

Ö

Ö

Ö

 

 

 

(BCD)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example

When R019 is ON, the data of D0211 is converted into 4-digit BCD, and the result is stored in RW22.

For example, if D0211 is 5432, the BCD data H5432 is stored in RW22.

D0211

5432

Binary to BCD

RW22

 

 

H5432

 

 

Note

·If the data of A is smaller than 0 or greater than 9999, the conversion is not executed and the instruction error flag (ERF = S051) is set to ON.

256 T1/T1S User’s Manual

CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net

Page 258
Image 258
Toshiba PROSEC T1 T1S, 6F3B0250 user manual Bcd, BCD conversion