Motion Master
|
This documentation provides an overview of the Ethernet Client, a static C++ library designed for efficient Ethernet communication with SOMANET Integro devices.
Note: To use this library, your SOMANET Integro device must have Ethernet firmware installed.
The pre-built static library and examples are available in this public repository.
An HTTP server application is available that wraps this library and exposes its functionality through HTTP endpoints. A web-based user interface (UI) is also included. Both the server installer and the UI can be accessed here: http://motion-master-console.synapticon.com/ethernet
To establish communication, the SOMANET Integro device must have a valid IP address. This can be configured in one of two ways:
Handles TCP communication with SOMANET devices over Ethernet.
This class provides methods for connecting to a remote server, sending messages, and receiving responses over a TCP connection using Boost.Asio. It manages the underlying socket, connection, and I/O operations required for client-server communication.
All message exchanges with the device are designed to be thread-safe.
Create an instance of the EthernetDevice class by specifying the device's IP address and port number:
Then, connect to the device with:
When the device is powered on, it will automatically transition to the OPERATIONAL state, which you can check with:
Most request functions support an optional expiryTime
parameter of type std::chrono::steady_clock::duration
. This specifies the maximum time to wait for a response from the device before a timeout error is triggered. For example:
To read a device parameter value (e.g., 0x6079: DC link circuit voltage), use:
The returned value is a vector of uint8_t representing a raw data buffer.
To write a device parameter value (e.g., 0x607A: Target position), use:
There's a better, type-safe way to read and write parameter values. It requires first loading the parameters:
This loads parameter metadata from the device into an internal parameter map. Refer to the common::Parameter class for more details. Once the Ethernet device has its parameters loaded, you can upload (read) and download (write) parameters using concrete types. These operations will automatically update the stored parameter value.
You can also retrieve a parameter and check its value after upload or download:
To read a file from the device:
To write a file to the device:
If you write app_firmware.bin
or com_firmware.bin
, you must trigger a firmware update afterward:
To read the list of available files:
To remove a file from the device:
Process data exchange works similarly to SDO communication. You can either use raw data buffers or a simplified, parameter-based interface.
Raw buffer example:
With the simplified interface, start by loading parameter metadata:
Then retrieve and modify a parameter value, for example:
To perform the process data exchange and automatically update parameter values based on the PDO mapping:
This will send all mapped RxPDO parameter values, receive TxPDO values from the device, and update the corresponding local parameters.
Note: The PDO map is currently static and defined internally by the EthernetDevice. In future versions, it will be dynamically refreshed when
loadParameters()
is called.
Download the DHCP Server
Download the DHCP Server for Windows from https://www.dhcpserver.de/cms/download/.
Extract the Server Files
Extract the contents to C:\dhcpsrv2.5.2
.
Add Configuration File
Copy the dhcpsrv.ini
file into the extracted folder (C:\dhcpsrv2.5.2
).
192.168.100.1
255.255.255.0
C:\dhcpsrv2.5.2\dhcpsrv.exe
.SERVER_0 > DHCP Clients
, you should see the assigned IP 192.168.100.5
, indicating the device successfully received its address from the DHCP server.com_motion-drive...
file to test_com_firmware.bin
.test_com_firmware.bin
to the same directory where integro_sock_client.py
is located.python.exe .\integro_sock_client.py -t write_file_boot test_com_firmware.bin
python.exe .\integro_sock_client.py -t update_firmware
cversion
to retrieve the firmware version.bversion
to retrieve the bootloader version.