• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

NetWork Programming

Hi there.

I have an application which communicates with a custom device via the serial port (RS232). It sends out binary data to the device, eg, 1A0FD3, and recieves a response in a similar fashion.

I am using the MSComm control to do this and have the settings to sendasBinary.

What I would like to know is

1) How could I send the info via the port without using MSComm or any other controls?

2) If we upgraded the system to run via LAN sothat we could add multiple devices, how do I send the info via LAN? Obviously the hex numbers will be the same, but what is the code to connect to the LAN, send info and recieve info?

Thank you,

1 Solution
While you are on the subject of Network Programming, Does anyone know how tom dissable the Internet on The entire network in VB? I know how 2 dissable it on 1 PC, but how do i do it for an entire Network?
You can use Win API to communicate via serial, but you would probaly be better off sticking with the MS Comm control.
If you want a program that can run anywhere on the lan and send data to a serial port on a specific machine that this device is connected to then you will need to do the following:
Create 2 seperate programs:
Server program
Create a program to run on the machine that is connected to the device.  It should do the exact same thing as the current program does only it figures out what interactions with the serial port are needed based on WinSock messages instead of users clicking on buttons.  It also porovides feed back via WinSock instead of a user interface.
This program need to use the WinSock control to listen for messages coming to it across the network.
When a message is recieved it takes the data in the message and determines what to do with the MS Comm Control. ie. send it the hex string, blah blah blah.
it waits for a response from the serial port and then take that data and sends it back to the computer that sent it the original message via winsock.
The Client program only needs to send and recieve messages to and from the server program.

So basicly what you are doing is seperating your program into 2 seperate programs.  One for user interface, and one for the backend, and then setting up a comminication between these 2 programs via winsock.

if you need specific help with this, or anything just let me know...

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now