{"id":212,"date":"2017-08-31T15:19:56","date_gmt":"2017-08-31T15:19:56","guid":{"rendered":"http:\/\/endrekatona.eu\/wordpress\/?p=212"},"modified":"2017-09-02T18:22:38","modified_gmt":"2017-09-02T18:22:38","slug":"building-automation-based-on-knx-bims-the-first-application-program","status":"publish","type":"post","link":"http:\/\/endrekatona.eu\/tech\/2017\/08\/31\/building-automation-based-on-knx-bims-the-first-application-program\/","title":{"rendered":"Building automation based on KNX &#8211; BIMs: The first application program"},"content":{"rendered":"<p>Developing new smart home appliances based on bus interface modules (BIMs) is comfortable not only because of the provided firmware and application programming interface, or the hardware for the easy KNX-bus connection. Using the provided development toolpackage also saves the developer from creating the application program from scratch.<\/p>\n<p>The BIM-Tools include the BIM Wizard, the tool which prepares the code, namely the declarations of the KNX communication objects are automatically generated.<\/p>\n<p>In a\u00a0<a href=\"http:\/\/endrekatona.eu\/tech\/2017\/08\/27\/building-automation-based-on-knx-bims-the-development-toolpackage\/\" target=\"_blank\" rel=\"noopener\">former article<\/a>\u00a0I&#8217;ve presented how to set up the development toolpackage (delivered by Opternus) and get ready to develop and download the first application program.<\/p>\n<p>The first step towards developing application programs for BIMs is creating the project using the BIM Wizard. Through this step, the needed , BIM related header files will be automatically included in the project, and the code for declaring the communication objects is also generated.<\/p>\n<p><b>Step 1:\u00a0<\/b>Open the BIM Tools and click on the BIM Wizard icon or choose from the main menu Tools\\BIM Wizard. Select the used family member, and set the path where the project should be saved. Click &#8220;next&gt;&gt;&#8221;.<\/p>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_1.png\"><img loading=\"lazy\" class=\"size-medium wp-image-319 aligncenter\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_1-300x292.png\" alt=\"\" width=\"300\" height=\"292\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_1-300x292.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_1.png 472w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><b>Step 2:\u00a0<\/b>Define the needed KNX communication objects. Give a name to each object, and set the data type for each. An example is shown on the figure below. Click &#8220;next&gt;&gt;&#8221;.<\/p>\n<div><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_2.png\"><img loading=\"lazy\" class=\"size-medium wp-image-320 aligncenter\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_2-300x284.png\" alt=\"\" width=\"300\" height=\"284\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_2-300x284.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_2.png 473w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><b><br \/>\nStep 3:\u00a0<\/b>Now choose the number of entries in the address and association tables. The minimum number of entries has already been calculated, more entries can be added by using the arrows, or writing larger numbers into the list boxes. The configuration may be saved in an XML file, by clicking on &#8220;Save Conf&#8221;. Click on &#8220;Create&#8221; to create the project.<\/div>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_3.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-326\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_3-300x285.png\" alt=\"\" width=\"300\" height=\"285\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_3-300x285.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Wizard_3.png 475w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<div>\n<p><b>Step 4:\u00a0<\/b>Open the new project using the IAR Embedded Workbench and implement the application specific program.<\/p>\n<div><\/div>\n<h3>The first application program<\/h3>\n<p>When the project, created with the BIM Wizard, is opened with IAR Embedded Workbench, the following files are already included in the workspace (not exclusively):<\/p>\n<ul>\n<li><b>BIM_M13x.h<\/b>, header file containing defines and data structure definitions which are specific for the BIM M13x systems. (e.g. definition of the TIMER strucutre, system specific time constants: MSEC500)<\/li>\n<li><b>config.xml<\/b>, configuration file for adding the &#8216;load controls&#8217; and making the memory conversion in the post-build phase<\/li>\n<li><b>main.c<\/b>, containing the application program<\/li>\n<li><b>tables.c<\/b>, contains the address table, association table and communication object table (group addresses are defined here)<\/li>\n<li><b>user.h<\/b>, defines for timers and communication objects<\/li>\n<\/ul>\n<div><\/div>\n<div>The best &#8220;Hello World Application&#8221; for an embedded system is toggling one of the hardware pins:<\/div>\n<div><\/div>\n<div>\n<ol>\n<li>Configure the hardware pins to be in output mode.<\/li>\n<li>Disable the use of pull-up resistors.<\/li>\n<li>Define one timer.<\/li>\n<li>Modify the\u00a0<b>main()\u00a0<\/b>function, so that one hardware pin is activated for 1 seconds, then deactivated for 1 second.<\/li>\n<\/ol>\n<\/div>\n<div><\/div>\n<div>On the BIM Evaluation Board only Port7 may be used entirely for solving application specific tasks. The pins of Port7 are wired out to the BIM connector (also called JP2 on the board schematics), as indicated on the picture and table below:<\/div>\n<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/IDH26.jpg\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-329\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/IDH26-300x280.jpg\" alt=\"\" width=\"300\" height=\"280\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/IDH26-300x280.jpg 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/IDH26.jpg 463w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/div>\n<div>\n<div>\n<table align=\"center\">\n<thead>\n<tr>\n<td style=\"text-align: center;\" bgcolor=\"#c0c0c0\">BIM-Connector pin<\/td>\n<td style=\"text-align: center;\" bgcolor=\"#c0c0c0\">Microcontroller pin<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">P71<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">P73<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">7<\/td>\n<td style=\"text-align: center;\">P70<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">9<\/td>\n<td style=\"text-align: center;\">P75<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">11<\/td>\n<td style=\"text-align: center;\">P72<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">13<\/td>\n<td style=\"text-align: center;\">P77<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">15<\/td>\n<td style=\"text-align: center;\">P74<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">19<\/td>\n<td style=\"text-align: center;\">P76<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">25<\/td>\n<td style=\"text-align: center;\">GND<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<p><b>Step 1:\u00a0<\/b>The API provided by the BCU 2.5 operating system makes it possible to use timers in the application program. For this, the number of timers must be defined in the file\u00a0<b>user.h<\/b>.<\/p>\n<p><span style=\"font-family: Courier;\">#define NUM_OF_TIMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<\/span><span style=\"font-family: Courier;\">\u00a0<\/span><\/p>\n<p>In\u00a0<b>main.c\u00a0<\/b>a timer table must be declared. This can be done easily, as the structure of a timer, as well as the structure of the timer table have been defined in the\u00a0<b>BIM_M13x.h\u00a0<\/b>header file.<\/p>\n<p><span style=\"font-family: Courier;\">TIMER_TAB UserTimerTab;<\/span><\/p>\n<p>In the application info block (a constant declared at the end of the\u00a0<b>main.c\u00a0<\/b>file) the application program gives some necessary information for the operating system. In this application info block, the declared timer table must also be mentioned:<\/p>\n<div>\n<p>const AppInfoBlock AIB = {<\/p>\n<p>Swap(0x0001), \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ AIBVersion<br \/>\n0x01, 0x01, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ ApplFirmwareVersion, ApplFirmwareSubVersion<br \/>\n__program_start, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ AppMain<br \/>\nsave, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ AppSave<br \/>\nunload, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ AppUnload<br \/>\nCObjects, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ pCObjects<br \/>\nRAMFlags, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ pRAMFlags<br \/>\n<b>&amp;UserTimerTab, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ pUserTimerTab<br \/>\n<\/b>\u00a0 \u00a0 NULL, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ pUsrIntObjRoot<br \/>\nNULL, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ pUsrParamMgmt<br \/>\n0x0000 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ WatchDogTime<br \/>\n<span style=\"font-family: Courier;\">};<\/span><\/p>\n<\/div>\n<p><b>Step 2:\u00a0<\/b>Initialize the user application timer table. The already created\u00a0<b>AppInit()\u00a0<\/b>function is just perfect to do this:<\/p>\n<div>\n<p><span style=\"font-family: Courier;\">void AppInit(void)<\/span><\/p>\n<p><span style=\"font-family: Courier;\">{<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0\u00a0<b>\/\/ init the user application timer table<\/b><\/span><span style=\"font-family: Courier;\"><b>\u00a0\u00a0<\/b><\/span><\/p>\n<p><span style=\"font-family: Courier;\"><b>\u00a0 \u00a0 U._TmInit(NUM_OF_TIMERS);<\/b><\/span><span style=\"font-family: Courier;\">\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ after initialization a taskswitch must be done because<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ the task switch is disabled at cstartup<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 FORCE_TASKSWITCH();<br \/>\n<\/span><span style=\"font-family: Courier;\">}<\/span><\/p>\n<div>\n<p><b>Step 3:\u00a0<\/b>Set the pins of PORT7 as output pins. Disable the pull-up resistors. Start the timer. Write the code, so that one pin is activated for one second and deactivated for one second.<\/p>\n<p><span style=\"font-family: Courier;\">void main (void)<\/span><\/p>\n<\/div>\n<\/div>\n<div>\n<p><span style=\"font-family: Courier;\">{<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ Do some initializations<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 AppInit();<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 int count = 0;<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 PM7 = 0x00; \/\/ pin modes<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 PU7 = 0x00; \/\/ disable pull-up resistors<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 U._TmStart(&amp;UserTimerTab.Timers[0], SEC1); \/\/ SEC1 defined in BIM_M13x.h<\/span><span style=\"font-family: Courier;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ Start the main loop of the application program<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ it will be interrupted every 3.3ms and<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 \/\/ continued after a complete system cycle<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 for(;;)<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 {<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0if ( U._TmIsExpired( &amp;UserTimerTab.Timers[0] ) )<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 count = 1 &#8211; count;<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 U._TmStart(&amp;UserTimerTab.Timers[0], SEC1);<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/span><\/p>\n<p><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0if ( count )<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 P7 = 0x01;<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0else<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 P7 = 0x00;<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<br \/>\n<\/span><span style=\"font-family: Courier;\">\u00a0 \u00a0 }<br \/>\n<\/span><span style=\"font-family: Courier;\">}<\/span><\/p>\n<\/div>\n<h3>Building the downloadable object file<\/h3>\n<div>The application program is now ready to be compiled and downloaded to the evaluation board (or directly to the BIM M130). Though, there is an important step, that must be done after compiling the code and before downloading it to the target device.<\/div>\n<div><\/div>\n<blockquote>\n<div>\n<p>To provide compatibility with ETS 3, the BIM operating system does a memory translation from bus addresses to the internal addresses of the microcontroller. That means that, for example, the start of the address table for the ETS is <strong><em>0x0116<\/em><\/strong> and in reality it is <strong><em>0x8116<\/em><\/strong> in the microcontroller.<\/p>\n<p>To generate an S19 file that could be imported in an ETS 3 (manufacturer version) database entry, it is necessary to convert the memory and to add &#8216;load controls&#8217;. The memory conversion has to be done because, as mentioned above, the BIM operating system does a memory translation for ETS compatibility. Therefore a byte located at <strong><em>0x8116<\/em><\/strong> in the microcontroller has to be set at <strong><em>0x0116<\/em><\/strong> in the S19 file for bus download, because the BIM operating system will set it back to <strong><em>0x8116<\/em><\/strong>.<\/p>\n<p>The &#8216;load controls&#8217; are necessary to control the processing of the address, association and communication object description table and of the application program.<\/p>\n<\/div>\n<\/blockquote>\n<div><\/div>\n<div>Converting the memory and adding the &#8216;load controls&#8217; can be done in two ways:<\/div>\n<div><\/div>\n<div>\n<ol>\n<li>Using the\u00a0<b>S19 modifier<\/b>\u00a0provided by the BIM Tools.<\/li>\n<li>Using a post-build command in IAR Embedded Workbench.<\/li>\n<\/ol>\n<div><\/div>\n<p>I&#8217;ve chosen to use a post-build command, which is automatically executed by the development environment at the end of the release build process.<\/p>\n<p>If the toolchain has been prepared as described in the\u00a0<a href=\"http:\/\/endrekatona.eu\/tech\/2017\/08\/27\/building-automation-based-on-knx-bims-the-development-toolpackage\/\" target=\"_blank\" rel=\"noopener\">former post<\/a>, this post-build command should be already added in IAR Embedded Workbench. This setting can be checked by choosing\u00a0<b>Project\/Options&#8230;<\/b>\u00a0from the main menu of the IAR Embedded Workbench. Choose <strong>&#8216;Build Actions&#8217;<\/strong> from the list on the right in the <strong>&#8216;Options&#8217;<\/strong> window, as shown in the picture below (if the &#8216;Build Actions&#8217; item does not appear in your list, it is very probable that your IAR Embedded Workbench limited evaluation license has been expired).<\/p>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Post-build-command.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-356\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Post-build-command-300x275.png\" alt=\"\" width=\"300\" height=\"275\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Post-build-command-300x275.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Post-build-command.png 471w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<\/div>\n<div>\n<p>On my machine the\u00a0<b>Post-build command line<\/b>\u00a0is:<\/p>\n<p><span style=\"font-family: Courier;\">&#8220;C:\\Program Files\\Siemens AG\\BIM Tools\\aioc.exe&#8221; -t modifier &#8211;targs &#8220;KNX_LightControl&#8221; &#8220;$PROJ_DIR$\\config.xml&#8221; &#8220;$PROJ_DIR$\\Release\\Exe\\KNX_LightControl.s19&#8221; &#8220;$PROJ_DIR$\\Release\\Exe\\KNX_LightControl_mod.s19&#8221;<\/span><\/p>\n<p><b>&#8220;Hint:\u00a0<\/b>in the\u00a0<i>config.xml\u00a0<\/i>file there is the following entry:<\/p>\n<p><span style=\"font-family: Courier;\">&lt;PropertyCompare&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;ObjectIndex&gt;00&lt;\/ObjectIndex&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;PropertyID&gt;4E&lt;\/PropertyID&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;StartIndex&gt;001&lt;\/StartIndex&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;NumOfElements&gt;1&lt;\/NumOfElements&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;Data&gt;010203040506&lt;\/Data&gt;<br \/>\n<\/span><span style=\"font-family: Courier;\">&lt;\/PropertyCompare&gt;<\/span><\/p>\n<p>This entry tells the ETS to read the property\u00a0<i>PID_HARDWARE_TYPE<\/i>\u00a0and compare the value (the hardware type has 6 bytes) with the value specified in the\u00a0<i>config.xml<\/i>\u00a0entry. If the values doesn&#8217;t match the download will not continue. This feature can be used to ensure that only the right application program of one manufacturer is loaded in the right hardware. If you do not want to use this feature you can leave out the complete\u00a0<i>&#8216;PropertyCompare&#8217;\u00a0<\/i>element, but keep in mind if you will develop a new product with the BIM the ETS will only check the manufacturer and will load the application program of your actual product in the new product which could possibly damage it.&#8221;<\/p>\n<p>Now select\u00a0<b>Release\u00a0<\/b>in IAR Embedded Workbench and rebuild your project. In the Release folder of you project library, the new .s19 file will be created, which is ready to be downloaded via the KNX-bus to the new hardware.<\/p>\n<h3>Downloading the application program<\/h3>\n<p>The just created .s19 object file can be downloaded to the target system using the BIM Tools.<\/p>\n<p>For that, connect your PC and the BIM M13x Evaluation Board to the KNX-Bus. To check if the connection is recognized by your PC, the ETS Connection Manager from the BIM Tools can be used:<\/p>\n<\/div>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/ETS_Connection_Manager.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-359\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/ETS_Connection_Manager-300x263.png\" alt=\"\" width=\"300\" height=\"263\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/ETS_Connection_Manager-300x263.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/ETS_Connection_Manager.png 474w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Before the Evaluation Board (or any other BIM M13x family member) can be directly accessed over the bus, it needs to get a unique bus-address. To assign this unique address to the new component, \u00a0use the\u00a0<i>Connectionless Mode\u00a0<\/i>(Main menu: Connection\/Connect&#8230;).<\/p>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Connecting_to_EVB.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-360\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Connecting_to_EVB-300x199.png\" alt=\"\" width=\"300\" height=\"199\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Connecting_to_EVB-300x199.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Connecting_to_EVB.png 471w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If the connection succeeds, choose the\u00a0<b>Addressing<\/b>\u00a0option (Main menu: Connection\/Addressing).<\/p>\n<p>Find your evaluation board (or BIM) via the programming button. Activate the programming button on your device (red LED is switched on), and click on &#8216;Get Devices in Programming Mode&#8217;.<\/p>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Tools_Addressing.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-361\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Tools_Addressing-300x193.png\" alt=\"\" width=\"300\" height=\"193\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Tools_Addressing-300x193.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/BIM_Tools_Addressing.png 439w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If the new device has been found (listed at\u00a0<i>Available Devices<\/i>), enter a new unique address (e.g. 15.15.19) in the\u00a0<i>New Address\u00a0<\/i>field\u00a0and click on &#8216;Set Device in Programming Mode&#8217;.\u00a0Now your Evaluation Board has its unique bus-address.<\/p>\n<p>Now, the connection in\u00a0<i>Connectionless Mode\u00a0<\/i>must be terminated, so that your PC can access directly the EVB (or BIM). To do this, use the\u00a0<i>Device Connection Mode<\/i>. The programming-button still needs to be activated on the Bus Interface Module \/ EVB. Select the option\u00a0<i>Find via Programming Button<\/i>. After a few seconds, the new address, that has just been assigned to the evaluation board, is listed. Select it, and click on\u00a0<i>Connect<\/i>.<\/p>\n<p>At this moment the PC is able to download the application program to the evaluation board. Click on &#8216;Download&#8217; (Main menu: Connection\/Download). In the downloader window choose &#8216;Open&#8217; and select your newly created and modified .s19 file (ProjectName_mod.s19).<\/p>\n<p><a href=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Downloading_Application_Program.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-366\" src=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Downloading_Application_Program-300x158.png\" alt=\"\" width=\"300\" height=\"158\" srcset=\"http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Downloading_Application_Program-300x158.png 300w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Downloading_Application_Program-768x404.png 768w, http:\/\/endrekatona.eu\/tech\/wp-content\/uploads\/2017\/08\/Downloading_Application_Program.png 944w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Click on &#8216;Download&#8217; (Note: the evaluation board must be in programming mode throughout the download process). The application program is downloaded to the evaluation board. The download process lasts 30-60 seconds.<\/p>\n<h3>References<\/h3>\n<ul>\n<li>The sources of the citations are different documents published by Opternus GmbH at\u00a0<a href=\"http:\/\/www.opternus.com\/en\/siemens\/knx-bus-interfacemodules\/bim-m130-135.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.opternus.com\/en\/siemens\/knx-bus-interfacemodules\/bim-m130-135.html<\/a>, documents containing technical description of the BIM M13x systems.<\/li>\n<li>The source of the illustration representing the BIM Connector (JP2) (26 pin connector) is the website of Pacific Custom Cable Inc,\u00a0<a href=\"http:\/\/www.pacificcable.com\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.pacificcable.com\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Developing new smart home appliances based on bus interface modules (BIMs) is comfortable not only because of the provided firmware and application programming interface, or the hardware for the easy KNX-bus connection. Using the provided development toolpackage also saves the developer from creating the application program from scratch. The BIM-Tools include the BIM Wizard, the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[11],"tags":[13,15,12,14],"_links":{"self":[{"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/posts\/212"}],"collection":[{"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":44,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":367,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/posts\/212\/revisions\/367"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/media\/252"}],"wp:attachment":[{"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/endrekatona.eu\/tech\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}