Jump to content

mcguirpa

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by mcguirpa

  1. QUOTE (Kevin P @ Mar 11 2008, 02:45 PM) That's it isn't it? Sometimes all it takes is a gentle nudge in the right direction :worship: Thinking about it in a different way: If I had a resolution 1mm x 1mm then my location would be the same as the index in the array I wanted to populate (assuming I rounded all the data to the nearest mm and normalised it all to a suitable zero). So If I want to change the resolution all I need to do is normalise the data to a suitable starting point by subtracting a constant (essentially making the top left position = 0,0) then divide each value by my resolution to give me the index of the value in the population density array I need to increment. Many, many thanks! *** With regards to my initial query about keeping a VI running while i played with the data and not having to load the data again, I sorted that out with a while loop. But I now have a related question: Once you stop a while loop and pass the data out of it how do you make it run again? The VI i've posted below opens a file, plots the data then lets me choose the timescale and select the data I want to keep. As soon as I stop the loops where i choose the timescale and select the data then the data is saved and the VI stops. How do I keep it running so I can make a different selection of data? As it is, it's ok for a run where I use one tracer, but it's not inconceivable that I could put numerous tracers through the reactor one at a time and save all the data to the same file (saving data for each tracer seperately at the time of the run is not an option unfortunately). I would then need to look at the plot, select the data corresponding to the first tracer, save to a file, then select the data for the 2nd and save again etc. How would I do this? I've tried using while loops in various ways but I can't get it to do what I want.
  2. QUOTE (BrokenArrow @ Mar 10 2008, 10:42 PM) Cheers. The answer to no. 1 is absolutely obvious now you've said it. I can have an array of time steps inside the loop and index it using the loop iteration. I was trying to feed the time steps in from an array outside the loop. The 2nd one isn't really related to the screenshot. What I'm really looking for is ideas for a reasonably efficient algorithm. The application I have is following a radioactive tracer particle inside a chemical reactor. So the data I have is time and location data. What I want to do is build up a picture of where our tracer spends the most time so I need to build up a density map from the location data. I have the bare bones of what I think I need to do: Initialise an array where each value corresponds to a location, so say my reactor is square with 9 possible locations ofr the particle, initialise a 3x3 array. Then loop through the location data at each time step and work out the location, then increment the corresponding value in the array by one. In reality I'm tracking the particle to an accuracy of 1mm in a 100x100x100 mm reactor. I could take locations of say 5 mm^2, so initialise a 20x20 array to represent my reactor (in 2D for the minute). The only way I can think of to populate the initialised array is then to loop through the data and use a case structure to decide which value in the initialised array to increment. But in a 20x20 array there's 400 possible locations, so I'll need 400 cases. Doable, but not pretty. Surely there must be a mnore elegant way to do it.
  3. QUOTE(mross @ Mar 10 2008, 09:42 PM) That's exactly what I was looking for. Cheers.
  4. Hi all. I have a slider on my VI with an indicator next to it, which displays the position of the slider. How do I make it so I can overwrite the value displayed in the indicator and have the slider move to the new value?
  5. Hi everyone, total newb to this. I've started writing a vi and pretty much got it doing what I want, but I want to make a few improvements and I'm not sure about how to go about it. Part of my vi is attached. This loop takes data from an array where the user can specify which columns are passed to the loop. There is a bottle neck in initially passing the data to the loop as there is a sub vi which does some array maniupalation to put the data in a form suitable for plotting. So what I would like to do is to be able to simply load the data then have the user be able to clear the graph and replot various columns against one another without having to load all the data again. There are some further things I would like to do, but a little less essential at the minute: 1. How do I vary the timing of the loop? One of the columns in my data is time, I have done a little routine to get the difference between each time (roughly 25 ms hence the delay of 25 ms in the loop) however when I try to delay each point by the 'real-time' delay I think all that is happening is that the loop is running right through with the first delay, then with the second delay etc. etc. Hope this bit makes sense 2. A density map. This data is time and location, what method would I use to make a plot of how long our tracer spends in each location over the course of a run? I have a rough idea that I would need to make a 2D array where each value corresponds to a location then loop through the location data and populate my array. Not sure what the best way to go about this would be though. Anyways, any help appreciated
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.