[Tutor] PLC communication with python?

Alan Gauld alan.gauld at freenet.co.uk
Wed Mar 8 22:32:47 CET 2006


> Hello, I would like to write a python script that communicates with
> a  PLC (programmable logic controller)

Assuming your PLC is on a development board on a PC then it might
be possible using the serial module interface.

Otherwise you probably need to wrap the C API into a Python API
using something like SWIG. But thats not a task for the faint harted,
especially if you are a novice. If you know a little C then its worth 
invetigating.

> as well as instruments like  calipers and things.

That will require an interface board and again probably wrapping
the API as python using SWIG. You might be able to use serial access
or ioctl but it will depend on the interface board and the protocol
in use (HPIB for example is probably viable)

HTH,

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list