<?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>CoR &#187; architecture</title>
	<atom:link href="http://blog.cor-net.org/tag/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cor-net.org</link>
	<description>...</description>
	<lastBuildDate>Sat, 03 Jul 2010 19:52:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CanArch Project</title>
		<link>http://blog.cor-net.org/embedded/canoe-project/</link>
		<comments>http://blog.cor-net.org/embedded/canoe-project/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 08:22:13 +0000</pubDate>
		<dc:creator>cor</dc:creator>
				<category><![CDATA[Embedded Development]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[can]]></category>
		<category><![CDATA[CanOE]]></category>
		<category><![CDATA[LGPL]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Qt4]]></category>
		<category><![CDATA[sourceforge]]></category>

		<guid isPermaLink="false">http://blog.cor-net.org/?p=41</guid>
		<description><![CDATA[An easy way to manage your CAN network using a C++ OpenSource library.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em>An easy way to manage your CAN network using a C++ OpenSource library.</em></p>
<p>Last year, I compete with a few teammates in the French Cup of Robotic, and our robot was extensively using CAN, because it&#8217;s a really robust and widespread network in embedded systems (and it&#8217;s true we didn&#8217;t had any trouble with it). The problem I was facing concerned how to manage all those ids and stuff in an efficient way.</p>
<p>I tried to find some solution on the Internet, but didn&#8217;t find any that would answer my problem without making me writing different code for the many few architectures we were using (PIC18F, dsPIC, ARM9 &#8230;).</p>
<p>So I wrote a small app, that used an XML file to &#8220;define&#8221; the network architecture (nodes, frames), that automatically generated IDs (using priority, node id and frame id) and exported them in a C Header using #define.</p>
<p><strong>I rewrote it from scratch, implementing a lot of things that were not possible in the first version and improving the overall architecture.</strong></p>
<p><strong>This is now provided as a library under LGPL, with a few tools to exploit it easily.</strong></p>
<p>So, if you have an existing CAN network, or a new one to design, and if you want to write not too static code for embedded systems, and analyze smartly the live feed of your network, CanArch might be helpful for you.</p>
<h1>Example</h1>
<p>So here is an XML file, it&#8217;s the &#8220;base&#8221;:</p>
<div class="aligncenter bigfileicon"><a href="http://blog.cor-net.org/wp-content/uploads/2009/08/simple.xml"><img src="http://blog.cor-net.org/wp-content/plugins/bigfiles/icons/32x32/application-xml.png" alt="simple.xml" /><br /><span>simple.xml</span></a></div>
<p>There is two parts:</p>
<ul>
<li>Configuration (conf): Network name, bitrate, types definition and id generation infos</li>
<li>Network tree (network): The network is a tree with <em>nodes</em> (devices on the network) which have <em>frames</em></li>
</ul>
<p>Hu ? Yeah, in that file you specify the nodes on your network, and the kind of frames that each node can emit.</p>
<p>Then the <em>format</em> of each frame is specified, using <em>types</em> like <em>int</em> or <em>enum</em>, with a bit size that you can specify.</p>
<p>Then you can generate IDs using the policy you specified in the definition file, and you can export it as a C Header like this one:</p>
<div class="aligncenter bigfileicon"><a href="http://blog.cor-net.org/wp-content/uploads/2009/08/graph.h"><img src="http://blog.cor-net.org/wp-content/plugins/bigfiles/icons/32x32/text-x-chdr.png" alt="graph.h" /><br /><span>graph.h</span></a></div>
<p>(well this is actually an export of <a href="http://blog.cor-net.org/wp-content/uploads/2009/08/graph.xml">that (graph.xml)</a> definition file, which is more complex than the simple previous one)</p>
<p>And to handle all the import / export / visualization, there is a nice Qt4 app called NetworkView:</p>
<div id="attachment_46" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.cor-net.org/wp-content/uploads/2009/08/Screenshot-NetworkView.png" rel="wp-prettyPhoto[g41]"><img class="size-medium wp-image-46" title="NetworkView" src="http://blog.cor-net.org/wp-content/uploads/2009/08/Screenshot-NetworkView-300x225.png" alt="Qt4 NetworkView Gui" width="300" height="225" /></a><p class="wp-caption-text">NetworkView : a Qt4 CanArch Gui</p></div>
<h1>Developers</h1>
<p>This project is fairly new, if you think you can help, I would be really glad if you do, so please contact me so we can talk about that.</p>
<p>There are lot of things that can be developed to improve this project, I&#8217;m thinking about a clean way to handle existing frames and interfaces (using <a href="http://developer.berlios.de/projects/socketcan/">socketcan</a> on Linux for example).</p>
<p>Also, a better support for existing networks, and DeviceNet and other higher level networks based on CAN are ideas I&#8217;m thinking about, and I would be glad to share the work, cause I won&#8217;t be able to do all that while studying and with my internship coming this winter.</p>
<h1>Download / Source</h1>
<p>The project page on BitBucket is <a href="http://bitbucket.org/corfr/canarch/">http://bitbucket.org/corfr/canarch/</a>, you can download the sources from there.</p>
<p><strong><br />
EDIT: CanArch has been renamed from CanOE, since this is a trademark for the <a href="http://www.vector.com/vi_canoe_en.html">Vector CANoe</a> software.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cor-net.org/embedded/canoe-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
