Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,150 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,082 people online right now. Registration is fast and FREE... Join Now!




Mapping in C

 
Reply to this topicStart new topic

Mapping in C

boschow
14 May, 2007 - 01:03 AM
Post #1

New D.I.C Head
*

Joined: 7 May, 2007
Posts: 41


My Contributions
Hi,

is mapping used for linking two program's variables. I mean if i have program A with variable a1, and program B with variable a1. How do i know that the change of variable in program A also occurs in program B and the change of variable in program B also occurs in program A. Is this what is mapping used for ? If yes, what is the easyest way to "map" variables? What is the moust efficient way to write this tipe of program?

Thanks for your time and help
Best Regards,
BoSCHoW
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Mapping In C
15 May, 2007 - 05:34 AM
Post #2

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 523



Thanked: 3 times
Dream Kudos: 125
My Contributions
As far as i understand what you are trying to say the answer is no.
But you might want to elaborate and rephrase your question, and perhaps illustrate it a bit.
User is offlineProfile CardPM
+Quote Post

boschow
RE: Mapping In C
16 May, 2007 - 12:05 AM
Post #3

New D.I.C Head
*

Joined: 7 May, 2007
Posts: 41


My Contributions
Well lets say that i am programming a microprocessor and i also want to make a program for parametrisation wich can communicate with this chip through a serial communication protocol. This program would have access to all the parameters located in the microprocessor. My question is, how is this done and how do i know that for example the address 1 in the application is the same as in the microprocessor "if i write 50 in address 1 of the application, how do i know that address 1 in the microcontroller wil change to 50" ?

This post has been edited by boschow: 16 May, 2007 - 12:13 AM
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Mapping In C
16 May, 2007 - 09:22 AM
Post #4

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 523



Thanked: 3 times
Dream Kudos: 125
My Contributions
So you are aiming on a kind of shared memory.
A program on the microcontroller will use it, and an external program.
Is that correct?

The only way (as far as i know) to get exact controll of where a program stores variabeles is to program in assembler. But i might be wrong, there can be compiler constructs for it.

I programmed an embedded system a long time ago. Then I had the same problem more or less, but solved it differently: the program running on the embedded system also handeled the communication with the outside world.
When that outside world asked for stored data (some timestamps + numbers of personell badges) it simply took the data out of the in-memory datastructure (array of structs) and pumped it back through the serialport.
Worked flawlessly.

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 11:01PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month