08-09-2021 07:36 AM
So the results end up looking like this.. I wasn't sure whether having the results appear in this format is preferable?
08-09-2021 07:48 AM
Hi Bag,
@Footballbag wrote:
So the results end up looking like this.. I wasn't sure whether having the results appear in this format is preferable?
So when you don't know if that data format is preferred or not, then how should we know about that?
Why is there a While loop in your last VI when you know the number of iterations before the loop? Use a FOR loop in this case!
08-09-2021 07:53 AM
Sorry, I'm confusing matters. I know the data format with the 5 columns is preferred for me for post-processing. I wasn't sure whether in terms of memory allocation or CPU usage I had vaguely heard it's better to produce results in row's and then transpose (I'm not being clear here because I lack that understanding). Nonetheless I want the array to be formatted with 5 columns and 10 rows for each of the 8 rounds of measurements.
08-09-2021 07:56 AM
I was using the iterator to shut the pump off after the loop has completed its final iteration. I suppose I can do it with a for loop also, though it doesn't seem like it makes much difference. I suppose its an unnecessary complication.
08-09-2021 08:30 AM
Thanks for the pointers, GerdW.
I hope that I am making sense in telling you what I am aiming for.
Kind regards,
Callum
08-09-2021 09:32 AM
We cannot tell what output arrangement is "preferable". You should ask the end users and maybe inspect the requirements document.
You are still way overcomplicating things.
You really should rewrite all this as a simple state machine with a toplevel while loop. Setting all control in edit mode followed by the run button in the tool bar is unprofessional. A end users should never be exposed to edit mode!
I would also recommend to clean up the front panel. A bewildering jumble of controls and indicators scattered randomly all over the panel is not user friendly.
08-09-2021 09:57 AM
We cannot tell what output arrangement is "preferable". You should ask the end users and maybe inspect the requirements document.
Sorry, I mentioned after I confused things, I want the array to be formatted like this:
pump % max speed | S11 mag | S11 phase | S21 mag | S21 phase |
08-09-2021 10:24 AM
Could you see the solution to my current situation of overwriting the column of values completely as in the below image:
I've attached the VI with a slightly cleaned up front panel for reference.
Thanks for the help again.
Callum
08-09-2021 11:59 AM
@Footballbag wrote:
Could you see the solution to my current situation of overwriting the column of values completely as in the below image:
If the data ends up in the wrong place, it is obviously caused by the way you are calculating the indices for the replacement operations. You definitely need to define the problem better because you don't say what it is. Do you want to overwrite or not overwrite? If you don't like how the data is arranged in the picture, you also need to show how you want it arranged.
How big are the arrays coming out of the "Read data" VI?
08-09-2021 12:35 PM
The problem is that you cannot replace a 1D array in a 2D array and specify both indices. Thus you always replace the entire column.
In order to specify row and column indices, you either need to wire a scalar or a 2D array. In your case you would create a Mx1 2D array (And transpose if you want a column array) and replace at the desired locations. Here's a quick draft to demonstrate. I had to take out all your IO, but is should be easy to adapt to your problem.
Modify as needed.