LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When using ‘Replace Array Subset’ VI, Values revert back

Solved!
Go to solution

 

What is the proper way to insert subarrays into a 2-d array? The attached example is a simplified version of my vi I am having difficulty, in the process of building a 2x4 array that is further processed. My actual application has both a DAQmx device and a bench-top DMM reading the same series of voltages and currents with the purpose of deriving calibration constants for the DAQmx for voltage measurement. In the example I’ve replaced the DAQ and the DMM with 2 function VIs F1 and F2 that generate a slightly different outputs in the producer process, and the results are to be inserted into “Array” in the consumer process. Running it you will see that ‘Array’, which is initialized with 1 will display the results momentarily then revert back to a value of 1 for each column of the array. I want the new inserted values to remain for each column rather than reverting back to the initial value but they immediately go back to 1. It seems to me that ‘Replace Array Subset’ should replace, and not temporarily! What am I doing wrong here?

0 Kudos
Message 1 of 3
(2,142 Views)
Solution
Accepted by topic author peacefulpaul55

You forgot to put a shift register on your outermost while loop!

 

(or use a feedback node within the innermost loop)

 

PS:  There is no need to write to a local variable of "Array" when you are writing to the terminal of "Array" at the same time!

Message 2 of 3
(2,133 Views)

Thanks!  Was having the same issue.  I will reme.ber this.

0 Kudos
Message 3 of 3
(1,588 Views)