Hello I am an electrical engineering student and I am designing an equipment that records values and then sends it as simple 8 bit data to LAN port. I have to retrieve this data with timestamp and display it in a GUI.
Data sent will be in the form:
(MSB) (LSB)
[start bit | 3 | 4 | 2 | 7 | 2 | 4 | 6 | stop bit]
And will be displayed in GUI as:
[Computer Time] 34.2 Volts 7.2 Amperes 46 degrees
Please guide me as to how to access the imformation from LAN port using C# or VB.Net and if possible please post the socket programming because being an electrical engineer, programming is not really my forte. Thank you.
Speaking from experience, I wrote a packet analysis engine in C# for my university dissertation. The problem you will face is that Managed .NET does not allow you to capture data below the IP level, however there are some unmanaged API's you can use to gain access to lower level packet data. SharpPCap for example will allow you to capture packets at the Data Layer (Layer 2 in the OSI model). I know of nothing in .NET that will allow you to directly read/write bytes to the LAN adapter, and even if you could, any PC would probably discard it as erroneous bits/bytes.
My suggestions to you are:
Learn about the OSI model, and how packet encapsulation works.
Learn how MAC and IP addressing works
Consider at what level you can transmit your data, and how you are going to serialize it from code to something which is transmittable. (and vice-versa).
IMHO, this seems more like the job of a serial port, or maybe even USB, where you have greater control over the data being sent/received. LAN based systems are standards based, and therefore in order for your data to be acceptable, you will need to learn, to some extent, the standards, or use ready built implementations.