Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 14-05-2006, 12:52 AM   #1 (permalink)
Right Off the Assembly Line
 
Nitin_Tyagi's Avatar
 
Join Date: May 2006
Location: Delhi
Posts: 21
Default Controlling an external Machine through a computer


I wanted to know How to control an external device with the help of a computer. Suppose i make an electrical device which contains of 5 switches and a combination of those can make my device do several things. How is it that i can control it through a computer. Moreover even if I am able to put the switches on or off with the Help of a computer is there any way by which i can write a program to define various actions performed by my machine and make it work by running the program.

Guys! anyone who can help me with that would help me create something you people would like getting ur hands on.
Nitin_Tyagi is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 14-05-2006, 10:40 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Feb 2005
Posts: 9
Default Re: Controlling an external Machine through a computer

Hi ,
Pc's know only 0's and 1's.
however as u want to control those switches it can be easily done with the Pc (provided the switch has only two states ON & OFF). PCs communicate with the external world thru ports. Your PC will have three ports

1.Parallel Port (25 pins that loooong one)
2.Serial Port (9 pins ,a bit smaller one)
3.USB port ( a small rectangular socket)

Of these three, the USB port is the fastest, however its the hardest one to implement in your custom device. Hence unless ur app dont need Tremoooooodus speed u can go for either of the first two. Each has its own advantages.

The serial port communication needs least wiring ( 5 wires max and is the most suitable for wireless commn where only one bit can be sent at a time ). However it is harder to implement.

The parallel port commn needs more wires but as u need to control only 4 switches the wiring can be reduced. It is also the easiest one to implement. However remember , its unsuitable for wireless applns.

Now after deciding which port to use just google for further info. Also contact me if u need any further info ( particularly if u r interested in implementing serial port using Mc, I can help u .)

The following links may help u.
http://electrosofts.com/parallel/index.html
http://www.epanorama.net/circuits/parallel_output.html

http://www.arcelect.com/rs232.htm
http://www.beyondlogic.org/serial/serial.htm

Raja
rajagopal87 <<<@>>>gmail+++com
rajagopal87 is offline  
Old 15-05-2006, 04:44 AM   #3 (permalink)
Right Off the Assembly Line
 
Nitin_Tyagi's Avatar
 
Join Date: May 2006
Location: Delhi
Posts: 21
Default Re: Controlling an external Machine through a computer

If the serial port is not too harder to implement i would like to go for it because I need to carry signals at longer distances. I dont need any wireless application but Ease in implementation is also a big issue for me because I am amateur at it. If the serial port is too harder to implement I can do with the parallel port. I also need Info about program level control I know a bit of Fortran and C language if Someone can tell me how to use them for my purpose It would mean a lot.

Last edited by Nitin_Tyagi; 15-05-2006 at 04:48 AM.
Nitin_Tyagi is offline  
Old 15-05-2006, 02:44 PM   #4 (permalink)
Right Off the Assembly Line
 
Join Date: Feb 2005
Posts: 9
Default Re: Controlling an external Machine through a computer

Do u have any exposure to microcontrollers??? . If u have, then implementing serial port commn will not be a big task. Go for an Mc with inbuilt hardware uart and u r done.

But in case u dont have any exposure to mcs, it will be too much difficult to imp it. In that case I would advice u to go for Parallel port. The programming part , I have no idea abt pascal , however a simple c program will do the job. Just see the following program,


/*flash an led on and off*/

#include <stdio.h>
#include<dos.h>
int main()
{

while(1)
{
outport(0x378,0);
sleep(1);
outport(0x378,1);
sleep(1);
}
return 0;
}

The outport instruction outputs the given value in the parallel port. Here it outputs 1 and 0. 0x378 is the address of the parallel port. The sleep command provides a time delay of 1 sec. You can check this program by using some other port monitoring software or by using the following ckt in ur parallel port.

[data0] ~~ resistor ~~~~~ LED~~~~~~[gnd]
pin2----------XXXXX-----------|>|---------pin 20
330~470ohm ~~~~ ```


here the LED will keep flashing. Since u r placing values 0 & 1 in parallel port the first data bit (least significant) will alone keep changing. The first data bit or data0 is hardware pin2. pin 18 - pin 25 are all gnd and u can use anyone gnd pin.

Hope u can understand the method. If u still had any doubt reg this feel free to contact me.


Raja

Last edited by rajagopal87; 15-05-2006 at 02:47 PM.
rajagopal87 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by trublu
- by soumya
- by Tenida
- by tv6952

Advertisement




All times are GMT +5.5. The time now is 05:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2