Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


klessm1 last won the day on August 22 2012

klessm1 had the most liked content!

Profile Information

  • Gender
    Not Telling

Contact Methods

LabVIEW Information

  • Version
    LabVIEW 2012
  • Since

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

klessm1's Achievements


Newbie (1/14)

  • Reacting Well Rare
  • Week One Done
  • One Month Later
  • One Year In Rare

Recent Badges



  1. I think that maybe a tool to analyze dependency links would be helpful. Not just for this type of issue either. In a couple of our projects I end up saying "why is that class being pulled in"? Many times you end up with a "uses a" relationship with another class (static vi reference, passing a class into another class's method). If you could visually and programatically inspect your class relationship it would be great. I am wondering what Symbio tools would do with the weird setup I had going (we don't use them). A tool like that would be pretty nice for code reviews. Just a simple representation of classes, lvlibs, and xcontrols in your project and some red flags for circular references. If I had some spare time...
  2. Slight restructure worked. I had some weird linkage because of some static vi references. Database class was clean. So my main GUI class is passed to all main screen guis as data from screens is sometimes shared (they are plugin screens for a sub panel). I could of done it diff but that is what I ended up with. Anyway, the GUI screen vis were part of the main GUI class because they use the main GUI class. For each screen I have another class containing the control refs for that GUI. In the init function for the screen class I had a static ref for that screens gui (which was part of the main GUI class). Throw in the fact that the screen guis have the xcontrol on them and the screen classes have the ref, properties,and methods you end up with a bad situation. Like a two day crash fest. So I removed the guis from the main class (don't know if it was required..), and got rid of the static refs from the screen init methods (this was probably the root cause). So now that the main and screen classes don't call each other everything seems to be OK. I left the refs as the xcontrol type (not containing data type) and I don't think I'll change it back as everything is working. Thanks for the inputs. Def will remember the delete ref trick.
  3. Posting here because NI forums is down...plus I found this thread which may have something to do with my problem. So what if there is a class that both the XControl calls and the Main class calls? For example, my Xcontrol calls a database class (which calls .net ADO), but that class is also in the dependencies of my main GUI class (which the XControl is also dependency of). I've been dealing with crashes, bad property and method nodes for the last two days am pretty much at that point where I start posting on forums. So my GUI class is in charge of getting data from and updating the display (which includes the XControls). I have the references for the controls I need to control in the class data (which sometimes causes problems when updating the X Control). Most of the time I just get a bad method or property node and can re-select and save. I also have a control (not type def) of the reference that I update with the latest reference of the XControl then I apply it to the class data. Having it as a type def causes way too many problems. I have also tried replacing the XControl strict reference with a regular control and used the "to more specific class", but that didn't work. The references were still called by the GUI class. What I am thinking of doing is removing my main GUI panels from my GUI class (floating VIs), and create a messaging system to another stand alone VI that would contain all the methods and properties I need to access for the X controls (which defeats the purpose of having these nice methods and properties). It is probably going to hurt a little (timewise), so I am looking for some wise guidance. Info: Using 2012 SP1f2 32bit on Win7, Most vi's have separate compiled cache set. Clearing cache before loading (usually have to load XControls first then main gui class).
  4. I have stopped using this tool because the latest version of tortoiseHG will now go through all the files first and then give a list of conflicts. It also allows you to select local or theirs and can use a merge tool of your choice on individual files (in the case of VI's just use lvmerge directly).
  5. Since the XControl is only being used in my application and in one spot I was able to fudge a little and use the following code. Note the plus 10 which I think is due to splitters or panes not being at origin. I think NI also has a similar issue with their tip strips that has been documented. If you hover over control that is in a paned window that is in a subpanel you will see it. The location of the tip strip can vary and to get it in the correct place you have to scroll the pane. Maybe this is fixed in 2012, but haven't switched from 2011SP1 yet so I'm unsure. Anyway here is the code that seemed to work good enough for me to get by.
  6. I am writing an X control that launches a popup that I want to place in reference to a control that is part of the XControl. It worked ok when the X Control was in a normal VI (even with multiple panes), but when that vi is in subpanel it always shows up in the same location. It gets the same "panel coordinates" everytime regardless of where the top level vi is placed, but changes when the subpanel is moved on the front panel of the main vi. It seems like I need to go one more level up, but so far have been unable to find a way to do that. It is almost like instead of "owning vi" I need the reference of the subpanels owning vi. Here is the vi I am using. The vi with the magnifying glass recursively searches for controls within controls (e.g. clusters, tabs). Basically it finds the pane the control belongs to then finds the panel coordinates and then the screen coordinates. Does anyone have a trick to make this work for subpanels? Much Thanks!
  7. I did a quick search of the website but I didn’t see something like this posted so I’d thought I’d post it. It’s probably been done before but I found that it pretty helpful in my current project. I usually use DVRs whenever I want to use the aggregation pattern (zero or more relationship). Many times though I want to sort or return an object from the array based on an attribute in the object (like name). Since I am using a DVR I found I can quickly make a hash table using variant attributes. I just use the “Name” or other unique value and make the DVR the value. I can then lookup a DVR by name through the variant. It stays really fast because the DVR is just a reference to the data and I am not looping through DVR references and comparing the name or unique value to the value in the object. Example use: I can lookup these commands by name or opcode using the variant hash table. I create the lookup based on name. I also create the lookup based on opcode I can then lookup the object very quickly based on name or opcode.
  8. Question posted on NI's site. Thought I would list it here in case you don't check NI's forums and you have an answer for my question! http://forums.ni.com/t5/LabVIEW/Setting-quot-Scale-Objects-While-Resizing-quot-programmatically/td-p/1970005 I am thinking of sharing this API after I get this figured out because it makes collapsing / expanding panes a breeze. Is there is a different \ easier way to accomplish this? I have attached what I have so far in an example vi. MessingAroundWithSplitters.zip
  9. I mis-wired the unbundle, but that occurs after VData to Cluster function.
  10. I ran into an interesting issue with the Array of VData to VCluster when using XControl references as part of the VData. It looks like it puts it together correctly into a cluster, but when trying to type back to the XControl reference type it throws an error. You can convert it back to a normal control type, but when doing generic sets on controls in a cluster that method doesn't work very well. LV2011, Latest verison of the library. Screen shots here and code attached. I actually tried it with a couple different XControls and it didn't work. I wouldn't think that this behaviour is normal, but maybe there are some known restrictions when using XControl references? The references themselves seem a little weird because I did a source build on the project and it changed the type of controls in the "new" cluster constant when LabVIEW compiled it. They were just normal control references made from scratch in the source code and then in the build it changed them. They still said "Control" but when you clicked on them to view the ActiveX class they had Control and MRUFilePath selected. Weird. Anyway, I can probably manually cast these values, but the whole reason behind my method was I just had to add the control ref to a cluster in a class and input the refereces as a variant array and It would load them...no custom loading of the clusters. XControlRef.zip
  11. Great API. Couple comments and suggestions. I was using a couple of panes in my application and so the locations got a little messed up. I modified it so it could register pane mouse down events instead of vi mouse down and it works pretty good. Although I don't have a current need I noticed that you can't register multiple controls on the same window or in two windows that are up at the same time. Finally it seems to take a little bit of time to load because it is using vi server. I am using it on some popup windows and when I switch between step interfaces quickly it is a bit noticable (not really bad, but should be almost instant). I tracked it down to the init call where it launches the vi dynamically. Possible update could be to run as a daemon?? It could solve the time to load and the multi-control / window open at the same time.
  12. I was going to post on the NI site, but they have one huge LabVIEW forum so I though it might get lost. Was not aware that every post was read there. Thanks for the information and for entering the CAR.
  13. I am flattening an array of classes and loading into an MSSQL database in an XML column. When the XML is returned it is formatted to take up less space. Which means a line of "<Cluster></Cluster>" becomes "<Cluster/>". When returned in this manner I get an error: 1403 LabVIEW: Attempted to read flattened data of a LabVIEW class. The data is corrupt. LabVIEW could not interpret the data as any valid flattened LabVIEW class. Lines that have <Val/> and <Name/> work ok. It is only the custer tag that has the issue. I have attached two xml files...one with <Cluster/> (doesn't work) and the other with <Cluster></Cluster> (works) for reference. I am hoping someone at NI will take a look at this and enter a CAR if necessary because it just seems to be an overlooked item that doesn't happen much. This seems only possible with classes when a child class is empty. I don't think an empty cluster outside a class is possible. The work around is to perform a search and replace of <Cluster/> with <Cluster></Cluster>. Easy, but shouldn't be necessary. Using LabVIEW 2011. BeforeReplace.xml ClusterReplace.xml
  14. Finally got around to checking it without recompile and it works as expected for me. Private function has an X and the public functions do not.
  15. I did not try that yet. I did however realize that the red X on the property node vi was because I had made it a private function. I will try it without compiling, but will probably do it tonight.
  • Create New...

Important Information

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