Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to interface PC with self designed electronics

Posted on 2000-04-30
3
Medium Priority
?
187 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

963 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