Jump to content

hooovahh

Moderators
  • Posts

    3,432
  • Joined

  • Last visited

  • Days Won

    289

Everything posted by hooovahh

  1. You are going to want to learn how to use the event structure. Your code continually regenerates the images with no wait in the while loop. This will consume tons of CPU resources for no reason if the user isn't interacting with the controls. Using an event structure will also have better response time for large images. I loaded a large image and tried to exist and I had to wait several seconds for the final conversion to complete. Using an event structure it will be immediate if nothing else is being done at that time. Is there a reason all subVIs and primitives have their labels shown? Is there also a reason all labels are bold? The value of Off Channels also doesn't change within the loop, so there is no need to continually read its value and become a FF or a 0. The error data type can have boolean operations like Not operated without having to pull out the Status. As for your questions, (sorry it took so long to get to that). The IMAQ image code has many more tools for doing ROI on sections. The IMAQ tools for ROI are free to download, but to do any manipulation with that image using the ROI you'll need the vision toolkit which isn't free. I added a quick Image Subset to your program but I doubt it is fully what you want. You may be able to get away with using multiple image subset and stitching them together. Attached is my updated version using the changes I mentioned. Jpeg Color Editor Hooovahh Edit.vi
  2. No I have no examples. This was just test proof of concept code and I have yet to use it in an application. I don't fully understand what you are trying to do. In the example there is the global event (or rather an event for all children) which is Quit, and then there are events for each child like Set Settings as mentioned earlier. You can generate this Set Settings event which has a variant as the data, and depending on the value of the data do different things. Like the data of the variant can be a cluster of a String, and a variant. The String can be the type of setting you are attempting to set, and the variant can be the payload of the event. I personally use Variant attributes but that is harder to explain if you are unfamiliar with them. Post some code if you are still confused.
  3. I always used Junction back in Windows XP days to have symbolic paths. I had forgotten about that tool until now. Glad to see it is part of the OS.
  4. I always wondered where this additional installer stuff was located. Thanks for the info, I think I may blow my MDF away at some point since it looks like it has all kinds of additional installers for versions of LabVIEW I rarely make builds with. For comparison my NIFPGA is 30GB, but my MDF is only 15GB. LabVIEW 2011 - 2014 installed.
  5. Yup an XNode already exists for this along with many others done by gb119 which are pretty neat. Also there is compatibility issues with LabVIEW but you likely wouldn't know that if you just stick with the newest. For me when I develop code I try to develop it for 2011 knowing the compatibility issues. Here is a chart showing what versions can open what versions, and what versions can back save to what versions. EDIT: Oh and as for cleanup, I generally have a constant on my GenerateCode which can enable cleanup when doing debugging, but then turn it off after I'm done. I also use templates and inline them instead of creating the VI from scratch each time. It is faster to develop this way, but I suspect the scripting is faster to execute too.
  6. Think data flow. You enter your loop it reads the value of boolean as false, and stop as false and then sits and waits forever for a menu selection to occur. Turn on highlight execution and you'll see that there is no data flow. So changing the value of controls is fine, but you are never actually reading those values. An easy solution which avoids the whole "why are we doing this?" question is to just set a timeout on that event structure of something like 100ms.
  7. Okay so this is all conceptual and I haven't actually tested any of this. Notice that in the Run Panel case in the Main.vi you are creating a variant to give to the child. This variant is actually similar to a Variant Repository I posted earlier but that is a different story. In this Variant we embed the same Quit user event. We also embed a Set Settings event, a Get Settings event, and a Get Settings Reply event which is unique for each child. The idea is that you could keep this information and can send user events to one child at a time, or throw it in a loop and set all of them.
  8. Okay I have a feature request. Very often I'll setup a project with an EXE and installer with what I want. Then after changing the software the only thing that the build specifications ever changes is the EXE version, and the installer version. Wouldn't it be nice if you could right click your EXE, and choose instead of Properties which opens the whole window and takes a while to load, just pick "Change Version" and a separate window popus up allowing the version to be changed. Then if you right click an installer and pick "Change Version" a similar window pops up, but this window shows the version of other EXE builds, and allows you to set the installer version, to the same version of the EXE. I'm pretty sure this can be done in a Pre-Build VI but have never tried it. 2014 added new controls for setting build versions programatically. Before then you could do it by setting tags and each version was slightly different.
  9. Flarn does tend to make being a moderator / admin interesting around here. I'm not so sure there is a need for a hard-copy, I mean the description on how to do this is in everyone's RSS feed by now. The step by step is so simple that the posted VI isn't even required. One thing I find interesting is that the signature has nothing to do with the actual code, just the names of the items in it like the VIs used. So before this signature weakness was found, one could simply install a valid tool, then edit the VIs in it to get the functionality you want. Or replace the existing VIs with your own without renaming and it would work. If I were investigating how to do this type of thing that would be the first step I would take, so I'm sure others found a weakness in the signature process before.
  10. I haven't personally used this QuickDrop but it allows you to take a selection of code and make a template from it. Then that template will be in your palette, and you can drop it down from quick drop.
  11. This chart is always a pain to read but I think 8.2 is the newest version that can open 4.x version. EDIT: Oh and by the way I started in the 6.x era so I think my code can be opened in modern versions.
  12. We need to have like a self confession thread, where we post code we are ashamed of. I haven't looked at any of my old code on my site, and I'm going to pretend that site doesn't exist except once a year when I have to pay the fee to keep it up.
  13. Okay so I didn't get around to doing the double the buffer size technique. I'm not convinced it would be for the best due to the extra memory needed, and the fact that two writes need to take place for each write. But attached is a non-XNode version of the circular buffer which is implemented with strings. I wanted to share this improved version with offset and length for reading subsets of data, and not performing a shift 1D array if it isn't needed. Also if a shift was needed for the read, then write the shifted data back. There were also some bugs with what happens if the buffer wasn't filled once. There is also a mild bug with doing a read when the offset is greater than 0, and the length is greater than the size it will wrap around. I didn't get to figuring out a way to fix that. If anyone gets a chance take a look at the read and see if they can come up with a better way, or give the thumbs up to the way it was done. Non XNode Circular Buffer.zip
  14. The future of technology, or at least what people won't shut up about, is wireless. You know, things like walkmans, flashlights, and solar calculators.
  15. Okay I think I get it but for this to work the dual write operations need to stop after every buffer location has been written to once correct? allocate a buffer twice the size the user requested apply writes to buffer also to buffer[usersize + i] Once the buffer has every point written to, continue writing at buffer[usersize+1] wrapping back around to buffer[0] after buffer[usersize+usersize] is written use Array Subset Node to return any contiguous part of the buffer very efficiently as a contiguous subarray
  16. I had a function a while ago and I'm not sure if it was included in this post but it would give relative position from a parent to a child, or absolute position from the desktop to the child. Saving this information, then using the Windows Move function on load could be done relatively easily. Now if you have custom connections for a child window you'll need some custom way of re-making those connections on load. This demo just shows a random number generator for a window, but one could see that a publisher subscriber architecture could be used where a child window subscribes to data to display. And these are the connections I am talking about that would need to be saved and loaded as well.
  17. You should it is awesome and I'm not biased at all...okay well I just wanted to explore more XNode stuff, and I think it could be useful. Right now the read returns the whole buffer, I can see that reading a subset could be useful especially if a rotate is not always needed. Also I'm getting the idea that if a rotate was required, that we could then write the newly rotated data back and set the pointer back to 0. I think this would mean that you can no longer have a write and read happening in parallel, but right now I think you could, not that I would want to. The benefit of this is that if you did two reads in a row before a write, the second read would never need a rotate. All sound improvements team, I'll implement these changes soon.
  18. Okay I typed up a big long explanation on how it worked and half way through I figured out it wouldn't work the way I was thinking. Never mind I need to see an example first.
  19. Oh that is clever. So the trade off would be that your data in memory will be twice the size it needs to be, but no shifting operation is needed, and the other down side is each write is two writes. I'm not convinced it would be worth it, but it could be done. Again I guess it comes down to the fact, will you expect to be reading more than you are writing? Or writing more than you are reading?
  20. That's neat, never seen this functionality before. I have a bunch of other possible choices for XNet things too. XNet Database / Device / Frame / Signal / Cluster / Session etc. So I'm guessing it queries your system somehow to show what types of I/O references it can be. I really expected DAQmx to be in the list but it isn't.
  21. The first place I thought about using this was in a graph situation, where you have a circular buffer of XY pair data for N channels and each channel maybe updated at different rates. In this case it made sense to read the whole buffer. I can see a use where you may want a subset and you can do that now of course reading the whole thing then get a subset, but it could be more efficient.
  22. Good questions and I'm up for changing. At the moment the way this works is a pointer does exist which keeps track of the next write location. This means that after a write is performed, the value at index 0 may not be the oldest value in the buffer. Lets say your buffer has 100 elements. If you write 90 elements, then index 0 is the oldest, and index 89 is the newest. Index 90 through 99 will be the default of that data type. If you then write another 20 elements then the oldest data will be at index 10, the newest will be at index 9. This makes the write relatively fast because it doesn't need to shift the array around. I could do shifting after each write so index 0 is the oldest, and that would make reading easier because no shifting around would be needed. I designed it thinking that writes take place more often then reads. Without knowing the application this may or may not be true. So because the write doesn't shift the array around, the read needs to. I suppose one improvement is after the read does the shift around, it could write the array back, so that if you read again you won't need to shift it around again.
  23. Version 1.0.1.13

    998 downloads

    Description This package contains functions for maintaining a circular buffer. Create the Circular Buffer using the Initialize Circular Buffer function. This makes a DVR, and the data type of the DVR changes based on the data type specified for the circular buffer. The data type can be any type as long as it is not an array. It must be a scalar. The size of the buffer is specified on initialization but can be changed using the Change Circular Buffer Size function. Add data to the circular buffer using the Write Circular Buffer function. Scalar values can be added, or a 1D array of data can be added. The data type of the values to be written is the data type defined in the initialize function. Read the data back out of the circular buffer using the Read Circular Buffer function. The data type of the read values will be the data type defined in the initialize function. Cleanup the program by destroying the DVR on exit. An example VI Circular Buffer Demo shows how a Circular Buffer can be used. XNode Disclaimer The Initialize, Read, Write, Get Status, and Change Size functions are implemented as XNodes. NI does not provide support XNode development. For an introduction to XNodes read Adam Rofer's "XNodes - A Crash Course" presentation (http://lavag.org/files/file/56-xnodes-a-crash-course-powerpoint). Dependencies LAVA Palette-1.0.0.1 How It Works The source is all open and the template VIs for each XNode is what is executed when the XNode is generated. This means you are welcome to try to further optimize these XNodes by editing the templates. A new instance of the XNode will need to be placed which will force the new code to be used. If anyone finds performance improvements for these functions please feel free to post in the support topic. Because the size of the buffer is practically unbounded, I wanted to avoid unnecessary data copies, which is why it is designed around DVRs. There exists 3 things in the DVR, the buffer size, a pointer to the current write location in that buffer, and the array of scalar values, whos data type is defined during the initialization.
  24. Name: Circular Buffer Submitter: hooovahh Submitted: 24 Sep 2014 Category: XNodes LabVIEW Version: 2011License Type: BSD (Most common) Description This package contains functions for maintaining a circular buffer. Create the Circular Buffer using the Initialize Circular Buffer function. This makes a DVR, and the data type of the DVR changes based on the data type specified for the circular buffer. The data type can be any type as long as it is not an array. It must be a scalar. The size of the buffer is specified on initialization but can be changed using the Change Circular Buffer Size function. Add data to the circular buffer using the Write Circular Buffer function. Scalar values can be added, or a 1D array of data can be added. The data type of the values to be written is the data type defined in the initialize function. Read the data back out of the circular buffer using the Read Circular Buffer function. The data type of the read values will be the data type defined in the initialize function. Cleanup the program by destroying the DVR on exit. An example VI Circular Buffer Demo shows how a Circular Buffer can be used. XNode Disclaimer The Initialize, Read, Write, Get Status, and Change Size functions are implemented as XNodes. NI does not provide support XNode development. For an introduction to XNodes read Adam Rofer's "XNodes - A Crash Course" presentation (http://lavag.org/files/file/56-xnodes-a-crash-course-powerpoint). Dependencies LAVA Palette-1.0.0.1 How It Works The source is all open and the template VIs for each XNode is what is executed when the XNode is generated. This means you are welcome to try to further optimize these XNodes by editing the templates. A new instance of the XNode will need to be placed which will force the new code to be used. If anyone finds performance improvements for these functions please feel free to post in the support topic. Because the size of the buffer is practically unbounded, I wanted to avoid unnecessary data copies, which is why it is designed around DVRs. There exists 3 things in the DVR, the buffer size, a pointer to the current write location in that buffer, and the array of scalar values, whos data type is defined during the initialization. Click here to download this file
  25. Welcome to the future. You probably don't need me saying this but 8.6 was released over 6 years ago. Not that that means you need to upgrade but there's a bunch of good stuff since then. Oh and I think things like Call and Forget and the Static VI reference were added in LabVIEW 2011, someone correct me if I'm wrong.
×
×
  • Create New...

Important Information

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