08-04-2015 09:18 AM
I posted something similar to this before, but what I got didn't work. So this time I'll try to be more clear with what I am trying to do. What I have done is combine two 1d arrays into a 2d array, and am using it to run an experiment. I split the 2d array into a 1d array by column, and am trying to get the while loop that the array is in to stop after the last element of the array is indexed. I need to use a while loop because the array is constantly updating because the number of elements can be changed while the program is running. What I am having trouble with is getting the while loop to stop after the last element has run, because the last element is subject to change. Any ideas?
Thanks
08-04-2015 09:27 AM
Why is the array changing is size? How do you know when the array has stopped changing? Is data only being added or is the whole array changing?
08-04-2015 09:27 AM
Sounds like you may want to use an actual state machine instead of a while loop.
Have you tried polling the array size and comparing it to the index terminal? (I think altenbach suggested that in your last thread.)
08-04-2015 10:06 AM
We probably would need to see some example code. If the array is changing, how do you know what the last element is. What if the array grows again to size >2 during the last iteration.
Wherre is the data coming from? Where is it going?
08-04-2015 10:43 AM
I can't get the code to you guys right now because of some admin issues, but how would I poll continously for the Array size. Is there a VI that does that?
08-04-2015 10:47 AM
Here is the code
08-04-2015 11:05 AM
As I told you in one of your other threads, your stopping logic is a mess and it looks like you do not have a good idea of data flow.
Also as I said before, give us a better understanding of what it is you are trying to do. I think you will need to do some rearchitecting to do this properly.
08-10-2015 08:25 AM
I am trying to run a measurement using labview to control different instruments. The program is suppossed tp work in that it runs a measurement for each current setpoint inputed, for 1 magnetic field setpoint. So for example, if the magnetic field setpoint is 8000 gauss, and the two current setpoints are .00001 amp, and .0001 amp, it will run the meauserement twice for the 2 current setpoints for each magnetic field setpoint. What I am trying to do is that sometimes, I might have to edit the magnetic field setpoints while the program is running. I am having trouble with refreshing the magnetic field setpoints, which allows the user to input a new magnetic field setpoint while it is running.
08-11-2015 05:17 PM
When you update a field in a while loop, such as the array for B Setpoints, it should update the next time the loop is run. This leads me to belive there is something inside your "B setpoint genorator.vi". Try to take a closer look at the subVI and see if the value is changing in there.