Click on "Custom devices" menu and follow these steps:
- Click in "New custom device" button or in "Import device" button if you have a JSON file already created.
- Introduce a "Device name" (for example, Circutor CVM-mini) and click in "Add Subdevice"
- Click in "Add Service" to start configuring the corresponding device and fill the following fields:
- Initial Register (address): is the initial modbus register (address) (an integer between 0 and 65535). #Note that "Address" is the "Register-1"
- Type Register: is either: 'input' or 'holding'
- DEXCell service: is the dexcell service identificator. You can find them here.
- Operation: nothing, multiply, divide or sum.
- Operand: is the operand of the operation. For example, in the kW to W case, we would set the operand value to 1000 to set the divisor of the operation to 1000.
- Type value: uint8_msb, int8_msb, uint8_lsb, int8_lsb, uint16, int16, uint32, int32, uint32inv, int32inv, uint48, int48, uint64, int64, float
- If you want to add additional services for the same subdevice, click on "Add Service"
- For additional subdevices under the same "Custom device" click on "Add Subdevice"
- When you finish to configure all the devices, click on "Save Device" to apply changes.
- After creating a file called "yourdevice" you'll need to add a line "customdevice.yourdevice=" in your modbus configuration file followed by the modbus addresses of your custom devices. For example if your device is called Circutor-CVM-mini and it has the modbus addres 13 you'll use this line:
MASTERING CUSTOM DEVICES:
Creating a Custom device is not different than integrating a Modbus device into DEXGate2 but in an easier way than writng code. However, we need some previous concepts and some checks have to be performed in order to be sure that we are doing things right.
The most important thing when starting a custom device, is to understand that you are trying to read and translate Hexadecimal numbers that are stored in a certain device, and that you want to convert them to the reading you need following a predefined schema, that depends on that specific device. This means that the first thing you need is the Modbus Registers Table that usually can be found in the device Manual, and that explains the way to read and transform these Hexadecimal numbers to get useful information.
Creating a Custom device is just defining how the DEXGate2 has to read a certain device, to get the Modbus registers we need, and transform them into the correct parameter and units to insert it into DEXCell.
But even before starting the custom device you should check previously that you can read those Modbus registers (that there is Modbus communication), and this has to be performed through the Read & Write Register feature in DEXGate2.
If you don't check that you can read the registers before you create the Custom Device, three things can happen:
1- All works correctly and you're done
2- Communication is fine but you get errors because the custom device is wrong defined
3- The custom device is fine but you get errors because communication is not working
In the second and third options you'll be totally lost until you check if there is communication. Once you are sure you can read those registers, then you can start defining how to play with them ;)
*NOTE: Remember that DEXGate2 is set by default to 9600 Bd, 8 data bits, 1 stop bit and parity N. Please check that all the devices in the RS485 BUS have the same values.
Also, while you are creating the custom device you can have doubts about the correct way to read the registers (holding or input, INT32 or UINT32, etc.) and looking at the hexadecimal registers can help you to understand what you are doing ( if a certain registry is empty, for example).
The best you can do when starting a custom device, is trying to read at least one of the registers you want to integrate, and then try to convert it manually to the expected value. This will give you the peace of mind of doing things well.
To convert the Hexadecimal values to decimal values, there are lots of different tools, from excel to online calculators.
Here you can find a link to scadacore.com online calculator that makes Hexadecimal conversions to different formats INT32 float UINT16 etc, and will help you understand what you have to define in the Custom device to obtain the reading given by the analyzer.
Online Hex Converter
The first time you face a Modbus integration, it seems impossible, but once the first is done you will have any Modbus device at your fingertips
We also reccomend you to take a look to our Hardware webinar, where you will find some interesting tips about how to configure your Modbus devices in DEXGate2