gb119 Posted November 12, 2007 Report Share Posted November 12, 2007 Ok, I've discovered a new way to shoot myself in the foot while programming in LabVIEW. Here's how you do it: 1) Create yourself a LabVIEW class 2) Create yourself an XControl to display your new class doing some nifty processing to prettyify your class's private data 2b) Note that you can't add your XControl to your class, so use some public methods to extract the private data 3) Decide you want a probe for your class, so create it and figure "why not just use my nice shiny XControl in my probe ?" 4) Add your probe to your class so that you can assign it in the class properties. Don't forget to save your class as soon as you have added the probe ! 5) Notice that your class is now locked. Enjoy that sinking feeling as you realise this means you can't remove the probe and undo whatever damage it is that you have just done. Find a nice text editor and get hacking on the XML file that defines the class. :headbang: I think the problem is that when a VI containing an XControl is added to a project, the XControl is loaded. creating a new application instance, which contains an instance of your class. Your class is now loaded in two application instances and is therefore locked. Quote Link to comment
Norm Kirchner Posted November 13, 2007 Report Share Posted November 13, 2007 Wow! Talk about one of those times that my feet are terribly greatful. They are currently wriggling around under my desk doing a jig since realizing they are saved from the pain of a bullet passing through them. Quote Link to comment
Ton Plomp Posted November 13, 2007 Report Share Posted November 13, 2007 QUOTE(Gavin Burnell @ Nov 11 2007, 10:33 PM) Don't forget to save your class as soon as you have added the probe !5) Notice that your class is now locked. Enjoy that sinking feeling as you realise this means you can't remove the probe and undo whatever damage it is that you have just done. Find a nice text editor and get hacking on the XML file that defines the class. :headbang: Source Code Control? Ton Quote Link to comment
gb119 Posted November 13, 2007 Author Report Share Posted November 13, 2007 QUOTE(tcplomp @ Nov 12 2007, 04:36 PM) Source Code Control?Ton Of course, or just a versioning file system so I didn't need to remember to do a commit after every save... oh for the days of VAXen and VMS Semi-seriously, has anyone else had problems with generating corrupt xml files when LV tries to handle non-unique filenames in multiple directories (like dir.mnu for example) - quite often I seem to get an XML file that has multiple entries for dir.mnu that originally pointed to different directories, but at some stage get set to all point at the same file. LabVIEW then decides my library/class is corrrupt and won't load it. A quick go with {CVS|SVN} Diff and a merge editor (I like WinMerge myself) sorts out the mess, but I wish I could work out what triggers this and how to stop it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.