Support Variables of List Type and Bool Type
NI supports the variables of list and bool, allowing you to have more variables to choose during NI definition.
List Variable
You can add the list variable from the above entrance and specify its initial value in the format {1, 3, 5} or {'red', 'blue', 'yellow'}. If you select the Auto remove duplicate element check box, the duplicated elements will be automatically removed while adding new elements.
You can do three operations on the list: ‘Add Element’, ‘Delete Element’, and ‘Sort’. The three operations are implemented through the logic Operate on List (Diagnosis > Add Action > Operate on Variable > Operate on List).
- Add Element: Add an element to the end of the list by selecting a variable value.
- Delete Element: Remove a specified element from the list, and you need to define the removal condition.
- Sort: Number variables can be sorted by value, string variables can be sorted in alphabetical order, and object variables can be sorted according to the value of their ID property.
The ‘Loop’ function in diagnosis can support the list variable. After the list variable is selected in the diagnosis loop, the variable name and type of list element are displayed in the UI. By looping the list, its element name can be modified, and this $element variable can be selected in the If-condition. If the element type is object, the object property will also be listed for selection.
In addition, you can get a list’s element count by a newly added function ‘int GetListElementCount(List)’.
Bool Variable
The bool variable can be used in compound/global/local/task variables, not in parser and macro variables. Its value can be True or False, and users can specify its initial value.