Jump to content
Chris_Collier

XML Data file versioning

Recommended Posts

I'm building an application (which I am intending to share at a local user group soon), but am having issues with XML file data versioning.

 

My intent is to have a data type which has a version string, and a variant for the data which will be read according to the version number in the version string.  The issue is that if you flatten the data type to an XML string with any data in the variant, then try to unflatten the data, you get an error (1106: "LabVIEW:  The XML tag describing the type of data does not match the wired type.")

 

How have you done versioning for data files which you are pretty sure will change over time?

 

And can anyone tell me why this attempt doesn't work?

 

Thanks,

 

-Chris Collier

 

P.S. The attached files are in LV 2014

Test XML.zip

Edited by Chris_Collier

Share this post


Link to post
Share on other sites

And can anyone tell me why this attempt doesn't work?

 

Apparently, xml for an empty variant is different than that for a variant with some typed data content; you can circumvent that flattening the variant:

post-28229-0-76595500-1440088947.png

Share this post


Link to post
Share on other sites

Thank you.  Implementing this does make the software work as I would expect.  This is more steps than I thought would or should be needed, but it should allow me to use versioning implemented as I wanted.

 

Thank you for your help!

Share this post


Link to post
Share on other sites

Since this is for a presentation at a User Group meeting, I wanted to keep as much of the code to standard LabVIEW install as possible (for those who inherently dislike plugin tools for whatever reason).  This should make it so that anyone with the correct version of LabVIEW will be able to review the code off-the-shelf.

That being said, I think I'll look into the JSON package for my own work.  Thanks for the link!

Share this post


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.

Guest
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 Benoit
      This XML test report library is available for you to modify at your will.
      It is based on the IPC-2547 standard so it is easier for any other application or database to parse.
      The html file report offered by LabVIEW was not sufficient for my need.
      So I created those. enjoy!!!
    • By Benoit
      View File .xml test report Measurements.zip
      This XML test report library is available for you to modify at your will.
      It is based on the IPC-2547 standard so it is easier for any other application or database to parse.
      The html file report offered by LabVIEW was not sufficient for my need.
      So I created those. enjoy!!!
      Submitter Benoit Submitted 02/26/2018 Category *Uncertified* LabVIEW Version  
    • By A Scottish moose
      Hello all,
      My question is: what is your preferred non-volatile way of storing daqmx task configurations? 
      Backstory: For a long time I've used ini files to maintain task configurations between executions of a program. This has worked for primarily static DAQmx configurations but I'm looking at creating a test executive with some degree of flexibility, which means daqmx task configurations start to get more complicated.
      If you use MAX for storing your tasks:  Do you run into problems accessing and maintaining these tasks even though you don't have direct access to the file?  Or is there an unlisted storage location for these files?
      If you use ini/text based files:  How do you keep things orderly?  I'm running into all kinds of limitations with the format.
      If you use XML: Where did you find your schema?  Did you write it?  I know NI saves tasks as XML files, and so therefore the schema exists, but I haven't been able to figure out how to use it.  I've created a task in my project and then dug through the XML of the project to find the attached image.  I believe this would be the ideal solution, but a little bit of digging in around NI.com (I know...) and google (actually useful) has resulted in no answers.
       
      I know there is an elegant answer to this question, I've just not found it yet.  Thanks in advance for your comments. 
       
      Cheers,
      Tim M


    • By Mafis
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <DCT Version="V3.0" User="Administrator" FileType="4" TagListFile=""><DATASOURCE Name="Marchwood" User="root" Password="" Driver="PI"/><PLANT PlantName="Marchwood" UnitName="Plant" ConfigFile="MAR1_Avg_000.XML" ConfigFileCreation="16/04/2007 14:01:40" TimeBias="0" Locale="(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London"/><DATA_MESSAGE Type="Average" TimeBegin="31-Dec-2007 00:00:00" TimeEnd="01-Jan-2008 00:00:00" SamplePeriod="00:05:00" RequestType="Automatic" TransferPeriod="24"><DATA_POINT PopName="11GB_VIB_HP-SMAX" TagName="11GB_VIB_HP-SMAX" Vartype="A" UnitLabel="µm"><SAMPLE TimeStamp="1199059500" Validity="0" Value="1.274646E+01"/><SAMPLE TimeStamp="1199059800" Validity="0" Value="1.260714E+01"/><SAMPLE TimeStamp="1199060100" Validity="0" Value="1.248902E+01"/><SAMPLE TimeStamp="1199060400" Validity="0" Value="1.236600E+01"/><SAMPLE TimeStamp="1199060700" Validity="0" Value="1.231612E+01"/><SAMPLE TimeStamp="1199061000" Validity="0" Value="1.237882E+01"/><SAMPLE TimeStamp="1199061300" Validity="0" Value="1.231513E+01"/><SAMPLE TimeStamp="1199061600" Validity="0" Value="1.233609E+01"/><SAMPLE TimeStamp="1199061900" Validity="0" Value="1.235653E+01"/><SAMPLE TimeStamp="1199062200" Validity="0" Value="1.236966E+01"/><SAMPLE TimeStamp="1199062500" Validity="0" Value="1.235595E+01"/><SAMPLE TimeStamp="1199062800" Validity="0" Value="1.221824E+01"/><SAMPLE TimeStamp="1199063100" Validity="0" Value="1.210020E+01"/><SAMPLE TimeStamp="1199063400" Validity="0" Value="1.202238E+01"/><SAMPLE TimeStamp="1199063700" Validity="0" Value="1.220617E+01"/><SAMPLE TimeStamp="1199064000" Validity="0" Value="1.231157E+01"/><SAMPLE TimeStamp="1199064300" Validity="0" Value="1.228374E+01"/><SAMPLE TimeStamp="1199064600" Validity="0" Value="1.230319E+01"/><SAMPLE TimeStamp="1199064900" Validity="0" Value="1.237157E+01"/><SAMPLE TimeStamp="1199065200" Validity="0" Value="1.231859E+01"/><SAMPLE TimeStamp="1199065500" Validity="0" Value="1.228248E+01"/><SAMPLE TimeStamp="1199065800" Validity="0" Value="1.235305E+01"/><SAMPLE TimeStamp="1199066100" Validity="0" Value="1.248533E+01"/><SAMPLE TimeStamp="1199066400" Validity="0" Value="1.242054E+01"/><SAMPLE TimeStamp="1199066700" Validity="0" Value="1.230065E+01"/><SAMPLE TimeStamp="1199067000" Validity="0" Value="1.228046E+01"/><SAMPLE TimeStamp="1199067300" Validity="0" Value="1.245642E+01"/><SAMPLE TimeStamp="1199067600" Validity="0" Value="1.245089E+01"/><SAMPLE TimeStamp="1199067900" Validity="0" Value="1.239629E+01"/><SAMPLE TimeStamp="1199068200" Validity="0" Value="1.242647E+01"/><SAMPLE TimeStamp="1199068500" Validity="0" Value="1.249479E+01"/><SAMPLE TimeStamp="1199068800" Validity="0" Value="1.251456E+01"/><SAMPLE TimeStamp="1199069100" Validity="0" Value="1.266746E+01"/><SAMPLE TimeStamp="1199069400" Validity="0" Value="1.266234E+01"/><SAMPLE TimeStamp="1199069700" Validity="0" Value="1.266106E+01"/><SAMPLE TimeStamp="1199070000" Validity="0" Value="1.259365E+01"/><SAMPLE TimeStamp="1199070300" Validity="0" Value="1.238166E+01"/><SAMPLE TimeStamp="1199070600" Validity="0" Value="1.229414E+01"/><SAMPLE TimeStamp="1199070900" Validity="0" Value="1.224306E+01"/><SAMPLE TimeStamp="1199071200" Validity="0" Value="1.225017E+01"/><SAMPLE TimeStamp="1199071500" Validity="0" Value="1.207360E+01"/><SAMPLE TimeStamp="1199071800" Validity="0" Value="1.223199E+01"/><SAMPLE TimeStamp="1199072100" Validity="0" Value="1.232578E+01"/><SAMPLE TimeStamp="1199072400" Validity="0" Value="1.236228E+01"/><SAMPLE TimeStamp="1199072700" Validity="0" Value="1.243583E+01"/><SAMPLE TimeStamp="1199073000" Validity="0" Value="1.254738E+01"/><SAMPLE TimeStamp="1199073300" Validity="0" Value="1.279570E+01"/><SAMPLE TimeStamp="1199073600" Validity="0" Value="1.317496E+01"/><SAMPLE TimeStamp="1199073900" Validity="0" Value="1.322220E+01"/><SAMPLE TimeStamp="1199074200" Validity="0" Value="1.337082E+01"/><SAMPLE TimeStamp="1199074500" Validity="0" Value="1.323367E+01"/><SAMPLE TimeStamp="1199074800" Validity="0" Value="1.274038E+01"/><SAMPLE TimeStamp="1199075100" Validity="0" Value="1.235951E+01"/><SAMPLE TimeStamp="1199075400" Validity="0" Value="1.243144E+01"/><SAMPLE TimeStamp="1199075700" Validity="0" Value="1.255276E+01"/><SAMPLE TimeStamp="1199076000" Validity="0" Value="1.263342E+01"/><SAMPLE TimeStamp="1199076300" Validity="0" Value="1.252355E+01"/><SAMPLE TimeStamp="1199076600" Validity="0" Value="1.254722E+01"/><SAMPLE TimeStamp="1199076900" Validity="0" Value="1.261100E+01"/><SAMPLE TimeStamp="1199077200" Validity="0" Value="1.265973E+01"/><SAMPLE TimeStamp="1199077500" Validity="0" Value="1.257116E+01"/><SAMPLE TimeStamp="1199077800" Validity="0" Value="1.245824E+01"/><SAMPLE TimeStamp="1199078100" Validity="0"
    • By cmh
      Hi all,
       
      I'm having problems with a program I've written that hangs after some period of running. The program is fairly simple but it does a lot of xml parsing so to fix the problem I'm looking for things like references that are not closed. I have found one unclosed reference in one of my subVI:s but I can't close it without breaking the program so I look to you for help.
       
      The reference in question is the "Node Out" reference in the NI_XML.lvlib:Get First Matched Node.vi marked in the attached file CloseRef. What I would like to do is really to wire it to the invoke node (and not use the "Refnum in" there) but that does not work because somehow the reference has changed from a document reference to a node reference. If I just close the "Node Out" reference my program doesn't work (I guess it kills the "Refnum in" reference which I need later on).
       

       
      Any ideas on how I could handle the matter?
      Maybe this is not the cause of the program hanging but it's the best candidate I found so far.
       
      Thanks
      Martin
       
       
×
×
  • Create New...

Important Information

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