Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
SINAMICS S120 - Runtime
Description: This tutorial teaches you how to run PROFINET communication and check the resultsKeywords: SIEMENS, CP1616, PROFINET, IO Controller, SINAMICS, Runtime
Tutorial Level: INTERMEDIATE
This tutorial teaches you how to run IO Controller wrapper in comination with User Node from previous tutorial, monitor and check the results. We recommend using additional computer connected to X127 Ethernet port of SINAMICS S120 Control unit for easier monitoring and testing of PROFINET communication.
Run the launch file
If you have completed all configuration steps as described in previous tutorials, it is time to run existing launch file:
roslaunch siemens_cp1616_sinamics_s120_tutorial siemens_cp1616_sinamics_s120_tutorial.launch
If initialization succeded, you should notice red error indicators on CP1616 turn off, SINAMICS S120 Control unit LEDs turn to green and get the following terminal output:
[ INFO] [1447012600.608580433]: CP1616: Number of input modules: 2 [ INFO] [1447012600.608712340]: CP1616: Number of output modules: 2 [ INFO] [1447012600.608976244]: Input Data Array: [Total size: 28 bytes] [ INFO] [1447012600.609101169]: I512-515 cu_input_topic [4 bytes] [ INFO] [1447012600.609215920]: I516-539 drive_1_input_topic [24 bytes] [ INFO] [1447012600.609337639]: Output Data Array: [Total size: 28 byte] [ INFO] [1447012600.609454864]: Q512-515 cu_output_topic [4 bytes] [ INFO] [1447012600.609569135]: Q516-539 drive_1_output_topic [24 bytes] [ INFO] [1447012600.673885980]: Openning CP1616 in IO_controller mode: done [ INFO] [1447012600.676558793]: IO_controller mode change request-> OPERATE: [ INFO] [1447012600.685698690]: Changing IO_controller mode: done [ INFO] [1447012604.789913418]: IO Controller ready, communication started
NOTE: If initialization fails and return errors, please check if yaml config file meets the hardware configuration (addresses, sizes). If errors still occur, please refer to original siemens cp1616 documentation.
Check CP1616 Webserver
If you have configured webserver in HW config, you can connect to CP1616 LAN Port and monitor CP state through Webserver interface. If initialization succedded, CP1616 should report "OPERATE".
Monitor topics
First use rostopic list command line tool to get the list of all active topics:
$ rostopic list
For this tutorial example, rostopic list should return:
/cu_input_topic /cu_output_topic /drive_1_input_topic /drive_1_output_topic /rosout /rosout_agg
With default configuration, CP buffers are updated and synchronized with data on topics every 10ms. Using rostopic hz command line tool check if "drive_1_input_topic" is updated regularly.
average rate: 99.983 min: 0.009s max: 0.010s std dev: 0.00042s window: 99 average rate: 99.999 min: 0.009s max: 0.010s std dev: 0.00043s window: 199 average rate: 99.996 min: 0.009s max: 0.010s std dev: 0.00043s window: 299
NOTE: Tutorial node publishes data every 5 seconds, but synchronization with CP buffers still happens every 10ms.
STARTER Diagnostics
Using additional Windows computer allows you to monitor PROFINET communication while running CP1616 application on the Linux machine. To monitor data being transmitted from CP1616 to SINAMICS S120 Control unit, use STARTER commisioning tool. Topology of configured drive system is shown in the picture below:
"Communication" -> "Recieve direction" label shows telegram data coming from CP1616's User node. You can see that in this case all the data are being transmitted properly.
"Communication" -> "Transmit direction" label shows telegram data being sent to CP1616 User node.
DIagnostics -> Control/Status word is very convenient tool to monitor actual state of the drive:
If everything works properly you should see your drive moving. In this particular example half a turn to both sides in the endless loop with 5 second delay.