Jump to content

jgcode

LabVIEW Tools Network
  • Posts

    2,397
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by jgcode

  1. Sorry about the formatting in the readme, I seem to be having an issue that I have posted here. I tried to edit it as best I could.

    *****This plugin was created for a bit of fun, I has the thought last year after the Norm pointed out the color algorithm for the LVOOP classes (thanks!)

    <center><object id="scPlayer" width="677" height="585"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/jingswfplayer.swf"></param>'>http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/jingswfplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/FirstFrame.jpg&containerwidth=677&containerheight=585&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/LVOOP%20Theme%20Creator.swf"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/"></param>'>http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/"></param> <embed src="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="677" height="585" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/FirstFrame.jpg&containerwidth=677&containerheight=585&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/LVOOP%20Theme%20Creator.swf" allowFullScreen="true" base="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/efa3682a-543f-46b5-bde4-040bf5306e22/" scale="showall"></embed> </object></center>

  2. I just cut and pasted some text for submitting to LAVACR that had linebreaks and spaces and it came out like below, in fact it is doing it with this post too. After I preview the post the text changes in the editor to html and I lost my formatting. Changing the post options doesn't help. Am I missing some new setting? It never used to do this. The LAVACR sumbit form does not allow for a quick edit and I don't see any post options to try. How can I fix this. Thanks!

    <edit>

    Ok I workaround is to select edit after I have posted it, and reedit the post. This seems to work!

    </edit>

    post-10325-12721920453_thumb.png

  3. Hi all,

    I want to drag a control/indicator in my front panel and i need to drop it in another place in the same front panel.. is this possible when vi is running? any ideas?

    Yes, you can drag controls around the front panel of the same VI.

    I assuming you cannot drag and drop to another FP (but someone might have done it?)

    I would start by looking at the Position Property for a FP object.

    Also Dynamically Registering these events for moving are a good idea too (to create more efficient code)

  4. I've been looking into using a professional installer (InstallAware Studio) for creating installers. It is turning out to be much more complicated that I originally expected, but I believe it will make things like supporting different Windows versions, applying patches, upgrading to new versions, etc. a lot easier to manage.

    Please let us know how you go!!!

    Although the NI installer is great, there have been times where a custom one would be ideal.

    I have had this idea previously, but never attempted to implement it:

    I have thought about doing things with a CD installer --> Using a batch file or similar, install the LabVIEW Run Time first if not already installed, then launch an exe off the CD that is a GUI dashboard that would have options for installing drivers, dotNET, support software etc... (this would look nicer than a CD popup autorun menu using autorun.inf etc...)

    I don't know how this would go?

    But I thought it would be nice for when you have a large application that contains e.g. DAQ and Analysis.

    Some users would install e.g DAQmx drivers if they want to collect data

    Other users might just want to Analyse data so they don't need the Drivers and can avoid a large install.

    If they ever wanted to collect DAQ then to install the drivers they just have to load the CD, and the dashboard would launch and they could select it.

    (In the app you would just precheck what is installed, and if e.g. no DAQmx then those VI could not be launched (dynamically))

    Has anyone else done something like this?

  5. Thanks for that.

    So as you said if you upgrade or un-install your application the data into C:\Program Data\<company>\<Project Name> is unaffected, so I guess this directory will just keep getting bigger.

    Great point! A utility that asks, "You have uninstalled Application X, do you want to delete Application X's data or keep it on the system?" would be nice. But unless you write your own installer (like VIPM) using the NI one, won't do it.

    Which leads me to another question, what if by some slim chance, the application you install has the same name as another application already installed on the computer - I guess it wouldn't really matter unless your Configuration file had the same name too, and that will be extremely unlikely.

    The chances would be slim, but that is why I usually use a folder that is <company>\<project> with the company being ours - unless its a commercial product and not custom, then its usually the clients company name. That way we can control this internally.

  6. We've just upgraded to LabVIEW 2009 and have started receiving requests to install our applications onto VISTA and Windows7. As far as I can tell the only thing different from previous installers for Windows XP and before is where we can store our Configuration files. Uptil now we have installed them in the C:\Program Files\<application> directory, but I believe we can't or shouldn't do this anymore. My questions are:

    1) Using the Get System Directory VI there is about a dozen directories listed (User Home, User Desktop.....Public Application Data etc..) I presume for Single (User) Or Multiple (Public) Users we use the Application Data directories to store our Configuration data?

    2) For the Public folders why does the NI Help file say that it is readable but sometimes writable. Is it because two users could be logged in at the same time and one of them is running the application preventing the other user from writing to the Config file?

    3) Assuming we can't write to files stored in the C:\Program Files\<application> directory, what happens if we want to modify the <application>.ini file that is associated with the <application>.exe file? And of course if we don't include an <application>.ini file in the installation process when the executable is run for the first time, if there is no *.ini file present, it creates it's own one, but will the OS allow this to happen?

    4) We installed an application onto a VISTA machine using the "Public Application Data" system directory type, but trying to find the actual config file proved a nightmare. On my XP machine in Windows Explorer I can easily navigate to C:\Documents and Settings\All Users\Applicaiton Data\<myapp>, but in VISTA it appears to be totally hidden and access is denied even with adminstrator rights. Is this Windows7 normal security settings - sort of defeats the purpose of having human readable/editable config files if the user can actually see them to modify them.

    Thanks for any help you can provide - Chris.

    This is a great topic, and I look forward to hearing from others.

    Currently I store my config (e.g. settings file) into Public Application Data

    Public App Data is resolved as C:\ProgramData on 7/VISTA.

    So it usually looks like this C:\ProgramData\<Company>\<Project Name>.

    And yes, C:\ProgramData is a hidden folder

    Currently, I do not install a default settings file with my applications, instead I have the app create the default settings file (if the file does not exist on startup). Thus far I have had no problems with file io access in that location.

    However, when only XP was around I used to use a different approach which was to install the config file. (I learned quick that this is a pain anyway because the clients files get removed on an upgrade and they have to be manually/scripted backed up and replaced after install to have settings persist!)

    I have noticed with older application where by I install the files to the Public App Data location I can get file io problems. Normally IT has to grant access to allow write in this location and that has fixed the issue. I haven't noticed this in all cases, but I have seen it. So I need to investigate it further. And guess I will experience this more as I work on older projects that have new requirements for the latest OS').

    So this is where I store data that I don't want the client to see (private) I usually have a public folder somewhere too that the user defines or I use e.g. C:\<Project> or similar, where a flat file database may sit etc...

    I haven't needed to create an app to support different users, I just share the data, but if I did I would make use of the User location.

    Cheers

    -JG

  7. Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;

    this one is for Local machine. Create a database in My SQl server first and give the name instead of "myDatabase".

    Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

    this one is for remote connection.

    By default, the MySQL server will not be shared for remote computers. You have to change the privilleges http://bui4ever.com/...windows-server/

    Hope this will help

    cheers

    Thanks

  8. [Cross posted to ni.com]

    OS: Windows 7

    LabVIEW 2009, LabVIEW 2009 SP1.

    Howdy

    If I create a project and add a VI and a unit test to it and save it, then delete the unit test, everything works.

    If I do the above but put the unit test in a virtual folder then delete it, the project hangs and LabVIEW crashes.

    I have tried this on multiple computers and get the same effect.

    If it is an issue I thought this may have been fixed in 2009 SP1, but it is not.

    I do not remember this happening in 8.6.1 but I was using VISTA at the time (if that is related?)

    I get the same problem if I open an existing project with unit tests in it.

    Additionally I have noticed that the files from the unit test in Windows 7 have no "logo/icon" associated with them. I thought in VISTA they had the same icon as what is shown in the project - the green plus sign (but this was a while ago).

    Is this a known issue / can anyone else confirm this?

    Cheers

    -JG

  9. ...now I make all my reuse code read-only while building it. Problem solved.

    Do you create a random password each time you build? Or do you use the same password for all releases?

    If random, how to you manage all the passwords? Given that the clients that you distribute your code to (internal or otherwise) may require the password (from time to time)?

  10. Hi all,

    Thanks alot for these wondeful inputs..With all your help, i solved my problem. I connected MySQL server using the connection string. Once again thank you so much for the help.

    Suvin

    Is anyone able to post up the syntax they used.

    I have not used connection string before and just had a quick go of connecting to MySQL database with no luck.

    I tried:

    Server=localhost; Database=gregs_list; Uid=root; Pwd=;

    I want to check the syntax.

    Password is blank and port is default 3306.

    Cheers

  11. Yeah, I'm a little slow...

    That does include time spent figuring out OpenG Builder too. VIPM encapsulates the build/packaging process while OpenG has separate tools for them. A good chunk of the time was spent fighting with NI's mnu files. VIPM's palette building tool is my favorite part of the software. thumbup1.gif (If only I could yank that out and use it in my own workflow.)

    Ok, I use NI builder API when I use OPPB, so I haven't spent time trying to tackle the OpenG Builder yet!

    What are your experiences with it?

    What are the advantages/disadvantages in using it over NI API?

    So far, NI builder API is great for what I do (especially in 2009, not so much 8.2)

    Are you referring to a top level dynamic palette?

    Yer, I get the organisation I want by doing the following:

    All .mnu files get stored in a "dynamic_palette" folder (under company name folder in vi.lib/addons), then a dynamic menu file (which is the what I call the top level palette menu) is created and points to that "dynamic_palette" folder.

    This menu goes in the Categories and Controls folder under the vi.lib\menu folder.

    I just copied JKI after talking to Jim about it.

    Do you do something similar/different?

  12. Link is broken because of weird bug with links that contain "expression":

    Here is the unlinked path:

    "expressionflow.com/2007/10/01/labview-queued-state-machine-architecture"

    (BTW, that's an excellent tutorial to keep at hand for newbies.)

    That is weird!

    I am assuming it is an IP Board Bug?

    Does anyone know if this been reported?

  13. Are there any example code around showing how to do a QSM with variant data (Cluster of event+command), where event = strictly typed enum and command=string. I guess there was some on the old LAVA-forum, but now I can't find any examples here.

    (LabVIEW 7.1.1)

    Here is a good article on implementing a QSM, it is from the Expression Flow website. I am not sure what version the example download is in, but you should be able to easily replicate it from the article.

  14. If management is still unwilling to spend money on VIPM Pro, you can use OpenG Package Builder to build packages instead of VIPM. I guarantee* it will cost you more figuring out how to do everything using OGPB than it would cost to purchase a $1k VIPM Pro package. OGPB is more flexible than VIPM however, so if VIPM doesn't create the packages you need AND you have time to burn, OGPB will likely provide you with a solution.

    *To put some rough numbers to it, over the past 1.5 years I've spent well over 200 hours figuring out how to build my packages using OGPB. (Granted, some of the things I've been trying to do fall outside the norm.) If your management values your time at less than $5/hr, OGPB makes perfect economic sense.

    I personally don't think OGPB is that complicated.

    Plus, in most cases you will have to (currently) use it with VIPM to create your top level palette menu.

    I think more emphasis should be directed to the .vipc files too.

    These will become an important part of the project under SCC.

    Its like having all the benefits of not copying your reuse library dependencies to your project, but the piece of mind that you are :yes:

  15. As do I. That's the method I usually use when I have similar code (not for polling controls, but there are other cases where you can get an array of booleans).

    Cool.

    For the UI, its the old... buttons in a cluster, convert the cluster to an array, then search the array for a true, add 1 (so not found = 0), convert to an enum, that is wired to a case structure so your cases are descriptive...

  16. I was refering to the basic construct of building the values into an array and converting to a number. I agree that adding a million empty cases is pointless.

    Thank goodness for that ;)

    I prefer using Search Array (for a TRUE), then that would fix the issue you raised about latched buttons.

  17. Thanks jgcode for the link. Not to belabor the point, but I still haven't found an explanation of the hazard associated with stacked sequences.

    No probs.

    Well I think you have, as that topic is a fairly good summary of the advantages/disadvantages of using Sequence Structures.

    And I think you can bump heads on this all day/week/year with anyone.

    If you like using them, then by all means use them.

    Below is my take on the subject.

    This sequence is written in stone, has always been thus and will always be thus.

    The only thing that is guaranteed in software development is CHANGE.

    Whilst your saying it is "set in stone" - that may be the case today, but will it be so in a month/ in a year etc...

    I have found that you cannot always predict the future.

    Therefore, I prefer I more flexible approach

    Sequence Structure do not provide me with that.

    You do not want to alter it by accident, and you want anyone reading your code to understand that this sequence is not to be tampered with.

    One example may be a set of instructions for allocating and deallocating memory. In such a case, a sequence structure is a clear signal to enforce the execution order.

    • Cannot change execution order without cutting and pasting code

    Good. We want to discourage casual modification.
    You should be able to do this with good documentation.
    Relying on a developer to "read you code" and to make that assumption, is probably not the best idea (and not the fastest/easiest way to come up with that conclusion)
    Also, if you have problems with people editing something accidentally these could be avoided using a Source Code Control system.

    • Have to run the entire sequence from start to end - cannot conditionally abort half way through etc...

    Again, enforcing this restriction may be by design. For example, Aborting a memory operation mid sequence could lead to memory leaks.

    Well that one comes down to good programming.

    If your sequence is 100 cases long and you need to stop mid way through, you can't. You are stuck having to run the other 50.

    That is inflexible to me.

    Whichever design you choose, if you do add in an abort feature/function, you should do so cleanly, and tidy up your references etc.. to avoid leaks.

    Not doing so would be lazy/bad programming.

    • Cannot run the same frame twice

    This is part of the definition of a sequence.
    No by definition a sequence is a succession of something.
    Not being able to run the same frame twice is not good for flexible/reusable code.

    • Cases are hidden

    Cases are hidden in most corners of Labview. Case structures, subVI's, etc. They are simple to inspect.

    Yes, but in the argument of Flat vs Stacked Sequence Structures, Flat would allow more code to be viewable.

    • Forced to wired from right to left when passing data between frames due to the use of sequence locals

    This is indeed the most compelling reason to avoid stacked sequences! Definitely frustrating. But this is not due to an inherent limitation of sequences. It has been implied that it is instead the result of a conscious decision by NI to not implement sequence locals in a friendly manner. What gives? This was the original poster's point and also my motivation.

    I am glad they did this. Sequence Structures are bad ;)

  18. Maybe the developer used 'Add Case For Every Value' - which would still be a lot of work, but not as much as manually adding them :P

    Can you do this for an integer? I think the poor guy must have been adding them manually!! :)

    What's inside case 63?

    Felix

    Nothing. Why do you ask?

    Actually, if the booleans aren't latched or if the user is fast enough, any value between 0 and 511 is possible (although I assume the other cases are actually empty).

    Faster than 50ms? I doubt it. :) But, yes missing states is a downfall of a polled interface.

    It looks like the code comes from an older version of LV (inverted stop condition, B&W VI icon, terminal labels non-transparent) which presumably did not have the event structure, so this code construct would be legitimate.

    Regardless of the event structure (this code is currently 7.1, thats how I got it) - Legitimate? Not really, all cases other than (0, 1, 2, 4, 8, 16, 64, 128 etc...) should have fallen under the Default case to do: "Do Nothing".

    Try these on for size!

    post-415-127005216553_thumb.png throwpc.gif

    post-415-127005224263_thumb.png

    That little white block on that last one is my 1920x1200 monitor. frusty.gif I'd need about nine of them side by side to see the whole thing.

    At least I don't have to refactor, but try and understand and document that! If it were up to me, it would be rewritten from scratch. That may happen yet at some point.

    OMG! Look at that nesting!

    Good luck with this project ;)

    Keep em coming!

  19. Refactoring someone else code the other day and found this little beauty I thought I would share.

    Now, building the buttons into a boolean array then converting to an integer is not such a bad thing (I can think of more elegant ways but I digress).

    What made me smile was that the developer created a case for every integer although only a few are possible (0,1,2,4,8,16,32,64,128).

    That is a lot of work!!

    As I wanted to add a 9th button I decided not to follow their lead and add in another 128 cases.

    I refactored instead.

    I have no problem making fun of someone else's code, as I know I have written bodgies before too and am happy to share those :)

    post-10325-126999946935_thumb.png

×
×
  • Create New...

Important Information

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