<?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>Factory Automation Software Blog &#187; Development Techniques</title>
	<atom:link href="http://factoryswblog.org/category/development-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://factoryswblog.org</link>
	<description>Merging modern software development with electrons and metal</description>
	<lastBuildDate>Fri, 27 Jan 2012 03:14:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Free PLC Simulators</title>
		<link>http://factoryswblog.org/2011/12/05/free-plc-simulators/</link>
		<comments>http://factoryswblog.org/2011/12/05/free-plc-simulators/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 01:13:29 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PLC Development]]></category>
		<category><![CDATA[Infoteam]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Tri-PLC]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=1080</guid>
		<description><![CDATA[Free PLC development environments + simulators on Windows]]></description>
			<content:encoded><![CDATA[<p>I recently decided to see what kind of free PLC simulators and integrated development environments (IDE) I could find that run on Windows.  A free IDE+simulator is great for teaching; for example, I can give examples that any of my readers can try out, but if I use a real PLC, I&#8217;ll be using what I have (Panasonic), which probably isn&#8217;t what most of my readers have.</p>
<p>Here is what I found:</p>
<ul>
<li><a href="http://www.tri-plc.com/trilogi.htm">Tri-PLC&#8217;s i-TRiLOGI</a> free development environment supports both ladder logic and their version of BASIC and includes a simulator.  Tri-PLC also sells low cost PLCs.</li>
<li><a href="http://www.infoteam.de/">Infoteam&#8217;s</a> <a href="http://www.infoteam.de/en/downloads/software/">OpenPCS</a> free development environment supports all the IEC61131 languages (including ladder and structured text) and includes a free PC-based simulator.  Infoteam&#8217;s business model is similar to CoDeSys:  customizing and charging money for the OpenPCS runtime.  (CoDeSys also has a simulator, but their free download is time-limited to a maximum 1 hour continuous run time.)</li>
<li><a href="http://www.nirtec.com/index.html">EasyPLC</a> is basically a soft-PLC with a HMI builder and is free in demo mode (simulation only).  It&#8217;s worth a look: for example, its simulation mode includes 3D.  The commercial license is affordable, starting at 50 Euros).</li>
<li>I vaguely recall rumors of being able to use an Allen-Bradley simulator for free, but couldn&#8217;t find anything when I searched (besides,  I don&#8217;t think the development software would be free&#8230;.)</li>
</ul>
<p>I choose to download and try out OpenPCS because I really like having support for all the IEC61131 programming languages.  I haven&#8217;t used OpenPCS enough to be able to discuss it intelligently, but hopefully I&#8217;ll be able to write more in a month or two.</p>
<p>If you really want to learn PLCs, then at some point I think you have to buy a real PLC and connect it to real sensors and outputs.  Simulating stuff just isn&#8217;t the same.  Real PLC&#8217;s can be quite affordable; many manufacturers (including IDEC and Siemens) sell complete kits (PLC and software, plus sometimes a HMI) for $250-$400, Tri-PLC and the Automation Direct Click! series are &lt;$150 and have free software, Panasonic FPWinPro 6 Basic is free (but code size limited), etc.</p>
<p>Beyond PLC&#8217;s there are some interesting options.  For example in the PAC world <a href="http://www.opto22.com/">Opto 22</a> has a free IDE and control simulator, but you need Opto 22 I/O since there&#8217;s no I/O simulation.  In the robotic world, Denso Robotics has a free 3 month trial of <a href="http://www.densorobotics.com/products_software.php">WinCaps III</a> which includes 3D robot simulation with no controller required.</p>
<p>Back in the PLC world, I&#8217;ve finished reading <a href="http://www.isa.org/template.cfm?Section=Shop_ISA&amp;Template=Ecommerce/ProductDisplay.cfm&amp;Productid=6086">Cascading Logic</a>; it&#8217;s a good book, and I hope to get a review up fairly soon.</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1080" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/12/05/free-plc-simulators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced PLC Programming Books</title>
		<link>http://factoryswblog.org/2011/10/06/advanced-plc-programming-books/</link>
		<comments>http://factoryswblog.org/2011/10/06/advanced-plc-programming-books/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 01:24:06 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Development Techniques]]></category>
		<category><![CDATA[PLC]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=1003</guid>
		<description><![CDATA[I went searching for advanced PLC programming books, and only found a couple that might fit the bill.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finished searching for books on advanced Programmable Logic Controller programming.  Mainstream programming languages such as C, C++, Java, and C# have a plethora of advanced books.  However, I didn&#8217;t find much on advanced ladder logic.</p>
<p>The book that seems the closest to what I&#8217;m looking for is <a href="http://www.isa.org/Template.cfm?Section=Books1&amp;Template=/Ecommerce/ProductDisplay.cfm&amp;ProductID=6086">Cascading Logic: A Machine Control Methodology for Programmable Logic Controllers</a> by Gary Kirchof.  I will be able to judge for myself soon, since a reasonably price copy is on its way to me.  (And hopefully I&#8217;ll have time to write a review soon.)</p>
<p>The second PLC book that impressed me is <a href="http://www.dogwoodvalleypress.com/production/default.asp">Programmable Logic Controllers: An Emphasis on Design and Application</a> by Kelvin Erickson.  It&#8217;s meant as a college textbook, but it is pretty comprehensive (&gt;1500 pages) and does have a heavy emphasis on real world techniques.  I couldn&#8217;t find it at a reasonable price, so I won&#8217;t be reviewing it.</p>
<p>I am surprised by how many PLC programming books are meant as textbooks; I&#8217;d say at least half are.  Also, I don&#8217;t think any book covers advanced Structured Text, although a book might devote a chapter to it.</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1003" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/10/06/advanced-plc-programming-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Initial Statechart Thoughts</title>
		<link>http://factoryswblog.org/2011/10/05/initial-statechart-thoughts/</link>
		<comments>http://factoryswblog.org/2011/10/05/initial-statechart-thoughts/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 01:29:16 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Development Techniques]]></category>
		<category><![CDATA[Book Review]]></category>
		<category><![CDATA[Statechart]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=992</guid>
		<description><![CDATA[My initial thoughts on Practical Statecharts in C/C++]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finished my initial skim of <a href="http://www.state-machine.com/psicc/">Practical Statecharts in C/C++</a>; my time was definitely well spent.</p>
<p>Startcharts are a type of hierarchical state machine.  Hierarchical state machines allow state machines to be nested inside state machines, which allows behavior to be inherited (analogous to inheritance in object oriented programming).</p>
<p>State machines are a way of modeling systems based on transitions from one state to another, with the transitions caused by events or conditions being met.  They are a very natural way of modeling many systems (for example, communications protocols) in semiconductors, embedded systems, automation systems, and more.</p>
<p>The UML (Unified Modeling Language) provides a standard statechart.  The author, Miro Samek, implements a simplified version of the UML statechart in object oriented C or C++ using message passing with a publish/subscribe message bus.  Although the author emphasizes implementation details, he does include some good advice on creating and structuring statecharts.  On the other hand, his quantum physics analogies detract from the text.</p>
<p>I will have to carefully re-read it and try using the concepts myself before I deeply understand it, but here are my initial, somewhat unorganized, thoughts:</p>
<ul>
<li>The book is definitely aimed at embedded developers; the author is always focused on speed and small size.</li>
<li>The book was definitely worth reading; overall, it&#8217;s well written, and appropriate for its target audience.</li>
<li>The concurrency method used (messaging with publish/subscribe) looks similar to the now-trendy actor approach (used in Erlang, Scala, etc).</li>
<li>Not a good fit overall for my current project, but I think I will be able to use some concepts from the book.</li>
<li>This book, and others such as <a href="http://www.wrox.com/WileyCDA/WroxTitle/Functional-Programming-in-C-Classic-Programming-Techniques-for-Modern-Projects.productCd-0470970286.html">Functional Programming in C#</a>, show a great strength of general purpose &#8220;traditional&#8221; languages such as C, C++, and C#: you can use them with all kinds of different programming styles, including imperative, object oriented, functional, dataflow, and statechart.  Try doing that with ladder logic!</li>
<li>Actually, I do wonder how well I could implement hierarchical state machines in structured text.  I definitely couldn&#8217;t use the more advanced implementations (since they relay on function pointers, which structured text does not have), but it could still be worthwhile.</li>
<li>Final note: I love this quote the author chose from Fred Brook&#8217;s <em>The Mythical Man Month</em>: &#8220;&#8230;software structure is not embedded in three-space, so there is no natural mapping from a conceptual design to a diagram, whether in two dimensions or more &#8230; one needs multiple diagrams, each conveying some distinct aspect, and some aspects don&#8217;t diagram well at all.&#8221;  <strong>That</strong> is why graphical programming is not inherently better than text.</li>
</ul>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=992" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/10/05/initial-statechart-thoughts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PLC Programming Best Practices?</title>
		<link>http://factoryswblog.org/2011/09/27/plc-programming-best-practices/</link>
		<comments>http://factoryswblog.org/2011/09/27/plc-programming-best-practices/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 01:25:36 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PLC Development]]></category>
		<category><![CDATA[PLC]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=987</guid>
		<description><![CDATA[One thing I really like about the software development books I&#8217;m reading is that most of them don&#8217;t just describe features, but give practical advice, based on experience, on the best ways to do things. I&#8217;m wondering if they are any similar books for PLC programming?  Books that don&#8217;t just discuss how to write a [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I really like about the<a href="http://factoryswblog.org/2011/09/12/my-fall-software-development-books/"> software development books I&#8217;m reading</a> is that most of them don&#8217;t just describe features, but give practical advice, based on experience, on the best ways to do things.</p>
<p>I&#8217;m wondering if they are any similar books for PLC programming?  Books that don&#8217;t just discuss how to write a ladder logic program, but the best way to do it &#8212; and why that recommended way works better.  (Note: I&#8217;m thinking books here, not websites or blogs, because this is the kind of topic that is best approached in a systemic way by a substantial book, not a serious of disconnected posts.  <em>The Art of Unit Testing</em> is a good example of what I&#8217;d like to see.)</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=987" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/09/27/plc-programming-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Fall Software Development Books</title>
		<link>http://factoryswblog.org/2011/09/12/my-fall-software-development-books/</link>
		<comments>http://factoryswblog.org/2011/09/12/my-fall-software-development-books/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 06:20:50 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Windows Development]]></category>
		<category><![CDATA[.NET Development]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Function Programming]]></category>
		<category><![CDATA[IronPython]]></category>
		<category><![CDATA[Statecharts]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=983</guid>
		<description><![CDATA[I just bought a lot of software development books, mostly centered on Microsoft&#8217;s .NET Framework.  I have a code base that is getting old and creaky (for example, parts are written in VB6) and it&#8217;s time to look at re-doing it, using Visual Studio 2010. I&#8217;m tempted to write everything in a mix of F# [...]]]></description>
			<content:encoded><![CDATA[<p>I just bought a lot of software development books, mostly centered on Microsoft&#8217;s .NET Framework.  I have a code base that is getting old and creaky (for example, parts are written in VB6) and it&#8217;s time to look at re-doing it, using Visual Studio 2010.</p>
<p>I&#8217;m tempted to write everything in a mix of F# and Boo, but I won&#8217;t, because it would be hard for almost anyone else to maintain it.  Instead, I&#8217;m planning on mostly C#, with maybe some IronPython thrown in (for rapid customization).</p>
<p>I&#8217;m reading each book quickly first to get an idea of what I can learn, then I will go back in depth for the techniques that I will use.</p>
<p>So what is on my list?</p>
<ul>
<li><a href="http://www.manning.com/skeet2/">C# In Depth, Second Edition</a> &#8212; to make sure I&#8217;m up to speed with all the latest changes to C#.  I haven&#8217;t read it yet.</li>
<li><a href="http://www.wrox.com/WileyCDA/WroxTitle/Functional-Programming-in-C-Classic-Programming-Techniques-for-Modern-Projects.productCd-0470970286.html">Functional Programming in C#</a> &#8212; highly recommended; it&#8217;s well written and shows how to use a lot of the functional techniques I&#8217;ve come to love from using Python; in short, it makes C# much more usable.  However, if you aren&#8217;t already familiar with concepts such as closures, first class functions, and lambdas, it&#8217;s going to be slow going for a while &#8212; and consider learning them in another language first (such as Lua using <a href="http://www.inf.puc-rio.br/~roberto/pil2/">Programming in Lua</a>).</li>
<li><a href="http://www.manning.com/osherove/">The Art of Unit Testing: With Examples in .NET</a> &#8212; highly recommended; it provides lots of practical advice and best practices for creating unit tests that work well.</li>
<li><a href="http://www.manning.com/foord/">IronPython In Action</a> &#8212; I haven&#8217;t read it yet, but it looks good, with a lot of best practices advice.</li>
<li><a href="http://www.state-machine.com/psicc/">Practical Statecharts in C/C++, First Edition</a> &#8212; I haven&#8217;t read it yet.  This book is really aimed at embedded developers, and although I don&#8217;t plan on using the author&#8217;s Quantum Programming framework, I think I will get some good ideas from it.</li>
</ul>
<p>The Manning books all include a free PDF of the book when you register your book.  I haven&#8217;t done this yet, but I will soon.</p>
<p>All my books are real, not e-books, because I prefer real books when learning a new topic, the paper books were cheaper or about the same price, and I won&#8217;t buy ebooks that require a proprietary reader (such as Kindle or Apple books).</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=983" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/09/12/my-fall-software-development-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling Code for Visual Studio 2003 Without VS2003</title>
		<link>http://factoryswblog.org/2011/09/02/compiling-code-for-vs-2003-free/</link>
		<comments>http://factoryswblog.org/2011/09/02/compiling-code-for-vs-2003-free/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 20:04:46 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[.NET Framework Development]]></category>
		<category><![CDATA[.NET Development]]></category>
		<category><![CDATA[SharpDvelop]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=974</guid>
		<description><![CDATA[I used SharpDevelop 2.2 to compile VS2003 code for .NET 1.1]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed to compile some code for Visual Studio 2003, which I don&#8217;t have (I have VS 2002 and VS 2005).</p>
<p>The obvious approach is to convert the project to VS 2005, which uses .NET 2.0.  However, I wanted to compile to .NET 1.1 for various reasons, and VS2005 does not allow this out of the box.</p>
<p>The first approach I tried was using the <a href="http://www.codeplex.com/wikipage?ProjectName=MSBee">MSBee</a> program.  MSBee is a program for MSBuild to allow compiling a program in VS 2005 to .NET 1.1.  MSBee requires modifying the project file, and has to be run from the command line.  I gave it a try, and it gave me a lot of errors.</p>
<p>I probably could have figured out those MSBuild errors, but I found a better solution: <a href="http://sharpdevelop.net/opensource/sd/download/">SharpDevelop 2.2</a>.  SharpDevelop typically allows you to compile to either the current .NET version or the previous one.  So SharpDevelop 2.2 can target either .NET 2.0 or .NET 1.1 &#8212; and it can read and convert VS 2003 project files.</p>
<p>Sharp Develop read my VS 2003 solution files without a problem, and I went to the Project menu, selected Project Options, clicked on the Compiling tab, and set the Target Framework to .NET Framework 1.1.  Success!</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=974" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/09/02/compiling-code-for-vs-2003-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Larry O&#8217;Brien on DVCS (Distributed Version Control Systems)</title>
		<link>http://factoryswblog.org/2011/01/17/larry-obrien-dvcs/</link>
		<comments>http://factoryswblog.org/2011/01/17/larry-obrien-dvcs/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 21:01:45 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=755</guid>
		<description><![CDATA[SD Times columnist Larry O&#8217;Brien has a short piece on distributed version control systems.  It&#8217;s worth a read if you&#8217;re curious about all the DVCS hype. I&#8217;m sticking with Subversion for the near future; on Windows, last time I checked, Subversion still had the edge on installation ease and tool support (e.g. TortoiseSVN).  Supposedly, merging [...]]]></description>
			<content:encoded><![CDATA[<p>SD Times columnist Larry O&#8217;Brien <a href="http://www.sdtimes.com/WINDOWS__NET_WATCH_GET_ONBOARD_THE_DVCS_TRAIN/By_Larry_O_Brien/About_VERSIONCONTROLSYSTEMS/35085" target="_self">has a short piece on distributed version control systems</a>.  It&#8217;s worth a read if you&#8217;re curious about all the DVCS hype.</p>
<p>I&#8217;m sticking with Subversion for the near future; on Windows, last time I checked, Subversion still had the edge on installation ease and tool support (e.g. TortoiseSVN).  Supposedly, merging has been improved in Subversion 1.5 and higher.</p>
<p>Still, I&#8217;d like to play around with two-level commits (local track when just playing around, development track for when changes are ready for prime time).</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=755" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2011/01/17/larry-obrien-dvcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There&#8217;s No Substitute For The Real (.NET) Thing</title>
		<link>http://factoryswblog.org/2010/11/20/theres-no-substitute-for-the-real-net-thing/</link>
		<comments>http://factoryswblog.org/2010/11/20/theres-no-substitute-for-the-real-net-thing/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 05:37:22 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[.NET Framework Development]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=705</guid>
		<description><![CDATA[Sometimes the .NET Framework's backwards compatibility doesn't work -- you have to the older version installed]]></description>
			<content:encoded><![CDATA[<p>Sometimes, the .NET framework&#8217;s backwards compatibility doesn&#8217;t work, and you have to install the exact version required by an assembly.</p>
<p>Recently, I was working on a project that used a number of components compiled for .NET 1.1 (I didn&#8217;t have the source code) &#8212; and, since I strongly prefer Visual Studio 2005 over the earlier versions, I was writing my test code in VS 2005, which installed .NET 2.0 only on the computer.</p>
<p>The result?  No obvious error messages from .NET (which I would&#8217;ve expected if there were version incompatibilities), but the .NET Remoting portion did not work.  The only error message was about being unable to serialize an object.</p>
<p>The solution?  I installed the .NET framework V1.1, and the Remoting (and serialization) problems went away.</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=705" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2010/11/20/theres-no-substitute-for-the-real-net-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version Control for Automation Developers</title>
		<link>http://factoryswblog.org/2009/04/02/version-control-automation-developers/</link>
		<comments>http://factoryswblog.org/2009/04/02/version-control-automation-developers/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 19:54:57 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Version Control]]></category>
		<category><![CDATA[Fossil]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[XAMPP]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=230</guid>
		<description><![CDATA[Version control software for automation software developers.  Notes on Subversion, Trac, git, Mercurial, and Fossil.]]></description>
			<content:encoded><![CDATA[<p>I highly recommend good version control software for all automation developers, even for companies with just one developer.  I think for most automation companies the requirements are similar to these:</p>
<ul>
<li>Runs well on Windows (most automation vendors use only Windows)</li>
<li>Easy to install</li>
<li>Good documentation</li>
<li>Easy to learn, including easy to learn concepts and how to handle typical version control situations</li>
<li>Good tools support such as GUI clients, support for Visual Studio and/or Eclipse, web interfaces, and links to bug tracking systems</li>
<li>Software is mature and reliable</li>
<li>Available support</li>
<li>Distributed team support is not needed</li>
</ul>
<p>I recommend looking at <a href="http://subversion.tigris.org/" target="_self">Subversion</a> first.  It meets all the requirements.  It runs well on Windows, is easy to install, has excellent documentation, and is widely used.  Tool support is excellent; highlights include the famous <a href="http://tortoisesvn.tigris.org/" target="_self">TortoiseSvn</a> GUI client and the <a href="http://trac.edgewall.org/" target="_self">Trac</a> light weight project management and bug tracking software.  Best of all, Subversion (like all the other projects mentioned in this post) is open source, so there are no license hassles, no limitations on named users, and no yearly maintenance fees.</p>
<p>Trac, on the other hand, isn&#8217;t so easy to install.  I&#8217;ve covered easier ways to install Subversion and Trac <a href="http://factoryswblog.org/2008/03/25/easier-ways-to-install-subversion-and-trac/" target="_self">before </a>.  Another approach I am looking at is running Subversion and Trac under <a href="http://www.apachefriends.org/en/xampp.html" target="_self">XAMPP</a>, the portable Apache/MySQL stack.  If it&#8217;s easy to do, this might be the best approach.</p>
<p>Distributed version control systems are definitely taking off.  <a href="http://git-scm.com/" target="_self">Git</a> seems to be in the lead, with <a href="http://www.selenic.com/mercurial/wiki/" target="_self">Mercurial</a> second.  They do have some major advantages over Subversion (which I hope to cover in detail sometime this year).  You should more concerned with which system works best for you, not what other developers (who probably have very different needs) are using.</p>
<p>Git normally isn&#8217;t the best choice for automation developers.  It doesn&#8217;t run well on Windows (you have to use cygwin (which is like running Linux) or <a href="http://code.google.com/p/msysgit/" target="_self">msysgit</a> (which is incomplete and poorly documented)), is still lacking in tool support, and appears to be harder to learn than Mercurial or Subversion.</p>
<p>Git does have some advantages; for example, it can reliably track CVS or Subversion repositories, and make a Subversion repository track a git one.  I will be using git for a project that requires creating a Subversion repository that tracks a CVS repository (and having a git repository that tracks the CVS repository is a nice extra).</p>
<p><a href="http://www.fossil-scm.org/index.html/doc/tip/www/index.wiki" target="_self">Fossil</a> is an interesting new distributed version control system with integrated bug tracking and wiki (similar to combining Mercurial with Trac).  It doesn&#8217;t have the tool support, documentation,  and widespread use of git, Mercurial, or Subversion, but it is much smaller (a single small executable), runs well under Windows, and has a GUI available via the browser (Web 2.0!).</p>
<p>I&#8217;d love to try out and do a detailed comparison of Subversion, git, Mercurial, and Fossil, but my realistic plan is:</p>
<ol>
<li>Get Subversion and Trac running under XAMPP</li>
<li>Get git running for the CVS repository tracking project</li>
</ol>
<p>and then, of course, write some posts about my experiences.</p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=230" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2009/04/02/version-control-automation-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Case of the Disappearing Exception</title>
		<link>http://factoryswblog.org/2008/06/24/case-disappearing-exception/</link>
		<comments>http://factoryswblog.org/2008/06/24/case-disappearing-exception/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 19:07:03 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[.NET Framework Development]]></category>
		<category><![CDATA[Exceptions]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://factoryswblog.org/?p=57</guid>
		<description><![CDATA[I was doing some debugging recently on an inherited Visual Basic.NET codebase. Something odd was going on &#8211; the code that reads a PLC&#8217;s input was always returning True, but I could see the input changing. The problem? The original programmer, who I&#8217;ll call &#8220;Bugs Bunny&#8221;, didn&#8217;t understand exception handling at all. The function, part [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some debugging recently on an inherited Visual Basic.NET codebase.  Something odd was going on &#8211; the code that reads a PLC&#8217;s input was always returning True, but I could see the input changing.  The problem?  The original programmer, who I&#8217;ll call &#8220;Bugs Bunny&#8221;, didn&#8217;t understand exception handling at all.</p>
<p>The function, part of a class that communicated with a PLC, went roughly like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://factoryswblog.org/wp-content/plugins/wp-codebox/wp-codebox.php?p=57&amp;download=Disappearing-Exception.vb">Disappearing-Exception.vb</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p573"><td class="code" id="p57code3"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Function</span> bubba<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span>
    bubba <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
    <span style="color: #0600FF;">Try</span>
        bubba <span style="color: #008000;">=</span> getResultFromPlc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception
        logException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></td></tr></table></div>

<p>Since all Exceptions are caught and <strong>not handled</strong> any Exceptions raised in bubba()&#8217;s Try block just disappear.  So all the code calling bubba() has no way of knowing if there are problem (such as the PLC isn&#8217;t powered or the serial port isn&#8217;t connected) .  Instead, because the return value is initially set to True (<em>bubba = True</em>), if an Exception occurs, bubba() always return True.</p>
<p>Sometimes you do need to ignore Exceptions.  For example, on a maintenance screen that repeatedly reads a PLC&#8217;s inputs, it&#8217;s good to indicate if there are any problems reading the inputs, but it&#8217;s not helpful to pop up a dialog box or exit the maintenance screen.  Exceptions should be ignored occasionally as needed in the calling code, not completely swallowed up in the base library code.</p>
<p>Another common anti-pattern in Bug&#8217;s code is:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://factoryswblog.org/wp-content/plugins/wp-codebox/wp-codebox.php?p=57&amp;download=Useless_try-catch.vb">Useless_try-catch.vb</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p574"><td class="code" id="p57code4"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Sub</span> joe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">Try</span>
        blah<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        blahblah<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception
        logException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Throw</span> ex
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
&nbsp;
<span style="color: #0600FF;">Sub</span> groovy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">Try</span>
        joe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception
        logException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Throw</span> ex
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></td></tr></table></div>

<p>What&#8217;s the point?  All that happens is the exception gets logged multiple times (adding confusion to the log file), more useless code is added (making the code harder to understand), and the program runs slower (throw, catching, and re-throwing Exceptions takes time).</p>
<p><em>Tony</em></p>
 <img src="http://factoryswblog.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=57" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://factoryswblog.org/2008/06/24/case-disappearing-exception/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

