4 type conversion, 1 byte_to_bool, 2 bool_to_byte – NORD Drivesystems BU0550 User Manual

Page 41: 3 int_to_byte

Advertising
background image

3 AWL (Instruction List, IL)

BU 0550 GB-0813

41

3.4 Type conversion

Operator

Explanation

BYTE_TO_BOOL

Conversion from BYTE to BOOL

BOOL_TO_BYTE

Conversion from BOOL to BYTE

INT_TO_BYTE

Conversion from INT to BYTE

BYTE_TO_INT

Conversion from BYTE to INT

DINT_TO_INT

Conversion from DINT to INT

INT_TO_DINT

Conversion from INT to DINT

Table 51 Overview of type conversions

3.4.1

BYTE_TO_BOOL

Converts the data type from BYTE to BOOL. As long as BYTE is not equal to zero, this always gives the
conversion result TRUE.

BOOL

BYTE

INT

DINT

Possible data types

X

Commands

Explanation

LD 10

BYTE_TO_BOOL

AE = TRUE

Table 52 BYTE_TO_BOOL

3.4.2

BOOL_TO_BYTE

Converts the AE data type from BOOL to BYTE. If the AE is FALSE, the accumulator is converted to 0. If
the AE is TRUE, the accumulator is converted to 1.

BOOL

BYTE

INT

DINT

Possible data types

X

Commands

Explanation

LD TRUE

BOOL_TO_BYTE

Accu = 1

Table 53 BOOL_TO_BYTE

3.4.3

INT_TO_BYTE

Converts the data type from INT to BYTE. Here, the High component of the INT value is not transferred.
Prefixes are lost as the BYTE type does not have prefixes.

BOOL

BYTE

INT

DINT

Possible data types

X

Commands

Explanation

LD 16#5008

INT_TO_BYTE

Accu = 8

Table 54 INT_TO_BYTE

Advertising