Pointing to Variable Bits and Array Variable Elements

Movicon.NExT supports the possibility to specify and assign a single bit of a byte, word, or double variable type or a single element of a data Array when assigning Tag variables to symbols or objects.

Pointing to bits

To specify the bit of a Tag variable assigned to a symbol or an object, you will need to use the "Input Expression" field which can be accessed using the right mouse key or the actual object's command menu.

 

 

 

The bit numbers (starting with 0) to be assigned must be entered in the expression field after a dot. For example bit 1 should be inserted as  ".1".

 

 

 

 The Inverse or Reverse Expressions are not necessary in these cases.  

 

 

 

In order to use the bits within the logic functions you will need to use the BITAND function for example:

 

This expression executes a AND logic between the bit 2 and the bit 4 of the variable [x] (because 2^2 = 4 and 2^4 = 16).

This type of expression is to be used in substitution of a  "=AND([x].2, [x].4)" expression type which is not allowed.

 

This expression executes an OR logic between the bit 3 (because 2^3 = 8) and the bit 4 of the variable [x] (because 2^4 = 16).

This type of expression is to be sued in substitution of a "=AND([x].3, [x].4)" express type which is not allowed.

The "[x]" placeholder represents the value of the Tag associated to the object's Tag property.

 

Pointing to Array elements

An element from an  Array Type Tag variable can be assigned in the same way as pointing to a variable bit.  Also in this case, after having associated the Array variable to the object, the number of the element to point to must be inserted in the ""Input Expression Code" field by specifying it between square brackets.

 

For example, to point to the first Array element, in other words element 0, you will need to insert the "[0]" syntax. .

 

 

Array elements can also be used within logic functions and other functions such as:

 

This expression executes an AND logic between element 2 of the "[x]" array with element 3 of the "2:Tags/2:myBoolArr" array.

 

This expression executes an AND logic between element 2 of the "[x]" array with the element 3 of the  "[x]" array.  The "[x]" placeholder represents the value of the Tag associated to the object-s Tag property.