You are on page 1of 10

Application Note

Sending CI-commands over Ethernet


(CMMP)

A brief explanation on how to send CI-commands to a CMMP-...- CMMP-…-M0/M3


M0/M3 over Ethernet

100136
Title .................................................................................................. Sending CI-commands over Ethernet (CMMP)
Version ............................................................................................................................................................. 1.10
Document no. .............................................................................................................................................. 100136
Original .................................................................................................................................................................en
Author ............................................................................................................................................................. Festo

Last saved ............................................................................................................................................ 06.03.2017

Copyright Notice
This documentation is the intellectual property of Festo AG & Co. KG, which also has the exclusive copyright. Any
modification of the content, duplication or reprinting of this documentation as well as distribution to third par-
ties can only be made with the express consent of Festo AG & Co. KG.
Festo AG & Co KG reserves the right to make modifications to this document in whole or in part. All brand and
product names are trademarks or registered trademarks of their respective owners.

Legal Notice
Hardware, software, operating systems and drivers may only be used for the applications described and only in
conjunction with components recommended by Festo AG & Co. KG.
Festo AG & Co. KG does not accept any liability for damages arising from the use of any incorrect or incomplete
information contained in this documentation or any information missing therefrom.
Defects resulting from the improper handling of devices and modules are excluded from the warranty.
The data and information specified in this document should not be used for the implementation of safety func-
tions relating to the protection of personnel and machinery.
No liability is accepted for claims for damages arising from a failure or functional defect. In other respects, the
regulations with regard to liability from the terms and conditions of delivery, payment and use of software of
Festo AG & Co. KG, which can be found at www.festo.com and can be supplied on request, shall apply.
All data contained in this document do not represent guaranteed specifications, particularly with regard to func-
tionality, condition or quality, in the legal sense.
The information in this document serves only as basic information for the implementation of a specific, hypo-
thetical application and is in no way intended as a substitute for the operating instructions of the respective
manufacturers and the design and testing of the respective application by the user.
The operating instructions for Festo products can be found at www.festo.com/sp.
Users of this document (application note) must verify that all functions described here also work correctly in the
application. By reading this document and adhering to the specifications contained therein, users are also solely
responsible for their own application.

 (Festo AG & CO. KG, D-73726 Esslingen, 2017)


Internet: http://www.festo.com
E-Mail: service_international@festo.com
Table of Contents
1 Components/Software used ....................................................................................................................... 5
1.1 Usage .......................................................................................................................................................... 5

2 Short explanation for UDP .......................................................................................................................... 6

3 Creating the message ................................................................................................................................. 7


3.1 CI Terminal FCT ............................................................................................................................................ 7
3.2 Content of the UDP message ....................................................................................................................... 8
3.3 Calculating the Checksum ........................................................................................................................... 8
3.4 Complete message ...................................................................................................................................... 9

4 Sending the message with ‘Packet Sender’ ............................................................................................. 10


Components/Software used

1 Components/Software used

Type/Name Version Software/Firmware Date of manufacture

CMMP-AS-…-M3 General --
CMMP-AS-…-M0 General --

Table 1.1: Components/Software used

1.1 Usage
This document is very useful for applications were the old CMMP drives (without M0/M3) were used with the
RS232 port. Some PLC’s use this way of communication to change parameters inside the controller or start posi-
tioning jobs. Now that the new CMMP-...-M0/M3 controllers don’t have the RS232 port available anymore, this
can be used for easy adaptation.

Advantage:
– Applications were the RS232 port was used the CMMP can now be exchanged to M0/M3 variants without the
need of rewriting a lot of code. The message remains the same, it only needs to be send over Ethernet (UDP).

This document only describes the way the CI-command is implemented inside the UDP message. It does not ex-
plain in detail the way a UDP-message itself can be build. To send the UDP messages a free-ware is used:
“Packet Sender”.

Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10 Seite 5 von 10
Short explanation for UDP

2 Short explanation for UDP


An UDP message over Ethernet contains the following information:
– Ethernet-header
– IP-header
– UDP-header
– Message
– FCS (frame check sequence)

This document only describes how to fill the ‘Message’ part.

Seite 6 von 10 Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10
Creating the message

3 Creating the message

3.1 CI Terminal FCT


In this example we are going to change a parameter that represents the I²t-time for the Motor Current. The KO
for that object has value 0x0049. Reading the actual value with the CI-terminal in FCT will look like this:

0x02FAF080 = 50000000 (the value is written in 0,1 microseconds, so the value is 5000ms)

To change the value the command looks like this: (OW:0049:02625A00)

The CMMP replies with ‘OK!’, to check the value we can resend the Object Read command:

0x02625A00 = 40000000 (4000ms)

Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10 Seite 7 von 10
Creating the message

3.2 Content of the UDP message

To send the message over Ethernet we need to add some information. In total it contains the following:
– Transaction Identifier
– Identification
– Reserve
– Message
– Carriage return

The Transaction Identifier can be used to validate which reply send by the motor controller belongs to which
send message. To use this function, simply increase the Transaction Identifier with each send packet. If you
don’t want to use it, it can be set to 0000 (hexadecimal).

The Identification represents the username and has to be equal to what’s set in the CMMP. It can be changed
but at default it’s empty. So this part of the message is: “MTX “ (5 spaces after MTX).

The Reserve is set to “0000 “ (4 spaces after 0000).

The Message itself contains the CI-command and a Checksum. This checksum is added to check if the infor-
mation inside the CI-command is correctly send. Section 3.3 will explain how the checksum is calculated.

The Carriage Return is to end the message: “\r”.

3.3 Calculating the Checksum


To calculate the checksum we need to convert the CI-command to HEX-numbers using an ASCII to HEX converter:
http://www.asciitohex.com/ (I prefer this website, because the HEX-result is separated by spaces)

CI-command used in example: OW:0049:02625A00

Because the checksum must be added after the value a ‘:’ is used to separate them. This character needs to be
there when calculating the HEX value:

Message without checksum: OW:0049:02625A00:


Converted to HEX: 4f 57 3a 30 30 34 39 3a 30 32 36 32 35 41 30 30 3a

Seite 8 von 10 Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10
Creating the message

To calculate the checksum you need to add up all the HEX value’s. For this message the result is ‘0x3C1’.
Because the checksum can only contain 2 characters, a modulo (or mask) needs to be performed (0xFF).
The result is: ‘C1’

Message with checksum: OW:0049:02625A00:C1

PLEASE NOTE: The calculation is case sensitive. Since the HEX transformation from ASCII ‘ow’ is different than
‘OW’, the checksum is also different. The controller does not care if the message is low/high case, as long as the
checksum is correct according to the used characters.

3.4 Complete message


When combining all information the result is:

ASCII: 0001MTX 0000 OW:0049:02625A00:C1\r


HEX: 30 30 30 31 4d 54 58 20 20 20 20 20 30 30 30 30 20 20 20 20 4f 57 3a 30 30 34 39 3a 30 31 37 44 37 38 34 30 3a 44 30 0d

Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10 Seite 9 von 10
Sending the message with ‘Packet Sender’

4 Sending the message with ‘Packet Sender’


To send the UDP message a windows application can be used called ‘Packet Sender’. It’s a freeware available on
https://packetsender.com/

The following information is required:


– Name (not relevant to the message)
– Message (either ASCII or HEX)
– Address (IP-address of the CMMP)
– Port (8802 for CMMP)

After hitting the button ‘send’, the message is send. If everything is correct the controller should reply
Immediately with ‘OK!’:

Seite 10 von 10 Application Note – Sending CI-commands over Ethernet (CMMP) – 1.10

You might also like