Solved

how to interface PC with self designed electronics

Posted on 2000-04-30
3
181 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
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
saurabh_dasgupta earned 25 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Template syntax for variable length arrays 9 75
IdTCPClient1->Disconnect(); not working 3 76
Unable to start eclipse ? 17 152
C++ help/ Toy problem 19 28
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

791 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