The Arduino Portenta Machine Control (PMC) is a fully-centralized, low-power, industrial control unit. For equipment and machinery control, industrial communication protocols, such as Modbus RTU over RS-485 and Modbus TCP/IP over Ethernet, can be implemented in the PMC. In this tutorial, we will learn about how to get started on how to configure the Modbus communication with the Arduino PLC IDE.
In order to configure the Portenta Machine Control you will need to connect to the device through the Arduino PLC IDE.
The device needs to be activated with a license, check the steps on the PLC IDE Set-up tutorial
Both Modbus RTU and Modbus TCP can run at the same time in parallel
Important: Once you use the Modbus Mode to Master/Slave the RS-485 ports will be only dedicated to Modbus, so the RS-485 protocol is not accessible while using Modbus
Inside the Arduino PLC IDE navigate to the left side panel and click on the "Resources" tab.
To configure the Modbus communication click on the "RS485 Serialport" label, it will open a new window in the middle to customize:
Then you can attach some functions to the Generic Modbus item, they will appear also in the Catalog Tile Window, you need to select first the Generic Modbus_01
Baud rate, options:
Name | Parity | data bits | stop bits |
---|---|---|---|
N, 8, 1 | No parity | 8 | 1 |
E, 8, 1 | Even parity | 8 | 1 |
O, 8, 1 | Odd parity | 8 | 2 |
N, 8, 2 | No parity | 8 | 2 |
O, 8, 2 | Odd parity | 8 | 2 |
(Only available on slave mode)
Once you have configured your device as a Modbus Master you can attach some blocks to configure it, you can see them while you have the RS485 SerialPort on the Catalog Tile Window
Important: Once you use the Modbus Mode, the Ethernet port will be only dedicated to Modbus, so the Ethernet protocol is not accessible while using Modbus
Inside the Arduino PLC IDE navigate to the left side panel and click on the "Resources" tab.
To configure the Modbus communication click on the "Ethernet" label, it will open a new window in the middle to customize:
Then you can attach some functions to the Generic Modbus item, they will appear also in the Catalog Tile Window, you need to select first the Generic Modbus device
Settings:
On the Generic
To configure the block you can click on it and it will show the configuration panel on the main window.
Inside each of the "devices" (functions) you can set its: General
Coil/Register/Table This is a table to link all the coils, registers or variables that the function is going to poll/write.