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”.
You can edit the PDO by writing a value in the textbox. The value will be accepted if you click “Update RxPDO data”.
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”.
You’ll now see the “Device Data”. On this window you’re able to configure the device. Please make sure that the device has correct ip settings.
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”.
You can now manipulate the cyclic process data by click into “Output Data”.
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”.
You’ll now see the “Device Data”.
Choose the tab “I/O Data” on the bottom side and click “Connect” to establish a connection.
You can now manipulate the cyclic process data by click into “I/O Data O->T”. Accept data by checking “Enable Run” and clicking “Apply”.
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.
The following instructions are very similar to application 02_profinet, which is why they are described only briefly. Please refer to chapter 02_profinet if you need more detailed instructions.
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”.
You can now manipulate the cyclic process data by click into “Output Data”.
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 |