NumericToBits Function Block

This block converts integer and floating value to binary.

Figure 1: NumericToBits Function Block

Figure 2: NumericToBits Property Sheet

Inputs

Table 1: Inputs of NumericToBits Function

Input Name

Description

In

This input represents the integer number to be divided into bits. The integer number is a maximum of 4 bytes long (32 bits). Range: 0 - 16777215 or "null" If In is "null" all outputs are "null".

Output

Output Name

Description

Bit0 - Bit7

Represents the bits, where bit0 represents the least significant bit.

The bits are either 0 or 1. If In is set to "null" Bit0 - Bit7 is set to "null".

Byte

The byte value represents an integer value of the Byte selected by the offset

The Byte has the value 0 - 255, or if In is set to "null" Byte is set to "null".

Table 2: Output of NumericToBits Function

Parameter

Parameter Name

Description

Byte Offset

If the input value In consists of several bytes, you can select the byte which is to be divided into bits. 0 = lowest byte (outer right). Valid Range is 0 - 2 (0 is the default).

Out Save

Master Sync Enabled: If you set it to "true" the last output will be set as output for one cycle after the controller restarts. The application can use it to return to the same state before the controller restart.

Out: To enable or disable the Out Save feature.

Bit0:To enable or disable the Bit0 feature.

Bit1:To enable or disable the Bit1 feature.

Bit2:To enable or disable the Bit2 feature.

Bit3:To enable or disable the Bit3 feature.

Bit4:To enable or disable the Bit4 feature.

Bit5:To enable or disable the Bit5 feature.

Bit6:To enable or disable the Bit6 feature.

Bit7:To enable or disable the Bit7 feature.

Byte:To enable or disable the Byte feature.

Table 3: Parameter of NumericToBit Function

Example:

The value 26434 is to be broken down into bits; the value corresponds to 67 42 in hexadecimal representation, consisting of 2 bytes. The lower byte is on the right (42 hex) and the higher byte on the left (67 hex).

Figure 3: NumericToBits calculation example

Figure 4: NumericToBits function block example

Figure 5: NumericToBits Property Sheet Byte 0

Figure 6: NumericToBits Property Sheet Byte 1

Refer to General Description for general information about IRMN4 Function Blocks.