LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract FORMULADT, MUXDT type information from CDD file

I have tried to extract FORMULADT, MUX data types from CDD file.

But I could not find the formula information. I could read FORMULADT, MUXDT type by accessing through ( DATATYPES child node -> Attributes->ArrayofNodes->Node name and Value). I only can check "Node name: usage & Node value : coded2Phys." but no formula information.

 

Could anyone inform me how to extract formula and MUX information?

And How could figure out XML structure to extract data from LabVIEW?

 

Many thanks,

ShawnKim

0 Kudos
Message 1 of 5
(4,692 Views)

The simplest way to extract the data that you need from XML (the format used in a Candela .cdd file) is to use XPATH expressions.

Here is an example of getting the value from a formula node using the LabVIEW inbuilt XML parser.  The "Get First Matched Node.vi" evaluates the XPATH expression and returns the first matching node.

GetFormulaFromCDD.png

Several years ago I uploaded an example program for extracting data from a .cdd file using the inbuilt LabVIEW XML functions, however I stopped using that method shortly after because it is incredibly slow in comparison to the something like libxml2.

 

You can find the LabVIEW libxml2 wrappers here: https://forums.ni.com/t5/Example-Program-Drafts/Parsing-XML-is-too-slow-or-is-it/ta-p/3492686

This is what the solution looks like using the libxml2 wrappers...

GetFormulaFromCDDlibxml.png

 As far as the XML structure goes, XML is plain text.  I use the free app Notepad++ to view it and set it recognise the .cdd file format as xml so it formats it nicely and allows me to collapse and expand nodes.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Download All
0 Kudos
Message 2 of 5
(4,659 Views)

Thank you so much, Troy!

 

I allocated GetNodeTextContent.vi to the correct child node from example program for extracting data from a .cdd file using the inbuilt LabVIEW XML function , and I used Evaluate Equations using Eval Formula node  to get the result from the formula. 

I will have to use libxml2 wrappers to make a faster automation system in the future. 

 

Thank you again.

Shawn Kim 

 

 

 

0 Kudos
Message 3 of 5
(4,646 Views)

I used the LabVIEW libxml2 solution, which resulted in an execution time that was at least 340x faster than the NI solution!  I was desperate for a better solution because I had 340 data packets to parse from an XML file, and each data packet took a little over 1 second to parse using NI nodes - almost six minutes!  With LabVIEW libxml2, it took less time to parse ALL the packets than it did to parse ONE packet the NI way!  (Less than one second!)  I literally LOL'd - and I was glad I wasn't eating or drinking anything when I ran it.

 

There's a learning curve, but it was worth it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 5
(4,643 Views)

Hi @ShawnKim7,

 

By any chance, were you trying to use this along with the NI ADCS Toolkit? And were you able to interpret the data with the CDD diagnostic database?

0 Kudos
Message 5 of 5
(4,365 Views)