Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Changing Array Default Values

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Complete the following 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 you 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 you 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 you 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 you set the default value of the entire array.
Note  In practice, you rarely need to change the scalar default. Typically you set or restore default values for the entire array.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit