Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.sao.ru/drabek/automations/BTA/Movidyn/09228764.pdf
Äàòà èçìåíåíèÿ: Mon May 30 01:00:00 2005
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 17:14:42 2016
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: http www.astronomy.ru forum index.php topic 4644.0.html
MOVIDYN® Servo Controller
Manual Communications Interfaces
Edition 01/97

16/042/95

0922 8764 / 0197


2

MOVIDYN ® Communications Interfaces


Table of contents
Table of contents 1 2 Introduction .............................................................. 4 Function of the Interfaces ................................................... 6 2.1 Execution principles of the communications protocol ....................... 6 2.1.1 Description of MOVIDYN® message types ................................ 7 2.1.1.1 ENQUIRY frame .................................................... 8 2.1.1.2 DATA frame........................................................ 9 2.1.1.3 LONG_DATA frame .................................................. 9 2.1.1.4 SELECT frame ...................................................... 9 2.1.1.5 LONG_SELECT frame ................................................ 9 2.1.1.6 ACK frame ......................................................... 9 2.1.1.7 NACK frame ....................................................... 9 2.1.2 Application examples ............................................... 10 2.1.2.1 Reading the heat sink temperature of the axis module ...................... 10 2.1.2.2 Writing ramp 1 to CW ............................................... 11 2.1.2.3 Writing an IPOS variable ............................................. 11 2.1.2.4 Reading an IPOS variable ............................................ 12 2.1.3 Description of message types for API /APA .............................. 13 2.1.3.1 ENQUIRY frame ................................................... 15 2.1.3.2 SELECT frame ..................................................... 15 2.1.3.3 DATA frame....................................................... 16 2.1.3.4 ACK frame ........................................................ 16 2.1.3.5 NACK frame ...................................................... 16 2.1.3.6 Application example ................................................ 18 RS-232 interfaces ........................................................ 20 3.1 Technical data of the RS-232 interfaces ................................. 20 3.2 Connection to the RS-232 interface .................................... 20 RS-485 interfaces ........................................................ 21 4.1 Technical data of the RS-485 interfaces ................................. 21 4.2 Connection to the RS-485 interface .................................... 21 Control of the direction of communication on the serial interfaces . . . . . . . . . . . . . . 22 Interface monitoring functions .............................................. 24 6.1 Timeout monitoring during data transmission ............................ 24 6.2 Timeout monitoring in remote mode ................................... 24 Communicating with a PLC................................................. 7.1 System requirements ............................................... 7.2 Initializing the PLC module CP523 in the application program ................ 7.3 Example: Reading the heat sink temperature ............................. 7.4 Example: Writing the parameter "T11 ramp up" ........................... 25 26 26 27 28

3

4

5 6

7

APPENDIX APPENDIX 1 List of all API/APA error messages which may be accessed via the interface ................ 30 a) Error messages during data transmission .................................... 30 b) Asynchronous error messages ............................................ 31 APPENDIX 2 Additional API/APA interface commands ............................................ 31

MOVIDYN ® Communications Interfaces

3


Introduction 1 Introduction

The MOVIDYN® servo controllers are provided with several interfaces which permit the exchange of data with other units. The RS-232 is primarily used for the connection of a PC, whereas the RS-485 allows signals to be received directly. The option pcbs offer further possibilities for connecting other units. The functional independence of the interfaces and the resultant combinability of the option pcbs ensure a great degree of flexibility and a wide scope of application and allow a multitude of communications concepts to be implemented. The following figure shows the interfaces and option pcbs which are currently available.
Modular controller with brake chopper RS-485 link via DBK..

Option pcbs AIO11 Inputs/outputs RS-232 APx12 Positioning control

MPB... RS-485 (X02) RS-232 (X01)

MAS...

MAS...

Option pcb slot

Option pcb slot

AFI11 INTERBUS-S AFP11 PROFIBUS

Modular controller with mains energy feedback RS-485 link via DBK..

MPR...

MAS...

MAS...

Option pcb slot

Option pcb slot

RS-485 (X02) RS-232 USS11 (X01)

AFC11 CAN bus

Compact ser vo controller MKS...

Option pcb slot

RS-485 (X41) RS-232 USS11 (X2)

The controller can be linked to other controllers via an RS-485 inter face.

Figure 1: Interfaces for the MOVIDYN

®

servo controller family

00210AEN

Each power supply module and each compact servo controller comes with an RS-485 interface as a basic feature. The RS-232 interface comes standard on MPB... power supply modules with brake chopper. The MKS... compact servo controller and the MPR... power supply module with mains energy feedback can be fitted with the USS11 option pcb which offers an RS-232.

4

MOVIDYN ® Communications Interfaces


Introduction
Options AIO11 The AIO11 option provides additional analog and digital inputs/outputs as well as an RS-232 serial interface. APx12 The APx12 options provides single-axis positioning control with an interface for incremental encoders (API12) or an SSI interface for absolute encoders (APA12). The data protocols for setting parameters and programming the APx differ from those used for setting parameters in the MOVIDYN® servo controller. They are discussed in Section 5. AFI11 The AFI11 option provides an INTERBUS-S interface to DIN 19258. It allows not only fast process data exchange but also complete adjustment of the servo controller parameters. AFP11 The AFP11 option provides a PROFIBUS interface (DP, FMS slave) to DIN 19245. It allows control and complete parameter adjustment of the servo controller. AFC11 The AFC11 option provides a CAN bus interface to CAN specification 2.0 Parts A and B. It allows control and complete parameter adjustment of the servo controller. USS11 The USS11 option converts the signal levels of the X01 interface of the MPR... servo controller and the X2 interface of the MKS... controller to RS-232 signal levels. An automation unit or a PC can be connected to the 9-pin type D socket using a standard interface cable. This enables the user to set parameters and control the servo controller (e.g. with the MD_SHELL user interface). This documentation only discusses the function and mode of operation of the serial interfaces. The communications protocol is dealt with in detail and examples are given to illustrate its use. For a detailed description of the AIO11 option pcb please refer to the "MOVIDYN® Servo Controller" Catalogue. All other option pcbs are dealt with in a separate user manual each.

MOVIDYN ® Communications Interfaces

5


Function of the interfaces 2 Function of the interfaces

The unit interfaces (RS-232, RS-485, interfaces on option pcbs) allow all the servo controller parameters to be adjusted and enable all internal and external unit conditions (actual values, terminal signals) to be read.

Note that it is not possible to use both interfaces on the basic unit (RS-485/RS-232 or RS-485/USS11) at the same time, as they actually use the same transmission line. Communication takes place on the master-slave principle, where the higher level controller (PC, PLC, IPC) acts as the master with the servo controller taking the function of the slave. This means that the drive does not initiate any send activities itself, but merely responds to enquiries from the master. The master always has control of the communications link. The standard interface and the RS-232 interface on the AIO11 are independent of each other and have equal status. This means that if an axis module parameters set through both interfaces at the same time, the value that was sent last will be the one that is effective. 2.1 Execution principles of the communications protocol The protocol which has been implemented was designed with regard to the following conditions:
q q q q

Shortest possible message lengths to achieve short response times Low implementation requirements and ease of portability to other systems Transmission of unit-independent data formats Limitation of data integrity in favour of fast protocol execution ability to increase amount of data to be transmitted to accommodate the expected functional enhancement of the unit Acyclic, acknowledged data traffic to minimize time-related demands on the drive.

q

Figure 2 illustrates the execution principles of the communications protocol of the serial interfaces. Seven different message types (frames) are used: ­ ENQUIRY Request a parameter value ­ DATA Acknowledgement with parameter value ­ LONG_DATA Acknowledgement with "long" parameter value (8 bytes) ­ SELECT Write a parameter value ­ LONG_SELECT Write a "long" parameter value (8 bytes) ­ ACK (ACKNOWLEDGE) Acknowledgement "understood" ­ NACK (NOT ACKNOWLEDGE) Acknowledgement "not understood" An individual parameter is addressed using the index assigned to it. This assignment is dealt with in the document entitled "MOVIDYN® Parameter List". The messages are described in detail in the following. The message format is identical for both serial interfaces.

6

MOVIDYN ® Communications Interfaces


Function of the interfaces

MASTER

SLAVE 1 SELECT/ LONG_SELECT 1. Send a parameter from the master to the slave 2. Acknowledge error-free receipt of the SELECT frame 2a ACK 2a. Error-free value transferred to system memory or 2b. Value was not accepted for some reason

2b NACK

3

ENQUIRY

3. Request a value from the slave 4. Send the requested value to the master

LONG_DATA/ 4 DATA 5 NACK

or 5. Negative acknowledgement of request (e.g. index cannot be assigned to any parameter).

Figure 2: The various message types in the protocol

00212AEN

2.1.1

Description of MOVIDYN® message types

Frame identifier

Frame identifier

Unit address

Unit address

Index of parameters

Index

Value

Value

Return code

RC

Checksum
Figure 3: MOVIDYN
®

CS
0183AEN

message components

MOVIDYN ® Communications Interfaces

7


Function of the interfaces
Frame identifier: Identifies whether the data sent is intended for the open- and closed-loop control system of the MOVIDYN® or applies to the API/APA. For data to/from MOVIDYN® the value is: 85 H (hexadecimal) for ENQUIRY frame A9 H (hexadecimal) for SELECT frame C8 H (hexadecimal) for DATA frame D2 H (hexadecimal) for ACK frame F3 H (hexadecimal) for NACK frame CA H (hexadecimal) for LONG_DATA frame AD H (hexadecimal) for LONG_SELECT frame BB H (hexadecimal) for API/APA frame (see Section 2.1.3) Unit address: This identifies the servo module for which the sent message is intended within an axis system. The unit address can be set at each axis module via the S1 pushbutton on the front (see MOVIDYN® Installation and Operating Instructions). Max. number of components that can be connected: 31 MKS... (compact servo controllers) 8 MPx... (power supply modules) with 23 MAS... (axis modules) Value range: 0..5910 Index: Contains a 16-bit number that specifies the requested parameter. The number is in hexadecimal format. Value: Contains the value of the parameter in the format specified in the parameter list. Return code (RC): The return code indicates the cause of an error in coded form. See the Appendix for table of possible return codes. Checksum (CS): This byte is used to check the data integrity of all the data in a frame. The checksum is the sum of all the transmitted bytes. The result then just shows the low byte.

2.1.1.1 ENQUIRY frame: The higher-level control system sends this frame to the servo controller to read parameter encoded in the index. Following error-free receipt, the servo controller DATA frame. In the case of an error, it returns a NACK frame with the appropriate unique relationship between index and parameter is described in the "MOVIDYN®

the value of the responds with a return code. The Parameter List".

Frame identifier

Unit address

Index

CS
00184AEN

8

MOVIDYN ® Communications Interfaces


Function of the interfaces
2.1.1.2 DATA frame: The MOVIDYN® uses this frame to send the requested data in response to a request (ENQUIRY frame) from the master.
Frame identifier

Index

Value

CS
00186AEN

2.1.1.3 LONG_DATA frame: The MOVIDYN® uses this frame to send the requested data in 8-byte format in response to a request (ENQUIRY frame) from the master. Parameters returned in this format are specially marked in the "MOVIDYN® Parameter List".
Frame identifier

Index

Value

CS
00213AEN

2.1.1.4 SELECT frame: The higher-level control system sends this frame to the servo controller to overwrite a parameter in the unit. After successful receipt, the MOVIDYN® responds with an ACK frame or, in the case of an error, with a NACK frame.
Frame identifier Unit address

Index

Value

CS
00185AEN

2.1.1.5 LONG_SELECT frame: The higher-level control system sends this frame to the servo controller to overwrite an 8-byte parameter in the unit. After successful receipt, the MOVIDYN® replies with an ACK frame or, in the case of an error, with a NACK frame. The 8-byte parameters are specially marked in the "MOVIDYN® Parameter List".
Frame identifier Unit address

Index

Value

CS
00214AEN

2.1.1.6 ACK frame: The servo controller uses this frame to acknowledge error-free receipt of the SELECT or LONG_SELECT frame.
Frame identifier

CS
00187EN

2.1.1.7 NACK frame: This frame is used by the servo controller following receipt of a SELECT, LONG_SELECT or ENQUIRY frame to inform the higher-level control system that the requested service could not be carried out.
Frame identifier

RC

CS
00188EN

MOVIDYN ® Communications Interfaces

9


Function of the interfaces
List of possible return codes in the MOVIDYN® NACK frame Description . . . . . . . . . . . . . . Return code value Illegal index . . . . . . . . . . . . . . . . . . . . . . . . . . . Function, parameter not implemented . . . . . . . . . . . . . . Read access only . . . . . . . . . . . . . . . . . . . . . . . . Parameter lock activated . . . . . . . . . . . . . . . . . . . . Factory setting running . . . . . . . . . . . . . . . . . . . . . Parameter value too large . . . . . . . . . . . . . . . . . . . . Parameter value too small . . . . . . . . . . . . . . . . . . . . Necessary option pcb for function or parameter not installed . . Fault in system software . . . . . . . . . . . . . . . . . . . . . Parameter protected from access *) . . . . . . . . . . . . . . End stage is not blocked . . . . . . . . . . . . . . . . . . . . . Invalid parameter value . . . . . . . . . . . . . . . . . . . . . (hexadecimal) . . . . . . 10 . . . . . . 11 . . . . . . 12 . . . . . . 13 . . . . . . 14 . . . . . . 15 . . . . . . 16 . . . . . . 17 . . . . . . 18 . . . . . . 1B . . . . . . 1C . . . . . . 1D

*) An index used internally by SEW has been requested, same effect as code 10. 2.1.2 Application examples The following examples illustrate the execution sequence of the protocol and the use of the associated frames. 2.1.2.1 Reading the heat sink temperature of the axis module The application program installed on a PLC is required to evaluate the heat sink temperature of the axis module with the address 12 for safety purposes. The address has previously been set using the pushbutton on the front of the module.

B5 Byte 0

16

0C 1

16

00 2

16

03 3

16

C4 4

16

00189AXX

The PLC (master) sends Frame identifier: Address of axis module: Index: Checksum:

an ENQUIRY frame with the following format: B5 (identifier for ENQUIRY frame) 0C (0C hex = 12 decimal) 00 03 (0003 = heat sink temperature) C4 (B5 + 0C + 00 + 03 = C4)

After error-free receipt of the ENQUIRY frame, the MOVIDYN® replies with a DATA frame containing the value for the heat sink temperature (25.5 °C)

C8 Byte 0

16

00 1

16

03 2

16

00 3

16

00 4

16

25 5

16

50 6

16

40 7

16

00190AXX

Frame identifier: Index: Value: Checksum:

C8 00 00 40

(identifier for DATA frame) 03 (0003 = heat sink temperature) 00 25 50 = 25.50 °C (C8 + 00 + 03 + 00 + 00 + 25 + 50 = 0140)

10

MOVIDYN ® Communications Interfaces


Function of the interfaces
2.1.2.2 Writing ramp 1 to CW The PLC is required to set the time for the 1st acceleration ramp (CW) to a value of 3.7 seconds. The following SELECT frame must be sent to the servo controller for this purpose:
A9 Byte 0 0C 1 00 2 1F 3 00 4 00 5 03 6 70 7 4716 8
00191AXX

16

16

16

16

16

16

16

16

Frame identifier: Address of axis module: Index: Value: Checksum:

A9 0C 00 00 47

(identifier for SELECT frame) (0C hex = 12 decimal) 1F (001F = 31 decimal = ramp 1 to CW) 00 03 70 = 3.7 sec (A9 + 0C + 00 + 1F + 00 + 00 + 03 + 70 = 0147)

The servo controller acknowledges error-free transfer of the value to the system memory with an ACK frame.
D2 1
00192AXX

D2 Byte 0

16

16

Frame identifier: Checksum:

D2 (identifier for ACK frame) D2

2.1.2.3 Writing an IPOS variable (only with IPOS option) The PLC is required to write IPOS variable 5 with a value of 123000 decimal = 1E078 hexadecimal to the unit with address 1. This requires the following sequence: 1. Write number of variable (5) to index 715 (data pointer). This selects variable 5 for the next write or read operations. Index 715 (= 02CB hex) must be written by a SELECT frame:

A9 Byte 0

16

01 1

16

02 2

16

CB 3

16

00 4

16

00 5

16

05 6

16

00 7

16

7C16 8
00215AXX

Frame identifier: Address of axis module: Index: Value: Checksum:

A9 (identifier for SELECT frame) 01 02CB (02CB hex = 715 decimal / index 715: data pointer) 00 00 05 00 (variable 5) 7C (A9 + 01 + 02 + CB + 00 + 00 + 05 + 00 = 017C)

2. Axis 1 acknowledges error-free transfer with an ACK frame.
D2 Byte 0 D2 1
00192AXX

16

16

Frame identifier: Checksum:

D2 (identifier for ACK frame) D2

MOVIDYN ® Communications Interfaces

11


Function of the interfaces
3. Write value of variable (123000 decimal = 1E078 hexadecimal) to index 1011 (data value). Index 1011 (= 03F3 hex) must be written by a LONG_SELECT frame:
AD16 Byte 0 01 1 03 2 F3 3 0016 0016 0016 0116 0E16 0016 0716 0816 4 5 6 7 8 9 10 11 C216 12
00216AXX

16

16

16

Frame identifier: Index: Value: Checksum:

AC 03 00 C2

(identifier for LONG_SELECT frame) F3 (03 F3 hex = 1011 decimal / index 1011: data value) 00 00 01 0E 00 07 08 (1E078 hex = 123000) (00 + 00 + 00 + 01 + 0E + 00 + 07 + 08 = C2)

4. Axis 1 acknowledges error-free transfer with an ACK frame.
D2 Byte 0 D2 1
00192AXX

16

16

Frame identifier: Checksum:

D2 (identifier for ACK frame) D2

Variable 5 has now been assigned the value 123000.

2.1.2.4 Reading an IPOS variable (only with IPOS option) The PLC is required to read the value of IPOS variable 5 (axis address 1) This requires the following sequence: 1. Write number of variable (5) to index 715 (data pointer). This selects variable 5 for the next write or read operations. Index 715 (= 02CB hex) must be written by a SELECT frame: Frame identifier: A9 (identifier for SELECT frame)
A9 Byte 0
16

01 1

16

02 2

16

CB 3

16

00 4

16

00 5

16

05 6

16

00 7

16

7C16 8
00215AXX

Address of axis module: 01 Index: 02CB (02 CB hex = 715 decimal / index 715: data pointer) Value: 00 00 05 00 (variable 5) Checksum: 7C (A9 + 01 + 02 + CB + 00 + 00 + 05 + 00 = 017C) 2. Axis 1 acknowledges error-free transfer with an ACK frame.
D2 Byte 0 D2 1
00192AXX

16

16

Frame identifier: Checksum:

D2 (identifier for ACK frame) D2

12

MOVIDYN ® Communications Interfaces


Function of the interfaces
3. Request value of previously determined variable 5 from index 1011 (data value). An ENQUIRY frame is used for this purpose (1011 dec = 03F3 hex):
B5 Byte 0 01 1 03 2 F3 3 AC 4
00217AXX

16

16

16

16

16

Frame identifier: Address of axis module: Index: Checksum:

B5 (identifier for ENQUIRY frame) 01 03 F3 (03 F3 hex = 1011 decimal / index 1011: data value) AC (B5 + 01 + 03 + F3 = 01AC)

4. Axis 1 replies with a LONG_DATA frame containing the value of variable 5 as 1E078 hexadecimal = 123000 decimal:
AC Byte 0
16

03 1

16

F3 2

16

0016 0016 0016 0116 0E16 0016 0716 0816 3 4 5 6 7 8 9 10

C016 11
00218AXX

Frame identifier: Index: Value: Checksum:

AC 03 00 C0

(identifier for LONG_DATA frame) F3 (03 F3 hex = 1011 decimal / index 1011: data value) 00 00 01 0E 00 07 08 (1E078 hex = 123000 decimal) (00 + 00 + 00 + 01 + 0E + 00 + 07 + 08 = 01C0)

2.1.3 Description of message types for API / APA The protocol for API/APA parameter adjustment is an ASCII protocol as far as the presentation of the user data is concerned. A message sent to API/APA consists of a frame header and the subsequent data for the positioning module.
Frame identifier

Unit
address

Status byte

Data length

SB

NL

User data

CS
00193AEN

Frame header

Positioning module data

The frame header is identical for all message types. Frame identifier: Shows whether the data sent is meant for the open- and closed-loop control system of the MOVIDYN or applies to the API/APA. For data to/from API/APA, this value is: BB (hexadecimal).
®

Unit address: This identifies which servo module within an axis system the message is destined for, or from which module the message originates. The reference address is set on each axis module using the S1 pushbutton on the front (see MOVIDYN® Installation and Operating Instructions). Value range: 0..5910 Status byte (SB): The status byte controls the data transmission between the higher-level control system and the API/APA. Figure 4 describes the format of the status byte. The status byte is bit-mapped.

MOVIDYN ® Communications Interfaces

13


Function of the interfaces
Description of the bits in the status byte: Bit 0: This indicates whether the message is a request message (ENQUIRY frame) or a data transmission message (SELECT frame). Request messages require acknowledgement in the form of the requested data or a NACK frame. Data transmission messages are only acknowledged with an ACK frame for successful transmission or a NACK frame if the transmission contained an error. The response on receipt of a NACK frame is determined by the user. Bit 1: Not used. Bit 2: Reserved. Bit 3: This bit indicates whether or not the data transmission is to be acknowledged with an ACK or a NACK frame resp. This only applies to data transmission messages (SELECT frames). Bit 4: From firmware version V2.0, the checksum can be calculated including the axis address by setting bit 4. Bit 5: With bit 5 = 1, the calculation of the checksum is shortened by the most significant bit. The range of values then is 0 to 7F. This measure is necessary because certain values used for the checksum were evaluated as the start byte of a new data transmission and this led to collisions on the bus. This bit is no longer relevant from IPOS V.71 and system V.15.

Bit

7

6

5

4

3

2

1

0 0: Data message 1: Request message Not used 0: Single / last block 1: Further blocks to come 0: No ACK / NACK requested 1: ACK / NACK requested
Firmware version V2.0 and higher

0: Checksum without axis address 1: Checksum with axis address
Firmware version V2.01 and higher

0: Checksum from 0..FF 1: Checksum from 0...7F
Figure 4: Format of the status byte
00194AEN

14

MOVIDYN ® Communications Interfaces


Function of the interfaces
Data Length (NL): This byte contains the number of user data bytes including the checksum byte CS. The status byte and the data length byte are not included. The data length is in hexadecimal format. User data: The commands in ASCII format contained in the manual constitute the user data. Checksum (CS): This byte is used to check the integrity of all the data in a frame. The checksum byte is obtained from the following: CS = status byte (SB) + data length (NL) + sum of user data bytes If bit 4 is set in the status byte: CS = axis address + status byte (SB) + data length (NL) + sum of user data bytes The bytes are added byte by byte, ignoring the carry digits. 2.1.3.1 ENQUIRY frame: This type of message is used to request data from the API/APA. For example, the value of a variable is to be requested from the API. The required command is contained in the user manual and is as follows: %RD H00: read the contents of variable H00 A request message with the following format is to be sent:

BB16 0016 0116 0716 '%' 'R'
Frame header

'D'

'H'

'0'

'0' 6B16
Checksum

Command in ASCII Length = 7 bytes Request

00195AEN

Note: It is not necessary to insert a space between `D' and `H'. 2.1.3.2 SELECT frame: Data can be transmitted to the API/APA with this message type. For example, a variable in the API/APA is to be assigned the value 10. The command for this is: %H00:10 ; set variable H00 = 10 A data transmission message in the following format is required:

BB16 0016 0816 0816 '%' 'H'
Frame header

'0'

'0'

':'

'1'

'0' 7816
Checksum

Command in ASCII Length = 8 bytes Data transmission, ACK requested

00196AEN

MOVIDYN ® Communications Interfaces

15


Function of the interfaces
The SELECT frame is either acknowledged with an ACK frame for successful data transmission, or a NACK frame for an abortive transfer, depending on the status byte condition. 2.1.3.3 DATA frame The API/APA acknowledges a correct request with a reply message, which basically has the following format, but may differ in the user data according to the requested value:

BB16 0016 0016 0816 '%' 'H'
Frame header

'0'

'0'

':'

'1' '0' 7016
Checksum

Content of H00 in ASCII Length = 8 bytes Reply identifier

00197AEN

An incorrect request will be acknowledged by a NACK frame. The user must extract the frame header, status byte, length byte and checksum from the data to obtain the user data in ASCII format. 2.3.1.4 ACK frame: The API/APA acknowledges successful data transmission on receipt of a SELECT frame with an ACK frame with the following format:

BB16 0016 0016 0216 0610 0816
Frame header ACK Length = 2 bytes
00198AEN

Checksum

The value for ACK = 0610. 2.3.1.5 NACK frame: If the data transmission contains errors (noise on the data line, syntax errors etc.) the API/APA acknowledges a request message or an incorrect SELECT frame with a NACK frame as shown below:

16

MOVIDYN ® Communications Interfaces


Function of the interfaces

BB16 0016 0016 0F
Frame header

16

1516 '3'

'\'

'9'

'3'

'\'

'1'

'\'

'1'
Sequential program no. Error identifier Error no. Error type

NACK Length = 15 bytes

Reply identifier

'\'

'1'

'0'

'\'

'0' 8316

Checksum Line no. sequential program
00199AEN

The value for NACK = 1516. In addition to the number of the data transmission error, the NACK frame also contains the program number currently selected and the program line number of the application program in use in the API/APA, which was processed at the time the error was reported. If the API/APA is not in automatic mode, both the program and line numbers will be transmitted as "- -" or "- - -". The error type parameter indicates whether the error was a syntax error or an asynchronous error: Error type = 3: syntax error Error type = 4: asynchronous error The error identifier parameter indicates whether the error acknowledged by the NACK frame was a minor error that does not require resetting, or whether a reset must be initiated with the %RES command: Error identifier = 0: no error present Error identifier = 1: error, but no reset necessary Error identifier 2: error; reset via % RES necessary

MOVIDYN ® Communications Interfaces

17


Function of the interfaces
2.1.3.6 Application example: Reading the API/APA status Error messages that occur asynchronously can be displayed by requesting the API/APA status. To request the status, a message containing the command "?" is sent to the API/APA.

BB16 0116 1116 0216 "?" 5316
Checksum "Request status" identifier Length = 2 bytes Include request message and axis address in checksum calculation Axis address Frame header
00227AEN

Format of the response string in response to an "?" API status request:

BB16 0016 0016 2316 'G' '1'

'2'

'3'

'H'

'1' '2'

'3'

'O'

'0'

'I'

'0'

'6'

'4'

'4' 'J'

'1'

'0'

'0' 'K'

'1'

'E'

'0'

'C'

'L'

'F'

'0'

'M' '0'

'N'

'1'

'0' 'P'

'0' CF16
00200AEN

The response message contains the following status messages in ASCII format: G... H... 0... I... J... K... L... M... N... P... Actual position (decimal) Target position (decimal) Lag error (decimal) Status of positioning processor in the API/APA (hexadecimal, 4-digit) Override (decimal) Status of digital inputs (hexadecimal, 4-digit) Status of digital outputs (hexadecimal, 2-digit) Currently active program no. (decimal) Current line number (decimal) Status of hardware limit switches (decimal, 1-digit) where 0 = no limit switch closed 1 = positive limit switch closed 2 = negative limit switch closed 3 = both limit switches closed
MOVIDYN ® Communications Interfaces

18


Function of the interfaces
Firmware version 2.0 and higher, the process data can also be called up separately. Example: ?G request actual position only:

BB16 0116 1116 0316 "?"
Frame header

"G" 9B16
Checksum "G" "?"
00228AEN

Note: If the API/APA is not automatic mode, hyphens are entered for the program and program line numbers as shown below: Program number: `M' `-' `-' Line number: `N' `-' `-' `-' If there is an error in the API/APA, the sequence shown below is included in the response message. An error sequence is inserted after the limit switch status data. The last character always represents the checksum. Error sequence: `Z' a `\' b `\' c `\' d `\' e `\' f Meaning: `Z' = Identifier for error string a = Error identifier b = Error number c = Error type d = 1st parameter (current program number in automatic mode, otherwise set to `0') e = 2nd parameter (current line number in automatic mode, otherwise set to `0') f= 3rd parameter (always 0) The individual parameters are separated by the backslash `\' character. Appendix 2 contains a list of all the error messages that may occur.

MOVIDYN ® Communications Interfaces

19


RS-232 interfaces 3 RS-232 interfaces

3.1 Technical data of the RS-232 interfaces q Standard: DIN 66020 (V.24)
q q q q q q q

Baud rate Start bits: Stop bits: Data bits: Parity: Data direction: Operating mode:

9600 baud 1 start bit 1 stop bit 8 data bits None Bidirectional Simplex, asynchronous

3.2 Connection to the RS-232 interface The connection to the RS-232 serial interface on the units is made via a 4-core screened cable, the screen being connected to ground at one end only. The unit interfaces X01 and X11 are provided as 9-pin type D connectors, only 4 connections (pins 2-5) being used. The remaining connections are blank. Figure 5 shows a schematic of the connector pinout. Connection 2 and pin 3 are the data lines. The PC controls the send direction of the data on the subsequent RS-485 cable via pin 4. Pin 5 is the ground connection for the units. MOVIDYN servo controller GND DTR RxD TxD DTR TxD RxD 9-pin socket Important: Pins 2 and 3 are reversed in the case of the connector

PC, PLC etc.

1 6 9

5

1 6 9

5

9-pin connector DTR RxD TxD

GND DTR TxD RxD 25-pin socket

1 6 9

5

1 14 25

13

All details given for connectors/sockets refer to the cable end.
Figure 5: RS-232 connector pinout
00178BEN

20

MOVIDYN ® Communications Interfaces


RS-485 interfaces 4 RS-485 interfaces

4.1 Technical data of the RS-485 interfaces q Standard: RS-485
q q q q q q q

Baud rate: Start bits: Stop bits: Data bits: Parity: Data direction: Operating mode:

9600 baud 1 start bit 1 stop bit 8 data bits None Bidirectional Half duplex, asynchronous

4.2 Connection to the RS-485 interface The RS-485 interface is connected to the power supply module / compact servo controller using pins 1, 2, 3 on the appropriate terminal block. This interface should be used if the distance between the higher-level control system and the drive unit is greater than 5 m, as the susceptibility to interference of the RS-485 interface is considerable less than that of an RS-232 interface due to transmission of differential clock signals. However, in this case the higher-level control system must have an RS-485 output (e.g. plug-in card, RS-485 adapter). A twisted, shielded two-wire cable is used as transmission medium. The cable is connected to pins 1 and 2 of each terminal block and the shield is connected to pin 3. The polarity of the connections to pins 1 and 2 must be observed with respect to the connections to the higher-level control system. Figure 6 shows the connection to the RS-485 interface of the various servo controllers.
Twisted, shielded two-wire cable
+Ud

Shield

MPB...

1 -Ud 2 3 4 5 6 Terminal X02

1 -Ud 2 3 Shield 4 5 MKS... 6 Terminal X41

+Ud

+Ud

-Ud
Shield

1 2 3 Terminal X02

MPR...
00219AEN

Figure 6: RS-485 connection to MPB..., MKS... and MPR..

Important: If the RS-485 interface is used, the RS-232 interface on the MPB... or via USS11 on the MPR... or MKS... may not be used at the same time. For control of the send direction of the data, please refer to the technical specification of the particular RS-485 connection to the higher-level control system.

MOVIDYN ® Communications Interfaces

21


Direction of communication 5 Control of the direction of communication on the serial interfaces

In controlling the data direction on the serial interfaces, certain peripheral conditions must be observed concerning the timing sequence. As can be seen from Figure 1, the axis modules are connected to each other via an RS-485 link. The link between the RS-485 and RS-232 level is via two servo converters. As the RS-485 interface operates in simplex mode, a bus station must always reverse the data direction for sending and receiving. Control of the send direction is handled by a signal of the sender's serial interface; this signal is given the name DTR in accordance with the RS-232 standard. Figure 7 shows the timing sequence for switching the DTR signal when sending and receiving data via an RS-232 interface in a timing diagram. Important: The signals in Figure 7 are shown with the signal levels of the RS-232 interface (± 10 V). The valid levels for control signals are: TTL 0 1 RS-232 -10 V +10 V

For design reasons, the switching of the DTR signal differs for the various servo controllers:
Servo controller MPB MPR, MKS with FIS31 (Part no. FIS31: 821 595 2.10) MPR, MKS with FIS31 (Part no. FIS31: 821 595 2.11/2.12) MPR, MKS with USS11 DTR Handling DTR switched DTR switched DTR not switched, but DTR permanently at "1" level (+10V) DTR not required USS11 reverses data direction automatically Remarks

Table 1: Method of handling the DTR signal for the various servo controllers

22

MOVIDYN ® Communications Interfaces


Direction of communication

Axis module set to "RECEIVE"
+10 V

Axis module set to "TRANSMIT"

Signal DTR
-10 V

t

2 ms minimum TxD von PC, SPS etc.
+10 V

t -10 V

PC sending data MOVIDYN response time adjustable via parameter P660

RxD von PC, SPS etc.

+10 V

-10 V

Axis module sending response

t

Figure 7: Signal level on the interface lines

00182BEN

Operational sequence description: a) The DTR signal must be switched to send at least 2ms before starting to transmit the send data. b) After transmission of the data (send buffer empty), the DTR signal is switched back to receive after a delay of at least 1ms. This time is the time taken to send one byte and ensures that the last bits of the final byte of an ongoing transmission are actually transmitted. To simplify the link-up to a PLC, it is possible to program a minimum delay time in the MOVIDYN® that must elapse before a servo controller responds. To do this, the 07SO