Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Can we send and receive data to and from Port Using Python ?

Thread Tools

Re: Can we send and receive data to and from Port Using Python ?

Steve Holden
Posts: n/a
sambasivareddy wrote:
> Hi,
> I am new to this group. I have some question, it is listed below.
> In my application I should send some data to hardware and it will give
> response that response should log in one file. To do it first should
> send data to port next receive response from port (hardware) so...
> __
> _Queries:_
> 1) Can we able to send data to serial port using python? If yes how?

The usual mechanism is the pyserial module. Google is your friend.

> 2) Can we able to receive data from serial port using python? If yes how?

See answer to 1)

> 3) Is there any function like "Register event call back”, please explain?
> (Register event call back: registers a script to be called when an event
> occurs)

I believe you need to implement the observer pattern. There have
already been several successful implementations of this, and
again Google should be capable of finding them. For example:

> 4) Is it possible "parallel loops" concept in python (In my application
> send data to port and receive data should be in one file and execute at
> same time)?

Most Python implementations support threading, and there are a
number of other asynchronous service techniques. There should
be absolutely no problem.

> If anyone knows answers please clarify and have any examples related to
> this please send it .if u need any information regarding questions
> please let me know.
> Thanks in advance.

Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC

Reply With Quote

Thread Tools

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 Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Request to receive xml data that send by using HttpWebRequest, Ying-CO ASP .Net 0 06-05-2008 09:52 PM
Pyserial - send and receive characters through linux serial port terry Python 5 05-03-2008 03:15 AM
Socket Send and Receive, Same local port, Different Remote Port Perl Misc 1 03-02-2005 08:54 AM
2509 asy port can not receive all data at speed of 9600 shark Cisco 0 08-12-2004 01:14 AM