Modbus PlugIn

Posted on
Thu Dec 19, 2013 4:22 pm
jblackburn offline
Posts: 77
Joined: Dec 11, 2013
Location: Quebec, Canada

Modbus PlugIn

Hi,

I have some devices using Modbus protocol on TCP/IP. I've started to develop a plug-in to connect my device to Indigo. I'm using pymodbus (TCP/IP) library and everything work fine in the Mac OS X terminal environnement. I've transposed my code inside the plugin of Indigo but I'm not able to connect to my ip device with the same code!?!?! I'm a little bit confuse!!! I'm lost between both interface... I have put a copy of the library directly in the 'contents' folder of the plugin structure as required. Do I need to install the pymodbus library inside Indigo Python environnement as I've done in the Mac OS X terminal?

http://code.google.com/p/pymodbus/

If it is the case, plugin distribution will not be easy:

PS: It's my first post, be nice with me! :D

Thanks!

Joël

Posted on
Thu Dec 19, 2013 6:32 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Modbus PlugIn

It is usually best to include any needed code in the plugin. It should normally be in, or under, the resources directory.

Posted on
Fri Dec 20, 2013 4:56 pm
jblackburn offline
Posts: 77
Joined: Dec 11, 2013
Location: Quebec, Canada

Re: Modbus PlugIn

I've tried with a different library (modbus-tk) and I have the same issue. It's working in the Mac OS X shell but not in the indigo python shell!?!

Thanks!

Joël

Posted on
Fri Dec 20, 2013 5:02 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Modbus PlugIn

Do you "import" the modbus libs?

If so, just placing them in the same directory as plugin.py should work. However, if the modbus module calls other modules, you may need to place them in an appropriate hierarchy.

You might take a look at the Phidgets plugin to see how I included the Phidgets libs. You will see that plugin.py imports modules for the difference device types the plugin can create. Then, each of those modules imports Phidgets standard modules that are contained in a sub-directory.

Posted on
Sat Dec 21, 2013 1:02 pm
jblackburn offline
Posts: 77
Joined: Dec 11, 2013
Location: Quebec, Canada

Re: Modbus PlugIn

Thanks for your input! I think I solved my problem. It's was the 'import' way and other minor things (e.g. test object, ...)... :wink:

PS: Your plugins are amazing!

Joël

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests

cron