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
874 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:

Exchange or ISA problem?
I installed a new ISA 2004 server and every thing appears to be working except for my mail. I am using exchage 2003 and when I send to external email addresses I get the following : xxxxxxx on 11/5/2006 3:26 AM You do not have permission to send to this recipient. For assistance, contact your system administrator. <sever #5.7.1 smtp;550 5.7.1 <jo7@msn.com>... Relaying denied. IP name possibly forged [the ip address of my external network]> Hi, I would guess that this is a DNS problem. Your MX record does not have the same IP address as the external IP address of your...

Problem with TransferSpreadsheet in Access 2007
I'm having a problem with the TransferSpreadsheet method in Access 2007. The TransferSpreadsheet method is exporting a query to Excel, and it has been working fine under Access 2002. Under 2007, however, Access seems to truncate up some of the query column names, with the result that Access doesn't recognize them and prompts me for values for those columns. The problem is reproducible, occurring on the same columns every time. If I open the query directly the column names are fine and it exports to Excel with no problems; it seems to happen only with the TransferSpreadsheet meth...

Problem with GetWindowRect
Hi All, I am trying to create a MFC application with Re-sizable PropertySheet. I have followed the following MSDN article on how to create a re- sizable PropertySheet. http://support.microsoft.com/kb/325613 But my problem is, it all works well in debug mode. When its in release mode the GetWindowRect or the GetClientRect for that matter, returns some insane values. I am wondering what the problem might be. While i was searching for this, i found a thread where one person had this same problem with GetWindowRect in release mode. But atleast he said he used to get some error when h...

Boot problem 03-04-10
I have a boot up problem with my xp pro. I shut my computer down at night and in the morning I get a grey screen at boot up, before anything shows. I can hear the computer going thru the startup process with nothing showing on the screen. After turning it on and off many times, including using a dos boot disc (which doesn't make a difference) it will finally boot. (a twenty-five minute process). Once it is running I am able to restart without any problem. It only happens after several hours of being shut down. I have run diagnostics on the hardware, monitor, graphics card and...

DrawThemeBackgroundEx ---- problem
Hi Our application, is a drawing software developed in MFC in VC6. My problem is that the application is crashing when i maximize the application in Windows XP theme. It works fine in XP in Windows classic theme. I traced out that uxtheme.dll ( C:\WINDOWS\system32 ), function DrawThemeBackgroundEx is deleting a pointer which i use in my application. I never call any function DrawThemeBackgroundEx.... How can i block the call to DrawThemeBackgroundEx??? Pls help >Our application, is a drawing software developed in MFC in VC6. > >My problem is that the application is crashing whe...

outllook 2003 shutdown problem
Whenever I try to close out of Outlook 2003, the Outlook icon remains active in the taskbar. When I put my cursor over the icon, it says that Outlook is not responding and to close it out with task manager. Once I do that and re- start Outlook, I get the message that it needs to start in "safe mode". What could possibly cause Outlook to not shut down properly? I have used the Office repair utility, but to no avail. ...

email problem
i am having a problem when i open my email, a window comes up asking for a password even though i have already entered it in the window where you save it so you don't have to keep re-entering it. I have tried creating a new identity and a new password, and no luck. Please help. I am having the same problem. If you find out, please post the resolution (and I'll do the same if I find out). It's driving me crazy! >-----Original Message----- >i am having a problem when i open my email, a window comes >up asking for a password even though i have already >entered i...

Server maintenance
Greetings: I've recently installed an Exchange 2k3 Server and was wondering what kind of maintanence needed to be performed and at what intervals to keep the server in tip - top shape. We have less than 20 users and some even hook up through POP3. Let me know if I can provide additional information. -- Regards, Jerry M. Gartner There really shouldn't need to be any periodic maintenance. There are your standard monitoring tasks that need to take place (check event logs, etc.), but Exchange performs online maintenance on a nightly basis by default. This optimizes th...

Problems with Exchange across multiple domains in same forest
Hey all, hoping I can get some help here: 1. Unable to view GAL for separate domain in same forest. Full GAL shows up in ESM but not in outlook. GAL that does show will update as new users added to first domain, but not second domain obviously. 2. Unable to authenticate to exchange server from second domain when setting up exchange connection. When setting up exchange connection using a user from first domain exchange works fine. Any help appreciated! -- ____________________________________________ Scott C. Reynolds - Tales From the SharpSide http://www.scottcreynolds....

Problems
How do I disable the Money 2002 function that tells me that I have a duplicate entry when I download my transactions from my banking website? It's always wrong and is really irritating. ...

Problem with upgrade to Win 2K
Upgraded to Win 2k and now my Outlook 97 will not open.. there is an error message: ordinal 36 could not be located in the dynamic link library MAPI32.dll What is the matter? I have had a microsoft problem weekend related to microsoft products and upgrades... Someone suggested that i use LINUX Op Sys.. No way.. I am a die hard Microsoft person.. Any suggestions? thanks.. Have you tried uninstalling/reinstalling Office/Outlook 97? If push comes to shove, you could try reinstalling MAPI. http://support.microsoft.com/default.aspx?scid=kb;en-us;172350 covers the files that make up MAPI. H...

PIN problem
I've been using Money 2005 Premium successfully for a couple of months now. Yesterday I was able to download quotes and bank statements without a problem. Today I get a previously unseen error message telling me: "Money encountered an internal error while attempt to save or clear a PIN number in your Money file." I haven't changed any user ID or password settings and my passport sign-in info is also unchanged. I've attempted to restore my Money file backup from yesterday and get the same error on it. I've also reinstalled Money. Ideas? Thanks, zender A...

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? ...

562 problems
I came here looking for an answer for a simple problem. I have the new Outlook 2003 and it will receive email but it won't send. But, I see there are only people here looking for answers. Does anyone have answers? You're using the Web interface to access the newsgroups -- are you clicking the plus sign next to each question to expand the thread and see the replies? (Of course, if you're not, you probably won't see this reply either...) -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup ...

Outlook Express Problem with Attachments
I'm trying to send .jpg images with outlook express but it sends the message out in 17 parts with no image received at addressee. What's up!? Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news groups. You can also find some good Outlook Express information here: http://insideoe.tomsterdam.com --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest vi...

Printout Problem error 2501
Hello - I've created an application in access 2003, installed it on another computer that has the following configuration: Windows XP, Office 2007, Access runtime 2003, and I've removed the access 2007 from the office package. The following error happens when the user is trying to print a report. "The action Printout was canceled, Error 2501" A message of the error handling that I've created focuses the problem on the Function "PrintNormalTas" which has the following code lines: DoCmd.OpenReport sReportName, acViewPreview, , sFilterCriter ...

Problems Exchange 5.5
I greet , I have problem. Situation is following: If on one of servers on which the exchange stands the user be put the X , and on different server the list distributional ( from expansion the server: any), which owner is the user the X , This in outlook user X has not right to modification users' letters. It between servers be put "directory replication" Regards Pawel On Thu, 20 Jan 2005 11:11:20 +0100, "P***" <prap@op.pl> wrote: >I greet , I have problem. > >Situation is following: > >If on one of servers on which the exchange stands t...

Problems with Controls Embedded in Worksheet
When I embed a control (eg Command Button) in a worksheet (even on a totally blank workbook), it drastically slows down the time taken to execute commands such as print, print preview, file close. As soon as I embed a contol (which in itself has become slow), and then for example select print preview of a range (including a range that does not include the embedded control), the print preview page takes approx 15 seconds to appear and the same delay will occur when closing the preview page. The execution of macros associated to the embedded control appears unaffected. thanks for any help Chri...

Help with unusual table problem
I would like to be able to add additional data to a table of approx. 2 rows and 4 columns. I would also like the newest data to be on to while the remaining 19 lines all shift one row down and the leas current row of data to drop off. I hope this explains my problem. Thanks, Howd -- Message posted from http://www.ExcelForum.com Not sure if you might have missed my suggestion to your earlier post yesterday in microsoft.public.excel. ( http://tinyurl.com/239sq ) Based on your "revised" specs in this post: Let's say your table is in Sheet1 in A1:D20 [assume an initial tab...

Outlook 2003 & Hyperlinks Problem
Windows XP Pro Outlook 2003 When clicking on a hyperlink in an email message, IE6 opens two duplicate windows opening the same exact web link. Any solution or suggestions for this? I've read the numerous posts about hyperlinks and Outlook and have performed all suggested solutions, but haven't found any messages or solutions for this particular case. Most of the posts about hyperlinks and email have been that IE opens a window and remains blank or IE opens a window with the incorrect web address. Please help. ...

Excel default number format problem
I have a user with an incorrect default cell format in Excel. His default number of decimal places for a cell with numbers is set to 4 instead of 2. I have no idea how he caused this and I have no idea how to correct it. In case I'm being ambiguous, here is the procedure: Open a new Excel workbook, choose any cell and go to Format. In the Format Cell dialog box go to the Number tab and choose the Number category. The Decimal Places box will be set to 2 by default but in this user's Excel it is set to 4. How do I get it back to the default of 2? http://www.imagedump.com/index.cgi?pick...

Problem - Extension SMTP
Hi, I have a problem: when I open IMS Properity show the message:Extension SMTP could not be loaded. The specyfied module could not be found. Microsoft Windows NT ID no: 0xc002007e. What I must do whit this problem? Thanks for help Hi, Try this: http://support.microsoft.com/default.aspx?scid=kb;en-us;186787 Regards, Tim "still" wrote: > Hi, I have a problem: when I open IMS Properity show the > message:Extension SMTP could not be loaded. The specyfied module could > not be found. Microsoft Windows NT ID no: 0xc002007e. > What I must do whit this problem? > Tha...

Excel problem #2
When I start excel is wants to open all the files in the directory automatically. This is a big pain, is there anything I can do outside of removing Office 2000 and reinstalling? Thanks in advance Excel will open all the files in your XLStart folder and all the files specified in: Tools|Options|General Tab: "at startup, open all files in:" <xl2002 wording> "Alternate Startup File location" <before xl2002 wording> Erase what you typed in there. (don't delete the files/folder--just the reference to it.) Sport wrote: > > When I start excel is...

Stacked chart problems
I'm using 2007 Using Jon Peltier information found below I'm stuck. http://peltiertech.com/Excel/ChartsHowTo/ClusterStack.html I have arranged the data as necessary for the stacking (rahter than three I have seven). I need to change the axis labels. However, I'm stuck because the directions state to Paste Special the data as a new series (and I can't paste special in 2007) and also confused how to to move series information to secondary axis. Any help would be appreciated. Thanks in advance. Paste Special works the same in 2007 if you can find it. Click on the down ...

SendKeys syntax problem
Can anyone please help. I am performing a search, that part of the code is working fine. When my result cell is activated, I would like to select both it, an the cell to the immediate right of it. I've tried using SendKeys, but I'm having difficulties with the synta obviously. Code ------------------- Application.SendKeys +("{RIGHT}" ------------------- I'm using the "plus"sign "+" for the SHIFT key to hold and select, bu I'm obviously writing the {RIGHT} portion of the code incorrectly, as get a run time error. Any assitance would be much ...