Solved

How to detect binary signal from serial port using VB 6???

Posted on 2003-12-11
5
745 Views
Last Modified: 2010-05-03
I’m doing a project to convert morse code (binary signal) to character using Visual Basic 6 in window XP. How can I input the binary signal to the computer using serial port? The program only needs to detect signal condition (1 or 0) on one pin of the serial port. Can anyone help me please?
0
Comment
Question by:ngwenpin
5 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 9921252
Use the Microsoft COMM Control.
The event you want is MSComm1_OnComm
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 135 total points
ID: 9921495
I don't think the serial port would be the best choice.  It is designed to send signals as pulses and so you can't really hold a particular pin high or low.  It may pulse fast enough to be seen as a high however.

The parallel port can be used to hold a pin high or low.

There is another open thread dealing with the same thing here:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20816365.html

Idle_Mind
0
 
LVL 1

Expert Comment

by:awabid
ID: 9922395
Well pal,
there is ofcourse a way out to detect this on the serial port, and MS COMM CONTROL is used to access the COM port. All you have to do is to open the port on 9600 baud with 8,N,1,No parity. But you have to design a hardware as well for this. This hardware will be consisting on a chip which is used to interface the input in RS232 format. This is pretty cheap chip. It is of MAXIM company and the number of the chip is MAX232. You can download its datasheet from    . Now all you have to do is to design a circuit, which can hold the input for a baud of 9600. Then put an OR/AND gate. Design a logic which can change the state of 1111 1111 to some other state, and using MS COMM CONTROL keep detecting the signal. Then compare with a known pattern. If the pattern changes (remember that the input will be some ascii value, which u will get) then you can use some switching statement to see what was the input.
Happy programming and development :)
A W Abid
0
 
LVL 27

Expert Comment

by:planocz
ID: 10270521
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from ngwenpin from 12/11/2003 comment
Award points to Idle_Mind is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 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