About Abhijeet Landge Expertise I can answer questions about System Analysis, Database Design, mapping live systems into models. I can answer questions related to Visual Basic 6.0, databases and ActiveX programming
Generating reports using Crystal Reports 7.0, passing parameters from VB Applications is another area where I can be of help.
I cannot answer questions pertaining to COM / DCOM.
Experience Developing Client Server Application in Visual Basic 6.0 and generating complex reports to the satisafaction of the end user using Crystal Reports 7
Education/Credentials B. E. Computers
[Bachelor or Computer Engineering]
Awards and Honors Won an Honor Mention in the ICPSC Contest organized by Wisconsin University
Expert: Abhijeet Landge Date: 7/6/2001 Subject: VB6 and Serial ports
Question Hi Landge,
Well I'm working on serial ports with Visual Basic 6 and I wanna know how can I manage the signals in the serial port pins. I want to send a signal from specified pin which I like and I want to figure out the pin of the signal that I receive. I didn't find anything helpful in MSDN library and I need an expertise. I want to develope a software with VB6 that show me all these stuffs (I also want to manipulate with the voltage of each pin).
Look at the following 9 pins,
D-Type-9 Pin No. Abbreviation Full Name
Pin 3 TD Transmit Data
Pin 2 RD Receive Data
Pin 7 RTS Request To Send
Pin 8 CTS Clear To Send
Pin 6 DSR Data Set Ready
Pin 5 SG Signal Ground
Pin 1 CD Carrier Detect
Pin 4 DTR Data Terminal Ready
Pin 9 RI Ring Indicator
These are the pins that I mentioned above.Voltage sent over the pins can be in one of two states, On or Off. On (binary value "1") means that the pin is transmitting a signal between -3 and -25 volts, while Off (binary value "0") means that it is transmitting a signal between +3 and +25 volts... And want to send and receive my signals (Voltage) via these pins.
I would be very appreciated if you help me in this case.
Thanks
Hooman Sakaki
Answer Hi Sakaki,
Sorry for the delay in answering the question. Manipulating Voltages and all should be easily possible once you can communicate using the ports.
I shall look up info related to VB 6.0 and let you know, but till that time here something to chow on
Opening a Port
Call the CreateFile function to open a serial port. Because hardware vendors and device driver developers can give any name to a port, an application should list the available ports and enable users to specify the port to open. If a port does not exist, CreateFile returns ERROR_FILE_NOT_FOUND, and users should be notified the port is not available.
// Open the serial port.
hPort = CreateFile (lpszPortName, // Pointer to the name of the port
GENERIC_READ | GENERIC_WRITE,
// Access (read-write) mode
0, // Share mode
NULL, // Pointer to the security attribute
OPEN_EXISTING,// How to open the serial port
0, // Port attributes
NULL); // Handle to port with attribute
// to copy
2. CONFIGURING A SERIAL PORT
3. CONFIGURING TIMEOUTS
4. WRITING TO SERIAL PORTS
5. READING FROM SERIAL PORTS
depending on what values you read from the ports, you could very well manipulate the output signal.