Links

Feb 01

Links

  Cats! I found the strengths and kept all our links in a single place. P.S. Further links I offer to add yourself here. Sorting, creation of new columns, replacement, and other improvements are highly appreciated 🙂...

Read More

How to Implement Data Communication Using Modbus RTU? (part 2)

Jan 12

How to Implement Data Communication Using Modbus RTU? (part 2)

So how to arrange data exchange through Modbus RTU?  Answering multiple requests and inspired by @burgua, @maxmaxmax and other people I have finally decided to write down a second part of the manual 🙂 In order to start up data exchange protocol, it is required to implement it both on master (in our case PC) and slave (board RS-485 with port). All this will work with RS-485 – USB adapter. Let’s have a look at Modbus RTU configuration implementation, where PC is a master (i.e. query sender) and a board is a slave (query responding unit). For the very beginning, one should define address chart to be completely matching address map set in the controller which we are going to use: Click to toggle codeblock 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 namespace Modbus {     public enum ModbusMap     {         ADR_STAT = 0,         ADR_ADC_STATUS = 1,         ADR_ADC_RESULT = 2,         ADR_ADC_ENG_VALUES = 12,         ADR_TIME = 22,         ADR_BINR_STATE = 25,         ADR_BINR_ATTEMPTNUM = 26,         ADR_STATUS_IOBSM = 27,         ADR_DIVISOR_COUNTER = 28,         ADR_TIME_SCALE = 29,         ADR_GSK_RES = 55,         ADR_OSK_RES = 83,         ADR_CMD = 111,         ADR_NAV_TASK_STATE = 112,         ADR_NAV_TASK_CORRECT_ORB_INDEX = 113,         ADR_NAV_TASK_CORRECT_ORB_INDEX_ITER = 114,         ADR_COUNT_GPS_DATA = 115,         ADR_COUNT_GPS_TASK = 116,         ADR_FIRST_INDEX_GPS_TASK = 117,         ADR_IS_CYCLE_READ_MODE = 118,         ADR_STORE_DIVISOR = 119     } } namespace Modbus { public enum ModbusMap { ADR_STAT = 0, ADR_ADC_STATUS = 1, ADR_ADC_RESULT = 2, ADR_ADC_ENG_VALUES = 12, ADR_TIME = 22, ADR_BINR_STATE = 25, ADR_BINR_ATTEMPTNUM = 26, ADR_STATUS_IOBSM = 27, ADR_DIVISOR_COUNTER = 28, ADR_TIME_SCALE = 29, ADR_GSK_RES = 55, ADR_OSK_RES = 83, ADR_CMD = 111, ADR_NAV_TASK_STATE = 112, ADR_NAV_TASK_CORRECT_ORB_INDEX = 113, ADR_NAV_TASK_CORRECT_ORB_INDEX_ITER = 114, ADR_COUNT_GPS_DATA =...

Read More

How to Implement Data Communication Using Modbus RTU? (part 1)

Mar 19

How to Implement Data Communication Using Modbus RTU? (part 1)

Not so long ago, I was engaged in the MC programming (in the framework of the work on the nanosatellite), in particular, I implemented a communication between devices by different protocols. So, where do we start? When it is necessary to solve this kind of problem, first of all, you should choose (if there are “hardware” restrictions, it means that the choice is partly made for us): data communication type (synchronous, asynchronous); interface (RS-232, RS-422, RS-485, USB, Bluetooth, etc.); protocol (WAKE, Modbus, etc.). To make the right choice, you need to take into account the scope, speed and signal transmission distance limits and other characteristics. One of my tasks was to implement a data communication between a computer and the STM32F105 MC on the existing board. On the interface board, there was the RS-485 for asynchronous serial data communication, which allows implementing connection of up to 32 devices at the same time, has a speed of 30 Mbit/s and a transmission distance of 1 200 m (see Table 1). Parameter RS-485 Data communication type Differential Maximum number of receivers 32 Maximum cable length 1200 m Maximum transmission rate 30 MBit/sec Output voltage -7…+12 V Receiver sensitivity ±200 mV Table 1. RS-485 interface parameters In principle, it is possible to implement a data communication without a protocol, but in this way, nobody guarantee data integrity and timely delivery, so a common practice is to use specialized protocols. Data communication protocol is a set of agreements of a logic level interface that define a data communication between different programs. These agreements define a uniform method for transmitting messages and error handling in the interaction of software of spaced apart devices, connected by one or another interface. A standardized data communication protocol also enables to develop interfaces (now at the physical level), which are not tied to a particular hardware platform and manufacturer (e.g., USB, Bluetooth). Communication protocols generally operate on the “master-slave” principle. A master initiates a communication and sends a request to slave devices (slaves), and slave devices respond (or do not respond) to requests according to the address in a package. There are many protocols, but one of the most common is Modbus. The Modbus protocol was established many years ago but is still very popular....

Read More

Meeting of Habrahabr Readers

Dec 31

Meeting of Habrahabr Readers

The meetup of readers of the Habrahabr community, popular with IT-specialists, was held On December 8. The event was very informal. Beer, peanuts, french fries… and technical presentations: Dmitry Yahov “ITIL, Methodology of IT-management Processes Within the Company”; Andrew Kobylianskii “Multidimensional Computer Graphics”; Sergei Gnidko “Work without Working Capital”; Alexander Shpak “Flexible Development Methodology. Who and why Invented them?”; Igor Petrushenko “Web Forms and Online Databases Constructor”. There were quite a few programmers at the meeting; it turned out that Habrahabr readers are mostly system administrators and integrators. It was a nice surprise for me to meet @RReverser  (you can find his blog here); we talked about Windows 8, Windows Phone and other cute .NET-stuff. Also, the organizers played beer barrels in the most honest random way (Anatoly, who was sitting at our table, was the...

Read More

IT Jam 2012 Report

Sep 20

IT Jam 2012 Report

September 1 is not only the day of knowledge, peonies, and teachers, but it is also a day of fun for more than 3,000 IT specialists in the NSC “Olimpiiskii“. Truly speaking, I have not seen anywhere else such a long queue for registration. When registering, in addition to cute notebooks-pens-markers-pins-magnets, you could also get a card of the first off-line social network, RFIDLE. The card is linked to my Facebook page, and with the help of it, I can give likes, add friends and upload photos using special terminals. The idea is excellent, but unfortunately, terminals often denied. In a couple of days, RFIDLE sent me a questionnaire by mail, and it turned out that we became participants of a beta testing, so let’s hope that developers are already fixing the system. “We are here to celebrate!” said IT Jam slogans. On two stages (under the titles “New ideas and technologies” and “From vision to implementation”) technical gurus told stories of their success in a simple and humorous way. Apart from Ukrainian speakers Max Istchenko (founder of the well-known DOU Ukrainian developer community) and Michael Zavileiskii (General Manager of the DataArt company), there were also foreign guests: Christopher Marsh (technical developer at AKQA), Greg Young (independent consultant and entrepreneur), Torben Maygaard (Ciklum founder) and others. Companies raffled off licenses (I, for example, wanted to win a license from JetBrains for Resharper, but alas, failed to), cups, T-shirts, Lego; held competitions and polls (DataArt gave everybody beans in bags for voting; some members even took them home, maybe in order to plant). But I was lucky enough to win a 20% discount on the preparation for the Microsoft certification in the training center, which is also good. Around the pavilion, there were Chucks Norris with jokes and a different stuff for entertainment. But the most important thing was going on in the community spots, where developers of different areas were communicating and exchanging contacts. Ironically, I almost missed the .NET lectures but had a great time with the guys from Podcasting. It was very entertaining to learn from the “inside” how to create podcasts, as I often listen to Mikhail Marchenko and to his podcast “Frankly about IT careerism”....

Read More