?
Solved

NetWork Programming

Posted on 2003-02-24
2
Medium Priority
?
243 Views
Last Modified: 2013-11-13
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,

John
0
Comment
Question by:JSMCM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Expert Comment

by:beauvoir2
ID: 8015737
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?
0
 
LVL 3

Accepted Solution

by:
Da_Weasel earned 150 total points
ID: 8021896
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...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question