C3 TCP Connection - Explanation
C3 TCP Connection - Explanation
C3 ServoManager
How to use TCP communication
with I30 Ethernet Powerlink Interface
June 2012
Table of Contents
Overview.......................................................................................................... 3
Hardware requirements .................................................................................. 3
Software requirements.................................................................................... 3
Communication settings ................................................................................. 4
Supported upload/download functions........................................................... 5
What is not possible ? ..................................................................................... 5
Known bugs ..................................................................................................... 5
Special hints …................................................................................................. 6
Advanced
Overview
The new C3 ServoManager release R9.0 allows the user to use TCP/IP communication with Compax3. The C3 with
EPL acts in the Basic Ethernet Mode as Internet server and is permanently waiting for incoming connections.
Hardware requirements
This communication is possible with Compax3 which have an I30 Ethernet Powerlink interface option.
Software requirements
Compax3 firmware version: 4.5.4
Firmware Package Release: 2009R08-4
I30 fieldbus firmware version: 2.02
Communication settings
To use this communication select “Ethernet TCP settings (PC <-> C3)” from the options menu.
Settings:
Select the valid IP – address from your device.
Important: Set the port address to 44822
Device address: 0
Compax3 gateway: unselected
Known bugs
In some rare cases downloads (IEC61131 / CAM) will hang up the communication on Compax3 side, if this
occurs no tcp connection is possible and the device has to be reset by Power OFF/ON.
Special hints
Closing the TCP connection by Compax3:
After 30 seconds of communication inactivity Compax3 closes the existing TCP socket, this is different to the
RS232/RS485 communication. This behavior has no effect to the user. If the user wants to start a download or
upload the C3 ServoManager automatically reconnects to the Compax3 device.
The green status label shows the open tcp connection (via socket) with the Compax3
After 30 seconds C3 ServoManager closes the connection and the status changes to Red (closed)
There are 3 different communication protocols available to read/write objects by Index and Subindex.
The ASCII and Binary protocol are the same as used for the RS232/485 communication;
Up to 3 different clients can be connected at the same time to the TCP server port 44821.
1.2 IP address
For an EPL device the default IP address is 192.168.100.NodeID!
The last part of the address is the NodeID set by the address switch S24.
This can be overwritten with the value of object 860.3 (IpAdr), if this value is not 0.
If object 860.3 has a value !=0, object 860.5 (Netmask_Ip) must be set too.
2 ASCII - protocol
The general layout of an ASCII command string for Compax3 is as follows:
[Adr] command CR
Adr the optional address is insignificant
2.1 Command
A command consists of the representable ASCII characters (0x21 .. 0x7E). Lower cases are converted
automatically into capitals and blanks (0x20) are deleted, if they are not placed between two quotation
marks.
Separator between places before and after the decimal is the decimal point (0x2E).
A numeric value can be given in the Hex-format if it is preceded by the "$" sign. Values can be requested
in the Hex-format if the CR is preceded additionally by the "$" sign.
Commands requesting an Info-string (e.g. software version), are only acknowledged with the respective
ASCII character sequence followed by a CR, without preceding command repetition. The length of these
answer strings is here constant.
Commands transferring a value to Compax3 or triggering a function in Compax3 are acknowledged by:
>CR
if the value can be accepted resp. if the function can be executed at that point in time.
If this is not the case or if the command syntax was invalid, the command is acknowledged with
!xxxxCR
3 Binary protocol
The binary protocol with error detection is based on 5 different frames:
The start code defines the frame type and is composed as follows:
Bit 7 6 5 4 3 2 1 0
Rsp Antwort 0 0 0 0 0 1 0 1
Bit 7,6,5 and 4 of the start character are the identifier for the frame type; bit 2 is always 1.
Bit 3, 1 and 0 have different meanings for the request and response frame.
Request_Frame
Address flag (Bit 0 = 1 ) indicates a following address byte
Gateway flag (Bit 1 = 1) indicates that this frame has to be routed to another destination
POP flag (Bit 3 = 1 ) activates the special Parker Operation Panel data format conversion
Response_Frame
Bit 0 und 1 are used to identify the response
Bit 3 always 0
The maximum number of data bytes in the request telegram is 256, in the response telegram 253.
The error detection with CRC16 is made via the CCITT table algorithm for all characters.
After receiving the start code, the timeout monitoring is activated in order to avoid that Compax3 waits
in vain for further codes (e.g. connection interrupted).
The timeout period between 2 codes received is fixed to 5ms (5 times the code time at 9600Baud)
C3 response, if access to the object was denied (e.g. function cannot be executed at that point in time or
object has no reading access). The error no. is coded according to the CiA Device Profile DSP 402.
0xAX n-1 Index1(Hi) Index1(Lo) Subindex1 Index2(Hi) Index2(Lo) Subindex2 ... ... 0x.. 0x..
The "CRC16" variable is set to before starting the calculation for a frame.
C3 checks the CRC value on receipt and reports CRC error in the case of a deviation.
CRC function:
return crc16;
At this time the C3 is not checking the received CRC value but it always transmits the correct CRC value.
4 HIO8 protocol
This protocol gives the possibility to have access to the C3 objects in 2 different data formats; the C3
format as known from the Binary protocol and the FBI format as known from the fieldbuses (CANopen,
Profibus, EPL).
The 20 byte long request and response frame consists of a 4 byte segment header and a 16 byte data
section.
Index: Object Index; Idh = high byte, Idl = low byte D0...D15: Data; D0 = high byte, D15 = low byte
Len: Object Length (Number of values of the data type) DT: Data type
4.4 Request-/Response-Coding
Request/Response-Header Data
Response:
0 1 - 6 0 0 - - - - - - - - - - - - - -
1 1 - 6 EH EL - - - - - - - - - - - - - -
Response:
1 1 - 6 EH EL - - - - - - - - - - - - - -
ASTR, OSTR
1. Chr. 2. Chr. 3. Chr. 4. Chr. ... ... ... ... ... ... ... ... ... ... 15. C 16. C
High Low High Low High Low High Low High Low
I48, F48
1. Value 2. Value
REAL
1. Value 2. Value
VISIBLESTRING, OCTETSTRING
1. Chr. 2. Chr. 3. Chr. 4. Chr. ... ... ... ... ... ... ... ... ... ... 15. C 16. C
High Low High Low High Low High Low High Low High Low High Low High Low
0 = X_MEM 0 = ASTR
0 1 = Y_MEM 1 = OSTR
2 = I24
2 = P_MEM
3 = F24
x x 3 = L_MEM 4 = ADR
0 = CMD_0 5 = I48
1 1 = CMD_1 6 =F48
2 = CMD_2 7 = REAL
Coding Integer8/16/32
Octet
The highest order bit (MSB) is the
bit after the sign bit (S) in the first
Integer8 1 S 26 25 24 23 22 21 20
octet.
S == 0: positive numbers & zero; Integer16 1 S 214 213 212 211 210 29 28
S == 1: negative numbers
2 27 26 25 24 23 22 21 20
4 27 26 25 24 23 22 21 20
Coding Unsigned8/16/32
Octet
Unsigned8 1 27 26 25 24 23 22 21 20
2 27 26 25 24 23 22 21 20
4 27 26 25 24 23 22 21 20
Bit 8 7 6 5 4 3 2 1
Exponent (E)
Octet 1
S 27 26 25 24 23 22 21
Fraction (F)
3
2-8 2-9 2-10 2-11 2-12 2-13 2-14 2-15
Fraction (F)
4
2-16 2-17 2-18 2-19 2-20 2-21 2-22 2-33
Octet
The highest order bit (MSB) is the
bit after the sign bit (S) in the first N2 1 S 20 2-1 2-2 2-3 2-4 2-5 2-6
octet.
S == 0: positive numbers & zero; 2 2-7 2-8 2-9 2-10 2-11 2-12 2-13 2-14
S == 1: negative numbers
1 S 20 2-1 2-2 2-3 2-4 2-5 2-6
Scaling factors
Y2 scaling factors are the objects 200.x and Y4 scalling factors are the objects 201.x
Bit 0..4 defines the number of decimal places respectively number of bits of the fractional part