<?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>Culverson Software-Custom DAQ Software labVIEW</title>
	<atom:link href="http://culverson.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://culverson.com</link>
	<description>Custom Labview Data Acquisition Software Maine</description>
	<lastBuildDate>Mon, 01 Feb 2010 20:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What time is it, again?</title>
		<link>http://culverson.com/what-time-is-it-again/</link>
		<comments>http://culverson.com/what-time-is-it-again/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 17:36:08 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=272</guid>
		<description><![CDATA[The TIMESTAMP indicator is smart enough to get you into trouble.
Just ran into what at first appeared to be a bug, but turned out to be proper, if misunderstood, behavior.
I have a project which records data files. When the actual recording starts, and again when it stops, I remember the time (by using a GET [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em><strong>The TIMESTAMP indicator is smart enough to get you into trouble.</strong></em></p>
<p>Just ran into what at first appeared to be a bug, but turned out to be proper, if misunderstood, behavior.</p>
<p>I have a project which records data files. When the actual recording starts, and again when it stops, I remember the time (by using a GET DATE/TIME in SECONDS function) in a TIMESTAMP variable, which is stored in the data file. There might or might not be some calibration activity after the recording has stopped.  When the DONE button is finally clicked, I record the current time using a FORMAT DATE and TIME STRING function, into another string field called &#8220;TEST TIME&#8221;</p>
<p>I have a viewer which examines the data files and reports various info about them. The indicator that shows the TEST TIME is on a different window from the one that shows the START TIME and END TIME.</p>
<p>If there&#8217;s no CAL operations done, then the TEST TIME has always been just a few seconds later than the STOP time (enough time to react to the test being done and click the DONE button), or it could be a few minutes later.</p>
<p>However, I recently noticed that, on a data file sent from my client to me, that the TEST TIME was almost an hour EARLIER than the STOP time.  How could that be?  Further rummaging thru other files that I had from him shows the same thing: the TEST TIME was short of an hour EARLIER than the DONE time.  If there were CAL operations done, this difference was 45-55 minutes; if not, it was a few seconds short of an hour.</p>
<p>I have run thousands of tests on my machine without noticing this; my client has also run nearly a thousand, and has never brought it up.  Whay is that?</p>
<p><span id="more-272"></span></p>
<p>There&#8217;s one piece of info missing from the above description that&#8217;s critical to figuring out what&#8217;s happening: My client is on CENTRAL time, while I am on EASTERN time.</p>
<p>It took a while to figure out what was really happening:  The TIMESTAMP value was being sent whole: encoded with that value somewhere must be the TIMEZONE that it was recorded in.  When the file crossed the timezone line, the value (as it was displayed to me) actually changed.  I confirmed this with my client; a given file showed a START time of 9:39:20 on his machine, but the same file showed a START time of 10:39:20 on my machine.  Of course, those are the exact same moments, just expressed in different time zones.</p>
<p>The TEST TIME, however was recorded as a STRING, and as such, has no mechanism for changing.</p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/what-time-is-it-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beating the Jitters</title>
		<link>http://culverson.com/beating-the-jitters/</link>
		<comments>http://culverson.com/beating-the-jitters/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:10:42 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=264</guid>
		<description><![CDATA[A shortcut to determinism in real-time applications
Determinism in software is the ability to ensure that any and all paths taken through the code take a consistent amount of time to execute.  Most desktop applications have no interest in this consistency because A) it doesn&#8217;t affect anything, and B) the existence of interrupts and preemptive multitasking [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em><strong><span style="color: #888888;">A shortcut to determinism in real-time applications</span></strong></em></p>
<p><span style="color: #000000;"><span style="color: #888888;">Determinism in software is the ability to ensure that any and all paths taken through the code take a consistent amount of time to execute.  Most desktop applications have no interest in this consistency because A) it doesn&#8217;t affect anything, and B) the existence of interrupts and preemptive multitasking means that you cannot do anything about it anyway.<br />
</span> </span><span style="color: #000000;"><span style="color: #888888;"><br />
</span> </span><span style="color: #000000;"><span style="color: #888888;">In an embedded control application, or one running under a real-time OS however, determinism is often important because it is critical that the control outputs be changed at a consistent time with respect to the control input sampling time. On the input side, when a signal is changing at a relatively rapid rate, any error in the TIME of measurement is just as destructive to the measurement accuracy as an error in AMPLITUDE.  For applications such as PID loops, this is even more important, since derivative terms are adversely affected by timing inaccuracies.<br />
</span> </span><span style="color: #000000;"><span style="color: #888888;"><br />
</span> </span><span style="color: #888888;">Equally important, but not always equally recognized, is the fact that the timing of the output samples has exactly the same effect.  If your control output is not consistently timed, then loop stability is compromised.</span></p>
<p><span style="color: #000000;"><span id="more-264"></span><span style="color: #888888;"><br />
</span> </span><span style="color: #000000;"><span style="color: #888888;"><br />
</span> </span><span style="color: #000000;"><span style="color: #888888;">One way to make your code deterministic is to go through it and make sure that all path lengths are identical.  For example, if your code includes an option to scale the signal to percent of full scale or not, then the proper way to make this deterministic is to compute the full-scale percentage in all cases, then decide to use the scaled or the unscaled value depending on the option setting.  This goes against the programmer&#8217;s natural instinct to do work only when required; but it&#8217;s necessary to ensure that both paths consume an equal time.<br />
</span> </span><span style="color: #000000;"><span style="color: #888888;"><br />
</span> </span><span style="color: #000000;"><span style="color: #888888;">Beginners to real-time programming are rightly warned about this situation.  If you look at the larger picture, you realize that the goal of all this is to ensure that the outputs change at a consistent time relative to each other and to absolute time.  The assumption inherent in the idea of equalizing code paths is that you want the outputs to follow as soon as possible after the control inputs are sampled.<br />
</span> </span><span style="color: #000000;"><span style="color: #888888;"><br />
</span> </span><span style="color: #888888;">That assumption is true in some cases, but by no means all.  There is another way to achieve the same result (consistency of output timing), without the drudgery of counting cycles and finding all the places where such path decisions are made.</span></p>
<p><span style="color: #888888;">By building in a hardware-controlled delay, you can achieve rock-solid precision of output timing, without fretting over every single operation. One way to do this is to use the very same clock signal that drives the input timing to drive the output timing.  For example, in the following code, we:</span></p>
<ul>
<li><span style="color: #888888;">Create the task for the Analog Output channels</span></li>
<li><span style="color: #888888;">Set the AO SAMPLE CLOCK timing parameters to the AI clock signal</span></li>
<li><span style="color: #888888;">Start the task</span></li>
</ul>
<p><span style="color: #888888;"><img class="alignnone size-full wp-image-265" title="AO Config" src="http://culverson.com/site09/wp-content/uploads/2009/10/AO-Config.PNG" alt="AO Config" width="532" height="348" /></span></p>
<p><span style="color: #888888;">This instructs the OUTPUT task to use the same clock as the INPUT.  When you WRITE to the output task, the values you write will stay in the output buffer until the clock ticks; at that point they will be transferred to the actual analog output.</span></p>
<p><strong><span style="color: #888888;">What Does this Do for Me? </span></strong></p>
<p><span style="color: #888888;">By doing this, you have freed yourself from all constraints of cycle-counting and path-equalization. Your control output will change exactly one clock tick after the inputs that produce it. No more and no less.  You have only one constraint: you must get the job done in one clock cycle. If you are running at a loop rate of 100 Hz, then you have 10 mSec to get your work done. If it takes 10 microseconds or 9.99 mSec, it makes NO difference, the output will change at the same point in time either way. You do have to ensure that it&#8217;s 10 mSec or less, but that&#8217;s a constraint you have in any case.</span></p>
<p><span style="color: #888888;">In most cases, where you are waiting on a clock-controlled input sample, performing some control processing with the measured values and writing control values out, the delay you are introducing is not significant.  And a precisely controlled </span><span style="text-decoration: underline;"><span style="color: #888888;">constant</span></span><span style="color: #888888;"> delay is often more easily dealt with in a control loop than an unpredictable jitter, and easier to produce in hardware than in software.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/beating-the-jitters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Non-Fragile Code</title>
		<link>http://culverson.com/writing-non-fragile-code/</link>
		<comments>http://culverson.com/writing-non-fragile-code/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:48:59 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Easier Programming]]></category>
		<category><![CDATA[LabVIEW]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=254</guid>
		<description><![CDATA[Oooops&#8230;. who broke it?
&#8220;Fragile&#8221; code is code that breaks in one place because of changes you make in some other place. It&#8217;s most aggravating when you&#8217;re due to ship a new version tomorrow and you need to make one last tweak at 11:30 PM, or your client is looking over your shoulder and this little [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong><em>Oooops&#8230;. who broke it?</em></strong></p>
<p>&#8220;Fragile&#8221; code is code that breaks in one place because of changes you make in some other place. It&#8217;s most aggravating when you&#8217;re due to ship a new version tomorrow and you need to make one last tweak at 11:30 PM, or your client is looking over your shoulder and this little &#8220;harmless&#8221; change shows up as a smoldering heap during the demo.</p>
<p>In this case, &#8220;break&#8221; doesn&#8217;t ONLY mean &#8220;broken arrow&#8221; , or uncompilable code (at least you can chase those down easily enough). Here, &#8220;break&#8221; also means &#8220;operates incorrectly&#8221; or &#8220;completely wrecks itself like it never did before&#8221; or somewhere in between.</p>
<p>These sorts of breaks come from unrecognized dependencies, and they&#8217;re all too easy to make: the header size has been 3 for months and months now, so when you add a new function that needs it, it&#8217;s easy to stick in a constant 3 and be done with it.</p>
<p>DON&#8217;T DO IT.</p>
<p><span id="more-254"></span>If you&#8217;re an old-hand bit-banging cycle counter like me, it&#8217;s easy to think of saving a few cycles and adding up the bytes in this cluster, and using a constant of 53 when you need the size of it.</p>
<p>DON&#8217;T DO IT.</p>
<p>The problem is, or course, then when (not <em>if</em>, but <em>when</em>) these things change, then you will have to track down ALL the instances where you use this number and change them.  Not a good plan.  The compiler won&#8217;t complain &#8211; the code is still valid.  But reading thee bytes when you should be reading four will not get you where you want to go.</p>
<p>One tip to solving this is to reduce the number of places that you use such numbers. Focus such procedures into a single VI if you can. But the real key to solving this is to recognize these things when you originate them.</p>
<p><strong>Example #1</strong></p>
<p>Here we need to receive a packet header, consisting of a cluster of a U8 enum command and a U16 integer.  It&#8217;s easy enough to count up to three bytes, and it would be easy to plop down a 3 constant.  However, it is safer to use a constant of the header&#8217;s typedef and calculate its size in code.  This might go against your instincts (it does mine), but in fact the extra time taken (to flatten into string and get string length) is trivial (<a href="http://culverson.com/what-time-is-it/" target="_blank">measure it yourself</a> if you have doubts). On top of a TCP READ operation, this burden is truly insignificant.</p>
<p>And the benefit is that when the integer needs to become an U32 or the command must become a U16, here&#8217;s one less thing YOU have to worry about.  Since the constant here is a TYPEDEF, and since you&#8217;re calculating the size every time, then it will keep on working.</p>
<p><img class="alignnone size-full wp-image-256" title="Fragile1" src="http://culverson.com/site09/wp-content/uploads/2009/10/Fragile1.PNG" alt="Fragile1" width="234" height="158" /></p>
<p><strong>Example #2</strong></p>
<p><strong><span style="font-weight: normal;">This example is similar &#8211; sending a packet header plus a payload thru a connection. Even if your payload is always the same size, it&#8217;s better to calculate it than to use a constant.  With any luck at all, the STRING LENGTH operation will get the same answer every time. and if you do change it at some point, then this code won&#8217;t break.</span></strong></p>
<div><img class="alignnone size-full wp-image-258" title="Fragile2" src="http://culverson.com/site09/wp-content/uploads/2009/10/Fragile2.PNG" alt="Fragile2" width="344" height="140" /></div>
<div><strong>Example #3</strong></div>
<div>Here&#8217;s another use.  When you have an ENUM, it might be useful to loop over every value. But how do you know how many values to use?  You could count them and plop down a constant. That&#8217;s no good, because it leaves you vulnerable.  You know the first value has a numeric equivalent of 0, you could add a value called &#8220;Last&#8221;, but that&#8217;s ugly if the enum is a control onscreen somewhere.</div>
<div>My answer is to cast a large U16 (or whatever data type the ENUM is) into that type (and then possibly back to an integer if needed.</div>
<div>Here, the FOLDER is an enum listing the various folders my program can refer to. I don&#8217;t know how many there are, maybe 25-30 (in this case, ignorance really is bliss), because I don&#8217;t care.</div>
<div>This code is responsible for creating them all (with exceptions) at startup time.</div>
<div>First we start with a large U16.  I picked U16 to match the representation of the enum itself; that&#8217;s necessary for proper casting results.</div>
<div>Then we typecast it to the folder type.  Presumably, 9999 is more than the number of entries in the ENUM, so the typecasting process can&#8217;t let a literal cast stand, as it would be an illegal value.  So what comes out is the last possible value.</div>
<div>Inside the loop, we convert the &#8220;i&#8221; variable to a U16 to match the representation of the enum itself.</div>
<div>Then we typecast that value into the folder type.</div>
<div>The result is a variable that cycles from first ENUM value to the last ENUM value, and does something with each value, all without knowing how many there are!</div>
<div>If we add a new folder type to the ENUM (it is a typedef), then this code does not need changing.</div>
<div><img class="alignnone size-full wp-image-259" title="Fragile3" src="http://culverson.com/site09/wp-content/uploads/2009/10/Fragile3.PNG" alt="Fragile3" width="351" height="183" /></div>
<div>I hope that this thought will help you create code that is more robust.  Your clients will love you for it.</div>
<div>Enjoy.</div>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/writing-non-fragile-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Time Alignment of Signals</title>
		<link>http://culverson.com/time-alignment-of-signals/</link>
		<comments>http://culverson.com/time-alignment-of-signals/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 21:09:43 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=230</guid>
		<description><![CDATA[A picture is worth 1024 words
I discussed the idea of a time-alignment scheme in the article Delays, Delays, Delays.  The idea is that signals which have a mechanical delay of some kind (gas transport time, for example) can be time-aligned with signals that have a lesser or no such delay by means of a &#8220;logical&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong><em>A picture is worth 1024 words</em></strong></p>
<p>I discussed the idea of a time-alignment scheme in the article <a title="Delays, Delays, Delays" href="http://culverson.com/delays-delays-delays/" target="_blank">Delays, Delays, Delays</a>.  The idea is that signals which have a mechanical delay of some kind (gas transport time, for example) can be time-aligned with signals that have a lesser or no such delay by means of a &#8220;logical&#8221; delay line inserted into all channels.  If the sum of all channel&#8217;s physical + logical delays is a constant, then the final output is time-aligned.</p>
<p>Here is a test of that concept, where three signals are generated, with different phases, and then fed thru that process. The outputs, as you can see, have been aligned.</p>
<p><img class="alignnone size-full wp-image-233" title="TimeAlignment" src="http://culverson.com/site09/wp-content/uploads/2009/09/TimeAlignment1.PNG" alt="TimeAlignment" width="568" height="528" /></p>
<p>You have to know the physical delay time, however; it does not guess.  You also have to account for the fact that some data is lost at the beginning, if that&#8217;s of concern, then start your recording early enough to account for that.</p>
<p>Even with those caveats, this scheme allows you to shift signals to account for mechanical delays, EVEN IN REAL TIME, if you need to.</p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/time-alignment-of-signals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Deflection Mapping Software</title>
		<link>http://culverson.com/web-deflection-mapping-software/</link>
		<comments>http://culverson.com/web-deflection-mapping-software/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 19:07:11 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[Best Works]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=214</guid>
		<description><![CDATA[Operators of large industrial engines are able to measure the deflection of a single segment of a crankshaft (known as a web) to determine that web&#8217;s stress on the shaft. Unfortunately the operators that contracted us for this program were unable to assess the cumulative stress of multiple webs on a single shaft.
Based on a [...]]]></description>
			<content:encoded><![CDATA[<img alt="" src="http://culverson.com/site09/wp-content/uploads/2009/09/webdef.thumb.gif" class="wppt_float_left" /><p>Operators of large industrial engines are able to measure the deflection of a single segment of a crankshaft (known as a web) to determine that web&#8217;s stress on the shaft. Unfortunately the operators that contracted us for this program were unable to assess the cumulative stress of multiple webs on a single shaft.</p>
<p>Based on a unifying equation, our program allows users to compile multiple web deflection measurements into a complete and easy to understand picture of the crank shaft&#8217;s shape and motion.</p>
<p>Using this program has helped many operators prevent crankshaft breakage (a costly occurrence) by focusing their maintenance dollars on the units showing the worst distortion.</p>
<div id="attachment_209" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefMain.png"><img class="size-medium wp-image-209" title="WebDefMain" src="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefMain-300x224.png" alt="The main window shows a diagram that the user can manipulate to indicate throw and bearing positions, and miscellaneous input parameters." width="300" height="224" /></a><p class="wp-caption-text">MainThe main window shows a diagram that the user can manipulate to indicate throw and bearing positions, and miscellaneous input parameters.</p></div>
<div id="attachment_207" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefEntry.png"><img class="size-medium wp-image-207" title="WebDefEntry" src="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefEntry-300x214.png" alt="For each throw on the crankshaft, the user enters readings of web deflection and the program calculates the path taken by the web as it rotates. " width="300" height="214" /></a><p class="wp-caption-text">For each throw on the crankshaft, the user enters readings of web deflection and the program calculates the path taken by the web as it rotates. </p></div>
<div id="attachment_208" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefGraph.png"><img class="size-medium wp-image-208" title="WebDefGraph" src="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefGraph-300x206.png" alt="This is a graph of the bearing displacements, shown as deviations from a straight line. " width="300" height="206" /></a><p class="wp-caption-text">This is a graph of the bearing displacements, shown as deviations from a straight line. </p></div>
<div id="attachment_211" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefAnimation.gif"><img class="size-medium wp-image-211" title="WebDefAnimation" src="http://culverson.com/site09/wp-content/uploads/2009/09/WebDefAnimation-300x186.gif" alt="By recording the bearing displacements over time, an animation can be displayed, alerting the user to possibly dangerous trends. " width="300" height="186" /></a><p class="wp-caption-text">By recording the bearing displacements over time, an animation can be displayed, alerting the user to possibly dangerous trends. </p></div>
<div id="attachment_206" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/WebDef3DAnimation.gif"><img class="size-medium wp-image-206" title="WebDef3DAnimation" src="http://culverson.com/site09/wp-content/uploads/2009/09/WebDef3DAnimation-300x205.gif" alt="Using the calculated displacements, a 3-D graph can be constructed to clearly indicate physical deformation of the shaft. The user can view the deformed shaft from any angle." width="300" height="205" /></a><p class="wp-caption-text">Using the calculated displacements, a 3-D graph can be constructed to clearly indicate physical deformation of the shaft. The user can view the deformed shaft from any angle.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/web-deflection-mapping-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watch your step</title>
		<link>http://culverson.com/watch-your-step/</link>
		<comments>http://culverson.com/watch-your-step/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 12:42:45 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Easier Programming]]></category>
		<category><![CDATA[LabVIEW]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=203</guid>
		<description><![CDATA[But who&#8217;s watching the watchers?
Some development environments have a concept called &#8220;watching&#8221;, where you choose a variable to watch and you see a continuous display of that variable in some window.  This is very useful during debugging, as you can step through your program and find out where this variable is being changed.
LabVIEW has no [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em><strong>But who&#8217;s watching the watchers?</strong></em></p>
<p>Some development environments have a concept called &#8220;watching&#8221;, where you choose a variable to watch and you see a continuous display of that variable in some window.  This is very useful during debugging, as you can step through your program and find out where this variable is being changed.</p>
<p>LabVIEW has no such built-in feature, but it doesn&#8217;t really need one.  You can construct your own watch windows, have them run independently of your main code and accomplish the same thing.</p>
<p>Simply make a new VI with a WHILE loop and a STOP button.  Add a WAIT for 200 mSec (or something) inside it (so you don&#8217;t hog the CPU).  Each time thru the loop, grab your watch variable, process it, and display it.</p>
<p>The &#8220;processing&#8221; can be unbundling a single item from a complicated cluster, or picking an element out of an array, or anything you need to display the item in question.  Perhaps you need to call a VI to get it. Perhaps you need to query an I/O port, or a TCP instrument. Whatever you need to do to watch your troublesome variable.</p>
<p>SUGGESTION:  When you&#8217;re done with it, save it in a folder called &#8220;Miscellaneous Stuff&#8221; or something, so you can get at it easy next time.  There will be a next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/watch-your-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Next Step in TCP-IP</title>
		<link>http://culverson.com/the-next-step-in-tcpip/</link>
		<comments>http://culverson.com/the-next-step-in-tcpip/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 21:37:56 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[TCP]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=198</guid>
		<description><![CDATA[Several conversations at once
A question came up on the LabVIEW forum the other day about multiple connections, and how hard it was to have two connections transmitting at two different rates.  This surprised me a bit, because I have been doing just that for quite a few years.  The allegation was made also that TCP [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center; "><strong><em>Several conversations at once</em></strong></p>
<p>A question came up on the LabVIEW forum the other day about multiple connections, and how hard it was to have two connections transmitting at two different rates.  This surprised me a bit, because I have been doing just that for quite a few years.  The allegation was made also that TCP requires a minimum packet size of 32 bytes. That is also a surprise since I have been doing things contrary to that &#8220;rule&#8221; for quite a few years.</p>
<p>So, in an attempt to clarify things above and beyond the <a href="http://culverson.com/beginners-guide-to-tcpip/" target="_blank">Beginner&#8217;s Guide to TCP/IP</a>, I present this example with a CLIENT and a SERVER.</p>
<p>The SERVER should be run first and listens for four connections on four consecutive ports. It has four data generators, running at different rates.  When data is available, it transmits it over the connection  if there is one, or listens for one if there&#8217;s not.</p>
<p>The SERVER uses a re-entrant VI so that the same code can be executing in four instances at one time.  The four instances are given four different intervals. The WAITs do not conflict because of this reentrancy.</p>
<p>The CLIENT initiates four connections to these same ports, and waits for data in four loops.  I did not use reentrant VIs here, because of the connection to the charts.  Although you could pass a reference to the chart to four reentrant subVIs, I chose not to, thinking that the speed would be better with the direct approach.</p>
<p>Given that this is based on the mSec Timer in LabVIEW, I wouldn&#8217;t vouch for it&#8217;s accuracy as you approach 1000 Hz. But the basic techniques are sound and will work beyond that frequency.</p>
<p><a href="http://culverson.com/site09/wp-content/uploads/MultiConnect.llb.zip">Click here</a> for a downloadable example of four-channel client server communications.</p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/the-next-step-in-tcpip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed of En Masse Operations</title>
		<link>http://culverson.com/speed-of-en-masse-operations/</link>
		<comments>http://culverson.com/speed-of-en-masse-operations/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 18:04:03 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Timing]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=193</guid>
		<description><![CDATA[Zip-zap-zowee and swoosh!
Just in case you thought I was kidding in the article on en masse operations, I decided to offer some proof of the speed advantages they can give you.
I used the Timing Template vi to measure the time it takes to multiply an array of DBLs by two, both with a loop, and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center; "><strong>Zip-zap-zowee and swoosh!</strong></p>
<p>Just in case you thought I was kidding in the article on <a href="http://culverson.com/operations-en-masse/" target="_blank">en masse</a> operations, I decided to offer some proof of the speed advantages they can give you.</p>
<p>I used the <a href="http://culverson.com/what-time-is-it/" target="_blank">Timing Template</a> vi to measure the time it takes to multiply an array of DBLs by two, both with a loop, and without.  I set up the timing VI to create an array of 1000 random numbers, and then time the multiply operation.</p>
<p>First, the loop method, where you auto-index every value out of the array, multiply it, and auto-index it back in:</p>
<p><img class="alignnone size-full wp-image-194" title="viaLoop" src="http://culverson.com/site09/wp-content/uploads/2009/09/viaLoop.PNG" alt="viaLoop" width="450" height="564" /></p>
<p>As you can see, this took 7.47 uSec per loop.  Not all that shabby.  But just removing the loop lets the <em>en masse</em> operation do it:</p>
<p><img class="alignnone size-full wp-image-195" title="EnMasse" src="http://culverson.com/site09/wp-content/uploads/2009/09/EnMasse.PNG" alt="EnMasse" width="461" height="570" /></p>
<p>Holy Speed Demon, Batman!  That&#8217;s 0.77 uSec or about ONE TENTH the time!</p>
<p>Now, I&#8217;m not guaranteeing that all such operations will save you that much time, but if you have a chance to use them, then you should!</p>
<p>It&#8217;s easier on you and easier on the hardware!</p>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/speed-of-en-masse-operations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping your charts up to date</title>
		<link>http://culverson.com/keeping-your-charts-up-to-date/</link>
		<comments>http://culverson.com/keeping-your-charts-up-to-date/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 14:49:00 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://culverson.com/?p=179</guid>
		<description><![CDATA[Use your chart to indicate time of day.
LabVIEW charts, out of the box, don&#8217;t lend themselves to displaying the actual time of day.  By default they give you 1024 history points and a visible scale of 0-100 so what you see is in terms of sample numbers, having no relation to actual time. This is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong><em>Use your chart to indicate time of day.</em></strong></p>
<p style="text-align: left;">LabVIEW charts, out of the box, don&#8217;t lend themselves to displaying the actual time of day.  By default they give you 1024 history points and a visible scale of 0-100 so what you see is in terms of sample numbers, having no relation to actual time. This is reasonable, given that the scale is adjustable in so many ways; there&#8217;s no way to guess what you want, so it&#8217;s up to you to tailor it to fit what you want.</p>
<p style="text-align: left;">Sometimes it&#8217;s useful to display the time of day on your charts, and keep that axis correctly updated as data flows in. For example:</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-183" title="ChartClock" src="http://culverson.com/site09/wp-content/uploads/2009/09/ChartClock1.PNG" alt="ChartClock" width="568" height="180" /></p>
<p style="text-align: left;">As you can see, the leading edge of the plots coincides with the current time on the clock  (see <a href="http://culverson.com/an-improved-analog-clock/" target="_blank">here</a> for how to do the clock indicator).   As data keeps coming in to this chart, the leading edge will reach the right side and the chart (and the X-axis scale) will scroll to the left, thus always matching the time of day.</p>
<p style="text-align: left;">
<p style="text-align: left;">Out of the box, a LabVIEW chart has a history of 1024 samples, and an X scale of 0-100 samples.  This scale has nothing to do with time, so if you want it to display the time, then you have to do several things to make it work.  If you have a CLEAR CHART function, triggered by a button or something, then attach this code to that action, otherwise just do it once when you start the data flowing  (Ideally, you should do this as you feed the first sample to the chart, but the few mSec difference that makes probably won&#8217;t matter).</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-181" title="ChartProperties" src="http://culverson.com/site09/wp-content/uploads/2009/09/ChartProperties.PNG" alt="ChartProperties" width="293" height="151" /></p>
<p style="text-align: left;">First, you clear the history.  That makes sure the OFFSET number is operating from an empty buffer (Time 0).  If the history buffer contains data, then the OFFSET applies to the end of it, and that&#8217;s not what you want.  The constant has to be an empty array of the same type of data as you feed to the chart (cluster of two DBLs in this case).</p>
<p style="text-align: left;">Next you set the XSCALE.OFFSET to set the OFFSET number to the current time.</p>
<p style="text-align: left;">Next you set the XSCALE.MULTIPLIER to the time (in sec) between samples that you display.</p>
<p style="text-align: left;">Next you set the XSCALE.MAXIMUM to now + the duration (in seconds) that you want the chart to show.</p>
<p style="text-align: left;">Do them in that order, or it could get confusing.  You also can set the CHART HISTORY LENGTH to match the duration / the display period.  For one minute at 2 Hz, that would be 120 samples.  You only need to do that step once &#8211; it&#8217;s a property that is not programmable.</p>
<p style="text-align: left;">
<p style="text-align: left;">Enjoy.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/keeping-your-charts-up-to-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Acoustic Modeling Software</title>
		<link>http://culverson.com/acoustic-modeling-software/</link>
		<comments>http://culverson.com/acoustic-modeling-software/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 14:49:24 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[Best Works]]></category>

		<guid isPermaLink="false">http://jimdugan.com/culverson/?p=59</guid>
		<description><![CDATA[A section of 6 full-time technicians was simulating compressor-piping interaction using a huge number of electronic components (capacitors, inductors, etc.) to predict where acoustical resonances could cause structural failures. This labor-intensive technique took a team of two people two weeks to assemble the model, run the initial simulation, revise the model, run the revised simulations, [...]]]></description>
			<content:encoded><![CDATA[<img alt="Widescreen" src="http://culverson.com/site09/wp-content/uploads/wp-post-thumbnail/Widescreen_U1isj.jpg" class="wppt_float_left" /><p>A section of 6 full-time technicians was simulating compressor-piping interaction using a huge number of electronic components (capacitors, inductors, etc.) to predict where acoustical resonances could cause structural failures. This labor-intensive technique took a team of two people two weeks to assemble the model, run the initial simulation, revise the model, run the revised simulations, disassemble the model, and manually prepare a report.</p>
<p>By digitizing the entire process, it now takes a single person two days to complete a job with multiple revisions, and generate a finished report.</p>
<p><em>The Modeler itself is not shown, as it has no screen interface. It executes on a cluster of high-speed computers and returns results to the operator that submitted the job.</em></p>
<div id="attachment_138" class="wp-caption aligncenter" style="width: 310px"><a href="http://culverson.com/site09/wp-content/uploads/2009/09/accoustic-modeling.png"><img class="size-medium wp-image-138" title="accoustic-modeling" src="http://culverson.com/site09/wp-content/uploads/2009/09/accoustic-modeling-300x224.png" alt="Model Builder allows one person to assemble virtual components on screen, to represent the compressor and piping system under test." width="300" height="224" /></a><p class="wp-caption-text">Model Builder allows one person to assemble virtual components on screen, to represent the compressor and piping system under test.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://culverson.com/acoustic-modeling-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
