LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving class to file using XML

Solved!
Go to solution

Hi-

 

I've made a new class for LabVIEW, and I'm trying to save it to a file using XML. Attached are pictures showing how I create the file and how I read it, along with the error message I get. I've tried a variety of different methods, and nothing has worked so far. I was wondering if anyone had any tips or examples for saving a class to file via XML. 

 

In the meantime I'll use the method described here:

http://forums.ni.com/ni/board/message?board.id=170&message.id=215511&query.id=672786#M215511

but I would prefer XML for more usability later down the line. 

 

I have also thought of just un-bundling all the data from the structure, saving it via XML, and then just bundling it back up and writing to an instance of the class. This seems like more work than should be necessary, and would have to be re-done every time I modify the class. 

 

It probably goes without saying that I'm pretty new to LabVIEW so hopefully this isn't a stupid error which is obvious to the vets.....

 

Thanks in advance,
Nate

Download All
0 Kudos
Message 1 of 5
(4,347 Views)

You didn't indicate which version of LabVIEW that you're using, and the last picture is a copy of the first, rather than the error message. This shows it in 8.6, and it seems to work OK:

 

Side-notes:

  • That little VI you have has the error in/out terminals at the top. This is highly unusual. It is recommended that error in/out terminals be at the bottom.
  • The Index Array can be resized to get more than one element out. The first one defaults to zero, and additional ones are +1 from the previous.
Message 2 of 5
(4,327 Views)

Ahh right you are, the error message is attached to this post.

 

Thanks for the style tip; I'm giving your method of saving a class a try now. 

 

 


Edit: Unfortunately your method gives the identical error.

Message Edited by Consigliere on 07-27-2009 04:20 PM
Message Edited by Consigliere on 07-27-2009 04:21 PM
0 Kudos
Message 3 of 5
(4,323 Views)
Well, now that I see the actual error that you're getting, I'm a tad confused. The error message indicates the class is not loaded. The VI you have seems to be in a library. Where is the class? Can you upload actual code?
Message 4 of 5
(4,294 Views)
Solution
Accepted by topic author Consigliere

First- sorry for wany wasted time for uploading the wrong screenshot in the OP.

 


Second- I solved it! I was about to upload a screenshot of my heirarchy for you to take a look at, but that got me thinking. I re-arranged my heirarchy; this solved the problem.

 

Now for anyone who had the same problem (Error 1527) :

 

The first screenshot is my original project heirarchy, which didn't work.

 

The second is my modified project heirarchy which solved the problem.

 

 

Thanks for your help!

Download All
0 Kudos
Message 5 of 5
(4,282 Views)