filmov
tv
LabVIEW - Changing Array Default Values
Показать описание
Changing Array Default Values
Here are the steps to manipulate the default values of an array.
1. Create a 1D array shell in the front panel window.
2. Add a digital numeric control to the array shell in the front panel window.
3. Resize the array shell to show at least six elements.
4. Set the value of the third element of the array to 1.0. LabVIEW sets the values for the first two elements to 0.0, which is the initial scalar default for the array.
5. Right-click the third element of the array and select Data Operations»Make Current Value Default from the shortcut menu to set the scalar default value of the third element to 1.0, whereas it was originally 0.0. Right-click the element itself, not the array index display or array shell.
6. Set the value of the sixth element of the array to 2.0. LabVIEW makes the fourth and fifth elements part of the array and sets their values to 1.0, which we set as the new scalar default for the array in step 5. LabVIEW does not change the values of the first two elements because they were added to the array when the scalar default value was still 0.0. When we add an element to an array by entering its value, LabVIEW sets the values of the elements between the current end of the array and the element we added to the scalar default.
7. Right-click the array index display or shell border and select Data Operations»Make Current Value Default from the shortcut menu to set the default value for the entire array. LabVIEW sets the current values in each element as the default value for those elements. For example, 2.0 is now the default value for the sixth element.
8. Right-click the first element of the array and select Data Operations»Reinitialize to Default Value from the shortcut menu to change the value of the first element from 0.0 to 1.0, which is the scalar default value of the entire array.
9. Right-click the array index display or shell border and select Data Operations»Reinitialize to Default Value from the shortcut menu. Notice that the value of the first element returns to 0.0, which was the value of this element when we set the default value of the entire array.
Note In practice, we rarely need to change the scalar default. Typically we set or restore default values for the entire array.
Watch the entire LabVIEW tutorial series here;
Watch the entire TestStand video learning series here;
#labview #labviewtutorial #labviewarrays
Here are the steps to manipulate the default values of an array.
1. Create a 1D array shell in the front panel window.
2. Add a digital numeric control to the array shell in the front panel window.
3. Resize the array shell to show at least six elements.
4. Set the value of the third element of the array to 1.0. LabVIEW sets the values for the first two elements to 0.0, which is the initial scalar default for the array.
5. Right-click the third element of the array and select Data Operations»Make Current Value Default from the shortcut menu to set the scalar default value of the third element to 1.0, whereas it was originally 0.0. Right-click the element itself, not the array index display or array shell.
6. Set the value of the sixth element of the array to 2.0. LabVIEW makes the fourth and fifth elements part of the array and sets their values to 1.0, which we set as the new scalar default for the array in step 5. LabVIEW does not change the values of the first two elements because they were added to the array when the scalar default value was still 0.0. When we add an element to an array by entering its value, LabVIEW sets the values of the elements between the current end of the array and the element we added to the scalar default.
7. Right-click the array index display or shell border and select Data Operations»Make Current Value Default from the shortcut menu to set the default value for the entire array. LabVIEW sets the current values in each element as the default value for those elements. For example, 2.0 is now the default value for the sixth element.
8. Right-click the first element of the array and select Data Operations»Reinitialize to Default Value from the shortcut menu to change the value of the first element from 0.0 to 1.0, which is the scalar default value of the entire array.
9. Right-click the array index display or shell border and select Data Operations»Reinitialize to Default Value from the shortcut menu. Notice that the value of the first element returns to 0.0, which was the value of this element when we set the default value of the entire array.
Note In practice, we rarely need to change the scalar default. Typically we set or restore default values for the entire array.
Watch the entire LabVIEW tutorial series here;
Watch the entire TestStand video learning series here;
#labview #labviewtutorial #labviewarrays