ProSoft Technology ProSoft i-View User Manual
Page 48

Data Source Files
ProSoft i-View ♦ Mobile Process Monitoring and Control Application
User Manual
Version 2.0.2
Page 48 of 106
ProSoft Technology, Inc.
September 29, 2011
Values used in expressions or assigned to tag attributes using expressions are
represented in engineering units. ProSoft i-View does not have a notion of PLC raw
values except for writing or reading values from PLCs. This is important in order to
understand why assigning a 'value' to a INTERNAL tag may not give the same result than
writing it to a PLC tag and reading it back. Differences are due to the implicit
scaling/descaling and type conversion performed on PLC tags. See the 'value' attribute
description for a discussion on this subject.
When using expressions in your project you must know the following:
Tag names in expressions are case sensitive. This means that a tag named int_value
will not be the same as a tag named Int_value.
Logical or Comparison operators assume non-zero values to be true and zero values
to be false. The result of a Logical or Comparison operator is always a value of 0 or
1.
Comparison operators are non-associative. This means that expressions such as
value=a
Assignments in expressions are not supported except for assigning values to
attributes. Therefore expressions such as value = condition && (int_tag = 3 ); will
cause a syntax error on the second assignment operator. Do not confuse the
assignment operator = with the the equality operator == which is fully supported.
An expression is executed only when at least one of the referred variables or tags
change. The process is totally transparent and integrators might not need to know
about it. However, keeping the event driven nature of ProSoft i-View in mind can help
integrators to understand why and when PLC tags will be written or alarms will trigger
as a consequence of an user interaction or PLC Tag change that originated a
cascade of change events.
Expressions containing Logical operators are no exception to the event driven
design. They will be executed even if a change occurs on the right side of the Logical
operator. For example the expression value = condition1 && condition2; will be
always false if condition1 is false, however it will execute anyway as a consequence
of a change on condition2. The expression result may not change (false), but the
engine will still send a change event to any referring expressions, which could
potentially cause other effects such as a PLC tag rewrite if the expression was linked
to a PLC tag.
Expressions are not allowed to create circular or recursive references. This means
that a result of an expression can not be refitted to another expression that ultimately
would send a change event to the originating expression. This is not allowed either
on the same expression or through intermediate expressions. For example the
following row int_value INT LOCAL "value=int_value+1;" is not valid because the
int_value tag creates a circular reference around the 'value' expression.
Expression values are internally stored as double float values (64 bits) and all
arithmetic and logical operations are performed as double float operations. Values
read from PLCs including BOOL and INT tags are scaled and converted to double
float type before they are used in expressions. This has no other relevance than you
do not have to care about types, type matching or type conversions while using
expressions in ProSoft i-View.
Data types in Expressions
Variables and Expressions in ProSoft i-View support three basic data types,
Numbers, Strings and Arrays. Appropriate operators and methods allow for
conversion among types and to perform custom operations with great flexibility.
See the following sections for a discussion on methods and operators.