Jump to content

torekp

Members
  • Posts

    216
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by torekp

  1. I have spent I-don't-know how many hours working with ways to build, transpose, and graph many-dimensional arrays. Many = more than 2. But lately I wonder: what the heck was I thinking? Why not just do everything with one-dimensional arrays of data, plus an additional one-dimensional array (per array) of sizes? Then when push comes to shove (i.e. it's time to graph something or save to a file) use Reshape Array as needed? Additionally I'm thinking, this might save me the need to convert to and from variants in order to create a don't-care-how-many-dimensions-it-really-has array variable. After all, in this approach all arrays have "one dimension" regardless of how many they "really" have. Now, surely this has all been done before, so please, point me to it. Also if you have experience with this kind of thing, please share your Do's and Don't's.
  2. This sounds like a great idea, care to explain more - by attaching a simple example? :worship: in advance.
  3. Would it be faster than the following simple array trick? I use this a lot: ...but my real life LUTs are massive and performance is everything. Note that I already separate the independent variable X into a separate 1D array and forget about interpolating.
  4. OK, I think of myself as a bit of a Labview geek, but I don't get what's so cool about variants. Obviously sometimes you have no choice but to use them, database stuff in particular. But otherwise, why convert from other types to variant? Also, another person implied that variants are an alternative to passing data by wire. How?
  5. I don't understand what is going into Table 2 - plot colors and point styles, stuff like that? I like snooper's idea, but if you don't need to query limited ranges of data, maybe the best thing would be to store the X values and Y values as "blobs". Then you could put multiple plots' and graphs' worth of data into one table, as seems to be your intention, and only have a few rows. I'm pretty much a DB ignoramus so take this suggestion with a grain of salt. In my limited experience of transferring data to/from LabView and DB, there is no problem dealing with a few thousands of rows in a table.
  6. Create a Property Node by right-clicking your Intensity Graph on the block diagram. Select Z Scale -> Range -> Maximum. (You can enlarge the Node to two lines and add Minimum as the next property too, if you want.) What this does is color all points at or above your Maximum as white. I figure and hope that's what you wanted.
  7. Try this. I'm assuming that your array has an integer number of repeats of the same voltages (e.g., 0,1,2,3,0,1,2,3; not 0,1,2,3,0,1,2). Or else that you don't mind the resulting array getting padded with 0's to fill the last column. Labview 8.0, but if you don't have 8 it's easy to reconstruct. Download File:post-4616-1150314694.vi
  8. Here's another few array tricks, primarily sort_Excel_style, which crelf's multicolumn listbox sorter reminded me of. This isn't as user-friendly, but it allows you to pick multiple columns (or rows instead) by which to sort. So if two lines are "tied" (have the same thing) in column 1, you can break the tie using your second-priority column, say column 9 for example. And if they're equal there as well, then ... and so on for up to 7 "priority" columns. Why 7? It would get more and more clumsy for more priorities (see middle diagram below), and I couldn't figure out how to make it inherently flexible. Download File:post-4616-1149618861.zip
  9. mballa makes a good point about controls with no connection on the connector pane. I often make a control with no connection in subVI GUIs where the subVI gets called multiple times, and on the 2nd and following calls, I want the control to start out with the value that the user last left it with. Also, you probably want to modify the VI properties of your subVI. Hit ctrl-I, select Appearance, and check "show front panel when called" and "close afterwards if originally closed".
  10. Oh, NOW you tell me, now that I've reinvented the wheel Thanks for the link - now how do I get the LV8 version of the GOOP toolkit?
  11. More free advice worth twice the price: If you're at all familiar with Matlab, I would strongly urge you to write a version of the Matlab program that can handle a whole array at once. Array manipulation is what makes Matlab great! If there's a lot of data, your performance will improve.
  12. Manfred, I tweaked your VI to make it even faster. At least, it's faster with really large strings (I used a large text file to test with). I'm throwing in the tester VI. The difference is, I initialized the array shift register with the original string (as byte array) and used replace array element (at index i) instead of append to array. You also can use this trick when you are deleting elements instead of replacing them - just be sure to keep track of the modified array length, and take a subset after the loop. Download File:post-4616-1147350812.viDownload File:post-4616-1147350375.vi Edit: revised to eliminate the bug pointed out by larsen
  13. Here's a small LLB (LV 8) with some of my favorite Stupid Array Tricks. Array_of_Indices is a tiny little block diagram that I got tired of making over and over. listbox_to_booleans and vice-versa do exactly that. linspace_N_points_DBL creates a linearly spaced ascending or descending series; any resemblance to the Matlab command linspace is strictly in the mind of the author. And my favorite, multiple_indices_from_array, it's simple, stupid, and oh so useful. I wrote it before I learned to do the polymorphic VI thing, and I wonder if it isn't a little faster-executing this way anyway. And besides, it's very handy if you want to index multiple array types with the same list of indices, which I do a lot. Any suggestions, comments, or reciprocation appreciated. I'd share more, but I forgot what it was Jim Kring said about how to keep you-know-who from copyrighting my ideas. Download File:post-4616-1145623818.llb
  14. You should also change the Plot.PointStyle to a number > 0.
×
×
  • Create New...

Important Information

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