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,
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
If by chance someone has already done a similar project to mine I am on your listening if you have any tips or leads.
Thank you, Mickael
Is what someone can explain what really has the TCP / IP stack ?
Thanks
I don't think anyone understand what you mean by:
"Is what someone can explain what really has the TCP / IP stack ?"
Is there a particular reason why you want to use ethernet rather than USB or plain, old RS232?
I certainly didn't!
But I thought you said your subcontractor was an "expert" - and they would sort your stack for you...?!
What really do the tcp/ip stack ?
I want to use Ethernet because there is no need for the module as serial port for example. in addition everyone has a ethernet cable and I was not on my USB lpc ...
Yes were experts and they will schedule me my stack but I understand its operation after power to put my code in C inside
A TCP/IP stack is a large block of program code that implements the networking functions. It sometimes - such as in your case - also contains the hardware mapping (driver) for the specific hardware.
Why named TCP/IP stack? TCP is a transfer protocol. IP is another transfer protocol. Stack is the name used for a specific module in a layered solution - each module forms its own layer.
The TCP/IP stack contains a long list of complex logic for (not complete list): - listening on incomming connections - connecting to other hosts - requesting translations from a host name to an IP number. - verify that received messages are addressed to your unit. - verify that received messages are not damaged. - perform resends if a message was lost or broken. - acknowledges the reception of messages. - sends ARP questions to find mappings from IP number of MAC address. - responds to ARP requests by telling your MAC address". - often supports dynamic requests for IP numbers using DHCP. - ...
It is a quite complex package, which is the reason why you don't write your own, but either buy one, or try to find any open-source stack. The disadvantage with an open-source stack is that you normally don't have anyplace where you can buy support if you get stuck. You may be able to get free support if you find someone willing to help on a forum, but the business risk is that no one is interested to help.
If you do not have a sub-contractor that has the knowledge, then it really is a good idea to buy that knowledge. It is way easier to maintain a working and well-written application, than to try to write it from scratch if you are not familiar with the problem. If you do not know what an TCP/IP stack is, then you do not have any real knowledge about network programming. You might have been able to use VB example applications to perform communication, but when you get to the embedded side, you really have to think about everything. The PC hides a lot of the problems with networking. Remember that the PC has "infinite" amounts of memory compared to the LPC2368. It also have a many times faster processor.
Most embedded TCP/IP stacks have severely limited functions for threaded operation. Most often, one single thread may perform networking. Because of the memory limitations, buffering of messages also becomes a big problem requiring your application to be cooperative.
One thing to think about:
Buy the Keil stack.
Take their example code for a web server.
Combine with your application.
Create dynamically generated pages to display state information.
Create input forms to allow input of parameters you want to change.
Then you can communicate with your unit without the need for a special PC program.
If you have advanced functions you want to implement, that isn't suitable for normal web pages, then you can still do it with a web server in the heat pump.
Just create special links that either dumps large amounts of binary data to the PC (and requires a special PC program to accept and extract the data) or create special links where you post large blocks of data or uploads full binary files.
Yes, I know that you said that you didn't need a web server, but it is an example program that will get you up and running - and it is also quite nice to be able to tell a customer:
"Use a cross-over cable and connect to 192.168.0.1."
"Tell us the message you see in your web browser. That message is the total # of running hours, the projected wear level of the internals and any detected errors."
The nice thing about a web server is that just about any user can connect and extract information. This makes it possible to get info out of the system even if the customer has not arranged an external IP for your equipment. Or a service technician can have a chance to get advance information about a problem before going to the customer.
Custom applications to communicate with hardware was something everyone used 10-20 years ago. Now, almost everyone tries to make as much actions as possible accessible through a web server. Possibly with a number of different passwords, to specify access levels. One password for the customer. Another for remote access. Another for a technician. A fourth for the factory...
... there will be no need for any VB programs!
What will the OP do then...?!
Take an early friday evening, knowing that the solution is economical for his employer, and practical for the technicians and customers and is future-proof since no VB code will break if MS makes any radical design decisions with their platform. And the client side will be available on Mac (without running Windows on it), Linux, FreeBSD, ...
Quite a number of people with custom 16-bit Windows applications had to swear a lot when their applications didn't work well on Win2k.
Most developers who have worked with embedded for a while can tell stories about crying technicians who have managed to smash their old Win95/Win98 laptop and suddenly finds themself locked out of the systems they are supposted to work with...
It is for my job. It's just that I could not understand how the stack tc / ip
forgive me, but your attitude can get you into serious trouble. TCP/IP is a complex protocol. there are entire libraries of books and magazines dedicated to it. and you come here to get a glimpse? give me (and your boss/clients) a break - grab a book and you'll know where to begin! have you tried http://www.amazon.com?
A web server with features to read and write variables need not be large. Note that http is just a protocol. It's just that it is a protocol that can allow a standard client to be used for a lot of functions.
The amount of RAM needed for a web server is mostly affected by two things: - max data you allow sending to it. - max page size it should send back.
It would normally work quite well with 1kB receive buffer and 1kB transmit buffer.
You could even use java-script and use AJAX to run a client-side "application" directly on a local web page, and have the javascript code request or update parameters.
I have added embedded web servers (own code) to embedded equipment, so I know that it can work quite well with a very limited foot print. I quite often also add web servers to normal PC applications as a means to reconfigure them (or monitoring them) on the fly while they are running.
The problem is that I need to retrieve a lot of information from the lpc2368. I need a fairly large number of pages. I have a memory of 100KB. I wrote some html pages I needed for my project and I already took 50Ko while I had that page in French and that I must integrate 5 languages. So we abandon this path because of memory. That's why I want to program in Visual Basic. The technician will just install the application on his computer and then thanks to the IP address it can connect to the different lpc, then he can read and write in the different variables that wish.
Needing five languages is tough. I only implement english.
I have a 12-byte table keeping track of all parameters. Two bytes are the parameter index (can be optimizaed away if parameter list doesn't contain any holes, but I also store a bit there to inform if the parameter is read-only or may be written). Two bytes indicates data type and formatting (such as shown in table, separation into different pages, ... A few "data types" represents callback functions) Four bytes represents memory address. Can be shrunk to two bytes since the LPC2368 has less than 64kB RAM. 4kB of the address space can be used to point at a configuration sector in flash. Four bytes points to a text string. The average string size is less than 20 bytes but with 20 bytes, 1000 parameters would take less than 32kB of code space to describe. I normally only need a fraction of that count. Maybe 100 .. 250 parameters.
I may have maybe 2-3kB boiler-plate HTML/CSS, but the rest is dynamically built based on the formatting information.
In reality, some data types are of type "two 32-bit unsigned", or similar - for example to retrieve debug info about # of received and transmitted bytes on a link as a single snapshot parameter.
With five languages I need to 5 times more pages of data. I already 50Ko French then just imagine with 5 languages ... It is not possible. More page layout should be the most beautiful possible to sell the product. We therefore need to insert images and many formatted. In addition some customers wondering Technician improvements and yet more variables.
Do you think 100KB available will not be enough?
I think not.
So as a VB application I have a memory on my computer almost unlimited. I can add as many pages I want ...
Are you agree?
Is that someone will sample code to retrieve frame tcp / ip in C?
Before looking at sample code, you will have to decide on a TCP/IP stack. The API of the different stacks are not identical, so the samples must be for _your_ stack.
On larger machines, POSIX defines a number of standard functions and structures, but most embedded systems need to perform optimizations and reductions because of lack of memory.
ok but in any case I should write the code to retrieve frame tcp Send using visual basic. no ?
What is POSIX please ?
How many seconds does it take to write http://www.google.com and then enter "posix" and press the search button?
Answer: Less time than it took me to write this text. DO YOUR OWN HOMEWORK. Use the forum when you get stuck. But don't expect people to do everything for you. If we do, then we expect money in exchange!
You are very funny. ;-) Finally, I was able to contact my provider he will take care of developed into this part of the soft so it only remains for me to realize my VB interface and sending my frame TCP / IP. Thank you for your help.
Mick
you know what you are? you are unbelievable. wasting good people's time here just to say later: "I was able to contact my provider he will take care of developed" guys like you REALLY take the fun out of helping people on this forum (or asking a question if needed...). Shame on you!
Interventions by Per Westermark and Andrew Neil served my lot and my light on many issues black. I want to thank you for your help. So thank you very much!
Tamir you can talk to me but your speeches of his not more useful than mine ....
As you concluded yourself, pal: stick to VB applications...!
As you concluded yourself, pal: be quiet Tamir !!
View all questions in Keil forum