from the Automation List department...
MBLogic Free Software Project
Open interfaces, software and hardware topic
Posted by Michael Griffin on 25 May, 2008 - 12:26 pm
I have a new software project that I have been working on, and I would like to
offer it for review and comment. It is a set of Free Software (GPLv3)
packages, available at the following location:

http://sourceforge.net/projects/mblogic/

The packages consist of the following:

MBServer - This is the main item. It is a combination of servers and clients
in a single integrated system which allows you to automatically poll multiple
remote servers, store the information in a data table, and then poll *that*
data table from another application. Right now, the main protocol supported
is Mobus/TCP, but other protocols can be added. It also supports a
Modbus-like web service. It has a web based status monitoring system, and web
based on-line help.

MBAsyncServer - This is a Modbus/TCP server. It can be useful if you need just
a server and want something simpler than MBServer.

MBPoll - This is a command line Modbus/TCP client. You can use it to read or
write Modbus/TCP servers. It also has a mode which allows you to poll
repeatedly at a specified rate, which can be useful when testing servers.
There is also a corresponding version for the Modbus-like web service.

SimpleClient - This is a library for writing your own Modbus/TCP clients.
There is also a corresponding version for the Modbus-like web service. (Both
of these are included in the MBPoll package.


These are on the second release. For some reason, SourceForge is at this time
only showing the first release on the front page of the project. You have to
click on "Browse all files" to see the second release. The changes between
the first and second release are very minor.

All of the above are written in Python (version 2.5). MBServer also needs the
Twisted communications framework. MBLogic, Python, and Twisted are all Free
Software. All three are multi-platform, and so should run on Linux, MacOS/X,
and MS Windows. MBLogic is developed on and targeted for Linux, but there is
nothing in it so far (or planned) which keeps it from running on other
operating systems.

The web site for the project (http://mblogic.sourceforge.net/) has more
information on the software (including where to download Python and Twisted
if you don't already have them). Most of the details for MBServer though, are
in the on-line help that comes with the package.


At present, I consider these packages to be "beta" grade. I have conducted my
own testing, but I am looking for more people to test them under different
conditions.

MBPoll and MBAsyncServer are complete so far as I can see. MBServer is
complete in so far as all features work, but I do intend to add more features
to it in future though.


The whole project is called MBLogic because the actual goal of the project is
a soft logic system, and the above are just byproducts of it. When complete,
the soft logic system (which is under current development) will be integrated
into MBServer, which means that package will be receiving additional
development to accommodate it.

The "MB" name doesn't actually mean anything other than that I lack
imagination. I needed the servers in order to help develop the soft logic
system, and I was using the Modbus protocol at the time so they got
called "MB". The system is intended to support multiple protocols though, so
it's not actually a "Modbus only" system. I wanted to push the project out
the door though, so the "MB" name has stuck so far.

All of these are Free Software, which means that you can do what you wish with
them, provided that you comply with the terms of the license (GPLv3). If you
are not familiar with the GPL software license, a very rough outline of it is
that you are can copy, sell, redistribute, modify, add to, (etc.) the
software, provided that you give any further recipients of it the complete
source code, and the same terms apply to any derivatives of it you may make
(see the copy of the GPL included with each for the authoritative terms).


Posted by Mohamed on 28 April, 2009 - 5:47 pm
Thanks for that software. I'm a student from Barcelona (Poltechnichal university of Catalunya), and i do my final project about free SCADA Systems. I have choosed your software, and just today, i have proved MBlogic, but i had a connection problem:

Connected outgoing client PLCUPC.
Lost connection on outgoing client PLCUPC.
Connected outgoing client PLCUPC.
Lost connection on outgoing client PLCUPC.

Any tip?


Posted by M Griffin on 29 April, 2009 - 7:59 pm
The system is connecting to device PLCUPS, but is then being disconnected by the device. Some devices seem to do this if you poll repeatedly for addresses which don't exist, or for function codes which it doesn't support.


The message: "Connected outgoing client PLCUPC." means the system successfully opened a connection to "PLCUPC".
The message: "Lost connection on outgoing client PLCUPC." means the system was disconnected from the other end.


If you have the system status monitor enabled (port 8080 on the default install), then if you point your web browser at "http://localhost:8080/MBStatusSystem.html" and then click on "Comms" in the menu at the top you will see a communications status web page. The device you are calling "PLCUPS" will be listed in a table along with its communications parameters. The address "localhost" in the above URL assumes your web browser is on the same computer as where you have installed MBLogic. Change that to the appropriate computer IP address if you are monitoring it from another computer.

If you click on the device name (PLCUPS), you will be taken to another web page which shows the configuration details and a fault log at the bottom of the page. If the PLCUPS device is reporting any Modbus exceptions, they will be listed there. Of course if PLCUPS isn't saying *why* it is disconnecting you, then all it will report is that an error occurred.

I would suggest checking the following:

1) Make sure you are talking to the correct IP address on the correct port.

2) Make sure you are using a function code that is supported by the device.

3) Make sure the address and quantity are within the addressable range of the device.

4) Start with a slow polling rate (cmdtime and repeattime), and increase it only after you have communications working correctly. The times are in milli-seconds.

5) Make sure the retry time (retrytime) is much larger (at least 10 times) than any normal delay. Just make this a very large number (e.g. 10000) to start with.


If you want to experiment with the connection to make sure the field device is reachable, there is another package called "MBTools" which has a command line client. You can use this to poll the end device to see what responses you get.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2010 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
This is the ____LAST time I take travel suggestions from Ray Bradbury!