Skip to main content

6.23. FRD(Convert form BCD to Integer) Convert to Integer

6.23. FRD(Convert form BCD to Integer):Convert to Integer

 

Symbol

Relay combination

Factor

src: Source relay (or Number)

dst: Destination relay

Description

If Rung is activated, convert the value of src’s BCD to integer and save it to dst.

This command is convenient when accepting a value of cam switch that is BCD type output as input.

If the value of src is not BCD, set SP7=1.

Also, if src is word(W) type and dst is byte(B) type, the maximum value of converted src will be &H9999. Conversion result of integer will be 9999(&H270F) which will exceed the range of byte &Hff and overflow will occur. In this case, set SP7=1. 

Usage example

FRD(XB3,RB2): Convert the value(BCD) of XB3 into integer and save it to RB2.

If (XB3)=&H23(35), save 23=&H17 to RB2.