It is important to ensure that the Modbus Service is running on Rubix Platform so that communication with the connected Modbus devices can occur.Using the Sidebar, click on the `Apps > Services` option. Once on the `Installed Apps` page, look for a tile called `Modbus`, with the coloured status icon for this service showing the current state. It should be green and labelled `Running`. If it is not `Running`, then ensure that the service `Enable` switch is ON/Green, and then click the `Restart` button . Refresh the page and check the status has become `Running`. If the `Modbus` tile is not visible, then the Modbus service will need to be installed (see the Rubix Platform: Installing and Updating Services)
Once we have confirmed that the Modbus Service is running, the Modbus Service can be accessed via the `Driver > Modbus Master` option in the Sidebar. If the `Driver > Modbus Master` option is not available see Rubix Platform: Customising the Sidebar.Add/Configure Modbus Networks
- Existing Modbus Networks can be edited by clicking the blue pencil icon on the left of the existing Modbus Network.
- A new Modbus Network can be added by clicking the `CREATE +` button at the top of the screen.
The settings for the networks are as follows:Network name - The network name is the name of the desired network. It is recommended you use the type of modbus communications (eg. LoRa or RS485-1 / RS485-2).Type - TCP this option is for Modbus over Ethernet/Network. RTU this option is for using Modbus over a wired RS485 or wireless LoRa network.Enable - Tick to enable the Modbus Network.Delay between points (ms) - This is the minimum time (in milliseconds) between the individual Modbus poll requests.Timeout - This is the time (in seconds) that the Modbus Service will wait for a response from the Modbus Device before moving on to the next Modbus poll.RTU parity - (RTU ONLY) Parity setting must match for all devices on the Modbus Network.RTU speed - (RTU ONLY) This is the BAUD RATE setting. Baud Rate setting must match for all devices on the Modbus Network.RTU stopbits - (RTU ONLY) Stop Bit setting must match for all devices on the Modbus Network.RTU bytesize - (RTU ONLY) Byte Size setting must match for all devices on the Modbus Network.RTU port - (RTU ONLY) Select from the dropdown the serial port that is used for the Modbus Network. For RS485-1/RS485-2 ports, use `/dev/tty/RS485-1` / `/dev/tty/RS485-2` RTU ports. respectively. For wireless LoRa Network, use `/dev/tty/XBEE-2`.IP - (TCP ONLY) This is the IP Address of the Modbus TCP Device (Gateway) that you are communicating with.Port - (TCP ONLY) This is the IP Address of the Modbus TCP Device (Gateway) that you are communicating with.Wireless LoRa Network
There should be a Modbus Network for Modbus Devices connecting via wireless (LoRa) to the Rubix Platform. We recommend naming this network `LoRa` for easy identification. The settings should match the settings shown below. See above for an explanation of what each of these settings pertain to.Network name - LoRaType - RTUEnable - TickedDelay between points (ms) - 6000Timeout - 5RTU parity - noneRTU speed - 38400RTU stopbits - 1RTU bytesize - 8RTU port - /data/socat/serialBridge1 (For an Rubix Compute 5)Wired RS485 Network (RS485-1 and/or RS485-2)
There should be a Modbus Network for Modbus Devices connecting via wired (RS485) to this Rubix device. We recommend naming this network `RS485-1` or `RS485-2` depending on which port on the Rubix device is used, these correspond to the labelled ports on the device. The settings should match the settings shown below. See above for an explanation of what each of these settings pertain to.Network name - RS485-1 or RS485-2 (depending on the port used)Type - RTUEnable - TickedDelay between points (ms) - 60Timeout - 1RTU speed - 38400RTU stopbits - 1RTU bytesize - 8RTU port - /dev/ttyRS485-1 or /dev/ttyRS485-2 (depending on the port used)
Modbus TCP (Ethernet) Network Settings
There should be a Modbus Network for Modbus Devices connecting via Ethernet/Networked to this Rubix device. We recommend naming this network based on the device that you are connecting to. See above for an explanation of what each of these settings pertain to.Network name - Name related to the Modbus Device/Gateway you are connecting to.Type - TCPEnable - TickedDelay between points (ms) - 60Timeout - 1IP - IP address of the Device/Gateway you are connecting toPort - Modbus Port of the Device/Gateway you are connecting to (this is a number)
Modbus Devices can be added to existing Modbus Networks. Click the previously created Modbus Network for the type of connection for the device to be added, this will bring you to the Modbus Devices page.Add & Configure Modbus Devices
- Existing Modbus Devices can be edited by clicking the blue pencil icon on the left of the existing Modbus Network.
- A new Modbus Devices can be added by clicking the `CREATE +` button at the top of the screen.
The settings for the Device are as follows:Device Name - The name of the device, use a naming convention to easily identify the specific device.Enable - If ticked, this enables the point.Supports Multiple r/w - This can be ticked if the Modbus Device supports reading/writing multiple registers at once. See your Modbus Device manual to confirm.Zero Mode - This can be ticked if your Modbus Device has registers starting at 0 instead of 1 (Ex. Holding Register 1 = address 400000, use Zero Mode;Holding Register 1 = address 40001 don't use Zero Mode).Ping Point - This specifies the point to be used as a Ping Point to check the device is online. Formatted as Function-Code:Address:Length (default value is 1:1:1).Address - The address of the point in relation to the Modbus NetworkOnce the settings are entered and `SAVE` has been clicked in the bottom right, wait a few minutes for the Modbus communication to be established. Once there is a connection with the controller, the Modbus Device will become a black row (instead of orange).
Modbus Points can be added to existing Modbus Devices. Click the previously created Modbus Device, this will bring you to the Modbus Points page for that Device.Add & Configure Modbus Point
- Existing Modbus Points can be edited by clicking the blue pencil icon on the left of the existing Modbus Device.
- A new Modbus Point can be added by clicking the `CREATE +` button at the top of the screen.
The settings for the point are as follows:Point name - The name of the point, use a naming convention to easily identify the specific point.Enable - If ticked, this enables the point.Writeable - If ticked, this enables values to be written to the modbus register for this point.Write Value Once - If ticked, this enables the point's values to be only written once on COV.COV Threshold - The amount the Modbus read value must change by in order to update the Point Present Value. For most Modbus Points this should remain at 0 (default).Function Code: This will automatically change depending on the other variables and does not need to be set.
- READ_COILS - Read only for coil type modbus points.
- READ_DISCRETE_INPUTS - Read only for discrete input coil type modbus points.
- READ_HOLDING_REGISTERS - Read only for holding register type modbus points.
- READ_INPUT_REGISTERS - Read only for input register type modbus points.
- WRITE_COIL/WRITE_COILS - Read/Write for coil type modbus points. Select WRITE_COIL or WRITE_COILS for writable coil registers, these options are interchangeable.
- WRITE_REGISTER/WRITE_REGISTERS - Read/Write only for holding register type modbus points. Select WRITE_REGISTER or WRITE_REGISTERS for writable holding registers, these options are interchangeable.
Data Type - The type of data variables expected.Data Endian - Refer to the Modbus Device manual to determine the correct data endian function.Register - The modbus register of the point.Register Length - This does not need to be set. It will be set automatically based on the Data Type.Point Round/Math SectionValue - This does not need to be set.Value Round - Rounding of the modbus read value to the specified number of decimal places.Math Operation - This is a basic equation (with the original point value as x) that modifies the present value based on the result of the set equation.Value Raw - Leave blank.Fallback Value - This is the value that will be written to the point if the priority array is null for all priorities. This can be left blank.Point Value Scale Section - Setting these properties will cause the raw read value to be scaled based on the values entered. Input -> Scale.input_min - This is the minimum input value to be expected.input_max - This is the maximum input value to be expected.scale_min - This is the minimum desired scale of the point; corresponds to input_min.scale_max - This is the maximum desired scale of the point; corresponds to input_max.After setting all of the desired and correct values in this pop-up, click the `SAVE` button in the bottom right to add this point to the device. Refresh the page and the point should be added. Once data has been read from the point, it will change from orange to grey.Point Actions
Individual points can be edited, deleted, or written to using the action buttons on the row of each specific point.Editing an Existing Point
Editing an existing point is as simple as clicking the blue pencil icon and entering the required data into the `Edit Point` pop-up. After entering the required edits to be made to the point, click `SAVE` to confirm these changes and apply them to the point.Deleting an Existing Point
Points can be deleted by clicking the red bin icon on the row of the point that is required to be deleted. Upon clicking the red bin icon, a confirmation pop-up appears, click `CANCEL` to cancel the deletion of the point, or click `CONFIRM`to proceed with the deletion of the point.Writing to an Existing Point
Data can be written to existing points by clicking the orange Modbus icon on the row of each specific point required to write. Once clicked, a pop-up will appear of the selected point, with two sections: point write, and point release priority. Enter in the desired values in to each section and click the blue `SEND` button to write this data on each individual item that has been entered. Click the `CLOSE` button when the data has been sent/written.