Functions of the Blocks

Overview

The blocks you can insert in the Logic Configurator provide different functions. This chapter provides further information on available blocks.

Logic Blocks

Logic blocks are logical operators that perform operations using Boolean input values.

NOTE: If either input A or B is not connected, it is automatically interpreted as FALSE.

The following Logic blocks are available:

Block

Description

Not

Performs a logical negation of the operand A:

A = TRUE => Output = FALSE

A = FALSE => Output = TRUE

And

Performs a logical AND of two operands A and B:

A = TRUE, B = TRUE => Output = TRUE

Other combinations of A and B => Output = FALSE

Nand

Performs a negated logical AND of two operands A and B:

A = TRUE, B = TRUE => Output = FALSE

Other combinations of A and B => Output = TRUE

Nor

Performs a negated logical OR of two operands A and B:

A = FALSE, B = FALSE => Output = TRUE

Other combinations of A and B => Output = FALSE

Or

Performs a logical OR of two operands A and B:

A = FALSE, B = FALSE => Output = FALSE

Other combinations of A and B => Output = TRUE

XNor

Performs a negated exclusive OR of two operands A and B:

A = FALSE, B = TRUE => Output = FALSE

A = TRUE, B = FALSE => Output = FALSE

Other combinations of A and B => Output = TRUE

Xor

Performs an exclusive OR of two operands A and B:

A = FALSE, B = TRUE => Output = TRUE

A = TRUE, B = FALSE => Output = TRUE

Other combinations of A and B => Output = FALSE

Flip Flop

Provides two outputs: Output and negated !Output. A Set state is retained until a Reset input becomes TRUE. See the Flip Flop input and output signals table hereafter.

Flip Flop input and output signals:

Input signals

Output signals

Result

Set

Reset

Output

!Output

FALSE

FALSE

Output

!Output

If both input signals are FALSE, the output signals do not change.

FALSE

TRUE

FALSE

TRUE

A reset is performed:

Output = FALSE

!Output = TRUE

The state is retained.

TRUE

FALSE

TRUE

FALSE

A set is performed:

Output = TRUE

!Output = FALSE

The state is retained.

TRUE

TRUE

FALSE

FALSE

If both input signals are TRUE, an invalid state is detected and both output signals are set to FALSE.

Comparison Blocks

Comparison blocks are logical operators that perform mathematical comparison operations using numerical input values. The output is presented as a Boolean value.

NOTE: If either input A or B is not connected, it is automatically interpreted as 0.

The following Comparison blocks are available:

Block

Description

Equal

If A is equal to B, the output is TRUE.

A = B => Output = TRUE

Greater Than

If A is greater than B, the output is TRUE.

A > B => Output = TRUE

Greater Than or Equal

If A is greater than or equal to B, the output is TRUE.

A >= B => Output = TRUE

Less Than

If A is less than B, the output is TRUE.

A < B => Output = TRUE

Less Than or Equal

If A is less than or equal to B, the output is TRUE.

A <= B => Output = TRUE

Not Equal

If A is not equal to B, the output is TRUE.

A <> B => Output = TRUE

Mathematics Blocks

Mathematics blocks are logical operators that perform mathematical operations using numerical input values and presenting numerical output values.

NOTE: If either input A or B is not connected, it is automatically interpreted as 0.

The following Comparison blocks are available:

Block

Description

Equation

The Mathematics > Equation block allows you to enter functions in the text box of the block. These functions act on the input variables as shown in the following example:

exp({a}) / {b}

To create a variable, enter text surrounded by curly brackets. For example, {MyVariable} creates the variable MyVariable.

Input variables are case-sensitive.

{PI} representing the constant value π = 3.14159 is supported.

The following operators are supported:

  • + (addition)

  • - (subtraction)

  • * (multiplication)

  • / (division)

  • % (remainder)

  • ^ (power)

  • ! (factorial)

  • sqrt (square root)

  • sin (sine)

  • asin (arcsine)

  • cos (cosine)

  • acos (arccosine)

  • tan (tangent)

  • atan (arctangent)

  • rad (convert degrees to radians)

  • deg (convert radians to degrees)

  • ceil (ceiling)

  • floor (floor)

  • round (rounding)

  • exp (e raised to power)

  • abs (absolute)

Number

The Number block allows you to enter a numerical input.

Absolute

The absolute value | x | of a numerical value x is the non-negative value of x without regard to its sign.

Add

The numerical input values are added.

Output = A + B

Ceiling

The input real number x is rounded to the smallest integer that is greater than or equal to x (also known as the least or smallest integer function).

Examples:

Input A = 9.51 => Output = 10

Input A = 9.49 => Output = 10

Divide

The numerical input value A is divided by value B.

Output = A / B

Floor

The input real number x is rounded to the greatest integer that is less than or equal to x (also known as the greatest integer function).

Examples:

Input A = 9.51 => Output = 9

Input A = 9.49 => Output = 9

Modulo

The remainder or signed remainder of a division is returned.

Output = A Mod B

Multiply

The numerical input values are multiplied.

Output = A * B

Round

The real number x is rounded to the nearest integer.

Examples:

Input A = 9.51 => Output = 10

Input A = 9.49 => Output = 9

Subtract

The numerical input value B is subtracted from the numerical input value A.

Output = A - B

Boolean Delay Block

Run the Boolean Delay command to add a Delay block. It allows you to add a delay time (in s) defined with the Delay input after the input is received before the Boolean output is set.

If the Delay input is not connected, it is by default set to 1 s.

Boolean Display Block

Run the Boolean Display command to add a Display block. It allows you to debug and visualize the values of Boolean outputs.

Counter Block

Inputs

Description

Count

When a rising edge is detected at the Count input, the Output value increases by the numerical value provided as Increment input.

Reset

When a rising edge is detected at the Reset input, the Output value is reset to 0.

Increment

Numerical input value by which the Output value is incremented when a rising edge is detected at the Count input. If the Increment input is not connected, it is interpreted as 1 by default.

Outputs

Description

Output

Numerical value that serves as a counter output.

Number Delay Block

Run the Number Delay command to add a Delay block. It allows you to add a delay time (in s) defined with the Delay input, which sets the numerical output.

Number Display Block

Run the Number Display command to add a Display block. It allows you to debug and visualize the values of numerical outputs.

Random Block

Inputs

Description

Trigger

When a rising edge is detected at the Trigger input, a random numerical Output value is generated based on the rules defined using the Max, Min, Seed inputs.

Max

This numerical input value defines the maximum threshold of the value range for the random output value.

This input value must be available to generate a random numerical Output value of type integer (Int, see Properties of a Random block).

Min

This numerical input value defines the minimum threshold of the value range for the random output value.

This input value must be available to generate a random numerical Output value of type integer (Int, see Properties of a Random block).

Seed

This numerical input value defines the initial value for the random output value.

Outputs

Description

Output

Generates a random numerical value.

Properties of a Random block:

The following parameter is available in the Properties view when a Random block is selected:

Parameter

Description

RandomMode

Select the type of numerical values that are generated as Output values:

  • Int: Output values of type integer are generated, for example, 2.

    To use this option, a Max and a Min input value must be available.

  • Double: Output values of type double are generated, for example, 0.596.

Default value: Double

Timer Block

Inputs

Description

Reset

When a rising edge is detected at the Reset input, the timer is reset.

Stop

When a rising edge is detected at the Stop input, the timer is stopped (without being reset).

Interval

This numerical input value in seconds defines the time interval for the timer.

Default value: 1 s

This input value is also available in the Properties view when the Timer block is selected. You can edit the value in the Properties view or you can connect a numerical Number block to this input.

Within this time interval, the Elapsed output switches from FALSE to TRUE as configured with the Duty Cycle parameter in the Properties view.

NOTE: Start the physical simulation for the Timer to become effective.

Outputs

Description

Elapsed

The Boolean output switches from FALSE to TRUE within the Interval time as configured with the Duty Cycle parameter in the Properties view.

By default, the output is 0.5 s FALSE and 0.5 s TRUE with Interval = 1 s and Duty Cycle = 50%.

Properties of a Timer block:

The following parameters are available in the Properties view when a Timer block is selected:

Parameter

Description

Interval

Time interval for the timer.

Default value: 1 s

Edit this value or connect a numerical Number block to the Interval input of the Timer block to define a time interval within which the Elapsed output switches from FALSE to TRUE as configured with the Duty Cycle parameter.

Duty Cycle

Configures a percentage of the Interval time. After this percentage of the Interval time has elapsed, the Elapsed output switches from FALSE to TRUE.

Default value: 50%

Auto Reset

By default, this option is selected and the timer is automatically reset and restarted.

Clear the check box to start the timer only upon a rising edge at the Reset input.

Example:

Interval = 10 s

Duty Cycle = 80%

With these settings, the Elapsed output is set to FALSE for 2 seconds and to TRUE for 8 seconds within the interval of 10 seconds.