Jump to content

Chris Davis

Members
  • Posts

    423
  • Joined

  • Last visited

Posts posted by Chris Davis

  1. index.php?app=downloads&module=display&section=screenshot&id=50

    Name: Example - Multiply Two Numbers Script.vi

    Submitter: LAVA 1.0 Content

    Submitted: 03 Jul 2009

    Category: VI Scripting

    LabVIEW Version: 7.0

    Version: 1.0.0

    License Type: BSD (Most common)

    Potentially make this available on the VI Package Network?: Undecided

    Example - Multiply Two Numbers Script V1.0.0

    Copyright © 2006, Chris Davis

    All rights reserved.

    Author:

    Chris Davis

    --see readme file for contact information

    Description::

    This simple VI uses scripting to create a new VI that has two numeric controls and a numeric indicator. The two controls are multiplied together and wired to the indicator

    This VI is designed to help a newbie learn some of the basics of LabView scripting.

    Code was created and tested using LV 7.0. Code should work in higher LabView versions, but has not been tested there.

    Version History:

    1.0.0:

    Initial release of the code.

    Click here to download this file

  2. QUOTE (jlokanis @ Jun 9 2009, 01:52 PM)

    FP Open.vi, FP Read.vi, FP Write.vi, FP Close.vi

    You might want to make sure you have included the DLL that these VIs call (FPLVMgr.dll) where it can be found by the VIs. When you bundle as an LLB using OpenG Builder, it doesn't know that it needs to include the DLL for use in an executable. If you are getting an error 1003 when you try to run the llb code, you may just be missing the DLLs.

  3. QUOTE (BobHamburger @ May 17 2009, 07:27 PM)

    Two words. http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&displaylang=en' rel='nofollow' target="_blank">Virtual PC. Its free and does what you are describing without all the complications of dual / triple / quad booting. I even have one setup just for testing software installs. I've set it to "delete changes" on shutdown, so its always a fresh install of XP when I need to test a software install.

    I would also echo the calls for source code control, having the ability to "fall back" to a version that works with the click of a mouse is, at times, priceless.

  4. I'm in a similar environment to you and your team. I have one other developer that I'm working with and he and I are working to make our environment more software engineered. I'm finding that spending time on our reuse libraries, and using VIPM to package and distribute them, even between two people, has saved us time (and thus money) already. SVN, which you already mentioned you have, was another huge time saver. Setting up standard templates for programs, to make it easier to read and understand other people's programs was also a big deal.

  5. Control references are something that you don't want to close until you are completely done with them, like at the end of the program. I do believe that you don't actually have to close them anymore, as LabVIEW will take care of them, although closing them explicitly is still considered the best practice. You may also want to look at using a subVI that has the ability to change the same property(or properties) on controls by the label text of a control. All control references can be gathered dynamically from LabVIEW using the built in VI Server methods (All Controls []), then label text can be gathered in a for loop and searched to find specific references. I don't have an example with me, and I don't have LabVIEW loaded, but if this doesn't make sense, I can upload a snap shot.

    Chris

  6. QUOTE (Michael Aivaliotis @ Mar 11 2009, 06:28 PM)

    Nowadays I prefer video. It's so easy with Screencast.com and Jing (is screencast.com blocked Cat?).

    I'm not sure about screencast, but I know that flash is blocked, so the videos that you post are blocked. I'm at a .mil computer too. I can't even post to lava at work because the php script redirect that goes on when you want to post is blocked. I solve this problem by having a non-internet LabVIEW computer right next to my "Internet" computer (sharing keyboard, monitor, and mouse via a kvm switch) so that if I find something on lava I want to see, I can open it quickly. I now use a laptop hard drive instead of a thumb drive to move stuff between computers.

  7. QUOTE (Ton @ Feb 9 2009, 11:38 AM)

    What version of LabVIEW are you using?

    I've had it working in every version of LabVIEW I've tried since 7 (7, 7.1, 8.0, 8.2, 8.5). I didn't do anything special, just added the keywords as properties within TortiseSVN's panel in a file's properties, then did a commit. I have the same text on my front panel and block diagram, no problems. In fact, it seems like Jim Kring pointed me towards the technique, but I can't find a mention of it in his blog or in any emails I have at my fingertips, just have it stuck in my memory somewhere. I'd post a screen shot or something along those lines, but I don't have anything in front of me, and I can't post from work. The only things I know that can trip one up are, make sure when you type Author, Date, Rev into a file's subversion keyword properties the three words are space-separated, not comma-separated like any normal programmer might expect.

    • Like 1
  8. QUOTE (Donald @ Feb 6 2009, 07:33 AM)

    What is the most efficient way to get some SVN properties like Revision and Author on the VI front panel (e.g. OpenG VIs)? For text files the SVN keyword substitution works very well, for binary files (like VIs) I'm not sure how to handle this without writing some automation code.

    I'm doing this now and it takes no special code modifications whatsoever. Just put the following free label on your front panel, and block diagram if you wish.

    $Author::								  $$Date::									$$Rev::									 $

    Then add those subversion keyword replacements as subversion properties to the VI's you want modified. The next time you commit, (which you will have to do to make the subversion properties change) you'll see the text updated. I've only done the keyword properties on windows clients, but it works every time.

    BTW, this technique is known as "fixed length keyword replacement", so the spaces above are required. Subversion will search out the $Author:: $ text in your binary file, and replace it with something like $Author::Chris $. You may end up playing around with how many spaces you put in the date line, it is always the longest amount of text.

  9. QUOTE (Neville D @ Feb 4 2009, 12:18 PM)

    Thats a very cool idea. But did you see any performance benefit by manually farming out processing to different cores?

    N.

    Sorry I haven't gotten back to you neville. Honestly, I didn't see much performance gain when I was the one assigning the tasks to a specific processor. But I could see where the process of tasks switching processors would cause my program to take a hit (albeit not a big hit). Others, who are using more intensive tasks, could see other responses. But since I had tried it, and the original poster had a question about timed loops, I thought I would throw my 2 cents in.

  10. I believe the new standard font on Vista is bigger than it was on XP. That being said I believe you can revert to the classic XP look / theme without having to revert to XP or develop things from scratch. I don't run Vista myself, but Microsoft did something similar when they introduced XP, they had a "classic" theme which made the system look like it was running 2000. Fairly simple directions are listed here.

  11. I've been working on this topic recently as well. NI introduced this in LabVIEW 8.5, although I get crashes when I try to set four separate while loops running on different cores. I haven't upgraded to 8.5.1 so your mileage may vary. In 8.6 I was able to get four timed loops to work on four separate cores.

    Anyway, back to your original question. I believe if you prototype your work you will see that for most code the timed loop will work and run as fast as possible when setting a dt of 0. But while you are prototyping you should try putting a "regular" while loop inside a single-run timed while loop. This will allow you to use the timed loop to only set processor affinity. Your code will be slightly "messier" but you may find it does exactly what you want.

    Enjoy,

    Chris

  12. QUOTE (Daklu @ Nov 6 2008, 06:09 PM)

    If you can tell us, why can't you use VIPM to make packages?

    QUOTE

    You may want to take a look at http://forums.jkisoft.com/index.php?showtopic=857' rel='nofollow' target="_blank">this post from the VIPM forums which kind of explains how the dynamic menu thing worked for OpenG. I'm using this setup now and it works like a charm.

    Honestly, I was using OpenG Package Builder for a couple of years and was fairly pleased with it until I tried to change something or customize something a little more than I was comfortable with. Then my self built packages started to not show up in the palettes and other problems occurred. The simplest solution I could come up with was to install in the user.lib and provide a dir.mnu in the package for each directory I made under the user.lib palette. This became more and more of an issue when I added or removed things from a palette I had customized in some fashion.

  13. I wanted to comment on this thread as well before it went away. Justin mentioned that he doesn't have an "off-site" level of backup protection. I found a solution to the off-site level that I think meets most personal needs. First off you need to choose an off-site location. I choose a company called IXWebhosting (www.ixwebhosting.com) they provide web site hosting services with "unlimited

    hard drive space, at a nominal cost (2 years of service is $100). I then setup a location on that web server that is not visible from the internet, only visible via FTP. I then use an FTP program called Transmit from Panic which provides me the capability to mirror directories on an FTP server. I use an Automator script that is triggered at various times during my work day to backup parts of my hard drive. This works best for me because when I and my wife are at work, and my kids are at school, no one is using my cable modem. This idea depends on having a broadband connection with a somewhat decent upload pipe. I have about 512kb avaliable to me, and when I make lots of changes to my family photos with iPhoto, it can take a couple of days to recover. This isn't acceptable in a work situation, but in a work situation, I'd be paying more for a better upload pipeline to the internet. As an added benefit the web site that IXWebhosting provides gives you lots of emails, ftp accounts, and lots of space to publish your own personal projects / web pages.

    QUOTE (ASTDan @ Nov 4 2008, 01:56 PM)

    On a simple level, a server is just another computer. Like Justin mentioned, you don't have to spend a fortune, but you'll want to make sure you know what you are buying. Most people who setup their own server run some form of linux on it. If you choose to run the program Justin mentioned, backuppc, you'll have to run some form of linux or unix. All of the major linux distributions have tried to make it very easy to make sure your hardware of choice runs fine with their operating system decisions. As such, they usually provide a "Live CD" which lets you try out a version of linux that you want without actually installing it onto the computer in question, everything runs from the CD. Makes a nice way to "try before you buy". Your choice of hardware will determine how much you spend, but deals like this computer and three of these hard drives would allow you to build a server with 3 500 GB hard drives in RAID 5 for around $310 before tax and shipping. That is assuming you have a spare CD drive laying around. As Justin also mentioned, there is a little bit of a learning curve when setting up your own linux server, but it can be good practice to learn the in's and out's of the setup process so that you have a good idea of how good your hardware will perform. Finding a place in your home to store this computer getting the appropriate power and ethernet connectivity could be another problem.

    Justin's mention of backuppc has got me thinking about building my own server to take advantage of this program to perform incremental backups of my Music/Movie/TV Show and Picture selection.

  14. QUOTE (Paulus @ Oct 22 2008, 06:56 PM)

    Array handle type

    after defining the type in a header used by the DLL with code, typically something like this

    typedef struct {

    int size;

    double elt[1];

    } dblArray;

    typedef dblArray **dblArrayHdl;

    I have passed arrays, both 1D and 2D to and from a C DLL and LabVIEW (6,7, and 8) and had no trouble. A couple of things that I kept in mind to make things work out.

    1. My C DLL never, ever, resized my LabVIEW array. This point is, from what I can tell, the most critical. If needed, I would create a function, or a mode of a function that returned how big LabVIEW needed to make the array it was going to provide to the C DLL to fill up.

    2. Don't use Array handle types, use Array Data Pointer. Pass the array bounds to the C DLL if needed.

    I have found that LabVIEW performs any endian conversions that are needed for you, which, as far as I can tell, is an undocumented (or at least, rarely mentioned) feature. I've used the process of having a C DLL fill up LabVIEW arrays pretty extensively and had no problems, as long as I follow the two rules mentioned above.

    Good Luck.

    Chris

  15. I also have to deal with this issue of having all my development done on a non-Internet connected computer. As a word of warning, you might run into a problem with the installation of VIPM 2 on a computer that has been "locked down". VIPM's installation expects to be able to write to your c:\windows directory as well as the c:\program files directory. You might want to do the install of VIPM without LabVIEW on a computer that you have full control over that is connected to the internet, such as a home computer. That being said, OpenG packages are worth the hassle, as is VIPM. Kudo's to Jim and all of JKI for a great program.

  16. This can be done now, using scripting. I'm using a VIPM 2 pre build VI to check the format and presense of VI properties text, as well as block diagram and front panel free label text. Using the private save instrument invoke node would allow you to save the results of an automatic copy/paste routine.

    I had thought about using this type of technique in conjunction with other code documentation techniques to provide a way to parse a directory of code for "developer's manual" entries to be able to produce an automatic developer's manual on a project.

  17. QUOTE (Shaun Hayward @ Sep 19 2008, 03:02 PM)

    ...that's what they always say... :ninja:

    ...seriously though, I guess it was more a question of does the system cope with very high numbers of revisions, or does it start to break down at a certain point, but looking at yours and PJM's answers, I'm getting the feeling that it is not a problem

    I'm at over 3200 on a single repository and have had no problems with svn.

  18. QUOTE (Raymond Tsang @ Aug 29 2008, 03:59 PM)

    However, I guess I already know where exactly the memory leak is. It leaks whenever I convert a number to a string, which I cannot avoid.

    Error 6 is often associated with a network share being unavaliable when trying to write to it. Are you by chance writing this file to a network share?

  19. QUOTE (Tom Bress @ Aug 25 2008, 10:12 AM)

    That's one of the reasons why I was advocating an external board to help grade certification exams. An external board would have more practical LabVIEW application programming experience than most NI employees, and would be able to pick up on things like this.

    Who would you see sitting on this external board? LabVIEW Champions? Exisitng CLA's? CLD's?

×
×
  • Create New...

Important Information

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