Jump to content

hooovahh

Moderators
  • Posts

    3,365
  • Joined

  • Last visited

  • Days Won

    268

Everything posted by hooovahh

  1. I this case I would call that a feature, which clears the error, which is the intent. EDIT: I also like the idea of putting an X on VIs that run regardless of the error. I do this on driver level code I write for the close tasks but think it would be best to make it clearer.
  2. I don't believe it will. There are several functions (like Close VI Ref) that will function even if an error is passed in because it knows it is a cleanup operation and should try to run no matter what.
  3. Yeah stupid me forgot to test the type cast. In either case I can suggest an improvement. Turn on For Loop Parallelism for the for loop, and for the number of instances wire the array size. This way they will all be closed in parallel like your first post. To do this you'll need to remove the shift register, but again as stated we don't care about the error so just pass out the last one from the for loop and clear it.
  4. After a few tests I didn't come up with anything. I thought I'd be smart and use the Coerce to Type but it also only works with user events of the same data type. Another method was OpenG Variant to Array of VData, then Variant to Data, or Coerce to Type of a user event that is a variant type. That didn't work either. So my official solution is to change your architecture to either have all user events user the variant data type. Or only have one user event with the variant data type. And in both situations convert back to the usable data type where the data is used. Sorry I couldn't come up with something better.
  5. I can't seem to find it at the moment, but I remember seeing a post someone made at NI's forums where they used VLC to perform an operation similar to what you are asking using ActiveX. It didn't fully work but I saw what they were going for and maybe that is an option. VLC by the way plays just about everything under the sun and I'd be surprised if it didn't play mov files. Since I can't provide a link to that idea here is another topic very close recommending a command line call to FFMPEG which might be useful too. Oh here is another similar topic.
  6. I'm not apart of the beta, but if I was I think I wouldn't be allowed to answer that. I can say 2013 SPI doesn't have the type of functionality built in that you are looking for.
  7. I've done some work on tables to make them more user friendly. Things like Tab, Enter, Shift+Tab, or Enter, formatting of cells to accept strings, or numbers or drop downs. All of these things are a manual process. LabVIEW gives you the controls to be able to do what ever you want, if you don't mind spending the time getting it right. I think some of the slowness you are seeing is because of custom cell formatting on each cell that you have. LabVIEW had a few functions for coloring an entire column, or row a specific color and that helps with performance, but having each cell individually colored is more difficult for LabVIEW. It even struggles with cells that aren't being shown. So if you have 10000 rows with custom formatting it doesn't matter that you only see 5 rows at a time. There are a few techniques to help with this, things like a virtual table that only shows 5 rows at a time, and it loads the data and formatting from some other location. Also in 2013 there were many improvements to tables and multicolumn listboxes to be able to handle this data a little smoother. It looks like you are on the right track, but unfortunately there aren't many native controls for what you want. I'm not sure your application but you could try to do some ActiveX and actually insert an Excel table in a LabVIEW front panel. I've experimented with this and had decent results, even with the free Excel for web pages can be inserted, but with limited functionality.
  8. I probably spent more time on this then I should have but I got carried away. Basically you could do it with multiple loops but there really is no need, you are only going to be doing one thing at a time. This makes state machines a good design. I created a state machine that is string based using an event structure to handle the UI being interacted with by the user. You said you wanted to find the peaks but didn't really specify how long the test should run for so I added a control that at the moment defaults to 5 seconds. So after clicking start it will run for 5 seconds displaying new data on a chart, and keeping track of the first value, and the maximum value. At the end of the 5 seconds you click Exit and Log or close the window to save the data the same way you were before. I also added a splitter and resized the graph with the window. I don't think this does all you need but it is a good place to start and to build on without shooting your self in the foot. Efficiency Checker Hooovahh Edit.vi
  9. I usually recommend looking at one of the shipped examples. Search for Basic Serial Write and Read.vi in the Help >> Find Examples in LabVIEW. This VI shows how to setup a port with the baud rate, and other bit flow settings. Then you write a string, wait, then read the response from the serial buffer. If you have it working in MAX then it should work in here as well. I would normally recommend LIFA but if you already have the code the way you want then I can see why you might want to stick with it. For future projects you might want to try out LIFA. It basically does what you already did for many I/O. It has a base firmware you put on the Arduino, and then you have premade VIs that know what commands to write and read to get the response from the Arduino.
  10. I hope this is what you are talking about http://en.wikipedia.org/wiki/Teaching_grandmother_to_suck_eggs Never heard of it before.
  11. I've been using it almost exclusively on all code in our reuse library and several projects from versions 2011, 2012, and 2013. I've had no issues yet. I've also inlined just about all I can in the reuse library as well without incident.
  12. I have and I maybe optimistic, but I think the community would benefit from it. It does have some quirks at the moment and you can shoot your self in the foot if you don't know the 2 or 3 rules when using it. I think I can have checks for these rules in the design with some extra coding but I want to keep it lean so I'm not sure what I want to do. The main benefit of what I have is the generation of actors, their methods, and even the basic project starting point is done through scripting invoked through the tools menu. This can be done also to add new methods to existing actors and projects. The main reason I haven't released it yet is it was developed on work time and it is used on several projects here. I've recently approached management asking them if I can post parts of our internal reuse library externally, hoping to get more things like this out there. They have yet to respond so I'm guessing they are ignoring my request. If that changes I will try to release all I can.
  13. So like many other developers I have my own spin on the actor design. Had yours been developed when I needed it I may have used it instead but that's besides the point. With my actor implementation I have a actor dedicated to probing the other actors messages. This can be opened by going to Help >> Debug Application >> Actor Probe from the application so it can debug messaging in an EXE. I have a few things I'd like to suggest that you can choose to do or not. In my probe I have the option to allow the size of the history to be changeable. It's not necessary but some times having too large a history can add unneeded extra memory but at the same time when debugging you want it to be larger. I also added a Pause and Resume function because some times messages come in quickly and with a history size being limited I might want to pause and look at what happened while the application continues as normal. Lastly I'd recommend some way to look at the actual data that is being sent. I see you have something for this but for more complicated data structures I don't think you'll see the values. I highly recommend the Variant Probe. With this not only can I see the history of messages sent, I can also look at the actual data that is being sent with it. All of these things combined have helped me troubeshoot multiple applications when deployed and behavior can be slightly different then in a development environment. I do think having a DT between messages is a great idea and I may implement that in the future.
  14. So sorry I re-read my post and I said the wrong thing, I have edited my previous post to be correct. When DAQmx is installed it looks for all versions of LabVIEW installed that it is compatible with and updates those versions to have the DAQmx palette and functions. If you install LabVIEW after DAQmx then you will not have those functions. What needs to happen is to reinstall DAQmx if a new version of LabVIEW was installed after DAQmx. So again to recap, here is an example Install LabVIEW 2012 Install DAQmx 9.7 (this adds support for 2012) Install LabVIEW 2009 At this point you will have 2012 working with DAQmx but 2009 will not. If you then reinstall DAQmx 9.7 it will add support for 2009. But as I mentioned no version of DAQmx supports both 2009 and 2013.
  15. If you installed LabVIEW after DAQmx you will need to re-install DAQmx. But even beyond that you won'd find a version of DAQmx that supports 2009 and 2013 according to this. http://digital.ni.com/public.nsf/allkb/B0D5630C0A50D5C6862578E800459248 In the past a virtual machine (or two real computers) helped with this so that you could have one version of DAQmx with 2009, and another version on a different computer with 2013. You still may run into issues since I'm guessing there are features in the newer DAQmx that aren't in the older. You might just want to develop in 2009 if that is the final form that the code will be in. Going to new versions is easy, going back is more difficult.
  16. I wouldn't think capitalization is the issue, simply because I thought that it defaulted to false. Meaning if there was no entry in the INI it wouldn't allow multiple instances, and only if you set it to true does its behavior change. Sorry never see this before.
  17. Wow very cool. I'm sorry I missed you saying that the Write PNG file.vi didn't work on RT. In either case congratulations on finding a solution.
  18. As usual a unlocked block diagram won't help. In most cases when a block diagram is locked it is for one of two reasons. The code is horrendous and was thrown together quickly for a uncommon function that NI doesn't intend on anyone but them using. Or (and this is the majority) the VI simply calls a Library or DLL function. In these cases I'm guessing NI just doesn't want you to know what the data type to the library calls are. In this case it is the second reason. But I'm guessing you can replicate the function by writing the file to disk and then re-reading it as binary. EDIT: Okay it was simple so I just wrote it. Not sure if it actually works. Image to PNG Data File Method.vi
  19. I love that little VI. It is probably the easiest way to convert a System.Graphics PictureBox image to a LabVIEW image. You can invoke the save on the PictureBox Image saving it to a stream of bytes instead of a file. If you set the file format to PNG you can then use that string with the PNG Data to LV Image VI to get it back. Some things LabVIEW is better at as far as 2D picture controls, and some times the system PictureBox is better so this enables you to go from one to the other without having to perform any I/O operations on the disk. EDIT: Here is an example of reading a file with .Net, scaling it, saving it to a PNG stream, and then using PNG to LV data to draw the resized image again. http://forums.ni.com/t5/LabVIEW/Net-image-resize-how-to-convert-to-format-labview-can-use/m-p/2199022#M704093
  20. Yeah totally agree, but you'd be surprised at the things that are in the block data for a VI file. Description, History, Default Icon, Title, Reentrant setting, Help info, and Version info are just a few things I know how to pull out. But you are right that VI broken-ness you would just have to open the VI reference.
  21. I think this is a weak argument. I mean I agree that it isn't very flexible, but how often do you start a comment with # and then no space? That is the only time a bookmark is made. If you have the comment "Here we take our # of samples and average them" it won't make a bookmark. You need to deliberately make a comment starting with # then no space. Yeah this one I think is a big over sight by NI. I mean they have a product, which semi-relies on free labels to be in a specific format to be able to pull requirements. When making the bookmark manager it should have some how incorporated that standard. That being said I know you can modify the requirements gateway reading functions to look for #tag instead of [tag] just like I think it uses [covers] could be #covers. I just think that what ever you came up with (which looks great and probably is more flexible) probably isn't as fast as NI's implementation, because they were able to put whatever hooks into the VI to make finding bookmarks faster. Wouldn't it be nice if your code used the bookmark manager searching tools instead of your own, assuming NI's is faster for larger projects. EDIT: By the way awesome discovery. Bookmarks are saved in the VI in a human readable format. They can be found by going to the BKMK block of the VI file, this can make finding bookmarks much faster since you don't need to even open a VI reference to the file, you simply need to open it and read the bytes of the file.
  22. Because NI has support for custom Bookmark Managers, I'm guessing that Shaun could make his own that merges the functionality of the two.
  23. Attached is what I was describing. Hydraulic Pressure units Hooovahh Edit2.vi
  24. I'm having some weirdness with the edit cell position selecting the 0,0 cell when it shouldn't so I won't upload what I have. But what you need to do is add an event to the event structure which is "Edit Cell?". Here you can get the String which is the new string value of the cell you edit. Then convert that to a number then back to a string. This is a much simpler way of getting a valid number. Then write that back to the String on the right side of the event structure. In that case you should also fire another Value Signaling event causing the output values to be recalculated with the new value. Also Decimal Digit? function takes a string, not a single char character. You can use this to validate the input as well.
  25. Just an FYI LabVIEW 2013 SP1 appears to be up on NI's site. http://www.ni.com/download/labview-development-system-2013-sp1/4527/en/ I generally only stick with SP1 releases for products, so for me this is when I get to actually use all the new features in 2013 on real programs. Another odd thing is the release date is in the future stating 3/10/14.
×
×
  • Create New...

Important Information

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