Skip to content

Commit

Permalink
[PC-1628] Opta: Getting Started with Modbus TCP using Arduino IDE (#2186
Browse files Browse the repository at this point in the history
)

* Initial commit - Early WIP draft w/ TCP PLC IDE Content struct minor cleanup

* Tutorial content update

* Tutorial content update (Example defined)

* Tutorial content update

* Tutorial content update (w/ Image shareholder)

* Tutorial content minor update

* Tutorial content minor update

* Tutorial content minor update

* Tutorial content update w/ graphic candidate

* Tutorial content update post-review

* Tutorial content update post-review linter patch

---------

Co-authored-by: TaddyHC <[email protected]>
  • Loading branch information
ArduinoBot and TaddyHC authored Sep 24, 2024
1 parent 7a19d2a commit 45e22ff
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ The installation wizard will provide all the required drivers, libraries, and co
For Modbus TCP communication, we will use two Opta™ devices and the PLC IDE.

#### Connection and Ethernet Switch Integration
<br></br>

Set up the connection by attaching the Ethernet LAN (RJ-45) cable to both devices using the `ETH RJ45` port. The following image provides a connection diagram for both devices:

Expand All @@ -114,7 +113,6 @@ Set up the connection by attaching the Ethernet LAN (RJ-45) cable to both device
The setup incorporates an Ethernet switch that monitors both Opta™ devices using the PLC IDE. This configuration not only links both Opta™ devices using the PLC IDE but also lets you employ a profile to observe information exchanges in real-time. We recommend using the setup with the Ethernet switch for this tutorial to ensure optimal communication between devices.

#### Field Deployment Setup
<br></br>

Once the Modbus connection is active, you can directly connect the Opta™ devices without the Ethernet switch in the field application. Furthermore, you have the flexibility to add more Modbus TCP compatible devices to the communication line, expanding the setup as needed. Refer to the following image for this configuration:

Expand All @@ -132,7 +130,6 @@ In any robust development environment, understanding the intricacies of project
We highly recommend reviewing [this tutorial](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license) before delving into the present tutorial.

#### Opta™ Basic Configuration
<br></br>

To configure the Modbus TCP communication, we need to know the IP address of each Opta™. When Opta™ is connected to a computer using the RJ-45 cable and the Ethernet switch, and the ethernet configuration is left as default, an IP address is automatically provided to Opta™ by the external *Dynamic Host Configuration Protocol (DHCP)* server. You will need to scan for the address and use that IP address as the device address of Opta™. To find the automatically assigned IP address, it is possible to use this [scanner](https://angryip.org/) to identify the address.

Expand All @@ -153,7 +150,6 @@ The configured IP address for Opta™ also serves to connect and develop within
Keep in mind that the correct configuration is key to work with PLC IDE and Opta™. Once the properties of the Opta™ devices are correctly set, we will be able to seamlessly connect to Opta™ and monitor the states of both devices.

#### Modbus TCP Client and Server Mode
<br></br>

The image below shows the interface we'll encounter when accessing the Modbus TCP configuration panel in the PLC IDE.

Expand All @@ -169,7 +165,6 @@ If the "Modbus TCP Master" option remains unchecked, the role of a Modbus TCP Se
When "Modbus TCP Master" is checked, both Client and Server roles are taken on by the Opta™ device. In this mode, precedence is given to the Client role. As a consequence, under the `Ethernet` configuration tab, the introduction of a *General Modbus Node* option can be observed, as will be detailed in the section that follows.

#### General Modbus Node Configuration
<br></br>

The General Modbus Node allows to add information regarding the devices compatible with the Modbus messaging service.

Expand All @@ -180,7 +175,6 @@ It will require you to fill in basic information under the `General` tab. The im
If you have added a General Modbus Node defining Opta™ as a Modbus TCP Master initially and unchecked the Client role later, the Node option will stay. However, the Node's configuration field will change and request for a Modbus address within the `1 ... 247` range.

#### PLC IDE Modbus Custom Editor
<br></br>

This is an alternative way of adding a Modbus node under the `Ethernet` configuration tab. To open the Modbus Custom Editor window, go to `Tools -> Run Modbus Custom Editor` on PLC IDE.

Expand All @@ -203,7 +197,6 @@ For those wishing to skip the step by step procedure, the complete example proje
In the sections that follow, the configuration of each Opta™, based on its designated role in Modbus TCP communication, will be detailed.

#### Modbus TCP Server Opta™
<br></br>

To set Opta™ as a Modbus TCP Server, navigate to the `Ethernet` tab located in the `Resources` panel of the PLC IDE. Since the `Modbus TCP Slave` mode is always enabled, you don't have to change any setting in the current window. Ethernet properties are essential for Opta™ to work properly with Modbus TCP, thus it requires a proper Ethernet configuration.

Expand Down Expand Up @@ -264,7 +257,6 @@ The Opta™ server device's task runs a simple counter and resets whenever the c
Upon completing these steps, you will have successfully configured an Opta™ device as a Modbus TCP Server. The next section will guide you through setting up another Opta™ as a Modbus TCP Client.

#### Modbus TCP Client Opta™
<br></br>

To set Opta™ as a Modbus TCP Client, begin by navigating to the 'Ethernet' tab found under the 'Resources' panel in the PLC IDE. Here, check the 'Modbus TCP Master' option. As previously discussed [here](#modbus-tcp-client-and-server-mode), this action will designate Opta™ as a Client. Do not worry about the greyed-out Server option.

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45e22ff

Please sign in to comment.