Mindmajix

LABVIEW – DELETE, INSERT AND REPLACE IN ARRAYS

DELETE COMMAND:

You can delete an element within a one-dimensional array and a row or column within a two-dimensional array. To delete an element in a one-dimensional array, right-click the array element on the front panel and select Data Operations»Delete Element. To delete a row or column in a two-dimensional array, right-click the array row or column on the front panel and select Data Operations»Delete Row or Delete Column. You can also programmatically delete elements, rows, columns and pages within arrays using the Delete From Array function.

You can delete an element, row, column or page within an array programmatically. What you can delete depends on how many dimensions the array has. For example, you can delete a row or a column from an array of two or more dimensions. You can delete a page from an array of three or more dimensions.

Complete the following steps to delete elements, rows, columns or pages in an array.

Step 1: Place the Delete From Array function on the block diagram.

Step 2: Wire an array of any dimension to the n-dim array input of the Delete From Array function. The function automatically resizes based on the dimensions of the array.

Step 3: Determine which operation you want to perform from the below Table  and complete the associated steps. 

The index input specifies from which element, row, column, or page you want to start deleting, with 0 being the first. The length input specifies the number of elements, rows, columns, or pages you want to delete.

Step 4: Run the VI.

                                                             107                                                                                                                   106

INSERT COMMAND:

You can insert an element into a one-dimensional array and a row or column into a two-dimensional array. To add an element to a one-dimensional array, right-click the array on the front panel and select Data Operations»Insert Element Before. To add a row or column to a two-dimensional array, right-click the array on the front panel and select Data Operations»Insert Row Before or Insert Column Before. You can also programmatically insert elements, rows, column, and pages into arrays using the Insert Into Array function.

You can insert an element, row, column or page into an array programmatically. What you can insert depends on how many dimensions the array has. For example, you can insert a row or a column into an array of two or more dimensions, but you cannot insert an element. You can insert a page into an array of three or more dimensions, but you cannot insert an element, row, or column.

Complete the following steps to insert elements, rows, columns or pages in an array.

Step 1: Place an Insert Into Array function on the block diagram.

Step 2: Wire an array of any dimension to the n-dim array input of the Insert into Array The function automatically resizes based on the dimensions of the array.

Step 3: Determine which operation you want to perform from  the below Table  and complete the associated steps.

Step 4: The index input specifies the element, row, column or page where you want to insert the element or array, with 0 being the first. Elements and arrays are added before the value you wire to index. Resize the Insert Into Array function to insert another element(s) row(s), column(s), or page(s) in an array and repeat steps 2 and 3.

 Step 5: Run the VI.

If the dimension size of the array you insert is smaller than the dimension size of the array you wired to the n-dim array input of the Insert Into Array function, the function pads the array you insert with default data, such as zeros in the case of an array of numeric values. If the dimension size of the array you insert is larger than the dimension size of the array you wired to the n-dim array input of the Insert Into Array function, the function crops the array from the end.

                                                             109

                                                   108

REPLACE COMMAND:

You can replace an element, row, column or page in an array. What you can replace depends on how many dimensions the array has. For example, in an array of two or more dimensions, you can replace a row or a column with a one-dimensional array. In an array of three or more dimensions, you can replace a page with a two-dimensional array. Replacing is done using the Replace Array Subset function.

Complete the following steps to replace elements, rows, columns or pages in an array.

Step 1: Place the Replace Array Subset function on the block diagram.

Step 2: Wire an array of any dimension to the n-dimension array input of the Replace Array Subset function. The function automatically resizes based on the dimensions of the array.

Step 3: Determine which operation you want to perform from  the below Table and complete the associated steps.

The index input specifies which element, row, column or page to replace, with 0 being the first. The new element/subarray input specifies the value you want to replace an element, or the array you want to replace a row, column or page.

Step 4: Resize the Replace Array Subset function to replace another element, row, column or page within an array and repeat steps 2 and 3.

Step 5: Run the VI.

                                                           112

                                            110


0 Responses on LABVIEW – DELETE, INSERT AND REPLACE IN ARRAYS"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.