Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ?? Modules for GPIB and Ethernet ??

Reply
Thread Tools

?? Modules for GPIB and Ethernet ??

 
 
Chaser
Guest
Posts: n/a
 
      11-04-2004
Hi folks,

Just wondering if anyone knows where I can find modules for NI-488.2
GPIB and for a generic ethercard?

Thanks.
 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      11-05-2004
Chaser wrote:
> Just wondering if anyone knows where I can find modules for NI-488.2
> GPIB and for a generic ethercard?


Can't help directly with the GPIB thing, except to note that
using something like ctypes it is generally pretty easy to
wrap the NI libraries for such things.

As for the other question: do you actually mean you want a
way to talk "raw" Ethernet, or are you just trying to do
some networking?

-Peter
 
Reply With Quote
 
 
 
 
Chaser
Guest
Posts: n/a
 
      11-05-2004
Peter Hansen <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Chaser wrote:
> > Just wondering if anyone knows where I can find modules for NI-488.2
> > GPIB and for a generic ethercard?

>
> Can't help directly with the GPIB thing, except to note that
> using something like ctypes it is generally pretty easy to
> wrap the NI libraries for such things.
>
> As for the other question: do you actually mean you want a
> way to talk "raw" Ethernet, or are you just trying to do
> some networking?
>
> -Peter


Hi Peter,

I have an equipment that's controlled through ethernet. (The control
program is currently written in C++.) I guess my really difficulty
is, how do I send commmands to that devise through ethernet using
Python?

Any suggestions are appreciated. Thanks.

v/r,
Justin
 
Reply With Quote
 
Roy Smith
Guest
Posts: n/a
 
      11-05-2004
In article <(E-Mail Removed) >,
http://www.velocityreviews.com/forums/(E-Mail Removed) (Chaser) wrote:

> I have an equipment that's controlled through ethernet. (The control
> program is currently written in C++.) I guess my really difficulty
> is, how do I send commmands to that devise through ethernet using
> Python?


You havn't given enough information to give a good answer, but I'll take
a shot.

First, you need to know what kind of protocol your device talks. It's
virtually certain that the device implements some kind of custom
application-level protocol on top of some standard transport layer such
as TCP/IP. Assuming that's the case, you need to:

1) Find the documentation for the application-level protocol it talks.

2) Find out the IP address (or hostname) of the device.

From within Python, you will need to create a socket, connect the socket
to your device using the connect() method, and then use the send() and
recv() methods to talk to the device. You'll need to implement the
application-layer protocol yourself.

The details of how to use sockets in Python (i.e. connect(), send(),
recv(), etc) are documented in "7.2 socket -- Low-level networking
interface" of the Python Library Reference. To really understand what
section 7.2 is talking about, however, you need to have a general feel
for how network communication works in general. Fortunately, the
introduction to section 7.2 contains some pointers to some good general
reference books.
 
Reply With Quote
 
Cameron Laird
Guest
Posts: n/a
 
      11-05-2004
In article <(E-Mail Removed)>,
Roy Smith <(E-Mail Removed)> wrote:
>In article <(E-Mail Removed) >,
> (E-Mail Removed) (Chaser) wrote:
>
>> I have an equipment that's controlled through ethernet. (The control
>> program is currently written in C++.) I guess my really difficulty
>> is, how do I send commmands to that devise through ethernet using
>> Python?

>
>You havn't given enough information to give a good answer, but I'll take
>a shot.
>
>First, you need to know what kind of protocol your device talks. It's
>virtually certain that the device implements some kind of custom
>application-level protocol on top of some standard transport layer such
>as TCP/IP. Assuming that's the case, you need to:
>
>1) Find the documentation for the application-level protocol it talks.
>
>2) Find out the IP address (or hostname) of the device.
>
>From within Python, you will need to create a socket, connect the socket
>to your device using the connect() method, and then use the send() and
>recv() methods to talk to the device. You'll need to implement the
>application-layer protocol yourself.
>
>The details of how to use sockets in Python (i.e. connect(), send(),
>recv(), etc) are documented in "7.2 socket -- Low-level networking
>interface" of the Python Library Reference. To really understand what
>section 7.2 is talking about, however, you need to have a general feel
>for how network communication works in general. Fortunately, the
>introduction to section 7.2 contains some pointers to some good general
>reference books.


I'll add that what you're attempting might be essentially impossible,
or extremely easy, or anything in between. Hardware vendors vary
WIDELY in the "hackability" of what they sell.

It might be worth calling in one of us with experience in networking
and physical devices for at least a small amount of initial consulta-
tion. It has the potential to save you months (! yes, I've seen it
take that long to understand a vendor sufficiently well to realize
that a problem has an easy answer).
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      11-07-2004
On 5 Nov 2004 05:33:49 -0800, Chaser <(E-Mail Removed)> wrote:
> Peter Hansen <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
>> Chaser wrote:
>> > Just wondering if anyone knows where I can find modules for NI-488.2
>> > GPIB and for a generic ethercard?

....
>> As for the other question: do you actually mean you want a
>> way to talk "raw" Ethernet, or are you just trying to do
>> some networking?

....
> I have an equipment that's controlled through ethernet. (The control
> program is currently written in C++.) I guess my really difficulty
> is, how do I send commmands to that devise through ethernet using
> Python?


If this really is raw ethernet, I think your best multi-platform shot would
be a bleeding edge version of libpcap (http://www.tcpdump.org), and a Python
wrapper on top of it. Then make your OS accept the presence of the
interface, but not send or listen to it, and use libpcap to listen and to
inject (new feature in libpcap) ethernet frames.

It /might/ work. High data rates may be a problem; libpcap with a
relatively slow client might drop packets.

/Jorgen

--
// Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu
\X/ algonet.se> R'lyeh wgah'nagl fhtagn!
 
Reply With Quote
 
Chaser
Guest
Posts: n/a
 
      11-08-2004
Jorgen Grahn <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> On 5 Nov 2004 05:33:49 -0800, Chaser <(E-Mail Removed)> wrote:
> > Peter Hansen <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> >> Chaser wrote:
> >> > Just wondering if anyone knows where I can find modules for NI-488.2
> >> > GPIB and for a generic ethercard?

> ...
> >> As for the other question: do you actually mean you want a
> >> way to talk "raw" Ethernet, or are you just trying to do
> >> some networking?

> ...
> > I have an equipment that's controlled through ethernet. (The control
> > program is currently written in C++.) I guess my really difficulty
> > is, how do I send commmands to that devise through ethernet using
> > Python?

>
> If this really is raw ethernet, I think your best multi-platform shot would
> be a bleeding edge version of libpcap (http://www.tcpdump.org), and a Python
> wrapper on top of it. Then make your OS accept the presence of the
> interface, but not send or listen to it, and use libpcap to listen and to
> inject (new feature in libpcap) ethernet frames.
>
> It /might/ work. High data rates may be a problem; libpcap with a
> relatively slow client might drop packets.
>
> /Jorgen


Wow! Thanks for the overwhelming support. I am a computer
illiterate. Please be patient with me.

I found the following posting that deals with GPIB interface using
Python.

http://groups.google.com/groups?q=py...eja.com&rnum=4

But I got stuck on the first step of installing the dynwin package.
The dynwin package relies on two auxiliary dlls, calldll.pyd and
npstruct.pyd.

I literally downloaded the .zip, unzip them and "drag and drop" the
two .pyd into my Python24/DLLs folders. Then I created a dynwin
folder in the Python24\Lib directory.

1. Is this the right way?
2. At the Python prompt, I typed "import windll" and got the error
message that the module doesn't exist!
3. I then tried "import dynwin.windll" and Python says module calldll
doesn't exist!

HELP HELP HELP
 
Reply With Quote
 
Michael Sweeney
Guest
Posts: n/a
 
      11-09-2004
(E-Mail Removed) (Chaser) wrote in message news:<(E-Mail Removed). com>...
> Hi folks,
>
> Just wondering if anyone knows where I can find modules for NI-488.2
> GPIB and for a generic ethercard?
>
> Thanks.


Have you checked out: http://sourceforge.net/projects/gpib82357a/

This looks like a good reference...

Mike
 
Reply With Quote
 
 
 
Reply

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
Length of read in in python-gpib Madhusudan Singh Python 2 10-16-2005 04:11 PM
help w/ simple GPIB prog. whoopsi Python 1 10-04-2005 02:49 PM
help w/ simple GPIB prog. whoopsi Python 1 10-04-2005 04:56 AM
Can 803 (ISDN-ethernet) work ethernet-ethernet? Peter Cisco 2 12-11-2003 11:24 PM



Advertisments