Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to interface PC with self designed electronics

Posted on 2000-04-30
3
Medium Priority
?
186 Views
Last Modified: 2010-04-02
Hi all.Please let me know how  can i interface a self designed electronic units with the PC

i'm looking for commands and example to access pin of serial and parallel comm port pin by pin. Please let me know how its done in VC++ and VB. and which one do you recommend i use.
0
Comment
Question by:jaxon445
[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
3 Comments
 
LVL 4

Accepted Solution

by:
saurabh_dasgupta earned 75 total points
ID: 2765139
Win NT provides a suite of Win32 APIs for transferring data through the serial ports.

These APIs make serial port operations behave  like  file operations.

Example: You can acquire a handle to the COM1 port using the following:
CreateFile ("COM1" , ...)

You can transfer data out using WriteFile and read incoming data using ReadFile. You can make your architecture asynchronous also.

Microsoft also provides a ActiveX wrapper (MSComm32.ocx) over all the above communication APIs . That can be useful for you in the prototype stages.

These APIs are documented in Platform SDk --> Base Serivices --> Files and I/O -- > Communications.

There is also a full blown sample by the name TTY located in the Samples\SDK\Win32\TTY directory in the MSVC50 setup folder.

Hope this helps ...
0
 

Author Comment

by:jaxon445
ID: 2765151
thanks saurabh

i was looking for command and ways to get it done by VB or VC++. please do let me know if you know anything on it.

0
 
LVL 4

Expert Comment

by:saurabh_dasgupta
ID: 2765210
Do you have MSVC 50 or 60 compiler ?
If yes then you can take a look at the TTY sample.

This is a simple executable that lets you transfer and receive bytes across serial ports.

You will need a shielded cable with a 9 bit connector on either sides.

Get hold of two compuers which are loaded with Win NT and connect their respective COM1 ports using the shielded cable. Run the TTY.EXE sample on both the computers.

.....and there you are. You have the full source code also (TTY.C)

This is a demo of  PC to PC communications. For PC to external hardware communication, you will need to use specific chips ( not much idea about that)

Hope this helps
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

715 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