How to realize communication problem?

Hello everybody.
I am working on a project in which I read/write data via rs-232 from/to my 
Windows application to/from an microcontroller. 
Now, my boss wants me to write a library which he can use for different 
microcontrollers. This library should store any changes of data. So the 
desired microcontroller should just be able to pick up the data. 

You can think of it this way: Me, representing the Windows application, put 
a sheet of information into a drawer. A buddy of mine, (representing a 
microcontroller) can go to the drawer an pick up the sheet for further 
treatment.

So, my question: How can I create such a library with such a kind of 
communication?
I've read any possibilites of interprocess communications, but in my opinion 
there is nothing of use to my problem, isn't it?

Help would really be appreciated. 

With kind regards,
Paul.
0
PaulC (24)
8/2/2005 1:47:08 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
661 Views

Similar Articles

[PageSpeed] 28

Paul C. wrote:
> Hello everybody.
> I am working on a project in which I read/write data via rs-232 from/to my
> Windows application to/from an microcontroller.
> Now, my boss wants me to write a library which he can use for different
> microcontrollers. This library should store any changes of data. So the
> desired microcontroller should just be able to pick up the data.
>
> You can think of it this way: Me, representing the Windows application, put
> a sheet of information into a drawer. A buddy of mine, (representing a
> microcontroller) can go to the drawer an pick up the sheet for further
> treatment.
>
> So, my question: How can I create such a library with such a kind of
> communication?
> I've read any possibilites of interprocess communications, but in my opinion
> there is nothing of use to my problem, isn't it?
>
> Help would really be appreciated.
>
> With kind regards,
> Paul.

It doesn't sound like you need to communicate between processes, so no.
Your boss would include your library in programs that needed it, but I
don't see a reason you'd need to include communication within Windows
into it (besides the obvious thing of communicating via RS232.

It sounds like you need to pick out which functions will be common
throughout the microcontrollers, create an abstract base class with the
necessary virtual functions, and then create the derived classes
(You've already got one I'm assuming) for the ones your boss wishes to
use. From there, you can just use the abstract base in the main source
of the code, and just set the derived class on initialization of the
program.

Josh McFarlane

0
darsant (187)
8/2/2005 2:00:03 PM

"Josh McFarlane" wrote:

> Your boss would include your library in programs that needed it, but I
> don't see a reason you'd need to include communication within Windows
> into it (besides the obvious thing of communicating via RS232.

I think I do not understand. Well, I've got an application in which the user 
can choose the microcontroller he/she wants to work with.
This microcontroller is connected to the pc via rs-232.

First I established communication with the CreateFile, WriteFile.....  in a 
thread.
In the software of the microcontroller which is written in C not in C++, I 
uses its interuppts to set/get the data. 
It worked all fine. Now my boss wants to use a library, which shall handle 
the used varibles. If they are changed they should be stored. 
0
PaulC (24)
8/2/2005 2:31:06 PM
I'm finding it difficult to follow what you want - I'm wondering if English
is your second language or if you have just found yourself dumped in the
deep end?

Maybe you're just talking about storing persistent data on teh PC that
multiple versions of microcontrollers will be able to query via the serial
port?
If that's the case, then save it in a file or the registry?  You app(s) will
change behaviour, if necessary, depending on the microcontroller that it
detects on teh serial port?

define the following and things will be a lot clearer:

"the data"
"library"
"used variable"
"changed"
"stored"

I'd recommend, if the task is not clear to you, to either get a spec from
your 'boss' or write one before doing any more work and get your 'boss' to
ok it before you continue.



"Paul C." <PaulC@discussions.microsoft.com> wrote in message
news:596DB01F-0DEC-4FBE-BBF1-447CB8036DD1@microsoft.com...
>
>
> "Josh McFarlane" wrote:
>
> > Your boss would include your library in programs that needed it, but I
> > don't see a reason you'd need to include communication within Windows
> > into it (besides the obvious thing of communicating via RS232.
>
> I think I do not understand. Well, I've got an application in which the
user
> can choose the microcontroller he/she wants to work with.
> This microcontroller is connected to the pc via rs-232.
>
> First I established communication with the CreateFile, WriteFile.....  in
a
> thread.
> In the software of the microcontroller which is written in C not in C++, I
> uses its interuppts to set/get the data.
> It worked all fine. Now my boss wants to use a library, which shall handle
> the used varibles. If they are changed they should be stored.


0
8/2/2005 2:43:31 PM
Well, english is my second language. But that is not the problem, I hope.
The problem is, that it is not what I want but what he wants. He  somehow 
insists of using a library for saving data and other stuff, which definitely 
do not work.

> Maybe you're just talking about storing persistent data on teh PC that
> multiple versions of microcontrollers will be able to query via the serial
> port?

Yeah, generally right. ;)

> If that's the case, then save it in a file or the registry?
Me, I wanted to do so. 

 
> You app(s) will
> change behaviour, if necessary, depending on the microcontroller that it
> detects on teh serial port?

Yes, some data variables won't be necessary for some microcontrollers.

> define the following and things will be a lot clearer:
> 
> "the data"                   
> "library"
> "used variable"
> "changed"
> "stored"

I am not sure, what you want me to do.
You mean, I shall write down for every controller, which data is needed, and 
so on?
> I'd recommend, if the task is not clear to you, to either get a spec from
> your 'boss' or write one before doing any more work and get your 'boss' to
> ok it before you continue.
 
Right, I am going to do this tomorrow morning! 


Thanks  - a lot. 

Kind regards. 
Paul
0
PaulC (24)
8/2/2005 6:32:03 PM
"Paul C." <PaulC@discussions.microsoft.com> wrote in message
news:3178A6E4-5D7B-4CB2-9E2F-44D62D6781CB@microsoft.com...
> Well, english is my second language. But that is not the problem, I hope.
> The problem is, that it is not what I want but what he wants. He  somehow
> insists of using a library for saving data and other stuff, which
definitely
> do not work.

But we don't know why it does not work because we have no details yet.

>
> > Maybe you're just talking about storing persistent data on teh PC that
> > multiple versions of microcontrollers will be able to query via the
serial
> > port?
>
> Yeah, generally right. ;)
>
> > If that's the case, then save it in a file or the registry?
> Me, I wanted to do so.

If by 'library', you mean a module that other apps can use, then the save to
file or save to registry is still appropriate.  Your lib file (or perhaps
dll) will just take care of all the file/registry saving so that others can
add in new microcontrollers without needing to know the details of how to
save the data (they just know that the data IS being saved on the PC by
calling routines in your library).

If by 'libary' you mean a repository of information, then you really do need
a specification that can be agreed on before work begins.


>
>
> > You app(s) will
> > change behaviour, if necessary, depending on the microcontroller that it
> > detects on teh serial port?
>
> Yes, some data variables won't be necessary for some microcontrollers.
>
> > define the following and things will be a lot clearer:
> >
> > "the data"
> > "library"
> > "used variable"
> > "changed"
> > "stored"
>
> I am not sure, what you want me to do.
> You mean, I shall write down for every controller, which data is needed,
and
> so on?

I actually meant for you to explain what each of these terms means to the
group, so that we can better understand what you want.  Although, your above
response will almost certainly be beneficial to everyone involved.


> > I'd recommend, if the task is not clear to you, to either get a spec
from
> > your 'boss' or write one before doing any more work and get your 'boss'
to
> > ok it before you continue.
>
> Right, I am going to do this tomorrow morning!
>
>
> Thanks  - a lot.
>
> Kind regards.
> Paul


0
8/2/2005 6:54:19 PM
"Joe Butler" wrote:
> But we don't know why it does not work because we have no details yet.

Well, let me try to explain. My boss wants the library ( a static library 
[.lib-file]) to 
handle the initialization and running of the UART of the microcontroller. 
Since this is just a library which cannot run routines due to the fact it 
does not have a main function it won't work. 

> If by 'library', you mean a module that other apps can use, then the save to
> file or save to registry is still appropriate.  Your lib file (or perhaps
> dll) will just take care of all the file/registry saving so that others can
> add in new microcontrollers without needing to know the details of how to
> save the data (they just know that the data IS being saved on the PC by
> calling routines in your library).

Like I said, a static library file is meant. So you are suggesting writing 
e.g. a function called ' void saveData(BYTE data)' which every app can use. 
This function saves it to a file. Am  I right? 

   "the data"         :  bytes transferred via rs-232; contains encrypted 
values for  the 'used variables'
   "library"            : static .lib-file
   "used variable"  : my variables, which contain lots of values of the µC, 
like voltage, current, ...... and variables which are used in the C-app of 
the µC
   "changed"         : with my application I can alter some values of the 
variables
   "stored"            : the changed values of the variables should be 
stored/saved

Paul.

0
PaulC (24)
8/3/2005 5:44:05 AM
I'm sure you've sorted this out by now, but there's a few questions in-line.

"Paul C." <PaulC@discussions.microsoft.com> wrote in message
news:E598BD9E-0342-486C-B792-ED89EB3DD150@microsoft.com...
> "Joe Butler" wrote:
> > But we don't know why it does not work because we have no details yet.
>
> Well, let me try to explain. My boss wants the library ( a static library
> [.lib-file]) to
> handle the initialization and running of the UART of the microcontroller.
> Since this is just a library which cannot run routines due to the fact it
> does not have a main function it won't work.

The lib file is compiled for Windows?
And the lib is supposed to supply a routine that runs on each type of
microcontroller?
Or the lib is supposed to initialise serial comms on the PC depending on
which processor is selected - i.e. some microcontrollers will be set up to
communicate at a slower baud rate than others, etc.?


>
> > If by 'library', you mean a module that other apps can use, then the
save to
> > file or save to registry is still appropriate.  Your lib file (or
perhaps
> > dll) will just take care of all the file/registry saving so that others
can
> > add in new microcontrollers without needing to know the details of how
to
> > save the data (they just know that the data IS being saved on the PC by
> > calling routines in your library).
>
> Like I said, a static library file is meant. So you are suggesting writing
> e.g. a function called ' void saveData(BYTE data)' which every app can
use.
> This function saves it to a file. Am  I right?

Essentially, but there are going to be details that need to be fleshed out -
such as:

- How the microcontroller is going to be sending the data: in a fixed format
block (structure) or as series of separate responses to multiple queries
originating at the PC, etc.

- How you know when you are reading back PC data that it goes to the correct
place on teh microcontroller.

- How to know the data is not corrupt.

etc. etc.


>
>    "the data"         :  bytes transferred via rs-232; contains encrypted
> values for  the 'used variables'

OK.


>    "library"            : static .lib-file

OK - a Visual C++ or MFC lib.


>    "used variable"  : my variables, which contain lots of values of the
�C,
> like voltage, current, ...... and variables which are used in the C-app of
> the �C

OK - so you want your microcontroller to get to a state where it can
communicate with the PC so that it can then ask the PC for specific
initialisation values that when received will be used to initialise the
microcontroller properly.  Is this a once-only thing at the factory, is is
to give different personalities to different units?

>    "changed"         : with my application I can alter some values of the
> variables

OK, so this gives the microcontroller some new parameters to work with.


>    "stored"            : the changed values of the variables should be
> stored/saved

OK, so is this so that when a unit is in the field you can query its setup
parameters or so that you can 'program' all teh other PCBs with the values
that work for that version of teh board.

>
> Paul.
>


0
8/4/2005 3:09:07 AM
Reply:

Similar Artilces:

A problem on Click()
Dear all, I have a form "F" on which there is a command button "B" and a textboxe "T". "S" is another string variable defined somewhere else outside the form. I want to have the value of the cell A1 in the sheet where its name is given in S changed to the value of T, what should I write in sub B_Click()? (For example, if "S" contains "Sheet1" while "T" contains "ABC", then I want Worksheets("Sheet1").Range("A1").Value = "ABC".) I don't know how to pass the value in "...

Problem with attachment forwarding
I'm running a exchange 2003 server with outlook 2003 clients. when a user tries to forward a mail with an attachment the mail will be sent but the receiver won't receive the attachment. in the sent items it will still show the attachment in the mail. any idea's? thx Vincent Is the attachment getting filtered from view? Are we talking any attachment, like a basic .txt file? Tested with plain text messages, too? I would look to antivirus first probably. Exchange does not arbitrarily strip attachments from email messages. "Vincent" <v.mast@action.nl> wrote i...

Outlook Mail problem
I recently got W7 on a new computer. The latest Microsoft Office version I had was 2002. Since W7 has no Outlook Express I installed Outlook as my email program. It seems ok but when I send an email to myself with a Web link, when I click on the link it opens the My Documents Folder and is looking for a .exe page instead of opening the web page. I have no idea how to change this. Any help very much appreciated. (I know I need an updated Outlook but cannot afford it right now) Thanks, Patti And is this dialog called "Locate Link Browser"? Point it to IEXPLOR.EXE or...

For those with IMF update problems
Just thought I would mention that you must use "Microsoft Update", not "Windows Update" in order to get the latest updates for IMF. Hope this helps some people out. -- Eddy - MCSE Hi Eddy, Thanks for your posting and especially appreciate the information that you shared. We value your presence here and look forward to working with you again in the SBS newsgroups! Here I just want to provide some related information for your reference: How to update the Intelligent Message Filter version 2 in Exchange Server 2003 SP2 http://support.microsoft.com/?kbid=907747 Hop...

Outlook 2002 send problem
I have a problem machine which can recieve email but cannot send email. The email is put in the sent items folder and they receive no error messages. I had them try the test button in the email accounts page and it passes all tests. Here is what I have dome so far: Reboot the machine Change the username and password to another known working account (same result) Went to another working machine and tried the account which would not work (worked fine) Checked for a firewall (none installed) Performed all updates and security patches. Everything else seems to work fine on the computer. Th...

Incorrect Realized gain/loss in money '02 reports
After inputing my investment info into money, i went to look at some of the reports that it provides. On one of my inv. it shows a realized gain of $18.45 THIS IS FALSE as i have been keeping everything in Excel spreadsheets. It should be $218.45. I enter all info into the transaction area and have entered a "activity" of sell which should have generated a $218.45 profit. Money know what i payed for the stock and what i sold it for. I really dont want to go back to Excel but if this is the best money can do then i guess i'll have to. I cant deal with incorrect informatio...

Problem with window contract
Hello, I bought a new computer and installed Office 2003 with their CD, all right. Now every time you start some programs (Outlook, Word, Excel ...) asks me where the window of the license agreement where I have to put Accept or Decline. If you refuse to put the window closes... if he continues to take place normally, but when I close and restart the program it shows me the new window. Can someone tell me how to solve? Thanks First link http://www.google.com/search?hl=en&source=hp&q=must+accept+office+eula&aq=f&oq=&aqi= Trust wrote: > Hello,...

A problem occured while microsoft access was communicating with ole server or activex control
Hi Everyone ! I have a developed a database on Microsoft Access 2000 small businesses, and when I have upgraded my system to Microsoft Access 2003, everytime I try to open a form or close a form with an event OnOpen / OnClose, I get this Error : "OnOpen: A problem occured while Microsoft Access was communicating with the OLE Server or ActiveX control." Even when have an empty OnOpen event (no code inside the sub), I get this problem. I searched the entire web and I couldn't find an answer. I don't have norton anti virus on my comuter !!!! Can Someone please help me ? Ode...

Problem Stationary
Hi Folks: I'm using Office/Outlook 2003-Pro. I'm not sure if this is the right Outlook group but . . . . I have a few customers that use double spacing, a light blue background, and a medium blue font, and "signatures" in a 24 point font - it's very hard to read and makes for a very long message. Is there some way to tell Outlook to automatically single space, cut the background, and use a 10 pt fornt for everything on all messages?? Thanks much You can set the option to read all messages as plain text as explained here: http://support.microsoft.com/kb/831607 ...

CPrintDialogEx problem
Hi, I've started using the Ex version of the print dialog. All has been fine until I've pressed the 'Apply' button. The only thing showing on the call stack I can see is: if (bCallDefault) lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam); in: _AfxActivationWndProc(..) with oldWndProc == NULL. And the error is: Invalid Address specified to RtlReAllocateHeap( 00150000, 00757250 ) Unhandled exception at 0x7c901230 in ars.exe: User breakpoint. So, I figured I wanted notification of 'Apply' and copied the CPrintDialogEx stuff to my own files and re...

CRM and Exchange Problems
Dear All, i have a problem between CRM and exchange, my setup is as follow:- i have a single computer with Windows Server 2003 installed, Exchange 2003, and CRM 1.2, CRM is working just fine, the samething is with Exchange OWA, however, i can't get CRM to send mails throught Exchange, i've installed the Exchange E-Mail Router but with no success, is there is any kind of incompatability between CRM and Windows or Exchange 2003, is there is any guide to follow to solve this? Thanks in advance GQ ...

Problem:windows CE image by jumping to address
Hi All, We have a customized board with 64MB SDRAM and 256MB NAND flash, where we can successfully booting the OS image from flash and running on SDRAM up to 16.7 ~ 16.9MB NK.bin size. If the OS image size is > 16.9MB it's unable to jump to the launch address. The system is hanging by displaying the launch address which we seen in NK.bin file format. Is anything wrong in our BSP for the OS image size > 16.9MB? How you are parsing the NK.bin during the booting? Are you copying the entire NK.bin to a portion of RAM from NAND Flash and parsing it? if yes...

Date problem #4
I am trying extract just the year from a date, ie the cell would contain - 29/04/2004 Now if I go =Right(B2,4) in the hope I get - 2004, I end up with the date code. How can I get around this? I have tried all sorts, from pivots to pasting specials. Many thanks in advance John Ps even if it needs some VBA, (but at a last resort) Hi try =YEAR(A1) an format the cell as 'Number' or if you want a text string use =TEXT(A1,"YYYY") >-----Original Message----- >I am trying extract just the year from a date, ie >the cell would contain - 29/04/2004 >Now if I go =Right...

fax feature problems
To send a fax I went to help, and followed their instructions. Unfortunately, I don't get at all what they say. I use OL 2000 Internet mail only. File-> new fax. I get an error message. MS OL cannot use Symantec Fax Starter edition for sending and receiving faxes. This feature is not currently installed. Would you like to install it now ? -> yes -> installation complete. You will have to restart OL . I do. I get another error message : Coding error [] should not be referenced in Key [HKEYUSERS\]. That is a directory, and I don't know enough to go there. Then I get &...

Print Preview Problem
Why is it that when I do print preview of a some pages of my booklet, other pages clipart and textboxes appear - although when I print it as a PDF or reg printer copy, it does not come out that way on the page? When you do a print preview you are viewing how it will print, not as laid out on the screen. If you have an eight page booklet, in print preview you will see page 8 and page one, page 7 and page two, and so on. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Kath" <Kath@discussions.microsoft.com> wrote in ...

problem in document libraries in variation enabled sites
Hi, I am facing a strange problem in my sharepoint multilingual intranet site. I have enabled multilinguality by the usage of Variations feature. So, the main site is divided into two parts - English(en-US) and Chinese(zh-TW). The problem concerns with document libraries only. A blank document library in any subsite of the english site should display the message "There are no items to show in this view of the 'Documents' document library. To create a new item, click 'New' or 'Upload above". But strangely this message is displayed in Chinese. All ...

Fix My Post Update Online Financial Services Communication Error!
After many attempts and many phone calls to MS Money Tech support I finally got my old MS Money 2005 file to load with the new automatic update. I was experiencing all the same problems everyone else was, while converting the old file I got the Online Financial Services communication error…….etc, etc. At least for me, my problem was because of a closed account that was setup to be used with MSN bill pay. (I used MSN Bill Pay at one point but stopped using it a while ago.) I simply changed the Financial Institution on the closed account from MSN Bill Pay to something else and the file c...

Problems with windows rights management client
I've installed Windows Rights Management Server on a windows 2003 server and it appears to be working fine because I can go to the administration page. But I'm having problem with the client portion. I've installed the "windows rights management client 1.0" (msdrmclient.exe) and the "windows right management add- on for IE" (rmusetup.exe) on my Windows Xp (sp2). I use Outlook 2003 with an exchange client to an Exchange 2003 server. I then create a new message in outlook and click on the 'permissions (restricted)' icon and I get this message: ...

Installing Office 07 on Vista (Problem Encountered)
My previous version of office corrupted and won't run, now when I try to install a new version to the same location it fails. I cannot uninstall the older version because it is corrupt - I was wondering if there is a walk-through for a manual uninstall or some support I don't have to pay $40 for. "Karl Neumann" <Karl Neumann@discussions.microsoft.com> wrote in message news:E653F052-BEA5-419D-AF5C-047A2D6FFF21@microsoft.com... > My previous version of office corrupted and won't run, now when I try to > install a new version to the same location i...

.XValues syntax problem
I am writing a macro that includes assigning x-values from the third column of Sheet 1 to the active chart: ActiveChart.SeriesCollection(1).XValues = Sheets("Sheet1").Range("C2:C105") However, when I change the range-referencing to cells-style, I get an error: ActiveChart.SeriesCollection(1).XValues = Sheets("Sheet1").Range(Cells(1,3),Cells(105,3)) The error says: "Method of 'Cells' of object '_Global' failed Does the XValues argument not take Cells-style referencing? I ask because what I really want to do is assign a variable to the ...

Excel 2003 printing problem--printing 1 document on 2 pages
Hi All!! I looked through the printing probs section and didn't see anything like this....but I KNOW someone will be able to help with this. We have a legal size spreadsheet with .7 left/right margins----it prints fine for most of us....but I just emailed it to one of our branches and it prints on 2 pages---half left and half right.... I spoke with the person trying to print this and we went through her page set-ups and they all seem to be fine....her printer set-up also seems to be correct....ANY ideas as to why this would happen and how I can walk her through (over the ph...

Problem opening a Dialog
Hi, Im trying to develop a Dialog based application. I have some buttons and when I hit a certain button I'd like to show a certain dialog. For every dialog that I want to open I have a variable CDialogN m_DialogN And use the DoModal method. Some dialogs give me a problem. When I close application without opening any dialog I got a "memory error" (memory can't be "read"). If I try to open the dialog I got a Debug assertion failed (line 52). The problem must be in deallocation the class resources but those classes are like the others and I didn't have this p...

problem inserting photo in publisher
when i insert photo from file the photo is blank in publisher Based on Publisher 2000; I'd look at View, Picture display and/or Control Panel Display, Settings, Advanced, Troubleshoot tab, and lower the acceleration setting. -- Don Vancouver USA "jj" <jj@discussions.microsoft.com> wrote in message news:8B473DE7-5794-409E-821B-0B0BD18A8E10@microsoft.com... > when i insert photo from file the photo is blank in publisher How are you inserting the photo? -- JoAnn Paules MVP Microsoft [Publisher] "jj" <jj@discussions.microsoft.com> wrote in ...

UML Interface realization arrow
Anybody knows how to draw a realization arrow in a static UML model? Right-click a Class shape and select Shape Display options. Check the "Realization" box and ok Drag the yellow center arrow and connect it to an Interface. -- -ronnie [MS] This posting is provided "AS IS" with no warranties, and confers no rights. "Interface realization arrow" <c-basarim@avanade.com> wrote in message news:531101c356f1$c8098500$a001280a@phx.gbl... > Anybody knows how to draw a realization arrow in a static > UML model? ...

Migration Problem
I was recently brought into a shop that wants to migrate from Windows NT/Exchange 5.5 to Exchange 2003. They have several NT servers in a domain, and several Windows 2003 servers with AD. They are running Exchange 5.5. They have a 2 way trust between the 2 domains. There are about 180 users on Exchange, some login to the old NT domain, some login to the new AD. I began the migration process by installing a new Windows 2003 SP1 server, applying all of the patches. I then proceeded to follow the migration process using the migration tool (first 2003 server into a 5.5 environment). Everyth...