EasyManuals Logo

Sensia JISKOOT InSpec Sampler User Manual

Sensia JISKOOT InSpec Sampler
127 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
SECTION 11: USER CONFIGURABLE LOGIC (UCL) InSpec Sampler Controller
70
The value 5.2 must be cast into an int16 type to be stored in the register i_ispare1. In this case,
it is cast to the value 5, because I_USER_INT1 is an integer register. Casting of this type always rounds
down.
Similarly, consider the statement:
F_USER_FLOAT1 = FALSE;
In this case FALSE is interpreted as zero and stored as a floating-point value.
The other type of casting is performed when an argument is passed to an operator. Each operator
operates on a certain type. If an argument does not match this type, then it must be cast into the correct type
before the operator can modify it. For example, consider:
F_USER_FLOAT1 = F_USER_FLOAT2 && F_USER_FLOAT3
The && operator takes boolean values, so if both F_USER_FLOAT2 and F_USER_FLOAT3 are non-
zero, F_USER_FLOAT1 will be 1.0.
Both types of casting are performed automatically. Although necessary, casting may occasionally result
in an unexpected result. Care must be taken, especially when dealing with large numbers, that casting is not
causing an erroneous result.
11.7 Arithmetic Operators (+, -, *, /, %)
These are the basic arithmetic operators. An example of each is given below.
+ ADDITION (float + float = float) (6 + 4 = 10)
- SUBTRACTION (float - float = float) (6 - 4 = 2)
* MULTIPLICATION (float * float = float) (6 * 4) = 24)
/ DIVISION (float / float = float) (6 / 4 = 1.5)
% REMAINDER (integer % integer = integer) (6 % 4 = 2)
Note: Division by 0 returns the answer 0.
11.8 Boolean Logical Operators (&&, ||, ^^, !)
UCL includes four operators for evaluating boolean logical operations. These are shown below.
&& AND (boolean && boolean = boolean) (1 && 0 = FALSE)
Evaluates to TRUE if both arguments are TRUE.
|| OR (boolean || boolean = boolean) (0 || 1 = TRUE)
Evaluates to TRUE if either, or both arguments are TRUE.
^^ EXCLUSIVE OR (boolean ^^ boolean = boolean) (1^^ 1 = FALSE)
Evaluates to TRUE if one or the other (but not both) are TRUE.
! NOT (! boolean = boolean) (!1 = 0)
The NOT operator is a unary operator; it operates on one argument alone. It returns the boolean
opposite of the argument.
11.9 Boolean Comparison Operators (==, !=, >, <, >=, <=)
UCL includes six operators for evaluating boolean comparison operations. These are shown below.
== EQUALS TO (float == float = boolean) (0 == 0 = TRUE)
Evaluates to TRUE if both arguments are logically equal, or FALSE otherwise.
!= NOT EQUAL TO (float != float = boolean) (0 != 0 = FALSE)
This is the opposite of EQUALS TO.
> GREATER THAN (float > float = boolean) (1 > 2 = FALSE)
If left argument is greater than right argument, return TRUE, else return FALSE.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sensia JISKOOT InSpec Sampler and is the answer not in the manual?

Sensia JISKOOT InSpec Sampler Specifications

General IconGeneral
BrandSensia
ModelJISKOOT InSpec Sampler
CategoryController
LanguageEnglish

Related product manuals