Solved

how to interface PC with self designed electronics

Posted on 2000-04-30
3
178 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now