Symbolic Expressions in Properties Block

QFIRE Studio

supports symbolic expressions in block properties fields and the definition of symbolic variables as well.

Symbolic Expressions List

Table 1, 2 and 3 show supported operators for logical, mathematical, and conditional expressions respectively.

Table 1 - Bitwise and Logical Expressions

Name

Description

Usage

Parentheses Used to assign priority to specific operations. (,)
Not Returns the negated value of the argument. !, not, -, ~
Shift Right Shifts all the bits of a binary number to the right. >>
Shift Left Shifts all the bits of a binary number to the left. <<
And Returns True only if both operands are True. If one or both operands are false, the operation returns False. And, &, &&
Or Returns True if at least one of the operands is True. It returns False only if both operands are False. Or, |, ||
Xor The "xor" operation (exclusive OR) is a binary logical operator that returns True if the operands are different; otherwise, it returns False. ^
Equal Returns True if the values are equal and False otherwise. =, ==
Different Returns True if the values are different and False if they are the same. !=, <>
Less Than Returns True if the left value is smaller, otherwise, it returns False. <
Greater Than Returns True if the left value is greater, otherwise, it returns False. >
Less Than or Equal To Returns True if the left value is smaller or equal to the right value, otherwise, it returns False. <=
Greater Than or Equal To Returns True if the left value is greater or equal to the right value, otherwise, it returns False. >=

Table 2 - Mathematical Expressions

Name

Description

Usage

Result

Abs Returns the absolute value of a specified number. Abs(-1) 1
Acos Returns the angle whose cosine is the specified number. Acos(1) 0
Asin Returns the angle whose sine is the specified number. Asin(0) 0
Atan Returns the angle whose tangent is the specified number. Atan(0) 0
Ceiling Returns the smallest integer greater than or equal to the specified number. Ceiling(1.5) 2
Cos Returns the cosine of the specified angle. Cos(0) 1
Exp Returns e raised to the specified power. Exp(0) 1
Floor Returns the largest integer less than or equal to the specified number. Floor(1.5) 1
Log Returns the logarithm of a specified number. Log(1, 10) 0
Log10 Returns the base 10 logarithm of a specified number. Log10(1) 0
Max Returns the larger of two specified numbers. Max(1, 2) 2
Min Returns the smaller of two numbers. Min(1, 2) 1
Pow Returns a specified number raised to the specified power. Pow(3, 2) 9
Remainder Calculates the remainder resulting from dividing one number by another. 5%3 2
Round Rounds a value to the nearest integer or specified number of decimal places. The mid number behaviour can be changed by using EvaluateOption.RoundAwayFromZero during construction of the Expression object. Round(3.222, 2) 3.22
Sign Returns a value indicating the sign of a number. Sign(-10) -1
Sin Returns the sine of the specified angle. Sin(0) 0
Sqrt Returns the square root of a specified number. Sqrt(4) 2
Tan Returns the tangent of the specified angle. Tan(0) 0
Truncate Calculates the integral part of a number. Truncate(1.7) 1

Table 3 - IF Clause Expression

Usage

Result

Description

if(1<2,3,4) 3 The expression evaluates a condition and returns one of two values based on whether the condition is true or false. If the condition is true, it returns the first argument; if false, it returns the second one.
(x is 2) ifs(x<2,10,x>2,20,30) 30 The expression evaluates a condition and returns one of several values based on whether the condition is true or false. If the first condition is true, it returns the first value; if the second condition is true, it returns the second value; otherwise, it returns the default value. For example, ifs(condition1, value1, condition2, value2, defaultValue).
Examples

In the sequence, there are some usage examples.

Not

The Symbolic Expression "Not()" acts when the argument is 0, resulting in 1. For any argument other than 0, the result is 0. Figure 1 shows some examples.

Figure 1 - Not operation

Bit Shifting

It is possible to use ">>" and "<<" to shift the values declared in the blocks. It is important to know that these values will always be displayed in integer format, thus decimal values are lost. Figure 2 shows how to use these operators.

Figure 2 - Shifting operation

About MWF

MWF is a traditional Brazilian company that provides a wide range of electronic and mechatronic products for industry sectors such as automotive, agricultural machinery and aerospace.

Contact Us

Rua Doutor Siqueira, 139 / Sala 804 Campos dos Goytacazes - RJ, Brasil

contact@mwf-technologies.com

© 2018-2026 MWF. All rights reserved.