ethernet comm instead of serial
-
hi i have an app running with serial comm. i read my comport for data that i send via an antenna, but to read it serial takes to long so i was thinking to use wireless ethernet. but i have no clue how this works is it simelar to serialport? and were can i find samples for this? ive been looking on the net but i didnt find what i was looking for. any ideas thx
-
hi i have an app running with serial comm. i read my comport for data that i send via an antenna, but to read it serial takes to long so i was thinking to use wireless ethernet. but i have no clue how this works is it simelar to serialport? and were can i find samples for this? ive been looking on the net but i didnt find what i was looking for. any ideas thx
faladrim wrote:
is it simelar to serialport?
It can be and then again it might not.:~ Can you provide some more details as to the application? Regarding the C# side of things both SerialPort & TcpClient or whatever you use to access the TCP/IP side of things will derive from System.IO.Stream so there shouldn't be too much to change on that side of things. But then again it depends completely on what the application is trying to do.
I have no idea what I just said. But my intentions were sincere.
-
faladrim wrote:
is it simelar to serialport?
It can be and then again it might not.:~ Can you provide some more details as to the application? Regarding the C# side of things both SerialPort & TcpClient or whatever you use to access the TCP/IP side of things will derive from System.IO.Stream so there shouldn't be too much to change on that side of things. But then again it depends completely on what the application is trying to do.
I have no idea what I just said. But my intentions were sincere.
well with a microprocessor i send data to my pc first i used a serial wire, but later i used two antennas to establish the communication i made some sort of protocol to send my data u know with a header and an end... so if i read the data in my pc it takes over 10 min to read all the data im sending and that is not so mutch. i have no idea to fasten this up so i thought i maybe could use ethernet because this transfers data mutch faster than serial but i have no idea how i can read this in my app now this is port.readchart() but i have no idea to start comm with ethernet. thx for the help :)
-
well with a microprocessor i send data to my pc first i used a serial wire, but later i used two antennas to establish the communication i made some sort of protocol to send my data u know with a header and an end... so if i read the data in my pc it takes over 10 min to read all the data im sending and that is not so mutch. i have no idea to fasten this up so i thought i maybe could use ethernet because this transfers data mutch faster than serial but i have no idea how i can read this in my app now this is port.readchart() but i have no idea to start comm with ethernet. thx for the help :)
First I would try using some form of simple compression algorithm to see if you can shrink the data first if this is viable. It'll be simpler than changing the hardware. A second alternative would be to try and find a USB module for the microprocessor, there are drivers available for Windows which make the USB port then look like a very high speed serial port. Nothing would need to be changed in the code except for the baud rate to reflect the change in speed. Thirdly, to read data over an ethernet connection you need to establish a connection using the
System.Net.(Sockets?.)TcpClient
class. Basically you connect to a specific IP address and port number and the TcpClinet is inherited fromSystem.IO.Stream
so you can create a StreamReader / Writer, BinaryReader / Writer etc from this to read in the data however you want. E.g. (this is off the top of my head so I can't verify it's accuracy)TcpClient micro = new TcpClient(ipAdressOfMicro, portNumber);
StreamReader microInput = new StreamReader(micro.BaseStream);
// Read in a line of text from the micro
string line = microInput.ReadLine();
I have no idea what I just said. But my intentions were sincere.