Hello, I want communicate with my lpc2368 by the Ethernet port using an application whose create with visual basic. It is possible ? How ?
Thanks,
Mickael
Did you start your day by asking this question, or have you spent some time thinking about this problem before you asked the qeustion?
Do you believe that the ARM chip isn't VB compatible? Or that VB can make ethernet-capable applications as long as the other side isn't based on an ARM chip?
Please come back with a bit of information why you saw a need to question the possibility of interfacing an LPC2368 with a VB program.
How to do it?
Get a TCP/IP stack for the ARM - either buy from Keil, or try using any free stack. Read through the example code for the choosen stack. Write an application.
Write a VB program that can communicate with a PC program using Ethernet.
Connect the ARM hardware to the PC and change the IP number and possibly port number in the VB program and communicate with your ARM hardware instead.
I know it is possible to establish a connection between two PCs over ethernet but with the LPC2368 I did not know.
I look all day if it were possible and I found nothing, so I wrote on the forum.
I have a TCP / IP stack ... So I can make a VB application? The PC must be configured as a server or client tcp ?
I am french, so excuse me for my bad English.
Thanks for your help,
The datasheet for the LPC2368 says it has ethernet support. That implies that it must be possible to implement a network-capable program using the LPC2368. If you implement a web server (also available with the example code for the Keil stack) then any web browser can connect to the LPC2368-based hardware and fetch web pages.
The VB application is a PC application. Your PC already have a TCP/IP stack.
It is for the ARM side you need to get a TCP/IP stack and then write an application that makes use of this stack.
You, as designer, have to decide if the PC is the client or the server. This directly follows from what type of problem you are going to solve.
When starting a project, YOU must sit down and think about what you want to solve. Then you must break this down into individual requirements. Then you can look through these requirements and try and figure out the possible problems that you must look into, before you commmit to the design.
A web forum can help when you get stuck, but YOU first have to spend time on your own.
I don't want to integrate a web server in the lpc2368 but write and read in memory of lpc2368 since my PC using a VB application and communication ethernet.
I look throughout the week on the internet but I found nothing of this subject.
As I said earlier I have already make an ethernet communications between two PCs but I was writing code on two PCs with VB. With the lpc2368 I can't write code in VB. That is why I ask is forum on how I should proceed?
Really?!
Just look around you; you are surrounded by very many different devices that all talk TCP/IP: Your PC (whether Windows or not); Macs; mobile phones; the management interfaces on routers, etc, etc, etc - you can even get a web-enabled toaster:
www.roke.co.uk/.../27.php
The one common thing that they all share is that they all speak the TCP/IP protocol - so long as they do that, it is entirely irrelevant what language they are programmed in, and what processor(s) they contain.
Exactly what did you spend the week searching for? There are a lot of information on this forum, and the NXP forums in case you searched.
1) Get a compiler for the ARM. For example Keil or gcc. Keil is expensive and the evaluation version will not do because of the code-size limitations.
2) Get a TCP/IP stack for the ARM. For example Keil. Or search on this forum (or on the net) for suggestions about available free stacks, or free OS with included stack, for these processors. If you can't afford the Keil compiler, look for free code supported by gcc (I would guess most/all free ARM code does).
3) Collect all sample code you can for the OS/stack and read it at least twice.
4) Write application using 2 and compiled with 1.
5) Load into hardware and test.
6) Test/update repeatedly until it works.
7) Post questions to web forums if you get stuck.
Is that you on that picture, Andy? :-)
ouch, I did not see the reference to the person's name under the picture...
I must write code in VB and load into memory lpc2368?
And after a vb application on my PC that communicates with the lpc2368?
Do I use the sockets?
You must write a PC application in whatever language you choose.
You must write a LPC2368 application using any language you are able to find compiler + TCP/IP stack for. Primary choice to look for: C or C++.
No: There is absolutely no way the LPC2368 can run any VB program. Visual Basic is for developing applications running on M$ Windows machines. The LPC2368 is not a x86-compatible processor with capacity to run Windows. And it is way too small to be able to emulate an x86 machine.
If you search, there is a little chance that someone have released a BASIC interpreter solution for the LPC23xx chips, where you may run BAISC (but not Visual Basic) applications in a LPC23xx chip. But this is of no value to you, unless said BASIC interpreter also contains an API for network communication.
"Do I use the sockets?" The function names to do different operations will differ between different TCP/IP stacks. But since TCP is a protocol, and IP is a protocol, you don't have much options. You must use the networking primitives that are available in the TCP/IP protocols to implement your networking. If you don't, then it will not be TCP/IP - even if you use ethernet as electrical carrier. And that would also imply that you would have to look into writing a new networking stack for your PC too...
If you don't care about safe, connectionbased delivery, then you may use UDP instead of TCP. But no difference. You must make use of the primitives available in the stack. If you do not, then you will not be able to communicate between PC and LPC23xx.
"Is that you on that picture, Andy? :-)"
Try http://www.8052.com. Find post by Andy. Visit his home page.
If you want to use Microsoft development tools - look for a platform using Windows CE.
A quick search seems to indicate that Windows CE supports the following processor instruction sets: ARMV4I MIPSII MIPSII_FP MIPSIV MIPSIV_FP SH4 x86
Or take a look at this:
www.digi.com/.../digiconnectme.jsp
A complete, ARM-based platform, and supports the .NET Micro Framework
I search the forum if someone had already made a application BASIC for Lpc23XX but I found nothing.
If I understood I must write a code c in the lpc then a code in VB in my PC. Both will they communicate?
Thanks, Mickael
It does not matter if you have different programming languages on the two sides. The networking protocols are still the same.
If they will communicate - now that is a quation about your skills. I can't answer if you will manage to write two working applications or not.
I am able to write two one vb application on my computer and the other on the c lpc2368 but I did not think it was possible to communicate with two different language. Is that someone has knowledge in one of its language to give me a track on the method used?
"If I understood I must write a code c in the lpc then a code in VB in my PC."
No, you misunderstand.
There is no specific requirement to write in any particular language on either platform!
The one and only thing that matters is that both devices use a compatible protocol.
You can implement that protocol using whatever language(s) you like - if the implementations are compatible, then they will communicate; if they are not compatible then, by definition, they will not communicate.
However, the choice of available languages will be more limited opn the LPC - and 'C' is likely to be the most widely available.
The choice of languages on the PC is much wider, and VB is just one of them.
I thought I was quite clear about your options:
"You must write a PC application in whatever language you choose.
You must write a LPC2368 application using any language you are able to find compiler + TCP/IP stack for. Primary choice to look for: C or C++."
It should be quite clear from the above, that the language used on the PC side and the language used on the LPC2368 side can be different.
I think you may have confused computer languages.
A computer language is a description language to tell a processor what to do. But when communicating between two programs, you normally do not send your "computer language" to the other side.
The program on one side builds a message consisting of bytes of data in a pre-defined format and sends to the other side.
The other side runs its program (possibly written in another computer language) picks up the message and extracts the individual bytes and then performs actions based on the message contents.
I want to use the TCP / IP. I am indeed choose the language Vb on my computer. And it will require that I use the C language on the LPC.
VB on the method used to send a frame on TCP / IP and sending socket but with c I don't know how do this.
In any TCP / IP application there must be a client and a server. In my case I can't decide who should be the server and the client ... The PC or LPC?
Can you help me?
There is no requirement that you must use C on the LPC side. But it is easier to find a C or a C++ compiler than it is to find a Pascal, Algol, Ada, C#, ... compiler.
Should be trivial to figure out which side is the server.
What is the link intended for?
Requesting configuration? Then the server is the PC, and multiple embedded systems connects.
Retrieving measurements? Then the board is the server, and the PC side has a list of IP numbers to connect to - one for each embedded unit.
Pushing of measurements? Then the server is on the PC side, and the embedded unit connects and sends in measurements.
If you do not know what the link should be used for, then you do not need the link in the first place...
"And it will require that I use the C language on the LPC."
This may now just be that English isn't your native language, but it does not require that you use the 'C' language.
It is, however, quite likely that you will choose to use 'C'
"with c I don't know how do this"
You will need to read the documentation for whatever TCP/IP stack you choose.
" can't decide who should be the server and the client ..."
Nobody can decide that without knowledge of your application!
If this is a school project, you seriously need to discuss this with your tutors - you are clearly well out of your depth, so you might be following completely the wrong path for this assignment!
At least your tutors will be able to help you in your own language!
It is for my job. So I want to use C because I already use this language to program the LPC because it is made to a regulator for heat pumps.
My VB application must be able to read and write in the registers of memory.
That's why I need to determine if the PC is server or client ..
Sorry for my bad English Thank you for your help Mickael
Then you really need to get some training!
If it's urgent, you need to hire a Consultant.
I have a supérior technician license. I have strong knowledge in VB and a little bit in C. It's just that I could not understand how the stack tc / ip I had more information thanks to you Thank you
I will try to find which should be the server PC or LPC ..
If you are going to use the ethernet connection similar to a serial connection, where the technician connects his laptop to the heat pump, then it is likely that the technician initiates the connect, i.e. the PC is the client.
If the heat pump is the client, then it would have to constantly try to connect (and fail) until a PC finally gets connected.
Not only that - if you want to be able to control/reconfigure multiple heat pumps that have fixed IP on the internet from "any" computer, then the heat pump will be unable to know the IP number of that "any" computer. Hence, the heat pump must be server and given a fixed IP.
The alternative is that you don't have technicians who connect to individual heat pumps. You may have a central server that monitors multiple heat pumps (where each heat pump must be connected on Internet). Then each heat pump should be a client and be configured to know the IP number of this central server.
But the person who hands out the money for the project must have a document that describes what the expected result should be of this project. From the requirements in that document, it should be obvious which side is client, and which side is server. Figuring out which side is client or server is one of the smallest decisions in this kind of projects. Most people make this decision in their heads before even starting to put down the actual requirements of the system.
It may be worth it to consider a consultant for this job - someone who have ample knowledge would be able to implement a well-working solution in much shorter time. Getting a working product in a shorter time will offset the higher hourly charge for the consultant. Since the consultant is likely to consume less hours, even the work cost may be lower if a consultant is used. Just make sure that you have a copy of the tools needed to build the project, so you know that you can update the system even five years from now.
My provider is getting a TCP / IP stack. I will look at the documentation when I provide it.
In fact I find it hard to understand how the TCP / IP stack ...
But it is now clear to me that the heat pump must be server. Because it does not know the IP of each different computer that will be connected to it.
the person who hands out the money for the project do not know if I should configure the server or client because it has no knowledge of TCP / IP or VB.
In any case I thank you for your help I have been very beneficial.
Thank you, Mickael CHAPUIS
"the person who hands out the money for the project do not know if I should configure the server or client"
This is a design decision; It's not his (or her) job to do the design - that is your job (presumably?)
But it is his job to specify the requirements for this system; then you, as designer, decide how to meet those requirements - and one of those design decisions is whether to make it a client or server.
" because it has no knowledge of TCP / IP"
Neither, it seems, do you.
You really should be considering a consultant for this job!
"You really should be considering a consultant for this job!"
Sorry i am french and i don't understand what is a consultant ?
Sorry.
A Consultant is a person who is skilled & experienced in the field, and will assist you - or do the job for you - on a contract basis.
Keil has a list here: http://www.keil.com/condb/
NXP also has a list.
Your stack supplier may well also have a list.
No doubt there will be local trade directories that you can consult...
Thank you, but I think I'll always get there alone. A test of strength and perseverance I will succeed. I know the VB language and I already made ethernet communications with a machine so I will be successful with the lpc2368. In any case thank you for your help I did well on my subject. First I know that my project feasible and Second and I know he must be my PC client and the server lpc2368. I already find codes c tcp its server will operate ... I have to be tested.
VB knowledge may not mean too much when it comes to the LPC2368 side. A normal PC has about 10,000 times more RAM than the LPC2368 (yes - ten thousand times!), so a networked application in the LPC2368 must take this into consideration.
"A test of strength and perseverance I will succeed."
But is it worth it? If you spend 3-5 times as much time as the consultant, the total project cost will be affected, and the delivery time. It also affects the quality of the program, i.e. future maintainance costs.
This isn't a decision for you as developer, but a business decision for the company. Is it worth it to invest in your schooling, or is it better to get a well working application within a limited time frame.
Do not worry about the company everything will be done in the details. I do not know too much but my tutors c projects know very well. verrz you what he has already done with the lpc2368 you would be surprised. But he did not know too many TCP / IP and no knowledge of VB. That's why they call me. So we should get there. In addition our subcontractor is development expert and he will set the TCP / IP stack so it will surely help us in the party lpc. For the PC party I have very great knowledge in VB I will be able to make a nice application.
Best regards, Mickael
View all questions in Keil forum