Hydromagic Modbus-RTU Plugin
Modbus is a communications protocol published by Modicon in 1979 for use in Programmable Logic Controllers (PLC's). This protocol is still used today. Most smart sensors around have a variant which is capable of communicating over RS232, RS422 or RS485 using the Modbus or Modbus-RTU protocol. Modbus-RTU is a compact (binary) variant of Modbus to be used in serial communications.
By shipping Hydromagic with a Modbus-RTU plugin, it is now possible to use any sensor using the Modbus-RTU or ASCII protocol in Hydromagic Dredging. This plugin can also be used to use a Modbus-RTU dual axis sensor as motion sensor for Hydromagic Survey.
Loading the Modbus-RTU plugin
To load this plugin, open the preferences window by selecting "Preferences..." from the "Options" menu. In the window that appears, select the "Devices" tab. Next click the "Add..." button.
The devices tab in the "Preferences" dialog.
A list of available plugins will be displayed. In this list, select the "Modbus-RTU plugin for dredging sensors" plugin and click "OK" to load and display the configuration dialog.
Select the Hydromagic Modbus-RTU plugin from the list of available plugins.
Configuring the Modbus plugin
Serial Communications
First, you must to configure the serial communications with the Modbus device(s). For Modbus-RTU, the default serial speed is 19200 bps and the 8E1 serial data format is used. Make sure you select this format, the 8N1 format, which is most often used, does not work for Modbus. Not all Modbus devices can be connected to a serial port directly. In some cases you will need a RS422/485 to RS232 converter in order to communicate with the sensor(s).
Sensor Settings
With Modbus, sensor values are stored at register indices. For each sensor you have to configure the device address, start register, register length and a scale factor. In the first column, you have to map the register value to a sensor:
- N/A - Unused;
- P - Pitch value;
- R - Roll value;
- Y - Yaw value;
- V1 - Segment 1 vertical angle (ladder or boom);
- V2 - Segment 2 vertical angle (stick);
- V3 - Segment 3 vertical angle (bucket);
- H1 - Segment 1 horizontal angle;
- H2 - Segment 2 horizontal angle;
- H3 - Segment 3 horizontal angle;
You have to enter the register index and register length in the second and third field respectively. You can find the register indices for your sensor in the user manual. The values have to be entered as hexadecimal values. When the user manual lists them as decimal values, you can use the Windows Calculator in "Programmer Mode" to convert from decimal to hexadecimal. The length field is in words (a word is two bytes). The only valid values for this field are '01' and '02' (16 or 32 bit values).
Finally you have to enter a scale factor. Most sensors store angle values in hundreds of degrees, so the values stored in the registers have to be divided by 100. For instance a pitch roll sensor will report the angles in a -9000 ... +9000 range, so we enter a scale factor of 100 in such cases. Again, please refer to the user manual of the sensor for more information.
The screenshot below shows an example configuration for a Tiltix dual-axis sensor. When using factory settings, these sensors listen at device address "7F". This particular device stores the X-axis in hundreds of degrees at register 0x00, and the Y-axis angle value is stored at register 0x02. For both values, the size of the values is two words (four bytes). Using these settings, you should be able to configure almost any Modbus-RTU enabled device in Hydromagic.
Configuration example for a Posital Fraba Tiltix dual axis sensor.
Unloading the Modbus-RTU plugin
To unload the Modbus-RTU plugin, open the preferences window by selecting "Preferences..." from the "Options" menu. In the window that appears, select the "Devices" tab. Next select the "Modbus-RTU plugin for dredging sensors" and click the "Remove..." button.
Select the Modbus-RTU plugin and click the "Remove..." button to unload the plugin.