iRJ45 / SoM - uGOAL Examples
01_ethercat
This example implements an EtherCAT slave. It supports dynamic PDO mapping and dynamic PDO assignment.
Configuration
Following all configured objects:
Index | SubIndex | Name | DataType | Description |
0x200c | 0x00 | application object | UINT32 | example object |
0x200d | 0x00 | application object | UINT32 | example object |
0x200e | 0x00 | application object | UINT32 | example object |
0x200f | 0x00 | application object | UINT32 | example object |
0x6000 | 0x01 | Read State 8 Input Lines (SI1) | UINT8 | digital input data |
0x6000 | 0x02 | Read State Input Lines (SI2) | UINT8 | digital input data |
0x6200 | 0x01 | Write State 8 Output Lines (SI1) | UINT8 | digital output data |
0x6200 | 0x02 | Write State 8 Output Lines (SI2) | UINT8 | digital output data |
0x6401 | 0x01 | Read Analog Input 16 Bit (SI1) | UINT16 | analog input data |
0x6401 | 0x02 | Read Analog Input 16 Bit (SI2) | UINT16 | analog input data |
0x6411 | 0x01 | Write Analog Output 16 Bit (SI1) | UINT16 | analog output data |
0x6411 | 0x02 | Write Analog Output 16 Bit (SI2) | UINT16 | analog output data |
By default all PDOs are active (objects 0x1C12, 0x1C13):
TxPDOs: 0x1A00, 0x1A01
RxPDOs: 0x1600, 0x1601
The default PDO mapping is following:
RxPDO 0x1600:
Object 0x6200:0x01 (digital Outputs 1 – 8)
RxPDO 0x1601:
Empty
TxPDO 0x1A00:
Object 0x6200:0x01 (digital Inputs 1-8)
TxPDO 0x1A01:
Empty
Content of the receive and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
8 .. 8 | Object 0x6200:0x01 |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 4 | Object 0x6000:0x01 |
Supported Platforms
Platform | Supported |
---|---|
NO* | |
YES | |
linux | YES |
YES (disable logging) | |
lpc55s69 | YES |
*This example doesn’t start properly due to insufficient RAM.
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device (see here), connect it to your computer and start the Industrial Communication Explorer.
The content of the EEPROM of the SoM must match the appropriate application. Please refer to this page, to write the ESI to the EEPROM to ensure full EtherCAT functionality.
Click right on your network interface and choose “Enable EtherCAT” as shown in the figure.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator” and click “Refresh Device Info”.
Choose the tab “Object Dictionary” and click “Read Object Dictionary Info” and “Read all object values”.
You can change the default mapping in the tab “PDO Mapping”.
Run a cyclic connection through choosing the tab “I/O Data” and clicking “Start process data exchange”.
02_profinet
This is a simple profinet example which creates two modules with each 128 byte of input data and output data. Data from slot 2 is mirrored to slot 1. The modules are handled by RPC calls, thus a update cycle of only 100ms is possible. The cyclic channel is only used for the LEDs.
Configuration
The device configuration is following:
Slot | Subslot | Module |
1 | 1 | 128 Byte Input data |
2 | 1 | 128 Byte Output data |
Record Index | Data |
0x7000 | 3 byte of parameter data (read/write) |
The GSDML file for this example is located beside the application code: "projects/ugoal/02_profinet/gsdml/".
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES |
lpc55s69 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device (see here), connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “PNIO Master” and click “Scan Device”.
Choose the tab “I/O” on the bottom side and click “Load GSDML File” - choosing the file “projects/ugoal/02_profinet/gsdml/*.xml”.
Plug the 128 bytes Input and Output module into the device slots per drag and drop according to shown figure.
Expand the modules in the bottom view, click the PC/CS “0/128” and choose “Edit”. Change the “IOPS Data State” into “Good” and accept with “OK”.
03_eip
This example demonstrates an EtherNet/IP slave. It supports operating with or without
the data mapper.
If the datamapper is enabled, operation of process data is executed within the EtherNet/IP
callback routine main_eipCallback
.
If the datamapper is not enabled, process data is operated within the simple api specific callback function som_dataCb
, which gives access to the raw SPI frame.
Configuration
This example requires a DHCP server to obtain an IP address. The device configuration is following:
Assembly ID | Size | Properties |
150 | 32 | Output Data |
100 | 32 | Input Data |
151 | 10 | Configuration Data |
The EDS file for this example is located beside the application code: "ugoal\example\03_eip".
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
8 .. 39 | Output Data of assembly |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 35 | Input Data of assembly |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES |
lpc55s69 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “EtherNet/IP Master” and click “Scan Device”.
Choose the tab “I/O Data” on the bottom side and click “Connect” to establish a connection.
04_profinet_dyn_modules
This example demonstrates dynamic module handling. The modules process data is handles over RPC.
Configuration
By default no IP address is set. Using a configuration tool (e.g. Industrial Communication Explorer) a valid configuration must be provided
To operate the following modules need to be plugged:
Slot | Module |
---|---|
1 | 64 bytes Input |
2 | 64 bytes Output |
The cyclic channel is used for the LED status.
The GSDML file for this example is located beside the application code: "projects/ugoal/04_profinet_dyn_modules/gsdml/*.xml"
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES |
lpc55s69 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “PNIO Master” and click “Scan Device”.
Choose the tab “I/O” on the bottom side and click “Load GSDML File” - choosing the file “ugoal/example/04_profinet_dyn_modules/gsdml/*.xml”.
Plug the 64 bytes Input and Output module into the device slots per drag and drop.
Expand the modules in the bottom view, click the PC/CS “0/64” and choose “Edit”. Change the “IOPS Data State” into “Good” and accept with “OK”.
05_ccm
This example shows a very basic application. No fieldbus is started. The application reads and writes some CM variables.
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES |
lpc55s69 | YES |
06_ethercat_minimal
This EtherCAT example demonstates a simple EtherCAT slave. It contains five each 32 bit wide objects (0x2000, 0x2001, 0x200D, 0x200E, 0x200F) - 0x2000 and 0x2001 are mapped to each a receive and a transmit PDO. Additionally, the feature EtherCAT Distributed Clocks (DC) will be activated, if the platform supports it. The DC Sync signals increment two application variables triggered by an interrupt on the platform.
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
8 .. 11 | Output Data |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Input Data |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
YES (including EtherCAT DC) | |
lpc55s69 | YES (including EtherCAT DC) |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click right on your network interface and choose “Enable EtherCAT” as shown in the figure.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator” and click “Refresh Device Info”.
Choose the tab “Object Dictionary” and click “Read Object Dictionary Info” and “Read all object values”.
Run a cyclic connection through choosing the tab “I/O Data” and clicking “Start process data exchange”.
07_http_ip_management
This example demonstrates usage of the web server. The example provides a web site which shows the current IP configuration of the device. Beside that a configuration of the IP configuration is possible. Either a static IP address of DHCP can be configured. Just fill in the values in the form and submit the configuration using the “Configure “ button.
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | No (insufficient RAM) |
rl78/g14 | No (insufficient RAM) |
linux | YES |
stm32g01/stm32f103 | YES |
lpc55s69 | YES |
08_pnio_max_data_rpc
This example demonstrates the maximum of transferrable data via Profinet. It processes 1434 Byte of data per direction (input and output) over RPC and mirrors the output into the input module. For further informations see also the application note 008 - Extending process data using RPC transport.
Configuration
By default no IP address is set. Using a configuration tool (e.g. Industrial Communication Explorer) a valid configuration must be provided,
To operate the following modules need to be plugged:
Slot | Module |
---|---|
1 | 1434 bytes Input |
2 | 1434 bytes Output |
The cyclic channel is used for the LED status.
The GSDML file for this example is located beside the application code: "projects/ugoal/08_pnio_max_data_rpc/gsdml/*.xml"
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | NO (insufficient RAM) |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES (double CONFIG_UGOAL_HEAP_BUFFER_SIZE) |
lpc55s69 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “PNIO Master” and click “Scan Device”.
Choose the tab “I/O” on the bottom side and click “Load GSDML File” - choosing the file “projects/ugoal/08_pnio_max_data_rpc/gsdml/GSDML-V2.35-portGmbH-irj45-20200717.xml”.
Plug 1434 bytes Input module in slot 1 and Plug 1434 byte Output module in Slot 2
Expand the modules in the bottom view, click the PC/CS “0/64” and choose “Edit”. Change the “IOPS Data State” into “Good” and accept with “OK”.
To establish a cyclic connection you can also use the software CODESYS.
09_pnio_io_mirror_new_api
This profinet slave example contains a fully functional profinet slave. There are 4 modules (slot 1 to 4) pre-allocated with modules which are mapped. Thus these modules are updated in a 1 ms cycle.
The function goal_pnioDmSubmodPlug maps the ioxs status and the process data of the given module to the cyclic channel. This example expects a input module with 32 bytes on slot 5 and an output module with 32 bytes in slot 6. Then data from slot 6 is mirrored to slot 5.
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
TODO |
|
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
TODO |
|
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | YES |
stm32f103rb | YES |
linux | YES |
rl78/g14 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “PNIO Master” and click “Scan Device”.
Choose the tab “I/O” on the bottom side and click “Load GSDML File” - choosing the file “projects/ugoal/09_pnio_io_mirror_new_api/gsdml/GSDML-V2.35-portGmbH-irj45-20200717.xml”.
Plug 32 bytes Input module in slot 5 and Plug 32 byte Output module in Slot 6
Expand the modules in the bottom view, click the PC/CS “0/64” and choose “Edit”. Change the “IOPS Data State” into “Good” and accept with “OK”.
Configuration of buffer sizes for data handling
Please refer to the application note regarding configuration of the RPC buffers. Initially those buffers are set to sufficient sizes for simple applications. This is done to support smaller targets. If the application requires handling of larger data buffers, those configuration options need to be configured by the user.
10_ethercat_rpc
This EtherCAT example demonstates extending process data beyond the capacity of the data mapper (64 byte). It is possible to map up to 124 Bytes in each communication direction. It contains two each 32 bit wide arrays (0x2000, 0x2001) with 4 subindices. Beside that there are two each 31 byte wide arrays (0x2002, 0x2003) with 4 subindices.
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | NO |
stm32f103rb | YES |
linux | YES |
YES (disable logging) | |
lpc55s69 | YES |
Process data mapping
Within the application the values of objects which can be mapped to PDOs are mirrored in the following order:
0x2003:1...4 -> 0x2002:1...4 (except the byte representing the subindex, this byte is set to 0x00)
0x2001:1...4 -> 0x2000:1...4
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click right on your network interface and choose “Enable EtherCAT” as shown in the figure.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator” and click “Refresh Device Info”.
Choose the tab “Object Dictionary” and click “Read Object Dictionary Info” and “Read all object values”.
Run a cyclic connection through choosing the tab “I/O Data” and clicking “Start process data exchange”.
11_eip_rpc
This example demonstrates the maximum of transferrable data via EtherNet/IP. It processes 509 Byte T-->O and 505 Byte O-->T of data over RPC and mirrors the output into the input module. For further informations see also the application note 008 - Extending process data using RPC transport.
Configuration
This example requires a DHCP server to obtain an IP address. The device configuration is following:
Assembly ID | Size | Properties |
150 | 505 | Output Data |
100 | 509 | Input Data |
151 | 10 | Configuration Data |
The EDS file for this example is located beside the application code: "ugoal\example\11_eip_rpc".
Content of the receive frame and transmit frame
Receive frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 7 | Generic Data Provider |
8 .. 39 | Output Data of assembly |
Transmit frame as following:
Position | Content |
---|---|
0 .. 3 | CTC header |
4 .. 35 | Input Data of assembly |
Supported Platforms
Platform | Supported |
---|---|
atmega2560 | No (insufficient RAM) |
stm32f103rb | Yes |
linux | Yes |
rl78/g14 | Yes (double CONFIG_UGOAL_HEAP_BUFFER_SIZE) |
lpc55s69 | YES |
Establish a connection
To establish a cyclic connection you can use the Industrial Communication Explorer. Flash the device, connect it to your computer and start the Industrial Communication Explorer.
Click the button “Scan Network” to find the device.
Choose the found device in “Network Navigator”, choose the tab “EtherNet/IP Master” and click “Scan Device”.
Choose the tab “I/O Data” on the bottom side and click “Connect” to establish a connection.