Blog - Thiago de Freitas Oliveira Araujo(multitouch, NUI, robotics, SLAM, Linux, Embedded Systems, Pervasive Computing, Nature, Soccer,...)

10 Oct 2010

Modbus Test using Modbus-tk, python and Modbus Tester

No Comments Embedded Linux, Linux, Tips & Hints


Sometimes when you are dealing with automation products, the modbus protocol is a very interesting alternative due to its simplicity and efficiency. At my work for Apel, we are currently developing some interesting applications for metro stations using GPS Antennas and Embedded Linux Boards like the TS-7400 from Technologic Systems, the linux distribution chosen was mainly debian due to the fact that it comes always almost with everything we need and Idid not want to have many additional work on that aspect(do not tell my boss on that one :) ),as we are planning to work some aspects of the product further.

Moreover, I would like to share just a bit of the experience as it may help more people to get their projects more advanced. For that I have configured a simple situation where I had a GPS antenna, a board and an old computer running an almost as old Windows XP. Then, I have connected both of them using the serial port and a serial/TTL board converter that we have constructed.

ntpGPS Modbus

ntpGPS Modbus

Then, for programming  I have used python and a nice project called Modbus-Tk http://code.google.com/p/modbus-tk/, an interesting program for running the master to test is the Modbus Tester that you can download from http://modbus.pl/Modbus_Tester.html, a different approach(and I did that already, it is indeed very simple) is to construct your RTU master using the modbus-tk library, as it comes with simple to use methods.

Using this program you can test communication with modbus slaves. At present, only the Modbus RTU mode is available.

The modbus content consisted mainly in:

Modbus Request

Modbus Request

Modbus feedback

Modbus feedback

For analyzing the information, you need to make some conversion such as the one, below:

converting Hexadecimal to Decimal

converting Hexadecimal to Decimal

At the code side you should mostly , due something like

slave_1 = modbusServ.add_slave(1)

slave_1.add_block(“a”, cst.ANALOG_INPUTS, 200,7)

and at the program you should set the values with the system time, like:

slave_1.set_values(“a”, 200, hour)

Video:

07 Oct 2010

Sergey Mikhailovich Prokudin-Gorskii : Russia in Colors ( 1905 – 1910)

No Comments Personal Interests


Sergey Prokudin-Gorskii was a pioneer russian photographer, that took photos from Russia in the years from 1905 to 1910, to make colored pictures that could document the behavior and personalities for that time. His technique consisted of taking 3 different pictures in short time intervals using monochromatic filters(R, G, B). Later, he joined the slides and projected with light. The result of some of his work may be visualized in some of the pictures, below.


WP SlimStat