Movicon Help on Line - Rel. 11.7.1302
The animation settings of Movicon objects (Displays, Rectangles, etc.) allow you to set variables and the relevant thresholds to activate the various graphics functions. In Movicon, these functions can be activated by also associating Basic Script string expressions to execute commands.
This will allow you to associate an entire VBA expression, complete with variables and logical conditions, to execute the desired graphics function instead of a variable. In this case, the value returned by the expression will be handled as an interpreted value instead of the variable.

This screenshot shows how to insert a Basic Script expression instead of a variable. The value returned from the expression will be interpreted instead of that of the variable's.
|
Warning! Movicon script functions such as GetVariableValue(), SetVariableValue, QualityOf(), etc., cannot be used in basic expressions. The basic expressions only support WinWrap mathematical operators as listed below. |
VBA Expression Editor
The basic script expressions can be inserted directly instead of the variable. An editor window has also been provided to do this and which opens when clicking the "Expression..." button located in the "Tag Browser" window:

This editor window provides all the necessary operations to insert expressions to allow major control over any errors.
Once the window has opened to insert a variable, double-click on the variable name on the list to the right. To insert a mathematical function, use the corresponding button. The available functions are:
Operator |
Description |
And |
AND binary operator |
Or |
OR binary operator |
Not |
NOT logic operator (inverts the variable's boolean value or the expression which follows it) |
= |
equal to binary operator |
<> |
different than binary operator |
>= |
more than or equal to binary operator |
<= |
less than or equal to binary operator |
( |
open brackets |
) |
close brackets |
+ |
addition |
- |
subtraction |
* |
multiplication |
/ |
division |
Abs() |
absolute value (module) |
Sqr() |
Square root |
Exp() |
base power is (2,718) |
Cos() |
cosine (in radiants) |
Sin() |
sine (in radiants) |
Tan() |
tangents (in radiants) |
Atn() |
arctangent |
CBool() |
conversion to boolean (boolean) |
CInt() |
conversion to integer (integer) |
CLng() |
conversion to long (long) |
CDbl() |
conversion to decimal number with double precision (double) |
Long expressions can be inserted by using the Enter Key to go back to the beginning. When the inserted expression is not valid, an error message will show when confirming with the OK key.
|
Expressions may not be valid if producing a division by zero. When validating expressions, the variables will all be considered with the "1" value. Therefore, the "VAR00001/(VAR00002-1)" expression will not be validated by the expression editor because it produces a division by zero. |
The use of VBA expressions instead of variables in objects is also a fast and effective in Windows CE. In addition, less resources are required than would be required do when writing code in object events. In fact, only one thread is needed to manage all the VBA expressions for the objects loaded in memory, and the VBA expressions are only evaluated when the linked variable changes (on event). This also functions faster than the IL Logic because the VBA expressions are evaluated on event, instead the IL Logic is executed continuously in a loop.
|
This functionality allows you to extend the draws' graphical potentialities further. The variable associated to each one of the symbol or draws graphic properties can in fact be substituted with Basic expressions which can contain combinations of multiple variables, logic, or mathematical expressions. |
|
When a symbol containing a VBA expression is added on screen, i.e. "VAR00001 + VAR00002", Movicon will acknowledge the use of the two "VAR00001 and VAR00002" variables and addes them both to the project. |
|
Warning! This functionality passes the expression inserted directly in the Basic Script interface. Therefore, the use of variables that begin with numeric characters or particular characters that include an underscore ("_") will not be admitted. |
|
Warning! Basic expressions do not support decimal formats (i.e. "x.x") but only "x". Therefore, you should used decimal order divisions directly in the expression (eg: (VAR00001+VAR00002)/10). |
|
Warning! Local Screen Variables are not supported in Basic Expressions. |
|
Warning! the <VariableName>.<BitNumber>syntax cannot be used in Basic Expressions and you must use a mask to extract the Bit value needed. |