<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!-- generator="wordpress/2.1" --><rss 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/" version="2.0">

<channel>
	<title>Coleman's Core</title>
	<link>http://coleman.jandasoft.biz</link>
	<description>Let's face it, this isn't the worst thing you've caught me doing.</description>
	<pubDate>Tue, 17 Aug 2010 22:26:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ColemansCore" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="colemanscore" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Testing BACnet MS/TP</title>
		<link>http://coleman.jandasoft.biz/?p=65</link>
		<comments>http://coleman.jandasoft.biz/?p=65#comments</comments>
		<pubDate>Tue, 17 Aug 2010 20:15:14 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=65</guid>
		<description><![CDATA[Recently, someone posted a question on BACnet-L about how to test MS/TP using an oscilloscope. It&#8217;s a good question, but one that requires more explanation than can be posted in an email response. I&#8217;m going to split this post into two parts in order to first address only the oscilloscope based tests and to secondly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tframe_gap.jpg" title="Tframe_gap measurement"></a><a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/rx_to_tx_tturnaround.jpg" title="Tturnaround RX to TX"></a>Recently, someone posted a question on <a target="_blank" href="http://www.bacnet.org/Contact/BACnet-L.htm" title="BACnet-L">BACnet-L</a> about how to test MS/TP using an oscilloscope. It&#8217;s a good question, but one that requires more explanation than can be posted in an email response. I&#8217;m going to split this post into two parts in order to first address only the oscilloscope based tests and to secondly address the serial analyzer based tests.</p>
<p>The following documentation is based on the <a href="http://www.bacnetinternational.org/associations/8066/files/BTL_Test_Package_5.0.final.zip">BTL Specified Tests</a> revision 5.0 concerning MS/TP testing, which can be found in section 2.2 of the document, BTL Specified Tests-5.0.final.doc. I am not including the section numbers here because, as of this writing, the TI-WG is working on getting these tests included in an upcoming addendum for inclusion in 135.1.</p>
<p>First, a disclaimer. PolarSoft, Inc. is my employer. The opinions expressed here are my own and may not reflect those of my employer. The explicit mention of a product or company in this post is not an endorsement of that company or product.</p>
<p><span style="text-decoration: underline"><strong>Test Tools<br />
</strong></span></p>
<p><em>Oscilloscope<br />
</em></p>
<p>The BTL uses the <a href="http://www.picotech.com">PicoScope</a>, but I found it pricey and overkill for what I needed. It&#8217;s also a bit too bulky to carry in your laptop bag.</p>
<p>The oscilloscope I use for EIA-485 testing is the <a href="http://www.saleae.com/logic/">Logic by Saleae</a>. It&#8217;s considered an entry level oscilloscope, but it&#8217;s got the features I need for this type of testing: it&#8217;s small, lightweight, equipped with easy to use probes, supports time measurements, and has a built in serial analyzer (with auto baud support). It&#8217;s powered via USB and small enough to carry in your laptop bag.</p>
<p>Another good manufacturer of USB oscilloscopes is <a href="http://www.usbee.com/">USBee</a>. Again, probably a bit pricey for this type of work and I think the Saleae Logic works just as well.</p>
<p><em>Serial Analyzer<br />
</em></p>
<p>In my opinion, a good MS/TP analyzer is capable of automatically and precisely measuring the time between the end of one frame and the start of another and is also capable of measuring the time between the start of one frame and the start of another. At a minimum, it should be capable of time stamping the start of each frame with one millisecond precision.</p>
<p>The obvious choice, for me, is <a href="http://www.polarsoft.biz/bactrace.html">BACtrace</a>™ by PolarSoft. However, there are other choices. The BTL uses &#8220;Visual Breakout&#8221; or &#8220;Fronline Serialtest&#8221;. From what I can tell, these tools require manual decoding of the MS/TP frames and they only measure intra-octet timing &#8212; not intra-packet timing. <a href="http://www.wireshark.org/">Wireshark</a> also includes an MS/TP analyzer which I have used for decoding MS/TP frames but I&#8217;ve found the time stamps to be imprecise.</p>
<p>For purposes of this document, I will be using BACtrace as the serial analyzer.</p>
<p>Any of these tools require an EIA-485 adapter. I recommend the <a href="http://www.bb-elec.com/product_family.asp?FamilyId=355&amp;Trail=45&amp;TrailType=Main">B&amp;B Electronics USOPTL4</a>. It&#8217;s powered by USB and it&#8217;s small enough to lug around in your laptop bag. It&#8217;s capable of performing at all of the MS/TP baud rates including 76800.</p>
<p><span style="text-decoration: underline"><strong>Test Setup<br />
</strong></span></p>
<p>The oscilloscope tests require access to the EIA-485 hardware on your device. How you make this available is up to you, but I recommend soldering leads to the RX, TX, and TX enable (TXE) pins for easy access to this data.</p>
<p><span style="text-decoration: underline"><strong>Tests<br />
</strong></span></p>
<p><em>Verify Tpostdrive<br />
</em></p>
<p>This test requires the use of an oscilloscope with access to the TX pin and the TXE pin on the EIA-485 hardware. The test is used to determine how long it takes the TXE pin to be deasserted after the last stop bit is transmitted. This is measured in bit times, so it&#8217;s baud rate dependent. If it takes the device longer than 15 bit times (or 15/baudrate) to return the TXE pin to idle, then the device fails this test. Here is the waveform showing a passing result:</p>
<p><a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tpostdrive.jpg" title="Tpostdrive measurement"><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tpostdrive.jpg" alt="Tpostdrive measurement" /></a></p>
<p>T2 marks where TXE is deasserted and T1 marks the last stop bit transmitted. So, T2-T1=Tpostdrive. The Logic software is capable of calculating the difference between these two markers, and the result is shown below:</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/081710-2014-testingbacn2.png" /></p>
<p>This shows that Tpostdrive is 19us. This test was run at 76800 baud therefore a passing result is 15/76800 or 195us.</p>
<p><em>Verify Tframe_gap<br />
</em></p>
<p>This test requires the use of an oscilloscope with access to the TX pin on the EIA-485 hardware. This test is used to measure the idle time between octets being transmitted by the device. Again, the results are based on bit time, but in this case a maximum of 20 bit times (or 20/baudrate). Here is the waveform showing a passing result:</p>
<p> <a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tframe_gap.jpg" title="Tframe_gap measurement"><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tframe_gap.jpg" alt="Tframe_gap measurement" /></a></p>
<p>T1 marks the end of the 0&#215;55 stop bit, and T2 marks the start bit of the 0xFF octet. And the calculated results:</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/081710-2014-testingbacn4.png" /></p>
<p>A passing result at 76800 is 260us, and 14.9us is under that limit.</p>
<p><em>Verify Tturnaround<br />
</em></p>
<p>This test requires the use of an oscilloscope with access to the RX, TX, and TXE pins on the EIA-485 hardware. This test is used to measure how long a device waits to enable it&#8217;s transmitter after it&#8217;s received any data. Again, the results are based on bit times, but in this case it&#8217;s a <strong>minimum</strong> of 40 times (or 40/baudrate). If the device enables its transmitter within 40 bit times of receiving any data, then it fails the test. Here is the RX to TX waveform showing a passing result:</p>
<p><a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/rx_to_tx_tturnaround.jpg" title="Tturnaround RX to TX"><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/rx_to_tx_tturnaround.jpg" alt="Tturnaround RX to TX" /></a></p>
<p>T1 marks the end of the trailing edge of the last stop bit of the RX frame. T2 marks the point where the device enables its transmitter.</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/081710-2014-testingbacn6.png" /></p>
<p>The difference is 4.471ms, which is greater than the 521us minimum required at 76800 baud.</p>
<p>Also, in my experience, a device should wait Tturaround between transmitting data to allow &#8220;single buffer&#8221; implementations time to process the previous frame. Here is the TX to TX waveform showing a passing result:</p>
<p><a href="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tx_to_tx_tturnaround.jpg" title="TX to TX Tturnaround"><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/tx_to_tx_tturnaround.jpg" alt="TX to TX Tturnaround" /></a></p>
<p>T1 marks the point where the device disables its transmitter. T2 marks the point where the device re-enables its transmitter.</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/08/081710-2014-testingbacn8.png" /></p>
<p>The difference is 1.344ms, which is greater than the 521us minimum required at 76800 baud.</p>
<p>This is the end of part one of this post which only examines the tests requiring the use of an oscilloscope.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for Testing BACnet MS/TP" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+Testing+BACnet+MS/TP" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=65</wfw:commentRss>
		</item>
		<item>
		<title>Standing on the shoulders of giants</title>
		<link>http://coleman.jandasoft.biz/?p=53</link>
		<comments>http://coleman.jandasoft.biz/?p=53#comments</comments>
		<pubDate>Tue, 01 Jun 2010 21:39:20 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=53</guid>
		<description><![CDATA[A colleague of mine once said &#8220;We were truly standing on the shoulders of giants.  Some of us knew it, some, not so much.&#8221;

That quote is applicable in BACnet committee work as well as anywhere else.  When proposals get written and before they&#8217;re reviewed by the committee, the original authors may not be [...]]]></description>
			<content:encoded><![CDATA[<p>A colleague of mine once said &#8220;We were truly standing on the shoulders of giants.  Some of us knew it, some, not so much.&#8221;
</p>
<p><img align="right" src="http://coleman.jandasoft.biz/wp-content/uploads/2010/06/060110-2138-standingont1.gif" alt=""/>That quote is applicable in BACnet committee work as well as anywhere else.  When proposals get written and before they&#8217;re reviewed by the committee, the original authors may not be in a position to continue championing the proposal.  This happens from time to time, and when it does, the committee will look for volunteers to take up the mantle.
</p>
<p>Such was the case for WS-033.  The gist of the proposal is to mandate when and where wildcard values may or may not be used within date and time values.  For example, the local-time property of the device may never contain a wildcard value because it represents a single moment in time.
</p>
<p>Some years ago, (Bill says it was about 10) Bill Swan began a proposal to point out and clarify these issues.  As Bill said, the proposal languished for face time as more important issues were discussed and resolved.  When the time finally came to discuss the issue in depth, Bill decided he had too much on his plate and I volunteered to continue working with the proposal.  The effort involved was to go through the standard, examine each use case for dates and times, and add clarifying language for each of those use cases.  A lofty task, and I can only hope I did it justice and stayed within the original intent of the proposal.  I think that&#8217;s the case, because Bill &#8220;blessed&#8221; it when the time came to send it out for public review.  However, if it weren&#8217;t for Bill&#8217;s initial work on this task, the proposal would likely have not reached this point.
</p>
<p>Fast forward to the end of the public review period and there were some extensive comments.  Some requiring subtle, but important changes. So, the addendum will have to be revised and go through another round of review before it becomes published.  I&#8217;ll do what I can to aid in that effort as well.
</p>
<p>But, these days, my plate is also pretty full considering the work that&#8217;s going on in the IP-WG with IPv6 support (that&#8217;s &#8220;only&#8221; a new data link layer and one new object type) as well as the work within the MSTP-WG.  Oh, right, not to mention my <a href="http://www.polarsoft.biz">day job</a>!  </p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for Standing on the shoulders of giants" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+Standing+on+the+shoulders+of+giants" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=53</wfw:commentRss>
		</item>
		<item>
		<title>Day 3</title>
		<link>http://coleman.jandasoft.biz/?p=51</link>
		<comments>http://coleman.jandasoft.biz/?p=51#comments</comments>
		<pubDate>Sun, 24 Jan 2010 14:51:45 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=51</guid>
		<description><![CDATA[Today is the third day of BACnet meetings in Orlando, FL. Today is the first of two days devoted for the main SSPC 135 meeting.
The morning of these meetings is usually a little &#8220;slow&#8221;, and I say that with all due respect. However, getting everyone on the same page with the network setup, then introductions, [...]]]></description>
			<content:encoded><![CDATA[<p>Today is the third day of BACnet meetings in Orlando, FL. Today is the first of two days devoted for the main SSPC 135 meeting.</p>
<p>The morning of these meetings is usually a little &#8220;slow&#8221;, and I say that with all due respect. However, getting everyone on the same page with the network setup, then introductions, review of the agenda and minutes from the last meeting, waiting for folks to get coffee, etc. takes up quite a bit of time. Then we dive into various updates from liaisons to other SPCs with ASHRAE as well various &#8220;sister&#8221; organizations such as IEIEJ. After that, we hear from the various working groups (essentially &#8220;focused&#8221; subcommittees) about their work. These activities usually take up the 8 AM to 11 AM time slot.</p>
<p>Today, there were a few interesting developments in the working group portion of the meeting.</p>
<ol>
<li>The SSPC formed a new WG, the Elevator Working Group (officially dubbed &#8220;EL-WG&#8221;). The goal of this group will be to find ways to implement BACnet in the elevator world. It turns out that in the elevator world, they use several proprietary protocols that are structurally similar to BACnet. Our friend <a href="http://bacnetbill.blogspot.com">&#8220;BACnet Bill&#8221; Swan</a> will be heading this working group. Congratulations, Bill!</li>
<li>This is the first ASHRAE meeting for the IT and SG working groups. The goal of the IT-WG is to find and address areas where BACnet can be integrated with the Information Technology field. The goal of the SG-WG is to find a way to integrate the Smart Grid initiative with BACnet (or vice versa).</li>
<li>OK, this one is a cheap plug. Roland Laird from Reliable Controls has decided to step down as convener of the IP-WG. It was officially announced today that at the end of these meetings, yours truly will be the new convener of this group. The goal of this working group is to oversee the use of BACnet over IP networks (BACnet/IP). Roland has been the convener of this group for as long as I&#8217;ve been involved with BACnet. There have been several improvements to the BACnet/IP data link layer under Roland&#8217;s watch, and I can only hope to fill his shoes.</li>
</ol>
<p>We spent the time leading up to lunch discussing a clarification concerning the modification_date property of the File object. The question was what the value should contain in the event that the device cannot determine the time from its local_time property. The only way that this can happen is if the device doesn&#8217;t &#8220;know&#8221; how to calculate the current time. Some embedded devices do not contain a real-time clock and are unable to determine the actual local time without the clock being &#8220;set&#8221;. They may be able to sync their time via some external source such as NTP or the BACnet time synchronization services and keep time (accurately or inaccurately) rom that point, though. However, at boot time, the OS does not know what the actual time is. Consider the case where the battery on a PC motherboard dies. At that point, the BIOS clock is unable to save the time across reboots. So, the PC is unable to determine what time it is from the hardware clock. In this case, when my program gets the current date and time from the OS, it will report its epoch time. Of course, I can set the time to whatever I want.</p>
<p>This is analogous to when an alarm clock is first plugged in. It resets it&#8217;s time to 12:00, but after a minute goes by, it&#8217;s 12:01. It&#8217;s wrong, but the clock still tracks time.</p>
<p>The point of all this is that a device has some default time, and in operating systems this is referred to as the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a>. Really, this is the point in time when the clock is all zeroes. In BACnet, this date is 00:00:00 on Monday, 1-January-1900.</p>
<p>The question is what should the value should the modification_date property contain when the internal &#8220;clock&#8221; is in this state. If, for example, you device creates a file at startup then that file object&#8217;s modification date must contain the date and time that the file was created. So, my assertion is that in this scenario the property value should either be 00:00:00 1-January-1900 or the epoch date and time reported by the OS.</p>
<p>After lunch and well into the afternoon, we spent our time discussing various addenda. But, that&#8217;s a story for another time.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for Day 3" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+Day+3" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=51</wfw:commentRss>
		</item>
		<item>
		<title>Alarming Discussions are, well, alarming</title>
		<link>http://coleman.jandasoft.biz/?p=50</link>
		<comments>http://coleman.jandasoft.biz/?p=50#comments</comments>
		<pubDate>Fri, 22 Jan 2010 17:07:31 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=50</guid>
		<description><![CDATA[Today is day 2 of the BACnet meetings in Orlando. The first meeting today is the OS-WG, which as of this writing is over its allotted time. This particular working group has been tasked with tackling the very large task of the alarm and event services reboot. These discussions have monopolized the OS-WG face time [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/01/012210-1707-alarmingdis1.jpg" style="width: 209px; height: 332px" align="right" height="396" width="276" />Today is day 2 of the BACnet meetings in Orlando. The first meeting today is the OS-WG, which as of this writing is over its allotted time. This particular working group has been tasked with tackling the very large task of the alarm and event services reboot. These discussions have monopolized the OS-WG face time of late, which unfortunately has caused other proposals to languish. I&#8217;m not complaining, mind you. I&#8217;m just pointing out that this is the cost associated with this type of work – especially in a committee with limited time.</p>
<p>As I understand it, there are two camps when it comes to alarm and event generation in BACnet. That more than one camp exists shows that the standard does not provide an adequate overview for the functionality. If the committee experts are split, imagine how end users feel.</p>
<p>Camp 1 is of the thought that event generation requires a certain &#8220;object tax&#8221; in that it requires Notification Class and Event Enrollment objects in order to perform event generation at all. As <a href="http://blog.polarsoft.com/">David</a> points out, not only do alarm generating objects have to support NC objects, but those NC objects need to have writable recipients, and more than one based on current BTL requirements and tests. This is a heavy burden to pay for a small sensor device. Small is a relative term considering Moore&#8217;s Law, but it&#8217;s still a big burden on a device with limited resources. The implication here is that in order for a device to even determine that it is in a state necessary to generate an event, that the device MUST support these object types. So, if a device doesn&#8217;t have these objects, then the required STATUS_FLAGS and EVEN_STATE properties remain static all the time. This point of view is supported by the various Alarm and Event BACnet interoperability building blocks (BIBBs). This is the &#8220;subscription approach&#8221;, in which a client must subscribe to the device in order to receive events from that particular device. The most common use case is a workstation that&#8217;s present 24/7 would add itself to a device&#8217;s recipient-list in order to receive events.</p>
<p>Camp 2 is of the thought that event generation can be *really* simple and that a device simply need to support the STAUS_FLAGS and EVENT_STATE properties. The values of these properties are then used to indicate whether or not the object is in a bad state. These properties can then be read at arbitrary times to determine if the device needs attention or not. This is the &#8220;polling approach&#8221; where a client could simply read these properties in a device and make a decision based on their values whether a device is in a bad state. The tax on the server device is much lower because all it has to do is update its STATUS_FLAGS and EVENT_STATE properties. Using the polling approach allows &#8220;alarm proxy&#8221; functionality which is akin to <a href="http://bacnetbill.blogspot.com/2009/12/slave-proxy.html">slave proxy</a> functionality. One con that came up during the meeting is that this approach doesn&#8217;t scale well. Perhaps, as it was only briefly discussed, that may be true. But, I&#8217;d like to think the committee is an intelligent bunch and can find a way to get this approach to scale.</p>
<p>Personally, I&#8217;m not sure which camp I support. I can see both arguments, but I also don&#8217;t see in the standard where the &#8220;subscription approach&#8221; is mutually exclusive from the &#8220;polling approach&#8221;. It&#8217;s possible that the BIBBs imply this, but in this case I think the intent is just as important (if not more so) than what the standard says at the moment. But, this is just my humble opinion. 135-2008 is huge, and it could be that I&#8217;ve missed key phrase that others are seeing in Camp 1. It would not be the first time this has happened.</p>
<p>I do like the idea of an alarm proxy, though. Not as an &#8220;out&#8221;, but as a way to pay a lower tax for event and alarm generation and consumption. There are vendors out there who want to take the much simpler &#8220;polling approach&#8221; to avoid paying the object tax and I don&#8217;t blame them at all. The concept of an &#8220;alarm proxy&#8221; device would hopefully allow this.</p>
<p>We, as a committee, would have to create a new BIBB (or set of BIBBS) that indicate this functionality. This not only allows for interoperability for this functionality, but also allows end users a way to specify what they want.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for Alarming Discussions are, well, alarming" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+Alarming+Discussions+are,+well,+alarming" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=50</wfw:commentRss>
		</item>
		<item>
		<title>I’m going to Disneyworld!</title>
		<link>http://coleman.jandasoft.biz/?p=47</link>
		<comments>http://coleman.jandasoft.biz/?p=47#comments</comments>
		<pubDate>Thu, 21 Jan 2010 19:21:31 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=47</guid>
		<description><![CDATA[I&#8217;m currently in Orlando, Florida. Not to visit the mouse, but to attend BACnet meetings as part of the 2010 Winter AHR Expo. BACnet is an ASHRAE standard and as such, the SSPC and the various working groups hold their meetings directly prior to the AHR show.
The working groups usually meet for 3 days and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2010/01/012110-1921-imgoingtodi11.jpg" align="left" />I&#8217;m currently in <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;q=&amp;vps=1&amp;jsv=200b&amp;sll=37.0625,-95.677068&amp;sspn=30.682067,54.667969&amp;ie=UTF8&amp;geocode=FeB1swEdXEAm-w&amp;split=0">Orlando, Florida</a>. Not to visit the <a href="http://en.wikipedia.org/wiki/Mickey_mouse">mouse</a>, but to attend BACnet meetings as part of the 2010 Winter AHR Expo. BACnet is an ASHRAE standard and as such, the SSPC and the various working groups hold their meetings directly prior to the AHR show.</p>
<p>The working groups usually meet for 3 days and the main SSPC meets for 2 days.</p>
<p>Today was the first day of the meetings. I decided to attend the BTL-WG meeting and David attended the LA-WG (lighting application working group). This made sense because I&#8217;ve been active with the BTL-WG for a lot of years. Also, David has been spearheading a lot of the effort in the LA-WG along with <a href="http://steve.kargs.net/">Steve Karg</a>.</p>
<p>BTL stands for <a href="http://www.bacnetinternational.net/btl/">BACnet Test Labs</a>, which is a part of BACnet International. The test lab is currently managed by Duffy O&#8217;Craven, who has been a fellow BACneteer for about 10 years, which is also about how long I&#8217;ve been working with BACnet – so Duffy and I have definitely <a href="http://en.wikipedia.org/wiki/Heartbreak_ridge">chewed some of the same dirt</a>.</p>
<p>The BTL-WG is near and dear to my heart, because that&#8217;s the group I originally started working with when I first joined the BACnet community. These days, the working group meetings are pretty civil, but I remember a time when that was not the case!!! Those days still bring a smile to my face.</p>
<p>We&#8217;re currently on our lunch break, but we were able to accomplish quite a bit this morning and we certainly jumped in with both feet.  We discussed a few clarification requests. All of these documents have yielded interesting conversations. The most intense of which has been a conversation of the functionality checklist for the new Trend Log Multiple object. The problem with (what I consider) &#8220;complex&#8221; objects is that some of them allow the use of ANY datatype as a value. The ANY datatype unfortunately allows all of the primitive BACnet types ALONG with all of the complex types as values. Most of the time, though, only a small set of the data types really make sense for a particular object, though. For instance, in the case of trending, how often will you trend an object-identifer whose value will (well, should) never change. So, in the checklist we were discussing how to list the optional datatypes supported for the trend log multiple. Limiting the datatypes supported is a good thing for interoperability, IMHO.  It&#8217;s because a client device, hopefully, will know what to expect when requesting data from a server device. </p>
<p>A lot of times, during these conversations, I try to visualize the functional use case for the particular thing we&#8217;re discussing. Determining use cases for these things is an acquired skill and sometimes it&#8217;s quite difficult to keep up with the conversations if these use cases aren&#8217;t on the tip of your tongue. It takes a lot of processing power to listen and digest the information being passed around at a rapid fire pace and it can be very exhausting. It&#8217;s a good thing there&#8217;s a steady supply of coffee available!</p>
<p>I&#8217;ve also taken on a work item for one of the MS/TP tests, which deals with the max-info-frames setting in a device and what can be expected to be sent from an MS/TP device based on the value of this property.</p>
<p>Tomorrow is OS-WG, AP-WG, XML-WG, and the TI-WG.</p>
<p>Of particular importance to me are the IT-WG, IP-WG, and SG-WG meetings on Sunday since the IPv6 work we&#8217;ll be doing in the IP-WG will likely be heavily discussed and debated ad nauseum.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for I’m going to Disneyworld!" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+I’m+going+to+Disneyworld!" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=47</wfw:commentRss>
		</item>
		<item>
		<title>We got a vendor ID</title>
		<link>http://coleman.jandasoft.biz/?p=45</link>
		<comments>http://coleman.jandasoft.biz/?p=45#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:10:48 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=45</guid>
		<description><![CDATA[Over the holidays, I decided to &#8220;stake my claim&#8221; in the BACnet world by obtaining a BACnet vendor identifier from ASHRAE. For those who are unfamiliar with this process, please check bacnet.org. The process is pretty easy, all things considered. There was more paperwork involved with joining the BACnet committee!
The only problem I encountered was [...]]]></description>
			<content:encoded><![CDATA[<p>Over the holidays, I decided to &#8220;stake my claim&#8221; in the BACnet world by obtaining a <a href="http://www.bacnet.org/VendorID/index.html">BACnet vendor identifier</a> from ASHRAE. For those who are unfamiliar with this process, please check <a href="http://www.bacnet.org/DL-Docs/Procedures-Vendor-ID-rev2-20-09.pdf">bacnet.org</a>. The process is pretty easy, all things considered. There was more paperwork involved with joining the BACnet committee!</p>
<p>The only problem I encountered was that they required my title at JANDAsoft. JANDAsoft (aka JANDA Software Company, LLC) is a sole proprietorship LLC, which is a really just a fancy way of saying it&#8217;s a company with one employee – me. So, technically, I&#8217;m &#8220;Founder and President&#8221;, but those titles are entirely too formal for my liking. But, ASHRAE requires a title, so I listed myself as &#8220;President&#8221;, which is why it&#8217;s listed as such on the list of <a href="http://www.bacnet.org/VendorID/BACnet%20Vendor%20IDs.htm">vendor identifiers</a>. It could just as easily say &#8220;Coleman Brumley, <a href="http://en.wikipedia.org/wiki/Grand_poobah">Grand Poobah</a>&#8220;.</p>
<p>Anyway, I&#8217;m now officially listed as a <a href="http://www.bacnet.org/VendorID/BACnet%20Vendor%20IDs.htm">BACnet vendor</a>.</p>
<p>If you&#8217;re considering building a BACnet product, please obtain a vendor identifier. Oh, and buy your stack from <a href="http://www.polarsoft.biz/">PolarSoft</a>!</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for We got a vendor ID" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+We+got+a+vendor+ID" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=45</wfw:commentRss>
		</item>
		<item>
		<title>BACnet over Bluetooth?</title>
		<link>http://coleman.jandasoft.biz/?p=44</link>
		<comments>http://coleman.jandasoft.biz/?p=44#comments</comments>
		<pubDate>Sat, 19 Dec 2009 20:36:48 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=44</guid>
		<description><![CDATA[An interesting development developed recently in the wireless world. Bluetooth 4.0 was announced on December 17,2009. This version of the Bluetooth standard is aimed directly at the sensor market.
This got me to thinking. What impact this will have in the BACnet community?

Addenda 135-2008q, which introduced Zigbee as a BACnet data link layer, was approved in [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting development developed recently in the wireless world. <a href="http://www.bluetooth.com/Bluetooth/Technology/Building/Specifications/">Bluetooth 4.0</a> was announced on December 17,2009. This version of the Bluetooth standard is aimed directly at the sensor market.</p>
<p>This got me to thinking. <em>What impact this will have in the BACnet community?<br />
</em></p>
<p><a href="http://www.bacnet.org/Addenda/Add-135-2008q.pdf">Addenda 135-2008q</a>, which introduced <a href="http://www.zigbee.org/">Zigbee</a> as a BACnet data link layer, was approved in January, 2009. What will Bluetooth 4.0 mean for BACnet/Zigbee, or more generally wireless BACnet? My brief introduction (from the <a href="http://news.zdnet.co.uk/communications/0,1000000085,39944124,00.htm?tag=mncol;txt">press releases</a>) about Bluetooth 4.0 leads me to believe they&#8217;re trying to directly compete with Zigbee.</p>
<p>I think a lot of the same concepts (virtual MAC layer, caching, etc.) that apply to BACnet/Zigbee would also apply to BACnet/Bluetooth.</p>
<p>This is an interesting time in BACnet. With the work being done in IPv6 and the hope to work with the Smart Grid alliance, the committee has their work cut out for them.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for BACnet over Bluetooth?" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+BACnet+over+Bluetooth?" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=44</wfw:commentRss>
		</item>
		<item>
		<title>1 Year Later</title>
		<link>http://coleman.jandasoft.biz/?p=41</link>
		<comments>http://coleman.jandasoft.biz/?p=41#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:26:16 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=41</guid>
		<description><![CDATA[One year ago today, I went to UPMC Magee for Roux-en-Y Gastric Bypass.  That day, I weighed 331 pounds.  That was after a weight loss of 18 pounds from the day I was diagnosed with Type II Diabetes, which means that on that fateful day I weighed 349 pounds.  I say fateful, [...]]]></description>
			<content:encoded><![CDATA[<p>One year ago today, I went to <a href="http://www.upmc.com/HospitalsFacilities/Hospitals/magee">UPMC Magee</a> for <a href="http://en.wikipedia.org/wiki/Gastric_bypass_operation">Roux-en-Y Gastric Bypass</a>.  That day, I weighed 331 pounds.  That was after a weight loss of 18 pounds from the day I was diagnosed with Type II Diabetes, which means that on that fateful day I weighed 349 pounds.  I say fateful, because that&#8217;s the day I made a decision that will affect me and my family for the rest of my life.
</p>
<p>At the time, I had considered that normal and didn&#8217;t think much of it.  I was &#8220;happy&#8221;, or at least that&#8217;s what I kept telling myself.  In reality, I was miserable!  I was in constant pain.  I could hardly walk.  My back hurt continuously.  And those were the symptoms I <em>knew</em> about.  What I didn&#8217;t know, and I would only find out during testing for the surgery was that my body was slowly turning on itself.  The surgeon, Dr. George Eid, described it as &#8220;<a href="http://www.annecollins.com/malignant-obesity.htm">malignant obesity</a>&#8220;.  My BMI was over 40, and I was in the <em>very</em> early stages of having kidney problems (determined by a microalbumin test).  I had &#8220;severe&#8221; obstructive sleep apnea.
</p>
<p>Well, I&#8217;m happy to report that today that&#8217;s all gone!  To date, I&#8217;ve lost 110 pounds.  I&#8217;m exercising again (though not as regularly as I should) and eating better.  I still, occasionally, slip into bad habits but I do my best to keep an eye on myself.  My Type II diabetes is gone &#8212; 100% cured.  My HA1C is around 5.  I sleep without a machine now!
</p>
<p>Some other &#8220;stats&#8221;:
</p>
<ul>
<li>14 inches gone from my waist (size 56 to size 42)
</li>
<li>I went from a XXXL to an XL shirt.
</li>
<li>My original wedding ring no longer fits.   My wife bought me another for Christmas, though!
</li>
<li>I can now fit in a Herman Miller Aeron size C chair without voiding the warranty.
</li>
<li>I can fly without asking for a seatbelt extension, nor risking getting charged for a second seat.
</li>
<li>I can put the tray down in front of me on a plane.  I could NEVER do this before.
</li>
<li>I can buy clothes at Wal-Mart.  No more Casual Male Big&amp;Tall for me.
</li>
<li>
<div>I&#8217;ve not drank soda (diet or otherwise) for over a year.  I&#8217;ve taken a sip here and there, but can&#8217;t stand the taste of it now.
</div>
<p>
 </p>
</li>
</ul>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for 1 Year Later" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+1+Year+Later" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=41</wfw:commentRss>
		</item>
		<item>
		<title>BusyBox 1.13.0 telnetd</title>
		<link>http://coleman.jandasoft.biz/?p=40</link>
		<comments>http://coleman.jandasoft.biz/?p=40#comments</comments>
		<pubDate>Sun, 23 Nov 2008 03:46:13 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[Embedded Linux]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=40</guid>
		<description><![CDATA[Recently, I was working with my embedded Linux platform and wanted to implement a telnet server on it. My platform, based on the Atmel AT91SAM9260 CPU, runs an unpatched BusyBox. BusyBox has a telnet daemon (telnetd) built into it, but it required some configuration to get running. I&#8217;d like to document those configuration steps here [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" src="http://coleman.jandasoft.biz/wp-content/uploads/2008/11/112308-0346-busybox11301.gif" />Recently, I was working with my embedded Linux platform and wanted to implement a telnet server on it. My platform, based on the Atmel AT91SAM9260 CPU, runs an unpatched <a href="http://www.busybox.net/">BusyBox</a>. BusyBox has a telnet daemon (telnetd) built into it, but it required some configuration to get running. I&#8217;d like to document those configuration steps here for future reference.<br />
 </p>
<p>1.  Download the latest BusyBox. These instructions are based on <a target="_blank" href="http://busybox.net/downloads/busybox-1.13.0.tar.bz2">BusyBox v1.13.0</a>.<br />
2.  Run <strong>make menuconfig</strong>, and select all of the options you want built into BusyBox. Remember to setup your cross compiler!<br />
3.  Run <strong>make</strong>.</p>
<p>In my case, I&#8217;m not using <a target="_blank" href="http://www.nsa.gov/selinux/papers/slinux/node60.html">devpts</a>, so I manually make the pseudo terminal (pty) entries in /dev. I used the following script to do this:</p>
<pre><code>for i in 0 1 2 3 4 5 6 7
do
    /bin/mknod /dev/ttyp$i c 3 $i
    /bin/mknod /dev/ptyp$i c 2 $i
done
</code></pre>
<p>Also, I made sure that CONFIG_FEATURE_DEVPTS was not set in the BusyBox .config before running make. The devpts file system was not configured in my kernel, so I knew I didn&#8217;t want it in BusyBox either. As far as I can tell, telnetd is the only BusyBox module that relies on this setting.</p>
<p>Some say that telnet is dead due to security issues and we should used ssh/scp instead of telnet/ftp. If you&#8217;re in that camp, I&#8217;d urge you to check out <a target="_blank" href="http://matt.ucc.asn.au/dropbear/dropbear.html">dropbear</a>. However, for what I&#8217;m doing with this board, easy remote access trumps complicated security measures. Of course, your mileage may vary (YMMV), and I&#8217;m not advocating ignoring security concerns altogether.<br />
     </p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for BusyBox 1.13.0 telnetd" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+BusyBox+1.13.0+telnetd" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=40</wfw:commentRss>
		</item>
		<item>
		<title>The one where I catch up (er, Visual Studio Macros)</title>
		<link>http://coleman.jandasoft.biz/?p=32</link>
		<comments>http://coleman.jandasoft.biz/?p=32#comments</comments>
		<pubDate>Thu, 30 Oct 2008 03:49:22 +0000</pubDate>
		<dc:creator>Coleman Brumley</dc:creator>
		
		<category><![CDATA[Windows Programming]]></category>

		<guid isPermaLink="false">http://coleman.jandasoft.biz/?p=32</guid>
		<description><![CDATA[Since I&#8217;ve been using the newer Visual Studios (starting with VS.Net 2003) an annoying issue has been how it copies code into the clipboard. See, I&#8217;m an avid fan of the Dark Side of Visual Studio and have been ever since I came across it in the Borland IDE years ago. However, when using these [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve been using the newer Visual Studios (starting with VS.Net 2003) an annoying issue has been how it copies code into the clipboard. See, I&#8217;m an avid fan of the <a href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/06/Join-the-Dark-Side-of-Visual-Studio.aspx">Dark Side of Visual Studio</a> and have been ever since I came across it in the Borland IDE years ago. However, when using these dark themes there appears to be an issue when copying and pasting from Visual Studio to applications like Outlook. The problem is that it keeps the theme settings and pastes the text as is into the target.</p>
<p>For example, here&#8217;s an image of some code from Visual Studio 2005. You&#8217;re welcome to hate me over the color settings. <a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx">Cie la vie</a>. I&#8217;ve heard them all, too.</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2008/10/103008-0349-theonewhere12.png" /></p>
<p>Here&#8217;s that same code pasted directly into this blog post:</p>
<p><span style="font-size: 10pt; font-family: Consolas"><strong><span style="color: white; background-color: black">xmlDocPtr getdoc (</span><span style="color: #cc7832; background-color: black">char</span></strong><span style="color: white; background-color: black"><strong> *docname)</strong><br />
</span></span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black">{<br />
</span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black"><strong>xmlDocPtr doc;</strong><br />
</span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black"><strong>doc = xmlParseFile(docname);</strong><br />
</span></p>
<p>    <br />
 </p>
<p><span style="font-size: 10pt; font-family: Consolas"><strong><span style="color: white; background-color: black"><br />
</span><span style="color: #cc7832; background-color: black">if</span></strong><span style="color: white; background-color: black"><strong> (doc == NULL ) </strong><br />
</span></span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black"><strong>{</strong><br />
</span></p>
<p><span style="font-size: 10pt; font-family: Consolas"><strong><span style="color: white; background-color: black">        </span><span style="color: #cc7832; background-color: black">return</span></strong><span style="color: white; background-color: black"><strong> NULL;</strong><br />
</span></span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black"><strong>}</strong><br />
</span></p>
<p>    <br />
 </p>
<p><span style="font-size: 10pt; font-family: Consolas"><strong><span style="color: white; background-color: black"><br />
</span><span style="color: #cc7832; background-color: black">return</span></strong><span style="color: white; background-color: black"><strong> doc;</strong><br />
</span></span></p>
<p><span style="font-size: 10pt; color: white; font-family: Consolas; background-color: black">}<br />
</span></p>
<p>Ugh. Since I regularly email code snippets to people, this requires manually editing the code after it&#8217;s pasted into an email message or Word doc or whatever.</p>
<p>Paste Special allows you to choose from RTF or unformatted text or unformatted Unicode text. However, &#8220;Paste Special&#8221; isn&#8217;t really helpful here because it pastes the text with a white foreground, which isn&#8217;t particularly useful on a white background.</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2008/10/103008-0349-theonewhere22.png" /></p>
<p>Here&#8217;s where I catch up with the times. Turns out, Visual Studio has these cool things called macros. Never heard of &#8216;em! Why, in my day, we did everything by hand in our IDE. And it snowed both ways, uphill. And we liked it. Or, <a href="http://everything2.com/index.pl?node_id=1786116">something like that</a>.</p>
<p>Anywho, macros. As is usually the case, <a href="http://www.codinghorror.com/blog/archives/000429.html">I&#8217;m not the only one bothered by this nuisance</a>. It&#8217;s just I&#8217;m the only one who didn&#8217;t go looking for a code solution. I just kept editing the code by hand. And I liked it. I liked it so much; I did it several times a day. Up hill, both ways.</p>
<p>I don&#8217;t know what got into me, but today I&#8217;d finally had enough. I went looking for a solution.</p>
<p><a href="http://www.codinghorror.com/blog/archives/000319.html">This link will take you to Jeff Atwood&#8217;s solution</a>. Go ahead, read it now. I&#8217;ll wait here. Jeff points out that VS copies text to the clipboard in Rich Text Format (RTF). This is supported by the &#8220;Formatted Text (RTF)&#8221; in the Paste Special choices. Jeff wanted to copy HTML from VS to paste into web pages or text boxes. I just wanted plain text. So, I expanded his macro a bit to do what I wanted. I added a function, RTFtoText that strips all of the RTF tags from the copied text and leaves the line breaks and tabs intact. There&#8217;s probably a more eloquent solution, but this works for me. I didn&#8217;t bind the macro to Ctrl-C yet, so I still have one extra key stroke or mouse click. I&#8217;ve mapped the CodeToText macro function to Alt+C in the text editor, so my key combination is Ctrl+C and the Alt+C. Then I can go to Outlook or Word or whatever and Ctrl+V. Way easier than Ctrl+C, go to Outlook, Ctrl+V, then highlight the new text remove the background color. Rehighlight the new text and change the font color to black.</p>
<p>So, I figure that one key stroke will save 30-40 seconds per instance. That adds up after a while. It&#8217;s worth the time it took me to work on this, which was a couple of hours or so.</p>
<p>Here&#8217;s the sample shown pasted into an email message after applying the CodeToText macro:</p>
<p><img src="http://coleman.jandasoft.biz/wp-content/uploads/2008/10/103008-0349-theonewhere31.png" /></p>
<p>I was going to show a sample here after running Jeff&#8217;s RtfToHtml, but it doesn&#8217;t quite get it right for C source.  I&#8217;ll have to spend some time on that later, but for now this does exactly what I want for emails.  </p>
<p><a href="http://www.jandasoft.biz/files/FormatToHtml.zip">Download the FormatToHtml macro</a> (6kb)</p>
<p>After that success, I started playing with all of the Sample macros provided by Visual Studio. Some of the more useful ones I found were the ones that added comments (AddFunctionDescription, AddRevisionMarks, etc.) and navigated to places in the code (BeginningofFunction). I modified AddFunctionDescription and AddRevisionMarks to add block comments formatted the way I like them. I also copied BeginningofFunction and created EndofFunction from it. Vim has the same browsing features, and I&#8217;ve found these quite useful. I&#8217;m glad there&#8217;s an equivalent in VS. I also added a macro that adds a comment to the end of the selected line. I do this a lot and I figure this macro will shave a couple of seconds from that activity.</p>
<p>I feel sad that I&#8217;d not found macros before. Of course, I knew they existed but I&#8217;ve never <span style="text-decoration: line-through">played</span> worked with them. Now, I&#8217;m glad I&#8217;m did, and that I didn&#8217;t just keep doing things like we did in the old days. Up hill, both ways.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="coleman.brumley@comcast.net" /><input type="hidden" name="return" value="Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine." /><input type="hidden" name="item_name" value="If you like this post, buy me a coffee! for The one where I catch up (er, Visual Studio Macros)" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="1.00" /><input type="image" src="http://coleman.jandasoft.biz/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="" title="" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=coleman.brumley@comcast.net&amp;currency_code=USD&amp;amount=1.00&amp;return=Thanks!  You've helped clear the morning fog, and I'm sure in some way helped feed the Starbucks machine.&amp;item_name=If+you+like+this+post,+buy+me+a+coffee!+for+The+one+where+I+catch+up+(er,+Visual+Studio+Macros)" target="paypal">Coffee helps me clear the fog.  If you've found any of the posts on this blog helpful, I could always use more coffee.  </a></p>]]></content:encoded>
			<wfw:commentRss>http://coleman.jandasoft.biz/?feed=rss2&amp;p=32</wfw:commentRss>
		</item>
	</channel>
</rss>
