Jump to content

Recommended Posts

I've been bashing my head against the proverbial wall for a couple of days now trying to understand what was corrupt in my LV project hierarchy. On the face of it, all appeared to be fine, but I was getting some very unusual errors when executing my VIs. Errors that hadn't occurred before I rearranged stuff. In my project I have a number of classes, with various inheritances and other defined relationships, and I recently moved some things around to make it, well, better organised. I ensured I didn't destroy the relationships required to maintain access to class methods etc. Indeed, after the rearrangement, there were no broken VIs, and a mass compile (for good measure) came back clean.


Now, although the majority of my classes were working fine, I had a very bizarre "Out of Memory" error occurring when accessing the private data of one particular class's DVR via an in-place structure. The private data of the class is nothing more than an array of a cluster of elements. Typically the array is empty, and in the in-place structure I am combining the contents of one class's array of elements into another's. And indeed, in the above error case I had two empty classes, so the build array function had no real work to do, yet I saw some very odd behaviour.


Firstly, when highlight execution was on, the array datawire from the unbundle terminal of the in-place element structure should show "#0" to indicate no elements in the array, but in fact would regularly show #84 for one, and I would never get to see the other due to the "Out of memory" error. This was very repeatable, even after rebooting my computer. Where was it getting 84 elements from!?


In a generic probe place on the class itself I would see that although the class wires showed normal content (zero elements in their private data), their Value field showed an incorrect namespace entry. This class is owned by a single library, so the namespaced title is mylibrary.lvlib:myclass.lvclass. However, the probe's namespaced title was mylibrary.lvlib:sublibrary.lvlib:myclass.lvclass, where sublibrary.lvlib is a library definition that I emptied and removed a few days ago. Yes, the class used to belong inside this library, but no more. In the library project view, the class can be confirmed to live directly within mylibrary.lvlib only. sublibrary.lvlib isn't even on the file structure anymore, it's literally gone - yet LabVIEW didn't seem to recognise this conflict.


After seeing this I realised there was a corruption, but I couldn't see how to properly inspect the defined class ownership properties, or influence it? There's nothing under the Properties panel accessible from the right-click menu? I wondered if dragging the class out of mylibrary.lvlib and back in again would help, but it is changing these ownerships that caused this mess in the first place, so I decided to close down LabVIEW and overwrite the myclass.lvclass file on disk with a backup from earlier that pre-dated the original move into sublibrary.lvlib.


Voila, this solved my issue immediately.


So I'm quite perturbed to see that a bad ownership property in a class can cause LabVIEW to keel over with very odd execution behaviour, yet otherwise believe everything is fine in the hierarchy itself. Is there a way to inspect class ownership properties throughout a project to look for inconsistencies? To validate the information already there? I already tried a mass compile and that didn't resolve it.


Now, I actually want it, and some other classes, in sublibrary.lvlib, contained within mylibrary.lvlib, but I've been trying for two days to recover my project after trying this once. I wonder now if I even dare try to rearrange my classes again!

Link to post
Share on other sites

a) What version of LV are you using? The issues you describe were in LV 8.5 but fixed in 8.6 and later to the best of my knowledge.

b) It is hard to help analyze anything without code. Have you opened a service request? Do you still have the corrupted versions?

Link to post
Share on other sites

Hi Aristos,


This is LV2011SP1. I wanted to try discussing the issue without code because it's part of the PTP Sequencer toolkit. However, I guess it doesn't really matter too much, so I'll be more accurate. I was rearranging my classes to the following structure:



  - ptp_sequencer_public.lvclass

  - ptp_sequencer_core.lvlib

    - ptp_sequencer_element.lvclass

    - ptp_sequencer_container.lvclass

    - ptp_sequencer_loop.lvclass

    - ptp_sequencer_branch.lvclass

    - ptps_ps_service.lvlib

      - ptps_pub_sub_service.vi

      - (lots more classes)


I have everything under PTP_Sequencer.lvlib currently, and I'm trying to add ptp_sequencer_core.lvlib. When I create the _core library and start moving the classes into it, that's when all holy hell breaks loose. Although LabVIEW doesn't complain about the move, things start getting weird afterwards.


I didn't want to create a service request because I suspect I'd be told "these issues are resolved in LabVIEW 2012...", but I want the toolkit developed in an older release to ensure compatibility with as many users as I can. I can't go older than 2011 due to the use of a few features that came out in that release (DVRs?).


may still have the corrupted versions because I've been backing up to separate folders at regular intervals to ensure I can revert easily. I'm about to try to achieve the above hierarchy again anyway, so I'll probably have a new corrupt version in a few minutes...  ;)

I'm about to try to achieve the above hierarchy again anyway, so I'll probably have a new corrupt version in a few minutes...  ;)

Well that didn't go well. LabVIEW popped!  :lol:

Link to post
Share on other sites

Creating a virtual folder, moving everything into that, and using the "convert to library" feature seems to have worked. It needed a mass compile to resolve the masses of errors that were created, but it may be I have a working structure now. Some further testing is needed to be confident...


Edit: After further testing it appears that some of the friendships between XControls and classes were not migrated, so a friend of the XControl previously at:


that moved to


was still listed in the XControl's Friends tab as being at the original namespace path. Therefore it lost it's friendship which broke some VIs. Simply removing the invalid class friendships and re-adding them solved this issue.  :)

Edited by Thoric
Link to post
Share on other sites

I had the same sort of problem the last week I made a lvlib that contained only two classes (no inheritance or anything complicated).


I'm terrible at moving stuff around on disk outside of a project to get it "organised". I then close the project, re-open and let labview find or ask me where things are and let it re-link. LV is usually pretty good and without classes this has never been a problem.


In this instance it just wouldn't forget an old class name that I had used previously and a couple of VIs were still linked to it-apparently. It only showed up when trying to build a package where it would show the finding dialogue and report an error of xxx.lvclass not found and the build would fail. There was no indication in the project that anything was a-miss (no broken VIs and nothing in the dependencies). Eventually, I searched all the files with a contents search to find what was linking to what (no other way of knowing) and once I found out which ones; disconnected them from library and re-added/re-saved. This fixed the problem but it took some hours to find and my bald spot now covers the rest of my head with all the scratching.


. I have vague recollections of a thread on here about similar behavior being reported, then fixed, then coming back again.

Edited by ShaunR
Link to post
Share on other sites

Very similar to your experience, the project reports fine but it's VIPM package builder that's failing to build. Once I sorted out these oddities it builds fine (albeit very slowly now?)

I'll check out your link Neil, I think it might be great to dissolve the mutation history. I can't see why that would be useful once a library is set in stone (which I hope it now is).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By 0_o
      This is not specifically LabVIEW related:
      How do you organize important posts you read and want to save for the time of need?
      For example, I want to save an interesting post from Lavag/NI Forums or any other LV blog.
      This post might contain VIs and I would like to tag it in a way that will let me find it when it becomes relevant.
      I would like such a post to be saved locally like an RSS so that I'll get the new comments and won't depend on the site to keep the links alive.
      I see the veterans here keep track of all the new posts and even offer solutions by giving links to some old posts without having to search for them sometimes.
      Do I miss something? How do you organize it all? I hope to hear of some cool little RSS app that will let me search through the tagged vis and posts stored on my computer and not about some bookmark manager.
      Thanks in advance.
    • By GregFreeman
      I am running calls to a various stored procedures in parallel, each with their own connection refnums. A few of these calls can take a while to execute from time to time. In critical parts of my application I would like the Cmd Execute.vi to be reentrant. Generally I handle this by making a copy of the NI library and namespacing my own version. I can then make a reentrant copy of the VI I need and save it in my own library, then commit it in version control so everyone working on the project has it. But the library is password protected so even a copy of it keeps it locked. I can't do a save as on the VIs that I need and make a reentrant copy, nor can I add any new VIs to the library.
      Does anyone have any suggestions? I have resorted to taking NIs library, including it inside my own library, then basically rewriting the VIs I need by copying the contents from the block diagram of the VI I want to "save as" and pasting them in another VI.
    • By etgohomeok
      Hello, this is not strictly VI Scripting related but I believe it's a pretty similar topic, so I hope this fits in with the discussion on this board.
      I am attempting to write a script that parses through the contents of a very large LabVIEW project (thousands of files) recursively and selectively moves/renames some of the files. The basics of this are fairly simple, however I have thus far been unable to come up with a way of moving files on disk that handles all relinking and dependencies without any issues.
      At a high-level, my question is whether or not the "Move on Disk..." option in the right-click menu of the project explorer "Files" view is accessible programmatically somehow, using invoke nodes. The option I'm talking about, for clarification, is this one:

      Using this option in the project explorer seems to be able to move all types of files in the project (VIs, libraries, classes, etc.) and handle all relinking properly without any conflicts popping up. However, there doesn't seem to be an equivalent "Move on Disk" method int he invoke node for project items. I have had some success with some of the "super secret" nodes for VIs:

      However this only works for VIs and there is no equivalent function for library (.lvlib) and class (.lvclass) files. I've tried various combinations of saving and relinking functions that are available, however I always end up with conflicts when I load the project after running my script.
      If the "Move on Disk..." function is not accessible programmatically, does anyone know of another way to programmatically move/rename library and class files on disk without causing conflicts?
    • By ASalcedo
      Hello to all.
      Thanks a lot for reading this post and being able to help.
      I would like to know what is the most recent release of modbus library for Labview. Which version? of this link http://forums.ni.com/t5/NI-Labs-Toolkits/LabVIEW-Modbus-API/ta-p/3524019
      1.2.1 of this link http://www.ni.com/example/29756/en/ ?
      Thanks a lot!
    • By PLeVasseur
      Some background: I'm trying to use the name of the library my VI is executing in as part of a string which will be used in the name of a Rendezvous, to keep it distinct from other Rendezvous I will create.
      When attempting to use the VI Property Node to access the Library property on the CompactRIO, error code 1 is returned. Running the same code on my computer runs as expected and returns the Library. Accessing the VI Name using the Property Node appears to work no problem on the RT, though.
      Does anyone know what could be causing the problem? I tried searching the documentation, but didn't turn up anything. Is this error part of some general behavior wherein some VI properties are not accessible when a VI is running on a real-time target?
      Code is attached. Please see attached pictures:
      Project Explorer:

      Block Diagram:

      Front Panel - RT Results:

      Front Panel - Computer Results:

      Experiment with VI Property Node Error.zip
  • Create New...

Important Information

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