Skip to content

Commit

Permalink
Fixes, updates to documentation and Test Specification reports as part
Browse files Browse the repository at this point in the history
of Milestone 1.7.3.
  • Loading branch information
Arunkumar-Karri committed Feb 15, 2013
1 parent 82b1afb commit 4af7669
Show file tree
Hide file tree
Showing 123 changed files with 8,295 additions and 7,558 deletions.
223 changes: 111 additions & 112 deletions Documents/1 Development Environment/topics/vc.dita

Large diffs are not rendered by default.

230 changes: 55 additions & 175 deletions Documents/4 Help/topics/com_interface_application.dita
Original file line number Diff line number Diff line change
@@ -1,175 +1,55 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd" []>
<topic id="com_interface_application" xml:lang="en-us">
<title>BUSMASTER COM interface</title>
<prolog>
<author>Ratnadip Choudhury</author>
<copyright>
<copyryear year="2011"/>
<copyrholder>ROBERT BOSCH ENGINEERING AND BUSINESS SOLUTIONS LIMITED</copyrholder>
</copyright>
<metadata>
<keywords>
<indexterm>BUSMASTER COM interface</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<p>Using BUSMASTER Automation Object:</p>
<p>User can use all the APIs exposed by BUSMASTER, as COM interface functions in his own application by following ways:</p>
<p>FROM VB:</p>
<p>If the client application is developed using VB the steps are:<ol>
<li>Project-&gt;Add Reference ie. <image href="../images/Reference.bmp" placement="break"/></li>
<li>Select the CAN_Monitor 1.0 Type Library<image href="../images/TypeLib.bmp" placement="break"/></li>
</ol></p>
<p>Now all the BUSMASTER COM APIs can be used in the client application.Once the VB project is configured to use CAN_Monitor type library, a global variable is needed to be declared and initialised so that the COM server can be accessed.This can be accomplished using following statement:</p>
<codeblock>Dim gBUSMASTERApp As CAN_MonitorApp.Application
Set gBUSMASTERApp = New CAN_MonitorApp.Application</codeblock>
<p>Now the varible gBUSMASTERApp can be used to access all the COM members.</p>
<example>For connecting the tool following code is required:<codeblock>gBUSMASTERApp .Connect 1</codeblock></example>
<p>From C++</p>
<p>Let&apos;s start with a very simple C++ application. Make a simple dialog-based application with the class wizard, be it an MFC or an ATL/WTL application. Just make sure that :CoInitialize() and CoUninitialize() are called somewhere (that is done automatically in ATL applications). Put a button on the dialog somewhere, wire it up, and put the following in the message handler for the BN_CLICKED handler:</p>
<codeblock>HResult hr;
hr = ::CoCreateInstance(CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication, (void**)&amp;m_IApplication);
if(SUCCEEDED(hr))
if (m_IApplication) {
m_IApplication-&gt;Connect ( 1 );
}
}</codeblock>
<p>In the header for the dialog, declare a member like this:</p>
<codeblock>IApplication* m_IApplication;</codeblock>
<p>Now, all you need to do is include the file CAN_Monitor_Interface.h which is provided in the BUSMASTER installation folder.When you go looking for this file, you&apos;ll notice another file: CAN_Monitor_Interface.c. This file contains the implementation of the interface and is needed by the linker. So, again, you can copy it, or add it to your project directly.</p>
<p>Now, build your application, click the button you&apos;ve made, and - there is your application!


</p>
<p>

</p>
<p>


To receive CAN messages from Busmaster makes use of the new interface_IAppEvents (connection points).</p>
<p>Provide implementation to sink class as shown below.</p>
<p><codeblock>Sink Class declaration:

VC++:

class ClientSink : public _IAppEvents
{
private:
DWORD m_dwRefCount;
public:
ClientSink();
virtual ~ClientSink();

STDMETHODIMP OnMessageReceived(CAN_MSGS RxMsg);

HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject);

ULONG STDMETHODCALLTYPE AddRef();

ULONG STDMETHODCALLTYPE Release();
};

C#:

class MyEventsSink : _IAppEvents
{
public MyEventsSink() { }

void _IAppEvents.OnMessageReceived(CAN_MSGS RxMsg)
{
MessageBox.Show(&quot;Rx Packet Received!&quot;);
}
}



Usage:

VC++:

HRESULT hResult = CoCreateInstance(CLSID_Application, NULL,
CLSCTX_LOCAL_SERVER, IID_IApplication, (void **) &amp;pICANvas);
if ((SUCCEEDED(hResult)) &amp;&amp; (NULL != pICANvas))
{
//check if this interface supports connectible objects
HRESULT hr = pICANvas-&gt;QueryInterface(IID_IConnectionPointContainer,(void **)&amp;m_pConnPtContainer);
if ( !SUCCEEDED(hr) )
{
return hr;
}

// find the specific connection point
hr = m_pConnPtContainer-&gt;FindConnectionPoint(IID__IAppEvents, &amp;m_pCntPoint);
if ( !SUCCEEDED(hr) )
{
return hr;
}

//we are done with the connection point container interface
m_pConnPtContainer-&gt;Release();

m_pSink = new ClientSink;
if ( NULL == m_pSink )
{
return E_FAIL;
}

//Get the pointer to CSink&apos;s IUnknown pointer
hr = m_pSink-&gt;QueryInterface (IID_IUnknown,(void **)&amp;m_pSinkUnk);
if ( !SUCCEEDED(hr) )
{
return hr;
}

// It is assumed that this should call the QueryInterface with _IAppEvents
// Do not understand why this calls the QueryInterface with IID_IMarshal
// Later this becomes reason for not getting event at ClientSink::OnMessageReceived
hr = m_pCntPoint-&gt;Advise(m_pSinkUnk, &amp;m_dwAdvise);
if ( !SUCCEEDED(hr) )
{
return hr;
}

UpdateGUI();
}
else
{
ASSERT(FALSE);
}


C#:

int cookie;
MyEventsSink mySink;
mySink = new MyEventsSink();

UCOMIConnectionPointContainer icpc = (UCOMIConnectionPointContainer)canMonitor;
UCOMIConnectionPoint icp;
Guid IID_IAppEvents = typeof(_IAppEvents).GUID;

icpc.FindConnectionPoint(ref IID_IAppEvents, out icp);
icp.Advise(mySink, out cookie);

canMonitor.Connect(1);
CAN_MonitorApp.CAN_MSGS sMsg = new CAN_MonitorApp.CAN_MSGS();
// Initialise message structure
sMsg.m_unMsgID = 100; // Message ID
sMsg.m_bEXTENDED = 0; // Standard Message type
sMsg.m_bRTR = 0; // Not RTR type
sMsg.m_ucDataLen = 8; // Length is 8 Bytes
sMsg.m_ucData = new Byte[8] { 0, 1, 2, 3, 4, 5, 6, 7 }; // Lower 4 Bytes
sMsg.m_ucChannel = 1; // First CAN channel

// Send the message
canMonitor.SendCANMSg(ref sMsg);
//canMonitor.

Thread.Sleep(5000);

icp.Unadvise(cookie);</codeblock></p>
</body>
</topic>
<?xml version='1.0' encoding='UTF-8'?>
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd" []>
<topic id="com_interface_application" xml:lang="en-us">
<title>BUSMASTER COM interface</title>
<prolog>
<author>Ratnadip Choudhury</author>
<copyright>
<copyryear year="2011"/>
<copyrholder>ROBERT BOSCH ENGINEERING AND BUSINESS SOLUTIONS LIMITED</copyrholder>
</copyright>
<metadata>
<keywords>
<indexterm>BUSMASTER COM interface</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<p>Using BUSMASTER Automation Object:</p>
<p>User can use all the APIs exposed by BUSMASTER, as COM interface functions in his own application by following ways:</p>
<p>FROM VB:</p>
<p>If the client application is developed using VB the steps are:<ol>
<li>Project-&gt;Add Reference ie. <image href="../images/Reference.bmp" placement="break"/></li>
<li>Select the CAN_Monitor 1.0 Type Library<image href="../images/TypeLib.bmp" placement="break"/></li>
</ol></p>
<p>Now all the BUSMASTER COM APIs can be used in the client application.Once the VB project is configured to use CAN_Monitor type library, a global variable is needed to be declared and initialised so that the COM server can be accessed.This can be accomplished using following statement:</p>
<codeblock>Dim gBUSMASTERApp As CAN_MonitorApp.Application
Set gBUSMASTERApp = New CAN_MonitorApp.Application</codeblock>
<p>Now the varible gBUSMASTERApp can be used to access all the COM members.</p>
<example>For connecting the tool following code is required:<codeblock>gBUSMASTERApp .Connect 1</codeblock></example>
<p>From C++</p>
<p>Let&apos;s start with a very simple C++ application. Make a simple dialog-based application with the class wizard, be it an MFC or an ATL/WTL application. Just make sure that :CoInitialize() and CoUninitialize() are called somewhere (that is done automatically in ATL applications). Put a button on the dialog somewhere, wire it up, and put the following in the message handler for the BN_CLICKED handler:</p>
<codeblock>HResult hr;
hr = ::CoCreateInstance(CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication, (void**)&amp;m_IApplication);
if(SUCCEEDED(hr))
if (m_IApplication) {
m_IApplication-&gt;Connect ( 1 );
}
}</codeblock>
<p>In the header for the dialog, declare a member like this:</p>
<codeblock>IApplication* m_IApplication;</codeblock>
<p>Now, all you need to do is include the file CAN_Monitor_Interface.h which is provided in the BUSMASTER installation folder.When you go looking for this file, you&apos;ll notice another file: CAN_Monitor_Interface.c. This file contains the implementation of the interface and is needed by the linker. So, again, you can copy it, or add it to your project directly.</p>
<p>Now, build your application, click the button you&apos;ve made, and - there is your application!


</p>
<p>

</p>
<p>


To receive CAN messages from Busmaster makes use of the new interface_IAppEvents (connection points).</p>
<p>To know more, refer Example folder in BUSMASTER installation folder.</p>
</body>
</topic>
100 changes: 67 additions & 33 deletions Documents/4 Help/topics/faq.dita
Original file line number Diff line number Diff line change
@@ -1,33 +1,67 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd" []>
<topic id="faq" xml:lang="en-us">
<title>Frequently Asked Questions</title>
<prolog>
<author>Ratnadip Choudhury</author>
<copyright>
<copyryear year="2011"/>
<copyrholder>ROBERT BOSCH ENGINEERING AND BUSINESS SOLUTIONS LIMITED</copyrholder>
</copyright>
<metadata>
<keywords>
<indexterm>Frequently Asked Questions</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<section>
<title>Question: I can log CAN Bus messages, and it looks like I can transmit them, but the Tester does not see the messages I transmit.</title>
<p>Answer: Follow the steps below<ol>
<li>Disconnect the BUSMASTER application.Then click &quot;option -&gt; controller mode&quot; if active mode is not selected please select it.</li>
<li>If baud rate is &gt;= 500 Kbps use 120 ohm terminating resistors between CANH and CANL at both end of cable between USB hardware and ECU (Tester).</li>
</ol></p>
</section>
<section>
<title>Question: BUSMASTER is able to receive messages but when message is transmitted application gives error?</title>
<p>Answer: Follow the steps below<ol>
<li>Measure the voltage between Pin 2 and 3 and Pin 7 an 3 of the SUB-D connector Pins of the PCAN-USB when system is idle.</li>
<li>If voltage is not around 2.5v then CAN Transceiver (Philips PCA82C251T) has got damaged.</li>
</ol></p>
</section>
</body>
</topic>
<?xml version='1.0' encoding='UTF-8'?>
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd" []>
<topic id="faq" xml:lang="en-us">
<title>Frequently Asked Questions</title>
<prolog>
<author>Ratnadip Choudhury</author>
<copyright>
<copyryear year="2011"/>
<copyrholder>ROBERT BOSCH ENGINEERING AND BUSINESS SOLUTIONS LIMITED</copyrholder>
</copyright>
<metadata>
<keywords>
<indexterm>Frequently Asked Questions</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<section>
<title>Question: I can log CAN Bus messages, and it looks like I can transmit them, but the Tester does not see the messages I transmit.</title>
<p>Answer: Follow the steps below<ol>
<li>Disconnect the BUSMASTER application.Then click &quot;option -&gt; controller mode&quot; if active mode is not selected please select it.</li>
<li>If baud rate is &gt;= 500 Kbps use 120 ohm terminating resistors between CANH and CANL at both end of cable between USB hardware and ECU (Tester).</li>
</ol></p>
</section>
<section>
<title>Question: BUSMASTER is able to receive messages but when message is transmitted application gives error?</title>
<p>Answer: Follow the steps below<ol>
<li>Measure the voltage between Pin 2 and 3 and Pin 7 an 3 of the SUB-D connector Pins of the PCAN-USB when system is idle.</li>
<li>If voltage is not around 2.5v then CAN Transceiver (Philips PCA82C251T) has got damaged.</li>
</ol></p>
</section>
<section>
<b>Question: BUSMASTER throws up an error saying BUSMASTER_Interface.h missing while compling. Why?</b>
</section>
<section>Answer: </section>
<section>Rebuilding the solution will solve the problem. When rebuild is selected, the visual studio will compile BUSMASTER.idl file and will generate BUSMASTER_Interface.h and BUSMASTER_Interface.c files.</section>
<section/>
<section><b>Question: Why Toolbar replay buttons are not active after changing the active window? </b>Answer: This is the intended behavior of the toolbar replay button. </section>
<section>This is because of the following functionality : </section>
<section>1. Add more than one log file for replay in Replay Configuration window </section>
<section>2. Select interactive replay </section>
<section>3. Connect to the network. Multiple replay windows will be displayed corresponding to the number of log files added for reply. If 2 log files are added then 2 interactive replay windows will be displayed on connect. </section>
<section>4. The replay toolbar functionality works based on the active interactive window. So making it general will not work. </section>
<section>Hence the tool bar is disabled. </section>
<section/>
<section><b>Question: After the Message Replay Window is closed, there is no way to have it back. </b>Answer:</section>
<section>In interactive replay method, the functionality of close button is basically stopping the replay. Hence the window will be closed and immediately the replay will be stopped. To get back the replay window, just disconnect and connect to the network again. No restart of application is required. Make sure, Interactive Replay Window option is selected in the Replay configuration window. </section>
<section/>
<section>
<b>Question:The files union.h are created each time BUSMASTER starts. Due to this, any previous manual changes in these files are lost.</b>
</section>
<section>Answer:</section>
<section>Unions.h file generated is intended to use with BUSMASTER only. So any manual modification will not be retained. If any additional changes or definitions are required then the same can be achieved by creating a new header file and referring it in the cpp file or modifying in the database file itself.</section>
<section/>
<section>
<b>Question:In Message window, close window does not work</b>
</section>
<section>Answer:</section>
<section>This is the intended behavior. Message window will always be kept open. If the window has to be hidden then uncheck the View --&gt; Message Window menu option </section>
<section/>
<section>
<b>Question:Error launching BUSMASTER. When BUSMASTER is installed and launched, error message &quot;The application cannot be started because the application config is not correct&quot; is displayed</b>
<p>Answer:</p>
<p>Install .Net framework 3.5 or above and try again. BUSMASTER has dependency with .Net Framework.</p>
</section>
</body>
</topic>
Loading

0 comments on commit 4af7669

Please sign in to comment.