<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thinking in G &#187; Rants</title>
	<atom:link href="http://thinkinging.com/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkinging.com</link>
	<description>an unfiltered stream of data flow consciousness</description>
	<lastBuildDate>Fri, 02 Oct 2009 23:51:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>If you can&#8217;t think of something great to say&#8230;</title>
		<link>http://thinkinging.com/2009/02/08/if-you-cant-think-of-something-great-to-say/</link>
		<comments>http://thinkinging.com/2009/02/08/if-you-cant-think-of-something-great-to-say/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 01:00:02 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://thinkinging.com/?p=709</guid>
		<description><![CDATA[Hopefully, I&#8217;m not contradicting myself right now by writing this post, but I think it is worth stating:
If you can&#8217;t think of something great to say, don&#8217;t say anything at all.
Joel Spolsky just pointed out a perfect example of how being redundant and wordy can make your product look lame.
In today&#8217;s world of information overload, [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully, I&#8217;m not contradicting myself right now by writing this post, but I think it is worth stating:</p>
<p style="text-align: center;"><strong>If you can&#8217;t think of something great to say, don&#8217;t say anything at all.</strong></p>
<p>Joel Spolsky just pointed out <a href="http://www.joelonsoftware.com/items/2009/01/12.html">a perfect example</a> of how being redundant and wordy can make your product look lame.</p>
<p>In today&#8217;s world of information overload, getting noticed and remembered is about being remarkable and saying more with less.</p>
<p>This is true for many things, including: blogs, websites, emails, and even software installers.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2009/02/08/if-you-cant-think-of-something-great-to-say/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Customizing the LabVIEW Palettes is (Ridiculously) Hard</title>
		<link>http://thinkinging.com/2008/06/16/customizing-the-labview-palettes-is-ridiculously-hard/</link>
		<comments>http://thinkinging.com/2008/06/16/customizing-the-labview-palettes-is-ridiculously-hard/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 00:21:42 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[JKI]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[LabVIEW Tips]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[VIPM]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2008/06/16/customizing-the-labview-palettes-is-ridiculously-hard/</guid>
		<description><![CDATA[







Have you ever tried editing the LabVIEW palettes in order to integrate
your reusable VIs into LabVIEW? &#160;If you have then you've
undoubtedly experienced the frustration of finding your VIs missing
from your custom palettes, at some point.









Maybe you didn't realize one of the following facts about&#160;*.mnu files:



Tip: you can skip over this list, because it's probably completely [...]]]></description>
			<content:encoded><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>


<body>

Have you ever tried editing the LabVIEW palettes in order to integrate
your reusable VIs into LabVIEW? &nbsp;If you have then you've
undoubtedly experienced the frustration of finding your VIs missing
from your custom palettes, at some point.<br />

<br />

<div style="text-align: center;"><img style="width: 218px; height: 188px;" alt="Where is my reuse library?" title="Where is my reuse library?" src="http://thinkinging.com/wp-content/uploads/2008/06/Where%20is%20my%20reuse%20library.png"><br />

</div>

<br />

Maybe you didn't realize one of the following facts about&nbsp;*.mnu files:<br />

<br style="font-weight: bold;">

<span style="font-weight: bold;">Tip: you can skip over this list, because it's probably completely irrelevant to you.</span>
<ul>

  <li>*.mnu files uses <a href="http://wiki.lavag.org/Symbolic_Path">Symbolic Paths</a> for linking to files some times</li>

  <li>*.mnu (palette menu) files can be set to <span style="font-style: italic;">Synchronize with Directory</span></li>

  <li>*.mnu files have both a Functions palette and Controls palette inside them</li>

  <li>an LLB file contains a built-in palette menu</li>

  <li>your palette was being stored in an LLB file that you overwrote</li>

  <li>your palette was being stored in your My Documents LabVIEW data folder and didn't propagate with your reuse library folder</li>

  <li>*.mnu files store deleted/hidden items</li>

  <li>LabVIEW automatically creates dir.mnu files in folders found inside user.lib</li>

  
  <ul>

    <li>except for folders that begin with an underscore ("_")</li>

  
  </ul>

  <li>The "merge VI" setting is used to place a VI's contents when dropped, rather than placing a subVI</li>

</ul>

OK, you get the point. &nbsp;There's a lot you don't know (or more likely that you <span style="font-style: italic;">don't care to know</span>)
about *.mnu files. &nbsp;Whatever the reason, getting your reuse
library into the palettes is way too hard. &nbsp;Only an unlucky few
people in this world understand the idiosyncrasies of editing the
LabVIEW palettes. &nbsp;Fortunately, a few of these people are at JKI
working hard on a solution to this problem. &nbsp;And, <a href="http://forums.jkisoft.com/index.php?showtopic=680">the next version of VI Package Manager</a> is going to make understanding how the LabVIEW palettes work completely irrelevant (unless of course, you work at JKI). <img src='http://thinkinging.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />

<br />

Imagine being able to get your reuse libraries into the LabVIEW
palettes with the press of a button. &nbsp;And, that's just the
beginning...<br />

<br />

Have you tried editing the LabVIEW palettes? &nbsp;Were you successful?
&nbsp;Do you feel that you understand how the palettes work? &nbsp;Are
you looking for a better solution?
</body>
</html>
]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2008/06/16/customizing-the-labview-palettes-is-ridiculously-hard/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A Challenge to NI: Use your Application Builder</title>
		<link>http://thinkinging.com/2008/05/27/a-dogfooding-challenge-to-ni-use-your-application-builder/</link>
		<comments>http://thinkinging.com/2008/05/27/a-dogfooding-challenge-to-ni-use-your-application-builder/#comments</comments>
		<pubDate>Tue, 27 May 2008 07:00:51 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[National Instruments]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2008/05/27/a-dogfooding-challenge-to-ni-use-your-application-builder/</guid>
		<description><![CDATA[




I'd like to challenge developers at NI to find more ways to incorporate
stand-alone (built) LabVIEW applications into their internal systems
and processes.

One
of the major pain points in my day-to-day use of LabVIEW (which I love)
is building stand-alone applications. I suspect that the reason this is
so painful for me is that (in addition to my use cases [...]]]></description>
			<content:encoded><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
I'd like to challenge developers at NI to find more ways to incorporate
stand-alone (built) LabVIEW applications into their internal systems
and processes.<br />
<br />
One
of the major pain points in my day-to-day use of LabVIEW (which I love)
is building stand-alone applications. I suspect that the reason this is
so painful for me is that (in addition to my use cases being fairly
advanced) most of the developers at NI who are on the LabVIEW
development team probably don't build applications using LabVIEW --
they are not <a
 href="http://en.wikipedia.org/wiki/Eat_one%27s_own_dog_food">eating
their own dog food</a>.<br />
<br />
For
example,&nbsp;<a href="http://wiki.lavag.org/LVOOP">LVOOP</a>
(native LabVIEW Object Oriented Programming) dynamic method overriding
requires VIs of the same name,
but it is impossible to store two VIs of the same name inside an EXE?
How could this&nbsp;feature conflict possibly happen? &nbsp;I
suspect
that nobody actually tried to build an application that used LVOOP
until well after the feature was implemented. &nbsp;What's even
crazier
is that NI was working on this feature for many years, before it was
released.<br />
<br />
As time goes by, more people within NI are developing
code in LabVIEW on a daily basis. However, I'll bet that most of them
never actually use the application builder to build stand-alone
applications, since most LabVIEW code is shipped in source form and
never gets "built" -- it's just one big, <a
 href="/2008/02/11/monolithic-vs-modular-software-reuse-libraries-part-i/">monolithic
reuse library</a>.<br />
<br />
So,
I'd like to challenge developers at NI to find ways to incorporate
stand-alone (built) LabVIEW applications into their internal systems
and processes. It will make a huge difference to your customers.<br />
<br />
I'll
have you know that I'm committed to eating my own dog food, too.
&nbsp;At <a href="http://jkisoft.com">JKI</a>,
we work
very hard to use our own products in a variety of ways:<br />
<ul>
  <li><a href="http://jkisoft.com/easyxml">EasyXML</a>
is being used inside VI Package Manager<a
 href="http://jkisoft.com/vipm"></a>
(and other JKI products and projects), for reading and writing XML
files.</li>
</ul>
<ul>
  <li><a href="http://jkisoft.com/vipm">VI Package
Manager</a> (VIPM) is used to install EasyXML, as well as manage
the LabVIEW
configuration needed to develop and build EasyXML (and every other JKI
product and project).</li>
</ul>
I'm only telling you this, because I'm
committed to practicing what I preach. &nbsp;And, we're working on
a new version of VIPM that is going to take this concept to a whole new
level -- more on that, later.<br />
<br />
I should close by saying that I know some
of the people who work on the LabVIEW application builder and LVOOP and
they are all very nice/smart people who are very competent LabVIEW
developers and software designers. &nbsp;The only problem is that
they
are probably not eating their own dog food. &nbsp;NI has stated
that they are committed to this, so I want to make sure that this is
one area they do not neglect <img src='http://thinkinging.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
</body>
</html>
]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2008/05/27/a-dogfooding-challenge-to-ni-use-your-application-builder/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>The Diagram Disable Structure causes bugs</title>
		<link>http://thinkinging.com/2008/05/11/the-diagram-disable-structure-causes-bugs/</link>
		<comments>http://thinkinging.com/2008/05/11/the-diagram-disable-structure-causes-bugs/#comments</comments>
		<pubDate>Sun, 11 May 2008 07:00:21 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[LabVIEW Tips]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2008/05/20/the-diagram-disabled-structure-causes-bugs/</guid>
		<description><![CDATA[




One LabVIEW features that I both love and hate is the Diagram Disable Structure.
&#160;I love the fact that you can comment out code, especially
broken or stub (unfinished) code. &#160;However, I hate the fact that output
tunnels of the&#160;Diagram Disable Structure are set to "Use
Default if Unwired", because it causes buggy code.
&#160;Here's an example...

Let's say that we [...]]]></description>
			<content:encoded><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
One LabVIEW features that I both love and hate is the <span
 style="font-weight: bold;">Diagram Disable Structure</span>.
&nbsp;I love the fact that you can comment out code, especially
broken or stub (unfinished) code. &nbsp;However, <span
 style="font-style: italic;">I hate the fact that output
tunnels of the&nbsp;Diagram Disable Structure are set to "Use
Default if Unwired"</span>, because it causes buggy code.
&nbsp;Here's an example...<br />
<br />
Let's say that we have the block of code and want to comment out a VI.<br />
<br />
<img style="width: 515px; height: 111px;"
 alt="before commenting out code"
 title="before commenting out code"
 src="http://thinkinging.com/wp-content/uploads/2008/05/Pre%20DDS.png"><br />
<br />
<br />
So, we wrap the VI in a&nbsp;Diagram Disable Structure.<br />
<br />
<img style="width: 515px; height: 133px;"
 alt="after commenting out code"
 title="after commenting out code"
 src="http://thinkinging.com/wp-content/uploads/2008/05/Post%20DDS.png"><br />
<br />
<br />
Everything is good, now, right? &nbsp;The VI's "Run Arrow" (<img
 style="width: 22px; height: 21px;" alt="Run Arrow"
 title="Run Arrow"
 src="http://thinkinging.com/wp-content/uploads/2008/05/Run%20Arrow.png">)
button is not broken, so surely everything must be OK.<br />
<br />
WRONG!!!<br />
<br />
If we show the "Enabled" frame of the Diagram Disable Structure, we can
see that we're not passing though the DAQmx task reference and the
error cluster. &nbsp;Our code won't work.<br />
<br />
<img style="width: 511px; height: 186px;"
 alt="I broke the dataflow" title="I broke the dataflow"
 src="http://thinkinging.com/wp-content/uploads/2008/05/Post%20DDS%20Warning.png"><br />
<br />
<br />
To fix this problem we have to manually wire the&nbsp;DAQmx task
reference and the error cluster.<br />
<br />
<img style="width: 512px; height: 185px;"
 alt="I fixed the dataflow" title="I fixed the dataflow"
 src="http://thinkinging.com/wp-content/uploads/2008/05/Post%20DDS%20Fixed.png"><br />
<br />
Now, we're good. &nbsp;But, we could have avoided this whole
problem if
the&nbsp;Diagram Disable Structure didn't set all the output
tunnels to
"Use Default if Unwired".<br />
<br />
Presumably, this "feature" (although I like to think of it as a bug)
was chosen because users's code doesn't break (at least not at edit
time) when they wrap a block of code in a Diagram Disable Structure.
Personally, <a
 href="http://thinkinging.com/2007/06/19/write-your-labview-code-so-that-it-breaks/">I'd
happily accept&nbsp;broken code at edit time&nbsp;to avoid code
with bugs</a> -- the choice is obvious to me.<br />
<br />
A good solution would be for the LabVIEW designers to make the Diagram
Disable Structure&nbsp;intelligent enough to automatically wire any
output tunnels to input tunnels that are of the same data type and
vertical position. &nbsp;Now, that would be cool! <img src='http://thinkinging.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />
<br />
</body>
</html>
]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2008/05/11/the-diagram-disable-structure-causes-bugs/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Did National Instruments forget about Virtual Instruments?</title>
		<link>http://thinkinging.com/2008/01/22/did-national-instruments-forget-about-virtual-instruments/</link>
		<comments>http://thinkinging.com/2008/01/22/did-national-instruments-forget-about-virtual-instruments/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 03:00:53 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[National Instruments]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2008/01/29/did-national-instruments-forget-about-virtual-instruments/</guid>
		<description><![CDATA[It&#8217;s been over 20 years now that National Instruments has been refining LabVIEW as a powerful test, measurement, and automation platform, as well as a general purpose graphical data flow programming language.  For many years, LabVIEW&#8217;s slogan was &#34;

   the software is the instrument

&#34;.  NI even named the basic building block [...]]]></description>
			<content:encoded><![CDATA[It&#8217;s been over 20 years now that National Instruments has been refining LabVIEW as a powerful test, measurement, and automation platform, as well as a general purpose graphical data flow programming language.  For many years, LabVIEW&#8217;s slogan was &quot;
<em zid="2">
   the software is the instrument
</em>
&quot;.  NI even named the basic building block of LabVIEW programs the &quot;virtual instrument&quot; (or &quot;VI&quot; for short).  But, after using LabVIEW now for well over a decade, I have to wonder&#8230;
<br zid="17" />
<br zid="18" />
<strong zid="3">
   Why is it so hard to create virtual instruments in LabVIEW?
</strong>
<br zid="19" />
<br zid="20" />
Just to be clear, when I say it&#8217;s difficult to create virtual instruments, I&#8217;m not taking about VIs (the basic building blocks of LabVIEW programs) with their Front Panels and Block Diagrams.  I am talking about 
<strong zid="4">
   software that 
   <em zid="5">
      behaves
   </em>
   like a instrument
</strong>
. Let&#8217;s take a step back and look at what I mean by this.
<br zid="21" />
<br zid="22" />
A traditional instrument is a physical device that sits on the lab bench or in a rack. The traditional instrument:
<br zid="29" />
<br zid="30" />
<ul zid="31">
   <li zid="32">
      has 
      <strong zid="6">
         statefulness
      </strong>
      &#8212; it remembers whether it&#8217;s turned ON or OFF, it knows its active configuration settings, etc.
   </li>
</ul>
<ul zid="33">
   <li zid="34">
      can do 
      <strong zid="7">
         work asynchronously 
      </strong>
      &#8212; you can ask it to reset, acquire some data, perform analysis, etc. You can ask it when it is finished with the asynchronous work and then ask it to send you the data.
   </li>
</ul>
<ul zid="35">
   <li zid="36">
      can have 
      <strong zid="8">
         multiple instances 
      </strong>
      &#8212; just order another one from the catalog and set it on the lab bench, right next to the first. You can give each physical instrument a name, such as &quot;multimeter 1&quot; and &quot;multimeter 2&quot; &#8212; you might even choose to use a label maker to print the name and stick it onto the front of each instrument, so that you never forget which one is which.
   </li>
</ul>
<ul zid="37">
   <li zid="38">
      can 
      <span zid="41" style="font-weight: bold;">
         communicate with other software and instruments 
      </span>
      &#8212; TCP-IP, RS-232, GPIB, etc. via SCPI, LXI, or other protocols.
      <br zid="39" />
   </li>
</ul>
OK, you get the point &#8212; you know all about traditional instruments.
<br zid="23" />
<br zid="24" />
Now, let&#8217;s say that you want to create a 
<span zid="42" style="font-style: italic;">
   virtual
</span>
instrument &#8212; meaning, you want to create software that uses modular hardware that can do everything that a bench-top instrument does. You want to use a data acquisition (DAQ) device as modular I/O and then write some software that uses the DAQ device to implement the functionality and behavior of a traditional multimeter.  Where do you get started?  First, let&#8217;s take inventory of the requirements:
<ul zid="9">
   <li zid="10">
      Statefulness
   </li>
   <li zid="11">
      Asynchronous processing of tasks
   </li>
   <li zid="12">
      Multiple named instances
   </li>
   <li zid="13">
      Ability to communicate with client software using industry standard protocols such as SCPI, LXI, etc.
   </li>
</ul>
Hmmm, it&#8217;s starting to sound like we need some kind of by-reference object-oriented framework&#8230;
<br zid="25" />
<br zid="26" />
Now, I&#8217;m not going to get into the whole 
<em zid="14">
   by value
</em>
vs 
<em zid="15">
   by reference
</em>
OOP debate.  All I&#8217;m saying is that almost every LabVIEW developer who creates a non-trivial automation or control system application will want to create a virtual instrument with all of the features that I&#8217;ve identified above and that these features sound a whole lot like by reference objects.
<br zid="27" />
<br zid="28" />
<span zid="45" style="font-weight: bold;">
   Where did NI drop the ball with virtual instrumentation?
</span>
<br zid="46" style="font-weight: bold;" />
<br zid="47" />
Did the concept of a VI as a Front Panel and Block Diagram distract them (and us) from what we really need from a virtual instrument?  Does NI&#8217;s marketing mantra shift away from &quot;the software is the instrument&quot; to &quot;design, develop, deploy&quot; imply that they aren&#8217;t really concerned with the developers ability to emulate pysical hardware using software (after all, NI does want you to buy 
<em zid="16">
   their
</em>
hardware)?  Is NI simply out of touch with the types of large systems that software developers create using LabVIEW? Or, is NI working on a by-reference framework that will allow us to create our own, stateful, asynchronous, multi-instance, by reference virtual instruments that can communicate using a variety of protocols and physical transport layers?
<br zid="49" />
<br zid="50" />
In a future article, I&#8217;ll describe more about the features that I&#8217;m looking for in a virtual instrumentation framework and how NI could stand to benefit from implementing something like it.
<br zid="48" />
<br zid="51" />
PS &#8211; After writing this, I did happen to find somebody at NI talking about the 
<a href="http://automatedtestblog.com/2008/01/22/trend2-growth-of-software-defined-instrumentation/" zid="52">
   Growth of Software-Defined Instrumentation
</a>
.  Hopefully that&#8217;s a good sign. <img src='http://thinkinging.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2008/01/22/did-national-instruments-forget-about-virtual-instruments/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using XML Data in LabVIEW is Hard</title>
		<link>http://thinkinging.com/2008/01/21/using-xml-data-in-labview-is-hard/</link>
		<comments>http://thinkinging.com/2008/01/21/using-xml-data-in-labview-is-hard/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 00:00:34 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2008/01/22/using-xml-data-in-labview-is-hard/</guid>
		<description><![CDATA[XML, which stands for eXtensible Markup Language, is text-based data format (or language) that
is human readable and can be used to create arbitrary data
structures.&#160; It is designed to facilitate sharing structured
data across many different systems.&#160; Here is a simple example
of XML data:


&#60;Person Nationality=&#8221;US&#8221;&#62;
&#160; &#60;Name&#62;
&#160;&#160;&#160; &#60;First&#62;John&#60;/First&#62;
&#160;&#160;&#160; &#60;Last&#62;Doe&#60;/Last&#62;
&#160; &#60;/Name&#62;

&#60;/Person&#62;

Figure 1 &#8211; simple XML data representing a person

You&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[XML, which stands for e<span style="font-weight: bold;" zid=
"9">X</span>tensible <span style="font-weight: bold;" zid=
"75">M</span>arkup <span style="font-weight: bold;" zid=
"11">L</span>anguage, is text-based data format (or language) that
is human readable and can be used to create arbitrary data
structures.&nbsp; It is designed to facilitate sharing structured
data across many different systems.&nbsp; Here is a simple example
of XML data:<br zid="17">

<br zid="18">
<span style="font-family: courier new,courier,monospace;" zid=
"53">&lt;Person Nationality=&#8221;US&#8221;&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="20">
<span style="font-family: courier new,courier,monospace;" zid=
"54">&nbsp; &lt;Name&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="21">
<span style="font-family: courier new,courier,monospace;" zid=
"55">&nbsp;&nbsp;&nbsp; &lt;First&gt;John&lt;/First&gt;</span><br
style="font-family: courier new,courier,monospace;" zid="22">
<span style="font-family: courier new,courier,monospace;" zid=
"56">&nbsp;&nbsp;&nbsp; &lt;Last&gt;Doe&lt;/Last&gt;</span><br
style="font-family: courier new,courier,monospace;" zid="23">
<span style="font-family: courier new,courier,monospace;" zid=
"57">&nbsp; &lt;/Name&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="19">

<span style="font-family: courier new,courier,monospace;" zid=
"58">&lt;/Person&gt;</span><br zid="12">
<br zid="76">
Figure 1 &#8211; simple XML data representing a person<br zid="77">
<br zid="24">
You&#8217;ll notice that the data looks a lot like HTML, or Hypertext
Markup Language (and in fact, XHTML is XML formatted data).&nbsp;
In XML a &#8220;schema&#8221; defines the set of the possible elements and the
constraints on those elements (what sub-elements and attributes
they can have).<br zid="169">
<br />
<h2 zid="186">LabVIEW&#8217;s XML Schema</h2>

There are several tools for dealing with XML data in LabVIEW.&nbsp;
First off, LabVIEW includes some VIs for Flattening and
Unflattening LabVIEW data to and from XML.&nbsp; Figure 2, below,
shows how to use the <span style="font-weight: bold;" zid=
"60">Flatten to XML</span> function to convert a cluster to an XML
string. <br zid="25">

<br zid="50">
<img src=
"http://thinkinging.com/wp-content/uploads/2008/01/NI%20Flatten%20Person%20Cluster%20to%20XML.png"
 zid="59">

<br zid="93">
Figure 2 &#8211; LabVIEW&#8217;s <span style="font-weight: bold;" zid=
"94">Flatten To XML</span> function is used to convert any LabVIEW
data to an XML string.<br zid="52">
<br zid="61">
What you&#8217;ll notice is that LabVIEW uses a special XML schema for
flattening data.&nbsp; The schema that LabVIEW uses is defined by
the XSD file located beneath the LabVIEW installation, here: <span
style="font-family: courier new,courier,monospace;" zid=
"92">&lt;LabVIEW&gt;\vi.lib\Utility\LVXMLSchema.xsd.
&nbsp;</span>Generally speaking the LabVIEW XML schema uses the
following format:<br zid="62">
<br zid="63">
<span style="font-family: courier new,courier,monospace;" zid=
"68">&lt;{Data Type}&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="26">

<span style="font-family: courier new,courier,monospace;" zid=
"69">&lt;Name&gt;{Data Label}&lt;/Name&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="64">
<span style="font-family: courier new,courier,monospace;" zid=
"70">&lt;{Attribute Name}&gt;{Attribute Value}&lt;/{Attribute
Name}&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="66">
<span style="font-family: courier new,courier,monospace;" zid=
"71">&lt;Val&gt;{Data Value}&lt;/Val&gt;</span><br style=
"font-family: courier new,courier,monospace;" zid="67">
<span style="font-family: courier new,courier,monospace;" zid=
"72">&lt;/{Data Type}&gt;</span><br zid="27">
<br zid="73">
One of the disadvantages of this format is that it does not allow
you generate or parse <span style="font-style: italic;" zid=
"84">arbitrary</span> XML.&nbsp; For example, the XML data shown in
Figure 1, which represents a person, does not conform to the
LabVIEW XML schema, so we cannot use LabVIEW&#8217;s <span style=
"font-weight: bold;" zid="78">Flatten To XML</span> or <span style=
"font-weight: bold;" zid="79">Unflatten From XML</span> functions
to generate or parse that data.<br zid="174">

<br zid="175">
<h2 zid="187">Creating Arbitrary XML Data</h2>

A natural and straight-forward approach is to use the <span style=
"font-weight: bold;" zid="109">Format into String</span> function
to create XML data when some special schema is required.<br zid=
"105">
<br zid="110">
<img align="bottom" alt="" border="0" hspace="0" src="http://thinkinging.com/wp-content/uploads/2008/01/Format%20into%20String%20Person%20Cluster%20to%20XML.png"
 vspace="0" zid="111"><br zid="121">

<br zid="122">
Figure 3 &#8211; Converting LabVIEW data to an arbitrary XML schema<br
zid="106">
<br zid="112">
The downside of the technique shown in Figure 3 is that whenever we
want to change the XML schema we have to change the items in the
cluster and in the format string.&nbsp; And, if we are changing the
number of items in the XML, we have to add or remove items on the

<span style="font-weight: bold;" zid="114">Unbundle by Name</span>
and <span style="font-weight: bold;" zid="115">Format into
String</span> functions &#8212; that&#8217;s a lot of work and leaves a lot of
room for mistakes (a.k.a. &#8220;bugs&#8221;).<br zid="116">
<br zid="118">
<h2 zid="188">Parsing Arbitrary XML Data</h2>

Converting arbitrary XML data back into LabVIEW data is a bit more
complicated than it is to convert LabVIEW data into arbitrary
XML.&nbsp; For this task, we really need to use an XML
parser.&nbsp; An XML parser analyzes an XML string and creates a
<span style="font-style: italic;" zid="123">document</span> object
that can be accessed using a Document Object Model, or DOM,
API.&nbsp; There are a variety of XML parsers available, including
one from National Instruments which is bundled with the <a href=
"http://sine.ni.com/nips/cds/view/p/lang/en/nid/2501" target=
"_blank" title="" zid="99">LabVIEW Internet Toolkit</a>.&nbsp;

Also, the Microsoft XML Parser is available from LabVIEW via
ActiveX and .NET and usually pre-installed on most Windows systems
(and if it&#8217;s not, you can easily download it for free).<br zid=
"138">
<br zid="139">
Figure 4, below, shows how to read an attribute of an XML
element using the functions provided with the LabVIEW Internet
Toolkit.&nbsp; As you can see, the process is quite tedious.&nbsp;
And, we haven&#8217;t even extracted the person&#8217;s name, yet.&nbsp; That
is even more tedious!<br zid="124">
<br zid="128">
<img align="bottom" alt="" border="0" hspace="0" src=
"http://thinkinging.com/wp-content/uploads/2008/01/Parse%20Person%20Nationality%20-%20NI%20Internet%20Toolkit.png"
 vspace="0" zid="135">

<br zid="131">
<br zid="132">
Figure 4 &#8211; Parsing an XML string to extract an element&#8217;s
attribute<br zid="133">
<br zid="177">

<h2 zid="178">Conclusion</h2>

Dealing with arbitrary XML data (that does not conform to LabVIEW&#8217;s
XML schema) is generally very difficult, requiring a lot of
duplicate and excessive code that is tedious and risky to
maintain.&nbsp; XML parsers do the work of validating and parsing
the XML, but there is usually a lot of additional coding required
to extract element and attribute values from the document object.
&nbsp; Certainly, there must be an easier way&#8230; <img src='http://thinkinging.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br zid=
"163">
<br zid="164">
Are you using XML in your LabVIEW applications?  Are there specific XML schema that you have to use?  Which aspects of working with XML data do you find difficult?  What solutions have you found?
<br /><br />
[Update: I have posted a follow-up to this article called <a href="http://thinkinging.com/2008/03/01/using-xml-data-in-labview-just-got-easier/">Using XML Data in LabVIEW Just Got Easier</a>. I hope you enjoy it.]]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2008/01/21/using-xml-data-in-labview-is-hard/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Rant: Why don&#8217;t desktop applications have a &#8220;rename document&#8221; option?</title>
		<link>http://thinkinging.com/2007/10/07/rant-why-dont-desktop-applications-have-a-rename-document-option/</link>
		<comments>http://thinkinging.com/2007/10/07/rant-why-dont-desktop-applications-have-a-rename-document-option/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 22:02:20 +0000</pubDate>
		<dc:creator>Jim Kring</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Software Usability]]></category>

		<guid isPermaLink="false">http://thinkinging.com/2007/10/07/rant-why-dont-desktop-applications-have-a-rename-document-option/</guid>
		<description><![CDATA[One of the things that annoys me about most software applications is how the
File&#62;&#62;Save As... dialog doesn't have a "rename" check box (or some
other easy way to rename and/or move a file on disk).

When renaming a document, you usually have to do it one of two ways:


  1) Close the document, rename it on [...]]]></description>
			<content:encoded><![CDATA[One of the things that annoys me about most software applications is how the
<i>File&gt;&gt;Save As...</i> dialog doesn't have a "rename" check box (or some
other <b>easy way to rename and/or move a file on disk</b>).<br/>
<br/>
When renaming a document, you usually have to do it one of two ways:<br/>
<br/>
<div style="MARGIN-LEFT:40px">
  1) Close the document, rename it on disk, reopen the document<br/>
  <br/>
  2) Select <i>File&gt;&gt;Save As...</i>, rename the document, and then go into
  the folder where the old file exists and delete it.<br/>
</div>
<br/>
Each of these two methods significantly <b>breaks the user's work flow</b>,
which is a terrible thing to do. It can cause you to <b>loose the context of
what you were doing</b> and it <b>increases the likelihood of making a
mistake</b> (like deleting the wrong file, etc.)<br/>
<br/>
<a href="http://docs.google.com" id="v7c0" title="Google Docs">Google Docs</a>
has a rename document feature and it is really nice. I guess that this was more
obvious to web app developers (especially the smart folks at Google), since the
user doesn't really interact with files on a PC and the fact that switching
between web pages to rename a file is even more tedious than doing it on a
desktop computer. But, desktop apps are going to be around for a while, so it
would be nice we could standardize a document renaming feature.<br/>
<br/>
Also,
<a href="http://en.wikipedia.org/wiki/LabVIEW" id="g1rn" title="LabVIEW">LabVIEW</a>
(starting in version 8.5) has a nice way to rename files from the
<i>File&gt;&gt;Save As...</i> dialog.&nbsp; And, I think <b>I can take a little
credit for inspiring this</b>, since I created a LabVIEW extension that adds a
<i>File&gt;&gt;Move/Rename As...</i> menu-option
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=47875#M47875" id="v6rv" title="back in 2003">back
in 2003</a>.&nbsp; Now that I think about it, that was before Google Docs, too <img src='http://thinkinging.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> 
<br/>
<br/>]]></content:encoded>
			<wfw:commentRss>http://thinkinging.com/2007/10/07/rant-why-dont-desktop-applications-have-a-rename-document-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
