This is a new Tutorial series that will be published about the Opto22-GRV-EPIC-PR1 Edge Controller. The first article will cover enabling the Codesys Runtime for the GRV-EPIC-PR1 Edge Controller, creating a project, and IO Configuration.
In order to build a groov EPIC processor and groov I/O module in the CODESYS development system, we need to add the Opto 22 Library Package.
Now, let’s get started.
GRV-EPIC?
The GRV-EPIC-PR1 Edge Programmable Industrial Controller is an embedded Linux-based, real-time controller with gateway functionality. This groov EPIC® processor provides control, connectivity, data processing, and visualization at the network edge, making it ideal for Industrial Internet of Things (IIoT) applications and various automation scenarios.
Beyond data collection, processing, display, and exchange, it can securely share data using open and up-to-date communication protocols with databases, cloud platforms, web services, PLC systems, and other systems and devices. Built-in security features include configurable device firewalls, VPN, encryption, and user authentication.
Additionally, data can be visualized on the controller’s built-in touchscreen, an external HDMI monitor, or accessed via a web browser or mobile device.
Hardware
The GRV-EPIC-PR1 features a high-resolution LCD display for I/O and network configuration, troubleshooting, and system HMI. It provides a robust unit with an easily accessible set of components when lifting the LCD display, including the power button, power connector, network interfaces, ports, and status LEDs.
Security
The groov EPIC processor is equipped with the following security features to establish a secure network:
- Two independent Ethernet interfaces
- Built-in, configurable firewall
- User accounts and authentication (account management through local or LDAP)
- Data encryption and security certificate management
Programmable
The GRV-EPIC-PR1 supports various programming methodologies for application development, including:
- PAC Control: A proven flowchart-based multi-chart control language.
- CODESYS Development System: Utilizes the CODESYS development system and runtime, compliant with the IEC 61131-3 standard.
- Node-RED: A visual programming tool for wiring together hardware devices, APIs, and online services.
- C, C++, Java, Python: These programming languages can be used for developing applications on the GRV-EPIC-PR1.
Note: The availability and specific versions of these programming options may depend on the specific configuration or software version of the GRV-EPIC-PR1.
Download Library Package
Download Library Packages for Opto22 from this link.
Install Packages
Next, start the Codesys IDE and click Tools>CODESYS Installer.
Click the Install File.
Select the Package you have just downloaded from the Opto22 homepage.
OK to proceed.
Continue.
If Codesys is open, close it and click “OK” to proceed.
Please wait a moment…
Done!
Enable Codesys Runtime
Next we need to enable Codesys Runtime on Opto22.
Enter the IP of Opto22 in the Browser.
Click on Processed to xxxx.
The Opto22 Web server screen appears.
Enter your User name and Password to login.
The administration screen of Done!groov is now displayed. From this screen, you can configure OPTO 22 settings, I/O status and Interface.
Open the Controller.
Next, click on CODESYS Controller.
The Codesys Runtime status of OPTO22 is now displayed, and operations such as enabling and disabling Codesys can be performed.
Click the Enable button in the Runtime Field to enable Codesys Runtime.
Opto22 has two Runtimes: PAC Controller and Codesys Controller. Please note that when one of them is enabled, the other Runtime System will be disabled.
Please wait a moment…
Your Opto22 EPIC Controller is now running Codesys.
Network
You can configure the network interface of the Opto 22 epic from the groovMANAGE screen.
Click on the Network button.
Click Configure to proceed.
You can configure the two Opto22 EPIC’s Ethernet Interface and Wi-IF and OpenVPN settings.
Ethernet 1 will be used this time, and the Default setting is DHCP.
Start!
We will now launch Codesys and build the IO Configuration.
New Project
Start Codesys and create a new Codesys project with New project.
Enter a project name and proceed.
Sets the device type for the Codesys project.
Select GRV-EPIC-PR1 (Opto 22) from the Drop-List in Device.
Here’s why you need to set up GRV-EPIC-PR1 (Opto 22): open groovMANAGE and click on Info and Help.
Click About for more information about the Controller.
GRV-EPIC-PR1 is shown in Processor>Part Name. Therefore, the Device Type in Codesys is GRV-EPIC-PR1 (Opto 22).
Let’s create a project in OK.
Done!
Scan
Next, scan Opto22 and connect it to the Codesys IDE by clicking on Device > Scan Network.
I found opto-04-a7-8e. Now there is only one device in the network, but if there is more than one Opto22, how do I know which one to connect to?
In the actual groovMANAGE screen, you can see your Codesys Controller name in Device Info>Name from the CODESYS Controller screen.
Proceed with Yes.
When activating Codesys for the first time, you may need to set the Device User.
Enter the User name and Password you have just set.
Done!
Download Missing Library
Every Device Type has almost the same error at the beginning and that is the problem of missing libraries.
Download the libraries you need by going to Library Manager>Download Missing Libraries.
Proceed with Download.
Done!
The Codesys IDE has also disappeared the error.
Add IOs
First add the CPUs that will communicate with IO Modules: Device>Right click>Add Device.
Ethernet
Add Ethernet Adapter>Ethernet.
Ethernet Interface has been added.
Browse
Specify the CPU Port to use for the Ethernet Interface.
eth0 is Port0 and eth1 is Port. Port1 will be used for this article.
Done!
Add Devices
Next add GRV-EPIC-PR1, right click on Ethernet>Add Device.
Add GRV-EPIC-PR1.
Done!GRV-EPIC-PR1 will be added and <Empty0-x> will be the module installed on the right side of the CPU itself.
Plug Device
Now add the IO module installed on the right side of GRV-EPIC-PR1 to the Codesys project.
The method is simple: right-click on each module in turn and use “Plug Device” to insert it, with Empty0 in Slot0 and Empty1 in Slot1.
Slot1
The Insert Module screen appears, listing all Opto22 modules.
The quickest way is to search.
You can easily find the module you want to insert by entering the module’s Keyword.
Module insertion is completed in Slot 0.
Slot2
Slot 2 has 12 DO points.
Slot3
Slot 3 has 12 temperature inputs.
Slot4
The last slot, Slot 4, is a 24-point voltage analog input.
Done!
Login
Download your project with Login from the Toolbar.
Proceed with Yes.
Finally, the Start button launches the application.
If Error?
I actually inserted a different module in Slot 1 than what was originally present in the physical device, and I downloaded the configuration to Opto 22. When I go online, Slot 0 has a red mark, indicating an issue.
Click on Slot0 to see the error from Status.
You can see the details of the error in Diagnostic.
To change the type of a module, right-click on a different module>Update Device.
Select the correct module and proceed with >Update Device.
When I logged in again, all modules now have a green ICON and are recognized without any problems.